Commit 2022-11-29 20:45 463b024d
View on Github →feat(Data.Prod.Lex): port file (#783) mathlib3 SHA: 1fc36cc9c8264e6e81253f88be7fb2cb6c92d76a porting notes: there are several issues here that should probably be fixed before this gets merged
Prod.Lex
is not protect in core, so when you have this namespace open and try to refer toLex
, Lean findsProd.Lex
instead of_root_.Lex
. This is not a huge deal since we have notationα ×ₗ β
, but we should probably ask for it to be protected in core. See https://github.com/leanprover/lean4/pull/1895- on the declarations
toLex_mono
andtoLex_strictMono
, Lean sees right through the type synonymα ×ₗ β
toα × β
and uses the wrongPreorder
instance, which is why I had to provide them manually. I think this is a bug and should be fixed, otherwise it will cause loads of other issues down the road (for other type synonyms) and the errors will be hard to diagnose. EDIT: Hopefully https://github.com/leanprover/lean4/issues/1891 will provide a fix. - I had to provide the definitions of
min
andmax
for theLinearOrder
instance manually because in Lean 4 we have the classesMin
andMax
which have no counterpart in Lean 3. In this case it's a bit annoying becauseite
requires decidability, so I effectively had to provide that three times in this instance declaration. Surely there should be a better way?