@@ -57,19 +57,41 @@ instance fun_like : fun_like (M ↪ₑ[L] N) M (λ _, N) :=
57
57
ext x,
58
58
exact function.funext_iff.1 h x end }
59
59
60
- @[simp] lemma map_formula (f : M ↪ₑ[L] N) {α : Type } [fintype α] (φ : L.formula α) (x : α → M) :
61
- φ.realize (f ∘ x) ↔ φ.realize x :=
60
+ instance : has_coe_to_fun (M ↪ₑ[L] N) (λ _, M → N) := fun_like.has_coe_to_fun
61
+
62
+ @[simp] lemma map_bounded_formula (f : M ↪ₑ[L] N) {α : Type } {n : ℕ}
63
+ (φ : L.bounded_formula α n) (v : α → M) (xs : fin n → M) :
64
+ φ.realize (f ∘ v) (f ∘ xs) ↔ φ.realize v xs :=
62
65
begin
63
- have g := fintype.equiv_fin α,
64
- have h := f.map_formula' (φ.relabel g) (x ∘ g.symm),
65
- rw [formula.realize_relabel, formula.realize_relabel, function.comp.assoc x g.symm g,
66
- g.symm_comp_self, function.comp.right_id] at h,
67
- rw [← h, iff_eq_eq],
68
- congr,
69
- ext y,
70
- simp,
66
+ classical,
67
+ rw [← bounded_formula.realize_restrict_free_var set.subset.rfl, set.inclusion_eq_id, iff_eq_eq],
68
+ swap, { apply_instance },
69
+ have h := f.map_formula' ((φ.restrict_free_var id).to_formula.relabel (fintype.equiv_fin _))
70
+ ((sum.elim (v ∘ coe) xs) ∘ (fintype.equiv_fin _).symm),
71
+ simp only [formula.realize_relabel, bounded_formula.realize_to_formula, iff_eq_eq] at h,
72
+ rw [← function.comp.assoc _ _ ((fintype.equiv_fin _).symm),
73
+ function.comp.assoc _ ((fintype.equiv_fin _).symm) (fintype.equiv_fin _),
74
+ equiv.symm_comp_self, function.comp.right_id, function.comp.assoc, sum.elim_comp_inl,
75
+ function.comp.assoc _ _ sum.inr, sum.elim_comp_inr,
76
+ ← function.comp.assoc] at h,
77
+ refine h.trans _,
78
+ rw [function.comp.assoc _ _ (fintype.equiv_fin _), equiv.symm_comp_self,
79
+ function.comp.right_id, sum.elim_comp_inl, sum.elim_comp_inr, ← set.inclusion_eq_id,
80
+ bounded_formula.realize_restrict_free_var set.subset.rfl],
71
81
end
72
82
83
+ @[simp] lemma map_formula (f : M ↪ₑ[L] N) {α : Type } (φ : L.formula α) (x : α → M) :
84
+ φ.realize (f ∘ x) ↔ φ.realize x :=
85
+ by rw [formula.realize, formula.realize, ← f.map_bounded_formula, unique.eq_default (f ∘ default)]
86
+
87
+ lemma map_sentence (f : M ↪ₑ[L] N) (φ : L.sentence) :
88
+ M ⊨ φ ↔ N ⊨ φ :=
89
+ by rw [sentence.realize, sentence.realize, ← f.map_formula, unique.eq_default (f ∘ default)]
90
+
91
+ lemma Theory_model_iff (f : M ↪ₑ[L] N) (T : L.Theory) :
92
+ M ⊨ T ↔ N ⊨ T :=
93
+ by simp only [Theory.model_iff, f.map_sentence]
94
+
73
95
@[simp] lemma injective (φ : M ↪ₑ[L] N) :
74
96
function.injective φ :=
75
97
begin
84
106
instance embedding_like : embedding_like (M ↪ₑ[L] N) M N :=
85
107
{ injective' := injective }
86
108
87
- instance has_coe_to_fun : has_coe_to_fun (M ↪ₑ[L] N) (λ _, M → N) :=
88
- ⟨λ f, f.to_fun⟩
89
-
90
109
@[simp] lemma map_fun (φ : M ↪ₑ[L] N) {n : ℕ} (f : L.functions n) (x : fin n → M) :
91
110
φ (fun_map f x) = fun_map f (φ ∘ x) :=
92
111
begin
@@ -314,12 +333,7 @@ instance : inhabited (L.elementary_substructure M) := ⟨⊤⟩
314
333
315
334
@[simp] lemma realize_sentence (S : L.elementary_substructure M) (φ : L.sentence) :
316
335
S ⊨ φ ↔ M ⊨ φ :=
317
- begin
318
- have h := S.is_elementary (φ.relabel (empty.elim : empty → fin 0 )) default,
319
- rw [formula.realize_relabel, formula.realize_relabel] at h,
320
- exact (congr (congr rfl (congr rfl (unique.eq_default _))) (congr rfl (unique.eq_default _))).mp
321
- h.symm,
322
- end
336
+ S.subtype.map_sentence φ
323
337
324
338
@[simp] lemma Theory_model_iff (S : L.elementary_substructure M) (T : L.Theory) :
325
339
S ⊨ T ↔ M ⊨ T :=
0 commit comments