l3lab/ntp-mathlib huggingface dataset:
/-- For any natural numbers n, a, and b, one of the following holds:
1. n < a
2. n ≥ b
3. n ∈ Ico a b
-/
theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ Ico a b := by
  by_cases h₁ : n < a
  · left
    exact h₁
  · right
    by_cases h₂ : n ∈ Ico a b
    · 

Proof state:
case pos
n a b : ℕ
h₁ : ¬n < a
h₂ : n ∈ Ico a b
⊢ b ≤ n ∨ n ∈ Ico a b

Next tactic:
right
/-- For any natural numbers n, a, and b, one of the following holds:
1. n < a
2. n ≥ b
3. n ∈ Ico a b
-/
theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ Ico a b := by
  by_cases h₁ : n < a
  · left
    exact h₁
  · right
    by_cases h₂ : n ∈ Ico a b
    · right
      

Proof state:
case pos.h
n a b : ℕ
h₁ : ¬n < a
h₂ : n ∈ Ico a b
⊢ n ∈ Ico a b

Next tactic:
exact h₂
/-- For any natural numbers n, a, and b, one of the following holds:
1. n < a
2. n ≥ b
3. n ∈ Ico a b
-/
theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ Ico a b := by
  by_cases h₁ : n < a
  · left
    exact h₁
  · right
    by_cases h₂ : n ∈ Ico a b
    · right
      exact h₂
    · 

Proof state:
case neg
n a b : ℕ
h₁ : ¬n < a
h₂ : n ∉ Ico a b
⊢ b ≤ n ∨ n ∈ Ico a b

Next tactic:
left
/-- For any natural numbers n, a, and b, one of the following holds:
1. n < a
2. n ≥ b
3. n ∈ Ico a b
-/
theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ Ico a b := by
  by_cases h₁ : n < a
  · left
    exact h₁
  · right
    by_cases h₂ : n ∈ Ico a b
    · right
      exact h₂
    · left
      

Proof state:
case neg.h
n a b : ℕ
h₁ : ¬n < a
h₂ : n ∉ Ico a b
⊢ b ≤ n

Next tactic:
simp only [Ico.mem, not_and, not_lt] at *
/-- For any natural numbers n, a, and b, one of the following holds:
1. n < a
2. n ≥ b
3. n ∈ Ico a b
-/
theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ Ico a b := by
  by_cases h₁ : n < a
  · left
    exact h₁
  · right
    by_cases h₂ : n ∈ Ico a b
    · right
      exact h₂
    · left
      simp only [Ico.mem, not_and, not_lt] at *
      

Proof state:
case neg.h
n a b : ℕ
h₁ : a ≤ n
h₂ : a ≤ n → b ≤ n
⊢ b ≤ n

Next tactic:
exact h₂ h₁
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  

Proof state:
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
⊢ Ordinal.IsLimit (ord c)

Next tactic:
refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · 

Proof state:
case refine'_1
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
h : ord c = 0
⊢ ℵ₀ = 0

Next tactic:
rw [← Ordinal.le_zero, ord_le] at h
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · rw [← Ordinal.le_zero, ord_le] at h
    

Proof state:
case refine'_1
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
h : c ≤ card 0
⊢ ℵ₀ = 0

Next tactic:
simpa only [card_zero, nonpos_iff_eq_zero] using co.trans h
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · rw [← Ordinal.le_zero, ord_le] at h
    simpa only [card_zero, nonpos_iff_eq_zero] using co.trans h
  · 

Proof state:
case refine'_2
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
a : Ordinal.{u_1}
h : ord c ≤ succ a
⊢ ord c ≤ a

Next tactic:
rw [ord_le] at h ⊢
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · rw [← Ordinal.le_zero, ord_le] at h
    simpa only [card_zero, nonpos_iff_eq_zero] using co.trans h
  · rw [ord_le] at h ⊢
    

Proof state:
case refine'_2
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
a : Ordinal.{u_1}
h : c ≤ card (succ a)
⊢ c ≤ card a

