feat(Algebra/Field/Power): weaken assumptions of Odd.neg_zpow#37319
feat(Algebra/Field/Power): weaken assumptions of Odd.neg_zpow#37319PrParadoxy wants to merge 9 commits intoleanprover-community:masterfrom
Conversation
The lemmas `Even.neg_zpow` and `Even.neg_one_zpow` are stated assuming `[DivisionMonoid α] [HasDistribNeg α]`. However, `Odd.neg_zpow` and `Odd.neg_one_zpow` currently assume the stronger `[DivisionRing α]`. This PR weakens the assumption of the `Odd` lemmas to match their `Even` counterparts. --- According to the docstring, the purpose of `Mathlib.Algebra.Field.Power` is to define `Field` with minimal imports. But after this PR, Power.lean does not rely on `Mathlib.Algebra.Field.Defs` any more. Arguably, it could be deprecated. The two results in the file could be stated in `Algebra.Ring.Int.Parity` without any extra imports. Should we implement this in the current or an additional PR? Note: ``` -- these all work: example (z : ℤ) (h : Even z) : (-1 : ℂ)^z = 1 := Even.neg_one_zpow h example (z : ℤ) (h : Even z) : (-1 : unitary ℂ)^z = 1 := Even.neg_one_zpow h example (z : ℤ) (h : Odd z) : (-1 : ℂ)^z = -1 := Odd.neg_one_zpow h -- this fails without the PR: example (z : ℤ) (h : Odd z) : (-1 : unitary ℂ)^z = -1 := Odd.neg_one_zpow h ```
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary 34f85c5f24
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Algebra.Field.Power | 376 | 372 | -4 (-1.06%) |
| Mathlib.Tactic.FieldSimp.Lemmas | 384 | 385 | +1 (+0.26%) |
Import changes for all files
| Files | Import difference |
|---|---|
| There are 2807 files with changed transitive imports taking up over 130896 characters: this is too many to display! | |
You can run ci-tools/scripts/pr_summary/import_trans_difference.sh all locally to see the whole output. |
Declarations diff
No declarations were harmed in the making of this PR! 🐙
You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.
No changes to technical debt.
You can run this locally as
./scripts/reporting/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
The lemmas
Even.neg_zpowandEven.neg_one_zpoware stated assuming[DivisionMonoid α] [HasDistribNeg α]. However,Odd.neg_zpowandOdd.neg_one_zpowcurrently assume the stronger[DivisionRing α].This PR weakens the assumption of the
Oddlemmas to match theirEvencounterparts.
According to the docstring, the purpose of
Mathlib.Algebra.Field.Poweris to define
Fieldwith minimal imports. But after this PR, Power.leandoes not rely on
Mathlib.Algebra.Field.Defsany more. Arguably, itcould be deprecated. The two results in the file could be stated in
Mathlib.Algebra.Ring.Int.Paritywithout any extra imports. Should we implementthis in the current or an additional PR?
Examples: