-
Notifications
You must be signed in to change notification settings - Fork 2
/
emma_orig.v
200 lines (188 loc) · 6.1 KB
/
emma_orig.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
Require Import Utf8_core.
Require ILLVarInt. (* Don't want to import it. *)
Import ILLVarInt.MILL. (* only this *)
Import ILLVarInt.Tacs. (* only this *)
Import FormulaMultiSet. (* and this *)
Open Scope ILL_scope.
(* Declaration of basic propositions. *)
Declare Scope Emma.
Notation "'P'" := (Proposition 1%nat):Emma. (* Poison *)
Notation "'R'" := (Proposition 2%nat):Emma. (* discussion with Rodolph *)
Notation "'G'" := (Proposition 3%nat):Emma. (* discussion with Guillaumin *)
Notation "'B'" := (Proposition 4%nat):Emma. (* discussion with Binet *)
Notation "'V'" := (Proposition 5%nat) (only parsing):Emma.
Notation "'S'" := (Proposition 5%nat):Emma.
Notation "'A'" := (Proposition 6%nat):Emma.
Notation "'E'" := (Proposition 7%nat):Emma.
Notation "'M'" := (Proposition 8%nat):Emma.
Open Scope ILL_scope.
Open Scope Emma.
Lemma simpl_ex: {P ⊸ M, P, !(S ⊸ A)} ⊢ A ⊕ M.
Proof with try solve [ apply Id;reflexivity | prove_multiset_eq].
bang_w (S ⊸ A)...
weak_impl_l P M...
apply Oplus_R_2...
Defined.
(* EXAMPLE OF IMPOSSIBLE INTERNAL CHOICE *)
Lemma originelle :
{P&1, R, G, B&1, !(S⊸A), (E⊸A)&1, (P⊸M)&1,(R⊸1)&(R⊸E), (G⊸1)⊕(G⊸S), 1⊕((B⊸S)&(B⊸1)) } ⊢ A ⊕ M .
Proof with try solve [ apply Id;reflexivity | prove_multiset_eq].
and_l_2 (R⊸1) (R⊸E).
oplus_l (G ⊸ 1) (G ⊸ S).
2:{
weak_impl_l G S...
weak_impl_l R E...
bang_c (S ⊸ A).
bang_d (S ⊸ A).
weak_impl_l S A...
and_l_1 (E ⊸ A) 1.
weak_impl_l E A... (* THERE ARE TWO A *)
Abort.
Lemma originelle :
{P&1, R, G, B&1, !(S⊸A), (E⊸A)&1, (P⊸M)&1,(R⊸1)&(R⊸E), (G⊸1)⊕(G⊸S), 1⊕((B⊸S)&(B⊸1)) } ⊢ A ⊕ M .
Proof with try solve [ apply Id;reflexivity | prove_multiset_eq].
oplus_l (G ⊸ 1) (G ⊸ S).
- (* Left branch *)
weak_impl_l G 1...
one_l.
oplus_l 1 ((B ⊸ S) & (B ⊸ 1)).
all: swap 1 2. (* switch subgoals to match the order of the document *)
(* Left left. *)
+ and_l_2 (B ⊸ S) (B ⊸ 1).
and_l_1 B 1.
weak_impl_l B 1...
one_l.
and_l_1 (R ⊸ 1) (R ⊸ E).
weak_impl_l R 1...
and_l_1 P 1.
and_l_2 (E ⊸ A) 1.
and_l_1 (P ⊸ M) 1.
do 2 one_l.
bang_w (S ⊸ A)...
weak_impl_l P M...
apply Oplus_R_2...
+ (* Left right *)
and_l_2 B 1.
do 2 one_l.
and_l_2 P 1.
and_l_1 (E ⊸ A) 1.
and_l_2 (P ⊸ M) 1.
and_l_2 (R ⊸ 1) (R ⊸ E).
do 2 one_l.
bang_w (S ⊸ A)...
weak_impl_l R E...
weak_impl_l E A...
apply Oplus_R_1...
- (* Right branch of the document *)
weak_impl_l G S...
and_l_1(R ⊸ 1) (R ⊸ E).
weak_impl_l R 1...
one_l. (* +L in the document but actually 1L *)
oplus_l 1 ((B ⊸ S) & (B ⊸ 1)).
+ (* Right left *)
and_l_2 P 1.
and_l_2 B 1.
and_l_2 (E ⊸ A) 1.
and_l_2 (P ⊸ M) 1.
repeat one_l.
bang_d (S ⊸ A)... (* !D instead of WL *)
weak_impl_l S A...
apply Oplus_R_1...
+ (* Right right *)
and_l_2 (B ⊸ S) (B ⊸ 1).
and_l_1 B 1.
weak_impl_l B 1...
one_l.
and_l_2 P 1.
and_l_2 (E ⊸ A) 1.
and_l_2 (P ⊸ M) 1.
repeat one_l.
bang_d (S ⊸ A)... (* !D instead of WL *)
weak_impl_l S A...
apply Oplus_R_1...
Defined.
Ltac search_goal n g :=
match n with
| O => fail 1
| (Init.Datatypes.S ?m) =>
match goal with
| |- ?g' =>
match g with
?env⊢?e =>
match g' with
?env'⊢e =>
same_env env env'
end
end
| |- ?env ⊢ ?e =>
match env with
| {e} => apply Id;prove_multiset_eq
| context C [(add 1 ?env')] =>
(one_l;search_goal m g)||fail 0
| context C [(add ( ?p' & ?q') ?env')] =>
(and_l_2 p' q';search_goal m g)|| fail 0
| context C [(add ( ?p' & ?q') ?env')] =>
(and_l_1 p' q';search_goal m g)|| fail 0
| context C [(add ( ?p' ⊗ ?q') ?env')] =>
(times_l p' q';search_goal m g) || fail 0
| context C [add (?p'⊸?q') ?env'] =>
let e := context C [ env' ] in
match e with
| context C' [ p'::?env''] =>
let e' := context C' [env''] in
(impl_l ({p'}) e' p' q';[constructor;prove_multiset_eq|search_goal m g])
(* apply Impl_L with (Γ:={p'}) (Δ:=e') (p:=p') (q:=q'); *)
(* [constructor;prove_multiset_eq |search_goal m g|prove_multiset_eq] *)
end
| context C [add ( !?p') ?env'] =>
(bang_w p';search_goal m g)
(* let e := context C [env'] in *)
(* apply Bang_W with (Γ:=e) (p:=p');[search_goal m g|prove_multiset_eq] *)
end || fail 0
| |- _ ⊢ ?p ⊕ ?q =>
apply Oplus_R_1;search_goal m g
| |- _ ⊢ ?p ⊕ ?q =>
apply Oplus_R_2;search_goal m g
end
end.
Lemma originelle' :
{P&1, R, G, B&1, !(S⊸A), (E⊸A)&1, (P⊸M)&1,(R⊸1)&(R⊸E), (G⊸1)⊕(G⊸S), 1⊕((B⊸S)&(B⊸1)) } ⊢ A ⊕ M .
Proof with try solve [ apply Id;reflexivity | prove_multiset_eq].
oplus_l (G ⊸ 1) (G ⊸ S).
- weak_impl_l G 1...
one_l.
oplus_l 1 ((B ⊸ S) & (B ⊸ 1)).
+ and_l_2 B 1.
do 2 one_l.
and_l_2 P 1.
and_l_1 (E ⊸ A) 1.
Time search_goal 6 ({R ⊸ E, E ⊸ A, R} ⊢ A ⊕ M).
finish_proof_strong.
+ and_l_2 (B ⊸ S) (B ⊸ 1).
and_l_1 B 1.
weak_impl_l B 1...
one_l.
and_l_1 (R ⊸ 1) (R ⊸ E).
weak_impl_l R 1...
and_l_1 P 1.
Time search_goal 6 ({P ⊸ M, P} ⊢ A ⊕ M).
finish_proof_strong.
- weak_impl_l G S...
and_l_1(R ⊸ 1) (R ⊸ E).
weak_impl_l R 1...
one_l.
oplus_l 1 ((B ⊸ S) & (B ⊸ 1)).
+ search_goal 10 ({S, !(S ⊸ A)} ⊢ A ⊕ M).
bang_d (S ⊸ A)... (* !D instead of WL *)
finish_proof_strong.
+ and_l_2 (B ⊸ S) (B ⊸ 1).
and_l_1 B 1.
Time search_goal 10 ({S, !(S ⊸ A)} ⊢ A ⊕ M).
bang_d (S ⊸ A)... (* !D instead of WL *)
finish_proof_strong.
Qed.
(*
Lemma originelle2 :
{P&1, R, G, B&1, !(S⊸A), (E⊸A)&1, (P⊸M)&1,(R⊸1)&(R⊸E), (G⊸1)⊕(G⊸S), 1⊕((B⊸S)&(B⊸1)) } ⊢ A ⊕ M .
and_l_2 (R⊸1) (R⊸E).
*)