0

I am trying to prove that a predefined addition function is associative, but I am stuck at the step where the goal reads

plus (S x') (plus y z) = plus (plus (S x') y) z

but the only hypothesis I have is :

IHx' : forall y z : nat,
plus x' (plus y z) = plus (plus x' y) z
Wahyu Kristianto
  • 8,719
  • 6
  • 43
  • 68
Serene
  • 1
  • 1

2 Answers2

0

You should use the definition of your function plus at this point, for instance using a function to evaluate your goal such as cbn (simpl or lazy may also work). Then you obtain a goal where your induction hypothesis apply so you can finish with congruence.

By the way, the base case when x = 0 can be solved simply by computation so reflexivity suffices.

kyo dralliam
  • 1,197
  • 5
  • 6
0

You have proved that plus 0 x = x, but you can also (easily) prove that plus (S x) y = S (plus x y). If you do that, you can rewrite your goal into S (plus x' (plus y z)) = S (plus (plus x' y) z) and then you can rewrite with your induction hypothesis.

larsr
  • 5,447
  • 19
  • 38