Skip to content

Commit 01233d2

Browse files
committed
Compactness Proof
1 parent 75d29e4 commit 01233d2

2 files changed

Lines changed: 29 additions & 115 deletions

File tree

Mathlib/ModelTheory/Topology/Types.lean

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/-
22
Copyright (c) 2025 Jonas van der Schaaf. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Jonas van der Schaaf
4+
Authors: Jonas van der Schaaf, Anish Rajeev
55
-/
66

77
module
@@ -66,5 +66,33 @@ instance : TotallySeparatedSpace (CompleteType T α) := by
6666
by change ¬∼φ∈q; rwa [not_mem_iff,←hφ, not_not, ←not_mem_iff]
6767
⟩)
6868

69+
instance {n : ℕ} : CompactSpace (T.CompleteType (Fin n)) := by
70+
constructor
71+
rw[isCompact_iff_ultrafilter_le_nhds]
72+
intros F _
73+
refine ⟨⟨{φ | typesWith φ ∈ F}, ?_, ?_⟩, ?_⟩
74+
· intro φ x
75+
exact F.mem_of_superset Filter.univ_mem (fun p _ ↦ p.subset x)
76+
· rw [Theory.IsMaximal, Theory.isSatisfiable_iff_isFinitelySatisfiable]
77+
refine ⟨?_, ?_⟩
78+
· rw[Theory.IsFinitelySatisfiable]
79+
intro x hx
80+
have : ∀ φ ∈ x, typesWith φ ∈ F.toFilter := by intro φ hφ ; exact hx hφ
81+
rw[←Filter.biInter_finset_mem x] at this
82+
obtain ⟨T, T_inter⟩ := F.neBot.nonempty_of_mem this
83+
have subset : SetLike.coe x ⊆ T.toTheory := by rwa[Set.mem_iInter₂] at T_inter
84+
exact Theory.IsSatisfiable.mono T.isMaximal'.1 subset
85+
· intro φ
86+
simp [mem_setOf_eq, typesWith_compl]
87+
exact Ultrafilter.mem_or_compl_mem F (typesWith φ)
88+
· refine ⟨trivial, ?_⟩
89+
· rw [nhds_generateFrom]
90+
apply le_iInf₂
91+
intro _ h
92+
rw [Filter.le_principal_iff]
93+
obtain ⟨_, rfl⟩ := h.2
94+
exact h.1
95+
96+
instance {n : ℕ} : BaireSpace (T.CompleteType (Fin n)) := BaireSpace.of_t2Space_locallyCompactSpace
6997

7098
end CompleteType

Mathlib/ModelTheory/Types.lean

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -237,120 +237,6 @@ theorem exists_modelType_is_realized_in (p : T.CompleteType α) :
237237

238238
end
239239