Next tactic:
rwa [← @add_one_of_aleph0_le (card a), ← card_succ]
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · rw [← Ordinal.le_zero, ord_le] at h
    simpa only [card_zero, nonpos_iff_eq_zero] using co.trans h
  · rw [ord_le] at h ⊢
    rwa [← @add_one_of_aleph0_le (card a), ← card_succ]
    

Proof state:
case refine'_2
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
a : Ordinal.{u_1}
h : c ≤ card (succ a)
⊢ ℵ₀ ≤ card a

Next tactic:
rw [← ord_le, ← le_succ_of_isLimit, ord_le]
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · rw [← Ordinal.le_zero, ord_le] at h
    simpa only [card_zero, nonpos_iff_eq_zero] using co.trans h
  · rw [ord_le] at h ⊢
    rwa [← @add_one_of_aleph0_le (card a), ← card_succ]
    rw [← ord_le, ← le_succ_of_isLimit, ord_le]
    · 

Proof state:
case refine'_2
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
a : Ordinal.{u_1}
h : c ≤ card (succ a)
⊢ ℵ₀ ≤ card (succ a)

Next tactic:
exact co.trans h
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · rw [← Ordinal.le_zero, ord_le] at h
    simpa only [card_zero, nonpos_iff_eq_zero] using co.trans h
  · rw [ord_le] at h ⊢
    rwa [← @add_one_of_aleph0_le (card a), ← card_succ]
    rw [← ord_le, ← le_succ_of_isLimit, ord_le]
    · exact co.trans h
    · 

Proof state:
case refine'_2.h
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
a : Ordinal.{u_1}
h : c ≤ card (succ a)
⊢ Ordinal.IsLimit (ord ℵ₀)

Next tactic:
rw [ord_aleph0]
theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit := by
  refine' ⟨fun h => aleph0_ne_zero _, fun a => lt_imp_lt_of_le_imp_le fun h => _⟩
  · rw [← Ordinal.le_zero, ord_le] at h
    simpa only [card_zero, nonpos_iff_eq_zero] using co.trans h
  · rw [ord_le] at h ⊢
    rwa [← @add_one_of_aleph0_le (card a), ← card_succ]
    rw [← ord_le, ← le_succ_of_isLimit, ord_le]
    · exact co.trans h
    · rw [ord_aleph0]
      

Proof state:
case refine'_2.h
c : Cardinal.{u_1}
co : ℵ₀ ≤ c
a : Ordinal.{u_1}
h : c ≤ card (succ a)
⊢ Ordinal.IsLimit ω

Next tactic:
exact omega_isLimit
@[simp]
theorem alephIdx_le {a b} : alephIdx a ≤ alephIdx b ↔ a ≤ b := by
  

Proof state:
a b : Cardinal.{u_1}
⊢ alephIdx a ≤ alephIdx b ↔ a ≤ b

Next tactic:
rw [← not_lt, ← not_lt, alephIdx_lt]
/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
  (The `aleph'` part is because unlike `aleph` this counts also the
  finite stages. So `alephIdx n = n`, `alephIdx ℵ₀ = ω`,
  `alephIdx ℵ₁ = ω + 1` and so on.)
  In this version, we register additionally that this function is an order isomorphism
  between cardinals and ordinals.
  For the basic function version, see `alephIdx`. -/
def alephIdx.relIso : @RelIso Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) :=
  @RelIso.ofSurjective Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) alephIdx.initialSeg.{u} <|
    (InitialSeg.eq_or_principal alephIdx.initialSeg.{u}).resolve_right fun ⟨o, e⟩ => by
      

Proof state:
x✝ : ∃ b, ∀ (x : Ordinal.{u}), x < b ↔ ∃ y, initialSeg y = x
o : Ordinal.{u}
e : ∀ (x : Ordinal.{u}), x < o ↔ ∃ y, initialSeg y = x
⊢ False

