Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
38fe3ed
added finiteness conditions to option type
AlexBrodbelt Apr 22, 2026
53ac572
feat(Mathlib/Data/Finite/Option): option type is finite iff type is f…
AlexBrodbelt May 19, 2026
50129d7
feat(Mathlib/Data/Finite/Subtype): Subtype of elements not equal to a…
AlexBrodbelt May 19, 2026
b7c246a
feat(Mathlib/Data/Finite/Units): Units are (in)finite if type is (in)…
AlexBrodbelt May 19, 2026
9a37537
remove min imports command
AlexBrodbelt May 19, 2026
3ca377b
remove min import command
AlexBrodbelt May 19, 2026
99baf79
add new file to Mathlib.lean
AlexBrodbelt May 19, 2026
a88c8cc
added docstrings and comments to files
AlexBrodbelt May 19, 2026
3332946
feat(Mathlib/Data/Finite/Subtype): Subtype of elements not equal to a…
AlexBrodbelt May 19, 2026
0f8f385
remove min imports command
AlexBrodbelt May 19, 2026
0fcbb1c
add file to Mathlib.lean and add docstrings
AlexBrodbelt May 19, 2026
c078728
added docstrings
AlexBrodbelt May 19, 2026
63c5a98
feat(Mathlib/Data/Finite/Units): Units are (in)finite if type is (in)…
AlexBrodbelt May 19, 2026
7d2de66
added file to Mathlib.lean and added docstrings
AlexBrodbelt May 19, 2026
2f03cfa
added docstrings and fixed some styling
AlexBrodbelt May 19, 2026
7531e4e
follow modifications from review
AlexBrodbelt May 19, 2026
81b6c46
feat(Mathlib/Data/Finite/Subtype): Subtype of elements not equal to a…
AlexBrodbelt May 19, 2026
bba1100
remove min imports command
AlexBrodbelt May 19, 2026
f4297c9
add file to Mathlib.lean and add docstrings
AlexBrodbelt May 19, 2026
bb97a2a
fix typos and styling
AlexBrodbelt May 19, 2026
b74f87e
fix typose and styling
AlexBrodbelt May 19, 2026
8fa788b
fix typos and styling
AlexBrodbelt May 19, 2026
a5555b7
remove finite instance
AlexBrodbelt May 19, 2026
a2b75c1
feat(Mathlib/Data/Finite/Units): Units are (in)finite if type is (in)…
AlexBrodbelt May 19, 2026
2d1668f
added file to Mathlib.lean and added docstrings
AlexBrodbelt May 19, 2026
141d918
remove finite instance
AlexBrodbelt May 19, 2026
578a9c2
fix typo
AlexBrodbelt May 19, 2026
0628928
fix typo
AlexBrodbelt May 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3820,11 +3820,14 @@ public import Mathlib.Data.FinEnum
public import Mathlib.Data.FinEnum.Option
public import Mathlib.Data.Finite.Card
public import Mathlib.Data.Finite.Defs
public import Mathlib.Data.Finite.Option
public import Mathlib.Data.Finite.Perm
public import Mathlib.Data.Finite.Prod
public import Mathlib.Data.Finite.Set
public import Mathlib.Data.Finite.Sigma
public import Mathlib.Data.Finite.Subtype
public import Mathlib.Data.Finite.Sum
public import Mathlib.Data.Finite.Units
public import Mathlib.Data.Finite.Vector
public import Mathlib.Data.Finmap
public import Mathlib.Data.Finset.Attach
Expand Down
23 changes: 23 additions & 0 deletions Mathlib/Data/Finite/Option.lean
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⟩
20 changes: 20 additions & 0 deletions Mathlib/Data/Finite/Subtype.lean
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]
29 changes: 29 additions & 0 deletions Mathlib/Data/Finite/Units.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/-
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.Algebra.GroupWithZero.Units.Equiv
public import Mathlib.Data.Finite.Subtype

/-!
# `Finite`ness conditions for `Units` of `GroupWithZero`
-/

public section

/-- `Units` of a `GroupWithZero` are finite if and only if the `GroupWithZero` is finite. -/
@[simp]
theorem Units.finite_iff₀ {G : Type*} [GroupWithZero G] : Finite Gˣ ↔ Finite G := by
rw [unitsEquivNeZero.finite_iff, Subtype.finite_ne_iff]

/-- `Units` of a `GroupWithZero` are infinite if and only if the `GroupWithZero` is infinite. -/
@[simp]
theorem Units.infinite_iff₀ {G : Type*} [GroupWithZero G] : Infinite Gˣ ↔ Infinite G := by
simpa only [not_finite_iff_infinite] using Units.finite_iff₀ (G := G).not

/-- If a `GroupWithZero` is infinite then its `Units` are finite. -/
instance {G : Type*} [GroupWithZero G] [hG : Infinite G] : Infinite Gˣ :=
Units.infinite_iff₀.2 ‹_›
Loading