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

Commit da01792

Browse files
committed
refactor(*): remove integral_domain, rename domain to is_domain (#9748)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 3c11bd7 commit da01792

File tree

80 files changed

+381
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+381
-481
lines changed

archive/imo/imo1962_q4.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ terms, `a ^ 2 * (2 * a ^ 2 - 1) * (4 * a ^ 2 - 3)`, being equal to zero.
9999

100100
/-- Someday, when there is a Grobner basis tactic, try to automate this proof. (A little tricky --
101101
the ideals are not the same but their Jacobson radicals are.) -/
102-
lemma formula {R : Type*} [comm_ring R] [integral_domain R] [char_zero R] (a : R) :
102+
lemma formula {R : Type*} [comm_ring R] [is_domain R] [char_zero R] (a : R) :
103103
a ^ 2 + (2 * a ^ 2 - 1) ^ 2 + (4 * a ^ 3 - 3 * a) ^ 2 = 1
104104
↔ (2 * a ^ 2 - 1) * (4 * a ^ 3 - 3 * a) = 0 :=
105105
calc a ^ 2 + (2 * a ^ 2 - 1) ^ 2 + (4 * a ^ 3 - 3 * a) ^ 2 = 1

src/algebra/algebra/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ by { convert this, ext, rw [algebra.smul_def, mul_one] },
359359
smul_left_injective R one_ne_zero
360360

361361
variables {R A}
362-
lemma iff_algebra_map_injective [ring A] [domain A] [algebra R A] :
362+
lemma iff_algebra_map_injective [ring A] [is_domain A] [algebra R A] :
363363
no_zero_smul_divisors R A ↔ function.injective (algebra_map R A) :=
364364
⟨@@no_zero_smul_divisors.algebra_map_injective R A _ _ _ _,
365365
no_zero_smul_divisors.of_algebra_map_injective⟩

src/algebra/algebra/bilinear.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,17 @@ variables {R A : Type*} [comm_semiring R] [ring A] [algebra R A]
130130

131131
lemma lmul_left_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
132132
function.injective (lmul_left R x) :=
133-
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
133+
by { letI : is_domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
134134
exact mul_right_injective₀ hx }
135135

136136
lemma lmul_right_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
137137
function.injective (lmul_right R x) :=
138-
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
138+
by { letI : is_domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
139139
exact mul_left_injective₀ hx }
140140

141141
lemma lmul_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
142142
function.injective (lmul R A x) :=
143-
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
143+
by { letI : is_domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
144144
exact mul_right_injective₀ hx }
145145

146146
end

src/algebra/algebra/subalgebra.lean

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,9 @@ instance no_zero_divisors {R A : Type*} [comm_ring R] [semiring A] [no_zero_divi
372372
[algebra R A] (S : subalgebra R A) : no_zero_divisors S :=
373373
S.to_subsemiring.no_zero_divisors
374374

375-
instance domain {R A : Type*} [comm_ring R] [ring A] [domain A] [algebra R A]
376-
(S : subalgebra R A) : domain S :=
377-
subring.domain S.to_subring
378-
379-
instance integral_domain {R A : Type*} [comm_ring R] [comm_ring A] [integral_domain A] [algebra R A]
380-
(S : subalgebra R A) : integral_domain S :=
381-
subring.integral_domain S.to_subring
375+
instance is_domain {R A : Type*} [comm_ring R] [ring A] [is_domain A] [algebra R A]
376+
(S : subalgebra R A) : is_domain S :=
377+
subring.is_domain S.to_subring
382378

383379
end subalgebra
384380

src/algebra/char_p/algebra.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ char_p_of_injective_algebra_map (is_fraction_ring.injective R K) p
9191
lemma char_zero_of_is_fraction_ring [char_zero R] : char_zero K :=
9292
@char_p.char_p_to_char_zero K _ (char_p_of_is_fraction_ring R 0)
9393

94-
variables [integral_domain R]
94+
variables [is_domain R]
9595

9696
/-- If `R` has characteristic `p`, then so does `fraction_ring R`. -/
9797
instance char_p [char_p R p] : char_p (fraction_ring R) p :=

src/algebra/euclidean_domain.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ Euclidean domain, transfinite Euclidean domain, Bézout's lemma
6060

6161
universe u
6262

63-
/-- A `euclidean_domain` is an `integral_domain` with a division and a remainder, satisfying
64-
`b * (a / b) + a % b = a`. The definition of a euclidean domain usually includes a valuation
65-
function `R → ℕ`. This definition is slightly generalised to include a well founded relation
63+
/-- A `euclidean_domain` is an non-trivial commutative ring with a division and a remainder,
64+
satisfying `b * (a / b) + a % b = a`.
65+
The definition of a euclidean domain usually includes a valuation function `R → ℕ`.
66+
This definition is slightly generalised to include a well founded relation
6667
`r` with the property that `r (a % b) b`, instead of a valuation. -/
6768
@[protect_proj without mul_left_not_lt r_well_founded]
6869
class euclidean_domain (R : Type u) extends comm_ring R, nontrivial R :=
@@ -317,7 +318,7 @@ by { have := @xgcd_aux_P _ _ _ a b a b 1 0 0 1
317318
rwa [xgcd_aux_val, xgcd_val] at this }
318319

319320
@[priority 70] -- see Note [lower instance priority]
320-
instance (R : Type*) [e : euclidean_domain R] : integral_domain R :=
321+
instance (R : Type*) [e : euclidean_domain R] : is_domain R :=
321322
by { haveI := classical.dec_eq R, exact
322323
{ eq_zero_or_eq_zero_of_mul_eq_zero :=
323324
λ a b h, (or_iff_not_and_not.2 $ λ h0,

src/algebra/field.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ lemma add_div_eq_mul_add_div (a b : K) {c : K} (hc : c ≠ 0) : a + b / c = (a *
161161
(eq_div_iff_mul_eq hc).2 $ by rw [right_distrib, (div_mul_cancel _ hc)]
162162

163163
@[priority 100] -- see Note [lower instance priority]
164-
instance division_ring.to_domain : domain K :=
165-
{ ..‹division_ring K›, ..(by apply_instance : semiring K),
164+
instance division_ring.is_domain : is_domain K :=
165+
{ ..‹division_ring K›,
166166
..(by apply_instance : no_zero_divisors K) }
167167

168168
end division_ring
@@ -223,8 +223,8 @@ by rwa [add_comm, add_div', add_comm]
223223
by simpa using div_sub_div a b hc one_ne_zero
224224

225225
@[priority 100] -- see Note [lower instance priority]
226-
instance field.to_integral_domain : integral_domain K :=
227-
{ ..‹field K›, ..division_ring.to_domain }
226+
instance field.is_domain : is_domain K :=
227+
{ ..division_ring.is_domain }
228228

229229
end field
230230

src/algebra/gcd_monoid/basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import data.nat.gcd
1111
/-!
1212
# Monoids with normalization functions, `gcd`, and `lcm`
1313
14-
This file defines extra structures on `comm_cancel_monoid_with_zero`s, including `integral_domain`s.
14+
This file defines extra structures on `comm_cancel_monoid_with_zero`s, including `is_domain`s.
1515
1616
## Main Definitions
1717
@@ -706,9 +706,9 @@ instance normalization_monoid_of_unique_units : normalization_monoid α :=
706706

707707
end unique_unit
708708

709-
section integral_domain
709+
section is_domain
710710

711-
variables [comm_ring α] [integral_domain α] [normalized_gcd_monoid α]
711+
variables [comm_ring α] [is_domain α] [normalized_gcd_monoid α]
712712

713713
lemma gcd_eq_of_dvd_sub_right {a b c : α} (h : a ∣ b - c) : gcd a b = gcd a c :=
714714
begin
@@ -729,7 +729,7 @@ end
729729
lemma gcd_eq_of_dvd_sub_left {a b c : α} (h : a ∣ b - c) : gcd b a = gcd c a :=
730730
by rw [gcd_comm _ a, gcd_comm _ a, gcd_eq_of_dvd_sub_right h]
731731

732-
end integral_domain
732+
end is_domain
733733

734734
section constructors
735735
noncomputable theory

src/algebra/gcd_monoid/finset.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ end gcd
199199
end finset
200200

201201
namespace finset
202-
section integral_domain
202+
section is_domain
203203

204-
variables [comm_ring α] [integral_domain α] [normalized_gcd_monoid α]
204+
variables [comm_ring α] [is_domain α] [normalized_gcd_monoid α]
205205

206206
lemma gcd_eq_of_dvd_sub {s : finset β} {f g : β → α} {a : α}
207207
(h : ∀ x : β, x ∈ s → a ∣ f x - g x) :
@@ -218,6 +218,6 @@ begin
218218
exact congr_arg _ (gcd_eq_of_dvd_sub_right (h _ (mem_insert_self _ _)))
219219
end
220220

221-
end integral_domain
221+
end is_domain
222222

223223
end finset

src/algebra/group_power/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ by rw [sq, sq, mul_self_sub_mul_self]
416416

417417
alias sq_sub_sq ← pow_two_sub_pow_two
418418

419-
lemma eq_or_eq_neg_of_sq_eq_sq [comm_ring R] [integral_domain R] (a b : R) (h : a ^ 2 = b ^ 2) :
419+
lemma eq_or_eq_neg_of_sq_eq_sq [comm_ring R] [is_domain R] (a b : R) (h : a ^ 2 = b ^ 2) :
420420
a = b ∨ a = -b :=
421421
by rwa [← add_eq_zero_iff_eq_neg, ← sub_eq_zero, or_comm, ← mul_eq_zero,
422422
← sq_sub_sq a b, sub_eq_zero]

0 commit comments

Comments
 (0)