240-
namespace TypeSpace
241-
242-
variable {T : L.Theory}
243-
244-
/-- Defines the basis for the Type Space and defines a function from formulas to basic
245-
clopen sets -/
246-
def basis {n : ℕ} : Set (Set (T.CompleteType (Fin n))) := {U | ∃ φ, U = {s | φ ∈ s}}
247-
/-- Clopen balls indexed by the sentence φ -/
248-
def BasicOpen {n : ℕ} (φ : L[[Fin n]].Sentence) : Set (T.CompleteType (Fin n)) :=
249-
{s : T.CompleteType (Fin n) | φ ∈ s}
250-
251-
lemma finite_inter {n : ℕ} : FiniteInter (α := T.CompleteType (Fin n)) basis := by
252-
constructor
253-
· use ⊤
254-
ext x
255-
simp
256-
exact Theory.CompleteType.mem_of_models x (fun _ _ _ a ↦ a)
257-
· rintro s ⟨φ, rfl⟩ t ⟨ψ, rfl⟩
258-
use φ ⊓ ψ
259-
ext t
260-
simp
261-
simp_rw[← SetLike.mem_coe, t.isMaximal.mem_iff_models (φ ⊓ ψ), t.isMaximal.mem_iff_models φ,
262-
t.isMaximal.mem_iff_models ψ, Theory.models_sentence_iff]
263-
constructor
264-
· rintro ⟨a, b⟩ M
265-
exact Formula.realize_inf.2 ⟨a M, b M⟩
266-
· intro a
267-
rw [←forall_and]
268-
intro M
269-
exact Formula.realize_inf.1 (a M)
270-
271-
lemma basic_open_compl {n : ℕ} (T : L.Theory) (φ : L[[Fin n]].Sentence) :
272-
BasicOpen (T := T) φ.not = (BasicOpen φ)ᶜ := by
273-
ext p; exact p.not_mem_iff φ
274-
275-
instance (n : ℕ) : TopologicalSpace (T.CompleteType (Fin n)) := generateFrom basis
276-
277-
instance {n : ℕ} : T0Space (T.CompleteType (Fin n)) := by
278-
rw [t0Space_iff_inseparable]
279-
intro x y a
280-
apply SetLike.ext
281-
intro φ
282-
replace h := inseparable_iff_forall_isOpen.1 a
283-
have b : IsOpen (X := (T.CompleteType (Fin n))) (BasicOpen φ) := by
284-
apply TopologicalSpace.GenerateOpen.basic
285-
use φ; trivial
286-
exact h (BasicOpen φ) b
287-
288-
instance {n : ℕ} : TotallySeparatedSpace (T.CompleteType (Fin n)) := by
289-
apply totallySeparatedSpace_of_t0_of_basis_clopen
290-
have a := isTopologicalBasis_of_subbasis_of_finiteInter
291-
(α := T.CompleteType (Fin n)) (s := basis) (by trivial) finite_inter
292-
apply IsTopologicalBasis.of_isOpen_of_subset
293-
· intro _ h; exact h.2
294-
· exact a
295-
· intro s ⟨φ, b⟩
296-
constructor
297-
· have h : IsOpen sᶜ := by
298-
replace b : s = BasicOpen φ := b
299-
rw[b, ←basic_open_compl]
300-
apply TopologicalSpace.GenerateOpen.basic
301-
exact ⟨φ.not, by trivial⟩
302-
rw[←compl_compl s]
303-
exact isClosed_compl_iff.2 h
304-
· apply TopologicalSpace.GenerateOpen.basic; use φ
305-
306-
instance {n : ℕ} : T2Space (T.CompleteType (Fin n)) := TotallySeparatedSpace.t2Space
307-
308-
instance {n : ℕ} : CompactSpace (T.CompleteType (Fin n)) := by
309-
constructor
310-
rw[isCompact_iff_ultrafilter_le_nhds]
311-
intros F _
312-
let x : L[[Fin n]].Theory := {φ | BasicOpen φ ∈ F}
313-
have a : (L.lhomWithConstants (Fin n)).onTheory T ⊆ x := by
314-
intro φ a
315-
have b : BasicOpen (T := T) φ = Set.univ := by
316-
ext y
317-
simp
318-
exact y.subset a
319-
rw[Set.mem_setOf_eq, b]
320-
exact Filter.univ_mem
321-
have b : Theory.IsMaximal x := by
322-
rw[Theory.IsMaximal]
323-
constructor
324-
· rw[Theory.isSatisfiable_iff_isFinitelySatisfiable, Theory.IsFinitelySatisfiable]
325-
intro φᵢ a
326-
have b : ∀ φ ∈ φᵢ, BasicOpen φ ∈ F.toFilter := by
327-
intro _ b
328-
exact a b
329-
rw[←Filter.biInter_finset_mem φᵢ] at b
330-
obtain ⟨y, c⟩ := F.neBot.nonempty_of_mem b
331-
have d : SetLike.coe φᵢ ⊆ y.toTheory := by
332-
rwa[Set.mem_iInter₂] at c
333-
exact Theory.IsSatisfiable.mono y.isMaximal'.1 d
334-
· intro φ
335-
rcases Ultrafilter.mem_or_compl_mem F (BasicOpen φ) with a | b
336-
· exact Or.inl a
337-
· rw[←basic_open_compl T φ] at b
338-
exact Or.inr b
339-
let p : T.CompleteType (Fin n) := ⟨x, a, b⟩
340-
use p
341-
constructor
342-
· trivial
343-
· rw [nhds_generateFrom]
344-
apply le_iInf₂
345-
intro _ a
346-
simp
347-
obtain ⟨_, rfl⟩ := a.2
348-
exact a.1
349-
350-
instance {n : ℕ} : BaireSpace (T.CompleteType (Fin n)) := BaireSpace.of_t2Space_locallyCompactSpace
351-
352-
end TypeSpace
353-
354240
end Theory
355241

356242
end Language

0 commit comments

Comments
 (0)