Skip to content

Commit 528c4e0

Browse files
feat(ModelTheory): add CardinalLTGenerated substructure API
1 parent fbf0644 commit 528c4e0

3 files changed

Lines changed: 56 additions & 3 deletions

File tree

Mathlib/ModelTheory/FinitelyGenerated.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ theorem fg_closure {s : Set M} (hs : s.Finite) : FG (closure L s) :=
7474
theorem fg_closure_singleton (x : M) : FG (closure L ({x} : Set M)) :=
7575
fg_closure (finite_singleton x)
7676

77+
theorem FG.cardinalLTGenerated {N : L.Substructure M} (hN : N.FG) {κ : Cardinal}
78+
(hκ : Cardinal.aleph0 ≤ κ) : N.CardinalLTGenerated κ := by
79+
obtain ⟨S, hS, hSN⟩ := fg_def.1 hN
80+
haveI : Finite S := hS.to_subtype
81+
exact ⟨S, hasCardinalLT_of_finite S κ hκ, hSN⟩
82+
83+
theorem cardinalLTGenerated_aleph0_iff {N : L.Substructure M} :
84+
N.CardinalLTGenerated Cardinal.aleph0 ↔ N.FG := by
85+
constructor
86+
· rintro ⟨S, hS, hSN⟩
87+
rw [hasCardinalLT_aleph0_iff] at hS
88+
exact fg_def.2 ⟨S, hS, hSN⟩
89+
· exact fun hN ↦ hN.cardinalLTGenerated le_rfl
90+
7791
theorem FG.sup {N₁ N₂ : L.Substructure M} (hN₁ : N₁.FG) (hN₂ : N₂.FG) : (N₁ ⊔ N₂).FG :=
7892
let ⟨t₁, ht₁⟩ := fg_def.1 hN₁
7993
let ⟨t₂, ht₂⟩ := fg_def.1 hN₂

Mathlib/ModelTheory/PartialEquiv.lean

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ This file defines partial isomorphisms between first-order structures.
2828
- `FirstOrder.Language.embedding_from_cg` shows that if structures `M` and `N` form an equivalence
2929
pair with `M` countably-generated, then any finite-generated partial equivalence between them
3030
can be extended to an embedding `M ↪[L] N`.
31-
- `FirstOrder.Language.equiv_from_cg` shows that if countably-generated structures `M` and `N` form
32-
an equivalence pair in both directions, then any finite-generated partial equivalence between them
33-
can be extended to an isomorphism `M [L] N`.
31+
- `FirstOrder.Language.equiv_between_cg` shows that if countably-generated structures `M` and `N`
32+
form an equivalence pair in both directions, then any finite-generated partial equivalence between
33+
them can be extended to an isomorphism `M [L] N`.
3434
- The proofs of these results are adapted in part from David Wärn's approach to countable dense
3535
linear orders, a special case of this phenomenon in the case where `L = Language.order`.
3636
@@ -528,6 +528,8 @@ theorem equiv_between_cg (M_cg : Structure.CG L M) (N_cg : Structure.CG L N)
528528
rw [toEquivOfEqTop_toEmbedding]
529529
apply Embedding.toPartialEquiv_toEmbedding
530530

531+
@[deprecated (since := "2026-06-13")] alias equiv_from_cg := equiv_between_cg
532+
531533
end FGEquiv
532534

533535
end Language

Mathlib/ModelTheory/Substructures.lean

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public import Mathlib.Data.Fintype.Order
99
public import Mathlib.Order.Closure
1010
public import Mathlib.ModelTheory.Semantics
1111
public import Mathlib.ModelTheory.Encoding
12+
public import Mathlib.SetTheory.Cardinal.HasCardinalLT
1213

