l3lab/ntp-mathlib huggingface dataset:
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  

Proof state:
case inr
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha : #α ≠ 0
h' : IsStrongLimit #α
⊢ #{ s // Bounded r s } = #α

Next tactic:
have ha := h'.isLimit.aleph0_le
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  

Proof state:
case inr
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
⊢ #{ s // Bounded r s } = #α

Next tactic:
apply le_antisymm
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · 

Proof state:
case inr.a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
⊢ #{ s // Bounded r s } ≤ #α

Next tactic:
have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    

Proof state:
case inr.a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
⊢ #{ s // Bounded r s } ≤ #α

Next tactic:
rw [← coe_setOf, this]
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    

Proof state:
case inr.a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
⊢ #↑(⋃ i, 𝒫{j | r j i}) ≤ #α

Next tactic:
refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    

Proof state:
case inr.a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
⊢ max (#α) (⨆ i, #↑(𝒫{j | r j i})) ≤ #α

Next tactic:
rw [max_eq_left]
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    

Proof state:
case inr.a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
⊢ ⨆ i, #↑(𝒫{j | r j i}) ≤ #α

Next tactic:
apply ciSup_le' _
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    

Proof state:
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
⊢ ∀ (i : α), #↑(𝒫{j | r j i}) ≤ #α

Next tactic:
intro i
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    

Proof state:
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
i : α
⊢ #↑(𝒫{j | r j i}) ≤ #α

Next tactic:
rw [mk_powerset]
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    

Proof state:
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
i : α
⊢ 2 ^ #↑{j | r j i} ≤ #α

Next tactic:
apply (h'.two_power_lt _).le
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    

Proof state:
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
i : α
⊢ #↑{j | r j i} < #α

Next tactic:
rw [coe_setOf, card_typein, ← lt_ord, hr]
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    rw [coe_setOf, card_typein, ← lt_ord, hr]
    

Proof state:
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
this : {s | Bounded r s} = ⋃ i, 𝒫{j | r j i}
i : α
⊢ typein (fun x => r x) i < type r

Next tactic:
apply typein_lt_type
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    rw [coe_setOf, card_typein, ← lt_ord, hr]
    apply typein_lt_type
  · 

Proof state:
case inr.a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
⊢ #α ≤ #{ s // Bounded r s }

Next tactic:
refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    rw [coe_setOf, card_typein, ← lt_ord, hr]
    apply typein_lt_type
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · 

Proof state:
case inr.a.refine'_1
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
x : α
⊢ Bounded r {x}

Next tactic:
apply bounded_singleton
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    rw [coe_setOf, card_typein, ← lt_ord, hr]
    apply typein_lt_type
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · apply bounded_singleton
      

Proof state:
case inr.a.refine'_1.hr
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
x : α
⊢ Ordinal.IsLimit (type r)

Next tactic:
rw [← hr]
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    rw [coe_setOf, card_typein, ← lt_ord, hr]
    apply typein_lt_type
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · apply bounded_singleton
      rw [← hr]
      

Proof state:
case inr.a.refine'_1.hr
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha✝ : #α ≠ 0
h' : IsStrongLimit #α
ha : ℵ₀ ≤ #α
x : α
⊢ Ordinal.IsLimit (ord #α)

Next tactic:
apply ord_isLimit ha
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    rw [coe_setOf, card_typein, ← lt_ord, hr]
    apply typein_lt_type
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · apply bounded_singleton
      rw [← hr]
      apply ord_isLimit ha
    · 

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

Next tactic:
intro a b hab
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  rcases eq_or_ne #α 0 with (ha | ha)
  · rw [ha]
    haveI := mk_eq_zero_iff.1 ha
    rw [mk_eq_zero_iff]
    constructor
    rintro ⟨s, hs⟩
    exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
  have h' : IsStrongLimit #α := ⟨ha, h⟩
  have ha := h'.isLimit.aleph0_le
  apply le_antisymm
  · have : { s : Set α | Bounded r s } = ⋃ i, 𝒫{ j | r j i } := setOf_exists _
    rw [← coe_setOf, this]
    refine mk_iUnion_le_sum_mk.trans ((sum_le_iSup (fun i => #(𝒫{ j | r j i }))).trans
      ((mul_le_max_of_aleph0_le_left ha).trans ?_))
    rw [max_eq_left]
    apply ciSup_le' _
    intro i
    rw [mk_powerset]
    apply (h'.two_power_lt _).le
    rw [coe_setOf, card_typein, ← lt_ord, hr]
    apply typein_lt_type
  · refine' @mk_le_of_injective α _ (fun x => Subtype.mk {x} _) _
    · apply bounded_singleton
      rw [← hr]
      apply ord_isLimit ha
    · intro a b hab
      

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

Next tactic:
simpa [singleton_eq_singleton_iff] using hab
theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, (2^x) < #α) :
    #{ s : Set α // #s < cof (#α).ord } = #α := by
  

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
⊢ #{ s // #↑s < Ordinal.cof (ord #α) } = #α

Next tactic:
rcases eq_or_ne #α 0 with (ha | ha)
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)
  · 

Proof state:
case inl
α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α = 0
⊢ #{ s // #↑s < Ordinal.cof (ord #α) } = #α

Next tactic:
simp [ha]
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]
  

Proof state:
case inr
α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
ha : #α ≠ 0
⊢ #{ s // #↑s < Ordinal.cof (ord #α) } = #α

Next tactic:
have h' : IsStrongLimit #α := ⟨ha, h⟩
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⟩
  

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

Next tactic:
rcases ord_eq α with ⟨r, wo, hr⟩
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⟩
  

Proof state:
case inr.intro.intro
α✝ : 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
⊢ #{ s // #↑s < Ordinal.cof (ord #α) } = #α

Next tactic:
haveI := wo
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
  

Proof state:
case inr.intro.intro
α✝ : 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:
apply le_antisymm
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
  · 

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:
conv_rhs => rw [← mk_bounded_subset h hr]
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 => 

Proof state:
α✝ : 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
| #α

Next tactic:
rw [← mk_bounded_subset h hr]
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]
    

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 #α) } ≤ #{ s // Bounded r s }

Next tactic:
apply mk_le_mk_of_subset