Debian Codegraph @

test-suite/success/simple_congruence.v

raw
1 Axiom P : Prop.
2 Definition Q := True -> P.
3
4 (* bug 13778, 5394 *)
5 Goal Q -> Q.
6 Proof.
7 intro.
8 Fail congruence.
9 simple congruence.
10 Qed.
11
12 Goal (not P) -> P -> False.
13 Proof. simple congruence. Qed.
14
15 Goal (P -> False) -> not P.
16 Proof.
17 simple congruence.
18 Qed.
19
20 Fixpoint slow (n: nat): bool :=
21 match n with
22 | O => true
23 | S m => andb (slow m) (slow (pred m))
24 end.
25
26 Parameter f: nat -> nat.
27
28 Definition foo(n b: nat): Prop :=
29 if slow n then (forall a, f a = f b) else True.
30
31 (* fail fast symbolically *)
32 (* bug 13189 *)
33 Goal forall a b, foo 27 b -> f a = f b.
34 Proof.
35 Timeout 1 Fail Time simple congruence.
36 (* Fail Timeout 1 Time congruence. *)
37 Admitted.
38
39 (* succeed fast symbolically *)
40 (* bug 13189 *)
41 Goal forall a b, foo 29 b -> f b = f a -> f a = f b.
42 Proof.
43 (* Fail Timeout 1 Time congruence. *)
44 Timeout 1 simple congruence.
45 Qed.
46
47 Goal True -> not True -> P.
48 Proof. simple congruence. Qed.
49
50 (* consider final not *)
51 Goal False -> not True.
52 Proof. simple congruence. Qed.
53
54 (* consider final not *)
55 Goal not (true = false).
56 Proof. simple congruence. Qed.
57
58 Fixpoint stupid (n : nat) : unit :=
59 match n with
60 | 0 => tt
61 | S n =>
62 let () := stupid n in
63 let () := stupid n in
64 tt
65 end.
66
67 (* do not try to unify 23 with stupid 23 *)
68 Goal 23 = 23 -> stupid 23 = stupid 23.
69 Proof. Timeout 1 simple congruence. Qed.
70
71 Inductive Fin : nat -> Set :=
72 | F1 : forall n : nat, Fin (S n)
73 | FS : forall n : nat, Fin n -> Fin (S n).
74
75 (* indexed inductives *)
76 Goal forall n (f : Fin n), FS n f = F1 n -> False.
77 Proof. intros n f H. simple congruence. Qed.
78
79 Axiom R : Prop.
80 Axiom R' : Prop.
81
82 Goal (not P) -> not P.
83 Proof. simple congruence. Qed.
84
85 Goal (P -> False) -> P -> False.
86 Proof. simple congruence. Qed.
87
88 Goal (not (true = true)) -> P.
89 Proof. simple congruence. Qed.
90
91 Goal Q -> (Q = R) -> R.
92 Proof. simple congruence. Qed.
93
94 (* unfortunately, common usecase *)
95 Goal P -> Q.
96 Proof.
97 Fail simple congruence.
98 repeat intro. simple congruence.
99 Qed.
100
101 (* bug 13778 *)
102 Goal R -> (R = not P) -> not P.
103 Proof.
104 Fail congruence.
105 simple congruence.
106 Qed.
107
108 Definition per_unit := forall u, match u with tt => True end.
109
110 (* bug 5394 *)
111 Goal per_unit -> per_unit.
112 Proof. simple congruence. Qed.