X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fground_2%2Frelocation%2Frtmap_sor.ma;h=864f3dcb91aa67f6fa17819f48070aaf2c415398;hb=990f97071a9939d47be16b36f6045d3b23f218e0;hp=8f38b806273e7ac3a4b9b4dd1e8adf0b31e8abc4;hpb=f215e6c18fbd22a049e6d34cf3bb52b0cabc4d58;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_sor.ma b/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_sor.ma index 8f38b8062..864f3dcb9 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_sor.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_sor.ma @@ -255,18 +255,59 @@ lemma sor_eq_repl_fwd3: ∀f1,f2. eq_repl_fwd … (λf. f1 ⋓ f2 ≡ f). #f1 #f2 @eq_repl_sym /2 width=3 by sor_eq_repl_back3/ qed-. -corec lemma sor_refl: ∀f. f ⋓ f ≡ f. +corec lemma sor_idem: ∀f. f ⋓ f ≡ f. #f cases (pn_split f) * #g #H [ @(sor_pp … H H H) | @(sor_nn … H H H) ] -H // qed. -corec lemma sor_sym: ∀f1,f2,f. f1 ⋓ f2 ≡ f → f2 ⋓ f1 ≡ f. +corec lemma sor_comm: ∀f1,f2,f. f1 ⋓ f2 ≡ f → f2 ⋓ f1 ≡ f. #f1 #f2 #f * -f1 -f2 -f #f1 #f2 #f #g1 #g2 #g #Hf * * * -g1 -g2 -g [ @sor_pp | @sor_pn | @sor_np | @sor_nn ] /2 width=7 by/ qed-. -(* Properies on test for identity *******************************************) +(* Properties with tail *****************************************************) + +lemma sor_tl: ∀f1,f2,f. f1 ⋓ f2 ≡ f → ⫱f1 ⋓ ⫱f2 ≡ ⫱f. +#f1 cases (pn_split f1) * #g1 #H1 +#f2 cases (pn_split f2) * #g2 #H2 +#f #Hf +[ cases (sor_inv_ppx … Hf … H1 H2) +| cases (sor_inv_pnx … Hf … H1 H2) +| cases (sor_inv_npx … Hf … H1 H2) +| cases (sor_inv_nnx … Hf … H1 H2) +] -Hf #g #Hg #H destruct // +qed. + +lemma sor_xxn_tl: ∀g1,g2,g. g1 ⋓ g2 ≡ g → ∀f. ⫯f = g → + (∃∃f1,f2. f1 ⋓ f2 ≡ f & ⫯f1 = g1 & ⫱g2 = f2) ∨ + (∃∃f1,f2. f1 ⋓ f2 ≡ f & ⫱g1 = f1 & ⫯f2 = g2). +#g1 #g2 #g #H #f #H0 elim (sor_inv_xxn … H … H0) -H -H0 * +/3 width=5 by ex3_2_intro, or_introl, or_intror/ +qed-. + +lemma sor_xnx_tl: ∀g1,g2,g. g1 ⋓ g2 ≡ g → ∀f2. ⫯f2 = g2 → + ∃∃f1,f. f1 ⋓ f2 ≡ f & ⫱g1 = f1 & ⫯f = g. +#g1 elim (pn_split g1) * #f1 #H1 #g2 #g #H #f2 #H2 +[ elim (sor_inv_pnx … H … H1 H2) | elim (sor_inv_nnx … H … H1 H2) ] -g2 +/3 width=5 by ex3_2_intro/ +qed-. + +lemma sor_nxx_tl: ∀g1,g2,g. g1 ⋓ g2 ≡ g → ∀f1. ⫯f1 = g1 → + ∃∃f2,f. f1 ⋓ f2 ≡ f & ⫱g2 = f2 & ⫯f = g. +#g1 #g2 elim (pn_split g2) * #f2 #H2 #g #H #f1 #H1 +[ elim (sor_inv_npx … H … H1 H2) | elim (sor_inv_nnx … H … H1 H2) ] -g1 +/3 width=5 by ex3_2_intro/ +qed-. + +(* Properties with iterated tail ********************************************) + +lemma sor_tls: ∀f1,f2,f. f1 ⋓ f2 ≡ f → + ∀n. ⫱*[n]f1 ⋓ ⫱*[n]f2 ≡ ⫱*[n]f. +#f1 #f2 #f #Hf #n elim n -n /2 width=1 by sor_tl/ +qed. + +(* Properies with test for identity *****************************************) corec lemma sor_isid_sn: ∀f1. 𝐈⦃f1⦄ → ∀f2. f1 ⋓ f2 ≡ f2. #f1 * -f1 @@ -280,7 +321,22 @@ corec lemma sor_isid_dx: ∀f2. 𝐈⦃f2⦄ → ∀f1. f1 ⋓ f2 ≡ f1. /3 width=7 by sor_pp, sor_np/ qed. -(* Inversion lemmas on test for identity ************************************) +lemma sor_isid: ∀f1,f2,f. 𝐈⦃f1⦄ → 𝐈⦃f2⦄ → 𝐈⦃f⦄ → f1 ⋓ f2 ≡ f. +/4 width=3 by sor_eq_repl_back2, sor_eq_repl_back1, isid_inv_eq_repl/ qed. + +(* Inversion lemmas with tail ***********************************************) + +lemma sor_inv_tl_sn: ∀f1,f2,f. ⫱f1 ⋓ f2 ≡ f → f1 ⋓ ⫯f2 ≡ ⫯f. +#f1 #f2 #f elim (pn_split f1) * +#g1 #H destruct /2 width=7 by sor_pn, sor_nn/ +qed-. + +lemma sor_inv_tl_dx: ∀f1,f2,f. f1 ⋓ ⫱f2 ≡ f → ⫯f1 ⋓ f2 ≡ ⫯f. +#f1 #f2 #f elim (pn_split f2) * +#g2 #H destruct /2 width=7 by sor_np, sor_nn/ +qed-. + +(* Inversion lemmas with test for identity **********************************) lemma sor_isid_inv_sn: ∀f1,f2,f. f1 ⋓ f2 ≡ f → 𝐈⦃f1⦄ → f2 ≗ f. /3 width=4 by sor_isid_sn, sor_mono/ @@ -307,17 +363,17 @@ qed-. lemma sor_inv_isid3: ∀f1,f2,f. f1 ⋓ f2 ≡ f → 𝐈⦃f⦄ → 𝐈⦃f1⦄ ∧ 𝐈⦃f2⦄. /3 width=4 by sor_fwd_isid2, sor_fwd_isid1, conj/ qed-. -(* Properties on finite colength assignment *********************************) +(* Properties with finite colength assignment *******************************) lemma sor_fcla_ex: ∀f1,n1. 𝐂⦃f1⦄ ≡ n1 → ∀f2,n2. 𝐂⦃f2⦄ ≡ n2 → ∃∃f,n. f1 ⋓ f2 ≡ f & 𝐂⦃f⦄ ≡ n & (n1 ∨ n2) ≤ n & n ≤ n1 + n2. #f1 #n1 #Hf1 elim Hf1 -f1 -n1 /3 width=6 by sor_isid_sn, ex4_2_intro/ #f1 #n1 #Hf1 #IH #f2 #n2 * -f2 -n2 /3 width=6 by fcla_push, fcla_next, ex4_2_intro, sor_isid_dx/ -#f2 #n2 #Hf2 elim (IH … Hf2) -IH -Hf2 -Hf1 -[ /3 width=7 by fcla_push, sor_pp, ex4_2_intro/ -| /3 width=7 by fcla_next, sor_pn, max_S2_le_S, le_S_S, ex4_2_intro/ -| /3 width=7 by fcla_next, sor_np, max_S1_le_S, le_S_S, ex4_2_intro/ +#f2 #n2 #Hf2 elim (IH … Hf2) -IH -Hf2 -Hf1 [2,4: #f #n