Built with doc-gen4, running Lean4. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓to navigate, Ctrl+🖱️to focus. On Mac, use Cmdinstead of Ctrl.
/-
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro

! This file was ported from Lean 3 source module data.fintype.option
! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Finset.Option

/-!
# fintype instances for option
-/


open Function

open Nat

universe u v

variable {
α: Type ?u.8616
α
β: Type ?u.3533
β
γ: Type ?u.8
γ
:
Type _: Type (?u.2694+1)
Type _
} open Finset Function
instance: {α : Type u_1} → [inst : Fintype α] → Fintype (Option α)
instance
{
α: Type ?u.20
α
:
Type _: Type (?u.20+1)
Type _
} [
Fintype: Type ?u.23 → Type ?u.23
Fintype
α: Type ?u.20
α
] :
Fintype: Type ?u.26 → Type ?u.26
Fintype
(
Option: Type ?u.27 → Type ?u.27
Option
α: Type ?u.20
α
) := ⟨
Finset.insertNone: {α : Type ?u.38} → Finset α ↪o Finset (Option α)
Finset.insertNone
univ: {α : Type ?u.217} → [inst : Fintype α] → Finset α
univ
, fun
a: ?m.272
a
=>

Goals accomplished! 🐙
α✝: Type ?u.11

β: Type ?u.14

γ: Type ?u.17

α: Type ?u.20

inst✝: Fintype α

a: Option α


a insertNone univ

