coq - Easy way to simplify expression within anonymous function? -
assume need prove following:
x: nat (fun _ : nat => 0) = (fun y : nat => if beq_nat x y 0 else 0)
since y
not in environment, looks can't destruct on beq_nat x y
simplify right-hand side. there simple way simplify expressions within anonymous function?
besides being able massage 2 functions equal, there way deduce 2 functions same showing produce same value on inputs?
edit: realize might asking impossible, since functions not same, it's when applied argument produce same value. i'm not sure how coq interprets this.
i believe case of referred functional extensionality
, want prove 2 functions extensionally equal (they behave same caller's point of view).
you cannot prove directly in coq (since =
definitioinal equality, not true), if wish to, can require module:
http://coq.inria.fr/stdlib/coq.logic.functionalextensionality.html
which provide axioms functional extensionality. can call tactic extensionality y.
give access y
.
Comments
Post a Comment