Debian Codegraph @

test-suite/ssr/havesuff.v

raw
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 (* (c) Copyright 2006-2016 Microsoft Corporation and Inria. *)
12
13 Require Import ssreflect.
14
15
16 Parameters P G : Prop.
17
18 Lemma test1 : (P -> G) -> P -> G.
19 Proof.
20 move=> pg p.
21 have suff {pg} H : P.
22 match goal with |- P -> G => move=> _; exact: pg p | _ => fail end.
23 match goal with H : P -> G |- G => exact: H p | _ => fail end.
24 Qed.
25
26 Lemma test2 : (P -> G) -> P -> G.
27 Proof.
28 move=> pg p.
29 have suffices {pg} H : P.
30 match goal with |- P -> G => move=> _; exact: pg p | _ => fail end.
31 match goal with H : P -> G |- G => exact: H p | _ => fail end.
32 Qed.
33
34 Lemma test3 : (P -> G) -> P -> G.
35 Proof.
36 move=> pg p.
37 suff have {pg} H : P.
38 match goal with H : P |- G => exact: pg H | _ => fail end.
39 match goal with |- (P -> G) -> G => move=> H; exact: H p | _ => fail end.
40 Qed.
41
42 Lemma test4 : (P -> G) -> P -> G.
43 Proof.
44 move=> pg p.
45 suffices have {pg} H: P.
46 match goal with H : P |- G => exact: pg H | _ => fail end.
47 match goal with |- (P -> G) -> G => move=> H; exact: H p | _ => fail end.
48 Qed.
49
50 (*
51 Lemma test5 : (P -> G) -> P -> G.
52 Proof.
53 move=> pg p.
54 suff have {pg} H : P := pg H.
55 match goal with |- (P -> G) -> G => move=> H; exact: H p | _ => fail end.
56 Qed.
57 *)
58
59 (*
60 Lemma test6 : (P -> G) -> P -> G.
61 Proof.
62 move=> pg p.
63 suff have {pg} H := pg H.
64 match goal with |- (P -> G) -> G => move=> H; exact: H p | _ => fail end.
65 Qed.
66 *)
67
68 Lemma test7 : (P -> G) -> P -> G.
69 Proof.
70 move=> pg p.
71 have suff {pg} H : P := pg.
72 match goal with H : P -> G |- G => exact: H p | _ => fail end.
73 Qed.
74
75 Lemma test8 : (P -> G) -> P -> G.
76 Proof.
77 move=> pg p.
78 have suff {pg} H := pg.
79 match goal with H : P -> G |- G => exact: H p | _ => fail end.
80 Qed.
81
82 Goal forall x y : bool, x = y -> x = y.
83 move=> x y E.
84 by have {x E} -> : x = y by [].
85 Qed.