l3lab/ntp-mathlib huggingface dataset:
/-- The infinite pigeonhole principle -/
theorem infinite_pigeonhole {β α : Type u} (f : β → α) (h₁ : ℵ₀ ≤ #β) (h₂ : #α < (#β).ord.cof) :
    ∃ a : α, #(f ⁻¹' {a}) = #β := by
  have : ∃ a, #β ≤ #(f ⁻¹' {a}) := by
    by_contra! h
    

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

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

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
h : ∀ (a : α), #↑(f ⁻¹' {a}) < #β
⊢ #↑Set.univ < #?m.95856
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
h : ∀ (a : α), #↑(f ⁻¹' {a}) < #β
⊢ Type ?u.95855

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

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
h : ∀ (a : α), #↑(f ⁻¹' {a}) < #β
⊢ #↑(⋃ i, ?m.95928 ⁻¹' {i}) < #?m.95925
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
h : ∀ (a : α), #↑(f ⁻¹' {a}) < #β
⊢ Type ?u.95922
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
h : ∀ (a : α), #↑(f ⁻¹' {a}) < #β
⊢ Type ?u.95923
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
h₁ : ℵ₀ ≤ #β
h₂ : #α < cof (ord #β)
h : ∀ (a : α), #↑(f ⁻¹' {a}) < #β
⊢ ?m.95925 → ?m.95927

Next tactic:
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
    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))
  

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

Next tactic:
cases' this with x h
/-- The infinite pigeonhole principle -/
theorem infinite_pigeonhole {β α : Type u} (f : β → α) (h₁ : ℵ₀ ≤ #β) (h₂ : #α < (#β).ord.cof) :
    ∃ a : α, #(f ⁻¹' {a}) = #β := by
  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))
  cases' this with x h
  

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

Next tactic:
refine' ⟨x, h.antisymm' _⟩
/-- The infinite pigeonhole principle -/
theorem infinite_pigeonhole {β α : Type u} (f : β → α) (h₁ : ℵ₀ ≤ #β) (h₂ : #α < (#β).ord.cof) :
    ∃ a : α, #(f ⁻¹' {a}) = #β := by
  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))
  cases' this with x h
  refine' ⟨x, h.antisymm' _⟩
  

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

Next tactic:
rw [le_mk_iff_exists_set]
/-- The infinite pigeonhole principle -/
theorem infinite_pigeonhole {β α : Type u} (f : β → α) (h₁ : ℵ₀ ≤ #β) (h₂ : #α < (#β).ord.cof) :
    ∃ a : α, #(f ⁻¹' {a}) = #β := by
  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))
  cases' this with x h
  refine' ⟨x, h.antisymm' _⟩
  rw [le_mk_iff_exists_set]
  

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

