Skip to content

Commit ecd5177

Browse files
committed
add Prod instances to match Pi instances
1 parent 20b17b9 commit ecd5177

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Mathlib/Algebra/Group/Prod.lean

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,21 @@ theorem fst_mul_snd [MulOneClass M] [MulOneClass N] (p : M × N) : (p.fst, 1) *
6464
instance [InvolutiveInv M] [InvolutiveInv N] : InvolutiveInv (M × N) :=
6565
{ inv_inv := fun _ => Prod.ext (inv_inv _) (inv_inv _) }
6666

67+
@[to_additive]
68+
instance isMulCommutative [Mul M] [Mul N] [IsMulCommutative M] [IsMulCommutative N] :
69+
IsMulCommutative (M × N) where
70+
is_comm.comm _ _ := by ext <;> apply mul_comm'
71+
72+
@[to_additive]
73+
instance commMagma [CommMagma M] [CommMagma N] : CommMagma (M × N) where
74+
mul_comm _ _ := by ext <;> apply mul_comm
75+
6776
@[to_additive]
6877
instance instSemigroup [Semigroup M] [Semigroup N] : Semigroup (M × N) where
6978
mul_assoc _ _ _ := by ext <;> exact mul_assoc ..
7079

7180
@[to_additive]
7281
instance instCommSemigroup [CommSemigroup G] [CommSemigroup H] : CommSemigroup (G × H) where
73-
mul_comm _ _ := by ext <;> exact mul_comm ..
7482

7583
@[to_additive]
7684
instance instMulOneClass [MulOneClass M] [MulOneClass N] : MulOneClass (M × N) where

0 commit comments

Comments
 (0)