Skip to content

Commit 1c43972

Browse files
xgenereuxMaría Inés de Frutos Fernández
authored andcommitted
feat(EuclideanDomain.Basic): RingEquiv.euclideanDomain (leanprover-community#38723)
Add `RingEquiv.euclideanDomain` similar to other `RingEquiv` transport lemmas. Co-authored-by: María Inés de Frutos Fernández <[mariaines.dff@gmail.com](mailto:mariaines.dff@gmail.com)> Co-authored-by: Xavier Genereux <xaviergenereux@hotmail.com>
1 parent be4cff3 commit 1c43972

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

Mathlib/Algebra/EuclideanDomain/Basic.lean

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module
88
public import Mathlib.Algebra.EuclideanDomain.Defs
99
public import Mathlib.Algebra.Ring.Divisibility.Basic
1010
public import Mathlib.Algebra.GroupWithZero.Divisibility
11-
public import Mathlib.Algebra.Ring.Basic
11+
public import Mathlib.Algebra.Ring.Equiv
1212

1313
/-!
1414
# Lemmas about Euclidean domains
@@ -413,3 +413,28 @@ theorem div_eq_div_iff_mul_eq_mul_of_dvd {x y z t : R} (h1 : y ≠ 0) (h2 : t
413413
end Div
414414

415415
end EuclideanDomain
416+
417+
section RingEquiv
418+
419+
variable {R S : Type*} [EuclideanDomain R] [CommRing S]
420+
421+
/-- If `S` is a nontrivial commutative ring isomorphic to a Euclidean domain
422+
`R` then it is also a Euclidean domain. -/
423+
protected abbrev RingEquiv.euclideanDomain (e : S ≃+* R) : EuclideanDomain S where
424+
toNontrivial := e.nontrivial
425+
quotient a b := e.symm (e a / e b)
426+
remainder a b := e.symm (e a % e b)
427+
r a b := EuclideanDomain.r (e a) (e b)
428+
r_wellFounded := InvImage.wf e EuclideanDomain.r_wellFounded
429+
quotient_zero a := by simp
430+
quotient_mul_add_remainder_eq a b := by
431+
apply e.injective
432+
simpa using EuclideanDomain.quotient_mul_add_remainder_eq (e a) (e b)
433+
remainder_lt a b hb := by
434+
have hb' : e b ≠ 0 := by simpa using hb
435+
simpa using EuclideanDomain.remainder_lt (e a) hb'
436+
mul_left_not_lt a b hb := by
437+
have hb' : e b ≠ 0 := by simpa using hb
438+
simpa using EuclideanDomain.mul_left_not_lt (e a) hb'
439+
440+
end RingEquiv

0 commit comments

Comments
 (0)