mathlib4 icon indicating copy to clipboard operation
mathlib4 copied to clipboard

refactor(Algebra/Polynomial/Laurent): use Int.ofNat.inj

Open mo271 opened this issue 1 year ago • 6 comments
trafficstars


Open in Gitpod

mo271 avatar Apr 25 '24 08:04 mo271

Not sure if we want to have a special name for a theorem of type Function.Injective Int.ofNat which is just Int.ofNat.inj with explicit arguments. If yes, what would be a good name and place for it?

mo271 avatar Apr 25 '24 08:04 mo271

Perhaps this is a use case for using alias?

mo271 avatar Apr 25 '24 19:04 mo271

Actually, I do think we should have the Injective lemma as well

Ruben-VandeVelde avatar May 05 '24 09:05 Ruben-VandeVelde

Actually, I do think we should have the Injective lemma as well

What would be a good name and place for it?

mo271 avatar May 05 '24 09:05 mo271

Int.ofNat_injective, and near Int.natCast_inj in Data.Int.Defs, perhaps

Ruben-VandeVelde avatar May 05 '24 20:05 Ruben-VandeVelde

Int.ofNat_injective, and near Int.natCast_inj in Data.Int.Defs, perhaps

done

mo271 avatar May 06 '24 06:05 mo271

I'm going to test if Nat.cast_injective works better in these rws. UPD: In 1 case it doesn't help (why do we need erw there?) ; in other case, expr uses Nat.cast, so I rewrote it in terms of Nat.cast_injective.

urkud avatar May 26 '24 15:05 urkud

Thanks! Once CI is happy, please merge this PR using bors r+ bors d+

urkud avatar May 26 '24 16:05 urkud

:v: mo271 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

mathlib-bors[bot] avatar May 26 '24 16:05 mathlib-bors[bot]

bors r+

mo271 avatar May 27 '24 05:05 mo271

Pull request successfully merged into master.

Build succeeded:

mathlib-bors[bot] avatar May 27 '24 06:05 mathlib-bors[bot]