]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/ng_assembly/num/oct_lemmas.ma
freescale porting, work in progress
[helm.git] / helm / software / matita / contribs / ng_assembly / num / oct_lemmas.ma
index 2d754d79937f7d57beb2539560c58312fbf4d5a0..7cb82090dac1d0945cd867272545e200bea83d5d 100755 (executable)
@@ -29,69 +29,14 @@ include "num/bool_lemmas.ma".
 
 ndefinition oct_destruct_aux ≝
 Πn1,n2:oct.ΠP:Prop.n1 = n2 →
- match n1 with
-  [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ]
-  | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ]
-  | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ]
-  | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ]
-  | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ]
-  | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ]
-  | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ]
-  | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]
-  ].
+ match eq_oct n1 n2 with [ true ⇒ P → P | false ⇒ P ].
 
 ndefinition oct_destruct : oct_destruct_aux.
- #n1; #n2; #P;
+ #n1; #n2; #P; #H;
+ nrewrite < H;
  nelim n1;
- ##[ ##1: nelim n2; nnormalize; #H;
-          ##[ ##1: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o0 with [ o0 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##| ##2: nelim n2; nnormalize; #H;
-          ##[ ##2: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o1 with [ o1 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##| ##3: nelim n2; nnormalize; #H;
-          ##[ ##3: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o2 with [ o2 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##| ##4: nelim n2; nnormalize; #H;
-          ##[ ##4: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o3 with [ o3 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##| ##5: nelim n2; nnormalize; #H;
-          ##[ ##5: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o4 with [ o4 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##| ##6: nelim n2; nnormalize; #H;
-          ##[ ##6: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o5 with [ o5 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##| ##7: nelim n2; nnormalize; #H;
-          ##[ ##7: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o6 with [ o6 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##| ##8: nelim n2; nnormalize; #H;
-          ##[ ##8: napply (λx:P.x)
-          ##| ##*: napply False_ind;
-                   nchange with (match o7 with [ o7 ⇒ False | _ ⇒ True ]);
-                   nrewrite > H; nnormalize; napply I
-          ##]
- ##]
+ nnormalize;
+ napply (λx.x).
 nqed.
 
 nlemma symmetric_eqoct : symmetricT oct bool eq_oct.
@@ -128,7 +73,10 @@ nlemma decidable_oct : ∀x,y:oct.decidable (x = y).
  nelim x;
  nelim y;
  ##[ ##1,10,19,28,37,46,55,64: napply (or2_intro1 (? = ?) (? ≠ ?) …); napply refl_eq
- ##| ##*: napply (or2_intro2 (? = ?) (? ≠ ?) …); nnormalize; #H; napply False_ind; napply (oct_destruct … H)
+ ##| ##*: napply (or2_intro2 (? = ?) (? ≠ ?) …);
+          nnormalize; #H;
+          napply False_ind;
+          napply (oct_destruct … H)
  ##]
 nqed.