Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to destruct pair equivalence in Coq?

Tags:

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!

like image 474
xywang Avatar asked May 18 '15 07:05

xywang


People also ask

What does Simpl do in Coq?

simpl: Simplifies the goal or hypotheses in the context. unfold: Unfolds the definitions of terms. apply: Uses implications to transform goals and hypotheses. rewrite: Replaces a term with an equivalent term if the equivalence of the terms has already been proven.

What is a tactic in Coq?

Tactics specify how to transform the proof state of an incomplete proof to eventually generate a complete proof. Proofs can be developed in two basic ways: In forward reasoning, the proof begins by proving simple statements that are then combined to prove the theorem statement as the last step of the proof.

How do you duplicate a hypothesis in Coq?

assert (HA := l1 H). assert (HB := l2 H). You can also do something like assert (H' := H). to explicitly copy H into H' , although you can usually resort to a more direct way for getting what you want. Save this answer.


2 Answers

Use injection H0 followed by intros as a first approximation.

like image 126
Atsby Avatar answered Nov 06 '22 19:11

Atsby


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

like image 3
Martin Huschenbett Avatar answered Nov 06 '22 20:11

Martin Huschenbett