forked from achlipala/frap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Relations.v
130 lines (100 loc) · 2.4 KB
/
Relations.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
Set Implicit Arguments.
Section trc.
Variable A : Type.
Variable R : A -> A -> Prop.
Inductive trc : A -> A -> Prop :=
| TrcRefl : forall x, trc x x
| TrcFront : forall x y z,
R x y
-> trc y z
-> trc x z.
Hint Constructors trc : core.
Theorem trc_one : forall x y, R x y
-> trc x y.
Proof.
eauto.
Qed.
Hint Resolve trc_one : core.
Theorem trc_trans : forall x y, trc x y
-> forall z, trc y z
-> trc x z.
Proof.
induction 1; eauto.
Qed.
Hint Resolve trc_trans : core.
Inductive trcEnd : A -> A -> Prop :=
| TrcEndRefl : forall x, trcEnd x x
| TrcBack : forall x y z,
trcEnd x y
-> R y z
-> trcEnd x z.
Hint Constructors trcEnd : core.
Lemma TrcFront' : forall x y z,
R x y
-> trcEnd y z
-> trcEnd x z.
Proof.
induction 2; eauto.
Qed.
Hint Resolve TrcFront' : core.
Theorem trc_trcEnd : forall x y, trc x y
-> trcEnd x y.
Proof.
induction 1; eauto.
Qed.
Hint Resolve trc_trcEnd : core.
Lemma TrcBack' : forall x y z,
trc x y
-> R y z
-> trc x z.
Proof.
induction 1; eauto.
Qed.
Hint Resolve TrcBack' : core.
Theorem trcEnd_trans : forall x y, trcEnd x y
-> forall z, trcEnd y z
-> trcEnd x z.
Proof.
induction 1; eauto.
Qed.
Hint Resolve trcEnd_trans : core.
Theorem trcEnd_trc : forall x y, trcEnd x y
-> trc x y.
Proof.
induction 1; eauto.
Qed.
Hint Resolve trcEnd_trc : core.
Inductive trcLiteral : A -> A -> Prop :=
| TrcLiteralRefl : forall x, trcLiteral x x
| TrcTrans : forall x y z, trcLiteral x y
-> trcLiteral y z
-> trcLiteral x z
| TrcInclude : forall x y, R x y
-> trcLiteral x y.
Hint Constructors trcLiteral : core.
Theorem trc_trcLiteral : forall x y, trc x y
-> trcLiteral x y.
Proof.
induction 1; eauto.
Qed.
Theorem trcLiteral_trc : forall x y, trcLiteral x y
-> trc x y.
Proof.
induction 1; eauto.
Qed.
Hint Resolve trc_trcLiteral trcLiteral_trc : core.
Theorem trcEnd_trcLiteral : forall x y, trcEnd x y
-> trcLiteral x y.
Proof.
induction 1; eauto.
Qed.
Theorem trcLiteral_trcEnd : forall x y, trcLiteral x y
-> trcEnd x y.
Proof.
induction 1; eauto.
Qed.
Hint Resolve trcEnd_trcLiteral trcLiteral_trcEnd : core.
End trc.
Notation "R ^*" := (trc R) (at level 0).
Notation "*^ R" := (trcEnd R) (at level 0).
Hint Constructors trc : core.