|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Jonas van der Schaaf. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Jonas van der Schaaf |
| 5 | +-/ |
| 6 | + |
| 7 | +module |
| 8 | + |
| 9 | +public import Mathlib.ModelTheory.Types |
| 10 | +public import Mathlib.Topology.Bases |
| 11 | +public import Mathlib.Topology.Connected.TotallyDisconnected |
| 12 | +public import Mathlib.Topology.Compactness.Compact |
| 13 | + |
| 14 | +/-! |
| 15 | +# Topology on the space of complete types |
| 16 | +
|
| 17 | +This file defines a topological structure on the type `CompleteType T α` (note that |
| 18 | +these are types from model theory and not types from type theory). The topology |
| 19 | +is generated by sets of the form `{p : CompleteType T α | ∃ φ, φ ∈ p}`. |
| 20 | +
|
| 21 | +Note that the contents of this file are separate from ModelTheory/Types.lean to avoid |
| 22 | +importing files from the Topology folder there. |
| 23 | +-/ |
| 24 | + |
| 25 | +open Set FirstOrder Language Theory CompleteType TopologicalSpace |
| 26 | + |
| 27 | +namespace CompleteType |
| 28 | + |
| 29 | +universe u |
| 30 | + |
| 31 | +variable {L : Language} {T : L.Theory} {α : Type _} |
| 32 | + |
| 33 | +instance : TopologicalSpace (CompleteType T α) := generateFrom (range typesWith) |
| 34 | + |
| 35 | +public lemma typesWith_basis : IsTopologicalBasis (range (typesWith (α := α) (T := T))) where |
| 36 | + exists_subset_inter := by |
| 37 | + intro t₁ ⟨φ, ht₁⟩ t₂ ⟨ψ, ht₂⟩ x hx |
| 38 | + refine ⟨typesWith (φ ⊓ ψ), ⟨φ ⊓ ψ, rfl⟩, ?_⟩ |
| 39 | + rw [typesWith_inf, ht₁, ht₂] |
| 40 | + exact ⟨hx, fun _ ↦ id⟩ |
| 41 | + sUnion_eq := by |
| 42 | + rw [←Set.univ_subset_iff] |
| 43 | + exact Set.subset_sUnion_of_mem ⟨_, typesWith_top⟩ |
| 44 | + eq_generateFrom := rfl |
| 45 | + |
| 46 | +lemma typesWith_open (φ : (L[[α]]).Sentence) : IsOpen (typesWith (T := T) φ) := |
| 47 | + isOpen_generateFrom_of_mem ⟨φ, rfl⟩ |
| 48 | + |
| 49 | +lemma typesWith_closed (φ : (L[[α]]).Sentence) : IsClosed (typesWith (T := T) φ) where |
| 50 | + isOpen_compl := by rw [←typesWith_compl]; exact typesWith_open _ |
| 51 | + |
| 52 | +lemma typesWith_clopen (φ : (L[[α]]).Sentence) : IsClopen (typesWith (T := T) φ) where |
| 53 | + left := typesWith_closed _ |
| 54 | + right := typesWith_open _ |
| 55 | + |
| 56 | +instance : TotallySeparatedSpace (CompleteType T α) := by |
| 57 | + rw [totallySeparatedSpace_iff_exists_isClopen] |
| 58 | + intro p q hpq |
| 59 | + simp only [ne_eq, SetLike.ext_iff, not_forall, not_iff] at hpq |
| 60 | + obtain ⟨φ, hφ⟩ := hpq |
| 61 | + exact (mem_or_not_mem p φ).elim |
| 62 | + (fun h ↦ ⟨typesWith φ, typesWith_clopen _, h, by change ¬φ ∈ q; rwa [←hφ, not_not]⟩) |
| 63 | + (fun h ↦ ⟨ |
| 64 | + typesWith ∼φ, |
| 65 | + typesWith_clopen _, h, |
| 66 | + by change ¬∼φ∈q; rwa [not_mem_iff,←hφ, not_not, ←not_mem_iff] |
| 67 | + ⟩) |
| 68 | + |
| 69 | + |
| 70 | +end CompleteType |
0 commit comments