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

Commit 3762d96

Browse files
ChrisHughes24digama0
authored andcommitted
feat(ring_theory/ideals): lift for quotient rings (#529)
1 parent 73933b7 commit 3762d96

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

ring_theory/ideals.lean

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ local attribute [instance] classical.prop_decidable
1414
namespace ideal
1515
variable (I : ideal α)
1616

17+
@[extensionality] lemma ext {I J : ideal α} (h : ∀ x, x ∈ I ↔ x ∈ J) : I = J :=
18+
submodule.ext h
19+
1720
theorem eq_top_of_unit_mem
1821
(x y : α) (hx : x ∈ I) (h : y * x = 1) : I = ⊤ :=
1922
eq_top_iff.2 $ λ z _, calc
@@ -142,6 +145,27 @@ begin
142145
exact SC JS ((eq_top_iff_one _).2 J0) }
143146
end
144147

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+
145169
end ideal
146170

147171
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
303327
exact classical.some_spec (exists_inv ha),
304328
..quotient.integral_domain I }
305329

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+
306358
end quotient
307359
end ideal

0 commit comments

Comments
 (0)