Trying to complete a Coq proof but I ended up getting stuck on the last goal. I transformed the goal to S n' <= m and have a hypothesis (S n' <=? m) = true, but am unable to unify these.
I tried to define an extra lemma leb_true to fix this but failed to do so. Is there something simple I'm missing?
<=?and<=are two different things, but the Coq programmers who included these two things in the library know that they are related. This knowledge is stored in the libraries about arithmetic.So you should perform the following operation:
This gives you a collection of theorems that you can use in proofs.
Now, you can use any of these 6 theorems to prove what you need. For instance, if your goal's conclusion has the shape
formula1 <= formula2and you have an hypothesis that says(formula1 <=? formula2) = trueit is useful to use the equivalence inNat.leb_le, through a rewrite statement:The new produced goal will contain
(formula1 <=? formula2) = trueand you will be able to conclude.