Goals accomplished! 🐙
theorem
univ_option: ∀ (α : Type u_1) [inst : Fintype α], univ = insertNone univ
univ_option
(
α: Type u_1
α
:
Type _: Type (?u.2338+1)
Type _
) [
Fintype: Type ?u.2341 → Type ?u.2341
Fintype
α: Type ?u.2338
α
] : (
univ: {α : Type ?u.2348} → [inst : Fintype α] → Finset α
univ
:
Finset: Type ?u.2346 → Type ?u.2346
Finset
(
Option: Type ?u.2347 → Type ?u.2347
Option
α: Type ?u.2338
α
)) =
insertNone: {α : Type ?u.2389} → Finset α ↪o Finset (Option α)
insertNone
univ: {α : Type ?u.2568} → [inst : Fintype α] → Finset α
univ
:=
rfl: ∀ {α : Sort ?u.2685} {a : α}, a = a
rfl
#align univ_option
univ_option: ∀ (α : Type u_1) [inst : Fintype α], univ = insertNone univ
univ_option
@[simp] theorem
Fintype.card_option: ∀ {α : Type u_1} [inst : Fintype α], card (Option α) = card α + 1
Fintype.card_option
{
α: Type ?u.2703
α
:
Type _: Type (?u.2703+1)
Type _
} [
Fintype: Type ?u.2706 → Type ?u.2706
Fintype
α: Type ?u.2703
α
] :
Fintype.card: (α : Type ?u.2710) → [inst : Fintype α] →
Fintype.card
(
Option: Type ?u.2711 → Type ?u.2711
Option
α: Type ?u.2703
α
) =
Fintype.card: (α : Type ?u.2728) → [inst : Fintype α] →
Fintype.card
α: Type ?u.2703
α
+
1: ?m.2734
1
:= (
Finset.card_cons: ∀ {α : Type ?u.2798} {s : Finset α} {a : α} (h : ¬a s), Finset.card (cons a s h) = Finset.card s + 1
Finset.card_cons
(

Goals accomplished! 🐙
α✝: Type ?u.2694

β: Type ?u.2697

γ: Type ?u.2700

α: Type u_1

inst✝: Fintype α


¬none map Embedding.some univ

Goals accomplished! 🐙
)).
trans: ∀ {α : Sort ?u.2803} {a b c : α}, a = bb = ca = c
trans
<|
congr_arg₂: ∀ {α : Sort ?u.2828} {β : Sort ?u.2829} {γ : Sort ?u.2830} (f : αβγ) {x x' : α} {y y' : β}, x = x'y = y'f x y = f x' y'
congr_arg₂
_: ?m.2831?m.2832?m.2833
_
(
card_map: ∀ {α : Type ?u.2847} {β : Type ?u.2848} {s : Finset α} (f : α β), Finset.card (map f s) = Finset.card s
card_map
_: ?m.2849 ?m.2850
_
)
rfl: ∀ {α : Sort ?u.2859} {a : α}, a = a
rfl
#align fintype.card_option
Fintype.card_option: ∀ {α : Type u_1} [inst : Fintype α], Fintype.card (Option α) = Fintype.card α + 1
Fintype.card_option
/-- If `Option α` is a `Fintype` then so is `α` -/ def
fintypeOfOption: {α : Type u_1} → [inst : Fintype (Option α)] → Fintype α
fintypeOfOption
{
α: Type ?u.3539
α
:
Type _: Type (?u.3539+1)
Type _
} [
Fintype: Type ?u.3542 → Type ?u.3542
Fintype
(
Option: Type ?u.3543 → Type ?u.3543
Option
α: Type ?u.3539
α
)] :
Fintype: Type ?u.3546 → Type ?u.3546
Fintype
α: Type ?u.3539
α
:= ⟨
Finset.eraseNone: {α : Type ?u.3557} → Finset (Option α) →o Finset α
Finset.eraseNone
(
Fintype.elems: {α : Type ?u.3596} → [self : Fintype α] → Finset α
Fintype.elems
(α :=
Option: Type ?u.3597 → Type ?u.3597
Option
α: Type ?u.3539
α
)), fun
x: ?m.3604
x
=>
mem_eraseNone: ∀ {α : Type ?u.3609} {s : Finset (Option α)} {x : α}, x eraseNone s some x s
mem_eraseNone
.
mpr: ∀ {a b : Prop}, (a b) → ba
mpr
(
Fintype.complete: ∀ {α : Type ?u.3629} [self : Fintype α] (x : α), x Fintype.elems
Fintype.complete
(
some: {α : Type ?u.3632} → αOption α
some
x: ?m.3604
x
))⟩ #align fintype_of_option
fintypeOfOption: {α : Type u_1} → [inst : Fintype (Option α)] → Fintype α
fintypeOfOption
/-- A type is a `Fintype` if its successor (using `Option`) is a `Fintype`. -/ def
fintypeOfOptionEquiv: {α : Type u_1} → {β : Type u_2} → [inst : Fintype α] → α Option βFintype β
fintypeOfOptionEquiv
[
Fintype: Type ?u.3680 → Type ?u.3680
Fintype
α: Type ?u.3671
α
] (
f: α Option β
f
:
α: Type ?u.3671
α
Option: Type ?u.3685 → Type ?u.3685
Option
β: Type ?u.3674
β
) :
Fintype: Type ?u.3688 → Type ?u.3688
Fintype
β: Type ?u.3674
β
:= haveI :=
Fintype.ofEquiv: {β : Type ?u.3695} → (α : Type ?u.3694) → [inst : Fintype α] → α βFintype β
Fintype.ofEquiv
_: Type ?u.3694
_
f: α Option β
f
fintypeOfOption: {α : Type ?u.3734} → [inst : Fintype (Option α)] → Fintype α
fintypeOfOption
#align fintype_of_option_equiv
fintypeOfOptionEquiv: {α : Type u_1} → {β : Type u_2} → [inst : Fintype α] → α Option βFintype β
fintypeOfOptionEquiv
namespace Fintype /-- A recursor principle for finite types, analogous to `Nat.rec`. It effectively says that every `Fintype` is either `Empty` or `Option α`, up to an `Equiv`. -/ def
truncRecEmptyOption: {P : Type u → Sort v} → ({α β : Type u} → α βP αP β) → P PEmpty({α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)) → (α : Type u) → [inst : Fintype α] → [inst : DecidableEq α] → Trunc (P α)
truncRecEmptyOption
{
P: Type u → Sort v
P
:
Type u: Type (u+1)
Type u
Sort v: Type v
Sort
Sort v: Type v
v
} (
of_equiv: {α β : Type u} → α βP αP β
of_equiv
: ∀ {
α: ?m.3797
α
β: ?m.3800
β
},
α: ?m.3797
α
β: ?m.3800
β
P: Type u → Sort v
P
α: ?m.3797
α
P: Type u → Sort v
P
β: ?m.3800
β
) (
h_empty: P PEmpty
h_empty
:
P: Type u → Sort v
P
PEmpty: Sort ?u.3811
PEmpty
) (
h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)
h_option
: ∀ {
α: ?m.3815
α
} [
Fintype: Type ?u.3818 → Type ?u.3818
Fintype
α: ?m.3815
α
] [
DecidableEq: Sort ?u.3821 → Sort (max1?u.3821)
DecidableEq
α: ?m.3815
α
],
P: Type u → Sort v
P
α: ?m.3815
α
P: Type u → Sort v
P
(
Option: Type ?u.3832 → Type ?u.3832
Option
α: ?m.3815
α
)) (
α: Type u
α
:
Type u: Type (u+1)
Type u
) [
Fintype: Type ?u.3837 → Type ?u.3837
Fintype
α: Type u
α
] [
DecidableEq: Sort ?u.3840 → Sort (max1?u.3840)
DecidableEq
α: Type u
α
] :
Trunc: Sort ?u.3849 → Sort ?u.3849
Trunc
(
P: Type u → Sort v
P
α: Type u
α
) :=

Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α


