Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit ab60244

Browse files
committed
feat(model_theory/basic,bundled): Structures induced by equivalences (#13124)
Defines `equiv.induced_Structure`, a structure on the codomain of a bijection that makes the bijection an isomorphism. Defines maps on bundled models to shift them along bijections and up and down universes.
1 parent 9f3e7fb commit ab60244

File tree

3 files changed

+54
-8
lines changed

3 files changed

+54
-8
lines changed

src/model_theory/basic.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Aaron Anderson, Jesse Michael Han, Floris van Doorn
66
import data.fin.vec_notation
77
import data.fin.tuple.basic
88
import logic.encodable.basic
9+
import logic.small
910
import set_theory.cardinal
1011
import category_theory.concrete_category.bundled
1112

@@ -628,3 +629,22 @@ end sum_Structure
628629

629630
end language
630631
end first_order
632+
633+
namespace equiv
634+
open first_order first_order.language first_order.language.Structure
635+
open_locale first_order
636+
637+
variables {L : language} {M : Type*} {N : Type*} [L.Structure M]
638+
639+
/-- A structure induced by a bijection. -/
640+
@[simps] def induced_Structure (e : M ≃ N) : L.Structure N :=
641+
⟨λ n f x, e (fun_map f (e.symm ∘ x)), λ n r x, rel_map r (e.symm ∘ x)⟩
642+
643+
/-- A bijection as a first-order isomorphism with the induced structure on the codomain. -/
644+
@[simps] def induced_Structure_equiv (e : M ≃ N) :
645+
@language.equiv L M N _ (induced_Structure e) :=
646+
{ map_fun' := λ n f x, by simp [← function.comp.assoc e.symm e x],
647+
map_rel' := λ n r x, by simp [← function.comp.assoc e.symm e x],
648+
.. e }
649+
650+
end equiv

src/model_theory/bundled.lean

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This file bundles types together with their first-order structure.
1818
1919
-/
2020

21-
universes u v w
21+
universes u v w w'
2222

2323
variables {L : first_order.language.{u v}}
2424

@@ -73,6 +73,24 @@ instance : inhabited (Model (∅ : L.Theory)) :=
7373

7474
end inhabited
7575

76+
variable {T}
77+
78+
/-- Maps a bundled model along a bijection. -/
79+
def equiv_induced {M : Model.{u v w} T} {N : Type w'} (e : M ≃ N) :
80+
Model.{u v w'} T :=
81+
{ carrier := N,
82+
struc := e.induced_Structure,
83+
is_model := @equiv.Theory_model L M N _ e.induced_Structure T e.induced_Structure_equiv _,
84+
nonempty' := e.symm.nonempty }
85+
86+
/-- Shrinks a small model to a particular universe. -/
87+
noncomputable def shrink (M : Model.{u v w} T) [small.{w'} M] :
88+
Model.{u v w'} T := equiv_induced (equiv_shrink M)
89+
90+
/-- Lifts a model to a particular universe. -/
91+
def ulift (M : Model.{u v w} T) : Model.{u v (max w w')} T :=
92+
equiv_induced (equiv.ulift.symm : M ≃ _)
93+
7694
end Model
7795

7896
variables {T}

src/model_theory/semantics.lean

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,9 @@ end
580580

581581
end bounded_formula
582582

583-
@[simp] lemma equiv.realize_bounded_formula (g : M ≃[L] N) (φ : L.bounded_formula α n)
583+
namespace equiv
584+
585+
@[simp] lemma realize_bounded_formula (g : M ≃[L] N) (φ : L.bounded_formula α n)
584586
{v : α → M} {xs : fin n → M} :
585587
φ.realize (g ∘ v) (g ∘ xs) ↔ φ.realize v xs :=
586588
begin
@@ -601,13 +603,19 @@ begin
601603
exact h' }}
602604
end
603605

604-
@[simp] lemma equiv.realize_formula (g : M ≃[L] N) (φ : L.formula α) {v : α → M} :
606+
@[simp] lemma realize_formula (g : M ≃[L] N) (φ : L.formula α) {v : α → M} :
605607
φ.realize (g ∘ v) ↔ φ.realize v :=
606-
begin
607-
rw [formula.realize, formula.realize, ← g.realize_bounded_formula φ,
608-
iff_eq_eq],
609-
exact congr rfl (funext fin_zero_elim),
610-
end
608+
by rw [formula.realize, formula.realize, ← g.realize_bounded_formula φ,
609+
iff_eq_eq, unique.eq_default (g ∘ default)]
610+
611+
lemma realize_sentence (g : M ≃[L] N) (φ : L.sentence) :
612+
M ⊨ φ ↔ N ⊨ φ :=
613+
by rw [sentence.realize, sentence.realize, ← g.realize_formula, unique.eq_default (g ∘ default)]
614+
615+
lemma Theory_model (g : M ≃[L] N) [M ⊨ T] : N ⊨ T :=
616+
⟨λ φ hφ, (g.realize_sentence φ).1 (Theory.realize_sentence_of_mem T hφ)⟩
617+
618+
end equiv
611619

612620
namespace relations
613621
open bounded_formula

0 commit comments

Comments
 (0)