l3lab/ntp-mathlib huggingface dataset:
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    

Proof state:
case inr.intro.intro.a.h
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
⊢ (fun x =>
      Quotient.liftOn₂ (#↑x) (Ordinal.cof (ord #α)) (fun α β => Nonempty (α ↪ β)) instLECardinal.proof_1 ∧
        ¬Quotient.liftOn₂ (Ordinal.cof (ord #α)) (#↑x) (fun α β => Nonempty (α ↪ β)) instLECardinal.proof_1) ⊆
    fun x => ∃ a, ∀ b ∈ x, r b a

Next tactic:
intro s hs
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    intro s hs
    

Proof state:
case inr.intro.intro.a.h
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
s : Set α
hs :
  s ∈ fun x =>
    Quotient.liftOn₂ (#↑x) (Ordinal.cof (ord #α)) (fun α β => Nonempty (α ↪ β)) instLECardinal.proof_1 ∧
      ¬Quotient.liftOn₂ (Ordinal.cof (ord #α)) (#↑x) (fun α β => Nonempty (α ↪ β)) instLECardinal.proof_1
⊢ s ∈ fun x => ∃ a, ∀ b ∈ x, r b a

Next tactic:
rw [hr] at hs
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    intro s hs
    rw [hr] at hs
    

Proof state:
case inr.intro.intro.a.h
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
s : Set α
hs :
  s ∈ fun x =>
    Quotient.liftOn₂ (#↑x) (Ordinal.cof (type r)) (fun α β => Nonempty (α ↪ β)) instLECardinal.proof_1 ∧
      ¬Quotient.liftOn₂ (Ordinal.cof (type r)) (#↑x) (fun α β => Nonempty (α ↪ β)) instLECardinal.proof_1
⊢ s ∈ fun x => ∃ a, ∀ b ∈ x, r b a

Next tactic:
exact lt_cof_type hs
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    intro s hs
    rw [hr] at hs
    exact lt_cof_type hs
  · 

Proof state:
case inr.intro.intro.a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
⊢ #α ≤ #{ s // #↑s < Ordinal.cof (ord #α) }

Next tactic:
refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    intro s hs
    rw [hr] at hs
    exact lt_cof_type hs
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · 

Proof state:
case inr.intro.intro.a.refine'_1
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
x : α
⊢ #↑{x} < Ordinal.cof (ord #α)

Next tactic:
rw [mk_singleton]
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    intro s hs
    rw [hr] at hs
    exact lt_cof_type hs
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · rw [mk_singleton]
      

Proof state:
case inr.intro.intro.a.refine'_1
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
x : α
⊢ 1 < Ordinal.cof (ord #α)

Next tactic:
exact one_lt_aleph0.trans_le (aleph0_le_cof.2 (ord_isLimit h'.isLimit.aleph0_le))
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    intro s hs
    rw [hr] at hs
    exact lt_cof_type hs
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · rw [mk_singleton]
      exact one_lt_aleph0.trans_le (aleph0_le_cof.2 (ord_isLimit h'.isLimit.aleph0_le))
    · 

Proof state:
case inr.intro.intro.a.refine'_2
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
⊢ Injective fun x => { val := {x}, property := (_ : #↑{x} < Ordinal.cof (ord #α)) }

Next tactic:
intro a b hab
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · simp [ha]
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  rcases ord_eq α with ⟨r, wo, hr⟩
  haveI := wo
  apply le_antisymm
  · conv_rhs => rw [← mk_bounded_subset h hr]
    apply mk_le_mk_of_subset
    intro s hs
    rw [hr] at hs
    exact lt_cof_type hs
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · rw [mk_singleton]
      exact one_lt_aleph0.trans_le (aleph0_le_cof.2 (ord_isLimit h'.isLimit.aleph0_le))
    · intro a b hab
      

Proof state:
case inr.intro.intro.a.refine'_2
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
h' : IsStrongLimit #α
r : α → α → Prop
wo : IsWellOrder α r
hr : ord #α = type r
this : IsWellOrder α r
a b : α
hab :
  (fun x => { val := {x}, property := (_ : #↑{x} < Ordinal.cof (ord #α)) }) a =
    (fun x => { val := {x}, property := (_ : #↑{x} < Ordinal.cof (ord #α)) }) b
⊢ a = b

Next tactic:
simpa [singleton_eq_singleton_iff] using hab
theorem IsRegular.ord_pos {c : Cardinal} (H : c.IsRegular) : 0 < c.ord := by
  

Proof state:
α : Type u_1
r : α → α → Prop
c : Cardinal.{u_2}
H : IsRegular c
⊢ 0 < ord c

Next tactic:
rw [Cardinal.lt_ord, card_zero]
theorem IsRegular.ord_pos {c : Cardinal} (H : c.IsRegular) : 0 < c.ord := by
  rw [Cardinal.lt_ord, card_zero]
  

Proof state:
α : Type u_1
r : α → α → Prop
c : Cardinal.{u_2}
H : IsRegular c
⊢ 0 < c

Next tactic:
exact H.pos
theorem isRegular_aleph0 : IsRegular ℵ₀ :=
  ⟨le_rfl, by 

Proof state:
α : Type u_1
r : α → α → Prop
⊢ ℵ₀ ≤ Ordinal.cof (ord ℵ₀)

Next tactic:
simp
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        

Proof state:
α : Type u_1
r : α → α → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
⊢ c < Ordinal.cof (ord (succ c))

Next tactic:
cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; 

Proof state:
case intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : ⟦α⟧ = succ c
⊢ c < Ordinal.cof (ord (succ c))

Next tactic:
simp at αe
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        

Proof state:
case intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
⊢ c < Ordinal.cof (ord (succ c))

Next tactic:
rcases ord_eq α with ⟨r, wo, re⟩
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; 

Proof state:
case intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
⊢ c < Ordinal.cof (ord (succ c))

Next tactic:
skip
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        

Proof state:
case intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
⊢ c < Ordinal.cof (ord (succ c))

Next tactic:
have := ord_isLimit (h.trans (le_succ _))
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        

Proof state:
case intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (ord (succ c))
⊢ c < Ordinal.cof (ord (succ c))

Next tactic:
rw [← αe, re] at this ⊢
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        

Proof state:
case intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
⊢ c < Ordinal.cof (type r)

Next tactic:
rcases cof_eq' r this with ⟨S, H, Se⟩
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
⊢ c < Ordinal.cof (type r)

Next tactic:
rw [← Se]
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        rw [← Se]
        

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
⊢ c < #↑S

Next tactic:
apply lt_imp_lt_of_le_imp_le fun h => mul_le_mul_right' h c
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        rw [← Se]
        apply lt_imp_lt_of_le_imp_le fun h => mul_le_mul_right' h c
        

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
⊢ c * c < #↑S * c

Next tactic:
rw [mul_eq_self h, ← succ_le_iff, ← αe, ← sum_const']
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        rw [← Se]
        apply lt_imp_lt_of_le_imp_le fun h => mul_le_mul_right' h c
        rw [mul_eq_self h, ← succ_le_iff, ← αe, ← sum_const']
        

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
⊢ #α ≤ sum fun x => c

Next tactic:
refine' le_trans _ (sum_le_sum (fun (x : S) => card (typein r (x : α))) _ fun i => _)
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        rw [← Se]
        apply lt_imp_lt_of_le_imp_le fun h => mul_le_mul_right' h c
        rw [mul_eq_self h, ← succ_le_iff, ← αe, ← sum_const']
        refine' le_trans _ (sum_le_sum (fun (x : S) => card (typein r (x : α))) _ fun i => _)
        · 

Proof state:
case intro.intro.intro.intro.intro.refine'_1
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
⊢ #α ≤ sum fun x => card (typein r ↑x)

Next tactic:
simp only [← card_typein, ← mk_sigma]
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        rw [← Se]
        apply lt_imp_lt_of_le_imp_le fun h => mul_le_mul_right' h c
        rw [mul_eq_self h, ← succ_le_iff, ← αe, ← sum_const']
        refine' le_trans _ (sum_le_sum (fun (x : S) => card (typein r (x : α))) _ fun i => _)
        · simp only [← card_typein, ← mk_sigma]
          

Proof state:
case intro.intro.intro.intro.intro.refine'_1
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
⊢ #α ≤ #((i : ↑S) × { y // r y ↑i })

Next tactic:
exact
            ⟨Embedding.ofSurjective (fun x => x.2.1) fun a =>
                let ⟨b, h, ab⟩ := H a
                ⟨⟨⟨_, h⟩, _, ab⟩, rfl⟩⟩
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        rw [← Se]
        apply lt_imp_lt_of_le_imp_le fun h => mul_le_mul_right' h c
        rw [mul_eq_self h, ← succ_le_iff, ← αe, ← sum_const']
        refine' le_trans _ (sum_le_sum (fun (x : S) => card (typein r (x : α))) _ fun i => _)
        · simp only [← card_typein, ← mk_sigma]
          exact
            ⟨Embedding.ofSurjective (fun x => x.2.1) fun a =>
                let ⟨b, h, ab⟩ := H a
                ⟨⟨⟨_, h⟩, _, ab⟩, rfl⟩⟩
        · 

Proof state:
case intro.intro.intro.intro.intro.refine'_2
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
i : ↑S
⊢ (fun x => card (typein r ↑x)) i ≤ c

Next tactic:
rw [← lt_succ_iff, ← lt_ord, ← αe, re]
theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c) :=
  ⟨h.trans (le_succ c),
    succ_le_of_lt
      (by
        cases' Quotient.exists_rep (@succ Cardinal _ _ c) with α αe; simp at αe
        rcases ord_eq α with ⟨r, wo, re⟩; skip
        have := ord_isLimit (h.trans (le_succ _))
        rw [← αe, re] at this ⊢
        rcases cof_eq' r this with ⟨S, H, Se⟩
        rw [← Se]
        apply lt_imp_lt_of_le_imp_le fun h => mul_le_mul_right' h c
        rw [mul_eq_self h, ← succ_le_iff, ← αe, ← sum_const']
        refine' le_trans _ (sum_le_sum (fun (x : S) => card (typein r (x : α))) _ fun i => _)
        · simp only [← card_typein, ← mk_sigma]
          exact
            ⟨Embedding.ofSurjective (fun x => x.2.1) fun a =>
                let ⟨b, h, ab⟩ := H a
                ⟨⟨⟨_, h⟩, _, ab⟩, rfl⟩⟩
        · rw [← lt_succ_iff, ← lt_ord, ← αe, re]
          

Proof state:
case intro.intro.intro.intro.intro.refine'_2
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
c : Cardinal.{u}
h : ℵ₀ ≤ c
α : Type u
αe : #α = succ c
r : α → α → Prop
wo : IsWellOrder α r
re : ord #α = type r
this : Ordinal.IsLimit (type r)
S : Set α
H : ∀ (a : α), ∃ b ∈ S, r a b
Se : #↑S = Ordinal.cof (type r)
i : ↑S
⊢ typein r ↑i < type r

Next tactic:
apply typein_lt_type
theorem isRegular_aleph_one : IsRegular (aleph 1) := by
  

Proof state:
α : Type u_1
r : α → α → Prop
⊢ IsRegular (aleph 1)

Next tactic:
rw [← succ_aleph0]
theorem isRegular_aleph_one : IsRegular (aleph 1) := by
  rw [← succ_aleph0]
  

Proof state:
α : Type u_1
r : α → α → Prop
⊢ IsRegular (succ ℵ₀)

Next tactic:
exact isRegular_succ le_rfl
theorem isRegular_aleph'_succ {o : Ordinal} (h : ω ≤ o) : IsRegular (aleph' (succ o)) := by
  

Proof state:
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
h : ω ≤ o
⊢ IsRegular (aleph' (succ o))

Next tactic:
rw [aleph'_succ]
theorem isRegular_aleph'_succ {o : Ordinal} (h : ω ≤ o) : IsRegular (aleph' (succ o)) := by
  rw [aleph'_succ]
  

Proof state:
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
h : ω ≤ o
⊢ IsRegular (succ (aleph' o))

Next tactic:
exact isRegular_succ (aleph0_le_aleph'.2 h)
theorem isRegular_aleph_succ (o : Ordinal) : IsRegular (aleph (succ o)) := by
  

Proof state:
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
⊢ IsRegular (aleph (succ o))

Next tactic:
rw [aleph_succ]
theorem isRegular_aleph_succ (o : Ordinal) : IsRegular (aleph (succ o)) := by
  rw [aleph_succ]
  

Proof state:
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
⊢ IsRegular (succ (aleph o))

Next tactic:
exact isRegular_succ (aleph0_le_aleph o)
/-- A function whose codomain's cardinality is infinite but strictly smaller than its domain's
has a fiber with cardinality strictly great than the codomain.
-/
theorem infinite_pigeonhole_card_lt {β α : Type u} (f : β → α) (w : #α < #β) (w' : ℵ₀ ≤ #α) :
    ∃ a : α, #α < #(f ⁻¹' {a}) := by
  

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

Next tactic:
simp_rw [← succ_le_iff]
/-- A function whose codomain's cardinality is infinite but strictly smaller than its domain's
has a fiber with cardinality strictly great than the codomain.
-/
theorem infinite_pigeonhole_card_lt {β α : Type u} (f : β → α) (w : #α < #β) (w' : ℵ₀ ≤ #α) :
    ∃ a : α, #α < #(f ⁻¹' {a}) := by
  simp_rw [← succ_le_iff]
  

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

Next tactic:
exact
    Ordinal.infinite_pigeonhole_card f (succ #α) (succ_le_of_lt w) (w'.trans (lt_succ _).le)
      ((lt_succ _).trans_le (isRegular_succ w').2.ge)
/-- A function whose codomain's cardinality is infinite but strictly smaller than its domain's
has an infinite fiber.
-/
theorem exists_infinite_fiber {β α : Type u} (f : β → α) (w : #α < #β) (w' : Infinite α) :
    ∃ a : α, Infinite (f ⁻¹' {a}) := by
  

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
w : #α < #β
w' : Infinite α
⊢ ∃ a, Infinite ↑(f ⁻¹' {a})

Next tactic:
simp_rw [Cardinal.infinite_iff] at w' ⊢
/-- A function whose codomain's cardinality is infinite but strictly smaller than its domain's
has an infinite fiber.
-/
theorem exists_infinite_fiber {β α : Type u} (f : β → α) (w : #α < #β) (w' : Infinite α) :
    ∃ a : α, Infinite (f ⁻¹' {a}) := by
  simp_rw [Cardinal.infinite_iff] at w' ⊢
  

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

Next tactic:
cases' infinite_pigeonhole_card_lt f w w' with a ha
/-- A function whose codomain's cardinality is infinite but strictly smaller than its domain's
has an infinite fiber.
-/
theorem exists_infinite_fiber {β α : Type u} (f : β → α) (w : #α < #β) (w' : Infinite α) :
    ∃ a : α, Infinite (f ⁻¹' {a}) := by
  simp_rw [Cardinal.infinite_iff] at w' ⊢
  cases' infinite_pigeonhole_card_lt f w w' with a ha
  

Proof state:
case intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
w : #α < #β
w' : ℵ₀ ≤ #α
a : α
ha : #α < #↑(f ⁻¹' {a})
⊢ ∃ a, ℵ₀ ≤ #↑(f ⁻¹' {a})

Next tactic:
exact ⟨a, w'.trans ha.le⟩
/-- If an infinite type `β` can be expressed as a union of finite sets,
then the cardinality of the collection of those finite sets
must be at least the cardinality of `β`.
-/
theorem le_range_of_union_finset_eq_top {α β : Type*} [Infinite β] (f : α → Finset β)
    (w : ⋃ a, (f a : Set β) = ⊤) : #β ≤ #(range f) := by
  

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ #β ≤ #↑(range f)

Next tactic:
have k : _root_.Infinite (range f) := by
    rw [infinite_coe_iff]
    apply mt (union_finset_finite_of_range_finite f)
    rw [w]
    exact infinite_univ
/-- If an infinite type `β` can be expressed as a union of finite sets,
then the cardinality of the collection of those finite sets
must be at least the cardinality of `β`.
-/
theorem le_range_of_union_finset_eq_top {α β : Type*} [Infinite β] (f : α → Finset β)
    (w : ⋃ a, (f a : Set β) = ⊤) : #β ≤ #(range f) := by
  have k : _root_.Infinite (range f) := by
    

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ Infinite ↑(range f)

Next tactic:
rw [infinite_coe_iff]