1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* ********************************************************************** *)
16 (* Progetto FreeScale *)
18 (* Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Ultima modifica: 05/08/2009 *)
21 (* ********************************************************************** *)
23 include "common/list.ma".
24 include "num/bool_lemmas.ma".
26 nlet rec nmember_list (T:Type) (elem:T) (f:T → T → bool) (l:list T) on l ≝
29 | cons h t ⇒ match f elem h with
30 [ true ⇒ false | false ⇒ nmember_list T elem f t ]
33 (* elem presente una ed una sola volta in l *)
34 nlet rec member_list (T:Type) (elem:T) (f:T → T → bool) (l:list T) on l ≝
37 | cons h t ⇒ match f elem h with
38 [ true ⇒ nmember_list T elem f t | false ⇒ member_list T elem f t ]
41 (* tutti gli atomi dell'universo che poi saranno raggruppati in sottouniversi *)
42 ninductive UN : Type ≝
43 (* quaternari[4] 1-4 *)
59 (* esadecimali[16] 13-28 *)
77 (* bitrigesimali[32] 29-60 *)
111 (* ascii[63] 61-123 *)
176 (* opcode[91] 124-214 *)
270 (* funzione di uguaglianza sugli atomi *)
273 [ uq0 ⇒ match u2 with [ uq0 ⇒ true | _ ⇒ false ]
274 | uq1 ⇒ match u2 with [ uq1 ⇒ true | _ ⇒ false ]
275 | uq2 ⇒ match u2 with [ uq2 ⇒ true | _ ⇒ false ]
276 | uq3 ⇒ match u2 with [ uq3 ⇒ true | _ ⇒ false ]
278 | uo0 ⇒ match u2 with [ uo0 ⇒ true | _ ⇒ false ]
279 | uo1 ⇒ match u2 with [ uo1 ⇒ true | _ ⇒ false ]
280 | uo2 ⇒ match u2 with [ uo2 ⇒ true | _ ⇒ false ]
281 | uo3 ⇒ match u2 with [ uo3 ⇒ true | _ ⇒ false ]
282 | uo4 ⇒ match u2 with [ uo4 ⇒ true | _ ⇒ false ]
283 | uo5 ⇒ match u2 with [ uo5 ⇒ true | _ ⇒ false ]
284 | uo6 ⇒ match u2 with [ uo6 ⇒ true | _ ⇒ false ]
285 | uo7 ⇒ match u2 with [ uo7 ⇒ true | _ ⇒ false ]
287 | ux0 ⇒ match u2 with [ ux0 ⇒ true | _ ⇒ false ]
288 | ux1 ⇒ match u2 with [ ux1 ⇒ true | _ ⇒ false ]
289 | ux2 ⇒ match u2 with [ ux2 ⇒ true | _ ⇒ false ]
290 | ux3 ⇒ match u2 with [ ux3 ⇒ true | _ ⇒ false ]
291 | ux4 ⇒ match u2 with [ ux4 ⇒ true | _ ⇒ false ]
292 | ux5 ⇒ match u2 with [ ux5 ⇒ true | _ ⇒ false ]
293 | ux6 ⇒ match u2 with [ ux6 ⇒ true | _ ⇒ false ]
294 | ux7 ⇒ match u2 with [ ux7 ⇒ true | _ ⇒ false ]
295 | ux8 ⇒ match u2 with [ ux8 ⇒ true | _ ⇒ false ]
296 | ux9 ⇒ match u2 with [ ux9 ⇒ true | _ ⇒ false ]
297 | uxA ⇒ match u2 with [ uxA ⇒ true | _ ⇒ false ]
298 | uxB ⇒ match u2 with [ uxB ⇒ true | _ ⇒ false ]
299 | uxC ⇒ match u2 with [ uxC ⇒ true | _ ⇒ false ]
300 | uxD ⇒ match u2 with [ uxD ⇒ true | _ ⇒ false ]
301 | uxE ⇒ match u2 with [ uxE ⇒ true | _ ⇒ false ]
302 | uxF ⇒ match u2 with [ uxF ⇒ true | _ ⇒ false ]
304 | ut00 ⇒ match u2 with [ ut00 ⇒ true | _ ⇒ false ]
305 | ut01 ⇒ match u2 with [ ut01 ⇒ true | _ ⇒ false ]
306 | ut02 ⇒ match u2 with [ ut02 ⇒ true | _ ⇒ false ]
307 | ut03 ⇒ match u2 with [ ut03 ⇒ true | _ ⇒ false ]
308 | ut04 ⇒ match u2 with [ ut04 ⇒ true | _ ⇒ false ]
309 | ut05 ⇒ match u2 with [ ut05 ⇒ true | _ ⇒ false ]
310 | ut06 ⇒ match u2 with [ ut06 ⇒ true | _ ⇒ false ]
311 | ut07 ⇒ match u2 with [ ut07 ⇒ true | _ ⇒ false ]
312 | ut08 ⇒ match u2 with [ ut08 ⇒ true | _ ⇒ false ]
313 | ut09 ⇒ match u2 with [ ut09 ⇒ true | _ ⇒ false ]
314 | ut0A ⇒ match u2 with [ ut0A ⇒ true | _ ⇒ false ]
315 | ut0B ⇒ match u2 with [ ut0B ⇒ true | _ ⇒ false ]
316 | ut0C ⇒ match u2 with [ ut0C ⇒ true | _ ⇒ false ]
317 | ut0D ⇒ match u2 with [ ut0D ⇒ true | _ ⇒ false ]
318 | ut0E ⇒ match u2 with [ ut0E ⇒ true | _ ⇒ false ]
319 | ut0F ⇒ match u2 with [ ut0F ⇒ true | _ ⇒ false ]
320 | ut10 ⇒ match u2 with [ ut10 ⇒ true | _ ⇒ false ]
321 | ut11 ⇒ match u2 with [ ut11 ⇒ true | _ ⇒ false ]
322 | ut12 ⇒ match u2 with [ ut12 ⇒ true | _ ⇒ false ]
323 | ut13 ⇒ match u2 with [ ut13 ⇒ true | _ ⇒ false ]
324 | ut14 ⇒ match u2 with [ ut14 ⇒ true | _ ⇒ false ]
325 | ut15 ⇒ match u2 with [ ut15 ⇒ true | _ ⇒ false ]
326 | ut16 ⇒ match u2 with [ ut16 ⇒ true | _ ⇒ false ]
327 | ut17 ⇒ match u2 with [ ut17 ⇒ true | _ ⇒ false ]
328 | ut18 ⇒ match u2 with [ ut18 ⇒ true | _ ⇒ false ]
329 | ut19 ⇒ match u2 with [ ut19 ⇒ true | _ ⇒ false ]
330 | ut1A ⇒ match u2 with [ ut1A ⇒ true | _ ⇒ false ]
331 | ut1B ⇒ match u2 with [ ut1B ⇒ true | _ ⇒ false ]
332 | ut1C ⇒ match u2 with [ ut1C ⇒ true | _ ⇒ false ]
333 | ut1D ⇒ match u2 with [ ut1D ⇒ true | _ ⇒ false ]
334 | ut1E ⇒ match u2 with [ ut1E ⇒ true | _ ⇒ false ]
335 | ut1F ⇒ match u2 with [ ut1F ⇒ true | _ ⇒ false ]
337 | uch_0 ⇒ match u2 with [ uch_0 ⇒ true | _ ⇒ false ]
338 | uch_1 ⇒ match u2 with [ uch_1 ⇒ true | _ ⇒ false ]
339 | uch_2 ⇒ match u2 with [ uch_2 ⇒ true | _ ⇒ false ]
340 | uch_3 ⇒ match u2 with [ uch_3 ⇒ true | _ ⇒ false ]
341 | uch_4 ⇒ match u2 with [ uch_4 ⇒ true | _ ⇒ false ]
342 | uch_5 ⇒ match u2 with [ uch_5 ⇒ true | _ ⇒ false ]
343 | uch_6 ⇒ match u2 with [ uch_6 ⇒ true | _ ⇒ false ]
344 | uch_7 ⇒ match u2 with [ uch_7 ⇒ true | _ ⇒ false ]
345 | uch_8 ⇒ match u2 with [ uch_8 ⇒ true | _ ⇒ false ]
346 | uch_9 ⇒ match u2 with [ uch_9 ⇒ true | _ ⇒ false ]
347 | uch__ ⇒ match u2 with [ uch__ ⇒ true | _ ⇒ false ]
348 | uch_A ⇒ match u2 with [ uch_A ⇒ true | _ ⇒ false ]
349 | uch_B ⇒ match u2 with [ uch_B ⇒ true | _ ⇒ false ]
350 | uch_C ⇒ match u2 with [ uch_C ⇒ true | _ ⇒ false ]
351 | uch_D ⇒ match u2 with [ uch_D ⇒ true | _ ⇒ false ]
352 | uch_E ⇒ match u2 with [ uch_E ⇒ true | _ ⇒ false ]
353 | uch_F ⇒ match u2 with [ uch_F ⇒ true | _ ⇒ false ]
354 | uch_G ⇒ match u2 with [ uch_G ⇒ true | _ ⇒ false ]
355 | uch_H ⇒ match u2 with [ uch_H ⇒ true | _ ⇒ false ]
356 | uch_I ⇒ match u2 with [ uch_I ⇒ true | _ ⇒ false ]
357 | uch_J ⇒ match u2 with [ uch_J ⇒ true | _ ⇒ false ]
358 | uch_K ⇒ match u2 with [ uch_K ⇒ true | _ ⇒ false ]
359 | uch_L ⇒ match u2 with [ uch_L ⇒ true | _ ⇒ false ]
360 | uch_M ⇒ match u2 with [ uch_M ⇒ true | _ ⇒ false ]
361 | uch_N ⇒ match u2 with [ uch_N ⇒ true | _ ⇒ false ]
362 | uch_O ⇒ match u2 with [ uch_O ⇒ true | _ ⇒ false ]
363 | uch_P ⇒ match u2 with [ uch_P ⇒ true | _ ⇒ false ]
364 | uch_Q ⇒ match u2 with [ uch_Q ⇒ true | _ ⇒ false ]
365 | uch_R ⇒ match u2 with [ uch_R ⇒ true | _ ⇒ false ]
366 | uch_S ⇒ match u2 with [ uch_S ⇒ true | _ ⇒ false ]
367 | uch_T ⇒ match u2 with [ uch_T ⇒ true | _ ⇒ false ]
368 | uch_U ⇒ match u2 with [ uch_U ⇒ true | _ ⇒ false ]
369 | uch_V ⇒ match u2 with [ uch_V ⇒ true | _ ⇒ false ]
370 | uch_W ⇒ match u2 with [ uch_W ⇒ true | _ ⇒ false ]
371 | uch_X ⇒ match u2 with [ uch_X ⇒ true | _ ⇒ false ]
372 | uch_Y ⇒ match u2 with [ uch_Y ⇒ true | _ ⇒ false ]
373 | uch_Z ⇒ match u2 with [ uch_Z ⇒ true | _ ⇒ false ]
374 | uch_a ⇒ match u2 with [ uch_a ⇒ true | _ ⇒ false ]
375 | uch_b ⇒ match u2 with [ uch_b ⇒ true | _ ⇒ false ]
376 | uch_c ⇒ match u2 with [ uch_c ⇒ true | _ ⇒ false ]
377 | uch_d ⇒ match u2 with [ uch_d ⇒ true | _ ⇒ false ]
378 | uch_e ⇒ match u2 with [ uch_e ⇒ true | _ ⇒ false ]
379 | uch_f ⇒ match u2 with [ uch_f ⇒ true | _ ⇒ false ]
380 | uch_g ⇒ match u2 with [ uch_g ⇒ true | _ ⇒ false ]
381 | uch_h ⇒ match u2 with [ uch_h ⇒ true | _ ⇒ false ]
382 | uch_i ⇒ match u2 with [ uch_i ⇒ true | _ ⇒ false ]
383 | uch_j ⇒ match u2 with [ uch_j ⇒ true | _ ⇒ false ]
384 | uch_k ⇒ match u2 with [ uch_k ⇒ true | _ ⇒ false ]
385 | uch_l ⇒ match u2 with [ uch_l ⇒ true | _ ⇒ false ]
386 | uch_m ⇒ match u2 with [ uch_m ⇒ true | _ ⇒ false ]
387 | uch_n ⇒ match u2 with [ uch_n ⇒ true | _ ⇒ false ]
388 | uch_o ⇒ match u2 with [ uch_o ⇒ true | _ ⇒ false ]
389 | uch_p ⇒ match u2 with [ uch_p ⇒ true | _ ⇒ false ]
390 | uch_q ⇒ match u2 with [ uch_q ⇒ true | _ ⇒ false ]
391 | uch_r ⇒ match u2 with [ uch_r ⇒ true | _ ⇒ false ]
392 | uch_s ⇒ match u2 with [ uch_s ⇒ true | _ ⇒ false ]
393 | uch_t ⇒ match u2 with [ uch_t ⇒ true | _ ⇒ false ]
394 | uch_u ⇒ match u2 with [ uch_u ⇒ true | _ ⇒ false ]
395 | uch_v ⇒ match u2 with [ uch_v ⇒ true | _ ⇒ false ]
396 | uch_w ⇒ match u2 with [ uch_w ⇒ true | _ ⇒ false ]
397 | uch_x ⇒ match u2 with [ uch_x ⇒ true | _ ⇒ false ]
398 | uch_y ⇒ match u2 with [ uch_y ⇒ true | _ ⇒ false ]
399 | uch_z ⇒ match u2 with [ uch_z ⇒ true | _ ⇒ false ]
401 | uADC ⇒ match u2 with [ uADC ⇒ true | _ ⇒ false ]
402 | uADD ⇒ match u2 with [ uADD ⇒ true | _ ⇒ false ]
403 | uAIS ⇒ match u2 with [ uAIS ⇒ true | _ ⇒ false ]
404 | uAIX ⇒ match u2 with [ uAIX ⇒ true | _ ⇒ false ]
405 | uAND ⇒ match u2 with [ uAND ⇒ true | _ ⇒ false ]
406 | uASL ⇒ match u2 with [ uASL ⇒ true | _ ⇒ false ]
407 | uASR ⇒ match u2 with [ uASR ⇒ true | _ ⇒ false ]
408 | uBCC ⇒ match u2 with [ uBCC ⇒ true | _ ⇒ false ]
409 | uBCLRn ⇒ match u2 with [ uBCLRn ⇒ true | _ ⇒ false ]
410 | uBCS ⇒ match u2 with [ uBCS ⇒ true | _ ⇒ false ]
411 | uBEQ ⇒ match u2 with [ uBEQ ⇒ true | _ ⇒ false ]
412 | uBGE ⇒ match u2 with [ uBGE ⇒ true | _ ⇒ false ]
413 | uBGND ⇒ match u2 with [ uBGND ⇒ true | _ ⇒ false ]
414 | uBGT ⇒ match u2 with [ uBGT ⇒ true | _ ⇒ false ]
415 | uBHCC ⇒ match u2 with [ uBHCC ⇒ true | _ ⇒ false ]
416 | uBHCS ⇒ match u2 with [ uBHCS ⇒ true | _ ⇒ false ]
417 | uBHI ⇒ match u2 with [ uBHI ⇒ true | _ ⇒ false ]
418 | uBIH ⇒ match u2 with [ uBIH ⇒ true | _ ⇒ false ]
419 | uBIL ⇒ match u2 with [ uBIL ⇒ true | _ ⇒ false ]
420 | uBIT ⇒ match u2 with [ uBIT ⇒ true | _ ⇒ false ]
421 | uBLE ⇒ match u2 with [ uBLE ⇒ true | _ ⇒ false ]
422 | uBLS ⇒ match u2 with [ uBLS ⇒ true | _ ⇒ false ]
423 | uBLT ⇒ match u2 with [ uBLT ⇒ true | _ ⇒ false ]
424 | uBMC ⇒ match u2 with [ uBMC ⇒ true | _ ⇒ false ]
425 | uBMI ⇒ match u2 with [ uBMI ⇒ true | _ ⇒ false ]
426 | uBMS ⇒ match u2 with [ uBMS ⇒ true | _ ⇒ false ]
427 | uBNE ⇒ match u2 with [ uBNE ⇒ true | _ ⇒ false ]
428 | uBPL ⇒ match u2 with [ uBPL ⇒ true | _ ⇒ false ]
429 | uBRA ⇒ match u2 with [ uBRA ⇒ true | _ ⇒ false ]
430 | uBRCLRn ⇒ match u2 with [ uBRCLRn ⇒ true | _ ⇒ false ]
431 | uBRN ⇒ match u2 with [ uBRN ⇒ true | _ ⇒ false ]
432 | uBRSETn ⇒ match u2 with [ uBRSETn ⇒ true | _ ⇒ false ]
433 | uBSETn ⇒ match u2 with [ uBSETn ⇒ true | _ ⇒ false ]
434 | uBSR ⇒ match u2 with [ uBSR ⇒ true | _ ⇒ false ]
435 | uCBEQA ⇒ match u2 with [ uCBEQA ⇒ true | _ ⇒ false ]
436 | uCBEQX ⇒ match u2 with [ uCBEQX ⇒ true | _ ⇒ false ]
437 | uCLC ⇒ match u2 with [ uCLC ⇒ true | _ ⇒ false ]
438 | uCLI ⇒ match u2 with [ uCLI ⇒ true | _ ⇒ false ]
439 | uCLR ⇒ match u2 with [ uCLR ⇒ true | _ ⇒ false ]
440 | uCMP ⇒ match u2 with [ uCMP ⇒ true | _ ⇒ false ]
441 | uCOM ⇒ match u2 with [ uCOM ⇒ true | _ ⇒ false ]
442 | uCPHX ⇒ match u2 with [ uCPHX ⇒ true | _ ⇒ false ]
443 | uCPX ⇒ match u2 with [ uCPX ⇒ true | _ ⇒ false ]
444 | uDAA ⇒ match u2 with [ uDAA ⇒ true | _ ⇒ false ]
445 | uDBNZ ⇒ match u2 with [ uDBNZ ⇒ true | _ ⇒ false ]
446 | uDEC ⇒ match u2 with [ uDEC ⇒ true | _ ⇒ false ]
447 | uDIV ⇒ match u2 with [ uDIV ⇒ true | _ ⇒ false ]
448 | uEOR ⇒ match u2 with [ uEOR ⇒ true | _ ⇒ false ]
449 | uINC ⇒ match u2 with [ uINC ⇒ true | _ ⇒ false ]
450 | uJMP ⇒ match u2 with [ uJMP ⇒ true | _ ⇒ false ]
451 | uJSR ⇒ match u2 with [ uJSR ⇒ true | _ ⇒ false ]
452 | uLDA ⇒ match u2 with [ uLDA ⇒ true | _ ⇒ false ]
453 | uLDHX ⇒ match u2 with [ uLDHX ⇒ true | _ ⇒ false ]
454 | uLDX ⇒ match u2 with [ uLDX ⇒ true | _ ⇒ false ]
455 | uLSR ⇒ match u2 with [ uLSR ⇒ true | _ ⇒ false ]
456 | uMOV ⇒ match u2 with [ uMOV ⇒ true | _ ⇒ false ]
457 | uMUL ⇒ match u2 with [ uMUL ⇒ true | _ ⇒ false ]
458 | uNEG ⇒ match u2 with [ uNEG ⇒ true | _ ⇒ false ]
459 | uNOP ⇒ match u2 with [ uNOP ⇒ true | _ ⇒ false ]
460 | uNSA ⇒ match u2 with [ uNSA ⇒ true | _ ⇒ false ]
461 | uORA ⇒ match u2 with [ uORA ⇒ true | _ ⇒ false ]
462 | uPSHA ⇒ match u2 with [ uPSHA ⇒ true | _ ⇒ false ]
463 | uPSHH ⇒ match u2 with [ uPSHH ⇒ true | _ ⇒ false ]
464 | uPSHX ⇒ match u2 with [ uPSHX ⇒ true | _ ⇒ false ]
465 | uPULA ⇒ match u2 with [ uPULA ⇒ true | _ ⇒ false ]
466 | uPULH ⇒ match u2 with [ uPULH ⇒ true | _ ⇒ false ]
467 | uPULX ⇒ match u2 with [ uPULX ⇒ true | _ ⇒ false ]
468 | uROL ⇒ match u2 with [ uROL ⇒ true | _ ⇒ false ]
469 | uROR ⇒ match u2 with [ uROR ⇒ true | _ ⇒ false ]
470 | uRSP ⇒ match u2 with [ uRSP ⇒ true | _ ⇒ false ]
471 | uRTI ⇒ match u2 with [ uRTI ⇒ true | _ ⇒ false ]
472 | uRTS ⇒ match u2 with [ uRTS ⇒ true | _ ⇒ false ]
473 | uSBC ⇒ match u2 with [ uSBC ⇒ true | _ ⇒ false ]
474 | uSEC ⇒ match u2 with [ uSEC ⇒ true | _ ⇒ false ]
475 | uSEI ⇒ match u2 with [ uSEI ⇒ true | _ ⇒ false ]
476 | uSHA ⇒ match u2 with [ uSHA ⇒ true | _ ⇒ false ]
477 | uSLA ⇒ match u2 with [ uSLA ⇒ true | _ ⇒ false ]
478 | uSTA ⇒ match u2 with [ uSTA ⇒ true | _ ⇒ false ]
479 | uSTHX ⇒ match u2 with [ uSTHX ⇒ true | _ ⇒ false ]
480 | uSTOP ⇒ match u2 with [ uSTOP ⇒ true | _ ⇒ false ]
481 | uSTX ⇒ match u2 with [ uSTX ⇒ true | _ ⇒ false ]
482 | uSUB ⇒ match u2 with [ uSUB ⇒ true | _ ⇒ false ]
483 | uSWI ⇒ match u2 with [ uSWI ⇒ true | _ ⇒ false ]
484 | uTAP ⇒ match u2 with [ uTAP ⇒ true | _ ⇒ false ]
485 | uTAX ⇒ match u2 with [ uTAX ⇒ true | _ ⇒ false ]
486 | uTPA ⇒ match u2 with [ uTPA ⇒ true | _ ⇒ false ]
487 | uTST ⇒ match u2 with [ uTST ⇒ true | _ ⇒ false ]
488 | uTSX ⇒ match u2 with [ uTSX ⇒ true | _ ⇒ false ]
489 | uTXA ⇒ match u2 with [ uTXA ⇒ true | _ ⇒ false ]
490 | uTXS ⇒ match u2 with [ uTXS ⇒ true | _ ⇒ false ]
491 | uWAIT ⇒ match u2 with [ uWAIT ⇒ true | _ ⇒ false ]
495 (* costruttore di un sottouniverso:
496 S_EL cioe' uno qualsiasi degli elementi del sottouniverso
497 S_KO cioe' il caso impossibile
499 ninductive S_UN (l:list UN) : Type ≝
500 S_EL : Πx:UN.((member_list UN x eq_UN l) = true) → (∀y.eq_UN x y = true → x = y) → S_UN l
501 | S_KO : False → S_UN l.
503 ndefinition getelem : ∀l.∀e:S_UN l.UN.
505 ##[ ##1: #u; #dim1; #dim2; napply u
510 ndefinition eq_SUN ≝ λl.λx,y:S_UN l.eq_UN (getelem ? x) (getelem ? y).
512 ndefinition getdim1 : ∀l.∀e:S_UN l.member_list UN (getelem ? e) eq_UN l = true.
515 ##| ##1: #u; #dim1; #dim2; napply dim1
519 ndefinition getdim2 : ∀l.∀e:S_UN l.(∀y.eq_UN (getelem ? e) y = true → (getelem ? e) = y).
522 ##| ##1: #u; #dim1; #dim2; napply dim2
526 nlemma SUN_destruct_1
527 : ∀l.∀e1,e2.∀dim11,dim21.∀dim12,dim22.S_EL l e1 dim11 dim12 = S_EL l e2 dim21 dim22 → e1 = e2.
528 #l; #e1; #e2; #dim11; #dim21; #dim12; #dim22; #H;
529 nchange with (match S_EL l e2 dim21 dim22 with [ S_EL a _ _ ⇒ e1 = a | S_KO _ ⇒ False ]);
535 ndefinition UN_destruct : ∀x,y.∀P:Prop.x = y → match eq_UN x y with [ true ⇒ P → P | false ⇒ P ].
543 ndefinition SUN_destruct : ∀l.∀x,y:S_UN l.∀P:Prop.x = y → match eq_SUN l x y with [ true ⇒ P → P | false ⇒ P ].
546 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
548 ##| ##1: #u2; #dim21; #dim22; #P;
549 nchange with (? → (match eq_UN u1 u2 with [ true ⇒ P → P | false ⇒ P ]));
550 #H; napply (UN_destruct u1 u2);
551 napply (SUN_destruct_1 l … H)
556 nlemma eq_to_eqUN : ∀e1,e2.e1 = e2 → eq_UN e1 e2 = true.
564 nlemma eq_to_eqSUN : ∀l.∀x,y:S_UN l.x = y → eq_SUN l x y = true.
567 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
569 ##| ##1: #u2; #dim21; #dim22;
570 nchange with (? → eq_UN u1 u2 = true);
571 #H; napply (eq_to_eqUN u1 u2);
572 napply (SUN_destruct_1 l … H)
577 nlemma neqUN_to_neq : ∀e1,e2.eq_UN e1 e2 = false → e1 ≠ e2.
579 napply (not_to_not (e1 = e2) (eq_UN e1 e2 = true) …);
580 ##[ ##1: napply (eq_to_eqUN e1 e2)
581 ##| ##2: napply (eqfalse_to_neqtrue … H)
585 nlemma neqSUN_to_neq : ∀l.∀x,y:S_UN l.eq_SUN l x y = false → x ≠ y.
588 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
590 ##| ##1: #u2; #dim21; #dim22;
591 nchange with ((eq_UN u1 u2 = false) → ?);
593 napply (neqUN_to_neq u1 u2 H);
594 napply (SUN_destruct_1 l … H1)
601 ∀dim11,dim21:(member_list UN u eq_UN l = true).
602 ∀dim12,dim22:(∀y0.(eq_UN u y0 = true) → (u = y0)).
603 ((S_EL l u dim11 dim12) = (S_EL l u dim21 dim22)).
605 nlemma eqgetelem_to_eq : ∀l.∀x,y:S_UN l.(getelem ? x) = (getelem ? y) → x = y.
608 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
610 ##| ##1: #u2; #dim21; #dim22;
611 nchange with (u1 = u2 → ?); #H;
612 nrewrite > H in dim11:(%) dim12:(%) ⊢ %; #dim11; #dim12;
613 napply (SUN_construct l u2 dim11 dim21 dim12 dim22);
618 nlemma neq_to_neqgetelem : ∀l.∀x,y:S_UN l.x ≠ y → (getelem ? x) ≠ (getelem ? y).
621 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
623 ##| ##1: #u2; #dim21; #dim22; #H;
624 napply (not_to_not ((getelem l ?) = (getelem l ?))
625 ((S_EL l u1 dim11 dim12) = (S_EL l u2 dim21 dim22)) ?);
627 ##| ##2: napply (eqgetelem_to_eq l …)
633 nlemma eqSUN_to_eq : ∀l.∀x,y:S_UN l.eq_SUN l x y = true → x = y.
636 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
638 ##| ##1: #u2; #dim21; #dim22;
639 nchange with ((eq_UN u1 u2 = true) → ?); #H;
640 nrewrite > (eqgetelem_to_eq l (S_EL l u1 dim11 dim12) (S_EL l u2 dim21 dim22) (dim12 u2 H));
646 nlemma neq_to_neqSUN : ∀l.∀x,y:S_UN l.x ≠ y → eq_SUN l x y = false.
649 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
651 ##| ##1: #u2; #dim21; #dim22; #H;
652 napply neqtrue_to_eqfalse;
653 napply (not_to_not ?? (eqSUN_to_eq l ??) ?) ;
659 nlemma decidable_SUN : ∀l.∀x,y:S_UN l.decidable (x = y).
662 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
664 ##| ##1: #u2; #dim21; #dim22; nnormalize;
665 napply (or2_elim … (decidable_bexpr (eq_SUN l (S_EL l u1 dim11 dim12) (S_EL l u2 dim21 dim22))));
666 ##[ ##1: #H; napply (or2_intro1 (? = ?) (? ≠ ?) (eqSUN_to_eq l … H))
667 ##| ##2: #H; napply (or2_intro2 (? = ?) (? ≠ ?) (neqSUN_to_neq l … H))
671 nlemma symmetric_eqSUN : ∀l.symmetricT (S_UN l) bool (eq_SUN l).
674 ##| ##1: #u1; #dim11; #dim12; #y; nelim y;
676 ##| ##1: #u2; #dim21; #dim22;
677 napply (or2_elim (? = ?) (? ≠ ?) ? (decidable_SUN l (S_EL l u1 dim11 dim12) (S_EL l u2 dim21 dim22)));
678 ##[ ##1: #H; nrewrite > H; napply refl_eq
679 ##| ##2: #H; nrewrite > (neq_to_neqSUN l … H);
680 napply (symmetric_eq ? (eq_SUN l ??) false);
681 napply (neq_to_neqSUN l … (symmetric_neq … H))