@@ -9,6 +9,7 @@ public import Mathlib.Data.Fintype.Order
99public import Mathlib.Order.Closure
1010public import Mathlib.ModelTheory.Semantics
1111public 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,
376379theorem 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+
379408instance 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
539568theorem 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+
542579section GaloisCoinsertion
543580
544581variable {ι : Type *} {f : M →[L] N}
0 commit comments