Theorem: Cardinal.mk_bounded_set_le_of_infinite
File: Mathlib/SetTheory/Cardinal/Ordinal.lean

tactic: refine' le_trans _ (by rw [← add_one_eq (aleph0_le_mk α)])
state_before: α : Type u
inst✝ : Infinite α
c : Cardinal
⊢ (#{ t // (#↑t) ≤ c }) ≤ (#α) ^ c

tactic: induction' c using Cardinal.inductionOn with β
state_before: α : Type u
inst✝ : Infinite α
c : Cardinal
⊢ (#{ t // (#↑t) ≤ c }) ≤ ((#α) + 1) ^ c

tactic: fapply mk_le_of_surjective
state_before: case h
α : Type u
inst✝ : Infinite α
β : Type u
⊢ (#{ t // (#↑t) ≤ (#β) }) ≤ ((#α) + 1) ^ (#β)

tactic: rintro ⟨s, ⟨g⟩⟩
state_before: case h.hf
α : Type u
inst✝ : Infinite α
β : Type u
⊢ Surjective fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }

tactic: use fun y => if h : ∃ x : s, g x = y then Sum.inl (Classical.choose h).val else Sum.inr ⟨⟩
state_before: case h.hf.mk.intro
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
⊢ ∃ a,
    (fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) a =
      { val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: apply Subtype.eq
state_before: case h.hf.mk.intro
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
⊢ ((fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) fun y =>
      if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) =
    { val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: ext x
state_before: case h.hf.mk.intro.a
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
⊢ ↑((fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) fun y =>
        if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) =
    ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: constructor
state_before: case h.hf.mk.intro.a.h
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
⊢ x ∈
      ↑((fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) fun y =>
          if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) ↔
    x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: rw [← add_one_eq (aleph0_le_mk α)]
state_before: α : Type u
inst✝ : Infinite α
c : Cardinal
⊢ ?m.204381 ≤ (#α) ^ c

tactic: intro f
state_before: case h.f
α : Type u
inst✝ : Infinite α
β : Type u
⊢ (fun α β => β → α) (α ⊕ PUnit) β → { t // (#↑t) ≤ (#β) }

tactic: use Sum.inl ⁻¹' range f
state_before: case h.f
α : Type u
inst✝ : Infinite α
β : Type u
f : (fun α β => β → α) (α ⊕ PUnit) β
⊢ { t // (#↑t) ≤ (#β) }

tactic: refine' le_trans (mk_preimage_of_injective _ _ fun x y => Sum.inl.inj) _
state_before: case h.f
α : Type u
inst✝ : Infinite α
β : Type u
f : (fun α β => β → α) (α ⊕ PUnit) β
⊢ (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)

tactic: apply mk_range_le
state_before: case h.f
α : Type u
inst✝ : Infinite α
β : Type u
f : (fun α β => β → α) (α ⊕ PUnit) β
⊢ (#↑(range f)) ≤ (#β)

tactic: rintro ⟨y, h⟩
state_before: case h.hf.mk.intro.a.h.mp
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
⊢ x ∈
      ↑((fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) fun y =>
          if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) →
    x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: dsimp only at h
state_before: case h.hf.mk.intro.a.h.mp.intro
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
y : β
h : (fun y => if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) y = Sum.inl x
⊢ x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: by_cases h' : ∃ z : s, g z = y
state_before: case h.hf.mk.intro.a.h.mp.intro
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
y : β
h : (if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) = Sum.inl x
⊢ x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: rw [dif_pos h'] at h
state_before: case pos
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
y : β
h : (if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) = Sum.inl x
h' : ∃ z, ↑g z = y
⊢ x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: cases Sum.inl.inj h
state_before: case pos
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
y : β
h' : ∃ z, ↑g z = y
h : Sum.inl ↑(choose h') = Sum.inl x
⊢ x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: exact (Classical.choose h').2
state_before: case pos.refl
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
y : β
h' : ∃ z, ↑g z = y
h : Sum.inl ↑(choose h') = Sum.inl ↑(choose h')
⊢ ↑(choose h') ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: rw [dif_neg h'] at h
state_before: case neg
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
y : β
h : (if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) = Sum.inl x
h' : ¬∃ z, ↑g z = y
⊢ x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: cases h
state_before: case neg
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
y : β
h : Sum.inr PUnit.unit = Sum.inl x
h' : ¬∃ z, ↑g z = y
⊢ x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }

tactic: intro h
state_before: case h.hf.mk.intro.a.h.mpr
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
⊢ x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) } →
    x ∈
      ↑((fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) fun y =>
          if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit)

tactic: have : ∃ z : s, g z = g ⟨x, h⟩ := ⟨⟨x, h⟩, rfl⟩
state_before: case h.hf.mk.intro.a.h.mpr
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
⊢ x ∈
    ↑((fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) fun y =>
        if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit)

tactic: use g ⟨x, h⟩
state_before: case h.hf.mk.intro.a.h.mpr
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ x ∈
    ↑((fun f => { val := Sum.inl ⁻¹' range f, property := (_ : (#↑(Sum.inl ⁻¹' range f)) ≤ (#β)) }) fun y =>
        if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit)

tactic: dsimp only
state_before: case h.hf.mk.intro.a.h.mpr
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ (fun y => if h : ∃ x, ↑g x = y then Sum.inl ↑(choose h) else Sum.inr PUnit.unit) (↑g { val := x, property := h }) =
    Sum.inl x

tactic: rw [dif_pos this]
state_before: case h.hf.mk.intro.a.h.mpr
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ (if h_1 : ∃ x_1, ↑g x_1 = ↑g { val := x, property := h } then Sum.inl ↑(choose h_1) else Sum.inr PUnit.unit) =
    Sum.inl x

tactic: congr
state_before: case h.hf.mk.intro.a.h.mpr
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ Sum.inl ↑(choose this) = Sum.inl x

tactic: suffices : Classical.choose this = ⟨x, h⟩
state_before: case h.hf.mk.intro.a.h.mpr.e_val
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ ↑(choose this) = x

tactic: exact congr_arg Subtype.val this
state_before: case h.hf.mk.intro.a.h.mpr.e_val
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this✝ : ∃ z, ↑g z = ↑g { val := x, property := h }
this : choose this✝ = { val := x, property := h }
⊢ ↑(choose this✝) = x

case this
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ choose this = { val := x, property := h }

tactic: apply g.2
state_before: case this
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ choose this = { val := x, property := h }

tactic: exact Classical.choose_spec this
state_before: case this.a
α : Type u
inst✝ : Infinite α
β : Type u
s : Set α
g : ↑s ↪ β
x : α
h : x ∈ ↑{ val := s, property := (_ : Nonempty (↑s ↪ β)) }
this : ∃ z, ↑g z = ↑g { val := x, property := h }
⊢ Embedding.toFun g (choose this) = Embedding.toFun g { val := x, property := h }