Commit 2022-11-20 00:17 4ee6f3d8
View on Github →feat: port data.{nat, int}.cast.defs (#641)
mathlib3 SHA: bb168510ef455e9280a152e7f31673cabd3d7496
Porting notes for Mathlib.Data.Nat.Cast.Defs
- I have moved
AddMonoidWithOneand 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. - mathport marked some translations as dubious because they used
AddMonoidWithOneinstead ofNatCastbecause the latter didn't exist until this PR, so I just fixed them to useNatCastand#aligned (with noₓ). - I need someone (e.g., @gebner) to rewrite the library note about coercions because I don't know enough.
- I reimplemented
Nat.binCastfrom scratch because we don't haveNat.binaryRec. The proof ofNat.binCast_eqcan likely be improved quite a bit. - I marked
Nat.cast_bit0andNat.cast_bit1as deprecated sincebit0andbit1are deprecated. - I added an instance of
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 forMathlib.Data.Int.Cast.Defs- 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 toMathlib.Data.Int.Cast.Basic, hence the reason for the weird diff. - I have moved
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.