Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3820,6 +3820,7 @@ 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
Expand Down
24 changes: 24 additions & 0 deletions Mathlib/Data/Finite/Option.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/-
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.Defs
import Mathlib.Data.Fintype.Option
import Mathlib.Logic.Equiv.Fin.Basic

/-!
# Finiteness conditions for `Option` types

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Finiteness conditions for `Option` types
# Finiteness conditions for `Option` types
This file shows that `Option α` is finite iff ` is.

-/

public section

/-- The `Option` type on a type is finite if and only if the underlying type is finite. -/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just

Suggested change
/-- The `Option` type on a type is finite if and only if the underlying type is finite. -/
/-- `Option α` 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⟩
Loading