l3lab/ntp-mathlib huggingface dataset:
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    rw [e, ord_nat] at this
    cases n
    · simp at e
      simp [e, not_zero_isLimit] at l
    · rw [nat_cast_succ, cof_succ] at this
      rw [← this, cof_eq_one_iff_is_succ] at e
      rcases e with ⟨a, rfl⟩
      

Proof state:
case inr.inr.intro.succ.intro
α : Type u_1
r : α → α → Prop
n✝ : ℕ
this : 1 = ↑(Nat.succ n✝)
a : Ordinal.{u_2}
l : IsLimit (succ a)
h : cof (succ a) < ℵ₀
⊢ False

Next tactic:
exact not_succ_isLimit _ l
@[simp]
theorem cof_omega : cof ω = ℵ₀ :=
  (aleph0_le_cof.2 omega_isLimit).antisymm' <| by
    

Proof state:
α : Type u_1
r : α → α → Prop
⊢ cof ω ≤ ℵ₀

Next tactic:
rw [← card_omega]
@[simp]
theorem cof_omega : cof ω = ℵ₀ :=
  (aleph0_le_cof.2 omega_isLimit).antisymm' <| by
    rw [← card_omega]
    

Proof state:
α : Type u_1
r : α → α → Prop
⊢ cof ω ≤ card ω

