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

Commit 9c48eb1

Browse files
committed
chore(ring_theory/{subring,integral_closure}): simplify a proof, remove redundant instances (#6513)
1 parent eec54d0 commit 9c48eb1

File tree

3 files changed

+19
-34
lines changed

3 files changed

+19
-34
lines changed

src/field_theory/subfield.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ instance to_field : field s :=
196196
inv_zero := subtype.ext inv_zero,
197197
mul_inv_cancel := λ x hx, subtype.ext (mul_inv_cancel (mt s.to_subring.coe_eq_zero_iff.mp hx)),
198198
exists_pair_ne := ⟨⟨0, s.zero_mem⟩, ⟨1, s.one_mem⟩, mt subtype.mk_eq_mk.mp zero_ne_one⟩,
199-
..subring.subring.domain s.to_subring }
199+
..s.to_subring.integral_domain }
200200

201201
@[simp, norm_cast] lemma coe_add (x y : s) : (↑(x + y) : K) = ↑x + ↑y := rfl
202202
@[simp, norm_cast] lemma coe_neg (x : s) : (↑(-x) : K) = -↑x := rfl

src/ring_theory/integral_closure.lean

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,14 @@ theorem is_integral_of_submodule_noetherian (S : subalgebra R A)
9292
(H : is_noetherian R (S : submodule R A)) (x : A) (hx : x ∈ S) :
9393
is_integral R x :=
9494
begin
95-
letI : algebra R S := S.algebra,
96-
letI : ring S := S.ring R A,
97-
suffices : is_integral R (⟨x, hx⟩ : S),
95+
suffices : is_integral R (show S, from ⟨x, hx⟩),
9896
{ rcases this with ⟨p, hpm, hpx⟩,
99-
replace hpx := congr_arg subtype.val hpx,
97+
replace hpx := congr_arg S.val hpx,
10098
refine ⟨p, hpm, eq.trans _ hpx⟩,
10199
simp only [aeval_def, eval₂, finsupp.sum],
102-
rw ← p.support.sum_hom subtype.val,
103-
{ refine finset.sum_congr rfl (λ n hn, _),
104-
change _ = _ * _,
105-
rw is_monoid_hom.map_pow coe, refl,
106-
split; intros; refl },
107-
refine { map_add := _, map_zero := _ }; intros; refl },
100+
rw S.val.map_sum,
101+
refine finset.sum_congr rfl (λ n hn, _),
102+
rw [S.val.map_mul, S.val.map_pow, S.val.commutes, S.val_apply, subtype.coe_mk], },
108103
refine is_integral_of_noetherian H ⟨x, hx⟩
109104
end
110105

@@ -562,10 +557,6 @@ section integral_domain
562557
variables {R S : Type*} [comm_ring R] [integral_domain S] [algebra R S]
563558

564559
instance : integral_domain (integral_closure R S) :=
565-
{ exists_pair_ne := ⟨0, 1, mt subtype.ext_iff_val.mp zero_ne_one⟩,
566-
eq_zero_or_eq_zero_of_mul_eq_zero := λ ⟨a, ha⟩ ⟨b, hb⟩ h,
567-
or.imp subtype.ext_iff_val.mpr subtype.ext_iff_val.mpr
568-
(eq_zero_or_eq_zero_of_mul_eq_zero (subtype.ext_iff_val.mp h)),
569-
..(integral_closure R S).comm_ring R S }
560+
infer_instance
570561

571562
end integral_domain

src/ring_theory/subring.lean

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,18 @@ instance to_ring : ring s :=
242242
instance to_comm_ring {R} [comm_ring R] (s : subring R) : comm_ring s :=
243243
{ mul_comm := λ _ _, subtype.eq $ mul_comm _ _, ..subring.to_ring s}
244244

245+
/-- A subring of a non-trivial ring is non-trivial. -/
246+
instance {R} [ring R] [nontrivial R] (s : subring R) : nontrivial s :=
247+
s.to_subsemiring.nontrivial
248+
249+
/-- A subring of a ring with no zero divisors has no zero divisors. -/
250+
instance {R} [ring R] [no_zero_divisors R] (s : subring R) : no_zero_divisors s :=
251+
s.to_subsemiring.no_zero_divisors
252+
253+
/-- A subring of an integral domain is an integral domain. -/
254+
instance {R} [integral_domain R] (s : subring R) : integral_domain s :=
255+
{ .. s.nontrivial, .. s.no_zero_divisors, .. s.to_comm_ring }
256+
245257
/-- The natural ring hom from a subring of ring `R` to `R`. -/
246258
def subtype (s : subring R) : s →+* R :=
247259
{ to_fun := coe,
@@ -363,24 +375,6 @@ end ring_hom
363375

364376
namespace subring
365377

366-
variables {cR : Type u} [comm_ring cR]
367-
368-
/-- A subring of a commutative ring is a commutative ring. -/
369-
def subset_comm_ring (S : subring cR) : comm_ring S :=
370-
{mul_comm := λ _ _, subtype.eq $ mul_comm _ _, ..subring.to_ring S}
371-
372-
/-- A subring of a non-trivial ring is non-trivial. -/
373-
instance {D : Type*} [ring D] [nontrivial D] (S : subring D) : nontrivial S :=
374-
S.to_subsemiring.nontrivial
375-
376-
/-- A subring of a ring with no zero divisors has no zero divisors. -/
377-
instance {D : Type*} [ring D] [no_zero_divisors D] (S : subring D) : no_zero_divisors S :=
378-
S.to_subsemiring.no_zero_divisors
379-
380-
/-- A subring of an integral domain is an integral domain. -/
381-
instance subring.domain {D : Type*} [integral_domain D] (S : subring D) : integral_domain S :=
382-
{ .. S.nontrivial, .. S.no_zero_divisors, .. S.subset_comm_ring }
383-
384378
/-! # bot -/
385379

386380
instance : has_bot (subring R) := ⟨(int.cast_ring_hom R).range⟩

0 commit comments

Comments
 (0)