Next tactic:
exact ⟨_, rfl⟩
/-- Pigeonhole principle for a cardinality below the cardinality of the domain -/
theorem infinite_pigeonhole_card {β α : Type u} (f : β → α) (θ : Cardinal) (hθ : θ ≤ #β)
    (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) : ∃ a : α, θ ≤ #(f ⁻¹' {a}) := by
  

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

Next tactic:
rcases le_mk_iff_exists_set.1 hθ with ⟨s, rfl⟩
/-- Pigeonhole principle for a cardinality below the cardinality of the domain -/
theorem infinite_pigeonhole_card {β α : Type u} (f : β → α) (θ : Cardinal) (hθ : θ ≤ #β)
    (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) : ∃ a : α, θ ≤ #(f ⁻¹' {a}) := by
  rcases le_mk_iff_exists_set.1 hθ with ⟨s, rfl⟩
  

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

Next tactic:
cases' infinite_pigeonhole (f ∘ Subtype.val : s → α) h₁ h₂ with a ha
/-- Pigeonhole principle for a cardinality below the cardinality of the domain -/
theorem infinite_pigeonhole_card {β α : Type u} (f : β → α) (θ : Cardinal) (hθ : θ ≤ #β)
    (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) : ∃ a : α, θ ≤ #(f ⁻¹' {a}) := by
  rcases le_mk_iff_exists_set.1 hθ with ⟨s, rfl⟩
  cases' infinite_pigeonhole (f ∘ Subtype.val : s → α) h₁ h₂ with a ha
  

Proof state:
case intro.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
s : Set β
hθ : #↑s ≤ #β
h₁ : ℵ₀ ≤ #↑s
h₂ : #α < cof (ord #↑s)
a : α
ha : #↑(f ∘ Subtype.val ⁻¹' {a}) = #↑s
⊢ ∃ a, #↑s ≤ #↑(f ⁻¹' {a})

Next tactic:
use a
/-- Pigeonhole principle for a cardinality below the cardinality of the domain -/
theorem infinite_pigeonhole_card {β α : Type u} (f : β → α) (θ : Cardinal) (hθ : θ ≤ #β)
    (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) : ∃ a : α, θ ≤ #(f ⁻¹' {a}) := by
  rcases le_mk_iff_exists_set.1 hθ with ⟨s, rfl⟩
  cases' infinite_pigeonhole (f ∘ Subtype.val : s → α) h₁ h₂ with a ha
  use a; 

Proof state:
case h
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
s : Set β
hθ : #↑s ≤ #β
h₁ : ℵ₀ ≤ #↑s
h₂ : #α < cof (ord #↑s)
a : α
ha : #↑(f ∘ Subtype.val ⁻¹' {a}) = #↑s
⊢ #↑s ≤ #↑(f ⁻¹' {a})

Next tactic:
rw [← ha, @preimage_comp _ _ _ Subtype.val f]
/-- Pigeonhole principle for a cardinality below the cardinality of the domain -/
theorem infinite_pigeonhole_card {β α : Type u} (f : β → α) (θ : Cardinal) (hθ : θ ≤ #β)
    (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) : ∃ a : α, θ ≤ #(f ⁻¹' {a}) := by
  rcases le_mk_iff_exists_set.1 hθ with ⟨s, rfl⟩
  cases' infinite_pigeonhole (f ∘ Subtype.val : s → α) h₁ h₂ with a ha
  use a; rw [← ha, @preimage_comp _ _ _ Subtype.val f]
  

Proof state:
case h
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
f : β → α
s : Set β
hθ : #↑s ≤ #β
h₁ : ℵ₀ ≤ #↑s
h₂ : #α < cof (ord #↑s)
a : α
ha : #↑(f ∘ Subtype.val ⁻¹' {a}) = #↑s
⊢ #↑(Subtype.val ⁻¹' (f ⁻¹' {a})) ≤ #↑(f ⁻¹' {a})

Next tactic:
exact mk_preimage_of_injective _ _ Subtype.val_injective
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  

Proof state:
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
⊢ ∃ a t, ∃ (h : t ⊆ s), θ ≤ #↑t ∧ ∀ ⦃x : β⦄ (hx : x ∈ t), f { val := x, property := (_ : x ∈ s) } = a

Next tactic:
cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  

Proof state:
case intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
⊢ ∃ a t, ∃ (h : t ⊆ s), θ ≤ #↑t ∧ ∀ ⦃x : β⦄ (hx : x ∈ t), f { val := x, property := (_ : x ∈ s) } = a

Next tactic:
refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
  · 

Proof state:
case intro.refine'_1
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
⊢ {x | ∃ (h : x ∈ s), f { val := x, property := h } = a} ⊆ s

Next tactic:
rintro x ⟨hx, _⟩
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
  · rintro x ⟨hx, _⟩
    

Proof state:
case intro.refine'_1.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
x : β
hx : x ∈ s
h✝ : f { val := x, property := hx } = a
⊢ x ∈ s

Next tactic:
exact hx
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
  · rintro x ⟨hx, _⟩
    exact hx
  · 

Proof state:
case intro.refine'_2
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
⊢ θ ≤ #↑{x | ∃ (h : x ∈ s), f { val := x, property := h } = a}

Next tactic:
refine'
      ha.trans
        (ge_of_eq <|
          Quotient.sound ⟨Equiv.trans _ (Equiv.subtypeSubtypeEquivSubtypeExists _ _).symm⟩)
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
  · rintro x ⟨hx, _⟩
    exact hx
  · refine'
      ha.trans
        (ge_of_eq <|
          Quotient.sound ⟨Equiv.trans _ (Equiv.subtypeSubtypeEquivSubtypeExists _ _).symm⟩)
    

Proof state:
case intro.refine'_2
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
⊢ ↑{x | ∃ (h : x ∈ s), f { val := x, property := h } = a} ≃
    { a_1 // ∃ (h : a_1 ∈ s), { val := a_1, property := h } ∈ f ⁻¹' {a} }

Next tactic:
simp only [coe_eq_subtype, mem_singleton_iff, mem_preimage, mem_setOf_eq]
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
  · rintro x ⟨hx, _⟩
    exact hx
  · refine'
      ha.trans
        (ge_of_eq <|
          Quotient.sound ⟨Equiv.trans _ (Equiv.subtypeSubtypeEquivSubtypeExists _ _).symm⟩)
    simp only [coe_eq_subtype, mem_singleton_iff, mem_preimage, mem_setOf_eq]
    

Proof state:
case intro.refine'_2
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
⊢ { x // ∃ (h : x ∈ s), f { val := x, property := h } = a } ≃
    { a_1 // ∃ (h : a_1 ∈ s), f { val := a_1, property := (_ : a_1 ∈ s) } = a }

Next tactic:
rfl
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
  · rintro x ⟨hx, _⟩
    exact hx
  · refine'
      ha.trans
        (ge_of_eq <|
          Quotient.sound ⟨Equiv.trans _ (Equiv.subtypeSubtypeEquivSubtypeExists _ _).symm⟩)
    simp only [coe_eq_subtype, mem_singleton_iff, mem_preimage, mem_setOf_eq]
    rfl
  

Proof state:
case intro.refine'_3
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
⊢ ∀ ⦃x : β⦄ (hx : x ∈ {x | ∃ (h : x ∈ s), f { val := x, property := h } = a}),
    f { val := x, property := (_ : x ∈ s) } = a

Next tactic:
rintro x ⟨_, hx'⟩
theorem infinite_pigeonhole_set {β α : Type u} {s : Set β} (f : s → α) (θ : Cardinal)
    (hθ : θ ≤ #s) (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) :
    ∃ (a : α) (t : Set β) (h : t ⊆ s), θ ≤ #t ∧ ∀ ⦃x⦄ (hx : x ∈ t), f ⟨x, h hx⟩ = a := by
  cases' infinite_pigeonhole_card f θ hθ h₁ h₂ with a ha
  refine' ⟨a, { x | ∃ h, f ⟨x, h⟩ = a }, _, _, _⟩
  · rintro x ⟨hx, _⟩
    exact hx
  · refine'
      ha.trans
        (ge_of_eq <|
          Quotient.sound ⟨Equiv.trans _ (Equiv.subtypeSubtypeEquivSubtypeExists _ _).symm⟩)
    simp only [coe_eq_subtype, mem_singleton_iff, mem_preimage, mem_setOf_eq]
    rfl
  rintro x ⟨_, hx'⟩; 

Proof state:
case intro.refine'_3.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
β α : Type u
s : Set β
f : ↑s → α
θ : Cardinal.{u}
hθ : θ ≤ #↑s
h₁ : ℵ₀ ≤ θ
h₂ : #α < cof (ord θ)
a : α
ha : θ ≤ #↑(f ⁻¹' {a})
x : β
w✝ : x ∈ s
hx' : f { val := x, property := w✝ } = a
⊢ f { val := x, property := (_ : x ∈ s) } = a

Next tactic:
exact hx'
theorem isStrongLimit_aleph0 : IsStrongLimit ℵ₀ :=
  ⟨aleph0_ne_zero, fun x hx => by
    

Proof state:
α : Type u_1
r : α → α → Prop
x : Cardinal.{u_2}
hx : x < ℵ₀
⊢ 2 ^ x < ℵ₀

Next tactic:
rcases lt_aleph0.1 hx with ⟨n, rfl⟩
theorem isStrongLimit_aleph0 : IsStrongLimit ℵ₀ :=
  ⟨aleph0_ne_zero, fun x hx => by
    rcases lt_aleph0.1 hx with ⟨n, rfl⟩
    

Proof state:
case intro
α : Type u_1
r : α → α → Prop
n : ℕ
hx : ↑n < ℵ₀
⊢ 2 ^ ↑n < ℵ₀

Next tactic:
exact mod_cast nat_lt_aleph0 (2 ^ n)
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  

Proof state:
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
H : IsSuccLimit o
⊢ IsStrongLimit (beth o)

Next tactic:
rcases eq_or_ne o 0 with (rfl | h)
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · 

Proof state:
case inl
α : Type u_1
r : α → α → Prop
H : IsSuccLimit 0
⊢ IsStrongLimit (beth 0)

Next tactic:
rw [beth_zero]
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · rw [beth_zero]
    

Proof state:
case inl
α : Type u_1
r : α → α → Prop
H : IsSuccLimit 0
⊢ IsStrongLimit ℵ₀

Next tactic:
exact isStrongLimit_aleph0
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · rw [beth_zero]
    exact isStrongLimit_aleph0
  · 

Proof state:
case inr
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
H : IsSuccLimit o
h : o ≠ 0
⊢ IsStrongLimit (beth o)

Next tactic:
refine' ⟨beth_ne_zero o, fun a ha => _⟩
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · rw [beth_zero]
    exact isStrongLimit_aleph0
  · refine' ⟨beth_ne_zero o, fun a ha => _⟩
    

Proof state:
case inr
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
H : IsSuccLimit o
h : o ≠ 0
a : Cardinal.{u_2}
ha : a < beth o
⊢ 2 ^ a < beth o

Next tactic:
rw [beth_limit ⟨h, isSuccLimit_iff_succ_lt.1 H⟩] at ha
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · rw [beth_zero]
    exact isStrongLimit_aleph0
  · refine' ⟨beth_ne_zero o, fun a ha => _⟩
    rw [beth_limit ⟨h, isSuccLimit_iff_succ_lt.1 H⟩] at ha
    

Proof state:
case inr
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
H : IsSuccLimit o
h : o ≠ 0
a : Cardinal.{u_2}
ha : a < ⨆ a, beth ↑a
⊢ 2 ^ a < beth o

Next tactic:
rcases exists_lt_of_lt_ciSup' ha with ⟨⟨i, hi⟩, ha⟩
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · rw [beth_zero]
    exact isStrongLimit_aleph0
  · refine' ⟨beth_ne_zero o, fun a ha => _⟩
    rw [beth_limit ⟨h, isSuccLimit_iff_succ_lt.1 H⟩] at ha
    rcases exists_lt_of_lt_ciSup' ha with ⟨⟨i, hi⟩, ha⟩
    

Proof state:
case inr.intro.mk
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
H : IsSuccLimit o
h : o ≠ 0
a : Cardinal.{u_2}
ha✝ : a < ⨆ a, beth ↑a
i : Ordinal.{u_2}
hi : i ∈ Iio o
ha : a < beth ↑{ val := i, property := hi }
⊢ 2 ^ a < beth o

Next tactic:
have := power_le_power_left two_ne_zero ha.le
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · rw [beth_zero]
    exact isStrongLimit_aleph0
  · refine' ⟨beth_ne_zero o, fun a ha => _⟩
    rw [beth_limit ⟨h, isSuccLimit_iff_succ_lt.1 H⟩] at ha
    rcases exists_lt_of_lt_ciSup' ha with ⟨⟨i, hi⟩, ha⟩
    have := power_le_power_left two_ne_zero ha.le
    

Proof state:
case inr.intro.mk
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
H : IsSuccLimit o
h : o ≠ 0
a : Cardinal.{u_2}
ha✝ : a < ⨆ a, beth ↑a
i : Ordinal.{u_2}
hi : i ∈ Iio o
ha : a < beth ↑{ val := i, property := hi }
this : 2 ^ a ≤ 2 ^ beth ↑{ val := i, property := hi }
⊢ 2 ^ a < beth o

Next tactic:
rw [← beth_succ] at this
theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o) := by
  rcases eq_or_ne o 0 with (rfl | h)
  · rw [beth_zero]
    exact isStrongLimit_aleph0
  · refine' ⟨beth_ne_zero o, fun a ha => _⟩
    rw [beth_limit ⟨h, isSuccLimit_iff_succ_lt.1 H⟩] at ha
    rcases exists_lt_of_lt_ciSup' ha with ⟨⟨i, hi⟩, ha⟩
    have := power_le_power_left two_ne_zero ha.le
    rw [← beth_succ] at this
    

Proof state:
case inr.intro.mk
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
H : IsSuccLimit o
h : o ≠ 0
a : Cardinal.{u_2}
ha✝ : a < ⨆ a, beth ↑a
i : Ordinal.{u_2}
hi : i ∈ Iio o
ha : a < beth ↑{ val := i, property := hi }
this : 2 ^ a ≤ beth (succ ↑{ val := i, property := hi })
⊢ 2 ^ a < beth o

Next tactic:
exact this.trans_lt (beth_lt.2 (H.succ_lt hi))
theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by
  

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

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

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

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

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

Next tactic:
haveI := mk_eq_zero_iff.1 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
    

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

Next tactic:
rw [mk_eq_zero_iff]
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]
    

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

Next tactic:
constructor
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
    

Proof state:
case inl.false
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha : #α = 0
this : IsEmpty α
⊢ { s // Bounded r s } → False

Next tactic:
rintro ⟨s, hs⟩
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⟩
    

Proof state:
case inl.false.mk
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
α : Type u_2
h : ∀ x < #α, 2 ^ x < #α
r : α → α → Prop
inst✝ : IsWellOrder α r
hr : ord #α = type r
ha : #α = 0
this : IsEmpty α
s : Set α
hs : Bounded r s
⊢ False

Next tactic:
exact (not_unbounded_iff s).2 hs (unbounded_of_isEmpty s)
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)
  

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

Next tactic:
have h' : IsStrongLimit #α := ⟨ha, h⟩