Try to justify the presence/absence of 'unique' attribute.
Chris Pressey
8 years ago
132 | 132 | of a turnstile can be filled out by a variable on the LHS, so I've taken the liberty of turning |
133 | 133 | it into a rule. |
134 | 134 | |
135 | The atom introduced as the variable in the `forall` must be unique (i.e. not used previously in | |
136 | the proof.) This implements scope. Without that restriction, it is possible to confuse | |
137 | arbitrary and particular variables and write proofs that make no sense. | |
135 | The variable being introduced by Universal Generalization need not be unique, because it | |
136 | is bound in a `forall`. | |
137 | ||
138 | Note that the substitution operation `P[X -> V]` used in the Universal Generalization rule | |
139 | first checks that the instance of V does not already occur in P. | |
140 | ||
141 | (This may in fact be overly restrictive. But it seems like the most hardship it causes at | |
142 | the moment is that it requires you to select different names for variables in parts of the | |
143 | proof. For example, below we show a result `forall(y, ...)`. We could just as easily | |
144 | want to show the result `forall(x, ...)` but x is already a free (arbitrary) variable in | |
145 | this proof.) | |
138 | 146 | |
139 | 147 | We use `c(zero)` to represent zero because we can't use `zero` because then you could use it as |
140 | 148 | a variable name and say something silly like `forall(zero, ...)`. |
143 | 151 | Premise = |- eq(add(x, c(zero)), x) |
144 | 152 | Commutivity_of_Equality = eq(E1, E0) |- impl(eq(E1, E0), eq(E0, E1)) |
145 | 153 | Modus_Ponens = P0 ; impl(P0, P1) |- P1 |
146 | Universal_Generalization = P ; X{term} ; V{unique atom} |- forall(V, P[X -> V]) | |
154 | Universal_Generalization = P ; X{term} ; V{atom} |- forall(V, P[X -> V]) | |
147 | 155 | show |
148 | 156 | forall(y, eq(y, add(y, c(zero)))) |
149 | 157 | proof |
158 | 166 | |
159 | 167 | All bugs are creepy and all bugs are crawly therefore all bugs are both creepy and crawly. |
160 | 168 | |
161 | Note that the term introduced as the variable in the UI need *not* be unique, because if | |
169 | Note that the term introduced as the variable in the UI need not be unique, because if | |
162 | 170 | something is true for all `x`, it is true for *all* `x`, even if `x` is something else |
163 | you've already been thinking about and given the name `x`. | |
164 | ||
165 | Note that it also need not be an atom. | |
171 | you've already been thinking about and given the name `x`. Note that it also need not | |
172 | be an atom. | |
173 | ||
174 | Note that the substitution operation `P[X -> V]` used in the Universal Instantiation rule | |
175 | first checks that the instance of V does not already occur in P. This prevents situations | |
176 | like instantiating ∀x.∃y.x≠y with y, to obtain ∃y.y≠y. | |
166 | 177 | |
167 | 178 | given |
168 | 179 | Modus_Ponens = impl(P, Q) ; P |- Q |
174 | 185 | end |
175 | 186 | end |
176 | 187 | |
177 | Universal_Generalization = P ; X{term} ; V{unique atom} |- forall(V, P[X -> V]) | |
188 | Universal_Generalization = P ; X{term} ; V{atom} |- forall(V, P[X -> V]) | |
178 | 189 | Universal_Instantiation = forall(X, P) ; V{term} |- P[X -> V] |
179 | 190 | |
180 | 191 | Premise_1 = |- forall(x, impl(bug(x), creepy(x))) |
203 | 214 | |
204 | 215 | All bugs are creepy therefore there exists a bug which is creepy. |
205 | 216 | |
206 | Again, the new variable name introduced into the `exists` must be unique to avoid | |
207 | scope problems. | |
217 | The variable being introduced by Existential Generalization need not be unique, because it | |
218 | is bound in an `exists`. | |
219 | ||
220 | Like always with `[X -> V]`, an occurs check occurs. Not sure if necessary atm. | |
208 | 221 | |
209 | 222 | given |
210 | 223 | Universal_Instantiation = forall(X, P) ; V{term} |- P[X -> V] |
211 | Existential_Generalization = P ; X{term} ; V{unique atom} |- exists(V, P[X -> V]) | |
224 | Existential_Generalization = P ; X{term} ; V{atom} |- exists(V, P[X -> V]) | |
212 | 225 | |
213 | 226 | Premise = |- forall(x, impl(bug(x), creepy(x))) |
214 | 227 | show |
225 | 238 | All men are mortal. There exists a man named Socrates. Therefore there exists a man who is mortal |
226 | 239 | and who is named Socrates. |
227 | 240 | |
228 | Very unlike UI, the new variable name introduced during EI needs to be both unique to avoid | |
229 | scope problems, and local, to prevent the name from "leaking out" of the EI block. | |
241 | Very unlike UI, to avoid scoping problems, the new variable name introduced during EI needs to be: | |
242 | ||
243 | * an atom, because instantiating an entire term is probably unjustifiable sometimes | |
244 | * unique, to avoid clashing with another variable that was previously instantiated | |
245 | * local, to prevent the name from "leaking out" of the EI block. | |
246 | ||
247 | Note that the substitution operation `P[X -> V]` used in the Existential Instantiation rule | |
248 | first checks that the instance of V does not already occur in P. This prevents situations | |
249 | like instantiating ∃x.∀y.p(y)→x≠y with y, to obtain ∀y.p(y)→y≠y. | |
230 | 250 | |
231 | 251 | given |
232 | 252 | Modus_Ponens = impl(P, Q) ; P |- Q |
236 | 256 | Tautology = P |- P |
237 | 257 | |
238 | 258 | Universal_Instantiation = forall(X, P) ; V{term} |- P[X -> V] |
239 | Existential_Generalization = P ; X{term} ; V{unique atom} |- exists(V, P[X -> V]) | |
259 | Existential_Generalization = P ; X{term} ; V{atom} |- exists(V, P[X -> V]) | |
240 | 260 | block Existential_Instantiation |
241 | 261 | case |
242 | 262 | Let = exists(X, P) ; V{unique local atom} |- P[X -> V] |
268 | 288 | For comparison, here are all of the rules for Universal (resp. Existential) |
269 | 289 | Generalization (resp. Instantiation) shown together in one place, with abbreviated names: |
270 | 290 | |
271 | UG = P ; X{term} ; V{unique atom} |- forall(V, P[X -> V]) | |
291 | UG = P ; X{term} ; V{atom} |- forall(V, P[X -> V]) | |
272 | 292 | UI = forall(X, P) ; V{term} |- P[X -> V] |
273 | EG = P ; X{term} ; V{unique atom} |- exists(V, P[X -> V]) | |
293 | EG = P ; X{term} ; V{atom} |- exists(V, P[X -> V]) | |
274 | 294 | block EI |
275 | 295 | case |
276 | 296 | Let = exists(X, P) ; V{unique local atom} |- P[X -> V] |
315 | 335 | As long as it's not the same as any atom already in P. (This sounds familiar.) |
316 | 336 | |
317 | 337 | given |
318 | UG = P ; X{term} ; V{unique atom} |- forall(V, P[X -> V]) | |
338 | UG = P ; X{term} ; V{atom} |- forall(V, P[X -> V]) | |
319 | 339 | UI = forall(X, P) ; V{term} |- P[X -> V] |
320 | EG = P ; X{term} ; V{unique atom} |- exists(V, P[X -> V]) | |
340 | EG = P ; X{term} ; V{atom} |- exists(V, P[X -> V]) | |
321 | 341 | block EI |
322 | 342 | case |
323 | 343 | Let = exists(X, P) ; V{unique local atom} |- P[X -> V] |