I want to prove something like:
Theorem new_theorem : $\forall (A B: \text{Prop}), ((A \wedge B) \iff (B \wedge A))$.
in coq. I know, i could just type firstorder., but could i prove this in coq without this tactic and if so how?
I want to prove something like:
Theorem new_theorem : $\forall (A B: \text{Prop}), ((A \wedge B) \iff (B \wedge A))$.
in coq. I know, i could just type firstorder., but could i prove this in coq without this tactic and if so how?
I'll post a sequence of proof scripts, starting from an "uphill both ways, in the snow" version that elaborately proofs every single step.
Version 1:
This splits the proof into two goals, $P \wedge Q \to Q \wedge P$ and $Q \wedge P \to P \wedge Q$. It proves each by splitting the assumtion in its constituent parts, splitting the goal into two subgoals and solving the subgoals with the corresponding assumptions.
Looking at this proof, there's a lot of duplication: we can simplify it with a lemma, like this:
This is basically the same proof as before, only made more succinct by using an
assert.There's yet another improvement to be made: we are laboriously using
exactto prove the goals, but they follow trivially from assumptions. Let's simplify again:This uses a
;tactical to shorten the proof a bit more, by merging identical tactic sequences into one. A final simplification would be to use introduction patterns and the fact thatsplitwill auto-introduce assumptions if neccessary:Further improvement would be possible here by using
autoinstead of thesplit; ...sequences, but at this point, we're almost at the level of usingfirstorderanyway...JFTR: I only
Require Import Utf8so that I can use unicode symbols such as \forall and \leftrightarrow; it has no influence on the proofs themselves.