|
8 | 8 | public import Mathlib.Algebra.EuclideanDomain.Defs |
9 | 9 | public import Mathlib.Algebra.Ring.Divisibility.Basic |
10 | 10 | public import Mathlib.Algebra.GroupWithZero.Divisibility |
11 | | -public import Mathlib.Algebra.Ring.Basic |
| 11 | +public import Mathlib.Algebra.Ring.Equiv |
12 | 12 |
|
13 | 13 | /-! |
14 | 14 | # 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 |
413 | 413 | end Div |
414 | 414 |
|
415 | 415 | 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