Trunc (P α)
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α


Trunc (P α)
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))


P (ULift (Fin (card α)))Trunc (P α)
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))


Trunc (P α)
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))

h: P (ULift (Fin (card α)))


Trunc (P α)
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))


Trunc (P α)
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))

h: P (ULift (Fin (card α)))


α Fin (card α)P α
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))


Trunc (P α)
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))

h: P (ULift (Fin (card α)))

e: α Fin (card α)


P α
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: (n : ) → Trunc (P (ULift (Fin n)))


Trunc (P α)

Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α


Trunc (P α)

Goals accomplished! 🐙
where -- porting note: do a manual recursion, instead of `induction` tactic, -- to ensure the result is computable /-- Internal induction hypothesis -/
ind: (n : ) → Trunc (P (ULift (Fin n)))
ind
: ∀
n:
n
:
: Type
,
Trunc: Sort ?u.3873 → Sort ?u.3873
Trunc
(
P: Type u → Sort v
P
(
ULift: Type ?u.3874 → Type (max?u.3874?u.3875)
ULift
<|
Fin: Type
Fin
n:
n
)) |
Nat.zero:
Nat.zero
=>

Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α


α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α



Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α



Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α


α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: card PEmpty = card (ULift (Fin 0))


PEmpty ULift (Fin 0)Trunc (P (ULift (Fin zero)))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α


α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: card PEmpty = card (ULift (Fin 0))

e: PEmpty ULift (Fin 0)


α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α


α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

this: card PEmpty = card (ULift (Fin 0))

e: PEmpty ULift (Fin 0)


a
P (ULift (Fin zero))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α



Goals accomplished! 🐙
|
Nat.succ:
Nat.succ
n:
n
=>

Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


Trunc (P (ULift (Fin (succ n))))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


Trunc (P (ULift (Fin (succ n))))

Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


card (Option (ULift (Fin n))) = card (ULift (Fin (succ n)))

Goals accomplished! 🐙
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


Trunc (P (ULift (Fin (succ n))))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:

this: card (Option (ULift (Fin n))) = card (ULift (Fin (succ n)))


Option (ULift (Fin n)) ULift (Fin (succ n))Trunc (P (ULift (Fin (succ n))))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


Trunc (P (ULift (Fin (succ n))))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:

this: card (Option (ULift (Fin n))) = card (ULift (Fin (succ n)))

e: Option (ULift (Fin n)) ULift (Fin (succ n))


Trunc (P (ULift (Fin (succ n))))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


Trunc (P (ULift (Fin (succ n))))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:

this: card (Option (ULift (Fin n))) = card (ULift (Fin (succ n)))

e: Option (ULift (Fin n)) ULift (Fin (succ n))


P (ULift (Fin n))P (ULift (Fin (succ n)))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


Trunc (P (ULift (Fin (succ n))))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:

this: card (Option (ULift (Fin n))) = card (ULift (Fin (succ n)))

e: Option (ULift (Fin n)) ULift (Fin (succ n))

ih: P (ULift (Fin n))


P (ULift (Fin (succ n)))
α✝: Type ?u.3783

β: Type ?u.3786

γ: Type ?u.3789

P: Type u → Sort v

of_equiv: {α β : Type u} → α βP αP β

h_empty: P PEmpty

h_option: {α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)

α: Type u

inst✝¹: Fintype α

inst✝: DecidableEq α

n:


Trunc (P (ULift (Fin (succ n))))

