On this documentation, it is mentioned how replace
could be used to complete the proof, but it ends up using rewrite
, which seems to be a syntax sugar that writes replace
for you. I'm interested in understanding how to use it explicitly.
If I understand correctly, it could be used to rewrite S k = S (plus k 0)
as S (plus k 0) = S (plus k 0)
, given a proof that k = plus k 0
, which would then be provable by reflexivity. But if we instance it as replace {P = \x => S x = S (plus k 0)} {x = k} {y = plus k 0} rec
, we'll now need a proof of S k = S (plus k 0)
, which is what we wanted to prove to begin with. In short, I'm not sure what exactly P
should be.