Next tactic:
have : ∀ c, alephIdx c < o := fun c => (e _).2 ⟨_, rfl⟩
/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
  (The `aleph'` part is because unlike `aleph` this counts also the
  finite stages. So `alephIdx n = n`, `alephIdx ℵ₀ = ω`,
  `alephIdx ℵ₁ = ω + 1` and so on.)
  In this version, we register additionally that this function is an order isomorphism
  between cardinals and ordinals.
  For the basic function version, see `alephIdx`. -/
def alephIdx.relIso : @RelIso Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) :=
  @RelIso.ofSurjective Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) alephIdx.initialSeg.{u} <|
    (InitialSeg.eq_or_principal alephIdx.initialSeg.{u}).resolve_right fun ⟨o, e⟩ => by
      have : ∀ c, alephIdx c < o := fun c => (e _).2 ⟨_, rfl⟩
      

Proof state:
x✝ : ∃ b, ∀ (x : Ordinal.{u}), x < b ↔ ∃ y, initialSeg y = x
o : Ordinal.{u}
e : ∀ (x : Ordinal.{u}), x < o ↔ ∃ y, initialSeg y = x
this : ∀ (c : Cardinal.{u}), alephIdx c < o
⊢ False

Next tactic:
refine' Ordinal.inductionOn o _ this
/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
  (The `aleph'` part is because unlike `aleph` this counts also the
  finite stages. So `alephIdx n = n`, `alephIdx ℵ₀ = ω`,
  `alephIdx ℵ₁ = ω + 1` and so on.)
  In this version, we register additionally that this function is an order isomorphism
  between cardinals and ordinals.
  For the basic function version, see `alephIdx`. -/
def alephIdx.relIso : @RelIso Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) :=
  @RelIso.ofSurjective Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) alephIdx.initialSeg.{u} <|
    (InitialSeg.eq_or_principal alephIdx.initialSeg.{u}).resolve_right fun ⟨o, e⟩ => by
      have : ∀ c, alephIdx c < o := fun c => (e _).2 ⟨_, rfl⟩
      refine' Ordinal.inductionOn o _ this; 

Proof state:
x✝ : ∃ b, ∀ (x : Ordinal.{u}), x < b ↔ ∃ y, initialSeg y = x
o : Ordinal.{u}
e : ∀ (x : Ordinal.{u}), x < o ↔ ∃ y, initialSeg y = x
this : ∀ (c : Cardinal.{u}), alephIdx c < o
⊢ ∀ (α : Type u) (r : α → α → Prop) [inst : IsWellOrder α r], (∀ (c : Cardinal.{u}), alephIdx c < type r) → False

Next tactic:
intro α r _ h
/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
  (The `aleph'` part is because unlike `aleph` this counts also the
  finite stages. So `alephIdx n = n`, `alephIdx ℵ₀ = ω`,
  `alephIdx ℵ₁ = ω + 1` and so on.)
  In this version, we register additionally that this function is an order isomorphism
  between cardinals and ordinals.
  For the basic function version, see `alephIdx`. -/
def alephIdx.relIso : @RelIso Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) :=
  @RelIso.ofSurjective Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) alephIdx.initialSeg.{u} <|
    (InitialSeg.eq_or_principal alephIdx.initialSeg.{u}).resolve_right fun ⟨o, e⟩ => by
      have : ∀ c, alephIdx c < o := fun c => (e _).2 ⟨_, rfl⟩
      refine' Ordinal.inductionOn o _ this; intro α r _ h
      

Proof state:
x✝ : ∃ b, ∀ (x : Ordinal.{u}), x < b ↔ ∃ y, initialSeg y = x
o : Ordinal.{u}
e : ∀ (x : Ordinal.{u}), x < o ↔ ∃ y, initialSeg y = x
this : ∀ (c : Cardinal.{u}), alephIdx c < o
α : Type u
r : α → α → Prop
inst✝ : IsWellOrder α r
h : ∀ (c : Cardinal.{u}), alephIdx c < type r
⊢ False

