Debian Codegraph @

apps/eltac/tests/test_case.v

raw
1 From elpi.apps Require Import eltac.case.
2
3 Lemma test1 (n : nat) : n = n.
4 Proof.
5 eltac.case n.
6 exact (refl_equal 0).
7 exact (refl_equal (S _)).
8 Qed.
9
10 Inductive is_even : nat -> Prop :=
11 | even0 : is_even 0
12 | evenS : forall x, is_even x -> is_even (S (S x)).
13
14 Lemma test2 (n : nat) (H : is_even n) : n = n.
15 Proof.
16 eltac.case H.
17 exact (refl_equal 0).
18 exact (refl_equal (S (S _))).
19 Qed.
20
21 Axiom q : nat -> Prop.
22 Axiom p0 : q 0.
23
24 (* The last 0 must not be abstracted or the goal is illtyped *)
25 Lemma test3 (H : is_even 0) : 0 = 0 /\ (@eq (q 0) p0 p0).
26 Proof.
27 eltac.case H.
28 split. exact (refl_equal 0). exact (refl_equal p0).
29 split; [ exact (refl_equal (S (S _))) | exact (refl_equal p0) ].
30 Qed.