@@ -31,7 +31,7 @@ variables [L.Structure M] [L.Structure N] [L.Structure P] [L.Structure Q]
31
31
structure elementary_embedding :=
32
32
(to_fun : M → N)
33
33
(map_formula' : ∀{n} (φ : L.formula (fin n)) (x : fin n → M),
34
- realize_formula N φ (to_fun ∘ x) ↔ realize_formula M φ x . obviously)
34
+ φ.realize (to_fun ∘ x) ↔ φ.realize x . obviously)
35
35
36
36
localized " notation A ` ↪ₑ[`:25 L `] ` B := L.elementary_embedding A B" in first_order
37
37
@@ -42,14 +42,13 @@ namespace elementary_embedding
42
42
instance has_coe_to_fun : has_coe_to_fun (M ↪ₑ[L] N) (λ _, M → N) :=
43
43
⟨λ f, f.to_fun⟩
44
44
45
- @[simp] lemma map_formula (f : M ↪ₑ[L] N) {α : Type } [fintype α] (φ : L.formula α)
46
- (x : α → M) :
47
- realize_formula N φ (f ∘ x) ↔ realize_formula M φ x :=
45
+ @[simp] lemma map_formula (f : M ↪ₑ[L] N) {α : Type } [fintype α] (φ : L.formula α) (x : α → M) :
46
+ φ.realize (f ∘ x) ↔ φ.realize x :=
48
47
begin
49
48
have g := fintype.equiv_fin α,
50
49
have h := f.map_formula' (φ.relabel g) (x ∘ g.symm),
51
- rw [realize_formula_relabel, realize_formula_relabel ,
52
- function.comp.assoc x g.symm g, g.symm_comp_self, function.comp.right_id] at h,
50
+ rw [formula.realize_relabel, formula.realize_relabel, function.comp.assoc x g.symm g ,
51
+ g.symm_comp_self, function.comp.right_id] at h,
53
52
rw [← h, iff_eq_eq],
54
53
congr,
55
54
ext y,
59
58
@[simp] lemma map_fun (φ : M ↪ₑ[L] N) {n : ℕ} (f : L.functions n) (x : fin n → M) :
60
59
φ (fun_map f x) = fun_map f (φ ∘ x) :=
61
60
begin
62
- have h := φ.map_formula (formula.graph f) (fin.snoc x (fun_map f x)),
63
- rw [realize_graph, fin.comp_snoc, realize_graph] at h,
61
+ have h := φ.map_formula (formula.graph f) (fin.cons (fun_map f x) x ),
62
+ rw [formula. realize_graph, fin.comp_cons, formula. realize_graph] at h,
64
63
rw [eq_comm, h]
65
64
end
66
65
67
66
@[simp] lemma map_const (φ : M ↪ₑ[L] N) (c : L.const) : φ c = c :=
68
- (φ.map_fun c fin.elim0 ).trans (congr rfl (funext fin.elim0))
67
+ (φ.map_fun c default ).trans fun_map_eq_coe_const
69
68
70
69
@[simp] lemma map_rel (φ : M ↪ₑ[L] N) {n : ℕ} (r : L.relations n) (x : fin n → M) :
71
70
rel_map r (φ ∘ x) ↔ rel_map r x :=
72
71
begin
73
- have h := φ.map_formula (bd_rel r ( var ∘ sum.inl) ) x,
72
+ have h := φ.map_formula (r.formula var) x,
74
73
exact h
75
74
end
76
75
77
76
@[simp] lemma injective (φ : M ↪ₑ[L] N) :
78
77
function.injective φ :=
79
78
begin
80
79
intros x y,
81
- have h := φ.map_formula (formula.equal (var 0 ) (var 1 ) : L.formula (fin 2 ))
82
- (λ i, if i = 0 then x else y),
83
- rw [realize_equal, realize_equal] at h,
84
- simp only [nat.one_ne_zero, realize_term, fin.one_eq_zero_iff, if_true, eq_self_iff_true,
80
+ have h := φ.map_formula ((var 0 ).equal (var 1 ) : L.formula (fin 2 )) (λ i, if i = 0 then x else y),
81
+ rw [formula.realize_equal, formula.realize_equal] at h,
82
+ simp only [nat.one_ne_zero, term.realize, fin.one_eq_zero_iff, if_true, eq_self_iff_true,
85
83
function.comp_app, if_false] at h,
86
84
exact h.1 ,
87
85
end
@@ -158,26 +156,32 @@ def to_elementary_embedding (f : M ≃[L] N) : M ↪ₑ[L] N :=
158
156
159
157
end equiv
160
158
161
- @[simp] lemma realize_term_substructure {α : Type } {S : L.substructure M} (v : α → S)
159
+ @[simp] lemma realize_term_substructure {α : Type * } {S : L.substructure M} (v : α → S)
162
160
(t : L.term α) :
163
- realize_term (coe ∘ v) t = (↑(realize_term v t ) : M) :=
164
- S.subtype.realize_term v t
161
+ t.realize (coe ∘ v) = (↑(t.realize v ) : M) :=
162
+ S.subtype.realize_term t
165
163
166
- @[simp] lemma realize_bounded_formula_top {α : Type } {n : ℕ} (v : α → (⊤ : L.substructure M))
167
- (xs : fin n → (⊤ : L.substructure M)) (φ : L.bounded_formula α n) :
168
- realize_bounded_formula (⊤ : L.substructure M) φ v xs ↔
169
- realize_bounded_formula M φ (coe ∘ v) (coe ∘ xs) :=
164
+ namespace substructure
165
+
166
+ @[simp] lemma realize_bounded_formula_top {α : Type *} {n : ℕ} {φ : L.bounded_formula α n}
167
+ {v : α → (⊤ : L.substructure M)} {xs : fin n → (⊤ : L.substructure M)} :
168
+ φ.realize v xs ↔ φ.realize ((coe : _ → M) ∘ v) (coe ∘ xs) :=
170
169
begin
171
- rw ← substructure.top_equiv.realize_bounded_formula v xs φ,
170
+ rw ← substructure.top_equiv.realize_bounded_formula φ,
172
171
simp,
173
172
end
174
173
175
- namespace substructure
174
+ @[simp] lemma realize_formula_top {α : Type *} {φ : L.formula α} {v : α → (⊤ : L.substructure M)} :
175
+ φ.realize v ↔ φ.realize ((coe : (⊤ : L.substructure M) → M) ∘ v) :=
176
+ begin
177
+ rw ← substructure.top_equiv.realize_formula φ,
178
+ simp,
179
+ end
176
180
177
181
/-- A substructure is elementary when every formula applied to a tuple in the subtructure
178
182
agrees with its value in the overall structure. -/
179
183
def is_elementary (S : L.substructure M) : Prop :=
180
- ∀{n} (φ : L.formula (fin n)) (x : fin n → S), realize_formula M φ ( coe ∘ x) ↔ realize_formula S φ x
184
+ ∀{n} (φ : L.formula (fin n)) (x : fin n → S), φ.realize (( coe : _ → M) ∘ x) ↔ φ.realize x
181
185
182
186
end substructure
183
187
@@ -213,11 +217,7 @@ def subtype (S : L.elementary_substructure M) : S ↪ₑ[L] M :=
213
217
214
218
/-- The substructure `M` of the structure `M` is elementary. -/
215
219
instance : has_top (L.elementary_substructure M) :=
216
- ⟨⟨⊤, λ n φ x, begin
217
- rw formula at φ,
218
- rw [realize_formula, realize_formula, realize_bounded_formula_top, iff_eq_eq],
219
- exact congr rfl (funext fin_zero_elim),
220
- end ⟩⟩
220
+ ⟨⟨⊤, λ n φ x, substructure.realize_formula_top.symm⟩⟩
221
221
222
222
instance : inhabited (L.elementary_substructure M) := ⟨⊤⟩
223
223
0 commit comments