-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(Mathlib/Data/Finite/Subtype): Subtype of elements not equal to a term is finite iff type is finite #39568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AlexBrodbelt
wants to merge
18
commits into
leanprover-community:master
Choose a base branch
from
AlexBrodbelt:AlexBrodbelt/Data/Finite/Subtype
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+45
−0
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
38fe3ed
added finiteness conditions to option type
AlexBrodbelt 53ac572
feat(Mathlib/Data/Finite/Option): option type is finite iff type is f…
AlexBrodbelt 50129d7
feat(Mathlib/Data/Finite/Subtype): Subtype of elements not equal to a…
AlexBrodbelt 9a37537
remove min imports command
AlexBrodbelt 3ca377b
remove min import command
AlexBrodbelt 99baf79
add new file to Mathlib.lean
AlexBrodbelt a88c8cc
added docstrings and comments to files
AlexBrodbelt 3332946
feat(Mathlib/Data/Finite/Subtype): Subtype of elements not equal to a…
AlexBrodbelt 0f8f385
remove min imports command
AlexBrodbelt 0fcbb1c
add file to Mathlib.lean and add docstrings
AlexBrodbelt c078728
added docstrings
AlexBrodbelt 7531e4e
follow modifications from review
AlexBrodbelt 81b6c46
feat(Mathlib/Data/Finite/Subtype): Subtype of elements not equal to a…
AlexBrodbelt bba1100
remove min imports command
AlexBrodbelt f4297c9
add file to Mathlib.lean and add docstrings
AlexBrodbelt bb97a2a
fix typos and styling
AlexBrodbelt b74f87e
fix typose and styling
AlexBrodbelt 8fa788b
fix typos and styling
AlexBrodbelt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /- | ||
| Copyright (c) 2026 Alex Brodbelt. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Alex Brodbelt, Eric Wieser | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Data.Fintype.Option | ||
| import Mathlib.Logic.Equiv.Fin.Basic | ||
|
|
||
| /-! | ||
| # Finiteness conditions for `Option` types | ||
| -/ | ||
|
|
||
| public section | ||
|
|
||
| /-- The `Option` type on a type is finite if and only if the underlying type is finite. -/ | ||
| @[simp] | ||
| theorem Option.finite_iff {α : Type*} : Finite (Option α) ↔ Finite α where | ||
| mpr _ := inferInstance | ||
| mp | ||
| | @Finite.intro _ 0 e => (e none).elim0 | ||
| | @Finite.intro _ (n + 1) e => ⟨(e.trans (finSuccEquiv n)).removeNone⟩ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /- | ||
| Copyright (c) 2026 Alex Brodbelt. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Alex Brodbelt, Eric Wieser | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Data.Finite.Option | ||
|
|
||
| /-! | ||
| # `Finite`ness conditions on subtypes | ||
| -/ | ||
|
|
||
| public section | ||
|
|
||
| /-- The subtype of terms not equal to a given term is finite if and only if the type is finite. -/ | ||
| @[simp] | ||
| theorem Subtype.finite_ne_iff {α : Type*} (a₀ : α) : Finite {a // a ≠ a₀} ↔ Finite α := by | ||
| classical | ||
| rw [← (Equiv.optionSubtypeNe a₀).finite_iff, Option.finite_iff] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this only imports the other new file, I wonder if you can just put the contents of this file together with the other and call the file something else that would make sense for both lemmas (maybe
Data/Finite/Subtypeis fine?)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen more
Option.leanfiles thanSubtype.leanmaybe better if it is namedData/Finite/Option.lean?