1314
/-!
1415
# First-Order Substructures
@@ -22,6 +23,8 @@ substructures appearing in the algebra library.
2223
substructures of the `L`-structure `M`.
2324
- `FirstOrder.Language.Substructure.closure` is defined so that if `s : Set M`, `closure L s` is
2425
the least substructure of `M` containing `s`.
26+
- `FirstOrder.Language.Substructure.CardinalLTGenerated` is defined so that
27+
`S.CardinalLTGenerated κ` means that `S` is generated by a set of cardinality less than `κ`.
2528
- `FirstOrder.Language.Substructure.comap` is defined so that `s.comap f` is the preimage of the
2629
substructure `s` under the homomorphism `f`, as a substructure.
2730
- `FirstOrder.Language.Substructure.map` is defined so that `s.map f` is the image of the
@@ -376,6 +379,32 @@ theorem closure_iUnion {ι} (s : ι → Set M) : closure L (⋃ i, s i) = ⨆ i,
376379
theorem closure_insert (s : Set M) (m : M) : closure L (insert m s) = closure L {m} ⊔ closure L s :=
377380
closure_union {m} s
378381

382+
/-- A substructure of `M` is `κ`-generated if it is the closure of a subset of cardinality
383+
less than `κ`. -/
384+
def CardinalLTGenerated (S : L.Substructure M) (κ : Cardinal) : Prop :=
385+
∃ s : Set M, HasCardinalLT s κ ∧ closure L s = S
386+
387+
theorem cardinalLTGenerated_def {S : L.Substructure M} {κ : Cardinal} :
388+
S.CardinalLTGenerated κ ↔ ∃ s : Set M, HasCardinalLT s κ ∧ closure L s = S :=
389+
Iff.rfl
390+
391+
theorem cardinalLTGenerated_closure {s : Set M} {κ : Cardinal} (hs : HasCardinalLT s κ) :
392+
CardinalLTGenerated (closure L s) κ :=
393+
⟨s, hs, rfl⟩
394+
395+
theorem cardinalLTGenerated_closure_singleton (m : M) {κ : Cardinal}
396+
(hκ : Cardinal.aleph0 ≤ κ) : CardinalLTGenerated (closure L ({m} : Set M)) κ := by
397+
haveI : Finite ({m} : Set M) := (finite_singleton m).to_subtype
398+
exact cardinalLTGenerated_closure (hasCardinalLT_of_finite ({m} : Set M) κ hκ)
399+
400+
theorem CardinalLTGenerated.sup {S T : L.Substructure M} {κ : Cardinal}
401+
(hS : S.CardinalLTGenerated κ) (hT : T.CardinalLTGenerated κ)
402+
(hκ : Cardinal.aleph0 ≤ κ) : (S ⊔ T).CardinalLTGenerated κ :=
403+
let ⟨s, hs⟩ := cardinalLTGenerated_def.1 hS
404+
let ⟨t, ht⟩ := cardinalLTGenerated_def.1 hT
405+
cardinalLTGenerated_def.2
406+
⟨s ∪ t, hasCardinalLT_union hκ hs.1 ht.1, by rw [closure_union, hs.2, ht.2]⟩
407+
379408
instance small_bot : Small.{u} (⊥ : L.Substructure M) := by
380409
rw [← closure_empty]
381410
haveI : Small.{u} (∅ : Set M) := small_subsingleton _
@@ -539,6 +568,14 @@ theorem map_closure (f : M →[L] N) (s : Set M) : (closure L s).map f = closure
539568
theorem closure_image (f : M →[L] N) : closure L (f '' s) = map f (closure L s) :=
540569
(map_closure f s).symm
541570

571+
theorem CardinalLTGenerated.map {f : M →[L] N} {S : L.Substructure M} {κ : Cardinal}
572+
(hS : S.CardinalLTGenerated κ) : (S.map f).CardinalLTGenerated κ := by
573+
rcases hS with ⟨s, hs_card, hs⟩
574+
refine ⟨f '' s, ?_, by rw [closure_image, hs]⟩
575+
exact hs_card.of_surjective
576+
(fun x : s ↦ ⟨f x.1, x.1, x.2, rfl⟩)
577+
(by rintro ⟨_, x, hx, rfl⟩; exact ⟨⟨x, hx⟩, rfl⟩)
578+
542579
section GaloisCoinsertion
543580

544581
variable {ι : Type*} {f : M →[L] N}

0 commit comments

Comments
 (0)