@@ -14,6 +14,9 @@ local attribute [instance] classical.prop_decidable
14
14
namespace ideal
15
15
variable (I : ideal α)
16
16
17
+ @[extensionality] lemma ext {I J : ideal α} (h : ∀ x, x ∈ I ↔ x ∈ J) : I = J :=
18
+ submodule.ext h
19
+
17
20
theorem eq_top_of_unit_mem
18
21
(x y : α) (hx : x ∈ I) (h : y * x = 1 ) : I = ⊤ :=
19
22
eq_top_iff.2 $ λ z _, calc
@@ -142,6 +145,27 @@ begin
142
145
exact SC JS ((eq_top_iff_one _).2 J0) }
143
146
end
144
147
148
+ def is_coprime (x y : α) : Prop :=
149
+ span ({x, y} : set α) = ⊤
150
+
151
+ theorem mem_span_pair {α} [comm_ring α] {x y z : α} :
152
+ z ∈ span (insert y {x} : set α) ↔ ∃ a b, a * x + b * y = z :=
153
+ begin
154
+ simp only [mem_span_insert, mem_span_singleton', exists_prop],
155
+ split,
156
+ { rintros ⟨a, b, ⟨c, hc⟩, h⟩,
157
+ exact ⟨c, a, by simp [h, hc]⟩ },
158
+ { rintro ⟨b, c, e⟩, exact ⟨c, b * x, ⟨b, rfl⟩, by simp [e.symm]⟩ }
159
+ end
160
+
161
+ theorem is_coprime_def {α} [comm_ring α] {x y : α} :
162
+ is_coprime x y ↔ ∀ z, ∃ a b, a * x + b * y = z :=
163
+ by simp [is_coprime, submodule.eq_top_iff', mem_span_pair]
164
+
165
+ theorem is_coprime_self {α} [comm_ring α] (x y : α) :
166
+ is_coprime x x ↔ is_unit x :=
167
+ by rw [← span_singleton_eq_top]; simp [is_coprime]
168
+
145
169
end ideal
146
170
147
171
def nonunits (α : Type u) [monoid α] : set α := { x | ¬is_unit x }
@@ -303,5 +327,33 @@ protected noncomputable def field (I : ideal α) [hI : I.is_maximal] : field I.q
303
327
exact classical.some_spec (exists_inv ha),
304
328
..quotient.integral_domain I }
305
329
330
+ variable [comm_ring β]
331
+
332
+ def lift (S : ideal α) (f : α → β) [is_ring_hom f] (H : ∀ (a : α), a ∈ S → f a = 0 ) :
333
+ quotient S → β :=
334
+ λ x, quotient.lift_on' x f $ λ (a b) (h : _ ∈ _),
335
+ eq_of_sub_eq_zero (by simpa only [is_ring_hom.map_sub f] using H _ h)
336
+
337
+ variables {S : ideal α} {f : α → β} [is_ring_hom f] {H : ∀ (a : α), a ∈ S → f a = 0 }
338
+
339
+ @[simp] lemma lift_mk : lift S f H (mk S a) = f a := rfl
340
+
341
+ instance : is_ring_hom (lift S f H) :=
342
+ { map_one := by show lift S f H (mk S 1 ) = 1 ; simp [is_ring_hom.map_one f, - mk_one],
343
+ map_add := λ a₁ a₂, quotient.induction_on₂' a₁ a₂ $ λ a₁ a₂, begin
344
+ show lift S f H (mk S a₁ + mk S a₂) = lift S f H (mk S a₁) + lift S f H (mk S a₂),
345
+ have := ideal.quotient.is_ring_hom_mk S,
346
+ rw ← this.map_add,
347
+ show lift S f H (mk S (a₁ + a₂)) = lift S f H (mk S a₁) + lift S f H (mk S a₂),
348
+ simp only [lift_mk, is_ring_hom.map_add f],
349
+ end ,
350
+ map_mul := λ a₁ a₂, quotient.induction_on₂' a₁ a₂ $ λ a₁ a₂, begin
351
+ show lift S f H (mk S a₁ * mk S a₂) = lift S f H (mk S a₁) * lift S f H (mk S a₂),
352
+ have := ideal.quotient.is_ring_hom_mk S,
353
+ rw ← this.map_mul,
354
+ show lift S f H (mk S (a₁ * a₂)) = lift S f H (mk S a₁) * lift S f H (mk S a₂),
355
+ simp only [lift_mk, is_ring_hom.map_mul f],
356
+ end }
357
+
306
358
end quotient
307
359
end ideal
0 commit comments