| 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 |
Require Import ssrbool. |
| 15 |
Require Import TestSuite.ssr_mini_mathcomp. |
| 16 |
|
| 17 |
Parameter T : Type. |
| 18 |
Parameters P : T -> Prop. |
| 19 |
|
| 20 |
Definition f := fun x y : T => x. |
| 21 |
|
| 22 |
Lemma test1 : forall x y : T, P (f x y) -> P x. |
| 23 |
Proof. |
| 24 |
move=> x y; set fxy := f x y; move=> Pfxy. |
| 25 |
wlog H : @fxy Pfxy / P x. |
| 26 |
match goal with |- (let fxy0 := f x y in P fxy0 -> P x -> P x) -> P x => by auto | _ => fail end. |
| 27 |
exact: H. |
| 28 |
Qed. |
| 29 |
|
| 30 |
Lemma test2 : forall x y : T, P (f x y) -> P x. |
| 31 |
Proof. |
| 32 |
move=> x y; set fxy := f x y; move=> Pfxy. |
| 33 |
wlog H : fxy Pfxy / P x. |
| 34 |
match goal with |- (forall fxy, P fxy -> P x -> P x) -> P x => by auto | _ => fail end. |
| 35 |
exact: H. |
| 36 |
Qed. |
| 37 |
|
| 38 |
Lemma test3 : forall x y : T, P (f x y) -> P x. |
| 39 |
Proof. |
| 40 |
move=> x y; set fxy := f x y; move=> Pfxy. |
| 41 |
move: {1}@fxy (Pfxy) (Pfxy). |
| 42 |
match goal with |- (let fxy0 := f x y in P fxy0 -> P fxy -> P x) => by auto | _ => fail end. |
| 43 |
Qed. |
| 44 |
|
| 45 |
Lemma test4 : forall n m z: bool, n = z -> let x := n in x = m && n -> x = m && n. |
| 46 |
move=> n m z E x H. |
| 47 |
case: true. |
| 48 |
by rewrite {1 2}E in (x) H |- *. |
| 49 |
by rewrite {1}E in x H |- *. |
| 50 |
Qed. |