Goals accomplished! 🐙
#align fintype.trunc_rec_empty_option
Fintype.truncRecEmptyOption: {P : Type u → Sort v} → ({α β : Type u} → α βP αP β) → P PEmpty({α : Type u} → [inst : Fintype α] → [inst : DecidableEq α] → P αP (Option α)) → (α : Type u) → [inst : Fintype α] → [inst : DecidableEq α] → Trunc (P α)
Fintype.truncRecEmptyOption
-- Porting note: due to instance inference issues in `SetTheory.Cardinal.Basic` -- I had to explicitly name `h_fintype` in order to access it manually. -- was `[Fintype α]` /-- An induction principle for finite types, analogous to `Nat.rec`. It effectively says that every `Fintype` is either `Empty` or `Option α`, up to an `Equiv`. -/ @[elab_as_elim] theorem
induction_empty_option: ∀ {P : (α : Type u) → [inst : Fintype α] → Prop}, (∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β) → P PEmpty(∀ (α : Type u) [inst : Fintype α], P αP (Option α)) → ∀ (α : Type u) [h_fintype : Fintype α], P α
induction_empty_option
{
P: (α : Type u) → [inst : Fintype α] → Prop
P
: ∀ (
α: Type u
α
:
Type u: Type (u+1)
Type u
) [
Fintype: Type ?u.7615 → Type ?u.7615
Fintype
α: Type u
α
],
Prop: Type
Prop
} (
of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β
of_equiv
: ∀ (
α: ?m.7621
α
β: ?m.7624
β
) [
Fintype: Type ?u.7627 → Type ?u.7627
Fintype
β: ?m.7624
β
] (
e: α β
e
:
α: ?m.7621
α
β: ?m.7624
β
), @
P: (α : Type u) → [inst : Fintype α] → Prop
P
α: ?m.7621
α
(@
Fintype.ofEquiv: {β : Type ?u.7636} → (α : Type ?u.7635) → [inst : Fintype α] → α βFintype β
Fintype.ofEquiv
α: ?m.7621
α
β: ?m.7624
β
‹_›
e: α β
e
.
symm: {α : Sort ?u.7642} → {β : Sort ?u.7641} → α ββ α
symm
) → @
P: (α : Type u) → [inst : Fintype α] → Prop
P
β: ?m.7624
β
‹_›) (
h_empty: P PEmpty
h_empty
:
P: (α : Type u) → [inst : Fintype α] → Prop
P
PEmpty: Sort ?u.7660
PEmpty
) (
h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)
h_option
: ∀ (
α: ?m.7676
α
) [
Fintype: Type ?u.7679 → Type ?u.7679
Fintype
α: ?m.7676
α
],
P: (α : Type u) → [inst : Fintype α] → Prop
P
α: ?m.7676
α
P: (α : Type u) → [inst : Fintype α] → Prop
P
(
Option: Type ?u.7688 → Type ?u.7688
Option
α: ?m.7676
α
)) (
α: Type u
α
:
Type u: Type (u+1)
Type u
) [
h_fintype: Fintype α
h_fintype
:
Fintype: Type ?u.7704 → Type ?u.7704
Fintype
α: Type u
α
] :
P: (α : Type u) → [inst : Fintype α] → Prop
P
α: Type u
α
:=

Goals accomplished! 🐙
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α


P α
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α


P α

Goals accomplished! 🐙
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α

i: Fintype PEmpty



Goals accomplished! 🐙
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α


P α

Goals accomplished! 🐙
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α

f_empty:= fun i => ?m.7731 i: ∀ (i : Fintype PEmpty), P PEmpty


∀ {α : Type u} [inst : Fintype α] [inst : DecidableEq α], (∀ (h : Fintype α), P α) → ∀ (h : Fintype (Option α)), P (Option α)
α✝¹: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α✝: Type u

h_fintype: Fintype α✝

f_empty:= fun i => ?m.7731 i: ∀ (i : Fintype PEmpty), P PEmpty

α: Type u

: Fintype α

: ∀ (h : Fintype α), P α

hα': Fintype (Option α)


P (Option α)
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α

f_empty:= fun i => ?m.7731 i: ∀ (i : Fintype PEmpty), P PEmpty


∀ {α : Type u} [inst : Fintype α] [inst : DecidableEq α], (∀ (h : Fintype α), P α) → ∀ (h : Fintype (Option α)), P (Option α)

Goals accomplished! 🐙
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α

x✝: Trunc (∀ (h : Fintype α), P α)

p: ∀ (h : Fintype α), P α


mk
P α
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α


P α
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α

x✝: Trunc (∀ (h : Fintype α), P α)

p: ∀ (h : Fintype α), P α


mk
P α
α✝: Type ?u.7603

β: Type ?u.7606

γ: Type ?u.7609

P: (α : Type u) → [inst : Fintype α] → Prop

of_equiv: ∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β

h_empty: P PEmpty

h_option: ∀ (α : Type u) [inst : Fintype α], P αP (Option α)

α: Type u

h_fintype: Fintype α

x✝: Trunc (∀ (h : Fintype α), P α)

p: ∀ (h : Fintype α), P α


mk
P α

