@@ -68,21 +68,23 @@ instance : has_mul (loc α S) :=
68
68
69
69
variables {α S}
70
70
71
- def of (r : α) (s : S) : loc α S := ⟦(r, s)⟧
71
+ def mk (r : α) (s : S) : loc α S := ⟦(r, s)⟧
72
+
73
+ def of (r : α) : loc α S := mk r 1
72
74
73
75
instance : comm_ring (loc α S) :=
74
76
by refine
75
77
{ add := has_add.add,
76
78
add_assoc := λ m n k, quotient.induction_on₃ m n k _,
77
- zero := of 0 1 ,
79
+ zero := of 0 ,
78
80
zero_add := quotient.ind _,
79
81
add_zero := quotient.ind _,
80
82
neg := has_neg.neg,
81
83
add_left_neg := quotient.ind _,
82
84
add_comm := quotient.ind₂ _,
83
85
mul := has_mul.mul,
84
86
mul_assoc := λ m n k, quotient.induction_on₃ m n k _,
85
- one := of 1 1 ,
87
+ one := of 1 ,
86
88
one_mul := quotient.ind _,
87
89
mul_one := quotient.ind _,
88
90
left_distrib := λ m n k, quotient.induction_on₃ m n k _,
@@ -95,33 +97,36 @@ by refine
95
97
refine (quotient.sound $ r_of_eq _),
96
98
simp [mul_left_comm, mul_add, mul_comm] }
97
99
98
- instance of.is_ring_hom : is_ring_hom (λ x, of x 1 : α → loc α S) :=
100
+ instance of.is_ring_hom : is_ring_hom (of : α → loc α S) :=
99
101
{ map_add := λ x y, quotient.sound $ by simp,
100
102
map_mul := λ x y, quotient.sound $ by simp,
101
103
map_one := rfl }
102
104
103
- instance : has_coe α (loc α S) := ⟨λ x, of x 1 ⟩
105
+ variables {S}
106
+
107
+ instance : has_coe α (loc α S) := ⟨of⟩
104
108
105
109
instance coe.is_ring_hom : is_ring_hom (coe : α → loc α S) :=
106
110
localization.of.is_ring_hom
107
111
108
112
section
109
113
variables (α S) (x y : α) (n : ℕ)
110
- @[simp] lemma of_one : (of 1 1 : loc α S) = 1 := rfl
111
- @[simp] lemma of_add : (of (x + y) 1 : loc α S) = of x 1 + of y 1 :=
112
- by apply of.is_ring_hom.map_add
114
+ @[simp] lemma of_zero : (of 0 : loc α S) = 0 := rfl
115
+ @[simp] lemma of_one : (of 1 : loc α S) = 1 := rfl
116
+ @[simp] lemma of_add : (of (x + y) : loc α S) = of x + of y :=
117
+ by apply is_ring_hom.map_add
113
118
114
- @[simp] lemma of_sub : (of (x - y) 1 : loc α S) = of x 1 - of y 1 :=
115
- @@is_ring_hom.map_sub _ _ (λ x, of x 1 ) of. is_ring_hom
119
+ @[simp] lemma of_sub : (of (x - y) : loc α S) = of x - of y :=
120
+ by apply is_ring_hom.map_sub
116
121
117
- @[simp] lemma of_mul : (of (x * y) 1 : loc α S) = of x 1 * of y 1 :=
118
- @@is_ring_hom.map_mul _ _ (λ x, of x 1 ) of. is_ring_hom
122
+ @[simp] lemma of_mul : (of (x * y) : loc α S) = of x * of y :=
123
+ by apply is_ring_hom.map_mul
119
124
120
- @[simp] lemma of_neg : (of (-x) 1 : loc α S) = -of x 1 :=
121
- @@is_ring_hom.map_neg _ _ (λ x, of x 1 ) of. is_ring_hom
125
+ @[simp] lemma of_neg : (of (-x) : loc α S) = -of x :=
126
+ by apply is_ring_hom.map_neg
122
127
123
- @[simp] lemma of_pow : (of (x ^ n) 1 : loc α S) = (of x 1 ) ^ n :=
124
- @@is_semiring_hom.map_pow _ _ (λ x, of x 1 ) (@@is_ring_hom. is_semiring_hom _ _ _ of.is_ring_hom) x n
128
+ @[simp] lemma of_pow : (of (x ^ n) : loc α S) = (of x) ^ n :=
129
+ by apply is_semiring_hom.map_pow
125
130
126
131
@[simp] lemma coe_zero : ((0 : α) : loc α S) = 0 := rfl
127
132
@[simp] lemma coe_one : ((1 : α) : loc α S) = 1 := rfl
@@ -132,45 +137,42 @@ by apply of.is_ring_hom.map_add
132
137
@[simp] lemma coe_pow : (↑(x ^ n) : loc α S) = x ^ n := of_pow _ _ _ _
133
138
end
134
139
135
- @[simp] lemma of_zero (s : S) : of 0 s = 0 :=
136
- quotient.sound ⟨s, s.2 , by simp only [mul_zero, sub_zero, zero_mul]⟩
137
-
138
- @[simp] lemma of_self {x : α} {hx : x ∈ S} :
139
- (of x ⟨x, hx⟩ : loc α S) = 1 :=
140
+ @[simp] lemma mk_self {x : α} {hx : x ∈ S} :
141
+ (mk x ⟨x, hx⟩ : loc α S) = 1 :=
140
142
quotient.sound ⟨1 , is_submonoid.one_mem S,
141
143
by simp only [subtype.coe_mk, is_submonoid.coe_one, mul_one, one_mul, sub_self]⟩
142
144
143
- @[simp] lemma of_self ' {s : S} :
144
- (of s s : loc α S) = 1 :=
145
- by cases s; exact of_self
145
+ @[simp] lemma mk_self ' {s : S} :
146
+ (mk s s : loc α S) = 1 :=
147
+ by cases s; exact mk_self
146
148
147
- @[simp] lemma of_self '' {s : S} :
148
- (of s.1 s : loc α S) = 1 :=
149
- of_self '
149
+ @[simp] lemma mk_self '' {s : S} :
150
+ (mk s.1 s : loc α S) = 1 :=
151
+ mk_self '
150
152
151
- @[simp] lemma coe_mul_of (x y : α) (s : S) :
152
- ↑x * of y s = of (x * y) s :=
153
+ @[simp] lemma coe_mul_mk (x y : α) (s : S) :
154
+ ↑x * mk y s = mk (x * y) s :=
153
155
quotient.sound $ r_of_eq $ by rw one_mul
154
156
155
- lemma of_eq_mul_of_one (r : α) (s : S) :
156
- of r s = r * of 1 s :=
157
- by rw [coe_mul_of , mul_one]
157
+ lemma mk_eq_mul_mk_one (r : α) (s : S) :
158
+ mk r s = r * mk 1 s :=
159
+ by rw [coe_mul_mk , mul_one]
158
160
159
- @[simp] lemma of_mul_of (x y : α) (s t : S) :
160
- of x s * of y t = of (x * y) (s * t) := rfl
161
+ @[simp] lemma mk_mul_mk (x y : α) (s t : S) :
162
+ mk x s * mk y t = mk (x * y) (s * t) := rfl
161
163
162
- @[simp] lemma of_mul_cancel_left (r : α) (s : S) :
163
- of (↑s * r) s = r :=
164
- by rw [of_eq_mul_of_one , mul_comm ↑s, coe_mul,
165
- mul_assoc, ← of_eq_mul_of_one, of_self ', mul_one]
164
+ @[simp] lemma mk_mul_cancel_left (r : α) (s : S) :
165
+ mk (↑s * r) s = r :=
166
+ by rw [mk_eq_mul_mk_one , mul_comm ↑s, coe_mul,
167
+ mul_assoc, ← mk_eq_mul_mk_one, mk_self ', mul_one]
166
168
167
- @[simp] lemma of_mul_cancel_right (r : α) (s : S) :
168
- of (r * s) s = r :=
169
- by rw [mul_comm, of_mul_cancel_left ]
169
+ @[simp] lemma mk_mul_cancel_right (r : α) (s : S) :
170
+ mk (r * s) s = r :=
171
+ by rw [mul_comm, mk_mul_cancel_left ]
170
172
171
173
@[elab_as_eliminator]
172
174
protected theorem induction_on {C : loc α S → Prop } (x : loc α S)
173
- (ih : ∀ r s, C (of r s : loc α S)) : C x :=
175
+ (ih : ∀ r s, C (mk r s : loc α S)) : C x :=
174
176
by rcases x with ⟨r, s⟩; exact ih r s
175
177
176
178
@[elab_with_expected_type]
@@ -212,7 +214,7 @@ instance rec.is_ring_hom {β : Type v} [comm_ring β]
212
214
@[reducible] def away (x : α) := loc α (powers x)
213
215
214
216
@[simp] def away.inv_self (x : α) : away x :=
215
- of 1 ⟨x, 1 , pow_one x⟩
217
+ mk 1 ⟨x, 1 , pow_one x⟩
216
218
217
219
@[elab_with_expected_type]
218
220
protected noncomputable def away.rec {x : α} {β : Type v} [comm_ring β]
@@ -223,7 +225,7 @@ by rw [units.coe_pow, ← classical.some_spec hfx, ← is_semiring_hom.map_pow f
223
225
noncomputable def away_to_away_right (x y : α) : away x → away (x * y) :=
224
226
localization.away.rec coe $
225
227
is_unit_of_mul_one x (y * away.inv_self (x * y)) $
226
- by rw [away.inv_self, coe_mul_of, coe_mul_of , mul_one, of_self ]
228
+ by rw [away.inv_self, coe_mul_mk, coe_mul_mk , mul_one, mk_self ]
227
229
228
230
instance away.rec.is_ring_hom {x : α} {β : Type v} [comm_ring β]
229
231
(f : α → β) [hf : is_ring_hom f] (hfx : is_unit (f x)) :
@@ -348,9 +350,20 @@ by refine
348
350
simp only [has_inv.inv, inv_aux, quotient.lift_beta, dif_neg this ],
349
351
exact (quotient.sound $ r_of_eq $ by simp [mul_comm]) }
350
352
351
- @[simp] lemma of_eq_div {r s} : (of r s : fraction_ring β) = (r / s : fraction_ring β) :=
353
+ @[simp] lemma mk_eq_div {r s} : (mk r s : fraction_ring β) = (r / s : fraction_ring β) :=
352
354
show _ = _ * dite (s.1 = 0 ) _ _, by rw [dif_neg (ne_zero_of_mem_non_zero_divisors s.2 )];
353
- exact localization.of_eq_mul_of_one _ _
355
+ exact localization.mk_eq_mul_mk_one _ _
356
+
357
+ variables {β}
358
+
359
+ lemma eq_zero_of (x : β) (h : (of x : fraction_ring β) = 0 ) : x = 0 :=
360
+ begin
361
+ rcases quotient.exact h with ⟨t, ht, ht'⟩,
362
+ simpa [ne_zero_of_mem_non_zero_divisors ht] using ht'
363
+ end
364
+
365
+ lemma of.injective : function.injective (of : β → fraction_ring β) :=
366
+ (is_add_group_hom.injective_iff _).mpr eq_zero_of
354
367
355
368
end fraction_ring
356
369
@@ -360,9 +373,9 @@ theorem map_comap (J : ideal (loc α S)) :
360
373
ideal.map coe (ideal.comap (coe : α → loc α S) J) = J :=
361
374
le_antisymm (ideal.map_le_iff_le_comap.2 (le_refl _)) $ λ x,
362
375
localization.induction_on x $ λ r s hJ, (submodule.mem_coe _).2 $
363
- mul_one r ▸ coe_mul_of r 1 s ▸ (ideal.mul_mem_right _ $ ideal.mem_map_of_mem $
376
+ mul_one r ▸ coe_mul_mk r 1 s ▸ (ideal.mul_mem_right _ $ ideal.mem_map_of_mem $
364
377
have _ := @ideal.mul_mem_left (loc α S) _ _ s _ hJ,
365
- by rwa [coe_coe, coe_mul_of, of_mul_cancel_left ] at this )
378
+ by rwa [coe_coe, coe_mul_mk, mk_mul_cancel_left ] at this )
366
379
367
380
def le_order_embedding :
368
381
((≤) : ideal (loc α S) → ideal (loc α S) → Prop ) ≼o
0 commit comments