Skip to content

Commit 3cd4988

Browse files
committed
feat(ModelTheory): add characterizations of complete theories (leanprover-community#32146)
Add `isComplete_eq_complete_theory` and `isComplete_iff_models_elementarily_equivalent` to connect syntactic completeness with semantic properties.
1 parent ac27902 commit 3cd4988

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Mathlib/ModelTheory/Satisfiability.lean

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,47 @@ theorem realize_sentence_iff (h : T.IsComplete) (φ : L.Sentence) (M : Type*) [L
412412
iff_of_false ((Sentence.realize_not M).1 (hφn.realize_sentence M))
413413
((h.models_not_iff φ).1 hφn)
414414

415+
/-- A complete theory is the `completeTheory` Th(M) of one of its models. -/
416+
theorem eq_complete_theory (h : T.IsComplete) (M : Type*) [L.Structure M] [M ⊨ T] [Nonempty M] :
417+
{φ | T ⊨ᵇ φ} = L.completeTheory M := by
418+
ext φ
419+
simp only [Set.mem_setOf_eq, L.mem_completeTheory]
420+
refine ⟨fun h_models => h_models.realize_sentence M, fun h_realize => ?_⟩
421+
cases h.2 φ with
422+
| inl hT => exact hT
423+
| inr hT =>
424+
have : M ⊨ φ.not := hT.realize_sentence M
425+
rw [Sentence.realize_not] at this
426+
contradiction
427+
428+
/-- A theory is complete iff it is satisfiable and all its models are elementarily equivalent. -/
429+
theorem isComplete_iff_models_elementarily_equivalent :
430+
T.IsComplete ↔
431+
T.IsSatisfiable ∧ ∀ (M N : ModelType.{u, v, max u v} T), ElementarilyEquivalent L M N := by
432+
constructor
433+
· intro hcomp
434+
refine ⟨hcomp.1, ?_⟩
435+
intro M N
436+
rw [ElementarilyEquivalent, ← hcomp.eq_complete_theory, ← hcomp.eq_complete_theory]
437+
· rintro ⟨hsat, h⟩
438+
refine ⟨hsat, ?_⟩
439+
intro φ
440+
obtain ⟨M⟩ := hsat
441+
by_cases hφ : M ⊨ φ
442+
· left
443+
exact models_sentence_iff.2 fun N => (elementarilyEquivalent_iff.1 (h M N) φ).1
444+
· right
445+
exact models_sentence_iff.2 fun N => (Sentence.realize_not N).2
446+
(mt (elementarilyEquivalent_iff.1 (h M N) φ).2 hφ)
447+
448+
/-- If a theory is complete all its models are elementarily equivalent. -/
449+
theorem models_elementarily_equivalent
450+
(h : T.IsComplete)
451+
(M N : Type*) [L.Structure M] [L.Structure N]
452+
[M ⊨ T] [N ⊨ T] [Nonempty M] [Nonempty N] :
453+
ElementarilyEquivalent L M N := by
454+
rw [ElementarilyEquivalent, ← h.eq_complete_theory, ← h.eq_complete_theory]
455+
415456
end IsComplete
416457

417458
/-- A theory is maximal when it is satisfiable and contains each sentence or its negation.

0 commit comments

Comments
 (0)