Theorem: Cardinal.Categorical.isComplete
File: Mathlib/ModelTheory/Satisfiability.lean

tactic: obtain ⟨_, _⟩ := Theory.exists_model_card_eq ⟨hS.some, hT hS.some⟩ κ h1 h2
state_before: L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
⊢ T ⊨ᵇ φ ∨ T ⊨ᵇ Formula.not φ

tactic: rw [Theory.models_sentence_iff, Theory.models_sentence_iff]
state_before: case intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
⊢ T ⊨ᵇ φ ∨ T ⊨ᵇ Formula.not φ

tactic: by_contra con
state_before: case intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
⊢ (∀ (M : Theory.ModelType T), ↑M ⊨ φ) ∨ ∀ (M : Theory.ModelType T), ↑M ⊨ Formula.not φ

tactic: push_neg  at con
state_before: case intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
con : ¬((∀ (M : Theory.ModelType T), ↑M ⊨ φ) ∨ ∀ (M : Theory.ModelType T), ↑M ⊨ Formula.not φ)
⊢ False

tactic: obtain ⟨⟨MF, hMF⟩, MT, hMT⟩ := con
state_before: case intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
con : (∃ M, ¬↑M ⊨ φ) ∧ ∃ M, ¬↑M ⊨ Formula.not φ
⊢ False

tactic: rw [Sentence.realize_not, Classical.not_not] at hMT
state_before: case intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ¬↑MT ⊨ Formula.not φ
⊢ False

tactic: refine' hMF _
state_before: case intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ↑MT ⊨ φ
⊢ False

tactic: haveI := hT MT
state_before: case intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ↑MT ⊨ φ
⊢ ↑MF ⊨ φ

tactic: haveI := hT MF
state_before: case intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ↑MT ⊨ φ
this : Infinite ↑MT
⊢ ↑MF ⊨ φ

tactic: obtain ⟨NT, MNT, hNT⟩ := exists_elementarilyEquivalent_card_eq L MT κ h1 h2
state_before: case intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ↑MT ⊨ φ
this✝ : Infinite ↑MT
this : Infinite ↑MF
⊢ ↑MF ⊨ φ

tactic: obtain ⟨NF, MNF, hNF⟩ := exists_elementarilyEquivalent_card_eq L MF κ h1 h2
state_before: case intro.intro.intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ↑MT ⊨ φ
this✝ : Infinite ↑MT
this : Infinite ↑MF
NT : Bundled (Structure L)
MNT : ↑MT ≅[L] ↑NT
hNT : (#↑NT) = κ
⊢ ↑MF ⊨ φ

tactic: obtain ⟨TF⟩ := h (MNT.toModel T) (MNF.toModel T) hNT hNF
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ↑MT ⊨ φ
this✝ : Infinite ↑MT
this : Infinite ↑MF
NT : Bundled (Structure L)
MNT : ↑MT ≅[L] ↑NT
hNT : (#↑NT) = κ
NF : Bundled (Structure L)
MNF : ↑MF ≅[L] ↑NF
hNF : (#↑NF) = κ
⊢ ↑MF ⊨ φ

tactic: exact
  ((MNT.realize_sentence φ).trans
    ((TF.realize_sentence φ).trans (MNF.realize_sentence φ).symm)).1 hMT
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.intro
L : Language
κ : Cardinal
T : Theory L
h : Categorical κ T
h1 : ℵ₀ ≤ κ
h2 : lift (card L) ≤ lift κ
hS : Theory.IsSatisfiable T
hT : ∀ (M : Theory.ModelType T), Infinite ↑M
φ : Sentence L
w✝ : Theory.ModelType T
h✝ : (#↑w✝) = κ
MF : Theory.ModelType T
hMF : ¬↑MF ⊨ φ
MT : Theory.ModelType T
hMT : ↑MT ⊨ φ
this✝ : Infinite ↑MT
this : Infinite ↑MF
NT : Bundled (Structure L)
MNT : ↑MT ≅[L] ↑NT
hNT : (#↑NT) = κ
NF : Bundled (Structure L)
MNF : ↑MF ≅[L] ↑NF
hNF : (#↑NF) = κ
TF : ↑(ElementarilyEquivalent.toModel T MNT) ≃[L] ↑(ElementarilyEquivalent.toModel T MNF)
⊢ ↑MF ⊨ φ