]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground/counters/rtc_ism_plus.ma
propagating the arithmetics library, partial commit
[helm.git] / matita / matita / contribs / lambdadelta / ground / counters / rtc_ism_plus.ma
diff --git a/matita/matita/contribs/lambdadelta/ground/counters/rtc_ism_plus.ma b/matita/matita/contribs/lambdadelta/ground/counters/rtc_ism_plus.ma
new file mode 100644 (file)
index 0000000..5453b63
--- /dev/null
@@ -0,0 +1,61 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "ground/xoa/ex_3_2.ma".
+include "ground/counters/rtc_plus.ma".
+include "ground/counters/rtc_ism.ma".
+
+(* T-BOUND RT-TRANSITION COUNTERS *******************************************)
+
+(* Constructions with rtc_plus **********************************************)
+
+lemma rtc_ism_plus (n1) (n2) (c1) (c2):  ðŒâŠn1,c1âŦ â†’ ðŒâŠn2,c2âŦ â†’ ðŒâŠn1+n2,c1+c2âŦ.
+#n1 #n2 #c1 #c2 * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct
+/2 width=3 by ex1_2_intro/
+qed.
+
+lemma rtc_ism_plus_zero_sn (n) (c1) (c2): ðŒâŠðŸŽ,c1âŦ â†’ ðŒâŠn,c2âŦ â†’ ðŒâŠn,c1+c2âŦ.
+#n #c1 #c2 #H1 #H2 >(nplus_zero_sn n) /2 width=1 by rtc_ism_plus/
+qed.
+
+lemma rtc_ism_plus_zero_dx (n) (c1) (c2): ðŒâŠn,c1âŦ â†’ ðŒâŠðŸŽ,c2âŦ â†’ ðŒâŠn,c1+c2âŦ.
+/2 width=1 by rtc_ism_plus/ qed.
+
+lemma rtc_ism_succ (n) (c): ðŒâŠn,câŦ â†’ ðŒâŠâ†‘n,c+𝟘𝟙âŦ.
+#n #c #H >nplus_one_dx
+/2 width=1 by rtc_ism_plus/
+qed.
+
+(* Inversions with rtc_plus *************************************************)
+
+lemma rtc_ism_inv_plus (n) (c1) (c2): ðŒâŠn,c1 + c2âŦ â†’
+      âˆƒâˆƒn1,n2. ðŒâŠn1,c1âŦ & ðŒâŠn2,c2âŦ & n1 + n2 = n.
+#n #c1 #c2 * #ri #rs #H
+elim (rtc_plus_inv_dx â€Ķ H) -H #ri1 #rs1 #ti1 #ts1 #ri2 #rs2 #ti2 #ts2 #_ #_ #H1 #H2 #H3 #H4
+elim (eq_inv_nplus_zero â€Ķ H1) -H1 /3 width=5 by ex3_2_intro, ex1_2_intro/
+qed-.
+
+lemma rtc_ism_inv_plus_zero_dx (n) (c1) (c2): ðŒâŠn,c1 + c2âŦ â†’ ðŒâŠðŸŽ,c2âŦ â†’ ðŒâŠn,c1âŦ.
+#n #c1 #c2 #H #H2
+elim (rtc_ism_inv_plus â€Ķ H) -H #n1 #n2 #Hn1 #Hn2 #H destruct
+lapply (rtc_ism_inj â€Ķ Hn2 H2) -c2 #H destruct //
+qed-.
+
+lemma rtc_ism_inv_plus_unit_dx (n) (c1) (c2): ðŒâŠn,c1 + c2âŦ â†’ ðŒâŠðŸ,c2âŦ â†’
+      âˆƒâˆƒm. ðŒâŠm,c1âŦ & n = â†‘m.
+#n #c1 #c2 #H #H2
+elim (rtc_ism_inv_plus â€Ķ H) -H #n1 #n2 #Hn1 #Hn2 #H destruct
+lapply (rtc_ism_inj â€Ķ Hn2 H2) -c2 #H destruct
+/2 width=3 by ex2_intro/
+qed-.