feat(Mathlib/Data/Finite/Option): option type is finite iff type is finite - #39567
AlexBrodbelt wants to merge 11 commits into
Conversation
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary e6a4467394Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
Hi @AlexBrodbelt, are you still working on this? No pressure of course! |
felixpernegger
left a comment
There was a problem hiding this comment.
Maybe also include the same thing for Infinite?
Also, would proving the result for Countable and Uncountable here cause issues?
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Data.Finite.Defs |
There was a problem hiding this comment.
| public import Mathlib.Data.Finite.Defs | |
| public import Mathlib.Data.Finite.Defs | |
There was a problem hiding this comment.
The change you are proposing leaves it unchanged?
There was a problem hiding this comment.
no; it adds an empty line between public and private imports; which is the convention
There was a problem hiding this comment.
ah okay, will keep that in mind. thanks!
There was a problem hiding this comment.
Regarding the analogous Countable and Uncountable results. Maybe a new file or even folder should be made? For now I will push including the Infinite case and work on the remaining cases on another branch
There was a problem hiding this comment.
yeah maybe, but at the same time 30 lines files are a bit unfortunate imo
|
Please "resolve conversation" when you've addressed the comments, and then when you're ready for another review please comment Also, you'll probably need to merge master in order to fix the CI error. |
|
|
||
| public section | ||
|
|
||
| /-- `Option α` is finite if and only if the underlying type `α`is finite. -/ |
There was a problem hiding this comment.
| /-- `Option α` is finite if and only if the underlying type `α`is finite. -/ | |
| /-- `Option α` is finite if and only if the underlying type `α` is finite. -/ |
|
-awaiting-author |
themathqueen
left a comment
There was a problem hiding this comment.
I think you should probably move this file to Basic/Finite?
| /-- `Option α` is infinite if and only if the underlying type `α` is infinite. -/ | ||
| @[simp] | ||
| theorem Option.infinite_iff {α : Type*} : Infinite (Option α) ↔ Infinite α := by | ||
| rw [← not_finite_iff_infinite, ← not_finite_iff_infinite, Option.finite_iff] |
There was a problem hiding this comment.
| rw [← not_finite_iff_infinite, ← not_finite_iff_infinite, Option.finite_iff] | |
| simp [← not_finite_iff_infinite] |
| mp | ||
| | @Finite.intro _ 0 e => (e none).elim0 | ||
| | @Finite.intro _ (n + 1) e => ⟨(e.trans (finSuccEquiv n)).removeNone⟩ |
There was a problem hiding this comment.
| mp | |
| | @Finite.intro _ 0 e => (e none).elim0 | |
| | @Finite.intro _ (n + 1) e => ⟨(e.trans (finSuccEquiv n)).removeNone⟩ | |
| mp _ := .of_injective _ (Option.some_injective α) |
|
Or actually, why not just add these results to |
Option type is finite if and only if the type is finite.
This is an intermediate result to proving that if the
GroupWithZerois (in)finite then theUnitsare (in)finite.