Commit 2022-02-16 11:53 75421198
View on Github →refactor(algebra/group/basic): add extra typeclasses for negation (#11960) The new typeclasses are:
has_involutive_inv R, stating that(r⁻¹)⁻¹ = r
(instances:group,group_with_zero,ennreal,set,submonoid)has_involutive_neg R, stating that- -r = r(instances:add_group,ereal,module.ray,ray_vector,set,add_submonoid,jordan_decomposition)has_distrib_neg R, stating that-a * b = a * -b = -(a * b)(instances:ring,units,unitary,special_linear_group,GL_pos) While the original motivation only concerned the twonegtypeclasses, theto_additivemachinery forced the introduction ofhas_involutive_inv, which turned out to be used in more places than expected. Adding these typeclases removes a large number of specializedunits Rlemmas as the lemmas aboutRnow match themselves. A surprising number of lemmas elsewhere in the library can also be removed. The removed lemmas are:- Lemmas about
units(replaced byunits.has_distrib_neg):units.neg_one_pow_eq_orunits.neg_powunits.neg_pow_bit0units.neg_pow_bit1units.neg_squnits.neg_inv(nowinv_neg'for arbitrary groups with distributive negation)units.neg_negunits.neg_mulunits.mul_negunits.neg_mul_eq_neg_mulunits.neg_mul_eq_mul_negunits.neg_mul_negunits.neg_eq_neg_one_mulunits.mul_neg_oneunits.neg_one_mulsemiconj_by.units_neg_rightsemiconj_by.units_neg_right_iffsemiconj_by.units_neg_leftsemiconj_by.units_neg_left_iffsemiconj_by.units_neg_one_rightsemiconj_by.units_neg_one_leftcommute.units_neg_rightcommute.units_neg_right_iffcommute.units_neg_leftcommute.units_neg_left_iffcommute.units_neg_one_rightcommute.units_neg_one_left
- Lemmas about groups with zero (replaced by
group_with_zero.to_has_involutive_neg):inv_inv₀inv_involutive₀inv_injective₀inv_eq_iff(now shared with theinv_eq_iff_inv_eqgroup lemma)eq_inv_iff(now shared with theeq_inv_iff_eq_invgroup lemma)equiv.inv₀measurable_equiv.inv₀
- Lemmas about
ereal(replaced byereal.has_involutive_neg):ereal.neg_negereal.neg_injereal.neg_eq_neg_iffereal.neg_eq_iff_neg_eq
- Lemmas about
ennreal(replaced byennreal.has_involutive_inv):ereal.inv_invereal.inv_involutiveereal.inv_bijectiveereal.inv_eq_inv
- Other lemmas:
ray_vector.neg_negmodule.ray.neg_negmodule.ray.neg_involutivemodule.ray.eq_neg_iff_eq_negset.inv_invset.neg_negsubmonoid.inv_invadd_submonoid.neg_negAs a bonus, this provides the groupunitary Rwith a negation operator and all the lemmas listed forunitsabove. For now this doesn't attempt to unifyunits.neg_smulandneg_smul.