Next tactic:
let s := ⨆ a, invFun alephIdx (Ordinal.typein r a)
/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
  (The `aleph'` part is because unlike `aleph` this counts also the
  finite stages. So `alephIdx n = n`, `alephIdx ℵ₀ = ω`,
  `alephIdx ℵ₁ = ω + 1` and so on.)
  In this version, we register additionally that this function is an order isomorphism
  between cardinals and ordinals.
  For the basic function version, see `alephIdx`. -/
def alephIdx.relIso : @RelIso Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) :=
  @RelIso.ofSurjective Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) alephIdx.initialSeg.{u} <|
    (InitialSeg.eq_or_principal alephIdx.initialSeg.{u}).resolve_right fun ⟨o, e⟩ => by
      have : ∀ c, alephIdx c < o := fun c => (e _).2 ⟨_, rfl⟩
      refine' Ordinal.inductionOn o _ this; intro α r _ h
      let s := ⨆ a, invFun alephIdx (Ordinal.typein r a)
      

Proof state:
x✝ : ∃ b, ∀ (x : Ordinal.{u}), x < b ↔ ∃ y, initialSeg y = x
o : Ordinal.{u}
e : ∀ (x : Ordinal.{u}), x < o ↔ ∃ y, initialSeg y = x
this : ∀ (c : Cardinal.{u}), alephIdx c < o
α : Type u
r : α → α → Prop
inst✝ : IsWellOrder α r
h : ∀ (c : Cardinal.{u}), alephIdx c < type r
s : Cardinal.{u} := ⨆ a, invFun alephIdx (typein r a)
⊢ False

Next tactic:
apply (lt_succ s).not_le
/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
  (The `aleph'` part is because unlike `aleph` this counts also the
  finite stages. So `alephIdx n = n`, `alephIdx ℵ₀ = ω`,
  `alephIdx ℵ₁ = ω + 1` and so on.)
  In this version, we register additionally that this function is an order isomorphism
  between cardinals and ordinals.
  For the basic function version, see `alephIdx`. -/
def alephIdx.relIso : @RelIso Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) :=
  @RelIso.ofSurjective Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) alephIdx.initialSeg.{u} <|
    (InitialSeg.eq_or_principal alephIdx.initialSeg.{u}).resolve_right fun ⟨o, e⟩ => by
      have : ∀ c, alephIdx c < o := fun c => (e _).2 ⟨_, rfl⟩
      refine' Ordinal.inductionOn o _ this; intro α r _ h
      let s := ⨆ a, invFun alephIdx (Ordinal.typein r a)
      apply (lt_succ s).not_le
      

Proof state:
x✝ : ∃ b, ∀ (x : Ordinal.{u}), x < b ↔ ∃ y, initialSeg y = x
o : Ordinal.{u}
e : ∀ (x : Ordinal.{u}), x < o ↔ ∃ y, initialSeg y = x
this : ∀ (c : Cardinal.{u}), alephIdx c < o
α : Type u
r : α → α → Prop
inst✝ : IsWellOrder α r
h : ∀ (c : Cardinal.{u}), alephIdx c < type r
s : Cardinal.{u} := ⨆ a, invFun alephIdx (typein r a)
⊢ succ s ≤ s

Next tactic:
have I : Injective.{u+2, u+2} alephIdx := alephIdx.initialSeg.toEmbedding.injective
/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
  (The `aleph'` part is because unlike `aleph` this counts also the
  finite stages. So `alephIdx n = n`, `alephIdx ℵ₀ = ω`,
  `alephIdx ℵ₁ = ω + 1` and so on.)
  In this version, we register additionally that this function is an order isomorphism
  between cardinals and ordinals.
  For the basic function version, see `alephIdx`. -/