Next tactic:
apply cof_le_card
theorem cof_eq' (r : α → α → Prop) [IsWellOrder α r] (h : IsLimit (type r)) :
    ∃ S : Set α, (∀ a, ∃ b ∈ S, r a b) ∧ #S = cof (type r) :=
  let ⟨S, H, e⟩ := cof_eq r
  ⟨S, fun a =>
    let a' := enum r _ (h.2 _ (typein_lt_type r a))
    let ⟨b, h, ab⟩ := H a'
    ⟨b, h,
      (IsOrderConnected.conn a b a' <|
            (typein_lt_typein r).1
              (by
                

Proof state:
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
h✝ : IsLimit (type r)
S : Set α
H : Unbounded r S
e : #↑S = cof (type r)
a : α
a' : α := enum r (succ (typein r a)) (_ : succ (typein r a) < type r)
b : α
h : b ∈ S
ab : ¬r b a'
⊢ typein r a < typein r a'

Next tactic:
rw [typein_enum]
theorem cof_eq' (r : α → α → Prop) [IsWellOrder α r] (h : IsLimit (type r)) :
    ∃ S : Set α, (∀ a, ∃ b ∈ S, r a b) ∧ #S = cof (type r) :=
  let ⟨S, H, e⟩ := cof_eq r
  ⟨S, fun a =>
    let a' := enum r _ (h.2 _ (typein_lt_type r a))
    let ⟨b, h, ab⟩ := H a'
    ⟨b, h,
      (IsOrderConnected.conn a b a' <|
            (typein_lt_typein r).1
              (by
                rw [typein_enum]
                

Proof state:
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
h✝ : IsLimit (type r)
S : Set α
H : Unbounded r S
e : #↑S = cof (type r)
a : α
a' : α := enum r (succ (typein r a)) (_ : succ (typein r a) < type r)
b : α
h : b ∈ S
ab : ¬r b a'
⊢ typein r a < succ (typein r a)

Next tactic:
exact lt_succ (typein _ _)
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      

Proof state:
α : Type u_1
r : α → α → Prop
⊢ Cardinal.univ.{u, v} ≤ cof univ.{u, v}

Next tactic:
refine' le_of_forall_lt fun c h => _
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      

Proof state:
α : Type u_1
r : α → α → Prop
c : Cardinal.{max (u + 1) v}
h : c < Cardinal.univ.{u, v}
⊢ c < cof univ.{u, v}

Next tactic:
rcases lt_univ'.1 h with ⟨c, rfl⟩
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      

Proof state:
case intro
α : Type u_1
r : α → α → Prop
c : Cardinal.{u}
h : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
⊢ Cardinal.lift.{max (u + 1) v, u} c < cof univ.{u, v}

Next tactic:
rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      

Proof state:
case intro.intro.intro
α : Type u_1
r : α → α → Prop
c : Cardinal.{u}
h : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
⊢ Cardinal.lift.{max (u + 1) v, u} c < cof univ.{u, v}

Next tactic:
rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      

Proof state:
case intro.intro.intro
α : Type u_1
r : α → α → Prop
c : Cardinal.{u}
h : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
⊢ Cardinal.lift.{u + 1, u} c < #↑S

Next tactic:
refine' lt_of_not_ge fun h => _
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      

Proof state:
case intro.intro.intro
α : Type u_1
r : α → α → Prop
c : Cardinal.{u}
h✝ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h : Cardinal.lift.{u + 1, u} c ≥ #↑S
⊢ False

Next tactic:
cases' Cardinal.lift_down h with a e
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      

Proof state:
case intro.intro.intro.intro
α : Type u_1
r : α → α → Prop
c : Cardinal.{u}
h✝ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e : Cardinal.lift.{u + 1, u} a = #↑S
⊢ False

Next tactic:
refine' Quotient.inductionOn a (fun α e => _) e
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      

Proof state:
case intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
⊢ False

Next tactic:
cases' Quotient.exact e with f
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f : ULift.{u + 1, u} α ≃ ↑S
⊢ False

Next tactic:
have f := Equiv.ulift.symm.trans f
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      have f := Equiv.ulift.symm.trans f
      

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f✝ : ULift.{u + 1, u} α ≃ ↑S
f : α ≃ ↑S
⊢ False

Next tactic:
let g a := (f a).1
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      have f := Equiv.ulift.symm.trans f
      let g a := (f a).1
      

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f✝ : ULift.{u + 1, u} α ≃ ↑S
f : α ≃ ↑S
g : α → Ordinal.{u} := fun a => ↑(f a)
⊢ False

Next tactic:
let o := succ (sup.{u, u} g)
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      have f := Equiv.ulift.symm.trans f
      let g a := (f a).1
      let o := succ (sup.{u, u} g)
      

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f✝ : ULift.{u + 1, u} α ≃ ↑S
f : α ≃ ↑S
g : α → Ordinal.{u} := fun a => ↑(f a)
o : Ordinal.{u} := succ (sup g)
⊢ False

Next tactic:
rcases H o with ⟨b, h, l⟩
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      have f := Equiv.ulift.symm.trans f
      let g a := (f a).1
      let o := succ (sup.{u, u} g)
      rcases H o with ⟨b, h, l⟩
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝¹ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h✝ : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f✝ : ULift.{u + 1, u} α ≃ ↑S
f : α ≃ ↑S
g : α → Ordinal.{u} := fun a => ↑(f a)
o : Ordinal.{u} := succ (sup g)
b : Ordinal.{u}
h : b ∈ S
l : ¬(fun x x_1 => x < x_1) b o
⊢ False

Next tactic:
refine' l (lt_succ_iff.2 _)
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      have f := Equiv.ulift.symm.trans f
      let g a := (f a).1
      let o := succ (sup.{u, u} g)
      rcases H o with ⟨b, h, l⟩
      refine' l (lt_succ_iff.2 _)
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝¹ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h✝ : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f✝ : ULift.{u + 1, u} α ≃ ↑S
f : α ≃ ↑S
g : α → Ordinal.{u} := fun a => ↑(f a)
o : Ordinal.{u} := succ (sup g)
b : Ordinal.{u}
h : b ∈ S
l : ¬(fun x x_1 => x < x_1) b o
⊢ b ≤ sup g

Next tactic:
rw [← show g (f.symm ⟨b, h⟩) = b by simp]
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      have f := Equiv.ulift.symm.trans f
      let g a := (f a).1
      let o := succ (sup.{u, u} g)
      rcases H o with ⟨b, h, l⟩
      refine' l (lt_succ_iff.2 _)
      rw [← show g (f.symm ⟨b, h⟩) = b by 

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝¹ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h✝ : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f✝ : ULift.{u + 1, u} α ≃ ↑S
f : α ≃ ↑S
g : α → Ordinal.{u} := fun a => ↑(f a)
o : Ordinal.{u} := succ (sup g)
b : Ordinal.{u}
h : b ∈ S
l : ¬(fun x x_1 => x < x_1) b o
⊢ g (f.symm { val := b, property := h }) = b

Next tactic:
simp
@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v} :=
  le_antisymm (cof_le_card _)
    (by
      refine' le_of_forall_lt fun c h => _
      rcases lt_univ'.1 h with ⟨c, rfl⟩
      rcases @cof_eq Ordinal.{u} (· < ·) _ with ⟨S, H, Se⟩
      rw [univ, ← lift_cof, ← Cardinal.lift_lift.{u+1, v, u}, Cardinal.lift_lt, ← Se]
      refine' lt_of_not_ge fun h => _
      cases' Cardinal.lift_down h with a e
      refine' Quotient.inductionOn a (fun α e => _) e
      cases' Quotient.exact e with f
      have f := Equiv.ulift.symm.trans f
      let g a := (f a).1
      let o := succ (sup.{u, u} g)
      rcases H o with ⟨b, h, l⟩
      refine' l (lt_succ_iff.2 _)
      rw [← show g (f.symm ⟨b, h⟩) = b by simp]
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h✝¹ : Cardinal.lift.{max (u + 1) v, u} c < Cardinal.univ.{u, v}
S : Set Ordinal.{u}
H : Unbounded (fun x x_1 => x < x_1) S
Se : #↑S = cof (type fun x x_1 => x < x_1)
h✝ : Cardinal.lift.{u + 1, u} c ≥ #↑S
a : Cardinal.{u}
e✝ : Cardinal.lift.{u + 1, u} a = #↑S
α : Type u
e : Cardinal.lift.{u + 1, u} ⟦α⟧ = #↑S
f✝ : ULift.{u + 1, u} α ≃ ↑S
f : α ≃ ↑S
g : α → Ordinal.{u} := fun a => ↑(f a)
o : Ordinal.{u} := succ (sup g)
b : Ordinal.{u}
h : b ∈ S
l : ¬(fun x x_1 => x < x_1) b o
⊢ g (f.symm { val := b, property := h }) ≤ sup g

Next tactic:
apply le_sup
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_sUnion (r : α → α → Prop) [wo : IsWellOrder α r] {s : Set (Set α)}
    (h₁ : Unbounded r <| ⋃₀ s) (h₂ : #s < StrictOrder.cof r) : ∃ x ∈ s, Unbounded r x := by
  

Proof state:
α : Type u_1
r✝ r : α → α → Prop
wo : IsWellOrder α r
s : Set (Set α)
h₁ : Unbounded r (⋃₀ s)
h₂ : #↑s < StrictOrder.cof r
⊢ ∃ x ∈ s, Unbounded r x

Next tactic:
by_contra! h
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_sUnion (r : α → α → Prop) [wo : IsWellOrder α r] {s : Set (Set α)}
    (h₁ : Unbounded r <| ⋃₀ s) (h₂ : #s < StrictOrder.cof r) : ∃ x ∈ s, Unbounded r x := by
  by_contra! h
  

Proof state:
α : Type u_1
r✝ r : α → α → Prop
wo : IsWellOrder α r
s : Set (Set α)
h₁ : Unbounded r (⋃₀ s)
h₂ : #↑s < StrictOrder.cof r
h : ∀ x ∈ s, ¬Unbounded r x
⊢ False

Next tactic:
simp_rw [not_unbounded_iff] at h
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_sUnion (r : α → α → Prop) [wo : IsWellOrder α r] {s : Set (Set α)}
    (h₁ : Unbounded r <| ⋃₀ s) (h₂ : #s < StrictOrder.cof r) : ∃ x ∈ s, Unbounded r x := by
  by_contra! h
  simp_rw [not_unbounded_iff] at h
  

Proof state:
α : Type u_1
r✝ r : α → α → Prop
wo : IsWellOrder α r
s : Set (Set α)
h₁ : Unbounded r (⋃₀ s)
h₂ : #↑s < StrictOrder.cof r
h : ∀ x ∈ s, Bounded r x
⊢ False

Next tactic:
let f : s → α := fun x : s => wo.wf.sup x (h x.1 x.2)
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_sUnion (r : α → α → Prop) [wo : IsWellOrder α r] {s : Set (Set α)}
    (h₁ : Unbounded r <| ⋃₀ s) (h₂ : #s < StrictOrder.cof r) : ∃ x ∈ s, Unbounded r x := by
  by_contra! h
  simp_rw [not_unbounded_iff] at h
  let f : s → α := fun x : s => wo.wf.sup x (h x.1 x.2)
  

Proof state:
α : Type u_1
r✝ r : α → α → Prop
wo : IsWellOrder α r
s : Set (Set α)
h₁ : Unbounded r (⋃₀ s)
h₂ : #↑s < StrictOrder.cof r
h : ∀ x ∈ s, Bounded r x
f : ↑s → α := fun x => WellFounded.sup (_ : WellFounded r) ↑x (_ : Bounded r ↑x)
⊢ False

Next tactic:
refine' h₂.not_le (le_trans (csInf_le' ⟨range f, fun x => _, rfl⟩) mk_range_le)
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_sUnion (r : α → α → Prop) [wo : IsWellOrder α r] {s : Set (Set α)}
    (h₁ : Unbounded r <| ⋃₀ s) (h₂ : #s < StrictOrder.cof r) : ∃ x ∈ s, Unbounded r x := by
  by_contra! h
  simp_rw [not_unbounded_iff] at h
  let f : s → α := fun x : s => wo.wf.sup x (h x.1 x.2)
  refine' h₂.not_le (le_trans (csInf_le' ⟨range f, fun x => _, rfl⟩) mk_range_le)
  

Proof state:
α : Type u_1
r✝ r : α → α → Prop
wo : IsWellOrder α r
s : Set (Set α)
h₁ : Unbounded r (⋃₀ s)
h₂ : #↑s < StrictOrder.cof r
h : ∀ x ∈ s, Bounded r x
f : ↑s → α := fun x => WellFounded.sup (_ : WellFounded r) ↑x (_ : Bounded r ↑x)
x : α
⊢ ∃ b ∈ range f, swap rᶜ x b

Next tactic:
rcases h₁ x with ⟨y, ⟨c, hc, hy⟩, hxy⟩
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_sUnion (r : α → α → Prop) [wo : IsWellOrder α r] {s : Set (Set α)}
    (h₁ : Unbounded r <| ⋃₀ s) (h₂ : #s < StrictOrder.cof r) : ∃ x ∈ s, Unbounded r x := by
  by_contra! h
  simp_rw [not_unbounded_iff] at h
  let f : s → α := fun x : s => wo.wf.sup x (h x.1 x.2)
  refine' h₂.not_le (le_trans (csInf_le' ⟨range f, fun x => _, rfl⟩) mk_range_le)
  rcases h₁ x with ⟨y, ⟨c, hc, hy⟩, hxy⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
r✝ r : α → α → Prop
wo : IsWellOrder α r
s : Set (Set α)
h₁ : Unbounded r (⋃₀ s)
h₂ : #↑s < StrictOrder.cof r
h : ∀ x ∈ s, Bounded r x
f : ↑s → α := fun x => WellFounded.sup (_ : WellFounded r) ↑x (_ : Bounded r ↑x)
x y : α
hxy : ¬r y x
c : Set α
hc : c ∈ s
hy : y ∈ c
⊢ ∃ b ∈ range f, swap rᶜ x b

Next tactic:
exact ⟨f ⟨c, hc⟩, mem_range_self _, fun hxz => hxy (Trans.trans (wo.wf.lt_sup _ hy) hxz)⟩
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_iUnion {α β : Type u} (r : α → α → Prop) [wo : IsWellOrder α r]
    (s : β → Set α) (h₁ : Unbounded r <| ⋃ x, s x) (h₂ : #β < StrictOrder.cof r) :
    ∃ x : β, Unbounded r (s x) := by
  

Proof state:
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α β : Type u
r : α → α → Prop
wo : IsWellOrder α r
s : β → Set α
h₁ : Unbounded r (⋃ x, s x)
h₂ : #β < StrictOrder.cof r
⊢ ∃ x, Unbounded r (s x)

Next tactic:
rw [← sUnion_range] at h₁
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_iUnion {α β : Type u} (r : α → α → Prop) [wo : IsWellOrder α r]
    (s : β → Set α) (h₁ : Unbounded r <| ⋃ x, s x) (h₂ : #β < StrictOrder.cof r) :
    ∃ x : β, Unbounded r (s x) := by
  rw [← sUnion_range] at h₁
  

Proof state:
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α β : Type u
r : α → α → Prop
wo : IsWellOrder α r
s : β → Set α
h₁ : Unbounded r (⋃₀ range fun x => s x)
h₂ : #β < StrictOrder.cof r
⊢ ∃ x, Unbounded r (s x)

Next tactic:
rcases unbounded_of_unbounded_sUnion r h₁ (mk_range_le.trans_lt h₂) with ⟨_, ⟨x, rfl⟩, u⟩
/-- If the union of s is unbounded and s is smaller than the cofinality,
  then s has an unbounded member -/
theorem unbounded_of_unbounded_iUnion {α β : Type u} (r : α → α → Prop) [wo : IsWellOrder α r]
    (s : β → Set α) (h₁ : Unbounded r <| ⋃ x, s x) (h₂ : #β < StrictOrder.cof r) :
    ∃ x : β, Unbounded r (s x) := by
  rw [← sUnion_range] at h₁
  rcases unbounded_of_unbounded_sUnion r h₁ (mk_range_le.trans_lt h₂) with ⟨_, ⟨x, rfl⟩, u⟩
  

Proof state:
case intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α β : Type u
r : α → α → Prop
wo : IsWellOrder α r
s : β → Set α
h₁ : Unbounded r (⋃₀ range fun x => s x)
h₂ : #β < StrictOrder.cof r
x : β
u : Unbounded r ((fun x => s x) x)
⊢ ∃ x, Unbounded r (s x)

Next tactic:
exact ⟨x, u⟩
/-- The infinite pigeonhole principle -/
theorem infinite_pigeonhole {β α : Type u} (f : β → α) (h₁ : ℵ₀ ≤ #β) (h₂ : #α < (#β).ord.cof) :
    ∃ a : α, #(f ⁻¹' {a}) = #β := by
  

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
⊢ ∃ a, #↑(f ⁻¹' {a}) = #β

Next tactic:
have : ∃ a, #β ≤ #(f ⁻¹' {a}) := by
    by_contra! h
    apply mk_univ.not_lt
    rw [← preimage_univ, ← iUnion_of_singleton, preimage_iUnion]
    exact
      mk_iUnion_le_sum_mk.trans_lt
        ((sum_le_iSup _).trans_lt <| mul_lt_of_lt h₁ (h₂.trans_le <| cof_ord_le _) (iSup_lt h₂ h))
/-- The infinite pigeonhole principle -/
theorem infinite_pigeonhole {β α : Type u} (f : β → α) (h₁ : ℵ₀ ≤ #β) (h₂ : #α < (#β).ord.cof) :
    ∃ a : α, #(f ⁻¹' {a}) = #β := by
  have : ∃ a, #β ≤ #(f ⁻¹' {a}) := by
    

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
⊢ ∃ a, #β ≤ #↑(f ⁻¹' {a})

Next tactic:
by_contra! h