Skip to content

Commit

Permalink
fix(algebra/group/pi): use correct div/sub (#5625)
Browse files Browse the repository at this point in the history
Without an explicit `div := has_div.div`, `rw [pi.sub_apply]` fails sometimes.
  • Loading branch information
urkud committed Jan 6, 2021
1 parent 3d6ba9a commit 3892155
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/algebra/group/pi.lean
Expand Up @@ -36,14 +36,20 @@ by refine_struct { one := (1 : Π i, f i), mul := (*), .. }; tactic.pi_instance_
instance comm_monoid [∀ i, comm_monoid $ f i] : comm_monoid (Π i : I, f i) :=
by refine_struct { one := (1 : Π i, f i), mul := (*), .. }; tactic.pi_instance_derive_field

@[to_additive]
instance div_inv_monoid [∀ i, div_inv_monoid $ f i] :
div_inv_monoid (Π i : I, f i) :=
{ div_eq_mul_inv := λ x y, funext (λ i, div_eq_mul_inv (x i) (y i)),
.. pi.monoid, .. pi.has_div, .. pi.has_inv }

@[to_additive]
instance group [∀ i, group $ f i] : group (Π i : I, f i) :=
by refine_struct { one := (1 : Π i, f i), mul := (*), inv := has_inv.inv, .. };
by refine_struct { one := (1 : Π i, f i), mul := (*), inv := has_inv.inv, div := has_div.div, .. };
tactic.pi_instance_derive_field

@[to_additive]
instance comm_group [∀ i, comm_group $ f i] : comm_group (Π i : I, f i) :=
by refine_struct { one := (1 : Π i, f i), mul := (*), inv := has_inv.inv, .. };
by refine_struct { one := (1 : Π i, f i), mul := (*), inv := has_inv.inv, div := has_div.div, .. };
tactic.pi_instance_derive_field

@[to_additive add_left_cancel_semigroup]
Expand All @@ -65,12 +71,6 @@ instance comm_monoid_with_zero [∀ i, comm_monoid_with_zero $ f i] :
by refine_struct { zero := (0 : Π i, f i), one := (1 : Π i, f i), mul := (*), .. };
tactic.pi_instance_derive_field

@[to_additive]
instance div_inv_monoid [∀ i, div_inv_monoid $ f i] :
div_inv_monoid (Π i : I, f i) :=
{ div_eq_mul_inv := λ x y, funext (λ i, div_eq_mul_inv (x i) (y i)),
.. pi.monoid, .. pi.has_div, .. pi.has_inv }

section instance_lemmas
open function

Expand Down

0 comments on commit 3892155

Please sign in to comment.