From: Ferruccio Guidi Date: Fri, 9 Aug 2013 10:59:49 +0000 (+0000) Subject: - we added nat-labeled reflexive and transitive closure (for use in lambdadelta) X-Git-Tag: make_still_working~1115 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=774c5e125eb44693a5a760226713067c41baf09f;p=helm.git - we added nat-labeled reflexive and transitive closure (for use in lambdadelta) - stylistic improvements in list-labeled reflexive and transitive closure --- diff --git a/matita/matita/lib/arithmetics/lstar.ma b/matita/matita/lib/arithmetics/lstar.ma new file mode 100644 index 000000000..ddd4113e3 --- /dev/null +++ b/matita/matita/lib/arithmetics/lstar.ma @@ -0,0 +1,135 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department of the University of Bologna, Italy. + ||I|| + ||T|| + ||A|| This file is distributed under the terms of the + \ / GNU General Public License Version 2 + \ / + V_______________________________________________________________ *) + +include "arithmetics/nat.ma". + +(* nat-labeled reflexive and transitive closure *****************************) + +definition ltransitive: ∀B:Type[0]. predicate (ℕ→relation B) ≝ λB,R. + ∀l1,b1,b. R l1 b1 b → ∀l2,b2. R l2 b b2 → R (l1+l2) b1 b2. + +definition inv_ltransitive: ∀B:Type[0]. predicate (ℕ→relation B) ≝ + λB,R. ∀l1,l2,b1,b2. R (l1+l2) b1 b2 → + ∃∃b. R l1 b1 b & R l2 b b2. + +inductive lstar (B:Type[0]) (R: relation B): ℕ→relation B ≝ +| lstar_O: ∀b. lstar B R 0 b b +| lstar_S: ∀b1,b. R b1 b → ∀l,b2. lstar B R l b b2 → lstar B R (l+1) b1 b2 +. + +fact lstar_ind_l_aux: ∀B,R,b2. ∀P:relation2 ℕ B. + P 0 b2 → + (∀l,b1,b. R b1 b → lstar … R l b b2 → P l b → P (l+1) b1) → + ∀l,b1,b. lstar … R l b1 b → b = b2 → P l b1. +#B #R #b2 #P #H1 #H2 #l #b1 #b #H elim H -b -b1 +[ #b #H destruct /2 width=1/ +| #b #b0 #Hb0 #l #b1 #Hb01 #IH #H destruct /3 width=4/ +] +qed-. + +(* imporeved version of lstar_ind with "left_parameter" *) +lemma lstar_ind_l: ∀B,R,b2. ∀P:relation2 ℕ B. + P 0 b2 → + (∀l,b1,b. R b1 b → lstar … R l b b2 → P l b → P (l+1) b1) → + ∀l,b1. lstar … R l b1 b2 → P l b1. +#B #R #b2 #P #H1 #H2 #l #b1 #Hb12 +@(lstar_ind_l_aux … H1 H2 … Hb12) // +qed-. + +lemma lstar_step: ∀B,R,b1,b2. R b1 b2 → lstar B R 1 b1 b2. +/2 width=3/ +qed. + +lemma lstar_inv_O: ∀B,R,l,b1,b2. lstar B R l b1 b2 → 0 = l → b1 = b2. +#B #R #l #b1 #b2 * -l -b1 -b2 // +#b1 #b #_ #l #b2 #_