Theorem: FirstOrder.Language.Theory.isSatisfiable_union_distinctConstantsTheory_of_card_le
File: Mathlib/ModelTheory/Satisfiability.lean

tactic: haveI : Inhabited M := Classical.inhabited_of_nonempty inferInstance
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : lift (#↑s) ≤ lift (#M)
⊢ IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ distinctConstantsTheory L s)

tactic: rw [Cardinal.lift_mk_le'] at h
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : lift (#↑s) ≤ lift (#M)
this : Inhabited M
⊢ IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ distinctConstantsTheory L s)

tactic: letI : (constantsOn α).Structure M := constantsOn.structure (Function.extend (↑) h.some default)
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this : Inhabited M
⊢ IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ distinctConstantsTheory L s)

tactic: have : M ⊨ (L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s := by
  refine' ((LHom.onTheory_model _ _).2 inferInstance).union _
  rw [model_distinctConstantsTheory]
  refine' fun a as b bs ab => _
  rw [← Subtype.coe_mk a as, ← Subtype.coe_mk b bs, ← Subtype.ext_iff]
  exact
    h.some.injective
      ((Subtype.coe_injective.extend_apply h.some default ⟨a, as⟩).symm.trans
        (ab.trans (Subtype.coe_injective.extend_apply h.some default ⟨b, bs⟩)))
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this✝ : Inhabited M
this : Structure (constantsOn α) M := constantsOn.structure (Function.extend Subtype.val (↑(Nonempty.some h)) default)
⊢ IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ distinctConstantsTheory L s)

tactic: exact Model.isSatisfiable M
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this✝¹ : Inhabited M
this✝ : Structure (constantsOn α) M := constantsOn.structure (Function.extend Subtype.val (↑(Nonempty.some h)) default)
this : M ⊨ LHom.onTheory (lhomWithConstants L α) T ∪ distinctConstantsTheory L s
⊢ IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ distinctConstantsTheory L s)

tactic: refine' ((LHom.onTheory_model _ _).2 inferInstance).union _
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this✝ : Inhabited M
this : Structure (constantsOn α) M := constantsOn.structure (Function.extend Subtype.val (↑(Nonempty.some h)) default)
⊢ M ⊨ LHom.onTheory (lhomWithConstants L α) T ∪ distinctConstantsTheory L s

tactic: rw [model_distinctConstantsTheory]
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this✝ : Inhabited M
this : Structure (constantsOn α) M := constantsOn.structure (Function.extend Subtype.val (↑(Nonempty.some h)) default)
⊢ M ⊨ distinctConstantsTheory L s

tactic: refine' fun a as b bs ab => _
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this✝ : Inhabited M
this : Structure (constantsOn α) M := constantsOn.structure (Function.extend Subtype.val (↑(Nonempty.some h)) default)
⊢ Set.InjOn (fun i => ↑(Language.con L i)) s

tactic: rw [← Subtype.coe_mk a as, ← Subtype.coe_mk b bs, ← Subtype.ext_iff]
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this✝ : Inhabited M
this : Structure (constantsOn α) M := constantsOn.structure (Function.extend Subtype.val (↑(Nonempty.some h)) default)
a : α
as : a ∈ s
b : α
bs : b ∈ s
ab : (fun i => ↑(Language.con L i)) a = (fun i => ↑(Language.con L i)) b
⊢ a = b

tactic: exact
  h.some.injective
    ((Subtype.coe_injective.extend_apply h.some default ⟨a, as⟩).symm.trans
      (ab.trans (Subtype.coe_injective.extend_apply h.some default ⟨b, bs⟩)))
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' T : Theory L
s : Set α
M : Type w'
inst✝² : Nonempty M
inst✝¹ : Structure L M
inst✝ : M ⊨ T
h : Nonempty (↑s ↪ M)
this✝ : Inhabited M
this : Structure (constantsOn α) M := constantsOn.structure (Function.extend Subtype.val (↑(Nonempty.some h)) default)
a : α
as : a ∈ s
b : α
bs : b ∈ s
ab : (fun i => ↑(Language.con L i)) a = (fun i => ↑(Language.con L i)) b
⊢ { val := a, property := as } = { val := b, property := bs }