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

tactic: refine' le_trans _ (mk_bounded_set_le s c)
state_before: α : Type u
s : Set α
c : Cardinal
⊢ (#{ t // t ⊆ s ∧ (#↑t) ≤ c }) ≤ max (#↑s) ℵ₀ ^ c

tactic: refine' ⟨Embedding.codRestrict _ _ _⟩
state_before: α : Type u
s : Set α
c : Cardinal
⊢ (#{ t // t ⊆ s ∧ (#↑t) ≤ c }) ≤ (#{ t // (#↑t) ≤ c })

tactic: use fun t => (↑) ⁻¹' t.1
state_before: case refine'_1
α : Type u
s : Set α
c : Cardinal
⊢ { t // t ⊆ s ∧ (#↑t) ≤ c } ↪ Set ↑s

case refine'_2
α : Type u
s : Set α
c : Cardinal
⊢ ∀ (a : { t // t ⊆ s ∧ (#↑t) ≤ c }),
    ↑?refine'_1 a ∈ fun t =>
      Quot.lift ((fun α β => Nonempty (α ↪ β)) ↑t) (_ : ∀ (a b : Type u), a ≈ b → Nonempty (↑t ↪ a) = Nonempty (↑t ↪ b))
        c

tactic: rintro ⟨t, _, h2t⟩
state_before: case refine'_2
α : Type u
s : Set α
c : Cardinal
⊢ ∀ (a : { t // t ⊆ s ∧ (#↑t) ≤ c }),
    ↑{ toFun := fun t => Subtype.val ⁻¹' ↑t,
            inj' :=
              (_ :
                ∀ ⦃a₁ a₂ : { t // t ⊆ s ∧ (#↑t) ≤ c }⦄,
                  (fun t => Subtype.val ⁻¹' ↑t) a₁ = (fun t => Subtype.val ⁻¹' ↑t) a₂ → a₁ = a₂) }
        a ∈
      fun t =>
      Quot.lift ((fun α β => Nonempty (α ↪ β)) ↑t) (_ : ∀ (a b : Type u), a ≈ b → Nonempty (↑t ↪ a) = Nonempty (↑t ↪ b))
        c

tactic: exact (mk_preimage_of_injective _ _ Subtype.val_injective).trans h2t
state_before: case refine'_2.mk.intro
α : Type u
s : Set α
c : Cardinal
t : Set α
left✝ : t ⊆ s
h2t : (#↑t) ≤ c
⊢ ↑{ toFun := fun t => Subtype.val ⁻¹' ↑t,
          inj' :=
            (_ :
              ∀ ⦃a₁ a₂ : { t // t ⊆ s ∧ (#↑t) ≤ c }⦄,
                (fun t => Subtype.val ⁻¹' ↑t) a₁ = (fun t => Subtype.val ⁻¹' ↑t) a₂ → a₁ = a₂) }
      { val := t, property := (_ : t ⊆ s ∧ (#↑t) ≤ c) } ∈
    fun t =>
    Quot.lift ((fun α β => Nonempty (α ↪ β)) ↑t) (_ : ∀ (a b : Type u), a ≈ b → Nonempty (↑t ↪ a) = Nonempty (↑t ↪ b)) c

tactic: rintro ⟨t, ht1, ht2⟩ ⟨t', h1t', h2t'⟩ h
state_before: case refine'_1
α : Type u
s : Set α
c : Cardinal
⊢ Injective fun t => Subtype.val ⁻¹' ↑t

tactic: apply Subtype.eq
state_before: case refine'_1.mk.intro.mk.intro
α : Type u
s : Set α
c : Cardinal
t : Set α
ht1 : t ⊆ s
ht2 : (#↑t) ≤ c
t' : Set α
h1t' : t' ⊆ s
h2t' : (#↑t') ≤ c
h :
  (fun t => Subtype.val ⁻¹' ↑t) { val := t, property := (_ : t ⊆ s ∧ (#↑t) ≤ c) } =
    (fun t => Subtype.val ⁻¹' ↑t) { val := t', property := (_ : t' ⊆ s ∧ (#↑t') ≤ c) }
⊢ { val := t, property := (_ : t ⊆ s ∧ (#↑t) ≤ c) } = { val := t', property := (_ : t' ⊆ s ∧ (#↑t') ≤ c) }

tactic: dsimp only at h⊢
state_before: case refine'_1.mk.intro.mk.intro.a
α : Type u
s : Set α
c : Cardinal
t : Set α
ht1 : t ⊆ s
ht2 : (#↑t) ≤ c
t' : Set α
h1t' : t' ⊆ s
h2t' : (#↑t') ≤ c
h :
  (fun t => Subtype.val ⁻¹' ↑t) { val := t, property := (_ : t ⊆ s ∧ (#↑t) ≤ c) } =
    (fun t => Subtype.val ⁻¹' ↑t) { val := t', property := (_ : t' ⊆ s ∧ (#↑t') ≤ c) }
⊢ ↑{ val := t, property := (_ : t ⊆ s ∧ (#↑t) ≤ c) } = ↑{ val := t', property := (_ : t' ⊆ s ∧ (#↑t') ≤ c) }

tactic: refine' (preimage_eq_preimage' _ _).1 h <;> rw [Subtype.range_coe] <;> assumption
state_before: case refine'_1.mk.intro.mk.intro.a
α : Type u
s : Set α
c : Cardinal
t : Set α
ht1 : t ⊆ s
ht2 : (#↑t) ≤ c
t' : Set α
h1t' : t' ⊆ s
h2t' : (#↑t') ≤ c
h : Subtype.val ⁻¹' t = Subtype.val ⁻¹' t'
⊢ t = t'