[Merged by Bors] - refactor(Data/ZMod/IntUnitsPower): generalize ZMod 2 to work for Nat and Int too#7866
[Merged by Bors] - refactor(Data/ZMod/IntUnitsPower): generalize ZMod 2 to work for Nat and Int too#7866eric-wieser wants to merge 16 commits intomasterfrom
Nat and Int too#7866Conversation
…t` and `Int` too
Na… …t and Int tooNat and Int too
|
This PR/issue depends on: |
j-loreaux
left a comment
There was a problem hiding this comment.
This diff is very hard to follow. Would you mind trying to minimize it by ordering things the same way if possible? I don't think there is anything to complain about here, but it's hard to make sure I've checked everything.
|
|
Nevermind, the lemmas actually are in the same order, but the git diff isn't matching them up. |
|
If you want a clear diff, I could rename the lemmas first? (edit: done in #8087) |
This reduces a diff in a future PR (#7866).
Well, that was a waste of time; the diff is still hard to follow, just because the statements and proofs are changing too much! |
|
Thanks for doing #8087. The diff was still a bit messy, but it was just readable enough to make sense of. bors merge |
…` and `Int` too (#7866) Instead of providing `instance : Pow ℤˣ (ZMod 2)`, this now provides `instance [Module R (Additive ℤˣ)] : Pow ℤˣ R`. It turns out that this instance already exists for `ℕ` and `ℤ`, so all we need to do is create `instance : Module (ZMod 2) (Additive ℤˣ)` and we obtain new definitions that generalize over all three types. As a result of the generalization, `z₂pow` has been renamed in lemmas to `uzpow` (`u`nits of `ℤ`). The motivation here is that I need $(-1) ^ i$ to make sense (and be lawful) for `ZMod 2` (on clifford algebras) and `ℕ` (on exterior algebras). [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Powers.20of.20.60.E2.84.A4.CB.A3.60.20by.20.60ZMod.202.60/near/397569279)
|
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Nat and Int tooNat and Int too
Following #7866, `Int.negOnePow` is redefined as a map `ℤ → ℤˣ` rather than `ℤ → ℤ`.
Following #7866, `Int.negOnePow` is redefined as a map `ℤ → ℤˣ` rather than `ℤ → ℤ`. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Following #7866, `Int.negOnePow` is redefined as a map `ℤ → ℤˣ` rather than `ℤ → ℤ`. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Following #7866, `Int.negOnePow` is redefined as a map `ℤ → ℤˣ` rather than `ℤ → ℤ`. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Following #7866, `Int.negOnePow` is redefined as a map `ℤ → ℤˣ` rather than `ℤ → ℤ`. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Instead of providing
instance : Pow ℤˣ (ZMod 2), this now providesinstance [Module R (Additive ℤˣ)] : Pow ℤˣ R.It turns out that this instance already exists for
ℕandℤ, so all we need to do is createinstance : Module (ZMod 2) (Additive ℤˣ)and we obtain new definitions that generalize over all three types.As a result of the generalization,
z₂powhas been renamed in lemmas touzpow(units ofℤ).The motivation here is that I need$(-1) ^ i$ to make sense (and be lawful) for
ZMod 2(on clifford algebras) andℕ(on exterior algebras).Zulip thread
ZMod 2onℤˣ#7661