Mathlib v3 is deprecated. Go to Mathlib v4

Commit 2021-07-05 15:47 38a6f265

View on Github →

feat(algebra/to_additive): map pow to smul (#7888)

  • Allows @[to_additive] to reorder consecutive arguments of specified identifiers.
  • This can be specified with the attribute @[to_additive_reorder n m ...] to swap arguments n and n+1, arguments m and m+1 etc. (start counting from 1).
  • The only two attributes currently in use are:
attribute [to_additive_reorder 1] has_pow
attribute [to_additive_reorder 1 4] has_pow.pow
  • It will eta-expand all expressions that have as head a declaration with attribute to_additive_reorder until they have the required number of arguments. This is required to correctly deal with partially applied terms.
  • Hack: if the first two arguments are reordered, then the first two universe variables are also reordered (this happens to be the correct behavior for has_pow and has_pow.pow). It might be cleaner to have a separate attribute for that, but that given the low amount of times that I expect that we use to_additive_reorder, this seems unnecessary.
  • This PR also allows the user to write @[to_additive?] to trace the generated declaration.

Estimated changes

deleted theorem add_monoid_hom.map_nsmul
deleted theorem add_nsmul
deleted theorem bit0_nsmul'
deleted theorem bit0_nsmul
deleted theorem bit1_nsmul'
deleted theorem bit1_nsmul
modified theorem commute.pow_left
modified theorem commute.pow_pow
modified theorem commute.pow_pow_self
modified theorem commute.pow_right
modified theorem commute.pow_self
modified theorem commute.self_pow
added theorem div_gpow
modified theorem gpow_coe_nat
modified theorem gpow_eq_pow
modified theorem gpow_neg
modified theorem gpow_neg_succ_of_nat
modified theorem gpow_one
modified theorem gpow_zero
deleted theorem gsmul_add
deleted theorem gsmul_coe_nat
deleted theorem gsmul_eq_smul
deleted theorem gsmul_neg
deleted theorem gsmul_neg_succ_of_nat
deleted theorem gsmul_of_nat
deleted theorem gsmul_sub
deleted theorem gsmul_zero
modified theorem inv_pow
modified theorem monoid_hom.map_pow
deleted theorem mul_nsmul'
deleted theorem mul_nsmul
deleted theorem neg_gsmul
deleted theorem neg_nsmul
deleted theorem neg_one_gsmul
modified theorem npow_eq_pow
deleted theorem nsmul_add
deleted theorem nsmul_add_comm'
deleted theorem nsmul_add_comm
deleted theorem nsmul_add_sub_nsmul
deleted theorem nsmul_eq_smul
deleted theorem nsmul_neg_comm
deleted theorem nsmul_sub
deleted theorem nsmul_zero
modified theorem one_gpow
deleted theorem one_gsmul
deleted theorem one_nsmul
modified theorem one_pow
modified theorem pow_one
modified theorem pow_zero
modified theorem semiconj_by.pow_right
deleted theorem sub_nsmul_nsmul_add
deleted theorem succ_nsmul'
deleted theorem succ_nsmul
deleted theorem two_nsmul
deleted theorem zero_gsmul
deleted theorem zero_nsmul
added def foo0
added def foo1
added def foo2
added def foo3
added theorem foo4_test
added def foo5
added def foo6
added def foo7
added def {a