[Merged by Bors] - feat: port data.{nat, int}.cast.defs#641
[Merged by Bors] - feat: port data.{nat, int}.cast.defs#641
Conversation
In that case you should put this SHA at the top of the PR message (unless you are not sure you were effective in incorporating the changes?). |
|
Okay, I've changed it. It was only a rename of a single lemma. |
I think we should keep the However, that PR is going to be very ugly to port to Lean 4, since we no longer have a |
This reverts commit 698f6ec.
|
I have reinstated the |
|
Note in case you already looked at this PR and didn't read the updated description: I have added a port of |
|
bors merge |
mathlib3 SHA: bb168510ef455e9280a152e7f31673cabd3d7496 Porting notes for `Mathlib.Data.Nat.Cast.Defs` 1. I have moved `AddMonoidWithOne` and related lemmas from `Mathlib.Algebra.GroupWithZero.Defs` into this file. All but 3 of these were in this file in mathlib3, so this is the correct place. The extra 3 are new lemmas in Mathlib4, and I made a note to this effect. 2. mathport marked some translations as dubious because they used `AddMonoidWithOne` instead of `NatCast` because the latter didn't exist until this PR, so I just fixed them to use `NatCast` and `#align`ed (with no `ₓ`). 3. I need someone (e.g., @gebner) to rewrite the library note about coercions because I don't know enough. 4. I reimplemented `Nat.binCast` from scratch because we don't have `Nat.binaryRec`. The proof of `Nat.binCast_eq` can likely be improved quite a bit. 5. I marked `Nat.cast_bit0` and `Nat.cast_bit1` as deprecated since `bit0` and `bit1` are deprecated. 6. I added an instance of `OfNat R n` for `n : ℕ` when `R` has an `AddMonoidWithOne` instance. I think we want this in order to talk about literals as terms in `R` (e.g., `37 : R`). This instance does not appear in mathlib3 and is new. 7. ~~I kept the (lack of) `simp` attributes from mathlib3 for certain lemmas which were already ported to mathlib4. This caused some breakage which I fixed. I thought it was better to be consistent with the mathlib3 `simp` set.~~ Per Gabriel's suggestion, I have kept these as `simp` lemmas. Porting notes for `Mathlib.Data.Int.Cast.Defs` 1. This file already existed in Mathlib4, but it's contents corresponded to things in mathlib3's `data.int.cast.basic`, so I have moved the previous contents to `Mathlib.Data.Int.Cast.Basic`, hence the reason for the weird diff. 2. I have moved `AddGroupWithOne` and the rest of that material out of `Mathlib.Algebra.GroupWithZero.Defs` so these files are now independent and `Mathlib.Data.Int.Cast.Defs` I think is a faithful and complete translation of the mathlib3 file. Co-authored-by: Gabriel Ebner <gebner@gebner.org>
|
Build failed: |
|
bors merge |
mathlib3 SHA: bb168510ef455e9280a152e7f31673cabd3d7496 Porting notes for `Mathlib.Data.Nat.Cast.Defs` 1. I have moved `AddMonoidWithOne` and related lemmas from `Mathlib.Algebra.GroupWithZero.Defs` into this file. All but 3 of these were in this file in mathlib3, so this is the correct place. The extra 3 are new lemmas in Mathlib4, and I made a note to this effect. 2. mathport marked some translations as dubious because they used `AddMonoidWithOne` instead of `NatCast` because the latter didn't exist until this PR, so I just fixed them to use `NatCast` and `#align`ed (with no `ₓ`). 3. I need someone (e.g., @gebner) to rewrite the library note about coercions because I don't know enough. 4. I reimplemented `Nat.binCast` from scratch because we don't have `Nat.binaryRec`. The proof of `Nat.binCast_eq` can likely be improved quite a bit. 5. I marked `Nat.cast_bit0` and `Nat.cast_bit1` as deprecated since `bit0` and `bit1` are deprecated. 6. I added an instance of `OfNat R n` for `n : ℕ` when `R` has an `AddMonoidWithOne` instance. I think we want this in order to talk about literals as terms in `R` (e.g., `37 : R`). This instance does not appear in mathlib3 and is new. 7. ~~I kept the (lack of) `simp` attributes from mathlib3 for certain lemmas which were already ported to mathlib4. This caused some breakage which I fixed. I thought it was better to be consistent with the mathlib3 `simp` set.~~ Per Gabriel's suggestion, I have kept these as `simp` lemmas. Porting notes for `Mathlib.Data.Int.Cast.Defs` 1. This file already existed in Mathlib4, but it's contents corresponded to things in mathlib3's `data.int.cast.basic`, so I have moved the previous contents to `Mathlib.Data.Int.Cast.Basic`, hence the reason for the weird diff. 2. I have moved `AddGroupWithOne` and the rest of that material out of `Mathlib.Algebra.GroupWithZero.Defs` so these files are now independent and `Mathlib.Data.Int.Cast.Defs` I think is a faithful and complete translation of the mathlib3 file. Co-authored-by: Gabriel Ebner <gebner@gebner.org>
|
Pull request successfully merged into master. Build succeeded: |
Regenerated from the [port status wiki page](https://github.com/leanprover-community/mathlib/wiki/mathlib4-port-status). Relates to the following PRs: * leanprover-community/mathlib4#563 * leanprover-community/mathlib4#608 * leanprover-community/mathlib4#627 * leanprover-community/mathlib4#638 * leanprover-community/mathlib4#641 * leanprover-community/mathlib4#645 * leanprover-community/mathlib4#650
Regenerated from the [port status wiki page](https://github.com/leanprover-community/mathlib/wiki/mathlib4-port-status). Relates to the following PRs: * leanprover-community/mathlib4#563 * leanprover-community/mathlib4#608 * leanprover-community/mathlib4#627 * leanprover-community/mathlib4#638 * leanprover-community/mathlib4#641 * leanprover-community/mathlib4#645 * leanprover-community/mathlib4#650
mathlib3 SHA: 39af7d3bf61a98e928812dbc3e16f4ea8b795ca3 Porting notes: 1. Some lemmas were transferred from `Data.Int.Cast.Defs` in order to match mathlib3 (I accidentally put them in the wrong place when I had ported that file because those lemmas were already present in mathlib4.) 2. The lemmas just mentioned have retained their `simp` attribute for the reason Gabriel mentioned on that PR (#641), even though that attribute isn't present on the mathlib3 version. 3. The `bit0` and `bit1` lemmas have been marked as deprecated. 4. There were many dubious translation errors, I believe primarily because of the difference in the way coercions are handled, so I have `#align`ed all of these with `ₓ`. I believe this is the correct thing to do, but confirmation would be nice.
mathlib3 SHA: bb168510ef455e9280a152e7f31673cabd3d7496
Porting notes for
Mathlib.Data.Nat.Cast.DefsAddMonoidWithOneand related lemmas fromMathlib.Algebra.GroupWithZero.Defsinto this file. All but 3 of these were in this file in mathlib3, so this is the correct place. The extra 3 are new lemmas in Mathlib4, and I made a note to this effect.AddMonoidWithOneinstead ofNatCastbecause the latter didn't exist until this PR, so I just fixed them to useNatCastand#aligned (with noₓ).Nat.binCastfrom scratch because we don't haveNat.binaryRec. The proof ofNat.binCast_eqcan likely be improved quite a bit.Nat.cast_bit0andNat.cast_bit1as deprecated sincebit0andbit1are deprecated.OfNat R nforn : ℕwhenRhas anAddMonoidWithOneinstance. I think we want this in order to talk about literals as terms inR(e.g.,37 : R). This instance does not appear in mathlib3 and is new.I kept the (lack of)Per Gabriel's suggestion, I have kept these assimpattributes from mathlib3 for certain lemmas which were already ported to mathlib4. This caused some breakage which I fixed. I thought it was better to be consistent with the mathlib3simpset.simplemmas.Porting notes for
Mathlib.Data.Int.Cast.Defsdata.int.cast.basic, so I have moved the previous contents toMathlib.Data.Int.Cast.Basic, hence the reason for the weird diff.AddGroupWithOneand the rest of that material out ofMathlib.Algebra.GroupWithZero.Defsso these files are now independent andMathlib.Data.Int.Cast.DefsI think is a faithful and complete translation of the mathlib3 file.