@@ -5,20 +5,23 @@ Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston
5
5
-/
6
6
import algebra.group.hom
7
7
import algebra.group.units
8
+ import tactic.alias
8
9
import tactic.norm_cast
9
10
import tactic.split_ifs
10
11
11
12
/-!
12
13
# Properties and homomorphisms of semirings and rings
13
14
14
15
This file proves simple properties of semirings, rings and domains and their unit groups. It also
15
- defines homomorphisms of semirings and rings, both unbundled (e.g. `is_semiring_hom f`)
16
- and bundled (e.g. `ring_hom a β`, a.k.a. `α →+* β`). The unbundled ones are deprecated
17
- and the plan is to slowly remove them from mathlib.
16
+ defines bundled homomorphisms of semirings and rings. As with monoid and groups, we use the same
17
+ structure `ring_hom a β`, a.k.a. `α →+* β`, for both homomorphism types.
18
+
19
+ The unbundled homomorphisms are defined in `deprecated/ring`. They are deprecated and the plan is to
20
+ slowly remove them from mathlib.
18
21
19
22
## Main definitions
20
23
21
- is_semiring_hom (deprecated), is_ring_hom (deprecated), ring_hom, nonzero, domain, integral_domain
24
+ ring_hom, nonzero, domain, integral_domain
22
25
23
26
## Notations
24
27
@@ -41,8 +44,8 @@ to use this method than to use type class inference.
41
44
42
45
## Tags
43
46
44
- is_ring_hom, is_semiring_hom, ring_hom, semiring_hom, semiring, comm_semiring, ring, comm_ring,
45
- domain, integral_domain, nonzero, units
47
+ ` ring_hom`, ` semiring_hom`, ` semiring`, ` comm_semiring`, ` ring`, ` comm_ring`, `domain`, `integral_domain`, `nonzero` ,
48
+ ` units`
46
49
-/
47
50
universes u v w
48
51
variables {α : Type u} {β : Type v} {γ : Type w}
@@ -62,12 +65,12 @@ class distrib (α : Type u) extends has_mul α, has_add α :=
62
65
lemma left_distrib [distrib α] (a b c : α) : a * (b + c) = a * b + a * c :=
63
66
distrib.left_distrib a b c
64
67
65
- def mul_add := @left_distrib
68
+ alias left_distrib ← mul_add
66
69
67
70
lemma right_distrib [distrib α] (a b c : α) : (a + b) * c = a * c + b * c :=
68
71
distrib.right_distrib a b c
69
72
70
- def add_mul := @right_distrib
73
+ alias right_distrib ← add_mul
71
74
72
75
@[protect_proj, ancestor has_mul has_zero]
73
76
class mul_zero_class (α : Type u) extends has_mul α, has_zero α :=
@@ -80,7 +83,8 @@ mul_zero_class.zero_mul a
80
83
@[ematch, simp] lemma mul_zero [mul_zero_class α] (a : α) : a * 0 = 0 :=
81
84
mul_zero_class.mul_zero a
82
85
83
- /-- Predicate typeclass for expressing that a (semi)ring or similar algebraic structure is nonzero. -/
86
+ /-- Predicate typeclass for expressing that a (semi)ring or similar algebraic structure
87
+ is nonzero. -/
84
88
@[protect_proj] class nonzero (α : Type u) [has_zero α] [has_one α] : Prop :=
85
89
(zero_ne_one : 0 ≠ (1 :α))
86
90
@@ -92,7 +96,9 @@ nonzero.zero_ne_one
92
96
lemma one_ne_zero [has_zero α] [has_one α] [nonzero α] : (1 :α) ≠ 0 :=
93
97
zero_ne_one.symm
94
98
95
- /- semiring -/
99
+ /-!
100
+ ### Semirings
101
+ -/
96
102
97
103
@[protect_proj, ancestor add_comm_monoid monoid distrib mul_zero_class]
98
104
class semiring (α : Type u) extends add_comm_monoid α, monoid α, distrib α, mul_zero_class α
@@ -410,7 +416,9 @@ lemma ring_hom.map_dvd (f : α →+* β) {a b : α} : a ∣ b → f a ∣ f b :=
410
416
411
417
end comm_semiring
412
418
413
- /- ring -/
419
+ /-!
420
+ ### Rings
421
+ -/
414
422
415
423
@[protect_proj, ancestor add_comm_group monoid distrib]
416
424
class ring (α : Type u) extends add_comm_group α, monoid α, distrib α
@@ -467,14 +475,14 @@ calc
467
475
a * (b - c) = a * b + a * -c : left_distrib a b (-c)
468
476
... = a * b - a * c : by simp [sub_eq_add_neg]
469
477
470
- def mul_sub := @mul_sub_left_distrib
478
+ alias mul_sub_left_distrib ← mul_sub
471
479
472
480
lemma mul_sub_right_distrib (a b c : α) : (a - b) * c = a * c - b * c :=
473
481
calc
474
482
(a - b) * c = a * c + -b * c : right_distrib a (-b) c
475
483
... = a * c - b * c : by simp [sub_eq_add_neg]
476
484
477
- def sub_mul := @mul_sub_right_distrib
485
+ alias mul_sub_right_distrib ← sub_mul
478
486
479
487
/-- An element of a ring multiplied by the additive inverse of one is the element's additive
480
488
inverse. -/
0 commit comments