xywang
xywang

Reputation: 951

How to destruct pair equivalence in Coq?

I'm trying to destruct a pair equivalence hypothesis in proof when using Coq. But I didn't find the tactic for me.

The case is:

a, b, a', b' : nat
H0 : (a, b) = (a', b')

I want to destruct the pairs in H0 to generate

H1 : a = a'
H2 : b = b'

How can I achieve this? Which tactic should I use? Or should I define lemma for destructing such pair?

Thank you!

Upvotes: 7

Views: 1194

Answers (2)

Martin Huschenbett
Martin Huschenbett

Reputation: 568

You can also do it in one step with inversion H0.

Upvotes: 3

Atsby
Atsby

Reputation: 2327

Use injection H0 followed by intros as a first approximation.

Upvotes: 6

Related Questions