Goals accomplished! 🐙
-- · #align fintype.induction_empty_option
Fintype.induction_empty_option: ∀ {P : (α : Type u) → [inst : Fintype α] → Prop}, (∀ (α β : Type u) [inst : Fintype β] (e : α β), P αP β) → P PEmpty(∀ (α : Type u) [inst : Fintype α], P αP (Option α)) → ∀ (α : Type u) [h_fintype : Fintype α], P α
Fintype.induction_empty_option
end Fintype /-- An induction principle for finite types, analogous to `Nat.rec`. It effectively says that every `Fintype` is either `Empty` or `Option α`, up to an `Equiv`. -/ theorem
Finite.induction_empty_option: ∀ {P : Type u → Prop}, (∀ {α β : Type u}, α βP αP β) → P PEmpty(∀ {α : Type u} [inst : Fintype α], P αP (Option α)) → ∀ (α : Type u) [inst : Finite α], P α
Finite.induction_empty_option
{
P: Type u → Prop
P
:
Type u: Type (u+1)
Type u
Prop: Type
Prop
} (
of_equiv: ∀ {α β : Type u}, α βP αP β
of_equiv
: ∀ {
α: ?m.8630
α
β: ?m.8633
β
},
α: ?m.8630
α
β: ?m.8633
β
P: Type u → Prop
P
α: ?m.8630
α
P: Type u → Prop
P
β: ?m.8633
β
) (
h_empty: P PEmpty
h_empty
:
P: Type u → Prop
P
PEmpty: Sort ?u.8644
PEmpty
) (
h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)
h_option
: ∀ {
α: ?m.8648
α
} [
Fintype: Type ?u.8651 → Type ?u.8651
Fintype
α: ?m.8648
α
],
P: Type u → Prop
P
α: ?m.8648
α
P: Type u → Prop
P
(
Option: Type ?u.8656 → Type ?u.8656
Option
α: ?m.8648
α
)) (
α: Type u
α
:
Type u: Type (u+1)
Type u
) [
Finite: Sort ?u.8661 → Prop
Finite
α: Type u
α
] :
P: Type u → Prop
P
α: Type u
α
:=

Goals accomplished! 🐙
α✝: Type ?u.8616

β: Type ?u.8619

γ: Type ?u.8622

P: Type u → Prop

of_equiv: ∀ {α β : Type u}, α βP αP β

h_empty: P PEmpty

h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)

α: Type u

inst✝: Finite α


P α
α✝: Type ?u.8616

β: Type ?u.8619

γ: Type ?u.8622

P: Type u → Prop

of_equiv: ∀ {α β : Type u}, α βP αP β

h_empty: P PEmpty

h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)

α: Type u

inst✝: Finite α

val✝: Fintype α


intro
P α
α✝: Type ?u.8616

β: Type ?u.8619

γ: Type ?u.8622

P: Type u → Prop

of_equiv: ∀ {α β : Type u}, α βP αP β

h_empty: P PEmpty

h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)

α: Type u

inst✝: Finite α


P α
α✝: Type ?u.8616

β: Type ?u.8619

γ: Type ?u.8622

P: Type u → Prop

of_equiv: ∀ {α β : Type u}, α βP αP β

h_empty: P PEmpty

h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)

α: Type u

inst✝: Finite α

val✝: Fintype α


intro.refine'_1
∀ (α β : Type u) [inst : Fintype β], α βP αP β
α✝: Type ?u.8616

β: Type ?u.8619

γ: Type ?u.8622

P: Type u → Prop

of_equiv: ∀ {α β : Type u}, α βP αP β

h_empty: P PEmpty

h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)

α: Type u

inst✝: Finite α

val✝: Fintype α


intro.refine'_2
α✝: Type ?u.8616

β: Type ?u.8619

γ: Type ?u.8622

P: Type u → Prop

of_equiv: ∀ {α β : Type u}, α βP αP β

h_empty: P PEmpty

h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)

α: Type u

inst✝: Finite α

val✝: Fintype α


intro.refine'_3
∀ (α : Type u) [inst : Fintype α], P αP (Option α)
α✝: Type ?u.8616

β: Type ?u.8619

γ: Type ?u.8622

P: Type u → Prop

of_equiv: ∀ {α β : Type u}, α βP αP β

h_empty: P PEmpty

h_option: ∀ {α : Type u} [inst : Fintype α], P αP (Option α)

α: Type u

inst✝: Finite α


P α

Goals accomplished! 🐙
#align finite.induction_empty_option
Finite.induction_empty_option: ∀ {P : Type u → Prop}, (∀ {α β : Type u}, α βP αP β) → P PEmpty(∀ {α : Type u} [inst : Fintype α], P αP (Option α)) → ∀ (α : Type u) [inst : Finite α], P α
Finite.induction_empty_option