Theorem and_commutative (P Q : Prop) : P ∧ Q → Q ∧ P.
Proof.
intros [HP HQ].
split.
- apply HQ.
- apply HP.
Qed.
"intros [HP HQ]" separates the two conjuncts of the hypothesis into separate hypotheses (P, and Q); "split" breaks the goal (Q ∧ P) into two subgoals (Q, and P), and the two applications prove the two subgoals.It could also be written:
Theorem and_commutative_2 (P Q : Prop) : P ∧ Q → Q ∧ P.
Proof. tauto. Qed.
...as the proof tactic "tauto" is capable of proving this (simple) theorem immediately.