def alephIdx.relIso : @RelIso Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) :=
  @RelIso.ofSurjective Cardinal.{u} Ordinal.{u} (· < ·) (· < ·) alephIdx.initialSeg.{u} <|
    (InitialSeg.eq_or_principal alephIdx.initialSeg.{u}).resolve_right fun ⟨o, e⟩ => by
      have : ∀ c, alephIdx c < o := fun c => (e _).2 ⟨_, rfl⟩
      refine' Ordinal.inductionOn o _ this; intro α r _ h
      let s := ⨆ a, invFun alephIdx (Ordinal.typein r a)
      apply (lt_succ s).not_le
      have I : Injective.{u+2, u+2} alephIdx := alephIdx.initialSeg.toEmbedding.injective
      

Proof state:
x✝ : ∃ b, ∀ (x : Ordinal.{u}), x < b ↔ ∃ y, initialSeg y = x
o : Ordinal.{u}
e : ∀ (x : Ordinal.{u}), x < o ↔ ∃ y, initialSeg y = x
this : ∀ (c : Cardinal.{u}), alephIdx c < o
α : Type u
r : α → α → Prop
inst✝ : IsWellOrder α r
h : ∀ (c : Cardinal.{u}), alephIdx c < type r
s : Cardinal.{u} := ⨆ a, invFun alephIdx (typein r a)
I : Injective alephIdx
⊢ succ s ≤ s

Next tactic:
simpa only [typein_enum, leftInverse_invFun I (succ s)] using
        le_ciSup
          (Cardinal.bddAbove_range.{u, u} fun a : α => invFun alephIdx (Ordinal.typein r a))
          (Ordinal.enum r _ (h (succ s)))
@[simp]
theorem type_cardinal : @type Cardinal (· < ·) _ = Ordinal.univ.{u, u + 1} := by
  

Proof state:
⊢ (type fun x x_1 => x < x_1) = Ordinal.univ.{u, u + 1}

Next tactic:
rw [Ordinal.univ_id]
@[simp]
theorem type_cardinal : @type Cardinal (· < ·) _ = Ordinal.univ.{u, u + 1} := by
  rw [Ordinal.univ_id]; 

Proof state:
⊢ (type fun x x_1 => x < x_1) = type fun x x_1 => x < x_1

Next tactic:
exact Quotient.sound ⟨alephIdx.relIso⟩
@[simp]
theorem mk_cardinal : #Cardinal = univ.{u, u + 1} := by
  

Proof state:
⊢ #Cardinal.{u} = univ.{u, u + 1}

Next tactic:
simpa only [card_type, card_univ] using congr_arg card type_cardinal
@[simp]
theorem aleph'_zero : aleph' 0 = 0 := by
  

Proof state:
⊢ aleph' 0 = 0

Next tactic:
rw [← nonpos_iff_eq_zero, ← aleph'_alephIdx 0, aleph'_le]
@[simp]
theorem aleph'_zero : aleph' 0 = 0 := by
  rw [← nonpos_iff_eq_zero, ← aleph'_alephIdx 0, aleph'_le]
  

Proof state:
⊢ 0 ≤ alephIdx 0

Next tactic:
apply Ordinal.zero_le
@[simp]
theorem aleph'_succ {o : Ordinal} : aleph' (succ o) = succ (aleph' o) := by
  

Proof state:
o : Ordinal.{u_1}
⊢ aleph' (succ o) = succ (aleph' o)

