Split conjunction goal into subgoals
Question
Consider the following toy exercise:
forall m n : nat, m = n -> (m, n) = (n, m)forall m n : nat, m = n -> (m, n) = (n, m)m, n: nat
H: m = n(m, n) = (n, m)
At this point I have the following:
I would like to split the goal into two subgoals, m = n and n = m. Is there a tactic which does that?
Answer
Solve using the f_equal tactic:
forall m n : nat, m = n -> (m, n) = (n, m)forall m n : nat, m = n -> (m, n) = (n, m)m, n: nat
H: m = n(m, n) = (n, m)m, n: nat
H: m = nm = nm, n: nat
H: m = nn = m
With state:
A: A comment about the reason f_equal works: if we unfold some notations, we'll get from the goal (m, n) = (n, m) to pair m n = pair n m, where pair is the only constructor of the prod datatype. At this point it should be obvious why f_equal splits the goal into two subgoals.