@@ -12,9 +12,9 @@ universe u
12
12
13
13
section prio
14
14
set_option default_priority 100 -- see Note [default priority]
15
-
15
+ set_option old_structure_cmd true
16
16
@[protect_proj without mul_left_not_lt r_well_founded]
17
- class euclidean_domain (α : Type u) extends nonzero_comm_ring α :=
17
+ class euclidean_domain (α : Type u) extends comm_ring α :=
18
18
(quotient : α → α → α)
19
19
(quotient_zero : ∀ a, quotient a 0 = 0 )
20
20
(remainder : α → α → α)
@@ -32,6 +32,7 @@ class euclidean_domain (α : Type u) extends nonzero_comm_ring α :=
32
32
function from weak to strong. I've currently divided the lemmas into
33
33
strong and weak depending on whether they require `val_le_mul_left` or not. -/
34
34
(mul_left_not_lt : ∀ a {b}, b ≠ 0 → ¬r (a * b) a)
35
+ (zero_ne_one : (0 : α) ≠ 1 )
35
36
end prio
36
37
37
38
namespace euclidean_domain
@@ -40,6 +41,9 @@ variables [euclidean_domain α]
40
41
41
42
local infix ` ≺ `:50 := euclidean_domain.r
42
43
44
+ @[priority 70 ] -- see Note [lower instance priority]
45
+ instance : nonzero α := ⟨euclidean_domain.zero_ne_one⟩
46
+
43
47
@[priority 70 ] -- see Note [lower instance priority]
44
48
instance : has_div α := ⟨euclidean_domain.quotient⟩
45
49
@@ -328,8 +332,6 @@ end lcm
328
332
329
333
end euclidean_domain
330
334
331
- open euclidean_domain
332
-
333
335
instance int.euclidean_domain : euclidean_domain ℤ :=
334
336
{ quotient := (/),
335
337
quotient_zero := int.div_zero,
@@ -342,7 +344,9 @@ instance int.euclidean_domain : euclidean_domain ℤ :=
342
344
exact int.mod_lt _ b0,
343
345
mul_left_not_lt := λ a b b0, not_lt_of_ge $
344
346
by rw [← mul_one a.nat_abs, int.nat_abs_mul];
345
- exact mul_le_mul_of_nonneg_left (int.nat_abs_pos_of_ne_zero b0) (nat.zero_le _) }
347
+ exact mul_le_mul_of_nonneg_left (int.nat_abs_pos_of_ne_zero b0) (nat.zero_le _),
348
+ .. int.comm_ring,
349
+ .. int.nonzero }
346
350
347
351
@[priority 100 ] -- see Note [lower instance priority]
348
352
instance field.to_euclidean_domain {K : Type u} [field K] : euclidean_domain K :=
@@ -355,4 +359,5 @@ instance field.to_euclidean_domain {K : Type u} [field K] : euclidean_domain K :
355
359
r_well_founded := well_founded.intro $ λ a, acc.intro _ $ λ b ⟨hb, hna⟩,
356
360
acc.intro _ $ λ c ⟨hc, hnb⟩, false.elim $ hnb hb,
357
361
remainder_lt := λ a b hnb, by simp [hnb],
358
- mul_left_not_lt := λ a b hnb ⟨hab, hna⟩, or.cases_on (mul_eq_zero.1 hab) hna hnb }
362
+ mul_left_not_lt := λ a b hnb ⟨hab, hna⟩, or.cases_on (mul_eq_zero.1 hab) hna hnb,
363
+ .. ‹field K› }
0 commit comments