Next tactic:
apply (succ_le_of_lt <| aleph'_lt.2 <| lt_succ o).antisymm' (Cardinal.alephIdx_le.1 <| _)
@[simp]
theorem aleph'_succ {o : Ordinal} : aleph' (succ o) = succ (aleph' o) := by
  apply (succ_le_of_lt <| aleph'_lt.2 <| lt_succ o).antisymm' (Cardinal.alephIdx_le.1 <| _)
  

Proof state:
o : Ordinal.{u_1}
⊢ alephIdx (aleph' (succ o)) ≤ alephIdx (succ (aleph' o))

Next tactic:
rw [alephIdx_aleph', succ_le_iff, ← aleph'_lt, aleph'_alephIdx]
@[simp]
theorem aleph'_succ {o : Ordinal} : aleph' (succ o) = succ (aleph' o) := by
  apply (succ_le_of_lt <| aleph'_lt.2 <| lt_succ o).antisymm' (Cardinal.alephIdx_le.1 <| _)
  rw [alephIdx_aleph', succ_le_iff, ← aleph'_lt, aleph'_alephIdx]
  

Proof state:
o : Ordinal.{u_1}
⊢ aleph' o < succ (aleph' o)

Next tactic:
apply lt_succ
@[simp]
theorem aleph'_nat : ∀ n : ℕ, aleph' n = n
  | 0 => aleph'_zero
  | n + 1 => show aleph' (succ n) = n.succ by 

Proof state:
n : ℕ
⊢ aleph' (succ ↑n) = ↑(Nat.succ n)

Next tactic:
rw [aleph'_succ, aleph'_nat n, nat_succ]
theorem aleph'_le_of_limit {o : Ordinal} (l : o.IsLimit) {c} :
    aleph' o ≤ c ↔ ∀ o' < o, aleph' o' ≤ c :=
  ⟨fun h o' h' => (aleph'_le.2 <| h'.le).trans h, fun h => by
    

Proof state:
o : Ordinal.{u_1}
l : Ordinal.IsLimit o
c : Cardinal.{u_1}
h : ∀ o' < o, aleph' o' ≤ c
⊢ aleph' o ≤ c

Next tactic:
rw [← aleph'_alephIdx c, aleph'_le, limit_le l]
theorem aleph'_le_of_limit {o : Ordinal} (l : o.IsLimit) {c} :
    aleph' o ≤ c ↔ ∀ o' < o, aleph' o' ≤ c :=
  ⟨fun h o' h' => (aleph'_le.2 <| h'.le).trans h, fun h => by
    rw [← aleph'_alephIdx c, aleph'_le, limit_le l]
    

Proof state:
o : Ordinal.{u_1}
l : Ordinal.IsLimit o
c : Cardinal.{u_1}
h : ∀ o' < o, aleph' o' ≤ c
⊢ ∀ x < o, x ≤ alephIdx c

Next tactic:
intro x h'
theorem aleph'_le_of_limit {o : Ordinal} (l : o.IsLimit) {c} :
    aleph' o ≤ c ↔ ∀ o' < o, aleph' o' ≤ c :=
  ⟨fun h o' h' => (aleph'_le.2 <| h'.le).trans h, fun h => by
    rw [← aleph'_alephIdx c, aleph'_le, limit_le l]
    intro x h'
    

Proof state:
o : Ordinal.{u_1}
l : Ordinal.IsLimit o
c : Cardinal.{u_1}
h : ∀ o' < o, aleph' o' ≤ c
x : Ordinal.{u_1}
h' : x < o
⊢ x ≤ alephIdx c

Next tactic:
rw [← aleph'_le, aleph'_alephIdx]
theorem aleph'_le_of_limit {o : Ordinal} (l : o.IsLimit) {c} :
    aleph' o ≤ c ↔ ∀ o' < o, aleph' o' ≤ c :=
  ⟨fun h o' h' => (aleph'_le.2 <| h'.le).trans h, fun h => by
    rw [← aleph'_alephIdx c, aleph'_le, limit_le l]
    intro x h'
    rw [← aleph'_le, aleph'_alephIdx]
    

Proof state:
o : Ordinal.{u_1}
l : Ordinal.IsLimit o
c : Cardinal.{u_1}
h : ∀ o' < o, aleph' o' ≤ c
x : Ordinal.{u_1}
h' : x < o
⊢ aleph' x ≤ c

Next tactic:
exact h _ h'
theorem aleph'_limit {o : Ordinal} (ho : o.IsLimit) : aleph' o = ⨆ a : Iio o, aleph' a := by
  

Proof state:
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
⊢ aleph' o = ⨆ a, aleph' ↑a

Next tactic:
refine' le_antisymm _ (ciSup_le' fun i => aleph'_le.2 (le_of_lt i.2))
theorem aleph'_limit {o : Ordinal} (ho : o.IsLimit) : aleph' o = ⨆ a : Iio o, aleph' a := by
  refine' le_antisymm _ (ciSup_le' fun i => aleph'_le.2 (le_of_lt i.2))
  

Proof state:
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
⊢ aleph' o ≤ ⨆ a, aleph' ↑a

Next tactic:
rw [aleph'_le_of_limit ho]
theorem aleph'_limit {o : Ordinal} (ho : o.IsLimit) : aleph' o = ⨆ a : Iio o, aleph' a := by
  refine' le_antisymm _ (ciSup_le' fun i => aleph'_le.2 (le_of_lt i.2))
  rw [aleph'_le_of_limit ho]
  

Proof state:
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
⊢ ∀ o' < o, aleph' o' ≤ ⨆ a, aleph' ↑a

Next tactic:
exact fun a ha => le_ciSup (bddAbove_of_small _) (⟨a, ha⟩ : Iio o)
@[simp]
theorem aleph'_omega : aleph' ω = ℵ₀ :=
  eq_of_forall_ge_iff fun c => by
    

Proof state:
c : Cardinal.{u_1}
⊢ aleph' ω ≤ c ↔ ℵ₀ ≤ c

Next tactic:
simp only [aleph'_le_of_limit omega_isLimit, lt_omega, exists_imp, aleph0_le]
@[simp]
theorem aleph'_omega : aleph' ω = ℵ₀ :=
  eq_of_forall_ge_iff fun c => by
    simp only [aleph'_le_of_limit omega_isLimit, lt_omega, exists_imp, aleph0_le]
    

Proof state:
c : Cardinal.{u_1}
⊢ (∀ (o' : Ordinal.{u_1}) (x : ℕ), o' = ↑x → aleph' o' ≤ c) ↔ ∀ (n : ℕ), ↑n ≤ c

Next tactic:
exact forall_swap.trans (forall_congr' fun n => by simp only [forall_eq, aleph'_nat])
@[simp]
theorem aleph'_omega : aleph' ω = ℵ₀ :=
  eq_of_forall_ge_iff fun c => by
    simp only [aleph'_le_of_limit omega_isLimit, lt_omega, exists_imp, aleph0_le]
    exact forall_swap.trans (forall_congr' fun n => by 

Proof state:
c : Cardinal.{u_1}
n : ℕ
⊢ (∀ (x : Ordinal.{u_1}), x = ↑n → aleph' x ≤ c) ↔ ↑n ≤ c

Next tactic:
simp only [forall_eq, aleph'_nat]
@[simp]
theorem max_aleph_eq (o₁ o₂ : Ordinal) : max (aleph o₁) (aleph o₂) = aleph (max o₁ o₂) := by
  

Proof state:
o₁ o₂ : Ordinal.{u_1}
⊢ max (aleph o₁) (aleph o₂) = aleph (max o₁ o₂)

Next tactic:
rcases le_total (aleph o₁) (aleph o₂) with h | h
@[simp]
theorem max_aleph_eq (o₁ o₂ : Ordinal) : max (aleph o₁) (aleph o₂) = aleph (max o₁ o₂) := by
  rcases le_total (aleph o₁) (aleph o₂) with h | h
  · 

Proof state:
case inl
o₁ o₂ : Ordinal.{u_1}
h : aleph o₁ ≤ aleph o₂
⊢ max (aleph o₁) (aleph o₂) = aleph (max o₁ o₂)

Next tactic:
rw [max_eq_right h, max_eq_right (aleph_le.1 h)]
@[simp]
theorem max_aleph_eq (o₁ o₂ : Ordinal) : max (aleph o₁) (aleph o₂) = aleph (max o₁ o₂) := by
  rcases le_total (aleph o₁) (aleph o₂) with h | h
  · rw [max_eq_right h, max_eq_right (aleph_le.1 h)]
  · 

Proof state:
case inr
o₁ o₂ : Ordinal.{u_1}
h : aleph o₂ ≤ aleph o₁
⊢ max (aleph o₁) (aleph o₂) = aleph (max o₁ o₂)

Next tactic:
rw [max_eq_left h, max_eq_left (aleph_le.1 h)]
@[simp]
theorem aleph_succ {o : Ordinal} : aleph (succ o) = succ (aleph o) := by
  

Proof state:
o : Ordinal.{u_1}
⊢ aleph (succ o) = succ (aleph o)

Next tactic:
rw [aleph, add_succ, aleph'_succ, aleph]
@[simp]
theorem aleph_zero : aleph 0 = ℵ₀ := by 

Proof state:
⊢ aleph 0 = ℵ₀

Next tactic:
rw [aleph, add_zero, aleph'_omega]
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a := by
  

Proof state:
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
⊢ aleph o = ⨆ a, aleph ↑a

Next tactic:
apply le_antisymm _ (ciSup_le' _)
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a := by
  apply le_antisymm _ (ciSup_le' _)
  · 

Proof state:
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
⊢ aleph o ≤ ⨆ i, aleph ↑i

Next tactic:
rw [aleph, aleph'_limit (ho.add _)]
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a := by
  apply le_antisymm _ (ciSup_le' _)
  · rw [aleph, aleph'_limit (ho.add _)]
    

Proof state:
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
⊢ ⨆ a, aleph' ↑a ≤ ⨆ i, aleph ↑i

Next tactic:
refine' ciSup_mono' (bddAbove_of_small _) _
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a := by
  apply le_antisymm _ (ciSup_le' _)
  · rw [aleph, aleph'_limit (ho.add _)]
    refine' ciSup_mono' (bddAbove_of_small _) _
    

Proof state:
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
⊢ ∀ (i : ↑(Iio (ω + o))), ∃ i', aleph' ↑i ≤ aleph ↑i'

Next tactic:
rintro ⟨i, hi⟩
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a := by
  apply le_antisymm _ (ciSup_le' _)
  · rw [aleph, aleph'_limit (ho.add _)]
    refine' ciSup_mono' (bddAbove_of_small _) _
    rintro ⟨i, hi⟩
    

Proof state:
case mk
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
i : Ordinal.{u_1}
hi : i ∈ Iio (ω + o)
⊢ ∃ i', aleph' ↑{ val := i, property := hi } ≤ aleph ↑i'

Next tactic:
cases' lt_or_le i ω with h h
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a := by
  apply le_antisymm _ (ciSup_le' _)
  · rw [aleph, aleph'_limit (ho.add _)]
    refine' ciSup_mono' (bddAbove_of_small _) _
    rintro ⟨i, hi⟩
    cases' lt_or_le i ω with h h
    · 

Proof state:
case mk.inl
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
i : Ordinal.{u_1}
hi : i ∈ Iio (ω + o)
h : i < ω
⊢ ∃ i', aleph' ↑{ val := i, property := hi } ≤ aleph ↑i'

Next tactic:
rcases lt_omega.1 h with ⟨n, rfl⟩
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a := by
  apply le_antisymm _ (ciSup_le' _)
  · rw [aleph, aleph'_limit (ho.add _)]
    refine' ciSup_mono' (bddAbove_of_small _) _
    rintro ⟨i, hi⟩
    cases' lt_or_le i ω with h h
    · rcases lt_omega.1 h with ⟨n, rfl⟩
      

Proof state:
case mk.inl.intro
o : Ordinal.{u_1}
ho : Ordinal.IsLimit o
n : ℕ
hi : ↑n ∈ Iio (ω + o)
h : ↑n < ω
⊢ ∃ i', aleph' ↑{ val := ↑n, property := hi } ≤ aleph ↑i'

Next tactic:
use ⟨0, ho.pos⟩