]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_structure.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / syntax / path_structure.ma
index 8c60eea7595c8a88c43250865500b11010701dee..288575c4e7680630668be3a61108478261a6d0c4 100644 (file)
@@ -14,6 +14,7 @@
 
 include "delayed_updating/syntax/path.ma".
 include "delayed_updating/notation/functions/circled_times_1.ma".
+include "ground/xoa/ex_3_2.ma".
 
 (* STRUCTURE FOR PATH *******************************************************)
 
@@ -22,10 +23,11 @@ match p with
 [ list_empty     β‡’ πž
 | list_lcons l q β‡’
    match l with
-   [ label_node_d n β‡’ structure q
-   | label_edge_L   β‡’ π—Ÿβ——structure q
-   | label_edge_A   β‡’ π—”β——structure q
-   | label_edge_S   β‡’ π—¦β——structure q
+   [ label_d k β‡’ structure q
+   | label_m   β‡’ structure q
+   | label_L   β‡’ (structure q)β—–π—Ÿ
+   | label_A   β‡’ (structure q)◖𝗔
+   | label_S   β‡’ (structure q)◖𝗦
    ]
 ].
 
@@ -39,53 +41,220 @@ lemma structure_empty:
       πž = βŠ—πž.
 // qed.
 
-lemma structure_d_sn (p) (n):
-      βŠ—p = βŠ—(𝗱nβ——p).
+lemma structure_d_dx (p) (k):
+      βŠ—p = βŠ—(p◖𝗱k).
 // qed.
 
-lemma structure_L_sn (p):
-      π—Ÿβ——βŠ—p = βŠ—(π—Ÿβ——p).
+lemma structure_m_dx (p):
+      βŠ—p = βŠ—(p◖𝗺).
 // qed.
 
-lemma structure_A_sn (p):
-      π—”β——βŠ—p = βŠ—(𝗔◗p).
+lemma structure_L_dx (p):
+      (βŠ—p)β—–π—Ÿ = βŠ—(pβ—–π—Ÿ).
 // qed.
 
-lemma structure_S_sn (p):
-      π—¦β——βŠ—p = βŠ—(𝗦◗p).
+lemma structure_A_dx (p):
+      (βŠ—p)◖𝗔 = βŠ—(p◖𝗔).
+// qed.
+
+lemma structure_S_dx (p):
+      (βŠ—p)◖𝗦 = βŠ—(p◖𝗦).
 // qed.
 
 (* Main constructions *******************************************************)
 
 theorem structure_idem (p):
         βŠ—p = βŠ—βŠ—p.
-#p elim p -p [| * [ #n ] #p #IH ] //
+#p elim p -p //
+* [ #k ] #p #IH //
 qed.
 
-theorem structure_append (p1) (p2):
-        βŠ—p1β—βŠ—p2 = βŠ—(p1●p2).
-#p1 elim p1 -p1 [| * [ #n ] #p1 #IH ] #p2
-[||*: <list_append_lcons_sn ] //
+theorem structure_append (p) (q):
+        βŠ—pβ—βŠ—q = βŠ—(p●q).
+#p #q elim q -q //
+* [ #k ] #q #IH //
+<list_append_lcons_sn //
 qed.
 
-(* Constructions with list_rcons ********************************************)
+(* Constructions with path_lcons ********************************************)
 
-lemma structure_d_dx (p) (n):
-      βŠ—p = βŠ—(p◖𝗱n).
-#p #n <structure_append //
+lemma structure_d_sn (p) (k):
+      βŠ—p = βŠ—(𝗱kβ——p).
+#p #k <structure_append //
 qed.
 
-lemma structure_L_dx (p):
-      (βŠ—p)β—–π—Ÿ = βŠ—(pβ—–π—Ÿ).
+lemma structure_m_sn (p):
+      βŠ—p = βŠ—(𝗺◗p).
 #p <structure_append //
 qed.
 
-lemma structure_A_dx (p):
-      (βŠ—p)◖𝗔 = βŠ—(p◖𝗔).
+lemma structure_L_sn (p):
+      (π—Ÿβ——βŠ—p) = βŠ—(π—Ÿβ——p).
 #p <structure_append //
 qed.
 
-lemma structure_S_dx (p):
-      (βŠ—p)◖𝗦 = βŠ—(p◖𝗦).
+lemma structure_A_sn (p):
+      (π—”β——βŠ—p) = βŠ—(𝗔◗p).
 #p <structure_append //
 qed.
+
+lemma structure_S_sn (p):
+      (π—¦β——βŠ—p) = βŠ—(𝗦◗p).
+#p <structure_append //
+qed.
+
+(* Basic inversions *********************************************************)
+
+lemma eq_inv_d_dx_structure (h) (q) (p):
+      q◖𝗱h = βŠ—p β†’ βŠ₯.
+#h #q #p elim p -p [| * [ #k ] #p #IH ]
+[ <structure_empty #H0 destruct
+| <structure_d_dx #H0 /2 width=1 by/
+| <structure_m_dx #H0 /2 width=1 by/
+| <structure_L_dx #H0 destruct
+| <structure_A_dx #H0 destruct
+| <structure_S_dx #H0 destruct
+]
+qed-.
+
+lemma eq_inv_m_dx_structure (q) (p):
+      q◖𝗺 = βŠ—p β†’ βŠ₯.
+#q #p elim p -p [| * [ #k ] #p #IH ]
+[ <structure_empty #H0 destruct
+| <structure_d_dx #H0 /2 width=1 by/
+| <structure_m_dx #H0 /2 width=1 by/
+| <structure_L_dx #H0 destruct
+| <structure_A_dx #H0 destruct
+| <structure_S_dx #H0 destruct
+]
+qed-.
+
+lemma eq_inv_L_dx_structure (q) (p):
+      qβ—–π—Ÿ = βŠ—p β†’
+      βˆƒβˆƒr1,r2. q = βŠ—r1 & πž = βŠ—r2 & r1β—π—Ÿβ——r2 = p.
+#q #p elim p -p [| * [ #k ] #p #IH ]
+[ <structure_empty #H0 destruct
+| <structure_d_dx #H0
+  elim IH -IH // -H0 #r1 #r2 #H1 #H0 #H2 destruct
+  /2 width=5 by ex3_2_intro/
+| <structure_m_dx #H0
+  elim IH -IH // -H0 #r1 #r2 #H1 #H0 #H2 destruct
+  /2 width=5 by ex3_2_intro/
+| <structure_L_dx #H0 destruct -IH
+  /2 width=5 by ex3_2_intro/
+| <structure_A_dx #H0 destruct
+| <structure_S_dx #H0 destruct
+]
+qed-.
+
+lemma eq_inv_A_dx_structure (q) (p):
+      q◖𝗔 = βŠ—p β†’
+      βˆƒβˆƒr1,r2. q = βŠ—r1 & πž = βŠ—r2 & r1●𝗔◗r2 = p.
+#q #p elim p -p [| * [ #k ] #p #IH ]
+[ <structure_empty #H0 destruct
+| <structure_d_dx #H0
+  elim IH -IH // -H0 #r1 #r2 #H1 #H0 #H2 destruct
+  /2 width=5 by ex3_2_intro/
+| <structure_m_dx #H0
+  elim IH -IH // -H0 #r1 #r2 #H1 #H0 #H2 destruct
+  /2 width=5 by ex3_2_intro/
+| <structure_L_dx #H0 destruct
+| <structure_A_dx #H0 destruct -IH
+  /2 width=5 by ex3_2_intro/
+| <structure_S_dx #H0 destruct
+]
+qed-.
+
+lemma eq_inv_S_dx_structure (q) (p):
+      q◖𝗦 = βŠ—p β†’
+      βˆƒβˆƒr1,r2. q = βŠ—r1 & πž = βŠ—r2 & r1●𝗦◗r2 = p.
+#q #p elim p -p [| * [ #k ] #p #IH ]
+[ <structure_empty #H0 destruct
+| <structure_d_dx #H0
+  elim IH -IH // -H0 #r1 #r2 #H1 #H0 #H2 destruct
+  /2 width=5 by ex3_2_intro/
+| <structure_m_dx #H0
+  elim IH -IH // -H0 #r1 #r2 #H1 #H0 #H2 destruct
+  /2 width=5 by ex3_2_intro/
+| <structure_L_dx #H0 destruct
+| <structure_A_dx #H0 destruct
+| <structure_S_dx #H0 destruct -IH
+  /2 width=5 by ex3_2_intro/
+]
+qed-.
+
+(* Main inversions **********************************************************)
+
+theorem eq_inv_append_structure (p) (q) (r):
+        p●q = βŠ—r β†’
+        βˆƒβˆƒr1,r2.p = βŠ—r1 & q = βŠ—r2 & r1●r2 = r.
+#p #q elim q -q [| * [ #k ] #q #IH ] #r
+[ <list_append_empty_sn #H0 destruct
+  /2 width=5 by ex3_2_intro/
+| #H0 elim (eq_inv_d_dx_structure β€¦ H0)
+| #H0 elim (eq_inv_m_dx_structure β€¦ H0)
+| #H0 elim (eq_inv_L_dx_structure β€¦ H0) -H0 #r1 #r2 #Hr1 #Hr2 #H0 destruct
+  elim (IH β€¦ Hr1) -IH -Hr1 #s1 #s2 #H1 #H2 #H3 destruct
+  @(ex3_2_intro β€¦ s1 (s2β—π—Ÿβ——r2)) //
+  <structure_append <structure_L_sn <Hr2 -Hr2 //
+| #H0 elim (eq_inv_A_dx_structure β€¦ H0) -H0 #r1 #r2 #Hr1 #Hr2 #H0 destruct
+  elim (IH β€¦ Hr1) -IH -Hr1 #s1 #s2 #H1 #H2 #H3 destruct
+  @(ex3_2_intro β€¦ s1 (s2●𝗔◗r2)) //
+  <structure_append <structure_A_sn <Hr2 -Hr2 //
+| #H0 elim (eq_inv_S_dx_structure β€¦ H0) -H0 #r1 #r2 #Hr1 #Hr2 #H0 destruct
+  elim (IH β€¦ Hr1) -IH -Hr1 #s1 #s2 #H1 #H2 #H3 destruct
+  @(ex3_2_intro β€¦ s1 (s2●𝗦◗r2)) //
+  <structure_append <structure_S_sn <Hr2 -Hr2 //
+]
+qed-.
+
+(* Inversions with path_lcons ***********************************************)
+
+lemma eq_inv_d_sn_structure (h) (q) (p):
+      (𝗱hβ——q) = βŠ—p β†’ βŠ₯.
+#h #q #p >list_cons_comm #H0
+elim (eq_inv_append_structure β€¦ H0) -H0 #r1 #r2
+<list_cons_comm #H0 #H1 #H2 destruct
+elim (eq_inv_d_dx_structure β€¦ H0)
+qed-.
+
+lemma eq_inv_m_sn_structure (q) (p):
+      (𝗺 β——q) = βŠ—p β†’ βŠ₯.
+#q #p >list_cons_comm #H0
+elim (eq_inv_append_structure β€¦ H0) -H0 #r1 #r2
+<list_cons_comm #H0 #H1 #H2 destruct
+elim (eq_inv_m_dx_structure β€¦ H0)
+qed-.
+
+lemma eq_inv_L_sn_structure (q) (p):
+      (π—Ÿβ——q) = βŠ—p β†’
+      βˆƒβˆƒr1,r2. πž = βŠ—r1 & q = βŠ—r2 & r1β—π—Ÿβ——r2 = p.
+#q #p >list_cons_comm #H0
+elim (eq_inv_append_structure β€¦ H0) -H0 #r1 #r2
+<list_cons_comm #H0 #H1 #H2 destruct
+elim (eq_inv_L_dx_structure β€¦ H0) -H0 #s1 #s2 #H1 #H2 #H3 destruct
+@(ex3_2_intro β€¦ s1 (s2●r2)) // -s1
+<structure_append <H2 -s2 //
+qed-.
+
+lemma eq_inv_A_sn_structure (q) (p):
+      (𝗔◗q) = βŠ—p β†’
+      βˆƒβˆƒr1,r2. πž = βŠ—r1 & q = βŠ—r2 & r1●𝗔◗r2 = p.
+#q #p >list_cons_comm #H0
+elim (eq_inv_append_structure β€¦ H0) -H0 #r1 #r2
+<list_cons_comm #H0 #H1 #H2 destruct
+elim (eq_inv_A_dx_structure β€¦ H0) -H0 #s1 #s2 #H1 #H2 #H3 destruct
+@(ex3_2_intro β€¦ s1 (s2●r2)) // -s1
+<structure_append <H2 -s2 //
+qed-.
+
+lemma eq_inv_S_sn_structure (q) (p):
+      (𝗦◗q) = βŠ—p β†’
+      βˆƒβˆƒr1,r2. πž = βŠ—r1 & q = βŠ—r2 & r1●𝗦◗r2 = p.
+#q #p >list_cons_comm #H0
+elim (eq_inv_append_structure β€¦ H0) -H0 #r1 #r2
+<list_cons_comm #H0 #H1 #H2 destruct
+elim (eq_inv_S_dx_structure β€¦ H0) -H0 #s1 #s2 #H1 #H2 #H3 destruct
+@(ex3_2_intro β€¦ s1 (s2●r2)) // -s1
+<structure_append <H2 -s2 //
+qed-.