I'm very confused as to why a proof of a lemma succeeded without function extensionality.
I'm messing around with some trivial Coq proofs for manipulating pseudosequences of the form A -> B -> C -> D
.
I'm interested in this way of using Coq because it lets me write functions in Gallina that act like tactics and use them by attaching hypotheses to my goal, firing off an apply my_gallina_term.
, and then intros
-ing the new hypotheses back into the environment. I'm also hoping to understand basic SSReflect (i.e. just the goal management parts, not the reflection parts, which I don't understand yet).
Anyway, here's a swapper
function, which swaps the two arguments of a two-argument function.
Lemma identity : forall A, A -> A.
Proof. easy. Qed.
Definition swapper : forall {A} {B} {C}, (A -> B -> C) -> (B -> A -> C) :=
fun A B C f x y => f y x.
Lemma swapper_is_invertible : forall A B C f, f = @swapper B A C (swapper f).
Proof.
intros.
easy.
Qed.
I can't figure out why this lemma succeeded. I'm not assuming function extensionality.