Open dselsam opened 3 years ago
Mario proposed the following: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/mathport/near/226330232. The proposal is fleshed out in the subsequent comments.
Mario proposed the following: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/mathport/near/226330232. The proposal is fleshed out in the subsequent comments.
This proposal has been prototyped here: https://github.com/dselsam/lean4/tree/postinst
Plan: simply wrap the bit0
/bit1
numerals with ofNat
during the port, and have new developments use the well-founded instance.
Re-opening, as Yury points out that the plan above will still cause unfortunate issues: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/mathport.3Anumbers/near/231540532
The number-mismatch is more problematic than I realized at first. Lean3 uses
zero
,one
,bit0
andbit1
, whereas Lean4 usesOfNat α n
. It is not trivial to auto-convert during the porting. I tried makingOfNat
instances fromhas_zero
,has_one
, andhas_add
, but I don't see a good way to support reasonably efficient kernel computation with it.The auto-porter could construct concrete instances for concrete
n
, but it does not seem to be possible for typeclass resolution to do this in general after the port.