Commit 2024-05-15 09:43 3e51ad14

View on Github →

move(Algebra/Parity): Split file (#12829) Parity of elements in a group/ring is a basic algebraic concept, but it currently requires importing a bunch of algebraic order theory. As a consequence, Algebra.Parity currently holds a bunch of lemmas that really belong in earlier files but cannot due to import cycles. This PR moves the content of Algebra.Parity to

  • Algebra.Group.Even for the definition of IsSquare and Even
  • Algebra.Ring.Parity for the definition of Odd and ring properties of Even
  • Algebra.Order.Group.Abs, Algebra.Order.Ring.Abs, Algebra.Order.Ring.Canonical, Algebra.Order.Sub.Canonical, Algebra.GroupPower.Order for the various algebraic order properties of Even and Odd As a result, Even/Odd are available much more widely without awkward dependencies and algebraic order lemmas are now in the correct files. The only slight downfall is that two lemmas in Algebra.Ring.Parity are stated using Set.range, hence I had to weaken a few assert_not_exists to forbidding Data.Set.Basic instead of Data.Set.Defs. This is inconsequential. A side-effect of this PR is that I had to move some bit0/bit1 lemmas. I could not find anywhere sensible to put them, so I am currently keeping them in Algebra.Parity. As a result, I had to reprove a few lemmas in Algebra.GroupPower.Order. I took the opportunity to generalise them. This is a followup to https://github.com/leanprover-community/mathlib/pull/17391 motivated by https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Mathlib.2EAlgebra.2EAssociated and the move-only part of #11863.

Estimated changes

added theorem Even.isSquare_pow
added theorem Even.isSquare_zpow
added theorem IsSquare.div
added theorem IsSquare.map
added theorem IsSquare.mul
added theorem IsSquare.pow
added theorem IsSquare.zpow
added def IsSquare
added theorem IsSquare_sq
added theorem even_ofMul_iff
added theorem even_toAdd_iff
added theorem isSquare_iff_exists_sq
added theorem isSquare_inv
added theorem isSquare_mul_self
added theorem isSquare_ofAdd_iff
added theorem isSquare_one
added theorem isSquare_op_iff
added theorem isSquare_toMul_iff
added theorem isSquare_unop_iff
deleted theorem Dvd.dvd.even
deleted theorem Even.add_odd
deleted theorem Even.add_one
deleted theorem Even.isSquare_pow
deleted theorem Even.isSquare_zpow
deleted theorem Even.mul_left
deleted theorem Even.mul_right
deleted theorem Even.neg_one_pow
deleted theorem Even.neg_one_zpow
deleted theorem Even.neg_pow
deleted theorem Even.neg_zpow
deleted theorem Even.odd_add
deleted theorem Even.one_add
deleted theorem Even.pow_of_ne_zero
deleted theorem Even.sub_odd
deleted theorem Even.trans_dvd
deleted theorem Even.tsub
deleted theorem IsSquare.div
deleted theorem IsSquare.map
deleted theorem IsSquare.mul
deleted theorem IsSquare.pow
deleted theorem IsSquare.zpow
deleted def IsSquare
deleted theorem IsSquare_sq
deleted theorem Odd.add_even
deleted theorem Odd.add_odd
deleted theorem Odd.map
deleted theorem Odd.mul
deleted theorem Odd.neg
deleted theorem Odd.neg_one_pow
deleted theorem Odd.neg_pow
deleted theorem Odd.pos
deleted theorem Odd.pow
deleted theorem Odd.pow_add_pow_eq_zero
deleted theorem Odd.sub_even
deleted theorem Odd.sub_odd
deleted def Odd
deleted theorem even_abs
deleted theorem even_bit0
deleted theorem even_iff_exists_two_mul
deleted theorem even_iff_two_dvd
deleted theorem even_neg_two
deleted theorem even_ofMul_iff
deleted theorem even_toAdd_iff
deleted theorem even_two
deleted theorem even_two_mul
deleted theorem isSquare_iff_exists_sq
deleted theorem isSquare_inv
deleted theorem isSquare_mul_self
deleted theorem isSquare_ofAdd_iff
deleted theorem isSquare_one
deleted theorem isSquare_op_iff
deleted theorem isSquare_toMul_iff
deleted theorem isSquare_unop_iff
deleted theorem isSquare_zero
deleted theorem odd_add_one_self'
deleted theorem odd_add_one_self
deleted theorem odd_add_self_one'
deleted theorem odd_bit1
deleted theorem odd_iff_exists_bit1
deleted theorem odd_neg
deleted theorem odd_neg_one
deleted theorem odd_one
deleted theorem odd_two_mul_add_one
deleted theorem range_two_mul
deleted theorem range_two_mul_add_one
added theorem Dvd.dvd.even
added theorem Even.add_odd
added theorem Even.add_one
added theorem Even.mul_left
added theorem Even.mul_right
added theorem Even.neg_one_pow
added theorem Even.neg_one_zpow
added theorem Even.neg_pow
added theorem Even.neg_zpow
added theorem Even.odd_add
added theorem Even.one_add
added theorem Even.pow_of_ne_zero
added theorem Even.sub_odd
added theorem Even.trans_dvd
added theorem Odd.add_even
added theorem Odd.add_odd
added theorem Odd.map
added theorem Odd.mul
added theorem Odd.neg
added theorem Odd.neg_one_pow
added theorem Odd.neg_pow
added theorem Odd.pow
added theorem Odd.sub_even
added theorem Odd.sub_odd
added def Odd
added theorem even_bit0
added theorem even_iff_two_dvd
added theorem even_neg_two
added theorem even_two
added theorem even_two_mul
added theorem isSquare_zero
added theorem odd_add_one_self'
added theorem odd_add_one_self
added theorem odd_add_self_one'
added theorem odd_bit1
added theorem odd_iff_exists_bit1
added theorem odd_neg
added theorem odd_neg_one
added theorem odd_one
added theorem odd_two_mul_add_one
added theorem range_two_mul
added theorem range_two_mul_add_one