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

Commit 2d8ed1f

Browse files
committed
chore(group_theory/eckmann_hilton): use mul_one_class and is_(left|right)_id (#7370)
This ties these theorems slightly more to the rest of mathlib. The changes are: * `eckmann_hilton.comm_monoid` now promotes a `mul_one_class` to a `comm_monoid` rather than taking two `is_unital` objects. This makes it consistent with `eckmann_hilton.comm_group`. * `is_unital` is no longer a `class`, since it never had any instances and was never used as a typeclass argument. * `is_unital` is now defined in terms of `is_left_id` and `is_right_id`. * `add_group.is_unital` has been renamed to `eckmann_hilton.add_zero_class.is_unital` - the missing namespace was an accident, and the definition works much more generally than it was originally stated for.
1 parent 1742443 commit 2d8ed1f

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/group_theory/eckmann_hilton.lean

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The main application lies in proving that higher homotopy groups (`πₙ` for `n
1414
1515
## Main declarations
1616
17-
* `eckmann_hilton.comm_monoid`: If a type carries two unital binary operations that distribute
18-
over each other, then these operations are equal, and form a commutative monoid structure.
17+
* `eckmann_hilton.comm_monoid`: If a type carries a unital magma structure that distributes
18+
over a unital binary operation, then the magma is a commutative monoid.
1919
* `eckmann_hilton.comm_group`: If a type carries a group structure that distributes
2020
over a unital binary operation, then the group is commutative.
2121
@@ -31,12 +31,11 @@ local notation a `<`m`>` b := m a b
3131

3232
/-- `is_unital m e` expresses that `e : X` is a left and right unit
3333
for the binary operation `m : X → X → X`. -/
34-
class is_unital (m : X → X → X) (e : X) : Prop :=
35-
(one_mul : ∀ x : X, (e <m> x) = x)
36-
(mul_one : ∀ x : X, (x <m> e) = x)
34+
structure is_unital (m : X → X → X) (e : X) extends is_left_id _ m e, is_right_id _ m e : Prop.
3735

38-
@[to_additive add_group.is_unital]
39-
lemma group.is_unital [G : group X] : is_unital (*) (1 : X) := { ..G }
36+
@[to_additive eckmann_hilton.add_zero_class.is_unital]
37+
lemma mul_one_class.is_unital [G : mul_one_class X] : is_unital (*) (1 : X) :=
38+
is_unital.mk (by apply_instance) (by apply_instance)
4039

4140
variables {m₁ m₂ : X → X → X} {e₁ e₂ : X}
4241
variables (h₁ : is_unital m₁ e₁) (h₂ : is_unital m₂ e₂)
@@ -49,55 +48,56 @@ then they have the same unit elements.
4948
In fact, the two operations are the same, and give a commutative monoid structure,
5049
see `eckmann_hilton.comm_monoid`. -/
5150
lemma one : e₁ = e₂ :=
52-
by simpa only [h₁.one_mul, h₁.mul_one, h₂.one_mul, h₂.mul_one] using distrib e₂ e₁ e₁ e₂
51+
by simpa only [h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id] using distrib e₂ e₁ e₁ e₂
5352

5453
/-- If a type carries two unital binary operations that distribute over each other,
5554
then these operations are equal.
5655
5756
In fact, they give a commutative monoid structure, see `eckmann_hilton.comm_monoid`. -/
58-
lemma mul : (m₁ = m₂) :=
57+
lemma mul : m₁ = m₂ :=
5958
begin
6059
funext a b,
6160
calc m₁ a b = m₁ (m₂ a e₁) (m₂ e₁ b) :
62-
by simp only [one h₁ h₂ distrib, h₁.one_mul, h₁.mul_one, h₂.one_mul, h₂.mul_one]
61+
by simp only [one h₁ h₂ distrib, h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id]
6362
... = m₂ a b :
64-
by simp only [distrib, h₁.one_mul, h₁.mul_one, h₂.one_mul, h₂.mul_one]
63+
by simp only [distrib, h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id]
6564
end
6665

6766
/-- If a type carries two unital binary operations that distribute over each other,
6867
then these operations are commutative.
6968
7069
In fact, they give a commutative monoid structure, see `eckmann_hilton.comm_monoid`. -/
7170
lemma mul_comm : is_commutative _ m₂ :=
72-
⟨λ a b, by simpa [mul h₁ h₂ distrib, h₂.one_mul, h₂.mul_one] using distrib e₂ a b e₂⟩
71+
⟨λ a b, by simpa [mul h₁ h₂ distrib, h₂.left_id, h₂.right_id] using distrib e₂ a b e₂⟩
7372

7473
/-- If a type carries two unital binary operations that distribute over each other,
7574
then these operations are associative.
7675
7776
In fact, they give a commutative monoid structure, see `eckmann_hilton.comm_monoid`. -/
7877
lemma mul_assoc : is_associative _ m₂ :=
79-
⟨λ a b c, by simpa [mul h₁ h₂ distrib, h₂.one_mul, h₂.mul_one] using distrib a b e₂ c⟩
80-
81-
/-- If a type carries two unital binary operations that distribute over each other,
82-
then these operations are equal, and form a commutative monoid structure. -/
83-
@[to_additive "If a type carries two unital binary operations that distribute over each other,
84-
then these operations are equal, and form a additive commutative monoid structure."]
85-
def comm_monoid : comm_monoid X :=
86-
{ mul := m₂,
87-
one := e₂,
88-
mul_comm := (mul_comm h₁ h₂ distrib).comm,
89-
mul_assoc := (mul_assoc h₁ h₂ distrib).assoc,
90-
..h₂ }
78+
⟨λ a b c, by simpa [mul h₁ h₂ distrib, h₂.left_id, h₂.right_id] using distrib a b e₂ c⟩
9179

9280
omit h₁ h₂ distrib
9381

82+
/-- If a type carries a unital magma structure that distributes over a unital binary
83+
operations, then the magma structure is a commutative monoid. -/
84+
@[to_additive "If a type carries a unital additive magma structure that distributes over a
85+
unital binary operations, then the additive magma structure is a commutative additive monoid."]
86+
def comm_monoid [h : mul_one_class X]
87+
(distrib : ∀ a b c d, ((a * b) <m₁> (c * d)) = ((a <m₁> c) * (b <m₁> d))) : comm_monoid X :=
88+
{ mul := (*),
89+
one := 1,
90+
mul_comm := (mul_comm h₁ mul_one_class.is_unital distrib).comm,
91+
mul_assoc := (mul_assoc h₁ mul_one_class.is_unital distrib).assoc,
92+
..h }
93+
9494
/-- If a type carries a group structure that distributes over a unital binary operation,
9595
then the group is commutative. -/
9696
@[to_additive "If a type carries an additive group structure that distributes
9797
over a unital binary operation, then the additive group is commutative."]
9898
def comm_group [G : group X]
9999
(distrib : ∀ a b c d, ((a * b) <m₁> (c * d)) = ((a <m₁> c) * (b <m₁> d))) : comm_group X :=
100-
{ mul_comm := (eckmann_hilton.comm_monoid h₁ group.is_unital distrib).mul_comm,
100+
{ ..(eckmann_hilton.comm_monoid h₁ distrib),
101101
..G }
102102

103103
end eckmann_hilton

0 commit comments

Comments
 (0)