You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
classeuclidean_domain (α : Type u) extends integral_domain α :=
14
14
(quotient : α → α → α)
15
15
(remainder : α → α → α)
16
-
(quotient_mul_add_remainder_eq : ∀ a b, (quotient a b) * b + (remainder a b) = a) -- This could be changed to the same order as int.mod_add_div. We normally write qb+r rather than r + qb though.
16
+
-- This could be changed to the same order as int.mod_add_div.
17
+
-- We normally write qb+r rather than r + qb though.
18
+
(quotient_mul_add_remainder_eq : ∀ a b, b * quotient a b + remainder a b = a)
17
19
(valuation : α → ℕ)
18
-
(valuation_remainder_lt : ∀ a b, b ≠ 0 → valuation (remainder a b) < valuation b)
19
-
(le_valuation_mul : ∀ a b, b ≠ 0 → valuation a ≤ valuation (a*b))
20
-
21
-
/-
22
-
le_valuation_mul is often not a required in definitions of a euclidean domain since given the other properties we can show there is a (noncomputable) euclidean domain α with the property le_valuation_mul.
23
-
So potentially this definition could be split into two different ones (euclidean_domain_weak and euclidean_domain_strong) with a noncomputable function from weak to strong.
24
-
I've currently divided the lemmas into strong and weak depending on whether they require le_valuation_mul or not.
25
-
-/
20
+
(val_remainder_lt : ∀ a {b}, b ≠ 0 → valuation (remainder a b) < valuation b)
21
+
/- le_valuation_mul is often not a required in definitions of a euclidean
22
+
domain since given the other properties we can show there is a
23
+
(noncomputable) euclidean domain α with the property le_valuation_mul.
24
+
So potentially this definition could be split into two different ones
25
+
(euclidean_domain_weak and euclidean_domain_strong) with a noncomputable
26
+
function from weak to strong. I've currently divided the lemmas into
27
+
strong and weak depending on whether they require le_valuation_mul or not. -/
28
+
(val_le_mul_left : ∀ a {b}, b ≠ 0 → valuation a ≤ valuation (a * b))
26
29
27
30
namespace euclidean_domain
28
31
variable {α : Type u}
29
-
variables [decidable_eq α] [euclidean_domain α]
32
+
variables [euclidean_domain α]
30
33
31
34
instance : has_div α := ⟨quotient⟩
32
35
33
36
instance : has_mod α := ⟨remainder⟩
34
37
35
-
instance : has_sizeof α := ⟨valuation⟩
36
-
37
-
lemmagcd_decreasing (a b : α) (w : a ≠ 0) : has_well_founded.r (b % a) a := valuation_remainder_lt b a w
38
-
39
-
defgcd : α → α → α
40
-
| a b := if a_zero : a = 0then b
41
-
elsehave h : has_well_founded.r (b % a) a := gcd_decreasing a b a_zero,
42
-
gcd (b%a) a
38
+
theoremdiv_add_mod (a b : α) : b * (a / b) + a % b = a :=
39
+
quotient_mul_add_remainder_eq _ _
43
40
44
-
/- weak lemmas -/
41
+
theoremval_mod_lt : ∀ a {b : α}, b ≠ 0 → valuation (a % b) < valuation b :=
42
+
val_remainder_lt
45
43
46
-
@[simp]lemmamod_zero (a : α) : a % 0 = a := by simpa using
47
-
quotient_mul_add_remainder_eq a 0
44
+
theoremval_le_mul_right {a : α} (b) (h : a ≠ 0) : valuation b ≤ valuation (a * b) :=
45
+
by rw mul_comm; exact val_le_mul_left b h
48
46
49
-
lemmadvd_mod_self (a : α) : a ∣ a % a :=
47
+
lemmamul_div_cancel_left {a : α} (b) (a0 : a ≠ 0) : a * b / a = b :=
0 commit comments