Theorem: FirstOrder.Language.exists_elementarySubstructure_card_eq
File: Mathlib/ModelTheory/Skolem.lean

tactic: obtain ⟨s', hs'⟩ := Cardinal.le_mk_iff_exists_set.1 h4
state_before: L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h1 : ℵ₀ ≤ κ
h2 : lift (#↑s) ≤ lift κ
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
⊢ ∃ S, s ⊆ ↑S ∧ lift (#{ x // x ∈ S }) = lift κ

tactic: rw [← aleph0_le_lift.{_, w}] at h1
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h1 : ℵ₀ ≤ κ
h2 : lift (#↑s) ≤ lift κ
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
hs' : (#↑s') = lift κ
⊢ ∃ S, s ⊆ ↑S ∧ lift (#{ x // x ∈ S }) = lift κ

tactic: rw [← hs'] at h1 h2 ⊢
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h1 : ℵ₀ ≤ lift κ
h2 : lift (#↑s) ≤ lift κ
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
hs' : (#↑s') = lift κ
⊢ ∃ S, s ⊆ ↑S ∧ lift (#{ x // x ∈ S }) = lift κ

tactic: refine'
  ⟨elementarySkolem₁Reduct (closure (L.sum L.skolem₁) (s ∪ Equiv.ulift '' s')),
    (s.subset_union_left _).trans subset_closure, _⟩
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
⊢ ∃ S, s ⊆ ↑S ∧ lift (#{ x // x ∈ S }) = (#↑s')

tactic: have h := mk_image_eq_lift _ s' Equiv.ulift.injective
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
⊢ lift
      (#{ x //
          x ∈
            elementarySkolem₁Reduct
              (LowerAdjoint.toFun (closure (Language.sum L (skolem₁ L))) (s ∪ ↑Equiv.ulift '' s')) }) =
    (#↑s')

tactic: rw [lift_umax.{w, w'}, lift_id'.{w, w'}] at h
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = lift (#↑s')
⊢ lift
      (#{ x //
          x ∈
            elementarySkolem₁Reduct
              (LowerAdjoint.toFun (closure (Language.sum L (skolem₁ L))) (s ∪ ↑Equiv.ulift '' s')) }) =
    (#↑s')

tactic: rw [coeSort_elementarySkolem₁Reduct, ← h, lift_inj]
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ lift
      (#{ x //
          x ∈
            elementarySkolem₁Reduct
              (LowerAdjoint.toFun (closure (Language.sum L (skolem₁ L))) (s ∪ ↑Equiv.ulift '' s')) }) =
    (#↑s')

tactic: refine'
  le_antisymm (lift_le.1 (lift_card_closure_le.trans _))
    (mk_le_mk_of_subset ((Set.subset_union_right _ _).trans subset_closure))
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ (#{ x // x ∈ LowerAdjoint.toFun (closure (Language.sum L (skolem₁ L))) (s ∪ ↑Equiv.ulift '' s') }) =
    (#↑(↑Equiv.ulift '' s'))

tactic: rw [max_le_iff, aleph0_le_lift, ← aleph0_le_lift.{_, w'}, h, add_eq_max, max_le_iff, lift_le]
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ max ℵ₀ (lift (#↑(s ∪ ↑Equiv.ulift '' s')) + lift (#(i : ℕ) × Functions (Language.sum L (skolem₁ L)) i)) ≤
    lift (#↑(↑Equiv.ulift '' s'))

tactic: refine' ⟨h1, (mk_union_le _ _).trans _, (lift_le.2 card_functions_sum_skolem₁_le).trans _⟩
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ ℵ₀ ≤ (#↑s') ∧
    (#↑(s ∪ ↑Equiv.ulift '' s')) ≤ (#↑(↑Equiv.ulift '' s')) ∧
      lift (#(i : ℕ) × Functions (Language.sum L (skolem₁ L)) i) ≤ lift (#↑(↑Equiv.ulift '' s'))

case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ ℵ₀ ≤ lift (#↑(s ∪ ↑Equiv.ulift '' s'))

tactic: rw [← lift_le, lift_add, h, add_comm, add_eq_max h1]
state_before: case intro.refine'_1
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ (#↑s) + (#↑(↑Equiv.ulift '' s')) ≤ (#↑(↑Equiv.ulift '' s'))

tactic: exact max_le le_rfl h2
state_before: case intro.refine'_1
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ max (#↑s') (lift (#↑s)) ≤ (#↑s')

tactic: rw [lift_max, lift_aleph0, max_le_iff, aleph0_le_lift, and_comm, ← lift_le.{_, w'},
  lift_lift, lift_lift, ← aleph0_le_lift, h]
state_before: case intro.refine'_2
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ lift (max ℵ₀ (card L)) ≤ lift (#↑(↑Equiv.ulift '' s'))

tactic: refine' ⟨_, h1⟩
state_before: case intro.refine'_2
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ lift (card L) ≤ lift (#↑(↑Equiv.ulift '' s')) ∧ ℵ₀ ≤ (#↑s')

tactic: rw [← lift_lift.{w', w}]
state_before: case intro.refine'_2
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ lift (card L) ≤ lift (#↑(↑Equiv.ulift '' s'))

tactic: refine' _root_.trans (lift_le.{_, w}.2 h3) _
state_before: case intro.refine'_2
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ lift (lift (card L)) ≤ lift (#↑(↑Equiv.ulift '' s'))

tactic: rw [lift_lift, ← lift_lift.{w, max u v}, ← hs', ← h, lift_lift]
state_before: case intro.refine'_2
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ lift (lift κ) ≤ lift (#↑(↑Equiv.ulift '' s'))

tactic: refine' _root_.trans _ (lift_le.2 (mk_le_mk_of_subset (Set.subset_union_right _ _)))
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ ℵ₀ ≤ lift (#↑(s ∪ ↑Equiv.ulift '' s'))

tactic: rw [aleph0_le_lift, ← aleph0_le_lift, h]
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ ℵ₀ ≤ lift (#↑(↑Equiv.ulift '' s'))

tactic: exact h1
state_before: case intro
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
s : Set M
κ : Cardinal
h3 : lift (card L) ≤ lift κ
h4 : lift κ ≤ lift (#M)
s' : Set (ULift M)
h2 : lift (#↑s) ≤ (#↑s')
h1 : ℵ₀ ≤ (#↑s')
hs' : (#↑s') = lift κ
h : lift (#↑(↑Equiv.ulift '' s')) = (#↑s')
⊢ ℵ₀ ≤ (#↑s')