From 55c768d7e45babb300b5010463ba3196a68f1bbe Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Sat, 29 May 2021 00:42:43 +0200 Subject: [PATCH] milestone update in ground + generic relocation maps are now streams of booleans + some renaming and restyling + operator precedence more uniform + recomm updated for relocation --- .gitignore | 2 + .../lambdadelta/apps_2/models/veq_lifts.ma | 2 +- .../basic_2/rt_transition/cpr_drops_basic.ma | 2 +- .../basic_2/rt_transition/cpx_drops_basic.ma | 2 +- .../contribs/lambdadelta/bin/recomm/Makefile | 6 +- .../lambdadelta/bin/recomm/bGroundArith.mrc | 2 + .../lambdadelta/bin/recomm/bGroundLib.mrc | 1 + .../bin/recomm/bGroundRelocation.mrc | 23 + .../bin/recomm/dGroundRelocation.mrc | 4 + .../bin/recomm/pGroundRelocation.mrc | 2 + .../lambdadelta/bin/recomm/rGroundLib.mrc | 2 + .../bin/recomm/rGroundRelocation.mrc | 21 + .../contribs/lambdadelta/bin/recomm/recomm.ml | 2 +- .../lambdadelta/bin/recomm/recommGc.ml | 26 +- .../bin/recomm/recommGcbGroundArith.ml | 2 + .../bin/recomm/recommGcbGroundLib.ml | 1 + .../bin/recomm/recommGcbGroundRelocation.ml | 68 +++ .../bin/recomm/recommGcbGroundRelocation.mli | 0 .../bin/recomm/recommGcdGroundRelocation.ml | 13 + .../bin/recomm/recommGcdGroundRelocation.mli | 0 .../bin/recomm/recommGcpGroundRelocation.ml | 11 + .../bin/recomm/recommGcpGroundRelocation.mli | 0 .../bin/recomm/recommGcrGroundLib.ml | 3 + .../bin/recomm/recommGcrGroundRelocation.ml | 30 + .../bin/recomm/recommGcrGroundRelocation.mli | 0 .../lambdadelta/bin/recomm/recommGcsMain.ml | 1 + .../lambdadelta/bin/recomm/recommGcsWith.ml | 1 + .../lambdadelta/bin/recomm/recommLexer.mll | 1 + .../lambdadelta/bin/recomm/recommOutput.ml | 10 +- .../lambdadelta/bin/recomm/recommParser.mly | 28 +- .../contribs/lambdadelta/bin/recomm/sMain.mrc | 1 + .../contribs/lambdadelta/bin/recomm/sWith.mrc | 2 +- .../lambdadelta/ground/arith/arith_2a.ma | 2 +- .../lambdadelta/ground/arith/nat_iter.ma | 2 +- .../lambdadelta/ground/arith/nat_minus.ma | 2 +- .../lambdadelta/ground/arith/nat_plus.ma | 4 +- .../lambdadelta/ground/arith/nat_rplus.ma | 2 +- .../lambdadelta/ground/arith/pnat_plus.ma | 2 +- .../lambdadelta/ground/arith/ynat_lminus.ma | 2 +- .../lambdadelta/ground/arith/ynat_plus.ma | 4 +- .../lambdadelta/ground/counters/rtc.ma | 11 +- .../lambdadelta/ground/counters/rtc_ism.ma | 6 +- .../lambdadelta/ground/counters/rtc_ist.ma | 6 +- .../lambdadelta/ground/counters/rtc_max.ma | 13 +- .../ground/counters/rtc_max_shift.ma | 2 +- .../lambdadelta/ground/counters/rtc_plus.ma | 11 +- .../lambdadelta/ground/counters/rtc_shift.ma | 7 +- .../pstream.ma => etc/relocation/pstream.etc} | 42 +- .../relocation/pstream_after.etc} | 42 +- .../relocation/pstream_basic.etc} | 16 +- .../relocation/pstream_coafter.etc} | 20 +- .../relocation/pstream_eq.etc} | 18 +- .../relocation/pstream_isid.etc} | 6 +- .../relocation/pstream_istot.etc} | 36 +- .../relocation/pstream_sor.etc} | 6 +- .../relocation/pstream_tl.etc} | 2 +- .../relocation/pstream_tls.etc} | 2 +- .../contribs/lambdadelta/ground/lib/exteq.ma | 18 +- .../lambdadelta/ground/lib/functions.ma | 26 +- .../contribs/lambdadelta/ground/lib/list.ma | 3 +- .../lambdadelta/ground/lib/list_eq.ma | 9 +- .../lambdadelta/ground/lib/list_length.ma | 3 +- .../contribs/lambdadelta/ground/lib/logic.ma | 3 +- .../contribs/lambdadelta/ground/lib/ltc.ma | 53 +- .../lambdadelta/ground/lib/ltc_ctc.ma | 8 +- .../lambdadelta/ground/lib/relations.ma | 6 +- .../contribs/lambdadelta/ground/lib/star.ma | 189 +++--- .../contribs/lambdadelta/ground/lib/stream.ma | 4 +- .../lambdadelta/ground/lib/stream_eq.ma | 46 +- .../lambdadelta/ground/lib/stream_eq_eq.ma | 35 ++ .../lambdadelta/ground/lib/stream_hdtl.ma | 16 +- .../lambdadelta/ground/lib/stream_tls.ma | 6 - .../lambdadelta/ground/lib/stream_tls_eq.ma | 27 + .../ground/notation/functions/circledE_1.ma | 6 +- .../ground/notation/functions/diamond_0.ma | 2 +- .../ground/notation/functions/downarrow_1.ma | 4 +- .../ground/notation/functions/downspoon_2.ma | 12 +- .../notation/functions/downspoonstar_3.ma | 12 +- .../ground/notation/functions/droppred_1.ma | 4 +- .../ground/notation/functions/droppreds_2.ma | 4 +- .../functions/{basic_2.ma => element_b_2.ma} | 6 +- .../{identity_0.ma => element_i_0.ma} | 6 +- .../{uniform_1.ma => element_u_1.ma} | 6 +- .../ground/notation/functions/exp_3.ma | 8 +- .../ground/notation/functions/infinity_0.ma | 3 +- .../ground/notation/functions/no_0.ma | 2 +- .../ground/notation/functions/one_0.ma | 2 +- .../ground/notation/functions/onezero_0.ma | 2 +- .../ground/notation/functions/semicolon_3.ma | 2 +- .../ground/notation/functions/tuple_4.ma | 2 +- .../ground/notation/functions/two_0.ma | 2 +- .../ground/notation/functions/uparrow_1.ma | 4 +- .../notation/functions/uparrowstar_2.ma | 4 +- .../notation/functions/updownarrowstar_1.ma | 4 +- .../ground/notation/functions/upspoon_1.ma | 4 +- .../notation/functions/upspoonstar_2.ma | 4 +- .../ground/notation/functions/yes_0.ma | 2 +- .../ground/notation/functions/zero_0.ma | 2 +- .../ground/notation/functions/zeroone_0.ma | 2 +- .../ground/notation/functions/zerozero_0.ma | 2 +- .../{isfinite_1.ma => predicate_f_1.ma} | 2 +- .../{isidentity_1.ma => predicate_i_1.ma} | 2 +- .../relations/{ism_2.ma => predicate_m_2.ma} | 2 +- ...{isdivergent_1.ma => predicate_omega_1.ma} | 2 +- .../relations/{ist_1.ma => predicate_t_1.ma} | 2 +- .../relations/{ist_2.ma => predicate_t_2.ma} | 2 +- .../{isuniform_1.ma => predicate_u_1.ma} | 2 +- .../relations/{rcolength_2.ma => rfun_c_2.ma} | 2 +- .../ground/relocation/fr2_append.ma | 41 ++ .../ground/relocation/{mr2.ma => fr2_map.ma} | 21 +- .../ground/relocation/fr2_minus.ma | 83 +++ .../lambdadelta/ground/relocation/fr2_nat.ma | 79 +++ .../ground/relocation/fr2_nat_nat.ma | 31 + .../relocation/{mr2_plus.ma => fr2_plus.ma} | 39 +- .../lambdadelta/ground/relocation/gr_after.ma | 197 +++++++ .../ground/relocation/gr_after_after.ma | 90 +++ .../ground/relocation/gr_after_after_ist.ma | 63 ++ ...rtmap_basic_after.ma => gr_after_basic.ma} | 31 +- .../ground/relocation/gr_after_eq.ma | 71 +++ .../ground/relocation/gr_after_isi.ma | 73 +++ .../ground/relocation/gr_after_ist.ma | 60 ++ .../ground/relocation/gr_after_ist_isi.ma | 40 ++ .../ground/relocation/gr_after_isu.ma | 36 ++ .../ground/relocation/gr_after_nat_uni.ma | 61 ++ .../ground/relocation/gr_after_pat.ma | 87 +++ .../ground/relocation/gr_after_pat_tls.ma | 33 ++ .../ground/relocation/gr_after_pat_uni.ma | 79 +++ .../ground/relocation/gr_after_uni.ma | 53 ++ .../lambdadelta/ground/relocation/gr_basic.ma | 37 ++ .../ground/relocation/gr_coafter.ma | 238 ++++++++ .../ground/relocation/gr_coafter_coafter.ma | 36 ++ .../relocation/gr_coafter_coafter_ist.ma | 61 ++ .../ground/relocation/gr_coafter_eq.ma | 71 +++ .../ground/relocation/gr_coafter_isi.ma | 50 ++ .../ground/relocation/gr_coafter_ist_isf.ma | 61 ++ .../ground/relocation/gr_coafter_ist_isi.ma | 59 ++ .../ground/relocation/gr_coafter_isu.ma | 29 + .../ground/relocation/gr_coafter_nat_tls.ma | 45 ++ .../relocation/gr_coafter_nat_tls_pushs.ma | 44 ++ .../ground/relocation/gr_coafter_pat_tls.ma | 59 ++ .../ground/relocation/gr_coafter_uni_pushs.ma | 29 + .../lambdadelta/ground/relocation/gr_eq.ma | 75 +++ .../lambdadelta/ground/relocation/gr_fcla.ma | 81 +++ .../ground/relocation/gr_fcla_eq.ma | 34 ++ .../ground/relocation/gr_fcla_fcla.ma | 30 + .../ground/relocation/gr_fcla_uni.ma | 26 + .../lambdadelta/ground/relocation/gr_id.ma | 32 + .../lambdadelta/ground/relocation/gr_id_eq.ma | 39 ++ .../lambdadelta/ground/relocation/gr_isd.ma | 51 ++ .../ground/relocation/gr_isd_eq.ma | 57 ++ .../ground/relocation/gr_isd_nexts.ma | 32 + .../ground/relocation/gr_isd_tl.ma | 28 + .../ground/relocation/gr_isd_tls.ma | 25 + .../lambdadelta/ground/relocation/gr_isf.ma | 67 +++ .../ground/relocation/gr_isf_eq.ma | 30 + .../ground/relocation/gr_isf_isu.ma | 26 + .../{rtmap_basic.ma => gr_isf_pushs.ma} | 27 +- .../ground/relocation/gr_isf_tl.ma | 34 ++ .../ground/relocation/gr_isf_tls.ma | 31 + .../relocation/{rtmap.ma => gr_isf_uni.ma} | 13 +- .../lambdadelta/ground/relocation/gr_isi.ma | 54 ++ .../ground/relocation/gr_isi_eq.ma | 58 ++ .../ground/relocation/gr_isi_id.ma | 34 ++ .../ground/relocation/gr_isi_pat.ma | 39 ++ .../ground/relocation/gr_isi_pushs.ma | 32 + .../ground/relocation/gr_isi_tl.ma | 28 + .../ground/relocation/gr_isi_tls.ma | 25 + .../relocation/{rtmap_id.ma => gr_isi_uni.ma} | 23 +- .../lambdadelta/ground/relocation/gr_ist.ma | 48 ++ .../ground/relocation/gr_ist_isi.ma | 27 + .../ground/relocation/gr_ist_ist.ma | 68 +++ .../ground/relocation/gr_ist_tls.ma | 27 + .../lambdadelta/ground/relocation/gr_isu.ma | 56 ++ .../ground/relocation/gr_isu_tl.ma | 35 ++ .../ground/relocation/gr_isu_uni.ma | 51 ++ .../lambdadelta/ground/relocation/gr_map.ma | 69 +++ .../lambdadelta/ground/relocation/gr_nat.ma | 209 +++++++ .../{rtmap_basic_nat.ma => gr_nat_basic.ma} | 36 +- .../ground/relocation/gr_nat_nat.ma | 73 +++ .../{rtmap_at_uni.ma => gr_nat_uni.ma} | 20 +- .../lambdadelta/ground/relocation/gr_nexts.ma | 51 ++ .../ground/relocation/gr_nexts_eq.ma | 27 + .../lambdadelta/ground/relocation/gr_pat.ma | 202 +++++++ .../{rtmap_basic_at.ma => gr_pat_basic.ma} | 37 +- .../ground/relocation/gr_pat_eq.ma | 58 ++ .../{pstream_id.ma => gr_pat_id.ma} | 27 +- .../ground/relocation/gr_pat_lt.ma | 79 +++ .../ground/relocation/gr_pat_pat.ma | 121 ++++ .../ground/relocation/gr_pat_pat_id.ma | 40 ++ .../ground/relocation/gr_pat_tls.ma | 77 +++ .../{rtmap_coafter_uni.ma => gr_pat_uni.ma} | 27 +- .../lambdadelta/ground/relocation/gr_pushs.ma | 51 ++ .../ground/relocation/gr_pushs_eq.ma | 27 + .../lambdadelta/ground/relocation/gr_sand.ma | 115 ++++ .../ground/relocation/gr_sand_eq.ma | 65 ++ .../lambdadelta/ground/relocation/gr_sdj.ma | 144 +++++ .../ground/relocation/gr_sdj_eq.ma | 54 ++ .../ground/relocation/gr_sdj_isi.ma | 47 ++ .../lambdadelta/ground/relocation/gr_sle.ma | 162 +++++ .../ground/relocation/gr_sle_eq.ma | 60 ++ .../ground/relocation/gr_sle_isd.ma | 40 ++ .../ground/relocation/gr_sle_isi.ma | 40 ++ .../ground/relocation/gr_sle_pushs.ma | 27 + .../ground/relocation/gr_sle_sle.ma | 30 + .../ground/relocation/gr_sle_tls.ma | 27 + .../lambdadelta/ground/relocation/gr_sor.ma | 340 +++++++++++ .../relocation/gr_sor_coafter_ist_isf.ma | 76 +++ .../ground/relocation/gr_sor_eq.ma | 65 ++ .../ground/relocation/gr_sor_fcla.ma | 71 +++ .../ground/relocation/gr_sor_isf.ma | 58 ++ .../ground/relocation/gr_sor_isi.ma | 83 +++ .../ground/relocation/gr_sor_sle.ma | 66 +++ .../ground/relocation/gr_sor_sor.ma | 129 ++++ .../ground/relocation/gr_sor_sor_sle.ma | 25 + .../ground/relocation/gr_sor_tls.ma | 28 + .../relocation/{rtmap_tl.ma => gr_tl.ma} | 34 +- .../lambdadelta/ground/relocation/gr_tl_eq.ma | 121 ++++ .../ground/relocation/gr_tl_eq_eq.ma | 37 ++ .../lambdadelta/ground/relocation/gr_tls.ma | 44 ++ .../ground/relocation/gr_tls_eq.ma | 26 + .../ground/relocation/gr_tls_nexts_eq.ma | 42 ++ .../ground/relocation/gr_tls_pushs.ma | 26 + .../ground/relocation/gr_tls_pushs_eq.ma | 42 ++ .../relocation/{mr2_append.ma => gr_uni.ma} | 28 +- .../ground/relocation/gr_uni_eq.ma | 56 ++ .../lambdadelta/ground/relocation/mr2_at.ma | 86 --- .../ground/relocation/mr2_minus.ma | 78 --- .../ground/relocation/rtmap_after.ma | 453 -------------- .../ground/relocation/rtmap_after_nat_uni.ma | 55 -- .../ground/relocation/rtmap_after_uni.ma | 95 --- .../lambdadelta/ground/relocation/rtmap_at.ma | 410 ------------- .../ground/relocation/rtmap_coafter.ma | 496 ---------------- .../lambdadelta/ground/relocation/rtmap_eq.ma | 144 ----- .../ground/relocation/rtmap_fcla.ma | 87 --- .../ground/relocation/rtmap_isdiv.ma | 104 ---- .../ground/relocation/rtmap_isfin.ma | 96 --- .../ground/relocation/rtmap_isid.ma | 103 ---- .../ground/relocation/rtmap_istot.ma | 101 ---- .../ground/relocation/rtmap_isuni.ma | 56 -- .../ground/relocation/rtmap_nat.ma | 247 -------- .../ground/relocation/rtmap_nat_uni.ma | 30 - .../ground/relocation/rtmap_nexts.ma | 63 -- .../ground/relocation/rtmap_pushs.ma | 63 -- .../ground/relocation/rtmap_sand.ma | 118 ---- .../ground/relocation/rtmap_sdj.ma | 146 ----- .../ground/relocation/rtmap_sle.ma | 191 ------ .../ground/relocation/rtmap_sor.ma | 557 ------------------ .../ground/relocation/rtmap_tls.ma | 52 -- .../ground/relocation/rtmap_uni.ma | 105 ---- .../lambdadelta/ground/web/ground.ldw.xml | 4 + .../lambdadelta/ground/web/ground_src.tbl | 56 +- .../lambdadelta/static_2/relocation/drops.ma | 2 +- .../static_2/relocation/drops_drops.ma | 2 +- .../lambdadelta/static_2/relocation/lex_tc.ma | 2 +- .../static_2/relocation/lifts_lifts.ma | 4 +- .../static_2/relocation/lifts_lifts_bind.ma | 4 +- .../lambdadelta/static_2/static/gcp_cr.ma | 2 +- .../lambdadelta/static_2/static/rex_lex.ma | 4 +- 258 files changed, 7472 insertions(+), 4529 deletions(-) create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/bGroundRelocation.mrc create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/dGroundRelocation.mrc create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/pGroundRelocation.mrc create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/rGroundRelocation.mrc create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundRelocation.ml create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundRelocation.mli create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcdGroundRelocation.ml create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcdGroundRelocation.mli create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcpGroundRelocation.ml create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcpGroundRelocation.mli create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundRelocation.ml create mode 100644 matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundRelocation.mli rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream.ma => etc/relocation/pstream.etc} (64%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_after.ma => etc/relocation/pstream_after.etc} (79%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_basic.ma => etc/relocation/pstream_basic.etc} (76%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_coafter.ma => etc/relocation/pstream_coafter.etc} (81%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_eq.ma => etc/relocation/pstream_eq.etc} (79%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_isid.ma => etc/relocation/pstream_isid.etc} (86%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_istot.ma => etc/relocation/pstream_istot.etc} (76%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_sor.ma => etc/relocation/pstream_sor.etc} (86%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_tl.ma => etc/relocation/pstream_tl.etc} (93%) rename matita/matita/contribs/lambdadelta/ground/{relocation/pstream_tls.ma => etc/relocation/pstream_tls.etc} (94%) create mode 100644 matita/matita/contribs/lambdadelta/ground/lib/stream_eq_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/lib/stream_tls_eq.ma rename matita/matita/contribs/lambdadelta/ground/notation/functions/{basic_2.ma => element_b_2.ma} (89%) rename matita/matita/contribs/lambdadelta/ground/notation/functions/{identity_0.ma => element_i_0.ma} (92%) rename matita/matita/contribs/lambdadelta/ground/notation/functions/{uniform_1.ma => element_u_1.ma} (90%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{isfinite_1.ma => predicate_f_1.ma} (97%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{isidentity_1.ma => predicate_i_1.ma} (97%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{ism_2.ma => predicate_m_2.ma} (97%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{isdivergent_1.ma => predicate_omega_1.ma} (97%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{ist_1.ma => predicate_t_1.ma} (97%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{ist_2.ma => predicate_t_2.ma} (97%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{isuniform_1.ma => predicate_u_1.ma} (97%) rename matita/matita/contribs/lambdadelta/ground/notation/relations/{rcolength_2.ma => rfun_c_2.ma} (97%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/fr2_append.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{mr2.ma => fr2_map.ma} (74%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/fr2_minus.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat_nat.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{mr2_plus.ma => fr2_plus.ma} (61%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after_ist.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_basic_after.ma => gr_after_basic.ma} (60%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_ist.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_ist_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_isu.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_nat_uni.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_pat.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_pat_tls.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_pat_uni.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_after_uni.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_basic.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter_ist.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isf.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isu.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls_pushs.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_pat_tls.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_uni_pushs.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_fcla.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_uni.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_id.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_id_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isd.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_nexts.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tl.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tls.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isf.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_isu.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_basic.ma => gr_isf_pushs.ma} (64%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tl.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tls.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap.ma => gr_isf_uni.ma} (77%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_id.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pat.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pushs.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tl.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tls.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_id.ma => gr_isi_uni.ma} (64%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_ist.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_ist.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_tls.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isu.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_tl.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_uni.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_map.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_nat.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_basic_nat.ma => gr_nat_basic.ma} (58%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_nat.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_at_uni.ma => gr_nat_uni.ma} (69%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pat.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_basic_at.ma => gr_pat_basic.ma} (53%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_eq.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{pstream_id.ma => gr_pat_id.ma} (65%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_lt.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_pat.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_pat_id.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_tls.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_coafter_uni.ma => gr_pat_uni.ma} (67%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pushs.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_pushs_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sand.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sand_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sle.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isd.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_pushs.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_sle.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_tls.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_coafter_ist_isf.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_fcla.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_isf.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_isi.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_sle.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_sor.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_sor_sle.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_tls.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{rtmap_tl.ma => gr_tl.ma} (65%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_tl_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_tl_eq_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_tls.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_tls_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_tls_nexts_eq.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_tls_pushs.ma create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_tls_pushs_eq.ma rename matita/matita/contribs/lambdadelta/ground/relocation/{mr2_append.ma => gr_uni.ma} (66%) create mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/gr_uni_eq.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/mr2_at.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/mr2_minus.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_after.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_after_nat_uni.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_after_uni.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_at.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_coafter.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_eq.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_fcla.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isdiv.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isfin.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isid.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_istot.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isuni.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat_uni.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nexts.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_pushs.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sand.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sdj.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sle.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sor.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_tls.ma delete mode 100644 matita/matita/contribs/lambdadelta/ground/relocation/rtmap_uni.ma diff --git a/.gitignore b/.gitignore index 69568a56b..7c95ce292 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,8 @@ matita/matita/lib/lambda/.depend matita/matita/contribs/lambdadelta/.depend matita/matita/contribs/lambdadelta/bin/recomm/srcs matita/matita/contribs/lambdadelta/bin/recomm/log.txt +matita/matita/contribs/lambdadelta/bin/recomm/subst.txt +matita/matita/contribs/lambdadelta/bin/recomm/subst_cn.txt matita/matita/contribs/lambdadelta/bin/nodes matita/matita/contribs/lambdadelta/bin/token matita/matita/contribs/lambdadelta/*/probe.txt diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/veq_lifts.ma b/matita/matita/contribs/lambdadelta/apps_2/models/veq_lifts.ma index c6a8e2f79..97066bda2 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/veq_lifts.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/veq_lifts.ma @@ -21,7 +21,7 @@ include "apps_2/models/veq.ma". (* Forward lemmas with generic relocation ***********************************) fact lifts_fwd_vpush_aux (M): is_model M → is_extensional M → - ∀f,T1,T2. ⇧*[f] T1 ≘ T2 → ∀m. 𝐁❨m,1❩ = f → + ∀f,T1,T2. ⇧*[f] T1 ≘ T2 → ∀m. 𝐛❨m,1❩ = f → ∀gv,lv,d. ⟦T1⟧[gv,lv] ≗{M} ⟦T2⟧[gv,⫯[m←d]lv]. #M #H1M #H2M #f #T1 #T2 #H elim H -f -T1 -T2 [ #f #s #m #Hf #gv #lv #d diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops_basic.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops_basic.ma index 8de34c2a4..327959cf6 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops_basic.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops_basic.ma @@ -31,7 +31,7 @@ lemma cpr_subst (h) (G) (L) (U1) (i): elim (lt_or_eq_or_gt i j) #Hij [ /3 width=4 by lifts_lref_ge_minus, cpr_refl, ex2_2_intro/ | elim (lifts_total V (𝐔❨↑i❩)) #U2 #HU2 - elim (lifts_split_trans … HU2 (𝐔❨i❩) (𝐁❨i,1❩)) [2: @(after_basic_rc i 0) ] + elim (lifts_split_trans … HU2 (𝐔❨i❩) (𝐛❨i,1❩)) [2: @(after_basic_rc i 0) ] /3 width=7 by cpm_delta_drops, ex2_2_intro/ | /3 width=4 by lifts_lref_lt, cpr_refl, ex2_2_intro/ ] diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_drops_basic.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_drops_basic.ma index 37551625d..4be41497d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_drops_basic.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_drops_basic.ma @@ -30,7 +30,7 @@ lemma cpx_subst (G) (L) (U1) (i): elim (lt_or_eq_or_gt i j) #Hij [ /3 width=4 by lifts_lref_ge_minus, cpx_refl, ex2_2_intro/ | elim (lifts_total V (𝐔❨↑i❩)) #U2 #HU2 - elim (lifts_split_trans … HU2 (𝐔❨i❩) (𝐁❨i,1❩)) [2: @(after_basic_rc i 0) ] + elim (lifts_split_trans … HU2 (𝐔❨i❩) (𝐛❨i,1❩)) [2: @(after_basic_rc i 0) ] /3 width=7 by cpx_delta_drops, ex2_2_intro/ | /3 width=4 by lifts_lref_lt, cpx_refl, ex2_2_intro/ ] diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/Makefile b/matita/matita/contribs/lambdadelta/bin/recomm/Makefile index 6fdc32c44..eb17004b4 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/Makefile +++ b/matita/matita/contribs/lambdadelta/bin/recomm/Makefile @@ -15,7 +15,11 @@ MRCS = $(wildcard *.mrc) mrc: $(MRCS:%.mrc=recommGc%.ml) @./mrc.native . +subst: subst.txt + @sed s/://g subst.txt + @cd ../token; . ./subst.sh + recommGc%.ml recommGc%.mli: %.mrc mrc*.ml mrc*.mli @./mrc.native $< -.PHONY: test mrc +.PHONY: test mrc subst diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/bGroundArith.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/bGroundArith.mrc index 561d9f957..6cb885931 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/bGroundArith.mrc +++ b/matita/matita/contribs/lambdadelta/bin/recomm/bGroundArith.mrc @@ -1,4 +1,6 @@ PcsAnd b "" true false +ple +plt niter ntri nsucc diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/bGroundLib.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/bGroundLib.mrc index 78ef1dd35..cade0886c 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/bGroundLib.mrc +++ b/matita/matita/contribs/lambdadelta/bin/recomm/bGroundLib.mrc @@ -5,3 +5,4 @@ land lsub compose, function composition ctc, contextual transitive closure +stream_eq diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/bGroundRelocation.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/bGroundRelocation.mrc new file mode 100644 index 000000000..c2f0b17d3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/bGroundRelocation.mrc @@ -0,0 +1,23 @@ +PcsAnd b "" true false +gr_eq +gr_tl, tl, tail +gr_pushs, pushs, iterated push +gr_nexts, nexts, iterated next +gr_tls, tls, iterated tail +gr_id, id +gr_uni, uni, uniform relocations +gr_basic, basic relocation +gr_pat, pat, at +gr_nat, nat +gr_isi, isi, isid, test for identity +gr_isu, isuni, test for uniform relocations +gr_fcla, fcla, finite colength assignment, finite colength +gr_isf, isf, isfin, test for finite colength +gr_ist, ist, istot +gr_isd, isdiv +gr_after, after +gr_coafter, coafter +gr_sle, sle, inclusion +gr_sdj, sdj +gr_sand, sand +gr_sor, sor diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/dGroundRelocation.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/dGroundRelocation.mrc new file mode 100644 index 000000000..1dcb63621 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/dGroundRelocation.mrc @@ -0,0 +1,4 @@ +PccFor d "" true false +FINITE RELOCATION MAPS +FINITE RELOCATION MAPS WITH PAIRS +GENERIC RELOCATION MAPS diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/pGroundRelocation.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/pGroundRelocation.mrc new file mode 100644 index 000000000..fceb31fc7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/pGroundRelocation.mrc @@ -0,0 +1,2 @@ +PcsPar p "" true false +(specific) diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/rGroundLib.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/rGroundLib.mrc index 7c2382e22..47cd15405 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/rGroundLib.mrc +++ b/matita/matita/contribs/lambdadelta/bin/recomm/rGroundLib.mrc @@ -6,5 +6,7 @@ TRANSITIVE CLOSURE LABELLED TRANSITIVE CLOSURE NAT-LABELED REFLEXIVE AND TRANSITIVE CLOSURE HEAD AND TAIL +TAIL ITERATED TAIL LENGTH +CONCATENATION, APPEND diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/rGroundRelocation.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/rGroundRelocation.mrc new file mode 100644 index 000000000..5a72cf539 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/rGroundRelocation.mrc @@ -0,0 +1,21 @@ +PccFor r "" true false +BASIC ELEMENTS +DISJOINTNESS +DIVERGENCE CONDITION +FINITE COLENGTH ASSIGNMENT +FINITE COLENGTH CONDITION +IDENTITY CONDITION +IDENTITY ELEMENT +INCLUSION +ITERATED PUSH +ITERATED NEXT +NON-NEGATIVE APPLICATION +POSITIVE APPLICATION +RELATIONAL CO-COMPOSITION +RELATIONAL COMPOSITION +RELATIONAL INTERSECTION +RELATIONAL SUBTRACTION +RELATIONAL UNION +TOTALITY CONDITION +UNIFORM ELEMENTS +UNIFORMITY CONDITION diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml index 87caeb10b..f950a0d84 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml @@ -19,7 +19,7 @@ let chdir path = Sys.chdir path let start_substs () = - subst := Some (open_out "subst.txt") + subst := Some (open_out "subst_cn.txt") let write_substs lint = function | None -> () diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGc.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGc.ml index 58f1f1001..843c606fc 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommGc.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGc.ml @@ -1,14 +1,18 @@ module G01 = RecommGcbGroundArith module G02 = RecommGcbGroundCounters module G03 = RecommGcbGroundLib -module G04 = RecommGcdGroundArith -module G05 = RecommGcdGroundCounters -module G06 = RecommGcdGroundLib -module G07 = RecommGcpGroundArith -module G08 = RecommGcpGroundLib -module G09 = RecommGcrGroundArith -module G10 = RecommGcrGroundCounters -module G11 = RecommGcrGroundLib -module G12 = RecommGcsAttr -module G13 = RecommGcsMain -module G14 = RecommGcsWith +module G04 = RecommGcbGroundRelocation +module G05 = RecommGcdGroundArith +module G06 = RecommGcdGroundCounters +module G07 = RecommGcdGroundLib +module G08 = RecommGcdGroundRelocation +module G09 = RecommGcpGroundArith +module G10 = RecommGcpGroundLib +module G11 = RecommGcpGroundRelocation +module G12 = RecommGcrGroundArith +module G13 = RecommGcrGroundCounters +module G14 = RecommGcrGroundLib +module G15 = RecommGcrGroundRelocation +module G16 = RecommGcsAttr +module G17 = RecommGcsMain +module G18 = RecommGcsWith diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundArith.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundArith.ml index 1528eb2b1..d9f7a0d10 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundArith.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundArith.ml @@ -20,6 +20,8 @@ let step k st outs ins = | "nsucc" :: tl -> k T.OK ("nsucc" :: outs) tl | "ntri" :: tl -> k T.OK ("ntri" :: outs) tl | "niter" :: tl -> k T.OK ("niter" :: outs) tl + | "plt" :: tl -> k T.OK ("plt" :: outs) tl + | "ple" :: tl -> k T.OK ("ple" :: outs) tl | _ -> k T.OO outs ins let main = diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundLib.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundLib.ml index 1402aff57..95c38750c 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundLib.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundLib.ml @@ -4,6 +4,7 @@ module R = RecommPcsAnd let step k st outs ins = if st <> T.OO then k st outs ins else match ins with + | "stream_eq" :: tl -> k T.OK ("stream_eq" :: outs) tl | "ctc" :: tl -> k T.OK ("ctc" :: outs) tl | "contextual" :: "transitive" :: "closure" :: tl -> k T.OK ("ctc" :: outs) tl | "compose" :: tl -> k T.OK ("compose" :: outs) tl diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundRelocation.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundRelocation.ml new file mode 100644 index 000000000..70e95bb4e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundRelocation.ml @@ -0,0 +1,68 @@ +module T = RecommTypes +module R = RecommPcsAnd + +let step k st outs ins = + if st <> T.OO then k st outs ins else + match ins with + | "gr_sor" :: tl -> k T.OK ("gr_sor" :: outs) tl + | "sor" :: tl -> k T.OK ("gr_sor" :: outs) tl + | "gr_sand" :: tl -> k T.OK ("gr_sand" :: outs) tl + | "sand" :: tl -> k T.OK ("gr_sand" :: outs) tl + | "gr_sdj" :: tl -> k T.OK ("gr_sdj" :: outs) tl + | "sdj" :: tl -> k T.OK ("gr_sdj" :: outs) tl + | "gr_sle" :: tl -> k T.OK ("gr_sle" :: outs) tl + | "sle" :: tl -> k T.OK ("gr_sle" :: outs) tl + | "inclusion" :: tl -> k T.OK ("gr_sle" :: outs) tl + | "gr_coafter" :: tl -> k T.OK ("gr_coafter" :: outs) tl + | "coafter" :: tl -> k T.OK ("gr_coafter" :: outs) tl + | "gr_after" :: tl -> k T.OK ("gr_after" :: outs) tl + | "after" :: tl -> k T.OK ("gr_after" :: outs) tl + | "gr_isd" :: tl -> k T.OK ("gr_isd" :: outs) tl + | "isdiv" :: tl -> k T.OK ("gr_isd" :: outs) tl + | "gr_ist" :: tl -> k T.OK ("gr_ist" :: outs) tl + | "ist" :: tl -> k T.OK ("gr_ist" :: outs) tl + | "istot" :: tl -> k T.OK ("gr_ist" :: outs) tl + | "gr_isf" :: tl -> k T.OK ("gr_isf" :: outs) tl + | "isf" :: tl -> k T.OK ("gr_isf" :: outs) tl + | "isfin" :: tl -> k T.OK ("gr_isf" :: outs) tl + | "test" :: "for" :: "finite" :: "colength" :: tl -> k T.OK ("gr_isf" :: outs) tl + | "gr_fcla" :: tl -> k T.OK ("gr_fcla" :: outs) tl + | "fcla" :: tl -> k T.OK ("gr_fcla" :: outs) tl + | "finite" :: "colength" :: "assignment" :: tl -> k T.OK ("gr_fcla" :: outs) tl + | "finite" :: "colength" :: tl -> k T.OK ("gr_fcla" :: outs) tl + | "gr_isu" :: tl -> k T.OK ("gr_isu" :: outs) tl + | "isuni" :: tl -> k T.OK ("gr_isu" :: outs) tl + | "test" :: "for" :: "uniform" :: "relocations" :: tl -> k T.OK ("gr_isu" :: outs) tl + | "gr_isi" :: tl -> k T.OK ("gr_isi" :: outs) tl + | "isi" :: tl -> k T.OK ("gr_isi" :: outs) tl + | "isid" :: tl -> k T.OK ("gr_isi" :: outs) tl + | "test" :: "for" :: "identity" :: tl -> k T.OK ("gr_isi" :: outs) tl + | "gr_nat" :: tl -> k T.OK ("gr_nat" :: outs) tl + | "nat" :: tl -> k T.OK ("gr_nat" :: outs) tl + | "gr_pat" :: tl -> k T.OK ("gr_pat" :: outs) tl + | "pat" :: tl -> k T.OK ("gr_pat" :: outs) tl + | "at" :: tl -> k T.OK ("gr_pat" :: outs) tl + | "gr_basic" :: tl -> k T.OK ("gr_basic" :: outs) tl + | "basic" :: "relocation" :: tl -> k T.OK ("gr_basic" :: outs) tl + | "gr_uni" :: tl -> k T.OK ("gr_uni" :: outs) tl + | "uni" :: tl -> k T.OK ("gr_uni" :: outs) tl + | "uniform" :: "relocations" :: tl -> k T.OK ("gr_uni" :: outs) tl + | "gr_id" :: tl -> k T.OK ("gr_id" :: outs) tl + | "id" :: tl -> k T.OK ("gr_id" :: outs) tl + | "gr_tls" :: tl -> k T.OK ("gr_tls" :: outs) tl + | "tls" :: tl -> k T.OK ("gr_tls" :: outs) tl + | "iterated" :: "tail" :: tl -> k T.OK ("gr_tls" :: outs) tl + | "gr_nexts" :: tl -> k T.OK ("gr_nexts" :: outs) tl + | "nexts" :: tl -> k T.OK ("gr_nexts" :: outs) tl + | "iterated" :: "next" :: tl -> k T.OK ("gr_nexts" :: outs) tl + | "gr_pushs" :: tl -> k T.OK ("gr_pushs" :: outs) tl + | "pushs" :: tl -> k T.OK ("gr_pushs" :: outs) tl + | "iterated" :: "push" :: tl -> k T.OK ("gr_pushs" :: outs) tl + | "gr_tl" :: tl -> k T.OK ("gr_tl" :: outs) tl + | "tl" :: tl -> k T.OK ("gr_tl" :: outs) tl + | "tail" :: tl -> k T.OK ("gr_tl" :: outs) tl + | "gr_eq" :: tl -> k T.OK ("gr_eq" :: outs) tl + | _ -> k T.OO outs ins + +let main = + R.register_b step diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundRelocation.mli b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcbGroundRelocation.mli new file mode 100644 index 000000000..e69de29bb diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcdGroundRelocation.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcdGroundRelocation.ml new file mode 100644 index 000000000..349cf6b36 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcdGroundRelocation.ml @@ -0,0 +1,13 @@ +module T = RecommTypes +module R = RecommPccFor + +let step k st outs ins = + if st <> T.OO then k st outs ins else + match ins with + | "GENERIC" :: "RELOCATION" :: "MAPS" :: tl -> k T.OK ("MAPS" :: "RELOCATION" :: "GENERIC" :: outs) tl + | "FINITE" :: "RELOCATION" :: "MAPS" :: "WITH" :: "PAIRS" :: tl -> k T.OK ("PAIRS" :: "WITH" :: "MAPS" :: "RELOCATION" :: "FINITE" :: outs) tl + | "FINITE" :: "RELOCATION" :: "MAPS" :: tl -> k T.OK ("MAPS" :: "RELOCATION" :: "FINITE" :: outs) tl + | _ -> k T.OO outs ins + +let main = + R.register_d step diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcdGroundRelocation.mli b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcdGroundRelocation.mli new file mode 100644 index 000000000..e69de29bb diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcpGroundRelocation.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcpGroundRelocation.ml new file mode 100644 index 000000000..ad66b8c5a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcpGroundRelocation.ml @@ -0,0 +1,11 @@ +module T = RecommTypes +module R = RecommPcsPar + +let step k st outs ins = + if st <> T.OO then k st outs ins else + match ins with + | "(specific)" :: tl -> k T.OK ("(specific)" :: outs) tl + | _ -> k T.OO outs ins + +let main = + R.register_p step diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcpGroundRelocation.mli b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcpGroundRelocation.mli new file mode 100644 index 000000000..e69de29bb diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundLib.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundLib.ml index 644497245..07c211c44 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundLib.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundLib.ml @@ -4,8 +4,11 @@ module R = RecommPccFor let step k st outs ins = if st <> T.OO then k st outs ins else match ins with + | "CONCATENATION" :: tl -> k T.OK ("CONCATENATION" :: outs) tl + | "APPEND" :: tl -> k T.OK ("CONCATENATION" :: outs) tl | "LENGTH" :: tl -> k T.OK ("LENGTH" :: outs) tl | "ITERATED" :: "TAIL" :: tl -> k T.OK ("TAIL" :: "ITERATED" :: outs) tl + | "TAIL" :: tl -> k T.OK ("TAIL" :: outs) tl | "HEAD" :: "AND" :: "TAIL" :: tl -> k T.OK ("TAIL" :: "AND" :: "HEAD" :: outs) tl | "NAT-LABELED" :: "REFLEXIVE" :: "AND" :: "TRANSITIVE" :: "CLOSURE" :: tl -> k T.OK ("CLOSURE" :: "TRANSITIVE" :: "AND" :: "REFLEXIVE" :: "NAT-LABELED" :: outs) tl | "LABELLED" :: "TRANSITIVE" :: "CLOSURE" :: tl -> k T.OK ("CLOSURE" :: "TRANSITIVE" :: "LABELLED" :: outs) tl diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundRelocation.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundRelocation.ml new file mode 100644 index 000000000..b4300e4ce --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundRelocation.ml @@ -0,0 +1,30 @@ +module T = RecommTypes +module R = RecommPccFor + +let step k st outs ins = + if st <> T.OO then k st outs ins else + match ins with + | "UNIFORMITY" :: "CONDITION" :: tl -> k T.OK ("CONDITION" :: "UNIFORMITY" :: outs) tl + | "UNIFORM" :: "ELEMENTS" :: tl -> k T.OK ("ELEMENTS" :: "UNIFORM" :: outs) tl + | "TOTALITY" :: "CONDITION" :: tl -> k T.OK ("CONDITION" :: "TOTALITY" :: outs) tl + | "RELATIONAL" :: "UNION" :: tl -> k T.OK ("UNION" :: "RELATIONAL" :: outs) tl + | "RELATIONAL" :: "SUBTRACTION" :: tl -> k T.OK ("SUBTRACTION" :: "RELATIONAL" :: outs) tl + | "RELATIONAL" :: "INTERSECTION" :: tl -> k T.OK ("INTERSECTION" :: "RELATIONAL" :: outs) tl + | "RELATIONAL" :: "COMPOSITION" :: tl -> k T.OK ("COMPOSITION" :: "RELATIONAL" :: outs) tl + | "RELATIONAL" :: "CO-COMPOSITION" :: tl -> k T.OK ("CO-COMPOSITION" :: "RELATIONAL" :: outs) tl + | "POSITIVE" :: "APPLICATION" :: tl -> k T.OK ("APPLICATION" :: "POSITIVE" :: outs) tl + | "NON-NEGATIVE" :: "APPLICATION" :: tl -> k T.OK ("APPLICATION" :: "NON-NEGATIVE" :: outs) tl + | "ITERATED" :: "NEXT" :: tl -> k T.OK ("NEXT" :: "ITERATED" :: outs) tl + | "ITERATED" :: "PUSH" :: tl -> k T.OK ("PUSH" :: "ITERATED" :: outs) tl + | "INCLUSION" :: tl -> k T.OK ("INCLUSION" :: outs) tl + | "IDENTITY" :: "ELEMENT" :: tl -> k T.OK ("ELEMENT" :: "IDENTITY" :: outs) tl + | "IDENTITY" :: "CONDITION" :: tl -> k T.OK ("CONDITION" :: "IDENTITY" :: outs) tl + | "FINITE" :: "COLENGTH" :: "CONDITION" :: tl -> k T.OK ("CONDITION" :: "COLENGTH" :: "FINITE" :: outs) tl + | "FINITE" :: "COLENGTH" :: "ASSIGNMENT" :: tl -> k T.OK ("ASSIGNMENT" :: "COLENGTH" :: "FINITE" :: outs) tl + | "DIVERGENCE" :: "CONDITION" :: tl -> k T.OK ("CONDITION" :: "DIVERGENCE" :: outs) tl + | "DISJOINTNESS" :: tl -> k T.OK ("DISJOINTNESS" :: outs) tl + | "BASIC" :: "ELEMENTS" :: tl -> k T.OK ("ELEMENTS" :: "BASIC" :: outs) tl + | _ -> k T.OO outs ins + +let main = + R.register_r step diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundRelocation.mli b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcrGroundRelocation.mli new file mode 100644 index 000000000..e69de29bb diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsMain.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsMain.ml index d308df8db..90e2844d8 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsMain.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsMain.ml @@ -18,6 +18,7 @@ let step k st outs ins = | "inversion" :: tl -> k T.OK ("inversions" :: outs) tl | "constructions" :: tl -> k T.OK ("constructions" :: outs) tl | "properties" :: tl -> k T.OK ("constructions" :: outs) tl + | "alternative" :: "definition" :: tl -> k T.OK ("definition" :: "alternative" :: outs) tl | _ -> k T.KO outs ins let main = diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsWith.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsWith.ml index 8d00bb812..48fe07955 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsWith.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommGcsWith.ml @@ -8,6 +8,7 @@ let step k st outs ins = | "with" :: tl -> k T.OK ("with" :: outs) tl | "of" :: tl -> k T.OK ("with" :: outs) tl | "for" :: tl -> k T.OK ("with" :: outs) tl + | "on" :: tl -> k T.OK ("with" :: outs) tl | _ -> k T.OO outs ins let main = diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommLexer.mll b/matita/matita/contribs/lambdadelta/bin/recomm/recommLexer.mll index 83a289247..596a909c8 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommLexer.mll +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommLexer.mll @@ -10,6 +10,7 @@ let heads = [| "Advanced"; + "Alternative"; "Basic"; "Constructions"; "Forward"; diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommOutput.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recommOutput.ml index c48ba9304..e93935e4a 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommOutput.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommOutput.ml @@ -70,11 +70,19 @@ let rec write_fst och = function | _ :: tl -> write_fst och tl and write_snd och tl s = function + | "axiom" :: n :: _ | "definition" :: n :: _ + | "corec" :: "definition" :: n :: _ + | "rec" :: "definition" :: n :: _ | "fact" :: n :: _ + | "corec" :: "fact" :: n :: _ | "lemma" :: n :: _ + | "corec" :: "lemma" :: n :: _ + | "theorem" :: n :: _ + | "corec" :: "theorem" :: n :: _ | "inductive" :: n :: _ - | "theorem" :: n :: _ -> + | "coinductive" :: n :: _ + | "|" :: n :: _ -> let ss = EL.split_on_char ' ' s in List.iter (write_subst och n) (List.tl ss); write_fst och tl diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recommParser.mly b/matita/matita/contribs/lambdadelta/bin/recomm/recommParser.mly index d8c655bf7..5e71743a9 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recommParser.mly +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recommParser.mly @@ -30,6 +30,10 @@ inn: | CW { $1 } | HW { $1 } +inn_w: + | inn { $1 } + | SR { $1 } + inns_r: | inn_r { $1 } | inn_r inns { $1 ^ $2 } @@ -38,6 +42,10 @@ inns: | inn { $1 } | inn inns { $1 ^ $2 } +inns_w: + | inn_w { $1 } + | inn_w inns_w { $1 ^ $2 } + out: | SP { $1 } | SR { $1 } @@ -79,16 +87,16 @@ sws: | SP sw sws { $2 :: $3 } src_l: - | NL { ET.Line $1 } - | OP sp PP inns CP { ET.Mark $4 } - | OP sp KW inns CP { ET.Key ($3, $4) } - | OP sp CW cws CP { ET.Title ($3 :: $4) } - | OP sp HW sws CP { ET.Slice (lc $3 :: $4) } - | OP sp CP { ET.Other (0, $1, $2, $3) } - | OP sp inns_r CP { ET.Other (0, $1, $2 ^ $3, $4) } - | OP SR inns CP { ET.Other (1, $1, $2 ^ $3, $4) } - | OP SR SR inns CP { ET.Other (2, $1, $2 ^ $3 ^ $4, $5) } - | OP SP SR inns CP { ET.Mark $4 } + | NL { ET.Line $1 } + | OP sp PP inns CP { ET.Mark $4 } + | OP sp KW inns_w CP { ET.Key ($3, $4) } + | OP sp CW cws CP { ET.Title ($3 :: $4) } + | OP sp HW sws CP { ET.Slice (lc $3 :: $4) } + | OP sp CP { ET.Other (0, $1, $2, $3) } + | OP sp inns_r CP { ET.Other (0, $1, $2 ^ $3, $4) } + | OP SR inns CP { ET.Other (1, $1, $2 ^ $3, $4) } + | OP SR SR inns CP { ET.Other (2, $1, $2 ^ $3 ^ $4, $5) } + | OP SP SR inns CP { ET.Mark $4 } src: | outs { ET.Text $1 } diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/sMain.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/sMain.mrc index fbb9e2dc5..7d9d62f98 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/sMain.mrc +++ b/matita/matita/contribs/lambdadelta/bin/recomm/sMain.mrc @@ -1,4 +1,5 @@ check s "GcsAttr" false true +alternative definition constructions, properties inversions, inversion properties, inversion lemmas, inversion destructions, forward properties, forward lemmas diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/sWith.mrc b/matita/matita/contribs/lambdadelta/bin/recomm/sWith.mrc index f057ad614..70305bb8e 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/sWith.mrc +++ b/matita/matita/contribs/lambdadelta/bin/recomm/sWith.mrc @@ -1,2 +1,2 @@ check s "GcsMain" false false -with, of, for +with, of, for, on diff --git a/matita/matita/contribs/lambdadelta/ground/arith/arith_2a.ma b/matita/matita/contribs/lambdadelta/ground/arith/arith_2a.ma index b5ff26116..92224c4c9 100644 --- a/matita/matita/contribs/lambdadelta/ground/arith/arith_2a.ma +++ b/matita/matita/contribs/lambdadelta/ground/arith/arith_2a.ma @@ -87,7 +87,7 @@ lemma lt_plus_SO_to_le: ∀x,y. x < y + (𝟏) → x ≤ y. (* Iterators ****************************************************************) -lemma iter_SO: ∀B:Type[0]. ∀f:B→B. ∀b,l. f^(l+𝟏) b = f (f^l b). +lemma iter_SO: ∀B:Type[0]. ∀f:B→B. ∀b,l. (f^(l+𝟏)) b = f ((f^l) b). #B #f #b #l next_rew #H cases (compose_inv_S1 … H) -H * -p >next_rew - /3 width=5 by after_next/ +| #p2 >gr_next_unfold #H cases (compose_inv_S1 … H) -H * -p >gr_next_unfold + /3 width=5 by gr_after_next/ ] qed-. theorem after_total: ∀f1,f2. f2 ⊚ f1 ≘ f2 ∘ f1. /2 width=1 by after_total_aux/ qed. -(* Specific inversion lemmas on after ***************************************) +(* Inversion lemmas on after (specific) ***************************************) lemma after_inv_xpx: ∀f2,g2,f,p2,p. p2⨮f2 ⊚ g2 ≘ p⨮f → ∀f1. ⫯f1 = g2 → f2 ⊚ f1 ≘ f ∧ p2 = p. #f2 #g2 #f #p2 elim p2 -p2 -[ #p #Hf #f1 #H2 elim (after_inv_ppx … Hf … H2) -g2 [|*: // ] +[ #p #Hf #f1 #H2 elim (gr_after_inv_push_bi … Hf … H2) -g2 [|*: // ] #g #Hf #H elim (push_inv_seq_dx … H) -H destruct /2 width=1 by conj/ -| #p2 #IH #p #Hf #f1 #H2 elim (after_inv_nxx … Hf) -Hf [|*: // ] +| #p2 #IH #p #Hf #f1 #H2 elim (gr_after_inv_next_sn … Hf) -Hf [|*: // ] #g1 #Hg #H1 elim (next_inv_seq_dx … H1) -H1 #x #Hx #H destruct elim (IH … Hg) [|*: // ] -IH -Hg #H destruct /2 width=1 by conj/ @@ -118,10 +118,10 @@ qed-. lemma after_inv_xnx: ∀f2,g2,f,p2,p. p2⨮f2 ⊚ g2 ≘ p⨮f → ∀f1. ↑f1 = g2 → ∃∃q. f2 ⊚ f1 ≘ q⨮f & q+p2 = p. #f2 #g2 #f #p2 elim p2 -p2 -[ #p #Hf #f1 #H2 elim (after_inv_pnx … Hf … H2) -g2 [|*: // ] +[ #p #Hf #f1 #H2 elim (gr_after_inv_push_next … Hf … H2) -g2 [|*: // ] #g #Hf #H elim (next_inv_seq_dx … H) -H #x #Hx #Hg destruct /2 width=3 by ex2_intro/ -| #p2 #IH #p #Hf #f1 #H2 elim (after_inv_nxx … Hf) -Hf [|*: // ] +| #p2 #IH #p #Hf #f1 #H2 elim (gr_after_inv_next_sn … Hf) -Hf [|*: // ] #g #Hg #H elim (next_inv_seq_dx … H) -H #x #Hx #H destruct elim (IH … Hg) -IH -Hg [|*: // ] #m #Hf #Hm destruct /2 width=3 by ex2_intro/ @@ -131,19 +131,19 @@ qed-. lemma after_inv_const: ∀f2,f1,f,p1,p. p⨮f2 ⊚ p1⨮f1 ≘ p⨮f → f2 ⊚ f1 ≘ f ∧ 𝟏 = p1. #f2 #f1 #f #p1 #p elim p -p -[ #H elim (after_inv_pxp … H) -H [|*: // ] +[ #H elim (gr_after_inv_push_sn_push … H) -H [|*: // ] #g2 #Hf #H elim (push_inv_seq_dx … H) -H /2 width=1 by conj/ -| #p #IH #H lapply (after_inv_nxn … H ????) -H /2 width=5 by/ +| #p #IH #H lapply (gr_after_inv_next_sn_next … H ????) -H /2 width=5 by/ ] qed-. lemma after_inv_total: ∀f2,f1,f. f2 ⊚ f1 ≘ f → f2 ∘ f1 ≡ f. -/2 width=4 by after_mono/ qed-. +/2 width=4 by gr_after_mono/ qed-. -(* Specific forward lemmas on after *****************************************) +(* Forward lemmas on after (specific) *****************************************) lemma after_fwd_hd: ∀f2,f1,f,p1,p. f2 ⊚ p1⨮f1 ≘ p⨮f → f2@❨p1❩ = p. -#f2 #f1 #f #p1 #p #H lapply (after_fwd_at ? p1 (𝟏) … H) -H [4:|*: // ] +#f2 #f1 #f #p1 #p #H lapply (gr_after_des_pat ? p1 (𝟏) … H) -H [4:|*: // ] /3 width=2 by at_inv_O1, sym_eq/ qed-. @@ -163,4 +163,4 @@ lemma after_inv_apply: ∀f2,f1,f,p2,p1,p. p2⨮f2 ⊚ p1⨮f1 ≘ p⨮f → (* Properties on apply ******************************************************) lemma compose_apply (f2) (f1) (i): f2@❨f1@❨i❩❩ = (f2∘f1)@❨i❩. -/4 width=6 by after_fwd_at, at_inv_total, sym_eq/ qed. +/4 width=6 by gr_after_des_pat, at_inv_total, sym_eq/ qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_basic.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_basic.etc similarity index 76% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_basic.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_basic.etc index 072b509f4..39c5bb6f1 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_basic.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_basic.etc @@ -16,20 +16,20 @@ include "ground/arith/nat_lt_plus.ma". include "ground/relocation/rtmap_basic_at.ma". include "ground/relocation/pstream_after.ma". -(* RELOCATION N-STREAM ******************************************************) +(* RELOCATION P-STREAM ******************************************************) -(* Specific properties on basic relocation **********************************) +(* Properties on basic relocation (specific) **********************************) -lemma apply_basic_lt: ∀m,n,i. ninj i ≤ m → 𝐁❨m,n❩@❨i❩ = i. -/3 width=1 by at_inv_total, at_basic_lt/ qed-. +lemma apply_basic_lt: ∀m,n,i. ninj i ≤ m → 𝐛❨m,n❩@❨i❩ = i. +/3 width=1 by at_inv_total, gr_pat_basic_lt/ qed-. -lemma apply_basic_ge: ∀m,n,i. m < ninj i → 𝐁❨m,n❩@❨i❩ = i+n. -/3 width=1 by at_inv_total, at_basic_ge/ qed-. +lemma apply_basic_ge: ∀m,n,i. m < ninj i → 𝐛❨m,n❩@❨i❩ = i+n. +/3 width=1 by at_inv_total, gr_pat_basic_ge/ qed-. -(* Specific main properties on basic relocation *****************************) +(* Main properties on basic relocation (specific) *****************************) theorem basic_swap: ∀d1,d2. d2 ≤ d1 → - ∀h1,h2. 𝐁❨d2,h2❩∘𝐁❨d1,h1❩ ≡ 𝐁❨d1+h2,h1❩∘𝐁❨d2,h2❩. + ∀h1,h2. 𝐛❨d2,h2❩∘𝐛❨d1,h1❩ ≡ 𝐛❨d1+h2,h1❩∘𝐛❨d2,h2❩. #d1 #d2 #Hd21 #h1 #h2 @nstream_inv_eq @nstream_eq_inv_ext #i diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_coafter.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_coafter.etc similarity index 81% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_coafter.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_coafter.etc index 4dd17dd58..6467a912b 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_coafter.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_coafter.etc @@ -15,27 +15,27 @@ include "ground/notation/functions/cocompose_2.ma". include "ground/relocation/rtmap_coafter.ma". -(* RELOCATION N-STREAM ******************************************************) +(* RELOCATION P-STREAM ******************************************************) -rec definition fun0 (p1:pnat) on p1: rtmap → pnat. +rec definition fun0 (p1:pnat) on p1: gr_map → pnat. * * [ | #p2 #f2 @(𝟏) ] #f2 cases p1 -p1 [ @(𝟏) ] #p1 @(↑(fun0 p1 f2)) defined. -rec definition fun2 (p1:pnat) on p1: rtmap → rtmap. +rec definition fun2 (p1:pnat) on p1: gr_map → gr_map. * * [ | #p2 #f2 @(p2⨮f2) ] #f2 cases p1 -p1 [ @f2 ] #p1 @(fun2 p1 f2) defined. -rec definition fun1 (p1:pnat) (f1:rtmap) on p1: rtmap → rtmap. +rec definition fun1 (p1:pnat) (f1:gr_map) on p1: gr_map → gr_map. * * [ | #p2 #f2 @(p1⨮f1) ] #f2 cases p1 -p1 [ @f1 ] #p1 @(fun1 p1 f1 f2) defined. -corec definition cocompose: rtmap → rtmap → rtmap. +corec definition cocompose: gr_map → gr_map → gr_map. #f2 * #p1 #f1 @(stream_cons … (fun0 p1 f2)) @(cocompose (fun2 p1 f2) (fun1 p1 f1 f2)) defined. @@ -58,7 +58,7 @@ lemma fun1_xxn: ∀f2,f1,p1. fun1 p1 f1 (↑f2) = p1⨮f1. * #p2 #f2 #f1 * // qed. -(* Basic properies on cocompose *********************************************) +(* Basic properties on cocompose *********************************************) lemma cocompose_rew: ∀f2,f1,p1. (fun0 p1 f2)⨮(fun2 p1 f2)~∘(fun1 p1 f1 f2) = f2 ~∘ (p1⨮f1). #f2 #f1 #p1 <(stream_rew … (f2~∘(p1⨮f1))) normalize // @@ -88,15 +88,15 @@ lemma cocompose_inv_nxx: ∀f2,f1,f,p1,x. (↑f2) ~∘ (p1⨮f1) = x⨮f → /2 width=1 by conj/ qed-. -(* Specific properties on coafter *******************************************) +(* Properties on coafter (specific) *******************************************) corec lemma coafter_total_aux: ∀f2,f1,f. f2 ~∘ f1 = f → f2 ~⊚ f1 ≘ f. * #p2 #f2 * #p1 #f1 * #p #f cases p2 -p2 [ cases p1 -p1 - [ #H cases (cocompose_inv_ppx … H) -H /3 width=7 by coafter_refl, eq_f2/ - | #p1 #H cases (cocompose_inv_pnx … H) -H /3 width=7 by coafter_push/ + [ #H cases (cocompose_inv_ppx … H) -H /3 width=7 by gr_coafter_refl, eq_f2/ + | #p1 #H cases (cocompose_inv_pnx … H) -H /3 width=7 by gr_coafter_push/ ] -| #p2 >next_rew #H cases (cocompose_inv_nxx … H) -H /3 width=5 by coafter_next/ +| #p2 >gr_next_unfold #H cases (cocompose_inv_nxx … H) -H /3 width=5 by gr_coafter_next/ ] qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_eq.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_eq.etc similarity index 79% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_eq.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_eq.etc index 12663ae77..a83f84cc9 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_eq.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_eq.etc @@ -5,7 +5,7 @@ (* ||T|| *) (* ||I|| Developers: *) (* ||T|| The HELM team. *) -(* ||A|| http://helm.tcs.unibo.it *) +(* ||A|| http://helm.cs.unibo.it *) (* \ / *) (* \ / This file is distributed under the terms of the *) (* v GNU General Public License Version 2 *) @@ -15,16 +15,16 @@ include "ground/lib/stream_eq.ma". include "ground/relocation/rtmap_eq.ma". -(* RELOCATION N-STREAM ******************************************************) +(* RELOCATION P-STREAM ******************************************************) -(* Specific properties ******************************************************) +(* Properties (specific) ******************************************************) fact eq_inv_seq_aux: ∀f1,f2,p1,p2. p1⨮f1 ≡ p2⨮f2 → p1 = p2 ∧ f1 ≡ f2. #f1 #f2 #p1 #p2 @(pnat_ind_2 … p1 p2) -p1 -p2 -[ #p2 #H elim (eq_inv_px … H) -H [2,3: // ] +[ #p2 #H elim (gr_eq_inv_push_sn … H) -H [2,3: // ] #g1 #H1 #H elim (push_inv_seq_dx … H) -H /2 width=1 by conj/ -| #p1 #_ #H elim (eq_inv_np … H) -H // -| #p1 #p2 #IH #H lapply (eq_inv_nn … H ????) -H [5:|*: // ] +| #p1 #_ #H elim (gr_eq_inv_next_push … H) -H // +| #p1 #p2 #IH #H lapply (gr_eq_inv_next_bi … H ????) -H [5:|*: // ] #H elim (IH H) -IH -H /2 width=1 by conj/ ] qed-. @@ -34,7 +34,7 @@ lemma eq_inv_seq: ∀g1,g2. g1 ≡ g2 → ∀f1,f2,p1,p2. p1⨮f1 = g1 → p2⨮ /2 width=1 by eq_inv_seq_aux/ qed-. corec lemma nstream_eq: ∀f1,f2. f1 ≡ f2 → f1 ≗ f2. -* #p1 #f1 * #p2 #f2 #Hf cases (eq_inv_gen … Hf) -Hf * +* #p1 #f1 * #p2 #f2 #Hf cases (gr_eq_inv_gen … Hf) -Hf * #g1 #g2 #Hg #H1 #H2 [ cases (push_inv_seq_dx … H1) -H1 * -p1 #H1 cases (push_inv_seq_dx … H2) -H2 * -p2 #H2 @@ -48,8 +48,8 @@ qed-. corec lemma nstream_inv_eq: ∀f1,f2. f1 ≗ f2 → f1 ≡ f2. * #p1 #f1 * #p2 #f2 #H cases (stream_eq_inv_cons ??? H) -H [|*: // ] -#Hf * -p2 cases p1 -p1 /3 width=5 by eq_push/ -#n @eq_next /3 width=5 by stream_eq_cons/ +#Hf * -p2 cases p1 -p1 /3 width=5 by gr_eq_next/ +#n @gr_eq_next /3 width=5 by stream_eq_cons/ qed. lemma eq_seq_id: ∀f1,f2. f1 ≡ f2 → ∀n. n⨮f1 ≡ n⨮f2. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_isid.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_isid.etc similarity index 86% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_isid.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_isid.etc index fa647fd14..881ba2ca1 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_isid.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_isid.etc @@ -14,11 +14,11 @@ include "ground/relocation/rtmap_isid.ma". -(* RELOCATION N-STREAM ******************************************************) +(* RELOCATION P-STREAM ******************************************************) -(* Specific inversion lemmas ************************************************) +(* Inversion lemmas (specific) ************************************************) lemma isid_inv_seq: ∀f,p. 𝐈❪p⨮f❫ → 𝐈❪f❫ ∧ 𝟏 = p. -#f #p #H elim (isid_inv_gen … H) -H +#f #p #H elim (gr_isi_inv_gen … H) -H #g #Hg #H elim (push_inv_seq_dx … H) -H /2 width=1 by conj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_istot.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_istot.etc similarity index 76% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_istot.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_istot.etc index f8b66a364..584154dfa 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_istot.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_istot.etc @@ -5,7 +5,7 @@ (* ||T|| *) (* ||I|| Developers: *) (* ||T|| The HELM team. *) -(* ||A|| http://helm.tcs.unibo.it *) +(* ||A|| http://helm.cs.unibo.it *) (* \ / *) (* \ / This file is distributed under the terms of the *) (* v GNU General Public License Version 2 *) @@ -17,9 +17,9 @@ include "ground/arith/pnat_le_plus.ma". include "ground/relocation/pstream_eq.ma". include "ground/relocation/rtmap_istot.ma". -(* RELOCATION N-STREAM ******************************************************) +(* RELOCATION P-STREAM ******************************************************) -rec definition apply (i: pnat) on i: rtmap → pnat. +rec definition apply (i: pnat) on i: gr_map → pnat. * #p #f cases i -i [ @p | #i lapply (apply i f) -apply -i -f @@ -30,14 +30,14 @@ defined. interpretation "functional application (nstream)" 'Apply f i = (apply i f). -(* Specific properties on at ************************************************) +(* Properties on at (specific) ************************************************) lemma at_O1: ∀i2,f. @❪𝟏, i2⨮f❫ ≘ i2. -#i2 elim i2 -i2 /2 width=5 by at_refl, at_next/ +#i2 elim i2 -i2 /2 width=5 by gr_pat_refl, gr_pat_next/ qed. lemma at_S1: ∀p,f,i1,i2. @❪i1, f❫ ≘ i2 → @❪↑i1, p⨮f❫ ≘ i2+p. -#p elim p -p /3 width=7 by at_push, at_next/ +#p elim p -p /3 width=7 by gr_pat_push, gr_pat_next/ qed. lemma at_total: ∀i1,f. @❪i1, f❫ ≘ f@❨i1❩. @@ -50,41 +50,41 @@ lemma at_istot: ∀f. 𝐓❪f❫. lemma at_plus2: ∀f,i1,i,p,q. @❪i1, p⨮f❫ ≘ i → @❪i1, (p+q)⨮f❫ ≘ i+q. #f #i1 #i #p #q #H elim q -q -/2 width=5 by at_next/ +/2 width=5 by gr_pat_next/ qed. -(* Specific inversion lemmas on at ******************************************) +(* Inversion lemmas on at (specific) ******************************************) lemma at_inv_O1: ∀f,p,i2. @❪𝟏, p⨮f❫ ≘ i2 → p = i2. -#f #p elim p -p /2 width=6 by at_inv_ppx/ -#p #IH #i2 #H elim (at_inv_xnx … H) -H [|*: // ] +#f #p elim p -p /2 width=6 by gr_pat_inv_unit_push/ +#p #IH #i2 #H elim (gr_pat_inv_next … H) -H [|*: // ] #j2 #Hj * -i2 /3 width=1 by eq_f/ qed-. lemma at_inv_S1: ∀f,p,j1,i2. @❪↑j1, p⨮f❫ ≘ i2 → ∃∃j2. @❪j1, f❫ ≘ j2 & j2+p = i2. -#f #p elim p -p /2 width=5 by at_inv_npx/ -#p #IH #j1 #i2 #H elim (at_inv_xnx … H) -H [|*: // ] +#f #p elim p -p /2 width=5 by gr_pat_inv_succ_push/ +#p #IH #j1 #i2 #H elim (gr_pat_inv_next … H) -H [|*: // ] #j2 #Hj * -i2 elim (IH … Hj) -IH -Hj #i2 #Hi * -j2 /2 width=3 by ex2_intro/ qed-. lemma at_inv_total: ∀f,i1,i2. @❪i1, f❫ ≘ i2 → f@❨i1❩ = i2. -/2 width=6 by at_mono/ qed-. +/2 width=6 by fr2_nat_mono/ qed-. -(* Spercific forward lemmas on at *******************************************) +(* Forward lemmas on at (specific) *******************************************) lemma at_increasing_plus: ∀f,p,i1,i2. @❪i1, p⨮f❫ ≘ i2 → i1 + p ≤ ↑i2. #f #p * [ #i2 #H <(at_inv_O1 … H) -i2 // | #i1 #i2 #H elim (at_inv_S1 … H) -H #j1 #Ht * -i2 apply_S1 >apply_S1 /3 width=1 by eq_f2/ @@ -109,7 +109,7 @@ qed. (* Main inversion lemmas ****************************************************) theorem apply_inj: ∀f,i1,i2,j. f@❨i1❩ = j → f@❨i2❩ = j → i1 = i2. -/2 width=4 by at_inj/ qed-. +/2 width=4 by gr_pat_inj/ qed-. corec theorem nstream_eq_inv_ext: ∀f1,f2. (∀i. f1@❨i❩ = f2@❨i❩) → f1 ≗ f2. * #p1 #f1 * #p2 #f2 #Hf @stream_eq_cons diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_sor.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_sor.etc similarity index 86% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_sor.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_sor.etc index 2e7758110..28e6fcb9d 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_sor.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_sor.etc @@ -14,13 +14,13 @@ include "ground/relocation/rtmap_sor.ma". -(* RELOCATION N-STREAM ******************************************************) +(* RELOCATION P-STREAM ******************************************************) -axiom union: rtmap → rtmap → rtmap. +axiom union: gr_map → gr_map → gr_map. interpretation "union (nstream)" 'union f1 f2 = (union f1 f2). -(* Specific properties on sor ***********************************************) +(* Properties on sor (specific) ***********************************************) axiom sor_total: ∀f1,f2. f1 ⋓ f2 ≘ f1 ∪ f2. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_tl.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_tl.etc similarity index 93% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_tl.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_tl.etc index 318b7da88..9fa3b818e 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_tl.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_tl.etc @@ -17,7 +17,7 @@ include "ground/relocation/pstream.ma". (* RELOCATION P-STREAM ******************************************************) -(* Poperties with stream_tl *************************************************) +(* Properties with stream_tl *************************************************) lemma tl_push: ∀f. f = ⫰⫯f. // qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_tls.ma b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_tls.etc similarity index 94% rename from matita/matita/contribs/lambdadelta/ground/relocation/pstream_tls.ma rename to matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_tls.etc index e7232fa8b..d6837045f 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/pstream_tls.ma +++ b/matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream_tls.etc @@ -18,7 +18,7 @@ include "ground/relocation/pstream_tl.ma". (* RELOCATION P-STREAM ******************************************************) -(* Poperties with stream_tls ************************************************) +(* Properties with stream_tls ************************************************) lemma tls_next: ∀f. ∀p:pnat. ⫰*[p]f = ⫰*[p]↑f. #f #p >(npsucc_pred p) (H2f a) -H2f /3 width=4 by ltc_rc/ qed-. lemma ltc_ind_dx_refl (A) (i) (f) (B) (R) (Q:A→predicate B) (b1): - associative … f → left_identity … f i → reflexive B (R i) → - Q i b1 → - (∀a1,a2,b,b2. ltc … f … R a1 b1 b → Q a1 b → R a2 b b2 → Q (f a1 a2) b2) → - ∀a,b2. ltc … f … R a b1 b2 → Q a b2. + associative … f → left_identity … f i → reflexive B (R i) → + Q i b1 → + (∀a1,a2,b,b2. ltc … f … R a1 b1 b → Q a1 b → R a2 b b2 → Q (f a1 a2) b2) → + ∀a,b2. ltc … f … R a b1 b2 → Q a b2. #A #i #f #B #R #Q #b1 #H1f #H2f #HR #IH1 #IH2 #a #b2 #H @(ltc_ind_dx … R … H1f … IH2 … H) -a -b2 -H1f #a #b2 #Hb12 >(H2f a) -H2f /3 width=4 by ltc_rc/ @@ -80,10 +84,11 @@ qed-. (* Constructions with lsub **************************************************) -lemma ltc_lsub_trans: ∀A,f. associative … f → - ∀B,C,R,S. (∀n. lsub_trans B C (λL. R L n) S) → - ∀n. lsub_trans B C (λL. ltc A f … (R L) n) S. -#A #f #Hf #B #C #R #S #HRS #n #L2 #T1 #T2 #H +lemma ltc_lsub_trans (A) (f) (B) (C) (R) (S): + associative … f → + (∀n. lsub_trans B C (λL. R L n) S) → + ∀n. lsub_trans B C (λL. ltc A f … (R L) n) S. +#A #f #B #C #R #S #Hf #HRS #n #L2 #T1 #T2 #H @(ltc_ind_dx … Hf ???? H) -n -T2 /3 width=5 by ltc_dx, ltc_rc/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/lib/ltc_ctc.ma b/matita/matita/contribs/lambdadelta/ground/lib/ltc_ctc.ma index e6fcccec6..f598434a1 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/ltc_ctc.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/ltc_ctc.ma @@ -22,8 +22,8 @@ alias symbol "subseteq" = "relation inclusion". (* * alias *) (* Constructions with ctc ***************************************************) lemma ltc_CTC (C) (A) (i) (f) (B) (R:relation4 C A B B): - left_identity … f i → - ∀c. CTC … (λc. R c i) c ⊆ ltc … f … (R c) i. + left_identity … f i → + ∀c. CTC … (λc. R c i) c ⊆ ltc … f … (R c) i. #C #A #i #f #B #R #Hf #c #b1 #b2 #H elim H -b2 /2 width=1 by ltc_rc/ #b #b2 #_ #Hb2 #IH >(Hf i) -Hf /2 width=3 by ltc_dx/ qed. @@ -31,8 +31,8 @@ qed. (* Inversions with ctc ******************************************************) lemma ltc_inv_CTC (C) (A) (i) (f) (B) (R:relation4 C A B B): - associative … f → annulment_2 … f i → - ∀c. ltc … f … (R c) i ⊆ CTC … (λc. R c i) c. + associative … f → annulment_2 … f i → + ∀c. ltc … f … (R c) i ⊆ CTC … (λc. R c i) c. #C #A #i #f #B #R #H1f #H2f #c #b1 #b2 @(insert_eq_1 … i) #a #H @(ltc_ind_dx A f B … H) -a -b2 /2 width=1 by inj/ -H1f diff --git a/matita/matita/contribs/lambdadelta/ground/lib/relations.ma b/matita/matita/contribs/lambdadelta/ground/lib/relations.ma index 328e2ea5b..6721a3471 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/relations.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/relations.ma @@ -143,8 +143,10 @@ interpretation (* Main constructions with eq ***********************************************) -theorem canc_sn_eq (A): left_cancellable A (eq …). +theorem canc_sn_eq (A): + left_cancellable A (eq …). // qed-. -theorem canc_dx_eq (A): right_cancellable A (eq …). +theorem canc_dx_eq (A): + right_cancellable A (eq …). // qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/lib/star.ma b/matita/matita/contribs/lambdadelta/ground/lib/star.ma index ee7ff16f7..7046fb45b 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/star.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/star.ma @@ -17,18 +17,24 @@ include "ground/lib/relations.ma". (* TRANSITIVE CLOSURE FOR RELATIONS *****************************************) -definition CTC: ∀A:Type[0]. ∀B. (A→relation B) → (A→relation B) ≝ - λA,B,R,a. TC … (R a). - -definition s_r_transitive: ∀A,B. relation2 (A→relation B) (B→relation A) ≝ λA,B,R1,R2. - ∀L2,T1,T2. R1 L2 T1 T2 → ∀L1. R2 T1 L1 L2 → CTC … R1 L1 T1 T2. - -definition s_rs_transitive: ∀A,B. relation2 (A→relation B) (B→relation A) ≝ λA,B,R1,R2. - ∀L2,T1,T2. CTC … R1 L2 T1 T2 → ∀L1. R2 T1 L1 L2 → CTC … R1 L1 T1 T2. - -lemma TC_strip1: ∀A,R1,R2. confluent2 A R1 R2 → - ∀a0,a1. TC … R1 a0 a1 → ∀a2. R2 a0 a2 → - ∃∃a. R2 a1 a & TC … R1 a2 a. +definition CTC (A:Type[0]) (B): + (A→relation B) → (A→relation B) ≝ + λR,a. TC … (R a). + +definition s_r_transitive (A) (B): + relation2 (A→relation B) (B→relation A) ≝ + λR1,R2. + ∀L2,T1,T2. R1 L2 T1 T2 → ∀L1. R2 T1 L1 L2 → CTC … R1 L1 T1 T2. + +definition s_rs_transitive (A) (B): + relation2 (A→relation B) (B→relation A) ≝ + λR1,R2. + ∀L2,T1,T2. CTC … R1 L2 T1 T2 → ∀L1. R2 T1 L1 L2 → CTC … R1 L1 T1 T2. + +lemma TC_strip (A) (R1) (R2): + confluent2 A R1 R2 → + ∀a0,a1. TC … R1 a0 a1 → ∀a2. R2 a0 a2 → + ∃∃a. R2 a1 a & TC … R1 a2 a. #A #R1 #R2 #HR12 #a0 #a1 #H elim H -a1 [ #a1 #Ha01 #a2 #Ha02 elim (HR12 … Ha01 … Ha02) -HR12 -a0 /3 width=3 by inj, ex2_intro/ @@ -38,9 +44,10 @@ lemma TC_strip1: ∀A,R1,R2. confluent2 A R1 R2 → ] qed. -lemma TC_strip2: ∀A,R1,R2. confluent2 A R1 R2 → - ∀a0,a2. TC … R2 a0 a2 → ∀a1. R1 a0 a1 → - ∃∃a. TC … R2 a1 a & R1 a2 a. +lemma TC_strip2 (A) (R1) (R2): + confluent2 A R1 R2 → + ∀a0,a2. TC … R2 a0 a2 → ∀a1. R1 a0 a1 → + ∃∃a. TC … R2 a1 a & R1 a2 a. #A #R1 #R2 #HR12 #a0 #a2 #H elim H -a2 [ #a2 #Ha02 #a1 #Ha01 elim (HR12 … Ha01 … Ha02) -HR12 -a0 /3 width=3 by inj, ex2_intro/ @@ -50,8 +57,8 @@ lemma TC_strip2: ∀A,R1,R2. confluent2 A R1 R2 → ] qed. -lemma TC_confluent2: ∀A,R1,R2. - confluent2 A R1 R2 → confluent2 A (TC … R1) (TC … R2). +lemma TC_confluent2 (A) (R1) (R2): + confluent2 A R1 R2 → confluent2 A (TC … R1) (TC … R2). #A #R1 #R2 #HR12 #a0 #a1 #H elim H -a1 [ #a1 #Ha01 #a2 #Ha02 elim (TC_strip2 … HR12 … Ha02 … Ha01) -HR12 -a0 /3 width=3 by inj, ex2_intro/ @@ -61,9 +68,10 @@ lemma TC_confluent2: ∀A,R1,R2. ] qed. -lemma TC_strap1: ∀A,R1,R2. transitive2 A R1 R2 → - ∀a1,a0. TC … R1 a1 a0 → ∀a2. R2 a0 a2 → - ∃∃a. R2 a1 a & TC … R1 a a2. +lemma TC_strap1 (A) (R1) (R2): + transitive2 A R1 R2 → + ∀a1,a0. TC … R1 a1 a0 → ∀a2. R2 a0 a2 → + ∃∃a. R2 a1 a & TC … R1 a a2. #A #R1 #R2 #HR12 #a1 #a0 #H elim H -a0 [ #a0 #Ha10 #a2 #Ha02 elim (HR12 … Ha10 … Ha02) -HR12 -a0 /3 width=3 by inj, ex2_intro/ @@ -73,9 +81,10 @@ lemma TC_strap1: ∀A,R1,R2. transitive2 A R1 R2 → ] qed. -lemma TC_strap2: ∀A,R1,R2. transitive2 A R1 R2 → - ∀a0,a2. TC … R2 a0 a2 → ∀a1. R1 a1 a0 → - ∃∃a. TC … R2 a1 a & R1 a a2. +lemma TC_strap2 (A) (R1) (R2): + transitive2 A R1 R2 → + ∀a0,a2. TC … R2 a0 a2 → ∀a1. R1 a1 a0 → + ∃∃a. TC … R2 a1 a & R1 a a2. #A #R1 #R2 #HR12 #a0 #a2 #H elim H -a2 [ #a2 #Ha02 #a1 #Ha10 elim (HR12 … Ha10 … Ha02) -HR12 -a0 /3 width=3 by inj, ex2_intro/ @@ -85,8 +94,8 @@ lemma TC_strap2: ∀A,R1,R2. transitive2 A R1 R2 → ] qed. -lemma TC_transitive2: ∀A,R1,R2. - transitive2 A R1 R2 → transitive2 A (TC … R1) (TC … R2). +lemma TC_transitive2 (A) (R1) (R2): + transitive2 A R1 R2 → transitive2 A (TC … R1) (TC … R2). #A #R1 #R2 #HR12 #a1 #a0 #H elim H -a0 [ #a0 #Ha10 #a2 #Ha02 elim (TC_strap2 … HR12 … Ha02 … Ha10) -HR12 -a0 /3 width=3 by inj, ex2_intro/ @@ -96,43 +105,47 @@ lemma TC_transitive2: ∀A,R1,R2. ] qed. -lemma CTC_lsub_trans: ∀A,B,R,S. lsub_trans A B R S → lsub_trans A B (CTC … R) S. +lemma CTC_lsub_trans (A) (B) (R) (S): + lsub_trans A B R S → lsub_trans A B (CTC … R) S. #A #B #R #S #HRS #L2 #T1 #T2 #H elim H -T2 /3 width=3 by inj/ #T #T2 #_ #HT2 #IHT1 #L1 #HL12 lapply (HRS … HT2 … HL12) -HRS -HT2 /3 width=3 by step/ qed-. -lemma s_r_conf1_CTC1: ∀A,B,S,R. s_r_confluent1 A B S R → s_r_confluent1 A B (CTC … S) R. +lemma s_r_conf1_CTC1 (A) (B) (S) (R): + s_r_confluent1 A B S R → s_r_confluent1 A B (CTC … S) R. #A #B #S #R #HSR #L1 #T1 #T2 #H @(TC_ind_dx … T1 H) -T1 /3 width=3 by/ qed-. -lemma s_r_trans_CTC1: ∀A,B,S,R. s_r_confluent1 A B S R → - s_r_transitive A B S R → s_rs_transitive A B S R. +lemma s_r_trans_CTC1 (A) (B) (S) (R): + s_r_confluent1 A B S R → + s_r_transitive A B S R → s_rs_transitive A B S R. #A #B #S #R #H1SR #H2SR #L2 #T1 #T2 #H @(TC_ind_dx … T1 H) -T1 /2 width=3 by/ #T1 #T #HT1 #_ #IHT2 #L1 #HL12 lapply (H2SR … HT1 … HL12) -H2SR -HT1 /4 width=5 by s_r_conf1_CTC1, trans_TC/ qed-. -lemma s_r_trans_CTC2: ∀A,B,S,R. s_rs_transitive A B S R → s_r_transitive A B S (CTC … R). +lemma s_r_trans_CTC2 (A) (B) (S) (R): + s_rs_transitive A B S R → s_r_transitive A B S (CTC … R). #A #B #S #R #HSR #L2 #T1 #T2 #HT12 #L1 #H @(TC_ind_dx … L1 H) -L1 /3 width=3 by inj/ qed-. -lemma s_r_to_s_rs_trans: ∀A,B,S,R. s_r_transitive A B (CTC … S) R → - s_rs_transitive A B S R. +lemma s_r_to_s_rs_trans (A) (B) (S) (R): + s_r_transitive A B (CTC … S) R → s_rs_transitive A B S R. #A #B #S #R #HSR #L2 #T1 #T2 #HL2 #L1 #HT1 elim (TC_idem … (S L1) … T1 T2) #_ #H @H @HSR // qed-. -lemma s_rs_to_s_r_trans: ∀A,B,S,R. s_rs_transitive A B S R → - s_r_transitive A B (CTC … S) R. +lemma s_rs_to_s_r_trans (A) (B) (S) (R): + s_rs_transitive A B S R → s_r_transitive A B (CTC … S) R. #A #B #S #R #HSR #L2 #T1 #T2 #HL2 #L1 #HT1 elim (TC_idem … (S L1) … T1 T2) #H #_ @H @HSR // qed-. -lemma s_rs_trans_TC1: ∀A,B,S,R. s_rs_transitive A B S R → - s_rs_transitive A B (CTC … S) R. +lemma s_rs_trans_TC1 (A) (B) (S) (R): + s_rs_transitive A B S R → s_rs_transitive A B (CTC … S) R. #A #B #S #R #HSR #L2 #T1 #T2 #HL2 #L1 #HT1 elim (TC_idem … (S L1) … T1 T2) elim (TC_idem … (S L2) … T1 T2) @@ -141,9 +154,10 @@ qed-. (* NOTE: Normal form and strong normalization *******************************) -lemma SN_to_NF: ∀A,R,S. NF_dec A R S → - ∀a1. SN A R S a1 → - ∃∃a2. star … R a1 a2 & NF A R S a2. +lemma SN_to_NF (A) (R) (S): + NF_dec A R S → + ∀a1. SN A R S a1 → + ∃∃a2. star … R a1 a2 & NF A R S a2. #A #R #S #HRS #a1 #H elim H -a1 #a1 #_ #IHa1 elim (HRS a1) -HRS /2 width=3 by srefl, ex2_intro/ * #a0 #Ha10 #Ha01 elim (IHa1 … Ha10 Ha01) -IHa1 -Ha01 /3 width=3 by star_compl, ex2_intro/ @@ -151,9 +165,10 @@ qed-. (* NOTE: Relations with unboxed pairs ***************************************) -lemma bi_TC_strip: ∀A,B,R. bi_confluent A B R → - ∀a0,a1,b0,b1. R a0 b0 a1 b1 → ∀a2,b2. bi_TC … R a0 b0 a2 b2 → - ∃∃a,b. bi_TC … R a1 b1 a b & R a2 b2 a b. +lemma bi_TC_strip (A) (B) (R): + bi_confluent A B R → + ∀a0,a1,b0,b1. R a0 b0 a1 b1 → ∀a2,b2. bi_TC … R a0 b0 a2 b2 → + ∃∃a,b. bi_TC … R a1 b1 a b & R a2 b2 a b. #A #B #R #HR #a0 #a1 #b0 #b1 #H01 #a2 #b2 #H elim H -a2 -b2 [ #a2 #b2 #H02 elim (HR … H01 … H02) -HR -a0 -b0 /3 width=4 by ex2_2_intro, bi_inj/ @@ -162,8 +177,8 @@ lemma bi_TC_strip: ∀A,B,R. bi_confluent A B R → ] qed. -lemma bi_TC_confluent: ∀A,B,R. bi_confluent A B R → - bi_confluent A B (bi_TC … R). +lemma bi_TC_confluent (A) (B) (R): + bi_confluent A B R → bi_confluent A B (bi_TC … R). #A #B #R #HR #a0 #a1 #b0 #b1 #H elim H -a1 -b1 [ #a1 #b1 #H01 #a2 #b2 #H02 elim (bi_TC_strip … HR … H01 … H02) -a0 -b0 /3 width=4 by ex2_2_intro, bi_inj/ @@ -173,17 +188,17 @@ lemma bi_TC_confluent: ∀A,B,R. bi_confluent A B R → ] qed. -lemma bi_TC_decomp_r: ∀A,B. ∀R:bi_relation A B. - ∀a1,a2,b1,b2. bi_TC … R a1 b1 a2 b2 → - R a1 b1 a2 b2 ∨ - ∃∃a,b. bi_TC … R a1 b1 a b & R a b a2 b2. +lemma bi_TC_decomp_r (A) (B) (R:bi_relation A B): + ∀a1,a2,b1,b2. bi_TC … R a1 b1 a2 b2 → + ∨∨ R a1 b1 a2 b2 + | ∃∃a,b. bi_TC … R a1 b1 a b & R a b a2 b2. #A #B #R #a1 #a2 #b1 #b2 * -a2 -b2 /2 width=1/ /3 width=4 by ex2_2_intro, or_intror/ qed-. -lemma bi_TC_decomp_l: ∀A,B. ∀R:bi_relation A B. - ∀a1,a2,b1,b2. bi_TC … R a1 b1 a2 b2 → - R a1 b1 a2 b2 ∨ - ∃∃a,b. R a1 b1 a b & bi_TC … R a b a2 b2. +lemma bi_TC_decomp_l (A) (B) (R:bi_relation A B): + ∀a1,a2,b1,b2. bi_TC … R a1 b1 a2 b2 → + ∨∨ R a1 b1 a2 b2 + | ∃∃a,b. R a1 b1 a b & bi_TC … R a b a2 b2. #A #B #R #a1 #a2 #b1 #b2 #H @(bi_TC_ind_dx … a1 b1 H) -a1 -b1 [ /2 width=1 by or_introl/ | #a1 #a #b1 #b #Hab1 #Hab2 #_ /3 width=4 by ex2_2_intro, or_intror/ (* * auto fails without #_ *) @@ -192,79 +207,87 @@ qed-. (* NOTE: Relations with unboxed triples *************************************) -definition tri_star: ∀A,B,C,R. tri_relation A B C ≝ - λA,B,C,R. tri_RC A B C (tri_TC … R). +definition tri_star (A) (B) (C) (R): + tri_relation A B C ≝ + tri_RC A B C (tri_TC … R). -lemma tri_star_tri_reflexive: ∀A,B,C,R. tri_reflexive A B C (tri_star … R). +lemma tri_star_tri_reflexive (A) (B) (C) (R): + tri_reflexive A B C (tri_star … R). /2 width=1 by/ qed. -lemma tri_TC_to_tri_star: ∀A,B,C,R,a1,b1,c1,a2,b2,c2. - tri_TC A B C R a1 b1 c1 a2 b2 c2 → - tri_star A B C R a1 b1 c1 a2 b2 c2. +lemma tri_TC_to_tri_star (A) (B) (C) (R): + ∀a1,b1,c1,a2,b2,c2. + tri_TC A B C R a1 b1 c1 a2 b2 c2 → tri_star A B C R a1 b1 c1 a2 b2 c2. /2 width=1 by or_introl/ qed. -lemma tri_R_to_tri_star: ∀A,B,C,R,a1,b1,c1,a2,b2,c2. - R a1 b1 c1 a2 b2 c2 → tri_star A B C R a1 b1 c1 a2 b2 c2. +lemma tri_R_to_tri_star (A) (B) (C) (R): + ∀a1,b1,c1,a2,b2,c2. + R a1 b1 c1 a2 b2 c2 → tri_star A B C R a1 b1 c1 a2 b2 c2. /3 width=1 by tri_TC_to_tri_star, tri_inj/ qed. -lemma tri_star_strap1: ∀A,B,C,R,a1,a,a2,b1,b,b2,c1,c,c2. - tri_star A B C R a1 b1 c1 a b c → - R a b c a2 b2 c2 → tri_star A B C R a1 b1 c1 a2 b2 c2. +lemma tri_star_strap1 (A) (B) (C) (R): + ∀a1,a,a2,b1,b,b2,c1,c,c2. + tri_star A B C R a1 b1 c1 a b c → + R a b c a2 b2 c2 → tri_star A B C R a1 b1 c1 a2 b2 c2. #A #B #C #R #a1 #a #a2 #b1 #b #b2 #c1 #c #c2 * [ /3 width=5 by tri_TC_to_tri_star, tri_step/ | * #H1 #H2 #H3 destruct /2 width=1 by tri_R_to_tri_star/ ] qed. -lemma tri_star_strap2: ∀A,B,C,R,a1,a,a2,b1,b,b2,c1,c,c2. R a1 b1 c1 a b c → - tri_star A B C R a b c a2 b2 c2 → - tri_star A B C R a1 b1 c1 a2 b2 c2. +lemma tri_star_strap2 (A) (B) (C) (R): + ∀a1,a,a2,b1,b,b2,c1,c,c2. + R a1 b1 c1 a b c → tri_star A B C R a b c a2 b2 c2 → + tri_star A B C R a1 b1 c1 a2 b2 c2. #A #B #C #R #a1 #a #a2 #b1 #b #b2 #c1 #c #c2 #H * [ /3 width=5 by tri_TC_to_tri_star, tri_TC_strap/ | * #H1 #H2 #H3 destruct /2 width=1 by tri_R_to_tri_star/ ] qed. -lemma tri_star_to_tri_TC_to_tri_TC: ∀A,B,C,R,a1,a,a2,b1,b,b2,c1,c,c2. - tri_star A B C R a1 b1 c1 a b c → - tri_TC A B C R a b c a2 b2 c2 → - tri_TC A B C R a1 b1 c1 a2 b2 c2. +lemma tri_star_to_tri_TC_to_tri_TC (A) (B) (C) (R): + ∀a1,a,a2,b1,b,b2,c1,c,c2. + tri_star A B C R a1 b1 c1 a b c → + tri_TC A B C R a b c a2 b2 c2 → tri_TC A B C R a1 b1 c1 a2 b2 c2. #A #B #C #R #a1 #a #a2 #b1 #b #b2 #c1 #c #c2 * [ /2 width=5 by tri_TC_transitive/ | * #H1 #H2 #H3 destruct /2 width=1 by/ ] qed. -lemma tri_TC_to_tri_star_to_tri_TC: ∀A,B,C,R,a1,a,a2,b1,b,b2,c1,c,c2. - tri_TC A B C R a1 b1 c1 a b c → - tri_star A B C R a b c a2 b2 c2 → - tri_TC A B C R a1 b1 c1 a2 b2 c2. +lemma tri_TC_to_tri_star_to_tri_TC (A) (B) (C) (R): + ∀a1,a,a2,b1,b,b2,c1,c,c2. + tri_TC A B C R a1 b1 c1 a b c → + tri_star A B C R a b c a2 b2 c2 → tri_TC A B C R a1 b1 c1 a2 b2 c2. #A #B #C #R #a1 #a #a2 #b1 #b #b2 #c1 #c #c2 #H * [ /2 width=5 by tri_TC_transitive/ | * #H1 #H2 #H3 destruct /2 width=1 by/ ] qed. -lemma tri_tansitive_tri_star: ∀A,B,C,R. tri_transitive A B C (tri_star … R). +lemma tri_tansitive_tri_star (A) (B) (C) (R): + tri_transitive A B C (tri_star … R). #A #B #C #R #a1 #a #b1 #b #c1 #c #H #a2 #b2 #c2 * [ /3 width=5 by tri_star_to_tri_TC_to_tri_TC, tri_TC_to_tri_star/ | * #H1 #H2 #H3 destruct /2 width=1 by/ ] qed. -lemma tri_star_ind: ∀A,B,C,R,a1,b1,c1. ∀P:relation3 A B C. P a1 b1 c1 → - (∀a,a2,b,b2,c,c2. tri_star … R a1 b1 c1 a b c → R a b c a2 b2 c2 → P a b c → P a2 b2 c2) → - ∀a2,b2,c2. tri_star … R a1 b1 c1 a2 b2 c2 → P a2 b2 c2. -#A #B #C #R #a1 #b1 #c1 #P #H #IH #a2 #b2 #c2 * +lemma tri_star_ind (A) (B) (C) (R): + ∀a1,b1,c1. ∀Q:relation3 A B C. Q a1 b1 c1 → + (∀a,a2,b,b2,c,c2. tri_star … R a1 b1 c1 a b c → R a b c a2 b2 c2 → Q a b c → Q a2 b2 c2) → + ∀a2,b2,c2. tri_star … R a1 b1 c1 a2 b2 c2 → Q a2 b2 c2. +#A #B #C #R #a1 #b1 #c1 #Q #H #IH #a2 #b2 #c2 * [ #H12 elim H12 -a2 -b2 -c2 /3 width=6 by tri_TC_to_tri_star/ | * #H1 #H2 #H3 destruct // ] qed-. -lemma tri_star_ind_dx: ∀A,B,C,R,a2,b2,c2. ∀P:relation3 A B C. P a2 b2 c2 → - (∀a1,a,b1,b,c1,c. R a1 b1 c1 a b c → tri_star … R a b c a2 b2 c2 → P a b c → P a1 b1 c1) → - ∀a1,b1,c1. tri_star … R a1 b1 c1 a2 b2 c2 → P a1 b1 c1. -#A #B #C #R #a2 #b2 #c2 #P #H #IH #a1 #b1 #c1 * +lemma tri_star_ind_dx (A) (B) (C) (R): + ∀a2,b2,c2. ∀Q:relation3 A B C. Q a2 b2 c2 → + (∀a1,a,b1,b,c1,c. R a1 b1 c1 a b c → tri_star … R a b c a2 b2 c2 → Q a b c → Q a1 b1 c1) → + ∀a1,b1,c1. tri_star … R a1 b1 c1 a2 b2 c2 → Q a1 b1 c1. +#A #B #C #R #a2 #b2 #c2 #Q #H #IH #a1 #b1 #c1 * [ #H12 @(tri_TC_ind_dx … a1 b1 c1 H12) -a1 -b1 -c1 /3 width=6 by tri_TC_to_tri_star/ | * #H1 #H2 #H3 destruct // ] diff --git a/matita/matita/contribs/lambdadelta/ground/lib/stream.ma b/matita/matita/contribs/lambdadelta/ground/lib/stream.ma index ff7a6c349..501daa031 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/stream.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/stream.ma @@ -27,7 +27,9 @@ interpretation (* Basic constructions ******************************************************) -lemma stream_rew (A) (t:stream A): match t with [ stream_cons a u ⇒ a ⨮ u ] = t. +(*** stream_rew *) +lemma stream_unfold (A) (t:stream A): + match t with [ stream_cons a u ⇒ a ⨮ u ] = t. #A * // qed. diff --git a/matita/matita/contribs/lambdadelta/ground/lib/stream_eq.ma b/matita/matita/contribs/lambdadelta/ground/lib/stream_eq.ma index 311930686..1e1320776 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/stream_eq.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/stream_eq.ma @@ -18,7 +18,8 @@ include "ground/lib/stream.ma". (* EXTENSIONAL EQUIVALENCE FOR STREAMS **************************************) coinductive stream_eq (A): relation (stream A) ≝ -| stream_eq_cons: ∀t1,t2,b1,b2. b1 = b2 → stream_eq A t1 t2 → stream_eq A (b1⨮t1) (b2⨮t2) +| stream_eq_cons (a1) (a2) (t1) (t2): + a1 = a2 → stream_eq A t1 t2 → stream_eq A (a1⨮t1) (a2⨮t2) . interpretation @@ -34,39 +35,30 @@ definition stream_eq_repl_back (A) (R:predicate …) ≝ definition stream_eq_repl_fwd (A) (R:predicate …) ≝ ∀t1. R t1 → ∀t2. t2 ≗{A} t1 → R t2. -(* Basic inversions *********************************************************) - -lemma stream_eq_inv_cons: ∀A,t1,t2. t1 ≗{A} t2 → - ∀u1,u2,a1,a2. a1⨮u1 = t1 → a2⨮u2 = t2 → - u1 ≗ u2 ∧ a1 = a2. -#A #t1 #t2 * -t1 -t2 -#t1 #t2 #b1 #b2 #Hb #Ht #u1 #u2 #a1 #a2 #H1 #H2 destruct /2 width=1 by conj/ -qed-. - (* Basic constructions ******************************************************) -corec lemma stream_eq_refl: ∀A. reflexive … (stream_eq A). -#A * #b #t @stream_eq_cons // +corec lemma stream_eq_refl (A:?): + reflexive … (stream_eq A). +* #a #t @stream_eq_cons // qed. -corec lemma stream_eq_sym: ∀A. symmetric … (stream_eq A). -#A #t1 #t2 * -t1 -t2 -#t1 #t2 #b1 #b2 #Hb #Ht @stream_eq_cons /2 width=1 by/ +corec lemma stream_eq_sym (A): + symmetric … (stream_eq A). +#t1 #t2 * -t1 -t2 +#a1 #a2 #t1 #t2 #Ha #Ht +@stream_eq_cons /2 width=1 by/ qed-. -lemma stream_eq_repl_sym: ∀A,R. stream_eq_repl_back A R → stream_eq_repl_fwd A R. +lemma stream_eq_repl_sym (A) (R): + stream_eq_repl_back A R → stream_eq_repl_fwd A R. /3 width=3 by stream_eq_sym/ qed-. -(* Main constructions *******************************************************) +(* Basic inversions *********************************************************) -corec theorem stream_eq_trans: ∀A. Transitive … (stream_eq A). -#A #t1 #t * -t1 -t -#t1 #t #b1 #b * #Ht1 * #b2 #t2 #H cases (stream_eq_inv_cons A … H) -H -b -/3 width=7 by stream_eq_cons/ +lemma stream_eq_inv_cons_bi (A): + ∀t1,t2. t1 ≗{A} t2 → + ∀u1,u2,b1,b2. b1⨮u1 = t1 → b2⨮u2 = t2 → + ∧∧ b1 = b2 & u1 ≗ u2. +#A #t1 #t2 * -t1 -t2 +#a1 #a2 #t1 #t2 #Ha #Ht #u1 #u2 #b1 #b2 #H1 #H2 destruct /2 width=1 by conj/ qed-. - -theorem stream_eq_canc_sn: ∀A,t,t1,t2. t ≗ t1 → t ≗ t2 → t1 ≗{A} t2. -/3 width=3 by stream_eq_trans, stream_eq_sym/ qed-. - -theorem stream_eq_canc_dx: ∀A,t,t1,t2. t1 ≗ t → t2 ≗ t → t1 ≗{A} t2. -/3 width=3 by stream_eq_trans, stream_eq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/lib/stream_eq_eq.ma b/matita/matita/contribs/lambdadelta/ground/lib/stream_eq_eq.ma new file mode 100644 index 000000000..33828dd95 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/lib/stream_eq_eq.ma @@ -0,0 +1,35 @@ +(**************************************************************************) +(* ___ *) +(* ||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/lib/stream_eq.ma". + +(* EXTENSIONAL EQUIVALENCE FOR STREAMS **************************************) + +(* Main constructions *******************************************************) + +corec theorem stream_eq_trans (A): + Transitive … (stream_eq A). +#t1 #t * -t1 -t +#a1 #a #t1 #t * #Ht1 * #a2 #t2 #H +cases (stream_eq_inv_cons_bi A … H) -H -a +/3 width=7 by stream_eq_cons/ +qed-. + +theorem stream_eq_canc_sn (A): + ∀t,t1,t2. t ≗ t1 → t ≗ t2 → t1 ≗{A} t2. +/3 width=3 by stream_eq_trans, stream_eq_sym/ qed-. + +theorem stream_eq_canc_dx (A): + ∀t,t1,t2. t1 ≗ t → t2 ≗ t → t1 ≗{A} t2. +/3 width=3 by stream_eq_trans, stream_eq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl.ma b/matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl.ma index 4a3640bae..5ddd583d1 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl.ma @@ -13,15 +13,17 @@ (**************************************************************************) include "ground/notation/functions/downspoon_2.ma". -include "ground/lib/stream_eq.ma". +include "ground/lib/stream.ma". (* HEAD AND TAIL FOR STREAMS ************************************************) -definition stream_hd (A:Type[0]): stream A → A ≝ - λt. match t with [ stream_cons a _ ⇒ a ]. +definition stream_hd (A:Type[0]): stream A → A. +#A * #a #_ @a +defined. -definition stream_tl (A:Type[0]): stream A → stream A ≝ - λt. match t with [ stream_cons _ t ⇒ t ]. +definition stream_tl (A:Type[0]): stream A → stream A. +#A * #_ #t @t +defined. interpretation "tail (streams)" @@ -37,7 +39,7 @@ lemma stream_tl_cons (A) (a) (t): t = ⫰{A}(a⨮t). // qed. -lemma eq_stream_split_hd_tl (A) (t): - stream_hd … t ⨮ ⫰t ≗{A} t. +lemma stream_split_tl (A) (t): + stream_hd A t ⨮ ⫰t = t. #A * // qed. diff --git a/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma b/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma index 9f34ba81d..185de605e 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma @@ -46,9 +46,3 @@ qed. lemma stream_tls_swap (A) (n) (t): (⫰*[n]⫰t) = ⫰*{A}[↑n]t. // qed. - -lemma stream_tls_eq_repl (A) (n): - stream_eq_repl A (λt1,t2. ⫰*[n] t1 ≗ ⫰*[n] t2). -#A #n @(nat_ind_succ … n) -n // -#n #IH * #n1 #t1 * #n2 #t2 #H elim (stream_eq_inv_cons … H) /2 width=7 by/ -qed. diff --git a/matita/matita/contribs/lambdadelta/ground/lib/stream_tls_eq.ma b/matita/matita/contribs/lambdadelta/ground/lib/stream_tls_eq.ma new file mode 100644 index 000000000..ee230d2b6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/lib/stream_tls_eq.ma @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/lib/stream_eq.ma". +include "ground/lib/stream_tls.ma". + +(* ITERATED TAIL FOR STREAMS ************************************************) + +(* Properties with stream_eq *) + +lemma stream_tls_eq_repl (A) (n): + stream_eq_repl A (λt1,t2. ⫰*[n] t1 ≗ ⫰*[n] t2). +#A #n @(nat_ind_succ … n) -n // +#n #IH * #n1 #t1 * #n2 #t2 #H +elim (stream_eq_inv_cons_bi … H) /2 width=7 by/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/circledE_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/circledE_1.ma index 669db2e7a..274a8c105 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/circledE_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/circledE_1.ma @@ -15,13 +15,13 @@ (* GROUND NOTATION **********************************************************) notation < "hvbox( Ⓔ )" - non associative with precedence 55 + non associative with precedence 75 for @{ 'CircledE $S }. notation > "hvbox( Ⓔ )" - non associative with precedence 55 + non associative with precedence 75 for @{ 'CircledE ? }. notation > "hvbox( Ⓔ{ term 46 C } )" - non associative with precedence 55 + non associative with precedence 75 for @{ 'CircledE $S }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/diamond_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/diamond_0.ma index 8199b1429..6c25a97c8 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/diamond_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/diamond_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "◊" - non associative with precedence 55 + non associative with precedence 75 for @{ 'Diamond }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/downarrow_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/downarrow_1.ma index 46000a861..6bc204a00 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/downarrow_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/downarrow_1.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ↓ term 70 T )" - non associative with precedence 70 +notation "hvbox( ↓ term 75 T )" + non associative with precedence 75 for @{ 'DownArrow $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoon_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoon_2.ma index 646685428..765c2c0c3 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoon_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoon_2.ma @@ -14,14 +14,14 @@ (* GROUND NOTATION **********************************************************) -notation < "hvbox( ⫰ term 46 a )" - non associative with precedence 46 +notation < "hvbox( ⫰ term 75 a )" + non associative with precedence 75 for @{ 'DownSpoon $S $a }. -notation > "hvbox( ⫰ term 46 a )" - non associative with precedence 46 +notation > "hvbox( ⫰ term 75 a )" + non associative with precedence 75 for @{ 'DownSpoon ? $a }. -notation > "hvbox( ⫰{ term 46 S } break term 46 a )" - non associative with precedence 46 +notation > "hvbox( ⫰{ term 46 S } break term 75 a )" + non associative with precedence 75 for @{ 'DownSpoon $S $a }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoonstar_3.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoonstar_3.ma index 0a57eea4e..5250539d1 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoonstar_3.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/downspoonstar_3.ma @@ -14,14 +14,14 @@ (* GROUND NOTATION **********************************************************) -notation < "hvbox( ⫰*[ break term 46 n ] break term 46 a )" - non associative with precedence 46 +notation < "hvbox( ⫰*[ break term 46 n ] break term 75 a )" + non associative with precedence 75 for @{ 'DownSpoonStar $S $n $a }. -notation > "hvbox( ⫰*[ break term 46 n ] break term 46 a )" - non associative with precedence 46 +notation > "hvbox( ⫰*[ break term 46 n ] break term 75 a )" + non associative with precedence 75 for @{ 'DownSpoonStar ? $n $a }. -notation > "hvbox( ⫰*{ term 46 S }[ break term 46 n ] break term 46 a )" - non associative with precedence 46 +notation > "hvbox( ⫰*{ term 46 S }[ break term 46 n ] break term 75 a )" + non associative with precedence 75 for @{ 'DownSpoonStar $S $n $a }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/droppred_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/droppred_1.ma index cb0d3c883..d4e0f0354 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/droppred_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/droppred_1.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ⫱ term 46 T )" - non associative with precedence 46 +notation "hvbox( ⫱ term 75 T )" + non associative with precedence 75 for @{ 'DropPred $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/droppreds_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/droppreds_2.ma index 7336f0cd0..86829e053 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/droppreds_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/droppreds_2.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ⫱ *[ term 46 n ] break term 46 T )" - non associative with precedence 46 +notation "hvbox( ⫱ *[ term 46 n ] break term 75 T )" + non associative with precedence 75 for @{ 'DropPreds $n $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/basic_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/element_b_2.ma similarity index 89% rename from matita/matita/contribs/lambdadelta/ground/notation/functions/basic_2.ma rename to matita/matita/contribs/lambdadelta/ground/notation/functions/element_b_2.ma index fddd6406b..679cab596 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/basic_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/element_b_2.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( 𝐁❨ term 46 l, break term 46 h ❩ )" - non associative with precedence 90 - for @{ 'Basic $l $h }. +notation "hvbox( 𝐛❨ term 46 d, break term 46 h ❩ )" + non associative with precedence 75 + for @{ 'ElementB $d $h }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/identity_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/element_i_0.ma similarity index 92% rename from matita/matita/contribs/lambdadelta/ground/notation/functions/identity_0.ma rename to matita/matita/contribs/lambdadelta/ground/notation/functions/element_i_0.ma index 97a04ef17..d3d8cdbf0 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/identity_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/element_i_0.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( 𝐈𝐝 )" - non associative with precedence 90 - for @{ 'Identity }. +notation "hvbox( 𝐢 )" + non associative with precedence 75 + for @{ 'ElementI }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/uniform_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/element_u_1.ma similarity index 90% rename from matita/matita/contribs/lambdadelta/ground/notation/functions/uniform_1.ma rename to matita/matita/contribs/lambdadelta/ground/notation/functions/element_u_1.ma index ad7877afe..48922bebb 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/uniform_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/element_u_1.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( 𝐔 ❨ break term 46 a ❩ )" - non associative with precedence 90 - for @{ 'Uniform $a }. +notation "hvbox( 𝐮 ❨ break term 46 a ❩ )" + non associative with precedence 75 + for @{ 'ElementU $a }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/exp_3.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/exp_3.ma index ea7f39835..42f56eadd 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/exp_3.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/exp_3.ma @@ -15,13 +15,13 @@ (* GROUND NOTATION **********************************************************) notation < "hvbox( f ^ break x )" - left associative with precedence 75 + left associative with precedence 65 for @{ 'Exp $X $f $x }. notation > "hvbox( f ^ break x )" - left associative with precedence 75 + left associative with precedence 65 for @{ 'Exp ? $f $x }. -notation > "hvbox( f ^{ break term 46 X } break term 75 x )" - non associative with precedence 75 +notation > "hvbox( f ^{ break term 46 X } break term 65 x )" + non associative with precedence 65 for @{ 'Exp $X $f $x }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/infinity_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/infinity_0.ma index 8a6a2eba9..733384f17 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/infinity_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/infinity_0.ma @@ -15,6 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "∞" - non associative with precedence 55 + non associative with precedence 75 for @{ 'Infinity }. - diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/no_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/no_0.ma index 25e0d34cb..ff366672e 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/no_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/no_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "Ⓕ" - non associative with precedence 55 + non associative with precedence 75 for @{'no}. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/one_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/one_0.ma index ba189fbb9..54fd7e8e7 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/one_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/one_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "𝟏" - non associative with precedence 55 + non associative with precedence 75 for @{ 'One }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/onezero_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/onezero_0.ma index 640ba879e..dcb2622ed 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/onezero_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/onezero_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "𝟙𝟘" - non associative with precedence 55 + non associative with precedence 75 for @{ 'OneZero }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/semicolon_3.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/semicolon_3.ma index ee874bc9f..2034b06d8 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/semicolon_3.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/semicolon_3.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "hvbox( ❨ term 46 hd1, break term 46 hd2 ❩; break term 46 tl )" - non associative with precedence 47 + non associative with precedence 75 for @{ 'Semicolon $hd1 $hd2 $tl }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/tuple_4.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/tuple_4.ma index 50b96096d..bf633f668 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/tuple_4.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/tuple_4.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "hvbox ( 〈 term 46 x1, break term 46 x2 , break term 46 x3, break term 46 x4 〉 )" - non associative with precedence 55 + non associative with precedence 75 for @{ 'Tuple $x1 $x2 $x3 $x4 }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/two_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/two_0.ma index 1f770896c..e2c957b8b 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/two_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/two_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "𝟐" - non associative with precedence 55 + non associative with precedence 75 for @{ 'Two }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrow_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrow_1.ma index cc3bb324b..759802da5 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrow_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrow_1.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ↑ term 70 T )" - non associative with precedence 70 +notation "hvbox( ↑ term 75 T )" + non associative with precedence 75 for @{ 'UpArrow $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrowstar_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrowstar_2.ma index 899beb264..c25f90ffa 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrowstar_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/uparrowstar_2.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ↑*[ term 46 n ] break term 70 T )" - non associative with precedence 70 +notation "hvbox( ↑*[ term 46 n ] break term 75 T )" + non associative with precedence 75 for @{ 'UpArrowStar $n $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/updownarrowstar_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/updownarrowstar_1.ma index 47b35d5d9..9c2d6625b 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/updownarrowstar_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/updownarrowstar_1.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ↕* term 46 T )" - non associative with precedence 46 +notation "hvbox( ↕* term 75 T )" + non associative with precedence 75 for @{ 'UpDownArrowStar $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoon_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoon_1.ma index 406f4a866..8299766a9 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoon_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoon_1.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ⫯ term 46 T )" - non associative with precedence 46 +notation "hvbox( ⫯ term 75 T )" + non associative with precedence 75 for @{ 'UpSpoon $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoonstar_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoonstar_2.ma index b3b50c643..31015e1bd 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoonstar_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/upspoonstar_2.ma @@ -14,6 +14,6 @@ (* GROUND NOTATION **********************************************************) -notation "hvbox( ⫯*[ term 46 n ] break term 46 T )" - non associative with precedence 46 +notation "hvbox( ⫯*[ term 46 n ] break term 75 T )" + non associative with precedence 75 for @{ 'UpSpoonStar $n $T }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/yes_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/yes_0.ma index 824475dcc..5b9480042 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/yes_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/yes_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "Ⓣ" - non associative with precedence 55 + non associative with precedence 75 for @{'yes}. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/zero_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/zero_0.ma index 50f6bb0db..a4dc1a442 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/zero_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/zero_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "𝟎" - non associative with precedence 55 + non associative with precedence 75 for @{ 'Zero }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/zeroone_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/zeroone_0.ma index a4fabaa47..1814c9bfa 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/zeroone_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/zeroone_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "𝟘𝟙" - non associative with precedence 55 + non associative with precedence 75 for @{ 'ZeroOne }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/zerozero_0.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/zerozero_0.ma index bf415b56a..957111fd2 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/functions/zerozero_0.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/functions/zerozero_0.ma @@ -15,5 +15,5 @@ (* GROUND NOTATION **********************************************************) notation "𝟘𝟘" - non associative with precedence 55 + non associative with precedence 75 for @{ 'ZeroZero }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/isfinite_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_f_1.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/isfinite_1.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_f_1.ma index a0bb366a2..458bc6dca 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/isfinite_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_f_1.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝐅❪ term 46 f ❫ )" non associative with precedence 45 - for @{ 'IsFinite $f }. + for @{ 'PredicateF $f }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/isidentity_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_i_1.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/isidentity_1.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_i_1.ma index 43fdded1b..78a5f35c9 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/isidentity_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_i_1.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝐈❪ term 46 f ❫ )" non associative with precedence 45 - for @{ 'IsIdentity $f }. + for @{ 'PredicateI $f }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/ism_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_m_2.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/ism_2.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_m_2.ma index 687c9e1d3..0063c04ac 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/ism_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_m_2.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝐌❪ term 46 n, break term 46 c ❫ )" non associative with precedence 45 - for @{ 'IsM $n $c }. + for @{ 'PredicateM $n $c }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/isdivergent_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_omega_1.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/isdivergent_1.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_omega_1.ma index 398b4dfb8..26a957a66 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/isdivergent_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_omega_1.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝛀❪ term 46 f ❫ )" non associative with precedence 45 - for @{ 'IsDivergent $f }. + for @{ 'PredicateOmega $f }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/ist_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_t_1.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/ist_1.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_t_1.ma index a0801cba7..d369bf780 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/ist_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_t_1.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝐓❪ term 46 f ❫ )" non associative with precedence 45 - for @{ 'IsT $f }. + for @{ 'PredicateT $f }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/ist_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_t_2.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/ist_2.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_t_2.ma index e337f5f29..36d416831 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/ist_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_t_2.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝐓❪ term 46 n, break term 46 c ❫ )" non associative with precedence 45 - for @{ 'IsT $n $c }. + for @{ 'PredicateT $n $c }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/isuniform_1.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_u_1.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/isuniform_1.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_u_1.ma index e0f081ca3..0c6bb46bd 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/isuniform_1.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/predicate_u_1.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝐔❪ term 46 f ❫ )" non associative with precedence 45 - for @{ 'IsUniform $f }. + for @{ 'PredicateU $f }. diff --git a/matita/matita/contribs/lambdadelta/ground/notation/relations/rcolength_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/relations/rfun_c_2.ma similarity index 97% rename from matita/matita/contribs/lambdadelta/ground/notation/relations/rcolength_2.ma rename to matita/matita/contribs/lambdadelta/ground/notation/relations/rfun_c_2.ma index 7a0a82148..9c931c379 100644 --- a/matita/matita/contribs/lambdadelta/ground/notation/relations/rcolength_2.ma +++ b/matita/matita/contribs/lambdadelta/ground/notation/relations/rfun_c_2.ma @@ -16,4 +16,4 @@ notation "hvbox( 𝐂❪ term 46 f ❫ ≘ break term 46 n )" non associative with precedence 45 - for @{ 'RCoLength $f $n }. + for @{ 'RFunC $f $n }. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/fr2_append.ma b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_append.ma new file mode 100644 index 000000000..184540728 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_append.ma @@ -0,0 +1,41 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/functions/append_2.ma". +include "ground/relocation/fr2_map.ma". + +(* APPEND FOR FINITE RELOCATION MAPS WITH PAIRS *******************************************) + +(* Note: this is compose *) +(*** fr2_append *) +rec definition fr2_append f1 f2 on f1 ≝ match f1 with +[ fr2_nil ⇒ f2 +| fr2_cons d h f1 ⇒ ❨d, h❩; fr2_append f1 f2 +]. + +interpretation + "append (finite relocation maps with pairs)" + 'Append f1 f2 = (fr2_append f1 f2). + +(* Basic properties *********************************************************) + +(*** mr2_append_nil *) +lemma fr2_append_nil (f2): + f2 = ◊ @@ f2. +// qed. + +(*** mr2_append_cons *) +lemma fr2_append_cons (d) (h) (f1) (f2): + ❨d, h❩; (f1 @@ f2) = (❨d, h❩; f1) @@ f2. +// qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/mr2.ma b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_map.ma similarity index 74% rename from matita/matita/contribs/lambdadelta/ground/relocation/mr2.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/fr2_map.ma index 6d3cb82d3..3de9abeb3 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/mr2.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_map.ma @@ -16,14 +16,19 @@ include "ground/notation/functions/diamond_0.ma". include "ground/notation/functions/semicolon_3.ma". include "ground/arith/nat.ma". -(* MULTIPLE RELOCATION WITH PAIRS *******************************************) +(* FINITE RELOCATION MAPS WITH PAIRS ****************************************) -inductive mr2: Type[0] := - | nil2 : mr2 - | cons2: nat → nat → mr2 → mr2. +(*** mr2 *) +inductive fr2_map: Type[0] := +(*** nil2 *) + | fr2_nil : fr2_map +(*** cons2 *) + | fr2_cons: nat → nat → fr2_map → fr2_map. -interpretation "nil (multiple relocation with pairs)" - 'Diamond = (nil2). +interpretation + "nil (finite relocation maps with pairs)" + 'Diamond = (fr2_nil). -interpretation "cons (multiple relocation with pairs)" - 'Semicolon hd1 hd2 tl = (cons2 hd1 hd2 tl). +interpretation + "cons (finite relocation maps with pairs)" + 'Semicolon d h f = (fr2_cons d h f). diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/fr2_minus.ma b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_minus.ma new file mode 100644 index 000000000..a97d13067 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_minus.ma @@ -0,0 +1,83 @@ +(**************************************************************************) +(* ___ *) +(* ||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_1.ma". +include "ground/notation/relations/rminus_3.ma". +include "ground/arith/nat_plus.ma". +include "ground/arith/nat_minus.ma". +include "ground/arith/nat_lt.ma". +include "ground/relocation/fr2_map.ma". + +(* RELATIONAL SUBTRACTION FOR FINITE RELOCATION MAPS WITH PAIRS *******************************************) + +(*** minuss *) +inductive fr2_minus: nat → relation fr2_map ≝ +(*** minuss_nil *) +| fr2_minus_nil (i): + fr2_minus i (◊) (◊) +(*** minuss_lt *) +| fr2_minus_lt (f1) (f2) (d) (h) (i): + i < d → fr2_minus i f1 f2 → fr2_minus i (❨d,h❩;f1) (❨d-i,h❩;f2) +(*** minuss_ge *) +| fr2_minus_ge (f1) (f2) (d) (h) (i): + d ≤ i → fr2_minus (h+i) f1 f2 → fr2_minus i (❨d,h❩;f1) f2 +. + +interpretation + "minus (finite relocation maps with pairs)" + 'RMinus f1 i f2 = (fr2_minus i f1 f2). + +(* Basic inversion lemmas ***************************************************) + +(*** minuss_inv_nil1 *) +lemma fr2_minus_inv_nil_sn (f2) (i): + ◊ ▭ i ≘ f2 → f2 = ◊. +#f2 #i @(insert_eq_1 … (◊)) +#f1 * -f1 -f2 -i +[ // +| #f1 #f2 #d #h #i #_ #_ #H destruct +| #f1 #f2 #d #h #i #_ #_ #H destruct +] +qed-. + +(*** minuss_inv_cons1 *) +lemma fr2_minus_inv_cons_sn (f1) (f2) (d) (h) (i): + ❨d, h❩;f1 ▭ i ≘ f2 → + ∨∨ ∧∧ d ≤ i & f1 ▭ h+i ≘ f2 + | ∃∃f. i < d & f1 ▭ i ≘ f & f2 = ❨d-i,h❩;f. +#g1 #f2 #d #h #i @(insert_eq_1 … (❨d,h❩;g1)) +#f1 * -f1 -f2 -i +[ #i #H destruct +| #f1 #f #d1 #h1 #i1 #Hid1 #Hf #H destruct /3 width=3 by ex3_intro, or_intror/ +| #f1 #f #d1 #h1 #i1 #Hdi1 #Hf #H destruct /3 width=1 by or_introl, conj/ +] +qed-. + +(*** minuss_inv_cons1_ge *) +lemma fr2_minus_inv_cons_sn_ge (f1) (f2) (d) (h) (i): + ❨d, h❩;f1 ▭ i ≘ f2 → d ≤ i → f1 ▭ h+i ≘ f2. +#f1 #f2 #d #h #i #H +elim (fr2_minus_inv_cons_sn … H) -H * // #f #Hid #_ #_ #Hdi +elim (nlt_ge_false … Hid Hdi) +qed-. + +(*** minuss_inv_cons1_lt *) +lemma fr2_minus_inv_cons_sn_lt (f1) (f2) (d) (h) (i): + ❨d, h❩;f1 ▭ i ≘ f2 → i < d → + ∃∃f. f1 ▭ i ≘ f & f2 = ❨d-i,h❩;f. +#f1 #f2 #d #h #i #H elim (fr2_minus_inv_cons_sn … H) -H * +[ #Hdi #_ #Hid elim (nlt_ge_false … Hid Hdi) +| /2 width=3 by ex2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat.ma b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat.ma new file mode 100644 index 000000000..d71dc8fb4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat.ma @@ -0,0 +1,79 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/rat_3.ma". +include "ground/arith/nat_plus.ma". +include "ground/arith/nat_lt.ma". +include "ground/relocation/fr2_map.ma". + +(* NON-NEGATIVE APPLICATION FOR FINITE RELOCATION MAPS WITH PAIRS *******************************************) + +(*** at *) +inductive fr2_nat: fr2_map → relation nat ≝ +(*** at_nil *) +| fr2_nat_nil (l): + fr2_nat (◊) l l +(*** at_lt *) +| fr2_nat_lt (f) (d) (h) (l1) (l2): + l1 < d → fr2_nat f l1 l2 → fr2_nat (❨d,h❩;f) l1 l2 +(*** at_ge *) +| fr2_nat_ge (f) (d) (h) (l1) (l2): + d ≤ l1 → fr2_nat f (l1 + h) l2 → fr2_nat (❨d,h❩;f) l1 l2 +. + +interpretation + "non-negative relational application (finite relocation maps with pairs)" + 'RAt l1 f l2 = (fr2_nat f l1 l2). + +(* Basic inversion lemmas ***************************************************) + +(*** at_inv_nil *) +lemma fr2_nat_inv_nil (l1) (l2): + @❪l1, ◊❫ ≘ l2 → l1 = l2. +#l1 #l2 @(insert_eq_1 … (◊)) +#f * -f -l1 -l2 +[ // +| #f #d #h #l1 #l2 #_ #_ #H destruct +| #f #d #h #l1 #l2 #_ #_ #H destruct +] +qed-. + +(*** at_inv_cons *) +lemma fr2_nat_inv_cons (f) (d) (h) (l1) (l2): + @❪l1, ❨d,h❩;f❫ ≘ l2 → + ∨∨ ∧∧ l1 < d & @❪l1, f❫ ≘ l2 + | ∧∧ d ≤ l1 & @❪l1+h, f❫ ≘ l2. +#g #d #h #l1 #l2 @(insert_eq_1 … (❨d, h❩;g)) +#f * -f -l1 -l2 +[ #l #H destruct +| #f1 #d1 #h1 #l1 #l2 #Hld1 #Hl12 #H destruct /3 width=1 by or_introl, conj/ +| #f1 #d1 #h1 #l1 #l2 #Hdl1 #Hl12 #H destruct /3 width=1 by or_intror, conj/ +] +qed-. + +(*** at_inv_cons *) +lemma fr2_nat_inv_cons_lt (f) (d) (h) (l1) (l2): + @❪l1, ❨d,h❩;f❫ ≘ l2 → l1 < d → @❪l1, f❫ ≘ l2. +#f #d #h #l1 #h2 #H +elim (fr2_nat_inv_cons … H) -H * // #Hdl1 #_ #Hl1d +elim (nlt_ge_false … Hl1d Hdl1) +qed-. + +(*** at_inv_cons *) +lemma fr2_nat_inv_cons_ge (f) (d) (h) (l1) (l2): + @❪l1, ❨d,h❩;f❫ ≘ l2 → d ≤ l1 → @❪l1+h, f❫ ≘ l2. +#f #d #h #l1 #h2 #H +elim (fr2_nat_inv_cons … H) -H * // #Hl1d #_ #Hdl1 +elim (nlt_ge_false … Hl1d Hdl1) +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat_nat.ma b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat_nat.ma new file mode 100644 index 000000000..1dd3cd9a6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_nat_nat.ma @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/fr2_nat.ma". + +(* NON-NEGATIVE APPLICATION FOR FINITE RELOCATION MAPS WITH PAIRS *******************************************) + +(* Main properties **********************************************************) + +(*** at_mono *) +theorem fr2_nat_mono (f) (l): + ∀l1. @❪l, f❫ ≘ l1 → ∀l2. @❪l, f❫ ≘ l2 → l1 = l2. +#f #l #l1 #H elim H -f -l -l1 +[ #l #x #H <(fr2_nat_inv_nil … H) -x // +| #f #d #h #l #l1 #Hld #_ #IH #x #H + lapply (fr2_nat_inv_cons_lt … H Hld) -H -Hld /2 width=1 by/ +| #f #d #h #l #l1 #Hdl #_ #IH #x #H + lapply (fr2_nat_inv_cons_ge … H Hdl) -H -Hdl /2 width=1 by/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/mr2_plus.ma b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_plus.ma similarity index 61% rename from matita/matita/contribs/lambdadelta/ground/relocation/mr2_plus.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/fr2_plus.ma index 29c76eb33..0297be7bd 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/mr2_plus.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/fr2_plus.ma @@ -13,35 +13,44 @@ (**************************************************************************) include "ground/arith/nat_minus_plus.ma". -include "ground/relocation/mr2.ma". +include "ground/relocation/fr2_map.ma". -(* MULTIPLE RELOCATION WITH PAIRS *******************************************) +(* ADDITION FOR FINITE RELOCATION MAPS WITH PAIRS ******************************) -rec definition pluss (cs:mr2) (i:nat) on cs ≝ match cs with -[ nil2 ⇒ ◊ -| cons2 l m cs ⇒ ❨l + i,m❩;pluss cs i +(* Note: this is pushs *) +(*** pluss *) +rec definition fr2_plus (f:fr2_map) (n:nat) on f ≝ match f with +[ fr2_nil ⇒ ◊ +| fr2_cons d h f ⇒ ❨d+n,h❩;fr2_plus f n ]. -interpretation "plus (multiple relocation with pairs)" - 'plus x y = (pluss x y). +interpretation + "plus (finite relocation maps with pairs)" + 'plus f n = (fr2_plus f n). (* Basic properties *********************************************************) -lemma pluss_SO2: ∀l,m,cs. ((❨l,m❩;cs) + 𝟏) = ❨↑l,m❩;cs + 𝟏. +(*** pluss_SO2 *) +lemma fr2_plus_cons_unit (d) (h) (f): + ((❨d,h❩;f)+𝟏) = ❨↑d,h❩;f+𝟏. normalize // qed. (* Basic inversion lemmas ***************************************************) -lemma pluss_inv_nil2: ∀i,cs. cs + i = ◊ → cs = ◊. -#i * // normalize -#l #m #cs #H destruct +(*** pluss_inv_nil2 *) +lemma fr2_plus_inv_nil_dx (n) (f): + f+n = ◊ → f = ◊. +#n * // normalize +#d #h #f #H destruct qed. -lemma pluss_inv_cons2: ∀i,l,m,cs2,cs. cs + i = ❨l,m❩;cs2 → - ∃∃cs1. cs1 + i = cs2 & cs = ❨l - i,m❩;cs1. -#i #l #m #cs2 * +(*** pluss_inv_cons2 *) +lemma fr2_plus_inv_cons_dx (n) (d) (h) (f2) (f): + f + n = ❨d,h❩;f2 → + ∃∃f1. f1+n = f2 & f = ❨d-n,h❩;f1. +#n #d #h #f2 * [ normalize #H destruct -| #l1 #m1 #cs1 whd in ⊢ (??%?→?); #H destruct +| #d1 #h1 #f1 whd in ⊢ (??%?→?); #H destruct (eq_inv_gr_push_bi … Hx1) >(eq_inv_gr_push_bi … Hx2) -x2 -x1 + /2 width=3 by ex2_intro/ +| #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct + elim (eq_inv_gr_push_next … Hx2) +| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct + elim (eq_inv_gr_push_next … Hx1) +] +qed-. + +(*** after_inv_pnx *) +lemma gr_after_inv_push_next: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → + ∃∃f. f1 ⊚ f2 ≘ f & ↑f = g. +#g1 #g2 #g * -g1 -g2 -g #f1 #f2 #f #g1 +[ #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct + elim (eq_inv_gr_next_push … Hx2) +| #g2 #g #Hf #H1 #H2 #H3 #x1 #x2 #Hx1 #Hx2 destruct + >(eq_inv_gr_push_bi … Hx1) >(eq_inv_gr_next_bi … Hx2) -x2 -x1 + /2 width=3 by ex2_intro/ +| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct + elim (eq_inv_gr_push_next … Hx1) +] +qed-. + +(*** after_inv_nxx *) +lemma gr_after_inv_next_sn: + ∀g1,f2,g. g1 ⊚ f2 ≘ g → ∀f1. ↑f1 = g1 → + ∃∃f. f1 ⊚ f2 ≘ f & ↑f = g. +#g1 #f2 #g * -g1 -f2 -g #f1 #f2 #f #g1 +[ #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct + elim (eq_inv_gr_next_push … Hx1) +| #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct + elim (eq_inv_gr_next_push … Hx1) +| #g #Hf #H1 #H #x1 #Hx1 destruct + >(eq_inv_gr_next_bi … Hx1) -x1 + /2 width=3 by ex2_intro/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** after_inv_ppp *) +lemma gr_after_inv_push_bi_push: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → f1 ⊚ f2 ≘ f. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (gr_after_inv_push_bi … Hg … H1 H2) -g1 -g2 +#x #Hf #Hx destruct <(eq_inv_gr_push_bi … Hx) -f // +qed-. + +(*** after_inv_ppn *) +lemma gr_after_inv_push_bi_next: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ↑f = g → ⊥. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (gr_after_inv_push_bi … Hg … H1 H2) -g1 -g2 +#x #Hf #Hx destruct elim (eq_inv_gr_push_next … Hx) +qed-. + +(*** after_inv_pnn *) +lemma gr_after_inv_push_next_next: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ⊚ f2 ≘ f. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (gr_after_inv_push_next … Hg … H1 H2) -g1 -g2 +#x #Hf #Hx destruct <(eq_inv_gr_next_bi … Hx) -f // +qed-. + +(*** after_inv_pnp *) +lemma gr_after_inv_push_next_push: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ⫯f = g → ⊥. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (gr_after_inv_push_next … Hg … H1 H2) -g1 -g2 +#x #Hf #Hx destruct elim (eq_inv_gr_next_push … Hx) +qed-. + +(*** after_inv_nxn *) +lemma gr_after_inv_next_sn_next: + ∀g1,f2,g. g1 ⊚ f2 ≘ g → + ∀f1,f. ↑f1 = g1 → ↑f = g → f1 ⊚ f2 ≘ f. +#g1 #f2 #g #Hg #f1 #f #H1 #H elim (gr_after_inv_next_sn … Hg … H1) -g1 +#x #Hf #Hx destruct <(eq_inv_gr_next_bi … Hx) -f // +qed-. + +(*** after_inv_nxp *) +lemma gr_after_inv_next_sn_push: + ∀g1,f2,g. g1 ⊚ f2 ≘ g → + ∀f1,f. ↑f1 = g1 → ⫯f = g → ⊥. +#g1 #f2 #g #Hg #f1 #f #H1 #H elim (gr_after_inv_next_sn … Hg … H1) -g1 +#x #Hf #Hx destruct elim (eq_inv_gr_next_push … Hx) +qed-. + +(*** after_inv_pxp *) +lemma gr_after_inv_push_sn_push: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → + ∀f1,f. ⫯f1 = g1 → ⫯f = g → + ∃∃f2. f1 ⊚ f2 ≘ f & ⫯f2 = g2. +#g1 #g2 elim (gr_map_split_tl g2) +#Hg2 #g #Hg #f1 #f #H1 #H +[ lapply (gr_after_inv_push_bi_push … Hg … H1 … H) -g1 -g + /2 width=3 by ex2_intro/ +| elim (gr_after_inv_push_next_push … Hg … H1 … H) -g1 -g -f1 -f // +] +qed-. + +(*** after_inv_pxn *) +lemma gr_after_inv_push_sn_next: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → + ∀f1,f. ⫯f1 = g1 → ↑f = g → + ∃∃f2. f1 ⊚ f2 ≘ f & ↑f2 = g2. +#g1 #g2 elim (gr_map_split_tl g2) +#Hg2 #g #Hg #f1 #f #H1 #H +[ elim (gr_after_inv_push_bi_next … Hg … H1 … H) -g1 -g -f1 -f // +| lapply (gr_after_inv_push_next_next … Hg … H1 … H) -g1 -g + /2 width=3 by ex2_intro/ +] +qed-. + +(*** after_inv_xxp *) +lemma gr_after_inv_push: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f. ⫯f = g → + ∃∃f1,f2. f1 ⊚ f2 ≘ f & ⫯f1 = g1 & ⫯f2 = g2. +#g1 elim (gr_map_split_tl g1) +#Hg1 #g2 #g #Hg #f #H +[ elim (gr_after_inv_push_sn_push … Hg … H) -g /2 width=5 by ex3_2_intro/ +| elim (gr_after_inv_next_sn_push … Hg … H) -g2 -g -f // +] +qed-. + +(*** after_inv_xxn *) +lemma gr_after_inv_next: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f. ↑f = g → + ∨∨ ∃∃f1,f2. f1 ⊚ f2 ≘ f & ⫯f1 = g1 & ↑f2 = g2 + | ∃∃f1. f1 ⊚ g2 ≘ f & ↑f1 = g1. +#g1 elim (gr_map_split_tl g1) +#Hg1 #g2 #g #Hg #f #H +[ elim (gr_after_inv_push_sn_next … Hg … H) -g + /3 width=5 by or_introl, ex3_2_intro/ +| /4 width=5 by gr_after_inv_next_sn_next, or_intror, ex2_intro/ +] +qed-. + +(*** after_inv_pxx *) +lemma gr_after_inv_push_sn: + ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f1. ⫯f1 = g1 → + ∨∨ ∃∃f2,f. f1 ⊚ f2 ≘ f & ⫯f2 = g2 & ⫯f = g + | ∃∃f2,f. f1 ⊚ f2 ≘ f & ↑f2 = g2 & ↑f = g. +#g1 #g2 elim (gr_map_split_tl g2) +#Hg2 #g #Hg #f1 #H +[ elim (gr_after_inv_push_bi … Hg … H) -g1 + /3 width=5 by or_introl, ex3_2_intro/ +| elim (gr_after_inv_push_next … Hg … H) -g1 + /3 width=5 by or_intror, ex3_2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after.ma new file mode 100644 index 000000000..7ee5239b1 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after.ma @@ -0,0 +1,90 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_after_eq.ma". + +(* RELATIONAL COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Main properties **********************************************************) + +(*** after_trans1 *) +corec theorem gr_after_trans_sn: + ∀f0,f3,f4. f0 ⊚ f3 ≘ f4 → + ∀f1,f2. f1 ⊚ f2 ≘ f0 → + ∀f. f2 ⊚ f3 ≘ f → f1 ⊚ f ≘ f4. +#f0 #f3 #f4 * -f0 -f3 -f4 #f0 #f3 #f4 #g0 [1,2: #g3 ] #g4 +[ #Hf4 #H0 #H3 #H4 #g1 #g2 #Hg0 #g #Hg + cases (gr_after_inv_push … Hg0 … H0) -g0 + #f1 #f2 #Hf0 #H1 #H2 + cases (gr_after_inv_push_bi … Hg … H2 H3) -g2 -g3 + #f #Hf #H /3 width=7 by gr_after_refl/ +| #Hf4 #H0 #H3 #H4 #g1 #g2 #Hg0 #g #Hg + cases (gr_after_inv_push … Hg0 … H0) -g0 + #f1 #f2 #Hf0 #H1 #H2 + cases (gr_after_inv_push_next … Hg … H2 H3) -g2 -g3 + #f #Hf #H /3 width=7 by gr_after_push/ +| #Hf4 #H0 #H4 #g1 #g2 #Hg0 #g #Hg + cases (gr_after_inv_next … Hg0 … H0) -g0 * + [ #f1 #f2 #Hf0 #H1 #H2 + cases (gr_after_inv_next_sn … Hg … H2) -g2 + #f #Hf #H /3 width=7 by gr_after_push/ + | #f1 #Hf0 #H1 /3 width=6 by gr_after_next/ + ] +] +qed-. + +(*** after_trans2 *) +corec theorem gr_after_trans_dx: + ∀f1,f0,f4. f1 ⊚ f0 ≘ f4 → + ∀f2, f3. f2 ⊚ f3 ≘ f0 → + ∀f. f1 ⊚ f2 ≘ f → f ⊚ f3 ≘ f4. +#f1 #f0 #f4 * -f1 -f0 -f4 #f1 #f0 #f4 #g1 [1,2: #g0 ] #g4 +[ #Hf4 #H1 #H0 #H4 #g2 #g3 #Hg0 #g #Hg + cases (gr_after_inv_push … Hg0 … H0) -g0 + #f2 #f3 #Hf0 #H2 #H3 + cases (gr_after_inv_push_bi … Hg … H1 H2) -g1 -g2 + #f #Hf #H /3 width=7 by gr_after_refl/ +| #Hf4 #H1 #H0 #H4 #g2 #g3 #Hg0 #g #Hg + cases (gr_after_inv_next … Hg0 … H0) -g0 * + [ #f2 #f3 #Hf0 #H2 #H3 + cases (gr_after_inv_push_bi … Hg … H1 H2) -g1 -g2 + #f #Hf #H /3 width=7 by gr_after_push/ + | #f2 #Hf0 #H2 + cases (gr_after_inv_push_next … Hg … H1 H2) -g1 -g2 + #f #Hf #H /3 width=6 by gr_after_next/ + ] +| #Hf4 #H1 #H4 #f2 #f3 #Hf0 #g #Hg + cases (gr_after_inv_next_sn … Hg … H1) -g1 + #f #Hg #H /3 width=6 by gr_after_next/ +] +qed-. + +(* Main inversion lemmas ****************************************************) + +(*** after_mono *) +corec theorem gr_after_mono: + ∀f1,f2,x,y. f1 ⊚ f2 ≘ x → f1 ⊚ f2 ≘ y → x ≡ y. +#f1 #f2 #x #y * -f1 -f2 -x +#f1 #f2 #x #g1 [1,2: #g2 ] #g #Hx #H1 [1,2: #H2 ] #H0x #Hy +[ cases (gr_after_inv_push_bi … Hy … H1 H2) -g1 -g2 /3 width=8 by gr_eq_push/ +| cases (gr_after_inv_push_next … Hy … H1 H2) -g1 -g2 /3 width=8 by gr_eq_next/ +| cases (gr_after_inv_next_sn … Hy … H1) -g1 /3 width=8 by gr_eq_next/ +] +qed-. + +(*** after_mono_eq *) +lemma gr_after_mono_eq: + ∀f1,f2,f. f1 ⊚ f2 ≘ f → ∀g1,g2,g. g1 ⊚ g2 ≘ g → + f1 ≡ g1 → f2 ≡ g2 → f ≡ g. +/4 width=4 by gr_after_mono, gr_after_eq_repl_back_dx, gr_after_eq_repl_back_sn/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after_ist.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after_ist.ma new file mode 100644 index 000000000..a3c13ff76 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after_ist.ma @@ -0,0 +1,63 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arith/nat_pred_succ.ma". +include "ground/relocation/gr_pat_tls.ma". +include "ground/relocation/gr_ist_tls.ma". +include "ground/relocation/gr_after_pat_tls.ma". + +(* RELATIONAL COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** H_after_inj *) +definition H_gr_after_inj: predicate gr_map ≝ + λf1. 𝐓❪f1❫ → + ∀f,f21,f22. f1 ⊚ f21 ≘ f → f1 ⊚ f22 ≘ f → f21 ≡ f22. + +(* Main forward lemmas on istot **************************************************) + +(*** after_inj_O_aux *) +corec fact gr_after_inj_unit_aux: + ∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_after_inj f1. +#f1 #H1f1 #H2f1 #f #f21 #f22 #H1f #H2f +cases (gr_pat_inv_unit_bi … H1f1) -H1f1 [|*: // ] #g1 #H1 +lapply (gr_ist_inv_push … H2f1 … H1) -H2f1 #H2g1 +cases (H2g1 (𝟏)) #p #Hp +cases (gr_after_inv_push_sn … H1f … H1) -H1f * #g21 #g #H1g #H21 #H +[ cases (gr_after_inv_push_sn_push … H2f … H1 H) -f1 -f #g22 #H2g #H22 + @(gr_eq_push … H21 H22) -f21 -f22 +| cases (gr_after_inv_push_sn_next … H2f … H1 H) -f1 -f #g22 #H2g #H22 + @(gr_eq_next … H21 H22) -f21 -f22 +] +@(gr_after_inj_unit_aux (⫱*[↓p]g1) … (⫱*[↓p]g)) -gr_after_inj_unit_aux +/2 width=1 by gr_after_tls_sn_tls, gr_ist_tls, gr_pat_unit_succ_tls/ +qed-. + +(*** after_inj_aux *) +fact gr_after_inj_aux: + (∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_after_inj f1) → + ∀i2,f1. @❪𝟏, f1❫ ≘ i2 → H_gr_after_inj f1. +#H0 #i2 elim i2 -i2 /2 width=1 by/ -H0 +#i2 #IH #f1 #H1f1 #H2f1 #f #f21 #f22 #H1f #H2f +elim (gr_pat_inv_unit_succ … H1f1) -H1f1 [|*: // ] #g1 #H1g1 #H1 +elim (gr_after_inv_next_sn … H1f … H1) -H1f #g #H1g #H +lapply (gr_after_inv_next_sn_next … H2f … H1 H) -f #H2g +/3 width=6 by gr_ist_inv_next/ +qed-. + +(*** after_inj *) +theorem gr_after_inj: + ∀f1. H_gr_after_inj f1. +#f1 #H cases (H (𝟏)) +/3 width=7 by gr_after_inj_aux, gr_after_inj_unit_aux/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_after.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_basic.ma similarity index 60% rename from matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_after.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/gr_after_basic.ma index 792fa995d..fa15b0d5a 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_after.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_after_basic.ma @@ -13,25 +13,26 @@ (**************************************************************************) include "ground/arith/nat_le_pred.ma". -include "ground/relocation/rtmap_after_uni.ma". -include "ground/relocation/rtmap_basic.ma". +include "ground/relocation/gr_basic.ma". +include "ground/relocation/gr_after_uni.ma". -(* RELOCATION MAP ***********************************************************) +(* RELATIONAL COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) -(* Properties with composition **********************************************) +(* Properties with gr_basic **********************************************) -lemma after_basic_rc (m2,m1): - m1 ≤ m2 → ∀n2,n1.m2 ≤ n1+m1 → 𝐁❨m2,n2❩ ⊚ 𝐁❨m1,n1❩ ≘ 𝐁❨m1,n1+n2❩. -#m2 #m1 @(nat_ind_2_succ … m2 m1) -m2 -m1 -[ #m1 #H #n2 #n1 #_ - <(nle_inv_zero_dx … H) -m1 // -| #m2 #IH #_ #n2 #n1 Hn1 -Hn1 Hh1 -Hh1 nsucc_inj + elim (gr_pat_inv_succ_dx … Hf2) -Hf2 [1,3: * |*: // ] + [ #g2 #j1 #Hg2 #H1 #H2 destruct >nsucc_inj in Hf; #Hf + elim (gr_after_inv_push_next … Hf) -Hf [ |*: // ] #g #Hg #H destruct + nsucc_inj #Hf + elim (gr_after_inv_next_sn … Hf) -Hf [2,3: // ] #g #Hg #H destruct + elim (gr_pat_inv_succ_dx … Hf2) -Hf2 [1,3: * |*: // ] + [ #g2 #j1 #Hg2 #H1 #H2 destruct gr_pushs_succ // +qed. + +(*** at_basic_zero_succ *) +lemma gr_basic_zero_succ (h): ↑𝐛❨𝟎,h❩ = 𝐛❨𝟎,↑h❩. +#h >gr_nexts_succ // +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter.ma new file mode 100644 index 000000000..8c730547f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter.ma @@ -0,0 +1,238 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/rcoafter_3.ma". +include "ground/xoa/ex_3_2.ma". +include "ground/relocation/gr_tl.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** coafter *) +coinductive gr_coafter: relation3 gr_map gr_map gr_map ≝ +(*** coafter_refl *) +| gr_coafter_refl (f1) (f2) (f) (g1) (g2) (g): + gr_coafter f1 f2 f → ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → gr_coafter g1 g2 g +(*** coafter_push *) +| gr_coafter_push (f1) (f2) (f) (g1) (g2) (g): + gr_coafter f1 f2 f → ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → gr_coafter g1 g2 g +(*** coafter_next *) +| gr_coafter_next (f1) (f2) (f) (g1) (g): + gr_coafter f1 f2 f → ↑f1 = g1 → ⫯f = g → gr_coafter g1 f2 g +. + +interpretation + "relational co-composition (generic relocation maps)" + 'RCoAfter f1 f2 f = (gr_coafter f1 f2 f). + +(* Basic inversion lemmas ***************************************************) + +(*** coafter_inv_ppx *) +lemma gr_coafter_inv_push_bi: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → + ∃∃f. f1 ~⊚ f2 ≘ f & ⫯f = g. +#g1 #g2 #g * -g1 -g2 -g #f1 #f2 #f #g1 +[ #g2 #g #Hf #H1 #H2 #H #x1 #x2 #Hx1 #Hx2 destruct + >(eq_inv_gr_push_bi … Hx1) >(eq_inv_gr_push_bi … Hx2) -x2 -x1 + /2 width=3 by ex2_intro/ +| #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct + elim (eq_inv_gr_push_next … Hx2) +| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct + elim (eq_inv_gr_push_next … Hx1) +] +qed-. + +(*** coafter_inv_pnx *) +lemma gr_coafter_inv_push_next: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → + ∃∃f. f1 ~⊚ f2 ≘ f & ↑f = g. +#g1 #g2 #g * -g1 -g2 -g #f1 #f2 #f #g1 +[ #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct + elim (eq_inv_gr_next_push … Hx2) +| #g2 #g #Hf #H1 #H2 #H3 #x1 #x2 #Hx1 #Hx2 destruct + >(eq_inv_gr_push_bi … Hx1) >(eq_inv_gr_next_bi … Hx2) -x2 -x1 + /2 width=3 by ex2_intro/ +| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct + elim (eq_inv_gr_push_next … Hx1) +] +qed-. + +(*** coafter_inv_nxx *) +lemma gr_coafter_inv_next_sn: + ∀g1,f2,g. g1 ~⊚ f2 ≘ g → ∀f1. ↑f1 = g1 → + ∃∃f. f1 ~⊚ f2 ≘ f & ⫯f = g. +#g1 #f2 #g * -g1 -f2 -g #f1 #f2 #f #g1 +[ #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct + elim (eq_inv_gr_next_push … Hx1) +| #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct + elim (eq_inv_gr_next_push … Hx1) +| #g #Hf #H1 #H #x1 #Hx1 destruct + >(eq_inv_gr_next_bi … Hx1) -x1 + /2 width=3 by ex2_intro/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** coafter_inv_ppp *) +lemma gr_coafter_inv_push_bi_push: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → f1 ~⊚ f2 ≘ f. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H +elim (gr_coafter_inv_push_bi … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct +<(eq_inv_gr_push_bi … Hx) -f // +qed-. + +(*** coafter_inv_ppn *) +lemma gr_coafter_inv_push_bi_next: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ↑f = g → ⊥. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H +elim (gr_coafter_inv_push_bi … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct +elim (eq_inv_gr_push_next … Hx) +qed-. + +(*** coafter_inv_pnn *) +lemma gr_coafter_inv_push_next_next: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ~⊚ f2 ≘ f. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H +elim (gr_coafter_inv_push_next … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct +<(eq_inv_gr_next_bi … Hx) -f // +qed-. + +(*** coafter_inv_pnp *) +lemma gr_coafter_inv_push_next_push: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ⫯f = g → ⊥. +#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H +elim (gr_coafter_inv_push_next … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct +elim (eq_inv_gr_next_push … Hx) +qed-. + +(*** coafter_inv_nxp *) +lemma gr_coafter_inv_next_sn_push: + ∀g1,f2,g. g1 ~⊚ f2 ≘ g → + ∀f1,f. ↑f1 = g1 → ⫯f = g → f1 ~⊚ f2 ≘ f. +#g1 #f2 #g #Hg #f1 #f #H1 #H +elim (gr_coafter_inv_next_sn … Hg … H1) -g1 #x #Hf #Hx destruct +<(eq_inv_gr_push_bi … Hx) -f // +qed-. + +(*** coafter_inv_nxn *) +lemma gr_coafter_inv_next_sn_next: + ∀g1,f2,g. g1 ~⊚ f2 ≘ g → + ∀f1,f. ↑f1 = g1 → ↑f = g → ⊥. +#g1 #f2 #g #Hg #f1 #f #H1 #H +elim (gr_coafter_inv_next_sn … Hg … H1) -g1 #x #Hf #Hx destruct +elim (eq_inv_gr_push_next … Hx) +qed-. + +(*** coafter_inv_pxp *) +lemma gr_coafter_inv_push_sn_push: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + ∀f1,f. ⫯f1 = g1 → ⫯f = g → + ∃∃f2. f1 ~⊚ f2 ≘ f & ⫯f2 = g2. +#g1 #g2 #g #Hg #f1 #f #H1 #H +elim (gr_map_split_tl g2) #H2 +[ lapply (gr_coafter_inv_push_bi_push … Hg … H1 H2 H) -g1 -g + /2 width=3 by ex2_intro/ +| elim (gr_coafter_inv_push_next_push … Hg … H1 H2 H) +] +qed-. + +(*** coafter_inv_pxn *) +lemma gr_coafter_inv_push_sn_next: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + ∀f1,f. ⫯f1 = g1 → ↑f = g → + ∃∃f2. f1 ~⊚ f2 ≘ f & ↑f2 = g2. +#g1 #g2 #g #Hg #f1 #f #H1 #H +elim (gr_map_split_tl g2) #H2 +[ elim (gr_coafter_inv_push_bi_next … Hg … H1 H2 H) +| lapply (gr_coafter_inv_push_next_next … Hg … H1 … H) -g1 -g + /2 width=3 by ex2_intro/ +] +qed-. + +(*** coafter_inv_xxn *) +lemma gr_coafter_inv_next: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f. ↑f = g → + ∃∃f1,f2. f1 ~⊚ f2 ≘ f & ⫯f1 = g1 & ↑f2 = g2. +#g1 #g2 #g #Hg #f #H +elim (gr_map_split_tl g1) #H1 +[ elim (gr_coafter_inv_push_sn_next … Hg … H1 H) -g + /2 width=5 by ex3_2_intro/ +| elim (gr_coafter_inv_next_sn_next … Hg … H1 H) +] +qed-. + +(*** coafter_inv_xnn *) +lemma gr_coafter_inv_next_dx_next: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + ∀f2,f. ↑f2 = g2 → ↑f = g → + ∃∃f1. f1 ~⊚ f2 ≘ f & ⫯f1 = g1. +#g1 #g2 #g #Hg #f2 #f #H2 destruct #H +elim (gr_coafter_inv_next … Hg … H) -g #z1 #z2 #Hf #H1 #H2 destruct +/2 width=3 by ex2_intro/ +qed-. + +(*** coafter_inv_xxp *) +lemma gr_coafter_inv_push: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f. ⫯f = g → + ∨∨ ∃∃f1,f2. f1 ~⊚ f2 ≘ f & ⫯f1 = g1 & ⫯f2 = g2 + | ∃∃f1. f1 ~⊚ g2 ≘ f & ↑f1 = g1. +#g1 #g2 #g #Hg #f #H +elim (gr_map_split_tl g1) #H1 +[ elim (gr_coafter_inv_push_sn_push … Hg … H1 H) -g + /3 width=5 by or_introl, ex3_2_intro/ +| /4 width=5 by gr_coafter_inv_next_sn_push, or_intror, ex2_intro/ +] +qed-. + +(*** coafter_inv_pxx *) +lemma gr_coafter_inv_push_sn: + ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f1. ⫯f1 = g1 → + ∨∨ ∃∃f2,f. f1 ~⊚ f2 ≘ f & ⫯f2 = g2 & ⫯f = g + | ∃∃f2,f. f1 ~⊚ f2 ≘ f & ↑f2 = g2 & ↑f = g. +#g1 #g2 #g #Hg #f1 #H1 +elim (gr_map_split_tl g2) #H2 +[ elim (gr_coafter_inv_push_bi … Hg … H1 H2) -g1 + /3 width=5 by or_introl, ex3_2_intro/ +| elim (gr_coafter_inv_push_next … Hg … H1 H2) -g1 + /3 width=5 by or_intror, ex3_2_intro/ +] +qed-. + +(* Inversion lemmas with tail ***********************************************) + +(*** coafter_inv_tl1 *) +lemma gr_coafter_inv_tl_dx: + ∀g2,g1,g. g2 ~⊚ ⫱g1 ≘ g → + ∃∃f. ⫯g2 ~⊚ g1 ≘ f & ⫱f = g. +#g2 #g1 #g +elim (gr_map_split_tl g1) #H1 #H2 +[ /3 width=7 by gr_coafter_refl, ex2_intro/ +| @(ex2_intro … (↑g)) /2 width=7 by gr_coafter_push/ (**) (* full auto fails *) +] +qed-. + +(*** coafter_inv_tl0 *) +lemma gr_coafter_inv_tl: + ∀g2,g1,g. g2 ~⊚ g1 ≘ ⫱g → + ∃∃f1. ⫯g2 ~⊚ f1 ≘ g & ⫱f1 = g1. +#g2 #g1 #g +elim (gr_map_split_tl g) #H1 #H2 +[ /3 width=7 by gr_coafter_refl, ex2_intro/ +| @(ex2_intro … (↑g1)) /2 width=7 by gr_coafter_push/ (**) (* full auto fails *) +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter.ma new file mode 100644 index 000000000..7bbc18f19 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter.ma @@ -0,0 +1,36 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_coafter_eq.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Main inversion lemmas ****************************************************) + +(*** coafter_mono *) +corec theorem gr_coafter_mono: + ∀f1,f2,x,y. f1 ~⊚ f2 ≘ x → f1 ~⊚ f2 ≘ y → x ≡ y. +#f1 #f2 #x #y * -f1 -f2 -x +#f1 #f2 #x #g1 [1,2: #g2 ] #g #Hx #H1 [1,2: #H2 ] #H0x #Hy +[ cases (gr_coafter_inv_push_bi … Hy … H1 H2) -g1 -g2 /3 width=8 by gr_eq_push/ +| cases (gr_coafter_inv_push_next … Hy … H1 H2) -g1 -g2 /3 width=8 by gr_eq_next/ +| cases (gr_coafter_inv_next_sn … Hy … H1) -g1 /3 width=8 by gr_eq_push/ +] +qed-. + +(*** coafter_mono_eq *) +lemma gr_coafter_mono_eq: + ∀f1,f2,f. f1 ~⊚ f2 ≘ f → ∀g1,g2,g. g1 ~⊚ g2 ≘ g → + f1 ≡ g1 → f2 ≡ g2 → f ≡ g. +/4 width=4 by gr_coafter_mono, gr_coafter_eq_repl_back_dx, gr_coafter_eq_repl_back_sn/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter_ist.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter_ist.ma new file mode 100644 index 000000000..7161e78f0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_coafter_ist.ma @@ -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/relocation/gr_pat_tls.ma". +include "ground/relocation/gr_ist_tls.ma". +include "ground/relocation/gr_coafter_nat_tls.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** H_coafter_inj *) +definition H_gr_coafter_inj: predicate gr_map ≝ + λf1. 𝐓❪f1❫ → + ∀f,f21,f22. f1 ~⊚ f21 ≘ f → f1 ~⊚ f22 ≘ f → f21 ≡ f22. + +(* Main Forward lemmas with istot ************************************************) + +(*** coafter_inj_O_aux *) +corec fact gr_coafter_inj_unit_aux: + ∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_coafter_inj f1. +#f1 #H1f1 #H2f1 #f #f21 #f22 #H1f #H2f +cases (gr_pat_inv_unit_bi … H1f1) -H1f1 [ |*: // ] #g1 #H1 +lapply (gr_ist_inv_push … H2f1 … H1) -H2f1 #H2g1 +cases (H2g1 (𝟏)) #n #Hn +cases (gr_coafter_inv_push_sn … H1f … H1) -H1f * #g21 #g #H1g #H21 #H +[ cases (gr_coafter_inv_push_sn_push … H2f … H1 H) -f1 -f #g22 #H2g #H22 + @(gr_eq_push … H21 H22) -f21 -f22 +| cases (gr_coafter_inv_push_sn_next … H2f … H1 H) -f1 -f #g22 #H2g #H22 + @(gr_eq_next … H21 H22) -f21 -f22 +] +@(gr_coafter_inj_unit_aux (⫱*[↓n]g1) … (⫱*[↓n]g)) -gr_coafter_inj_unit_aux +/2 width=1 by gr_coafter_tls_bi_tls, gr_ist_tls, gr_pat_unit_succ_tls/ +qed-. + +(*** coafter_inj_aux *) +fact gr_coafter_inj_aux: + (∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_coafter_inj f1) → + ∀i2,f1. @❪𝟏, f1❫ ≘ i2 → H_gr_coafter_inj f1. +#H0 #i2 elim i2 -i2 /2 width=1 by/ -H0 +#i2 #IH #f1 #H1f1 #H2f1 #f #f21 #f22 #H1f #H2f +elim (gr_pat_inv_unit_succ … H1f1) -H1f1 [ |*: // ] #g1 #H1g1 #H1 +elim (gr_coafter_inv_next_sn … H1f … H1) -H1f #g #H1g #H +lapply (gr_coafter_inv_next_sn_push … H2f … H1 H) -f #H2g +/3 width=6 by gr_ist_inv_next/ +qed-. + +(*** coafter_inj *) +theorem gr_coafter_inj: + ∀f1. H_gr_coafter_inj f1. +#f1 #H cases (H (𝟏)) /3 width=7 by gr_coafter_inj_aux, gr_coafter_inj_unit_aux/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_eq.ma new file mode 100644 index 000000000..bf0e47d4d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_eq.ma @@ -0,0 +1,71 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl_eq.ma". +include "ground/relocation/gr_coafter.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *) + +(*** coafter_eq_repl_back2 *) +corec lemma gr_coafter_eq_repl_back_sn: + ∀f1,f. gr_eq_repl_back (λf2. f2 ~⊚ f1 ≘ f). +#f1 #f #f2 * -f2 -f1 -f +#f21 #f1 #f #g21 [1,2: #g1 ] #g #Hf #H21 [1,2: #H1 ] #H #g22 #H0 +[ cases (gr_eq_inv_push_sn … H0 … H21) -g21 /3 width=7 by gr_coafter_refl/ +| cases (gr_eq_inv_push_sn … H0 … H21) -g21 /3 width=7 by gr_coafter_push/ +| cases (gr_eq_inv_next_sn … H0 … H21) -g21 /3 width=5 by gr_coafter_next/ +] +qed-. + +(*** coafter_eq_repl_fwd2 *) +lemma gr_coafter_eq_repl_fwd_sn: + ∀f1,f. gr_eq_repl_fwd (λf2. f2 ~⊚ f1 ≘ f). +#f1 #f @gr_eq_repl_sym /2 width=3 by gr_coafter_eq_repl_back_sn/ +qed-. + +(*** coafter_eq_repl_back1 *) +corec lemma gr_coafter_eq_repl_back_dx: + ∀f2,f. gr_eq_repl_back (λf1. f2 ~⊚ f1 ≘ f). +#f2 #f #f1 * -f2 -f1 -f +#f2 #f11 #f #g2 [1,2: #g11 ] #g #Hf #H2 [1,2: #H11 ] #H #g2 #H0 +[ cases (gr_eq_inv_push_sn … H0 … H11) -g11 /3 width=7 by gr_coafter_refl/ +| cases (gr_eq_inv_next_sn … H0 … H11) -g11 /3 width=7 by gr_coafter_push/ +| @(gr_coafter_next … H2 H) /2 width=5 by/ +] +qed-. + +(*** coafter_eq_repl_fwd1 *) +lemma gr_coafter_eq_repl_fwd_dx: + ∀f2,f. gr_eq_repl_fwd (λf1. f2 ~⊚ f1 ≘ f). +#f2 #f @gr_eq_repl_sym /2 width=3 by gr_coafter_eq_repl_back_dx/ +qed-. + +(*** coafter_eq_repl_back0 *) +corec lemma gr_coafter_eq_repl_back: + ∀f1,f2. gr_eq_repl_back (λf. f2 ~⊚ f1 ≘ f). +#f2 #f1 #f * -f2 -f1 -f +#f2 #f1 #f01 #g2 [1,2: #g1 ] #g01 #Hf01 #H2 [1,2: #H1 ] #H01 #g02 #H0 +[ cases (gr_eq_inv_push_sn … H0 … H01) -g01 /3 width=7 by gr_coafter_refl/ +| cases (gr_eq_inv_next_sn … H0 … H01) -g01 /3 width=7 by gr_coafter_push/ +| cases (gr_eq_inv_push_sn … H0 … H01) -g01 /3 width=5 by gr_coafter_next/ +] +qed-. + +(*** coafter_eq_repl_fwd0 *) +lemma gr_coafter_eq_repl_fwd: + ∀f2,f1. gr_eq_repl_fwd (λf. f2 ~⊚ f1 ≘ f). +#f2 #f1 @gr_eq_repl_sym /2 width=3 by gr_coafter_eq_repl_back/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isi.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isi.ma new file mode 100644 index 000000000..94b080c5c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isi.ma @@ -0,0 +1,50 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi_id.ma". +include "ground/relocation/gr_coafter_coafter.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with test for identity ****************************************) + +(*** coafter_isid_sn *) +corec lemma gr_coafter_isi_sn: + ∀f1. 𝐈❪f1❫ → ∀f2. f1 ~⊚ f2 ≘ f2. +#f1 * -f1 #f1 #g1 #Hf1 #H1 #f2 +cases (gr_map_split_tl f2) #H2 +/3 width=7 by gr_coafter_push, gr_coafter_refl/ +qed. + +(*** coafter_isid_dx *) +corec lemma gr_coafter_isi_dx: + ∀f2,f. 𝐈❪f2❫ → 𝐈❪f❫ → ∀f1. f1 ~⊚ f2 ≘ f. +#f2 #f * -f2 #f2 #g2 #Hf2 #H2 * -f #f #g #Hf #H #f1 +cases (gr_map_split_tl f1) #H1 +[ /3 width=7 by gr_coafter_refl/ +| @(gr_coafter_next … H1 … H) /3 width=3 by gr_isi_push/ +] +qed. + +(* Inversion lemmas with test for identity **********************************) + +(*** coafter_isid_inv_sn *) +lemma gr_coafter_isi_inv_sn: + ∀f1,f2,f. f1 ~⊚ f2 ≘ f → 𝐈❪f1❫ → f2 ≡ f. +/3 width=6 by gr_coafter_isi_sn, gr_coafter_mono/ qed-. + +(*** coafter_isid_inv_dx *) +lemma gr_coafter_isi_inv_dx: + ∀f1,f2,f. f1 ~⊚ f2 ≘ f → 𝐈❪f2❫ → 𝐈❪f❫. +/4 width=4 by gr_eq_id_isi, gr_coafter_isi_dx, gr_coafter_mono/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isf.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isf.ma new file mode 100644 index 000000000..ebd461dcf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isf.ma @@ -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/relocation/gr_pat_tls.ma". +include "ground/relocation/gr_isf_tls.ma". +include "ground/relocation/gr_ist_tls.ma". +include "ground/relocation/gr_coafter_nat_tls.ma". +include "ground/relocation/gr_coafter_isi.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** H_coafter_isfin2_fwd *) +definition H_gr_coafter_des_ist_isf: predicate gr_map ≝ + λf1. ∀f2. 𝐅❪f2❫ → 𝐓❪f1❫ → ∀f. f1 ~⊚ f2 ≘ f → 𝐅❪f❫. + +(* Forward lemmas with ist and isf *) + +(*** coafter_isfin2_fwd_O_aux *) +fact gr_coafter_des_ist_isf_unit_aux: + ∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_coafter_des_ist_isf f1. +#f1 #Hf1 #f2 #H +generalize in match Hf1; generalize in match f1; -f1 +@(gr_isf_ind … H) -f2 +[ /3 width=4 by gr_coafter_isi_inv_dx, gr_isf_isi/ ] +#f2 #_ #IH #f1 #H #Hf1 #f #Hf +elim (gr_pat_inv_unit_bi … H) -H [ |*: // ] #g1 #H1 +lapply (gr_ist_inv_push … Hf1 … H1) -Hf1 #Hg1 +elim (Hg1 (𝟏)) #n #Hn +[ elim (gr_coafter_inv_push_bi … Hf) | elim (gr_coafter_inv_push_next … Hf) +] -Hf [1,6: |*: // ] #g #Hg #H0 destruct +/5 width=6 by gr_isf_next, gr_isf_push, gr_isf_inv_tls, gr_ist_tls, gr_pat_unit_succ_tls, gr_coafter_tls_sn_tls/ +qed-. + +(*** coafter_isfin2_fwd_aux *) +fact gr_coafter_des_ist_isf_aux: + (∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_coafter_des_ist_isf f1) → + ∀i2,f1. @❪𝟏, f1❫ ≘ i2 → H_gr_coafter_des_ist_isf f1. +#H0 #i2 elim i2 -i2 /2 width=1 by/ -H0 +#i2 #IH #f1 #H1f1 #f2 #Hf2 #H2f1 #f #Hf +elim (gr_pat_inv_unit_succ … H1f1) -H1f1 [ |*: // ] #g1 #Hg1 #H1 +elim (gr_coafter_inv_next_sn … Hf … H1) -Hf #g #Hg #H0 +lapply (IH … Hg1 … Hg) -i2 -Hg +/2 width=4 by gr_ist_inv_next, gr_isf_push/ (**) (* full auto fails *) +qed-. + +(*** coafter_isfin2_fwd *) +lemma gr_coafter_des_ist_isf: ∀f1. H_gr_coafter_des_ist_isf f1. +#f1 #f2 #Hf2 #Hf1 cases (Hf1 (𝟏)) +/3 width=7 by gr_coafter_des_ist_isf_aux, gr_coafter_des_ist_isf_unit_aux/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isi.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isi.ma new file mode 100644 index 000000000..871158d80 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_ist_isi.ma @@ -0,0 +1,59 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_pat_tls.ma". +include "ground/relocation/gr_isi_tls.ma". +include "ground/relocation/gr_ist_tls.ma". +include "ground/relocation/gr_coafter_nat_tls.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** H_coafter_fwd_isid2 *) +definition H_gr_coafter_des_ist_sn_isi: predicate gr_map ≝ + λf1. ∀f2,f. f1 ~⊚ f2 ≘ f → 𝐓❪f1❫ → 𝐈❪f❫ → 𝐈❪f2❫. + +(* Forward lemmas with ist and isi *) + +(*** coafter_fwd_isid2_O_aux *) +corec fact gr_coafter_des_ist_sn_isi_unit_aux: + ∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_coafter_des_ist_sn_isi f1. +#f1 #H1f1 #f2 #f #H #H2f1 #Hf +cases (gr_pat_inv_unit_bi … H1f1) -H1f1 [ |*: // ] #g1 #H1 +lapply (gr_ist_inv_push … H2f1 … H1) -H2f1 #H2g1 +cases (H2g1 (𝟏)) #n #Hn +cases (gr_coafter_inv_push_sn … H … H1) -H * #g2 #g #H #H2 #H0 +[ lapply (gr_isi_inv_push … Hf … H0) -Hf #Hg + @(gr_isi_push … H2) -H2 + /3 width=7 by gr_coafter_tls_sn_tls, gr_pat_unit_succ_tls, gr_ist_tls, gr_isi_tls/ +| cases (gr_isi_inv_next … Hf … H0) +] +qed-. + +(*** coafter_fwd_isid2_aux *) +fact gr_coafter_des_ist_sn_isi_aux: + (∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_coafter_des_ist_sn_isi f1) → + ∀i2,f1. @❪𝟏, f1❫ ≘ i2 → H_gr_coafter_des_ist_sn_isi f1. +#H0 #i2 elim i2 -i2 /2 width=1 by/ -H0 +#i2 #IH #f1 #H1f1 #f2 #f #H #H2f1 #Hf +elim (gr_pat_inv_unit_succ … H1f1) -H1f1 [ |*: // ] #g1 #Hg1 #H1 +elim (gr_coafter_inv_next_sn … H … H1) -H #g #Hg #H0 +@(IH … Hg1 … Hg) /2 width=3 by gr_ist_inv_next, gr_isi_inv_push/ (**) (* full auto fails *) +qed-. + +(*** coafter_fwd_isid2 *) +lemma gr_coafter_des_ist_sn_isi: + ∀f1. H_gr_coafter_des_ist_sn_isi f1. +#f1 #f2 #f #Hf #H cases (H (𝟏)) +/3 width=7 by gr_coafter_des_ist_sn_isi_aux, gr_coafter_des_ist_sn_isi_unit_aux/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isu.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isu.ma new file mode 100644 index 000000000..e74ed1854 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_isu.ma @@ -0,0 +1,29 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi_pushs.ma". +include "ground/relocation/gr_isu_uni.ma". +include "ground/relocation/gr_coafter_uni_pushs.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with test for uniform relocations and isi *****************************) + +(*** coafter_isuni_isid *) +lemma gr_coafter_isu_isi: + ∀f2. 𝐈❪f2❫ → ∀f1. 𝐔❪f1❫ → f1 ~⊚ f2 ≘ f2. +#f #Hf #g #H +elim (gr_isu_inv_uni … H) -H #n #H +/5 width=4 by gr_isi_pushs, gr_isi_inv_eq_repl, gr_coafter_eq_repl_back, gr_coafter_eq_repl_back_sn/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls.ma new file mode 100644 index 000000000..f297468f9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls.ma @@ -0,0 +1,45 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tls.ma". +include "ground/relocation/gr_nat.ma". +include "ground/relocation/gr_coafter.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with nat and iterated tail ********************************************) + +(*** coafter_tls *) +lemma gr_coafter_tls_bi_tls (n2) (n1): + ∀f1,f2,f. @↑❪n1, f1❫ ≘ n2 → + f1 ~⊚ f2 ≘ f → ⫱*[n2]f1 ~⊚ ⫱*[n1]f2 ≘ ⫱*[n2]f. +#n2 @(nat_ind_succ … n2) -n2 [ #n1 | #n2 #IH * [| #n1 ] ] #f1 #f2 #f #Hf1 #Hf +[ elim (gr_nat_inv_zero_dx … Hf1) -Hf1 [ |*: // ] #g1 #Hg1 #H1 destruct // +| elim (gr_nat_inv_zero_succ … Hf1) -Hf1 [ |*: // ] #g1 #Hg1 #H1 + elim (gr_coafter_inv_next_sn … Hf … H1) -Hf #g #Hg #H0 destruct + lapply (IH … Hg1 Hg) -IH -Hg1 -Hg // +| elim (gr_nat_inv_succ_dx … Hf1) -Hf1 [1,3: * |*: // ] #g1 [ #n1 ] #Hg1 [ #H ] #H1 + [ elim (gr_coafter_inv_push_sn … Hf … H1) -Hf * #g2 #g #Hg #H2 #H0 destruct + lapply (IH … Hg1 Hg) -IH -Hg1 -Hg #H // + | elim (gr_coafter_inv_next_sn … Hf … H1) -Hf #g #Hg #H0 destruct + lapply (IH … Hg1 Hg) -IH -Hg1 -Hg #H // + ] +] +qed. + +(*** coafter_tls_O *) +lemma gr_coafter_tls_sn_tls: + ∀n,f1,f2,f. @↑❪𝟎, f1❫ ≘ n → + f1 ~⊚ f2 ≘ f → ⫱*[n]f1 ~⊚ f2 ≘ ⫱*[n]f. +/2 width=1 by gr_coafter_tls_bi_tls/ qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls_pushs.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls_pushs.ma new file mode 100644 index 000000000..cc5d28489 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_nat_tls_pushs.ma @@ -0,0 +1,44 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_pushs.ma". +include "ground/relocation/gr_tls.ma". +include "ground/relocation/gr_nat.ma". +include "ground/relocation/gr_coafter.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Forward lemmas with nat and iterated tail and pushs ************************************************) + +(*** coafter_fwd_pushs *) +lemma gr_coafter_des_pushs_dx (n) (m): + ∀g2,f1,g. g2 ~⊚ ⫯*[m]f1 ≘ g → @↑❪m, g2❫ ≘ n → + ∃∃f. ⫱*[n]g2 ~⊚ f1 ≘ f & ⫯*[n] f = g. +#n @(nat_ind_succ … n) -n +[ #m #g2 #f1 #g #Hg #H + elim (gr_nat_inv_zero_dx … H) -H [|*: // ] #f2 #H1 #H2 destruct + /2 width=3 by ex2_intro/ +| #n #IH * [| #m ] #g2 #f1 #g #Hg #H + [ elim (gr_nat_inv_zero_succ … H) -H [|*: // ] #f2 #Hmn #H destruct + elim (gr_coafter_inv_next_sn … Hg) -Hg [|*: // ] #f #Hf #H destruct + elim (IH … Hf Hmn) -IH -Hf -Hmn /2 width=3 by ex2_intro/ + | elim (gr_nat_inv_succ_bi … H) -H [1,4: * |*: // ] #f2 #Hmn #H destruct + [ elim (gr_coafter_inv_push_bi … Hg) -Hg [|*: // ] #f #Hf #H destruct + elim (IH … Hf Hmn) -IH -Hf -Hmn /2 width=3 by ex2_intro/ + | elim (gr_coafter_inv_next_sn … Hg) -Hg [|*: // ] #f #Hf #H destruct + elim (IH … Hf Hmn) -IH -Hf -Hmn /2 width=3 by ex2_intro/ + ] + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_pat_tls.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_pat_tls.ma new file mode 100644 index 000000000..13f801e1c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_coafter_pat_tls.ma @@ -0,0 +1,59 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_pat_tls.ma". +include "ground/relocation/gr_coafter_nat_tls.ma". + +(* RELATIONAL CO-COMPOSITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with pat and iterated tail ********************************************) + +(* Note: this does not require ↑ first and second j *) +(*** coafter_tls_succ *) +lemma gr_coafter_tls_tl_tls: + ∀g2,g1,g. g2 ~⊚ g1 ≘ g → + ∀j. @❪𝟏, g2❫ ≘ j → ⫱*[j]g2 ~⊚ ⫱g1 ≘ ⫱*[j]g. +#g2 #g1 #g #Hg #j #Hg2 +lapply (gr_nat_pred_bi … Hg2) -Hg2 #Hg2 +lapply (gr_coafter_tls_bi_tls … Hg2 … Hg) -Hg #Hg +lapply (gr_pat_unit_succ_tls … Hg2) -Hg2 #H +elim (gr_pat_inv_unit_bi … H) -H [ |*: // ] #f2 #H2 +elim (gr_coafter_inv_push_sn … Hg … H2) -Hg * #f1 #f #Hf #H1 #H0 +>(npsucc_pred j) (eq_inv_gr_push_bi … H) -f // +| #g #m #_ #f #H elim (eq_inv_gr_push_next … H) +] +qed-. + +(*** fcla_inv_nx *) +lemma gr_fcla_inv_next (g) (m): 𝐂❪g❫ ≘ m → ∀f. ↑f = g → ∃∃n. 𝐂❪f❫ ≘ n & ↑n = m. +#g #m * -g -m +[ #g #Hg #f #H destruct + elim (gr_isi_inv_next … Hg) -Hg // +| #g #m #_ #f #H elim (eq_inv_gr_next_push … H) +| #g #m #Hg #f #H >(eq_inv_gr_next_bi … H) -f + /2 width=3 by ex2_intro/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** cla_inv_nn *) +lemma gr_cla_inv_next_succ (g) (m): 𝐂❪g❫ ≘ m → ∀f,n. ↑f = g → ↑n = m → 𝐂❪f❫ ≘ n. +#g #m #H #f #n #H1 #H2 elim (gr_fcla_inv_next … H … H1) -g +#x #Hf #H destruct <(eq_inv_nsucc_bi … H) -n // +qed-. + +(*** cla_inv_np *) +lemma gr_cla_inv_next_zero (g) (m): 𝐂❪g❫ ≘ m → ∀f. ↑f = g → 𝟎 = m → ⊥. +#g #m #H #f #H1 elim (gr_fcla_inv_next … H … H1) -g +#x #_ #H1 #H2 destruct /2 width=2 by eq_inv_zero_nsucc/ +qed-. + +(*** fcla_inv_xp *) +lemma gr_fcla_inv_zero (g) (m): 𝐂❪g❫ ≘ m → 𝟎 = m → 𝐈❪g❫. +#g #m #H elim H -g -m /3 width=3 by gr_isi_push/ +#g #m #_ #_ #H destruct elim (eq_inv_zero_nsucc … H) +qed-. + +(*** fcla_inv_isid *) +lemma gr_fcla_inv_isi (g) (m): 𝐂❪g❫ ≘ m → 𝐈❪g❫ → 𝟎 = m. +#f #n #H elim H -f -n /3 width=3 by gr_isi_inv_push/ +#f #n #_ #_ #H elim (gr_isi_inv_next … H) -H // +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_eq.ma new file mode 100644 index 000000000..59013d57a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_eq.ma @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi_eq.ma". +include "ground/relocation/gr_fcla.ma". + +(* FINITE COLENGTH ASSIGNMENT FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *********************************************************) + +(*** fcla_eq_repl_back *) +lemma gr_fcla_eq_repl_back (n): + gr_eq_repl_back … (λf. 𝐂❪f❫ ≘ n). +#n #f1 #H elim H -f1 -n /3 width=3 by gr_fcla_isi, gr_isi_eq_repl_back/ +#f1 #n #_ #IH #g2 #H [ elim (gr_eq_inv_push_sn … H) | elim (gr_eq_inv_next_sn … H) ] -H +/3 width=3 by gr_fcla_push, gr_fcla_next/ +qed-. + +(*** fcla_eq_repl_fwd *) +lemma fcla_eq_repl_fwd (n): + gr_eq_repl_fwd … (λf. 𝐂❪f❫ ≘ n). +#n @gr_eq_repl_sym /2 width=3 by gr_fcla_eq_repl_back/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_fcla.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_fcla.ma new file mode 100644 index 000000000..fe6098108 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_fcla.ma @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_fcla.ma". + +(* FINITE COLENGTH ASSIGNMENT FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Main forward lemmas ******************************************************) + +(*** fcla_mono *) +theorem gr_fcla_mono (f): + ∀n1. 𝐂❪f❫ ≘ n1 → ∀n2. 𝐂❪f❫ ≘ n2 → n1 = n2. +#f #n #H elim H -f -n +[ /2 width=3 by gr_fcla_inv_isi/ +| /3 width=3 by gr_fcla_inv_push/ +| #f #n1 #_ #IH #n2 #H elim (gr_fcla_inv_next … H) -H [2,3 : // ] + #g #Hf #H destruct >IH // +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_uni.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_uni.ma new file mode 100644 index 000000000..bbae04602 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_fcla_uni.ma @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi_uni.ma". +include "ground/relocation/gr_fcla.ma". + +(* FINITE COLENGTH ASSIGNMENT FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_uni ***************************) + +(*** fcla_uni *) +lemma gr_fcla_uni (n): 𝐂❪𝐮❨n❩❫ ≘ n. +#n @(nat_ind_succ … n) -n +/2 width=1 by gr_fcla_isi, gr_fcla_next/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_id.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_id.ma new file mode 100644 index 000000000..783215f49 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_id.ma @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/functions/element_i_0.ma". +include "ground/relocation/gr_map.ma". + +(* IDENTITY ELEMENT FOR GENERIC RELOCATION MAPS ******************************************************) + +(*** id *) +corec definition gr_id: gr_map ≝ ⫯gr_id. + +interpretation + "identity element (generic relocation streams)" + 'ElementI = (gr_id). + +(* Basic properties (specific) *********************************************************) + +(*** id_rew *) +lemma gr_id_unfold: ⫯𝐢 = 𝐢. +<(stream_unfold … (𝐢)) in ⊢ (???%); // +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_id_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_id_eq.ma new file mode 100644 index 000000000..00a4d3691 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_id_eq.ma @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl_eq.ma". +include "ground/relocation/gr_id.ma". + +(* IDENTITY ELEMENT FOR GENERIC RELOCATION MAPS ******************************************************) + +(* Properties with gr_eq *) + +corec lemma gr_id_eq (f): ⫯f ≡ f → 𝐢 ≡ f. +cases gr_id_unfold #Hf +cases (gr_eq_inv_push_sn … Hf) [|*: // ] #_ #H +cases H in Hf; -H #Hf +@gr_eq_push [3:|*: // ] +/3 width=5 by gr_eq_inv_push_bi/ +qed. + +(* Inversions with gr_eq *) + +(* Note: this has the same proof of the previous *) +corec lemma gr_id_inv_eq (f): 𝐢 ≡ f → ⫯f ≡ f. +cases gr_id_unfold #Hf +cases (gr_eq_inv_push_sn … Hf) [|*: // ] #_ #H +cases H in Hf; -H #Hf +@gr_eq_push [3:|*: // ] +/3 width=5 by gr_eq_inv_push_bi/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd.ma new file mode 100644 index 000000000..aa5404adb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd.ma @@ -0,0 +1,51 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/predicate_omega_1.ma". +include "ground/relocation/gr_map.ma". + +(* DIVERGENCE CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** isdiv *) +coinductive gr_isd: predicate gr_map ≝ +(*** isdiv_next *) +| gr_isd_next (f) (g): + gr_isd f → ↑f = g → gr_isd g +. + +interpretation + "divergence condition (generic relocation maps)" + 'PredicateOmega f = (gr_isd f). + +(* Basic inversion lemmas ***************************************************) + +(*** isdiv_inv_gen *) +lemma gr_isd_inv_gen (g): 𝛀❪g❫ → ∃∃f. 𝛀❪f❫ & ↑f = g. +#g * -g +#f #g #Hf * /2 width=3 by ex2_intro/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** isdiv_inv_next *) +lemma gr_isd_inv_next (g): 𝛀❪g❫ → ∀f. ↑f = g → 𝛀❪f❫. +#g #H elim (gr_isd_inv_gen … H) -H +#f #Hf * -g #g #H >(eq_inv_gr_next_bi … H) -H // +qed-. + +(*** isdiv_inv_push *) +lemma gr_isd_inv_push (g): 𝛀❪g❫ → ∀f. ⫯f = g → ⊥. +#g #H elim (gr_isd_inv_gen … H) -H +#f #Hf * -g #g #H elim (eq_inv_gr_push_next … H) +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_eq.ma new file mode 100644 index 000000000..9aeb37fce --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_eq.ma @@ -0,0 +1,57 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl_eq_eq.ma". +include "ground/relocation/gr_isd.ma". + +(* DIVERGENCE CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *********************************************************) + +(*** isdiv_eq_repl_back *) +corec lemma gr_isd_eq_repl_back: + gr_eq_repl_back … gr_isd. +#f1 #H cases (gr_isd_inv_gen … H) -H +#g1 #Hg1 #H1 #f2 #Hf cases (gr_eq_inv_next_sn … Hf … H1) -f1 +/3 width=3 by gr_isd_next/ +qed-. + +(*** isdiv_eq_repl_fwd *) +lemma gr_isd_eq_repl_fwd: + gr_eq_repl_fwd … gr_isd. +/3 width=3 by gr_isd_eq_repl_back, gr_eq_repl_sym/ qed-. + +(* Main inversion lemmas with gr_eq ***************) + +(*** isdiv_inv_eq_repl *) +corec theorem gr_isd_inv_eq_repl (g1) (g2): 𝛀❪g1❫ → 𝛀❪g2❫ → g1 ≡ g2. +#H1 #H2 +cases (gr_isd_inv_gen … H1) -H1 +cases (gr_isd_inv_gen … H2) -H2 +/3 width=5 by gr_eq_next/ +qed-. + +(* Alternative definition with gr_eq ***************************************************) + +(*** eq_next_isdiv *) +corec lemma gr_eq_next_isd (f): ↑f ≡ f → 𝛀❪f❫. +#H cases (gr_eq_inv_next_sn … H) -H +/4 width=3 by gr_isd_next, gr_eq_trans/ +qed. + +(*** eq_next_inv_isdiv *) +corec lemma gr_eq_next_inv_isd (g): 𝛀❪g❫ → ↑g ≡ g. +* -g #f #g #Hf * +/3 width=5 by gr_eq_next/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_nexts.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_nexts.ma new file mode 100644 index 000000000..71c39b335 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_nexts.ma @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_nexts.ma". +include "ground/relocation/gr_isd.ma". + +(* DIVERGENCE CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with iterated next ********************************************) + +(*** isdiv_nexts *) +lemma gr_isd_nexts (n) (f): 𝛀❪f❫ → 𝛀❪↑*[n]f❫. +#n @(nat_ind_succ … n) -n /3 width=3 by gr_isd_next/ +qed. + +(* Inversion lemmas with iterated next **************************************) + +(*** isdiv_inv_nexts *) +lemma gr_isd_inv_nexts (n) (g): 𝛀❪↑*[n]g❫ → 𝛀❪g❫. +#n @(nat_ind_succ … n) -n /3 width=3 by gr_isd_inv_next/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tl.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tl.ma new file mode 100644 index 000000000..cd5cc230e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tl.ma @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl.ma". +include "ground/relocation/gr_isd.ma". + +(* DIVERGENCE CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with tail *****************************************************) + +(*** isdiv_tl *) +lemma gr_isd_tl (f): 𝛀❪f❫ → 𝛀❪⫱f❫. +#f cases (gr_map_split_tl f) * #H +[ elim (gr_isd_inv_push … H) -H // +| /2 width=3 by gr_isd_inv_next/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tls.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tls.ma new file mode 100644 index 000000000..71375b463 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isd_tls.ma @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tls.ma". +include "ground/relocation/gr_isd_tl.ma". + +(* DIVERGENCE CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with iterated tail ********************************************) + +(*** isdiv_tls *) +lemma gr_isd_tls (n) (g): 𝛀❪g❫ → 𝛀❪⫱*[n]g❫. +#n @(nat_ind_succ … n) -n /3 width=1 by gr_isd_tl/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf.ma new file mode 100644 index 000000000..4a5c13534 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf.ma @@ -0,0 +1,67 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/predicate_f_1.ma". +include "ground/relocation/gr_fcla.ma". + +(* FINITE COLENGTH CONDITION FOR GENERIC RELOCATION MAPS *) + +(*** isfin *) +definition gr_isf: predicate gr_map ≝ + λf. ∃n. 𝐂❪f❫ ≘ n. + +interpretation + "finite colength condition (generic relocation maps)" + 'PredicateF f = (gr_isf f). + +(* Basic eliminators ********************************************************) + +(*** isfin_ind *) +lemma gr_isf_ind (Q:predicate …): + (∀f. 𝐈❪f❫ → Q f) → + (∀f. 𝐅❪f❫ → Q f → Q (⫯f)) → + (∀f. 𝐅❪f❫ → Q f → Q (↑f)) → + ∀f. 𝐅❪f❫ → Q f. +#Q #IH1 #IH2 #IH3 #f #H elim H -H +#n #H elim H -f -n /3 width=2 by ex_intro/ +qed-. + +(* Basic inversion lemmas ***************************************************) + +(*** isfin_inv_push *) +lemma gr_isf_inv_push (g): 𝐅❪g❫ → ∀f. ⫯f = g → 𝐅❪f❫. +#g * /3 width=4 by gr_fcla_inv_push, ex_intro/ +qed-. + +(*** isfin_inv_next *) +lemma gr_isf_inv_next (g): 𝐅❪g❫ → ∀f. ↑f = g → 𝐅❪f❫. +#g * #n #H #f #H0 elim (gr_fcla_inv_next … H … H0) -g +/2 width=2 by ex_intro/ +qed-. + +(* Basic properties *********************************************************) + +(*** isfin_isid *) +lemma gr_isf_isi (f): 𝐈❪f❫ → 𝐅❪f❫. +/3 width=2 by gr_fcla_isi, ex_intro/ qed. + +(*** isfin_push *) +lemma gr_isf_push (f): 𝐅❪f❫ → 𝐅❪⫯f❫. +#f * /3 width=2 by gr_fcla_push, ex_intro/ +qed. + +(*** isfin_next *) +lemma gr_isf_next (f): 𝐅❪f❫ → 𝐅❪↑f❫. +#f * /3 width=2 by gr_fcla_next, ex_intro/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_eq.ma new file mode 100644 index 000000000..123c59bd3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_eq.ma @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_fcla_eq.ma". +include "ground/relocation/gr_isf.ma". + +(* FINITE COLENGTH CONDITION FOR GENERIC RELOCATION MAPS *) + +(* Properties with gr_eq *) + +(*** isfin_eq_repl_back *) +lemma gr_isf_eq_repl_back: + gr_eq_repl_back … gr_isf. +#f1 * /3 width=4 by gr_fcla_eq_repl_back, ex_intro/ +qed-. + +(*** isfin_eq_repl_fwd *) +lemma gr_isf_eq_repl_fwd: gr_eq_repl_fwd … gr_isf. +/3 width=3 by gr_isf_eq_repl_back, gr_eq_repl_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_isu.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_isu.ma new file mode 100644 index 000000000..29a14f8b5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_isu.ma @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isu.ma". +include "ground/relocation/gr_isf.ma". + +(* FINITE COLENGTH CONDITION FOR GENERIC RELOCATION MAPS *) + +(* Properties with gr_isu *) + +(*** isuni_fwd_isfin *) +lemma gr_isf_isu (f): 𝐔❪f❫ → 𝐅❪f❫. +#f #H elim H -f +/3 width=1 by gr_isf_next, gr_isf_isi/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_pushs.ma similarity index 64% rename from matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_pushs.ma index f6671fa46..014d0b3a5 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_pushs.ma @@ -12,22 +12,21 @@ (* *) (**************************************************************************) -include "ground/notation/functions/basic_2.ma". -include "ground/relocation/rtmap_uni.ma". +include "ground/relocation/gr_pushs.ma". +include "ground/relocation/gr_isf.ma". -(* RELOCATION MAP ***********************************************************) +(* FINITE COLENGTH CONDITION FOR GENERIC RELOCATION MAPS *) -definition basic: nat → nat → rtmap ≝ λm,n. ⫯*[m] 𝐔❨n❩. +(* Properties with iterated push ********************************************) -interpretation "basic relocation (rtmap)" - 'Basic m n = (basic m n). - -(* Basic properties *********************************************************) - -lemma at_basic_succ_sn (m) (n): ⫯𝐁❨m,n❩ = 𝐁❨↑m,n❩. -#m #n >pushs_S // +(*** isfin_pushs *) +lemma gr_isf_pushs (n) (f): 𝐅❪f❫ → 𝐅❪⫯*[n]f❫. +#n @(nat_ind_succ … n) -n /3 width=3 by gr_isf_push/ qed. -lemma at_basic_zero_succ (n): ↑𝐁❨𝟎,n❩ = 𝐁❨𝟎,↑n❩. -#n >nexts_S // -qed. +(* Inversion lemmas with iterated push **************************************) + +(*** isfin_inv_pushs *) +lemma gr_isf_inv_pushs (n) (g): 𝐅❪⫯*[n]g❫ → 𝐅❪g❫. +#n @(nat_ind_succ … n) -n /3 width=3 by gr_isf_inv_push/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tl.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tl.ma new file mode 100644 index 000000000..da0992aa0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tl.ma @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl.ma". +include "ground/relocation/gr_isf.ma". + +(* FINITE COLENGTH CONDITION FOR GENERIC RELOCATION MAPS *) + +(* Properties with tail *****************************************************) + +(*** isfin_tl *) +lemma gr_isf_tl (f): 𝐅❪f❫ → 𝐅❪⫱f❫. +#f elim (gr_map_split_tl f) * #Hf +/3 width=3 by gr_isf_inv_push, gr_isf_inv_next/ +qed. + +(* Inversion lemmas with tail ***********************************************) + +(*** isfin_inv_tl *) +lemma gr_isf_inv_tl (g): 𝐅❪⫱g❫ → 𝐅❪g❫. +#f elim (gr_map_split_tl f) * #Hf +/2 width=1 by gr_isf_next, gr_isf_push/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tls.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tls.ma new file mode 100644 index 000000000..4f817a9a2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_tls.ma @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tls.ma". +include "ground/relocation/gr_isf_tl.ma". + +(* FINITE COLENGTH CONDITION FOR GENERIC RELOCATION MAPS *) + +(* Properties with iterated tail **************************************) + +lemma gr_isf_tls (n) (f): 𝐅❪f❫ → 𝐅❪⫱*[n]f❫. +#n @(nat_ind_succ … n) -n /3 width=1 by gr_isf_tl/ +qed. + +(* Inversion lemmas with iterated tail **************************************) + +(*** isfin_inv_tls *) +lemma gr_isf_inv_tls (n) (g): 𝐅❪⫱*[n]g❫ → 𝐅❪g❫. +#n @(nat_ind_succ … n) -n /3 width=1 by gr_isf_inv_tl/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_uni.ma similarity index 77% rename from matita/matita/contribs/lambdadelta/ground/relocation/rtmap.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_uni.ma index 23cf0d46d..a74076620 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isf_uni.ma @@ -12,10 +12,13 @@ (* *) (**************************************************************************) -include "ground/relocation/pstream.ma". +include "ground/relocation/gr_fcla_uni.ma". +include "ground/relocation/gr_isf.ma". -(* RELOCATION MAP ***********************************************************) +(* FINITE COLENGTH CONDITION FOR GENERIC RELOCATION MAPS *) -lemma pn_split: ∀f. (∃g. ⫯g = f) ∨ (∃g. ↑g = f). -@case_prop /3 width=2 by or_introl, or_intror, ex_intro/ -qed-. +(* Properties with gr_uni ***************************) + +(*** isfin_uni *) +lemma gr_isf_uni (n): 𝐅❪𝐮❨n❩❫. +/3 width=2 by ex_intro/ qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi.ma new file mode 100644 index 000000000..464c72bc7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi.ma @@ -0,0 +1,54 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/predicate_i_1.ma". +include "ground/relocation/gr_map.ma". + +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** isid *) +coinductive gr_isi: predicate gr_map ≝ +(*** isid_push *) +| gr_isi_push (f) (g): + gr_isi f → ⫯f = g → gr_isi g +. + +interpretation + "identity condition (generic relocation maps)" + 'PredicateI f = (gr_isi f). + +(* Basic inversion lemmas ***************************************************) + +(*** isid_inv_gen *) +lemma gr_isi_inv_gen (g): 𝐈❪g❫ → ∃∃f. 𝐈❪f❫ & ⫯f = g. +#g * -g +#f #g #Hf /2 width=3 by ex2_intro/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** isid_inv_push *) +lemma gr_isi_inv_push (g): 𝐈❪g❫ → ∀f. ⫯f = g → 𝐈❪f❫. +#g #H +elim (gr_isi_inv_gen … H) -H #f #Hf +* -g #g #H +>(eq_inv_gr_push_bi … H) -H // +qed-. + +(*** isid_inv_next *) +lemma gr_isi_inv_next (g): 𝐈❪g❫ → ∀f. ↑f = g → ⊥. +#g #H +elim (gr_isi_inv_gen … H) -H #f #Hf +* -g #g #H elim (eq_inv_gr_next_push … H) +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_eq.ma new file mode 100644 index 000000000..fd631c333 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_eq.ma @@ -0,0 +1,58 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl_eq_eq.ma". +include "ground/relocation/gr_isi.ma". + +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *********************************************************) + +(*** isid_eq_repl_back *) +corec lemma gr_isi_eq_repl_back: + gr_eq_repl_back … gr_isi. +#f1 #H +cases (gr_isi_inv_gen … H) -H #g1 #Hg1 #H1 #f2 #Hf +cases (gr_eq_inv_push_sn … Hf … H1) -f1 +/3 width=3 by gr_isi_push/ +qed-. + +(*** isid_eq_repl_fwd *) +lemma gr_isi_eq_repl_fwd: + gr_eq_repl_fwd … gr_isi. +/3 width=3 by gr_isi_eq_repl_back, gr_eq_repl_sym/ qed-. + +(* Main inversion lemmas with gr_eq ****************************************************) + +(*** isid_inv_eq_repl *) +corec theorem gr_isi_inv_eq_repl (g1) (g2): 𝐈❪g1❫ → 𝐈❪g2❫ → g1 ≡ g2. +#H1 #H2 +cases (gr_isi_inv_gen … H1) -H1 +cases (gr_isi_inv_gen … H2) -H2 +/3 width=5 by gr_eq_push/ +qed-. + +(* Alternative definition with gr_eq ***************************************************) + +(*** eq_push_isid *) +corec lemma gr_eq_push_isi (f): ⫯f ≡ f → 𝐈❪f❫. +#H cases (gr_eq_inv_push_sn … H) -H +/4 width=3 by gr_isi_push, gr_eq_trans/ +qed. + +(*** eq_push_inv_isid *) +corec lemma gr_isi_inv_eq_push (g): 𝐈❪g❫ → ⫯g ≡ g. +* -g #f #g #Hf * +/3 width=5 by gr_eq_push/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_id.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_id.ma new file mode 100644 index 000000000..f2d1efe1e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_id.ma @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_id.ma". +include "ground/relocation/gr_isi_eq.ma". + +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_id *********************************************************) + +(*** id_isid *) +lemma gr_isi_id: 𝐈❪𝐢❫. +/2 width=1 by gr_eq_push_isi/ qed. + +(* Alternative definition with gr_id and gr_eq *******************************************) + +(*** eq_id_isid *) +lemma gr_eq_id_isi (f): 𝐢 ≡ f → 𝐈❪f❫. +/2 width=3 by gr_isi_eq_repl_back/ qed. + +(*** eq_id_inv_isid *) +lemma gr_isi_inv_eq_id (f): 𝐈❪f❫ → 𝐢 ≡ f. +/2 width=1 by gr_isi_inv_eq_repl/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pat.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pat.ma new file mode 100644 index 000000000..95b57f5ee --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pat.ma @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi_id.ma". +include "ground/relocation/gr_pat_pat_id.ma". + +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Advanced properties on isid **********************************************) + +(*** isid_at *) +lemma gr_isi_pat (f): (∀i. @❪i,f❫ ≘ i) → 𝐈❪f❫. +/3 width=1 by gr_eq_id_isi, gr_pat_inv_id/ +qed. + +(* Inversion lemmas on pat ****************************************) + +(*** isid_inv_at *) +lemma gr_isi_inv_pat (f) (i): 𝐈❪f❫ → @❪i,f❫ ≘ i. +/3 width=3 by gr_isi_inv_eq_id, gr_pat_id, gr_pat_eq_repl_back/ +qed-. + +(* Destructions with pat *) + +(*** isid_inv_at_mono *) +lemma gr_isi_pat_des (f) (i1) (i2): 𝐈❪f❫ → @❪i1,f❫ ≘ i2 → i1 = i2. +/4 width=3 by gr_isi_inv_eq_id, gr_pat_id_des, gr_pat_eq_repl_fwd/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pushs.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pushs.ma new file mode 100644 index 000000000..bf245e978 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_pushs.ma @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_pushs.ma". +include "ground/relocation/gr_isi.ma". + +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ******************************************************) + +(* Properties with gr_pushs *) + +(*** isid_pushs *) +lemma gr_isi_pushs (n) (f): 𝐈❪f❫ → 𝐈❪⫯*[n]f❫. +#n @(nat_ind_succ … n) -n /3 width=3 by gr_isi_push/ +qed. + +(* Inversion lemmas with iterated push **************************************) + +(*** isid_inv_pushs *) +lemma gr_isi_inv_pushs (n) (g): 𝐈❪⫯*[n]g❫ → 𝐈❪g❫. +#n @(nat_ind_succ … n) -n /3 width=3 by gr_isi_inv_push/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tl.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tl.ma new file mode 100644 index 000000000..4a80d36e4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tl.ma @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl.ma". +include "ground/relocation/gr_isi.ma". + +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with tail *****************************************************) + +(*** isid_tl *) +lemma gr_isi_tl (f): 𝐈❪f❫ → 𝐈❪⫱f❫. +#f cases (gr_map_split_tl f) * #H +[ /2 width=3 by gr_isi_inv_push/ +| elim (gr_isi_inv_next … H) -H // +] +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tls.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tls.ma new file mode 100644 index 000000000..a1cc29b90 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_tls.ma @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tls.ma". +include "ground/relocation/gr_isi_tl.ma". + +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with iterated tail ********************************************) + +(*** isid_tls *) +lemma gr_isi_tls (n) (f): 𝐈❪f❫ → 𝐈❪⫱*[n]f❫. +#n @(nat_ind_succ … n) -n /3 width=1 by gr_isi_tl/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_id.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_uni.ma similarity index 64% rename from matita/matita/contribs/lambdadelta/ground/relocation/rtmap_id.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_uni.ma index 2ab5b383e..34421d67a 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_id.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isi_uni.ma @@ -12,20 +12,19 @@ (* *) (**************************************************************************) -include "ground/relocation/pstream_id.ma". -include "ground/relocation/rtmap_isid.ma". +include "ground/relocation/gr_uni.ma". +include "ground/relocation/gr_isi_id.ma". -(* RELOCATION MAP ***********************************************************) +(* IDENTITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) -(* Basic properties *********************************************************) +(* Properties with test for identity ****************************************) -lemma id_isid: 𝐈❪𝐈𝐝❫. -/3 width=5 by eq_push_isid/ qed. +(*** uni_inv_isid uni_isi *) +lemma gr_uni_isi (f): 𝐮❨𝟎❩ ≡ f → 𝐈❪f❫. +/2 width=1 by gr_eq_id_isi/ qed. -(* Alternative definition of isid *******************************************) +(* Inversion lemmas with test for identity **********************************) -lemma eq_id_isid: ∀f. 𝐈𝐝 ≡ f → 𝐈❪f❫. -/2 width=3 by isid_eq_repl_back/ qed. - -lemma eq_id_inv_isid: ∀f. 𝐈❪f❫ → 𝐈𝐝 ≡ f. -/2 width=1 by isid_inv_eq_repl/ qed-. +(*** uni_isid isi_inv_uni *) +lemma gr_isi_inv_uni (f): 𝐈❪f❫ → 𝐮❨𝟎❩ ≡ f. +/2 width=1 by gr_isi_inv_eq_id/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist.ma new file mode 100644 index 000000000..c20743e1a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist.ma @@ -0,0 +1,48 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/predicate_t_1.ma". +include "ground/relocation/gr_pat.ma". + +(* TOTALITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** istot *) +definition gr_ist: predicate gr_map ≝ + λf. ∀i. ∃j. @❪i,f❫ ≘ j. + +interpretation + "totality condition (generic relocation maps)" + 'PredicateT f = (gr_ist f). + +(* Basic inversion lemmas ***************************************************) + +(*** istot_inv_push *) +lemma gr_ist_inv_push (g): 𝐓❪g❫ → ∀f. ⫯f = g → 𝐓❪f❫. +#g #Hg #f #H #i elim (Hg (↑i)) -Hg +#j #Hg elim (gr_pat_inv_succ_push … Hg … H) -Hg -H /2 width=3 by ex_intro/ +qed-. + +(*** istot_inv_next *) +lemma gr_ist_inv_next (g): 𝐓❪g❫ → ∀f. ↑f = g → 𝐓❪f❫. +#g #Hg #f #H #i elim (Hg i) -Hg +#j #Hg elim (gr_pat_inv_next … Hg … H) -Hg -H /2 width=2 by ex_intro/ +qed-. + +(* Properties on tl *********************************************************) + +(*** istot_tl *) +lemma gr_ist_tl (f): 𝐓❪f❫ → 𝐓❪⫱f❫. +#f cases (gr_map_split_tl f) * +/2 width=3 by gr_ist_inv_next, gr_ist_inv_push/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_isi.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_isi.ma new file mode 100644 index 000000000..593d63e79 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_isi.ma @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi_pat.ma". +include "ground/relocation/gr_ist.ma". + +(* TOTALITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Advanced properties on isid **********************************************) + +(*** isid_at_total *) +lemma gr_isi_pat_total: ∀f. 𝐓❪f❫ → (∀i1,i2. @❪i1,f❫ ≘ i2 → i1 = i2) → 𝐈❪f❫. +#f #H1f #H2f @gr_isi_pat +#i lapply (H1f i) -H1f * +#j #Hf >(H2f … Hf) in ⊢ (???%); -H2f // +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_ist.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_ist.ma new file mode 100644 index 000000000..f80e08496 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_ist.ma @@ -0,0 +1,68 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_eq.ma". +include "ground/relocation/gr_pat_lt.ma". +include "ground/relocation/gr_pat_pat.ma". +include "ground/relocation/gr_ist.ma". + +(* TOTALITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Advanced properties on at ************************************************) + +(*** at_dec *) +lemma gr_pat_dec (f) (i1) (i2): 𝐓❪f❫ → Decidable (@❪i1,f❫ ≘ i2). +#f #i1 #i2 #Hf lapply (Hf i1) -Hf * +#j2 #Hf elim (eq_pnat_dec i2 j2) +[ #H destruct /2 width=1 by or_introl/ +| /4 width=6 by gr_pat_mono, or_intror/ +] +qed-. + +(*** is_at_dec *) +lemma is_gr_pat_dec (f) (i2): 𝐓❪f❫ → Decidable (∃i1. @❪i1,f❫ ≘ i2). +#f #i2 #Hf +lapply (dec_plt (λi1.@❪i1,f❫ ≘ i2) … (↑i2)) [| * ] +[ /2 width=1 by gr_pat_dec/ +| * /3 width=2 by ex_intro, or_introl/ +| #H @or_intror * #i1 #Hi12 + /5 width=3 by gr_pat_increasing, plt_succ_dx, ex2_intro/ +] +qed-. + +(* Main forward lemmas on at ************************************************) + +(*** at_ext *) +corec theorem gr_eq_ext_pat (f1) (f2): 𝐓❪f1❫ → 𝐓❪f2❫ → + (∀i,i1,i2. @❪i,f1❫ ≘ i1 → @❪i,f2❫ ≘ i2 → i1 = i2) → + f1 ≡ f2. +cases (gr_map_split_tl f1) #H1 +cases (gr_map_split_tl f2) #H2 +#Hf1 #Hf2 #Hi +[ @(gr_eq_push … H1 H2) @gr_eq_ext_pat -gr_eq_ext_pat + [3:|*: /2 width=3 by gr_ist_inv_push/ ] -Hf1 -Hf2 #i #i1 #i2 #Hg1 #Hg2 + lapply (Hi (↑i) (↑i1) (↑i2) ??) /2 width=7 by gr_pat_push/ +| cases (Hf2 (𝟏)) -Hf1 -Hf2 -gr_eq_ext_pat + #j2 #Hf2 cases (gr_pat_increasing_strict … Hf2 … H2) -H2 + lapply (Hi (𝟏) (𝟏) j2 … Hf2) /2 width=2 by gr_pat_refl/ -Hi -Hf2 -H1 + #H2 #H cases (plt_ge_false … H) -H // +| cases (Hf1 (𝟏)) -Hf1 -Hf2 -gr_eq_ext_pat + #j1 #Hf1 cases (gr_pat_increasing_strict … Hf1 … H1) -H1 + lapply (Hi (𝟏) j1 (𝟏) Hf1 ?) /2 width=2 by gr_pat_refl/ -Hi -Hf1 -H2 + #H1 #H cases (plt_ge_false … H) -H // +| @(gr_eq_next … H1 H2) @gr_eq_ext_pat -gr_eq_ext_pat + [3:|*: /2 width=3 by gr_ist_inv_next/ ] -Hf1 -Hf2 #i #i1 #i2 #Hg1 #Hg2 + lapply (Hi i (↑i1) (↑i2) ??) /2 width=5 by gr_pat_next/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_tls.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_tls.ma new file mode 100644 index 000000000..1dcf5c5cf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_ist_tls.ma @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tls.ma". +include "ground/relocation/gr_ist.ma". + +(* TOTALITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties on tls ********************************************************) + +(*** istot_tls *) +lemma gr_ist_tls (n) (f): 𝐓❪f❫ → 𝐓❪⫱*[n]f❫. +#n @(nat_ind_succ … n) -n // +#n #IH #f #Hf (eq_inv_gr_next_bi … Hx) -x // +] +qed-. + +(* Basic forward lemmas *****************************************************) + +(*** isuni_fwd_push *) +lemma gr_isu_fwd_push (g): 𝐔❪g❫ → ∀f. ⫯f = g → 𝐔❪f❫. +/3 width=3 by gr_isu_inv_push, gr_isu_isi/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_tl.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_tl.ma new file mode 100644 index 000000000..a0cb8dbb9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_tl.ma @@ -0,0 +1,35 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl.ma". +include "ground/relocation/gr_isu.ma". + +(* UNIFORMITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with tail *****************************************************) + +lemma gr_isu_tl (f): 𝐔❪f❫ → 𝐔❪⫱f❫. +#f cases (gr_map_split_tl f) * #H +[ /3 width=3 by gr_isu_inv_push, gr_isu_isi/ +| /2 width=3 by gr_isu_inv_next/ +] +qed. + +(* Advanced inversion lemmas ***************************************************) + +(*** isuni_split *) +lemma gr_isu_split (g): 𝐔❪g❫ → ∨∨ (∃∃f. 𝐈❪f❫ & ⫯f = g) | (∃∃f.𝐔❪f❫ & ↑f = g). +#g elim (gr_map_split_tl g) * #H +/4 width=3 by gr_isu_inv_next, gr_isu_inv_push, or_introl, or_intror, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_uni.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_uni.ma new file mode 100644 index 000000000..e8b2c439a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_isu_uni.ma @@ -0,0 +1,51 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi_uni.ma". +include "ground/relocation/gr_isu.ma". + +(* UNIFORMITY CONDITION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_uni **************************************) + +(*** isuni_uni *) +lemma gr_isu_uni (n): 𝐔❪𝐮❨n❩❫. +#n @(nat_ind_succ … n) -n +/3 width=3 by gr_isu_isi, gr_isu_next/ +qed. + +(*** uni_inv_isuni *) +lemma gr_isu_eq_repl_back: + gr_eq_repl_back … gr_isu. +#f1 #H elim H -f1 +[ /3 width=3 by gr_isu_isi, gr_isi_eq_repl_back/ +| #f1 #_ #g1 * #IH #f2 #H -g1 + elim (gr_eq_inv_next_sn … H) -H + /3 width=3 by gr_isu_next/ +] +qed-. + +lemma gr_isu_eq_repl_fwd: + gr_eq_repl_fwd … gr_isu. +/3 width=3 by gr_isu_eq_repl_back, gr_eq_repl_sym/ qed-. + +(* Inversion lemmas with gr_uni ********************************) + +(*** uni_isuni *) +lemma gr_isu_inv_uni (f): 𝐔❪f❫ → ∃n. 𝐮❨n❩ ≡ f. +#f #H elim H -f +[ /3 width=2 by gr_isi_inv_uni, ex_intro/ +| #f #_ #g #H * /3 width=6 by gr_eq_next, ex_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_map.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_map.ma new file mode 100644 index 000000000..ac568e1f0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_map.ma @@ -0,0 +1,69 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/functions/upspoon_1.ma". +include "ground/notation/functions/uparrow_1.ma". +include "ground/lib/stream.ma". +include "ground/lib/bool.ma". + +(* GENERIC RELOCATION MAPS **************************************************) + +(*** rtmap *) +definition gr_map: Type[0] ≝ stream bool. + +(*** push *) +definition gr_push (f): gr_map ≝ Ⓕ⨮f. + +interpretation + "push (generic relocation maps)" + 'UpSpoon f = (gr_push f). + +(*** next *) +definition gr_next (f): gr_map ≝ Ⓣ⨮f. + +interpretation + "next (generic relocation maps)" + 'UpArrow f = (gr_next f). + +(* Basic properties (specific) **********************************************) + +(*** push_rew *) +lemma gr_push_unfold (f): Ⓕ⨮f = ⫯f. +// qed. + +(*** next_rew *) +lemma gr_next_unfold (f): Ⓣ⨮f = ↑f. +// qed. + +(* Basic inversion lemmas ***************************************************) + +(*** injective_push *) +lemma eq_inv_gr_push_bi: injective ? ? gr_push. +#f1 #f2 (npsucc_pred i1) in ⊢ (%→?); >(npsucc_pred i2) in ⊢ (%→?); +// +qed. + +(* Basic inversion lemmas ***************************************************) + +(*** gr_nat_inv_ppx *) +lemma gr_nat_inv_zero_push (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g. 𝟎 = l1 → ⫯g = f → 𝟎 = l2. +#f #l1 #l2 #H #g #H1 #H2 destruct +lapply (gr_pat_inv_unit_push … H ???) -H +/2 width=2 by eq_inv_npsucc_bi/ +qed-. + +(*** gr_nat_inv_npx *) +lemma gr_nat_inv_succ_push (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g,k1. ↑k1 = l1 → ⫯g = f → + ∃∃k2. @↑❪k1,g❫ ≘ k2 & ↑k2 = l2. +#f #l1 #l2 #H #g #k1 #H1 #H2 destruct +elim (gr_pat_inv_succ_push … H) -H [|*: // ] #k2 #Hg +>(npsucc_pred (↑l2)) #H +@(ex2_intro … (↓k2)) // +qed-. + +(*** gr_nat_inv_xnx *) +lemma gr_nat_inv_next (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g. ↑g = f → + ∃∃k2. @↑❪l1,g❫ ≘ k2 & ↑k2 = l2. +#f #l1 #l2 #H #g #H1 destruct +elim (gr_pat_inv_next … H) -H [|*: // ] #k2 +>(npsucc_pred (k2)) in ⊢ (%→?→?); #Hg #H +@(ex2_intro … (↓k2)) // +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** gr_nat_inv_ppn *) +lemma gr_nat_inv_zero_push_succ (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g,k2. 𝟎 = l1 → ⫯g = f → ↑k2 = l2 → ⊥. +#f #l1 #l2 #Hf #g #k2 #H1 #H <(gr_nat_inv_zero_push … Hf … H1 H) -f -g -l1 -l2 +/2 width=3 by eq_inv_nsucc_zero/ +qed-. + +(*** gr_nat_inv_npp *) +lemma gr_nat_inv_succ_push_zero (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g,k1. ↑k1 = l1 → ⫯g = f → 𝟎 = l2 → ⊥. +#f #l1 #l2 #Hf #g #k1 #H1 #H elim (gr_nat_inv_succ_push … Hf … H1 H) -f -l1 +#x2 #Hg * -l2 /2 width=3 by eq_inv_zero_nsucc/ +qed-. + +(*** gr_nat_inv_npn *) +lemma gr_nat_inv_succ_push_succ (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g,k1,k2. ↑k1 = l1 → ⫯g = f → ↑k2 = l2 → @↑❪k1,g❫ ≘ k2. +#f #l1 #l2 #Hf #g #k1 #k2 #H1 #H elim (gr_nat_inv_succ_push … Hf … H1 H) -f -l1 +#x2 #Hg * -l2 #H >(eq_inv_nsucc_bi … H) -k2 // +qed-. + +(*** gr_nat_inv_xnp *) +lemma gr_nat_inv_next_zero (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g. ↑g = f → 𝟎 = l2 → ⊥. +#f #l1 #l2 #Hf #g #H elim (gr_nat_inv_next … Hf … H) -f +#x2 #Hg * -l2 /2 width=3 by eq_inv_zero_nsucc/ +qed-. + +(*** gr_nat_inv_xnn *) +lemma gr_nat_inv_next_succ (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g,k2. ↑g = f → ↑k2 = l2 → @↑❪l1,g❫ ≘ k2. +#f #l1 #l2 #Hf #g #k2 #H elim (gr_nat_inv_next … Hf … H) -f +#x2 #Hg * -l2 #H >(eq_inv_nsucc_bi … H) -k2 // +qed-. + +(*** gr_nat_inv_pxp *) +lemma gr_nat_inv_zero_bi (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → 𝟎 = l1 → 𝟎 = l2 → ∃g. ⫯g = f. +#f elim (gr_map_split_tl … f) /2 width=2 by ex_intro/ +#H #l1 #l2 #Hf #H1 #H2 cases (gr_nat_inv_next_zero … Hf … H H2) +qed-. + +(*** gr_nat_inv_pxn *) +lemma gr_nat_inv_zero_succ (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀k2. 𝟎 = l1 → ↑k2 = l2 → + ∃∃g. @↑❪l1,g❫ ≘ k2 & ↑g = f. +#f elim (gr_map_split_tl … f) +#H #l1 #l2 #Hf #k2 #H1 #H2 +[ elim (gr_nat_inv_zero_push_succ … Hf … H1 H H2) +| /3 width=5 by gr_nat_inv_next_succ, ex2_intro/ +] +qed-. + +(*** gr_nat_inv_nxp *) +lemma gr_nat_inv_succ_zero (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀k1. ↑k1 = l1 → 𝟎 = l2 → ⊥. +#f elim (gr_map_split_tl f) +#H #l1 #l2 #Hf #k1 #H1 #H2 +[ elim (gr_nat_inv_succ_push_zero … Hf … H1 H H2) +| elim (gr_nat_inv_next_zero … Hf … H H2) +] +qed-. + +(*** gr_nat_inv_nxn *) +lemma gr_nat_inv_succ_bi (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀k1,k2. ↑k1 = l1 → ↑k2 = l2 → + ∨∨ ∃∃g. @↑❪k1,g❫ ≘ k2 & ⫯g = f + | ∃∃g. @↑❪l1,g❫ ≘ k2 & ↑g = f. +#f elim (gr_map_split_tl f) * +/4 width=7 by gr_nat_inv_next_succ, gr_nat_inv_succ_push_succ, ex2_intro, or_intror, or_introl/ +qed-. + +(* Note: the following inversion lemmas must be checked *) +(*** gr_nat_inv_xpx *) +lemma gr_nat_inv_push (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g. ⫯g = f → + ∨∨ ∧∧ 𝟎 = l1 & 𝟎 = l2 + | ∃∃k1,k2. @↑❪k1,g❫ ≘ k2 & ↑k1 = l1 & ↑k2 = l2. +#f * [2: #l1 ] #l2 #Hf #g #H +[ elim (gr_nat_inv_succ_push … Hf … H) -f /3 width=5 by or_intror, ex3_2_intro/ +| >(gr_nat_inv_zero_push … Hf … H) -f /3 width=1 by conj, or_introl/ +] +qed-. + +(*** gr_nat_inv_xpp *) +lemma gr_nat_inv_push_zero (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g. ⫯g = f → 𝟎 = l2 → 𝟎 = l1. +#f #l1 #l2 #Hf #g #H elim (gr_nat_inv_push … Hf … H) -f * // +#k1 #k2 #_ #_ * -l2 #H elim (eq_inv_zero_nsucc … H) +qed-. + +(*** gr_nat_inv_xpn *) +lemma gr_nat_inv_push_succ (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → ∀g,k2. ⫯g = f → ↑k2 = l2 → + ∃∃k1. @↑❪k1,g❫ ≘ k2 & ↑k1 = l1. +#f #l1 #l2 #Hf #g #k2 #H elim (gr_nat_inv_push … Hf … H) -f * +[ #_ * -l2 #H elim (eq_inv_nsucc_zero … H) +| #x1 #x2 #Hg #H1 * -l2 #H + lapply (eq_inv_nsucc_bi … H) -H #H destruct + /2 width=3 by ex2_intro/ +] +qed-. + +(*** gr_nat_inv_xxp *) +lemma gr_nat_inv_zero_dx (f) (l1) (l2): + @↑❪l1,f❫ ≘ l2 → 𝟎 = l2 → ∃∃g. 𝟎 = l1 & ⫯g = f. +#f elim (gr_map_split_tl f) +#H #l1 #l2 #Hf #H2 +[ /3 width=6 by gr_nat_inv_push_zero, ex2_intro/ +| elim (gr_nat_inv_next_zero … Hf … H H2) +] +qed-. + +(*** gr_nat_inv_xxn *) +lemma gr_nat_inv_succ_dx (f) (l1) (l2): @↑❪l1,f❫ ≘ l2 → ∀k2. ↑k2 = l2 → + ∨∨ ∃∃g,k1. @↑❪k1,g❫ ≘ k2 & ↑k1 = l1 & ⫯g = f + | ∃∃g. @↑❪l1,g❫ ≘ k2 & ↑g = f. +#f elim (gr_map_split_tl f) +#H #l1 #l2 #Hf #k2 #H2 +[ elim (gr_nat_inv_push_succ … Hf … H H2) -l2 /3 width=5 by or_introl, ex3_2_intro/ +| lapply (gr_nat_inv_next_succ … Hf … H H2) -l2 /3 width=3 by or_intror, ex2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_nat.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_basic.ma similarity index 58% rename from matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_nat.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_basic.ma index bf6159792..77ed0ed6d 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_nat.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_basic.ma @@ -12,40 +12,40 @@ (* *) (**************************************************************************) -include "ground/relocation/rtmap_nat_uni.ma". -include "ground/relocation/rtmap_basic.ma". +include "ground/relocation/gr_basic.ma". +include "ground/relocation/gr_nat_uni.ma". -(* RELOCATION MAP ***********************************************************) +(* NON-NEGATIVE APPLICATION FOR GENERIC RELOCATION MAPS *****************************) -(* Prioerties with application **********************************************) +(* Properties with gr_basic **********************************************) -lemma rm_nat_basic_lt (m) (n) (l): - l < m → @↑❪l, 𝐁❨m,n❩❫ ≘ l. +lemma gr_nat_basic_lt (m) (n) (l): + l < m → @↑❪l, 𝐛❨m,n❩❫ ≘ l. #m @(nat_ind_succ … m) -m [ #n #i #H elim (nlt_inv_zero_dx … H) | #m #IH #n #l @(nat_ind_succ … l) -l - [ #_ /2 width=2 by refl, at_refl/ + [ #_ /2 width=2 by refl, gr_pat_refl/ | #l #_ #H lapply (nlt_inv_succ_bi … H) -H #Hlm - /3 width=7 by refl, at_push/ + /3 width=7 by refl, gr_pat_push/ ] ] qed. -lemma rm_nat_basic_ge (m) (n) (l): - m ≤ l → @↑❪l, 𝐁❨m,n❩❫ ≘ l+n. +lemma gr_nat_basic_ge (m) (n) (l): + m ≤ l → @↑❪l, 𝐛❨m,n❩❫ ≘ l+n. #m @(nat_ind_succ … m) -m // #m #IH #n #l #H elim (nle_inv_succ_sn … H) -H #Hml #H >H -H -/3 width=7 by rm_nat_push/ +/3 width=7 by gr_nat_push/ qed. -(* Inversion lemmas with application ****************************************) +(* Inversion lemmas with gr_basic ****************************************) -lemma rm_nat_basic_inv_lt (m) (n) (l) (k): - l < m → @↑❪l, 𝐁❨m,n❩❫ ≘ k → l = k. -/3 width=4 by rm_nat_basic_lt, rm_nat_mono/ qed-. +lemma gr_nat_basic_inv_lt (m) (n) (l) (k): + l < m → @↑❪l, 𝐛❨m,n❩❫ ≘ k → l = k. +/3 width=4 by gr_nat_basic_lt, gr_nat_mono/ qed-. -lemma rm_nat_basic_inv_ge (m) (n) (l) (k): - m ≤ l → @↑❪l, 𝐁❨m,n❩❫ ≘ k → l+n = k. -/3 width=4 by rm_nat_basic_ge, rm_nat_mono/ qed-. +lemma gr_nat_basic_inv_ge (m) (n) (l) (k): + m ≤ l → @↑❪l, 𝐛❨m,n❩❫ ≘ k → l+n = k. +/3 width=4 by gr_nat_basic_ge, gr_nat_mono/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_nat.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_nat.ma new file mode 100644 index 000000000..a70e01ce4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_nat.ma @@ -0,0 +1,73 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arith/nat_lt_pred.ma". +include "ground/relocation/gr_nat.ma". + +(* NON-NEGATIVE APPLICATION FOR GENERIC RELOCATION MAPS *****************************) + +(* Main destructions ********************************************************) + +theorem gr_nat_monotonic (k2) (l2) (f): + @↑❪l2,f❫ ≘ k2 → ∀k1,l1. @↑❪l1,f❫ ≘ k1 → l1 < l2 → k1 < k2. +#k2 @(nat_ind_succ … k2) -k2 +[ #l2 #f #H2f elim (gr_nat_inv_zero_dx … H2f) -H2f // + #g #H21 #_ #k1 #l1 #_ #Hi destruct + elim (nlt_inv_zero_dx … Hi) +| #k2 #IH #l2 #f #H2f #k1 @(nat_ind_succ … k1) -k1 // + #k1 #_ #l1 #H1f #Hl elim (nlt_inv_gen … Hl) + #_ #Hl2 elim (gr_nat_inv_succ_bi … H2f (↓l2)) -H2f [1,3: * |*: // ] + #g #H2g #H + [ elim (gr_nat_inv_push_succ … H1f … H) -f + /4 width=8 by nlt_inv_succ_bi, nlt_succ_bi/ + | /4 width=8 by gr_nat_inv_next_succ, nlt_succ_bi/ + ] +] +qed-. + +theorem gr_nat_inv_monotonic (k1) (l1) (f): + @↑❪l1,f❫ ≘ k1 → ∀k2,l2. @↑❪l2,f❫ ≘ k2 → k1 < k2 → l1 < l2. +#k1 @(nat_ind_succ … k1) -k1 +[ #l1 #f #H1f elim (gr_nat_inv_zero_dx … H1f) -H1f // + #g * -l1 #H #k2 #l2 #H2f #Hk + lapply (nlt_des_gen … Hk) -Hk #H22 + elim (gr_nat_inv_push_succ … H2f … (↓k2) H) -f // +| #k1 #IH #l1 @(nat_ind_succ … l1) -l1 + [ #f #H1f elim (gr_nat_inv_zero_succ … H1f) -H1f [ |*: // ] + #g #H1g #H #k2 #l2 #H2f #Hj elim (nlt_inv_succ_sn … Hj) -Hj + /3 width=7 by gr_nat_inv_next_succ/ + | #l1 #_ #f #H1f #k2 #l2 #H2f #Hj elim (nlt_inv_succ_sn … Hj) -Hj + #Hj #H22 elim (gr_nat_inv_succ_bi … H1f) -H1f [1,4: * |*: // ] + #g #Hg #H + [ elim (gr_nat_inv_push_succ … H2f … (↓k2) H) -f + /3 width=7 by nlt_succ_bi/ + | /3 width=7 by gr_nat_inv_next_succ/ + ] + ] +] +qed-. + +theorem gr_nat_mono (f) (l) (l1) (l2): + @↑❪l,f❫ ≘ l1 → @↑❪l,f❫ ≘ l2 → l2 = l1. +#f #l #l1 #l2 #H1 #H2 elim (nat_split_lt_eq_gt l2 l1) // +#Hi elim (nlt_ge_false l l) +/2 width=6 by gr_nat_inv_monotonic/ +qed-. + +theorem gr_nat_inj (f) (l1) (l2) (l): + @↑❪l1,f❫ ≘ l → @↑❪l2,f❫ ≘ l → l1 = l2. +#f #l1 #l2 #l #H1 #H2 elim (nat_split_lt_eq_gt l2 l1) // +#Hi elim (nlt_ge_false l l) +/2 width=6 by gr_nat_monotonic/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_at_uni.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_uni.ma similarity index 69% rename from matita/matita/contribs/lambdadelta/ground/relocation/rtmap_at_uni.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_uni.ma index fed9d867b..0a79bbc18 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_at_uni.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_uni.ma @@ -5,26 +5,28 @@ (* ||T|| *) (* ||I|| Developers: *) (* ||T|| The HELM team. *) -(* ||A|| http://helm.tcs.unibo.it *) +(* ||A|| http://helm.cs.unibo.it *) (* \ / *) (* \ / This file is distributed under the terms of the *) (* v GNU General Public License Version 2 *) (* *) (**************************************************************************) -include "ground/arith/nat_rplus_succ.ma". -include "ground/relocation/rtmap_uni.ma". -include "ground/relocation/rtmap_at.ma". +include "ground/arith/nat_plus_rplus.ma". +include "ground/relocation/gr_pat_uni.ma". +include "ground/relocation/gr_nat_nat.ma". -(* RELOCATION MAP ***********************************************************) +(* NON-NEGATIVE APPLICATION FOR GENERIC RELOCATION MAPS *****************************) (* Properties with uniform relocations **************************************) -lemma at_uni: ∀n,i. @❪i,𝐔❨n❩❫ ≘ i+n. -#n @(nat_ind_succ … n) -n /2 width=5 by at_next/ +lemma gr_nat_uni (n) (l): + @↑❪l,𝐮❨n❩❫ ≘ l+n. +/2 width=1 by gr_nat_pred_bi/ qed. (* Inversion lemmas with uniform relocations ********************************) -lemma at_inv_uni: ∀n,i,j. @❪i,𝐔❨n❩❫ ≘ j → j = i+n. -/2 width=4 by at_mono/ qed-. +lemma gr_nat_inv_uni (n) (l) (k): + @↑❪l,𝐮❨n❩❫ ≘ k → k = l+n. +/2 width=4 by gr_nat_mono/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts.ma new file mode 100644 index 000000000..ff1595ced --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts.ma @@ -0,0 +1,51 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/functions/uparrowstar_2.ma". +include "ground/arith/nat_succ_iter.ma". +include "ground/relocation/gr_map.ma". + +(* ITERATED NEXT FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** nexts *) +definition gr_nexts (f:gr_map) (n:nat) ≝ + (gr_next^n) f. + +interpretation + "iterated next (generic relocation maps)" + 'UpArrowStar n f = (gr_nexts f n). + +(* Basic properties *********************************************************) + +(*** nexts_O *) +lemma gr_nexts_zero: + ∀f. f = ↑*[𝟎] f. +// qed. + +(*** nexts_swap *) +lemma gr_nexts_next (n): + ∀f. ↑↑*[n] f = ↑*[n] ↑f. +#f #n @(niter_appl … gr_next) +qed. + +(*** nexts_S *) +lemma gr_nexts_succ (n): + ∀f. ↑↑*[n] f = ↑*[↑n] f. +#f #n @(niter_succ … gr_next) +qed. + +(*** nexts_xn *) +lemma gr_nexts_swap (n): + ∀f. ↑*[n] ↑f = ↑*[↑n] f. +// qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts_eq.ma new file mode 100644 index 000000000..928cb4289 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_nexts_eq.ma @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_eq.ma". +include "ground/relocation/gr_nexts.ma". + +(* ITERATED NEXT FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq ******************************************************) + +(*** nexts_eq_repl *) +lemma gr_nexts_eq_repl (n): + gr_eq_repl (λf1,f2. ↑*[n] f1 ≡ ↑*[n] f2). +#n @(nat_ind_succ … n) -n +/3 width=5 by gr_eq_next/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_pat.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_pat.ma new file mode 100644 index 000000000..926e94cda --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_pat.ma @@ -0,0 +1,202 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/rat_3.ma". +include "ground/xoa/ex_3_2.ma". +include "ground/arith/pnat.ma". +include "ground/relocation/gr_tl.ma". + +(* POSITIVE APPLICATION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** at *) +coinductive gr_pat: relation3 gr_map pnat pnat ≝ +(*** at_refl *) +| gr_pat_refl (f) (g) (j1) (j2): + ⫯f = g → 𝟏 = j1 → 𝟏 = j2 → gr_pat g j1 j2 +(*** at_push *) +| gr_pat_push (f) (i1) (i2): + gr_pat f i1 i2 → ∀g,j1,j2. ⫯f = g → ↑i1 = j1 → ↑i2 = j2 → gr_pat g j1 j2 +(*** at_next *) +| gr_pat_next (f) (i1) (i2): + gr_pat f i1 i2 → ∀g,j2. ↑f = g → ↑i2 = j2 → gr_pat g i1 j2 +. + +interpretation + "relational positive application (generic relocation maps)" + 'RAt i1 f i2 = (gr_pat f i1 i2). + +(*** H_at_div *) +definition H_gr_pat_div: relation4 gr_map gr_map gr_map gr_map ≝ + λf2,g2,f1,g1. + ∀jf,jg,j. @❪jf,f2❫ ≘ j → @❪jg,g2❫ ≘ j → + ∃∃j0. @❪j0,f1❫ ≘ jf & @❪j0,g1❫ ≘ jg. + +(* Basic inversion lemmas ***************************************************) + +(*** at_inv_ppx *) +lemma gr_pat_inv_unit_push (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g. 𝟏 = i1 → ⫯g = f → 𝟏 = i2. +#f #i1 #i2 * -f -i1 -i2 // +[ #f #i1 #i2 #_ #g #j1 #j2 #_ * #_ #x #H destruct +| #f #i1 #i2 #_ #g #j2 * #_ #x #_ #H elim (eq_inv_gr_push_next … H) +] +qed-. + +(*** at_inv_npx *) +lemma gr_pat_inv_succ_push (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g,j1. ↑j1 = i1 → ⫯g = f → + ∃∃j2. @❪j1,g❫ ≘ j2 & ↑j2 = i2. +#f #i1 #i2 * -f -i1 -i2 +[ #f #g #j1 #j2 #_ * #_ #x #x1 #H destruct +| #f #i1 #i2 #Hi #g #j1 #j2 * * * #x #x1 #H #Hf >(eq_inv_gr_push_bi … Hf) -g destruct /2 width=3 by ex2_intro/ +| #f #i1 #i2 #_ #g #j2 * #_ #x #x1 #_ #H elim (eq_inv_gr_push_next … H) +] +qed-. + +(*** at_inv_xnx *) +lemma gr_pat_inv_next (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g. ↑g = f → + ∃∃j2. @❪i1,g❫ ≘ j2 & ↑j2 = i2. +#f #i1 #i2 * -f -i1 -i2 +[ #f #g #j1 #j2 * #_ #_ #x #H elim (eq_inv_gr_next_push … H) +| #f #i1 #i2 #_ #g #j1 #j2 * #_ #_ #x #H elim (eq_inv_gr_next_push … H) +| #f #i1 #i2 #Hi #g #j2 * * #x #H >(eq_inv_gr_next_bi … H) -g /2 width=3 by ex2_intro/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** at_inv_ppn *) +lemma gr_pat_inv_unit_push_succ (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g,j2. 𝟏 = i1 → ⫯g = f → ↑j2 = i2 → ⊥. +#f #i1 #i2 #Hf #g #j2 #H1 #H <(gr_pat_inv_unit_push … Hf … H1 H) -f -g -i1 -i2 +#H destruct +qed-. + +(*** at_inv_npp *) +lemma gr_pat_inv_succ_push_unit (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g,j1. ↑j1 = i1 → ⫯g = f → 𝟏 = i2 → ⊥. +#f #i1 #i2 #Hf #g #j1 #H1 #H elim (gr_pat_inv_succ_push … Hf … H1 H) -f -i1 +#x2 #Hg * -i2 #H destruct +qed-. + +(*** at_inv_npn *) +lemma gr_pat_inv_succ_push_succ (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g,j1,j2. ↑j1 = i1 → ⫯g = f → ↑j2 = i2 → @❪j1,g❫ ≘ j2. +#f #i1 #i2 #Hf #g #j1 #j2 #H1 #H elim (gr_pat_inv_succ_push … Hf … H1 H) -f -i1 +#x2 #Hg * -i2 #H destruct // +qed-. + +(*** at_inv_xnp *) +lemma gr_pat_inv_next_unit (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g. ↑g = f → 𝟏 = i2 → ⊥. +#f #i1 #i2 #Hf #g #H elim (gr_pat_inv_next … Hf … H) -f +#x2 #Hg * -i2 #H destruct +qed-. + +(*** at_inv_xnn *) +lemma gr_pat_inv_next_succ (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g,j2. ↑g = f → ↑j2 = i2 → @❪i1,g❫ ≘ j2. +#f #i1 #i2 #Hf #g #j2 #H elim (gr_pat_inv_next … Hf … H) -f +#x2 #Hg * -i2 #H destruct // +qed-. + +(*** at_inv_pxp *) +lemma gr_pat_inv_unit_bi (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → 𝟏 = i1 → 𝟏 = i2 → ∃g. ⫯g = f. +#f elim (gr_map_split_tl … f) /2 width=2 by ex_intro/ +#H #i1 #i2 #Hf #H1 #H2 cases (gr_pat_inv_next_unit … Hf … H H2) +qed-. + +(*** at_inv_pxn *) +lemma gr_pat_inv_unit_succ (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀j2. 𝟏 = i1 → ↑j2 = i2 → + ∃∃g. @❪i1,g❫ ≘ j2 & ↑g = f. +#f elim (gr_map_split_tl … f) +#H #i1 #i2 #Hf #j2 #H1 #H2 +[ elim (gr_pat_inv_unit_push_succ … Hf … H1 H H2) +| /3 width=5 by gr_pat_inv_next_succ, ex2_intro/ +] +qed-. + +(*** at_inv_nxp *) +lemma gr_pat_inv_succ_unit (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀j1. ↑j1 = i1 → 𝟏 = i2 → ⊥. +#f elim (gr_map_split_tl f) +#H #i1 #i2 #Hf #j1 #H1 #H2 +[ elim (gr_pat_inv_succ_push_unit … Hf … H1 H H2) +| elim (gr_pat_inv_next_unit … Hf … H H2) +] +qed-. + +(*** at_inv_nxn *) +lemma gr_pat_inv_succ_bi (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀j1,j2. ↑j1 = i1 → ↑j2 = i2 → + ∨∨ ∃∃g. @❪j1,g❫ ≘ j2 & ⫯g = f + | ∃∃g. @❪i1,g❫ ≘ j2 & ↑g = f. +#f elim (gr_map_split_tl f) * +/4 width=7 by gr_pat_inv_next_succ, gr_pat_inv_succ_push_succ, ex2_intro, or_intror, or_introl/ +qed-. + +(* Note: the following inversion lemmas must be checked *) +(*** at_inv_xpx *) +lemma gr_pat_inv_push (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g. ⫯g = f → + ∨∨ ∧∧ 𝟏 = i1 & 𝟏 = i2 + | ∃∃j1,j2. @❪j1,g❫ ≘ j2 & ↑j1 = i1 & ↑j2 = i2. +#f * [2: #i1 ] #i2 #Hf #g #H +[ elim (gr_pat_inv_succ_push … Hf … H) -f /3 width=5 by or_intror, ex3_2_intro/ +| >(gr_pat_inv_unit_push … Hf … H) -f /3 width=1 by conj, or_introl/ +] +qed-. + +(*** at_inv_xpp *) +lemma gr_pat_inv_push_unit (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g. ⫯g = f → 𝟏 = i2 → 𝟏 = i1. +#f #i1 #i2 #Hf #g #H elim (gr_pat_inv_push … Hf … H) -f * // +#j1 #j2 #_ #_ * -i2 #H destruct +qed-. + +(*** at_inv_xpn *) +lemma gr_pat_inv_push_succ (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀g,j2. ⫯g = f → ↑j2 = i2 → + ∃∃j1. @❪j1,g❫ ≘ j2 & ↑j1 = i1. +#f #i1 #i2 #Hf #g #j2 #H elim (gr_pat_inv_push … Hf … H) -f * +[ #_ * -i2 #H destruct +| #x1 #x2 #Hg #H1 * -i2 #H destruct /2 width=3 by ex2_intro/ +] +qed-. + +(*** at_inv_xxp *) +lemma gr_pat_inv_unit_dx (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → 𝟏 = i2 → + ∃∃g. 𝟏 = i1 & ⫯g = f. +#f elim (gr_map_split_tl f) +#H #i1 #i2 #Hf #H2 +[ /3 width=6 by gr_pat_inv_push_unit, ex2_intro/ +| elim (gr_pat_inv_next_unit … Hf … H H2) +] +qed-. + +(*** at_inv_xxn *) +lemma gr_pat_inv_succ_dx (f) (i1) (i2): + @❪i1,f❫ ≘ i2 → ∀j2. ↑j2 = i2 → + ∨∨ ∃∃g,j1. @❪j1,g❫ ≘ j2 & ↑j1 = i1 & ⫯g = f + | ∃∃g. @❪i1,g❫ ≘ j2 & ↑g = f. +#f elim (gr_map_split_tl f) +#H #i1 #i2 #Hf #j2 #H2 +[ elim (gr_pat_inv_push_succ … Hf … H H2) -i2 /3 width=5 by or_introl, ex3_2_intro/ +| lapply (gr_pat_inv_next_succ … Hf … H H2) -i2 /3 width=3 by or_intror, ex2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_at.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_basic.ma similarity index 53% rename from matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_at.ma rename to matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_basic.ma index 00e2509e4..8ffe58797 100644 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_basic_at.ma +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_basic.ma @@ -12,31 +12,34 @@ (* *) (**************************************************************************) -include "ground/arith/nat_plus_rplus.ma". -include "ground/relocation/rtmap_basic_nat.ma". +include "ground/relocation/gr_nat_basic.ma". -(* RELOCATION MAP ***********************************************************) +(* POSITIVE APPLICATION FOR GENERIC RELOCATION MAPS ***********************************************************) -(* Prioerties with application **********************************************) +(* Properties with gr_basic **********************************************) -lemma at_basic_lt (m) (n) (i): - ninj i ≤ m → @❪i, 𝐁❨m,n❩❫ ≘ i. +(*** at_basic_lt *) +lemma gr_pat_basic_lt (m) (n) (i): + ninj i ≤ m → @❪i, 𝐛❨m,n❩❫ ≘ i. #m #n #i >(npsucc_pred i) #Hmi -/2 width=1 by rm_nat_basic_lt/ +/2 width=1 by gr_nat_basic_lt/ qed. -lemma at_basic_ge (m) (n) (i): - m < ninj i → @❪i, 𝐁❨m,n❩❫ ≘ i+n. +(*** at_basic_ge *) +lemma gr_pat_basic_ge (m) (n) (i): + m < ninj i → @❪i, 𝐛❨m,n❩❫ ≘ i+n. #m #n #i >(npsucc_pred i) #Hmi (eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. + +(*** sand_inv_npx *) +lemma gr_sand_inv_next_push: + ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → + ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g. +#g1 #g2 #g * -g1 -g2 -g +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct +try (>(eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. + +(*** sand_inv_pnx *) +lemma gr_sand_inv_push_next: + ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → + ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g. +#g1 #g2 #g * -g1 -g2 -g +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct +try (>(eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. + +(*** sand_inv_nnx *) +lemma gr_sand_inv_next_bi: + ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → + ∃∃f. f1 ⋒ f2 ≘ f & ↑f = g. +#g1 #g2 #g * -g1 -g2 -g +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct +try (>(eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sand_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sand_eq.ma new file mode 100644 index 000000000..a199c7706 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sand_eq.ma @@ -0,0 +1,65 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl_eq.ma". +include "ground/relocation/gr_sand.ma". + +(* RELATIONAL INTERSECTION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *) + +(*** sand_eq_repl_back1 *) +corec lemma gr_sand_eq_repl_back_sn: + ∀f2,f. gr_eq_repl_back … (λf1. f1 ⋒ f2 ≘ f). +#f2 #f #f1 * -f1 -f2 -f +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x #Hx +try cases (gr_eq_inv_push_sn … Hx … H1) try cases (gr_eq_inv_next_sn … Hx … H1) -g1 +/3 width=7 by gr_sand_push_bi, gr_sand_next_push, gr_sand_push_next, gr_sand_next_bi/ +qed-. + +(*** sand_eq_repl_fwd1 *) +lemma gr_sand_eq_repl_fwd_sn: + ∀f2,f. gr_eq_repl_fwd … (λf1. f1 ⋒ f2 ≘ f). +#f2 #f @gr_eq_repl_sym /2 width=3 by gr_sand_eq_repl_back_sn/ +qed-. + +(*** sand_eq_repl_back2 *) +corec lemma gr_sand_eq_repl_back_dx: + ∀f1,f. gr_eq_repl_back … (λf2. f1 ⋒ f2 ≘ f). +#f1 #f #f2 * -f1 -f2 -f +#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx +try cases (gr_eq_inv_push_sn … Hx … H2) try cases (gr_eq_inv_next_sn … Hx … H2) -g2 +/3 width=7 by gr_sand_push_bi, gr_sand_next_push, gr_sand_push_next, gr_sand_next_bi/ +qed-. + +(*** sand_eq_repl_fwd2 *) +lemma sand_eq_repl_fwd_dx: + ∀f1,f. gr_eq_repl_fwd … (λf2. f1 ⋒ f2 ≘ f). +#f1 #f @gr_eq_repl_sym /2 width=3 by gr_sand_eq_repl_back_dx/ +qed-. + +(*** sand_eq_repl_back3 *) +corec lemma gr_sand_eq_repl_back: + ∀f1,f2. gr_eq_repl_back … (λf. f1 ⋒ f2 ≘ f). +#f1 #f2 #f * -f1 -f2 -f +#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx +try cases (gr_eq_inv_push_sn … Hx … H0) try cases (gr_eq_inv_next_sn … Hx … H0) -g +/3 width=7 by gr_sand_push_bi, gr_sand_next_push, gr_sand_push_next, gr_sand_next_bi/ +qed-. + +(*** sand_eq_repl_fwd3 *) +lemma gr_sand_eq_repl_fwd: + ∀f1,f2. gr_eq_repl_fwd … (λf. f1 ⋒ f2 ≘ f). +#f1 #f2 @gr_eq_repl_sym /2 width=3 by gr_sand_eq_repl_back/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj.ma new file mode 100644 index 000000000..66281ee0f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj.ma @@ -0,0 +1,144 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/parallel_2.ma". +include "ground/relocation/gr_tl.ma". + +(* DISJOINTNESS FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** sdj *) +coinductive gr_sdj: relation gr_map ≝ +(*** sdj_pp *) +| gr_sdj_push_bi (f1) (f2) (g1) (g2): + gr_sdj f1 f2 → ⫯f1 = g1 → ⫯f2 = g2 → gr_sdj g1 g2 +(*** sdj_np *) +| gr_sdj_next_push (f1) (f2) (g1) (g2): + gr_sdj f1 f2 → ↑f1 = g1 → ⫯f2 = g2 → gr_sdj g1 g2 +(*** sdj_pn *) +| gr_sdj_push_next (f1) (f2) (g1) (g2): + gr_sdj f1 f2 → ⫯f1 = g1 → ↑f2 = g2 → gr_sdj g1 g2 +. + +interpretation + "disjointness (generic relocation maps)" + 'Parallel f1 f2 = (gr_sdj f1 f2). + +(* Basic properties *********************************************************) + +(*** sdj_sym *) +corec lemma gr_sdj_sym: + symmetric … gr_sdj. +#f1 #f2 * -f1 -f2 +#f1 #f2 #g1 #g2 #Hf #H1 #H2 +[ @(gr_sdj_push_bi … H2 H1) +| @(gr_sdj_push_next … H2 H1) +| @(gr_sdj_next_push … H2 H1) +] -g2 -g1 +/2 width=1 by/ +qed-. + +(* Basic inversion lemmas ***************************************************) + +(*** sdj_inv_pp *) +lemma gr_sdj_inv_push_bi: + ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → f1 ∥ f2. +#g1 #g2 * -g1 -g2 +#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct +[ lapply (eq_inv_gr_push_bi … Hx1) -Hx1 + lapply (eq_inv_gr_push_bi … Hx2) -Hx2 // +| elim (eq_inv_gr_push_next … Hx1) +| elim (eq_inv_gr_push_next … Hx2) +] +qed-. + +(*** sdj_inv_np *) +lemma gr_sdj_inv_next_push: + ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → f1 ∥ f2. +#g1 #g2 * -g1 -g2 +#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct +[ elim (eq_inv_gr_next_push … Hx1) +| lapply (eq_inv_gr_next_bi … Hx1) -Hx1 + lapply (eq_inv_gr_push_bi … Hx2) -Hx2 // +| elim (eq_inv_gr_push_next … Hx2) +] +qed-. + +(*** sdj_inv_pn *) +lemma gr_sdj_inv_push_next: + ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → f1 ∥ f2. +#g1 #g2 * -g1 -g2 +#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct +[ elim (eq_inv_gr_next_push … Hx2) +| elim (eq_inv_gr_push_next … Hx1) +| lapply (eq_inv_gr_push_bi … Hx1) -Hx1 + lapply (eq_inv_gr_next_bi … Hx2) -Hx2 // +] +qed-. + +(*** sdj_inv_nn *) +lemma gr_sdj_inv_next_bi: + ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → ⊥. +#g1 #g2 * -g1 -g2 +#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct +[ elim (eq_inv_gr_next_push … Hx1) +| elim (eq_inv_gr_next_push … Hx2) +| elim (eq_inv_gr_next_push … Hx1) +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** sdj_inv_nx *) +lemma gr_sdj_inv_next_sn: + ∀g1,g2. g1 ∥ g2 → ∀f1. ↑f1 = g1 → + ∃∃f2. f1 ∥ f2 & ⫯f2 = g2. +#g1 #g2 elim (gr_map_split_tl g2) #H2 #H #f1 #H1 +[ lapply (gr_sdj_inv_next_push … H … H1 H2) -H /2 width=3 by ex2_intro/ +| elim (gr_sdj_inv_next_bi … H … H1 H2) +] +qed-. + +(*** sdj_inv_xn *) +lemma gr_sdj_inv_next_dx: + ∀g1,g2. g1 ∥ g2 → ∀f2. ↑f2 = g2 → + ∃∃f1. f1 ∥ f2 & ⫯f1 = g1. +#g1 #g2 elim (gr_map_split_tl g1) #H1 #H #f2 #H2 +[ lapply (gr_sdj_inv_push_next … H … H1 H2) -H /2 width=3 by ex2_intro/ +| elim (gr_sdj_inv_next_bi … H … H1 H2) +] +qed-. + +(*** sdj_inv_xp *) +lemma gr_sdj_inv_push_dx: + ∀g1,g2. g1 ∥ g2 → ∀f2. ⫯f2 = g2 → + ∨∨ ∃∃f1. f1 ∥ f2 & ⫯f1 = g1 + | ∃∃f1. f1 ∥ f2 & ↑f1 = g1. +#g1 #g2 elim (gr_map_split_tl g1) #H1 #H #f2 #H2 +[ lapply (gr_sdj_inv_push_bi … H … H1 H2) +| lapply (gr_sdj_inv_next_push … H … H1 H2) +] -H -H2 +/3 width=3 by ex2_intro, or_introl, or_intror/ +qed-. + +(*** sdj_inv_px *) +lemma gr_sdj_inv_push_sn: + ∀g1,g2. g1 ∥ g2 → ∀f1. ⫯f1 = g1 → + ∨∨ ∃∃f2. f1 ∥ f2 & ⫯f2 = g2 + | ∃∃f2. f1 ∥ f2 & ↑f2 = g2. +#g1 #g2 elim (gr_map_split_tl g2) #H2 #H #f1 #H1 +[ lapply (gr_sdj_inv_push_bi … H … H1 H2) +| lapply (gr_sdj_inv_push_next … H … H1 H2) +] -H -H1 +/3 width=3 by ex2_intro, or_introl, or_intror/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_eq.ma new file mode 100644 index 000000000..3cb13289d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_eq.ma @@ -0,0 +1,54 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl_eq.ma". +include "ground/relocation/gr_sdj.ma". + +(* DISJOINTNESS FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *********************************************************) + +(*** sdj_eq_repl_back1 *) +corec lemma gr_sdj_eq_repl_back_sn: + ∀f2. gr_eq_repl_back … (λf1. f1 ∥ f2). +#f2 #f1 * -f2 -f1 +#f1 #f2 #g1 #g2 #Hf #H1 #H2 #g #H0 +[ cases (gr_eq_inv_push_sn … H0 … H1) -g1 /3 width=5 by gr_sdj_push_bi/ +| cases (gr_eq_inv_next_sn … H0 … H1) -g1 /3 width=5 by gr_sdj_next_push/ +| cases (gr_eq_inv_push_sn … H0 … H1) -g1 /3 width=5 by gr_sdj_push_next/ +] +qed-. + +(*** sdj_eq_repl_fwd1 *) +lemma gr_sdj_eq_repl_fwd_sn: + ∀f2. gr_eq_repl_fwd … (λf1. f1 ∥ f2). +#f2 @gr_eq_repl_sym /2 width=3 by gr_sdj_eq_repl_back_sn/ +qed-. + +(*** sdj_eq_repl_back2 *) +corec lemma gr_sdj_eq_repl_back_dx: + ∀f1. gr_eq_repl_back … (λf2. f1 ∥ f2). +#f1 #f2 * -f1 -f2 +#f1 #f2 #g1 #g2 #Hf #H1 #H2 #g #H0 +[ cases (gr_eq_inv_push_sn … H0 … H2) -g2 /3 width=5 by gr_sdj_push_bi/ +| cases (gr_eq_inv_push_sn … H0 … H2) -g2 /3 width=5 by gr_sdj_next_push/ +| cases (gr_eq_inv_next_sn … H0 … H2) -g2 /3 width=5 by gr_sdj_push_next/ +] +qed-. + +(*** sdj_eq_repl_fwd2 *) +lemma gr_sdj_eq_repl_fwd_dx: + ∀f1. gr_eq_repl_fwd … (λf2. f1 ∥ f2). +#f1 @gr_eq_repl_sym /2 width=3 by gr_sdj_eq_repl_back_dx/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_isi.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_isi.ma new file mode 100644 index 000000000..d98726d11 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sdj_isi.ma @@ -0,0 +1,47 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi.ma". +include "ground/relocation/gr_sdj.ma". + +(* DISJOINTNESS FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with isid *****************************************************) + +(*** sdj_isid_dx *) +corec lemma gr_sdj_isi_dx: + ∀f2. 𝐈❪f2❫ → ∀f1. f1 ∥ f2. +#f2 * -f2 +#f2 #g2 #Hf2 #H2 #f1 cases (gr_map_split_tl f1) * +/3 width=5 by gr_sdj_next_push, gr_sdj_push_bi/ +qed. + +(*** sdj_isid_sn *) +corec lemma gr_sdj_isi_sn: + ∀f1. 𝐈❪f1❫ → ∀f2. f1 ∥ f2. +#f1 * -f1 +#f1 #g1 #Hf1 #H1 #f2 cases (gr_map_split_tl f2) * +/3 width=5 by gr_sdj_push_next, gr_sdj_push_bi/ +qed. + +(* Inversion lemmas with isid ***********************************************) + +(*** sdj_inv_refl *) +corec lemma gr_sdj_inv_refl: + ∀f. f ∥ f → 𝐈❪f❫. +#f cases (gr_map_split_tl f) #Hf #H +[ lapply (gr_sdj_inv_push_bi … H … Hf Hf) -H /3 width=3 by gr_isi_push/ +| elim (gr_sdj_inv_next_bi … H … Hf Hf) +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle.ma new file mode 100644 index 000000000..6ad077f23 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle.ma @@ -0,0 +1,162 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl.ma". + +(* INCLUSION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** sle *) +coinductive gr_sle: relation gr_map ≝ +(*** sle_push *) +| gr_sle_push (f1) (f2) (g1) (g2): + gr_sle f1 f2 → ⫯f1 = g1 → ⫯f2 = g2 → gr_sle g1 g2 +(*** sle_next *) +| gr_sle_next (f1) (f2) (g1) (g2): + gr_sle f1 f2 → ↑f1 = g1 → ↑f2 = g2 → gr_sle g1 g2 +(*** sle_weak *) +| gr_sle_weak (f1) (f2) (g1) (g2): + gr_sle f1 f2 → ⫯f1 = g1 → ↑f2 = g2 → gr_sle g1 g2 +. + +interpretation + "inclusion (generic relocation maps)" + 'subseteq f1 f2 = (gr_sle f1 f2). + +(* Basic properties *********************************************************) + +(*** sle_refl *) +corec lemma gr_sle_refl: + reflexive … gr_sle. +#f cases (gr_map_split_tl f) #H +[ @(gr_sle_push … H H) | @(gr_sle_next … H H) ] -H // +qed. + +(* Basic inversion lemmas ***************************************************) + +(*** sle_inv_xp *) +lemma gr_sle_inv_push_dx: + ∀g1,g2. g1 ⊆ g2 → ∀f2. ⫯f2 = g2 → + ∃∃f1. f1 ⊆ f2 & ⫯f1 = g1. +#g1 #g2 * -g1 -g2 +#f1 #f2 #g1 #g2 #H #H1 #H2 #x2 #Hx2 destruct +[ lapply (eq_inv_gr_push_bi … Hx2) -Hx2 /2 width=3 by ex2_intro/ ] +elim (eq_inv_gr_push_next … Hx2) +qed-. + +(*** sle_inv_nx *) +lemma gr_sle_inv_next_sn: + ∀g1,g2. g1 ⊆ g2 → ∀f1. ↑f1 = g1 → + ∃∃f2. f1 ⊆ f2 & ↑f2 = g2. +#g1 #g2 * -g1 -g2 +#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #Hx1 destruct +[2: lapply (eq_inv_gr_next_bi … Hx1) -Hx1 /2 width=3 by ex2_intro/ ] +elim (eq_inv_gr_next_push … Hx1) +qed-. + +(*** sle_inv_pn *) +lemma gr_sle_inv_push_next: + ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → f1 ⊆ f2. +#g1 #g2 * -g1 -g2 +#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct +[ elim (eq_inv_gr_next_push … Hx2) +| elim (eq_inv_gr_push_next … Hx1) +| lapply (eq_inv_gr_push_bi … Hx1) -Hx1 + lapply (eq_inv_gr_next_bi … Hx2) -Hx2 // +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** sle_inv_pp *) +lemma gr_sle_inv_push_bi: + ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → f1 ⊆ f2. +#g1 #g2 #H #f1 #f2 #H1 #H2 +elim (gr_sle_inv_push_dx … H … H2) -g2 #x1 #H #Hx1 destruct +lapply (eq_inv_gr_push_bi … Hx1) -Hx1 // +qed-. + +(*** sle_inv_nn *) +lemma gr_sle_inv_next_bi: + ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → f1 ⊆ f2. +#g1 #g2 #H #f1 #f2 #H1 #H2 +elim (gr_sle_inv_next_sn … H … H1) -g1 #x2 #H #Hx2 destruct +lapply (eq_inv_gr_next_bi … Hx2) -Hx2 // +qed-. + +(*** sle_inv_px *) +lemma gr_sle_inv_push_sn: + ∀g1,g2. g1 ⊆ g2 → ∀f1. ⫯f1 = g1 → + ∨∨ ∃∃f2. f1 ⊆ f2 & ⫯f2 = g2 + | ∃∃f2. f1 ⊆ f2 & ↑f2 = g2. +#g1 #g2 +elim (gr_map_split_tl g2) #H2 #H #f1 #H1 +[ lapply (gr_sle_inv_push_bi … H … H1 H2) +| lapply (gr_sle_inv_push_next … H … H1 H2) +] -H -H1 +/3 width=3 by ex2_intro, or_introl, or_intror/ +qed-. + +(*** sle_inv_xn *) +lemma gr_sle_inv_next_dx: + ∀g1,g2. g1 ⊆ g2 → ∀f2. ↑f2 = g2 → + ∨∨ ∃∃f1. f1 ⊆ f2 & ⫯f1 = g1 + | ∃∃f1. f1 ⊆ f2 & ↑f1 = g1. +#g1 #g2 +elim (gr_map_split_tl g1) #H1 #H #f2 #H2 +[ lapply (gr_sle_inv_push_next … H … H1 H2) +| lapply (gr_sle_inv_next_bi … H … H1 H2) +] -H -H2 +/3 width=3 by ex2_intro, or_introl, or_intror/ +qed-. + +(* Properties with tail *****************************************************) + +(*** sle_px_tl *) +lemma gr_sle_push_sn_tl: + ∀g1,g2. g1 ⊆ g2 → ∀f1. ⫯f1 = g1 → f1 ⊆ ⫱g2. +#g1 #g2 #H #f1 #H1 +elim (gr_sle_inv_push_sn … H … H1) -H -H1 * // +qed. + +(*** sle_xn_tl *) +lemma gr_sle_next_dx_tl: + ∀g1,g2. g1 ⊆ g2 → ∀f2. ↑f2 = g2 → ⫱g1 ⊆ f2. +#g1 #g2 #H #f2 #H2 +elim (gr_sle_inv_next_dx … H … H2) -H -H2 * // +qed. + +(*** sle_tl *) +lemma gr_sle_tl: + ∀f1,f2. f1 ⊆ f2 → ⫱f1 ⊆ ⫱f2. +#f1 elim (gr_map_split_tl f1) #H1 #f2 #H +[ lapply (gr_sle_push_sn_tl … H … H1) -H // +| elim (gr_sle_inv_next_sn … H … H1) -H // +] +qed. + +(* Inversion lemmas with tail ***********************************************) + +(*** sle_inv_tl_sn *) +lemma gr_sle_inv_tl_sn: + ∀f1,f2. ⫱f1 ⊆ f2 → f1 ⊆ ↑f2. +#f1 elim (gr_map_split_tl f1) #H #f2 #Hf12 +/2 width=5 by gr_sle_next, gr_sle_weak/ +qed-. + +(*** sle_inv_tl_dx *) +lemma gr_sle_inv_tl_dx: + ∀f1,f2. f1 ⊆ ⫱f2 → ⫯f1 ⊆ f2. +#f1 #f2 elim (gr_map_split_tl f2) #H #Hf12 +/2 width=5 by gr_sle_push, gr_sle_weak/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_eq.ma new file mode 100644 index 000000000..244ee713a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_eq.ma @@ -0,0 +1,60 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_sle.ma". +(**) (* this should go first *) +include "ground/relocation/gr_tl_eq.ma". + +(* INCLUSION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *********************************************************) + +(*** sle_eq_repl_back1 *) +corec lemma gr_sle_eq_repl_back_sn: + ∀f2:gr_map. gr_eq_repl_back … (λf1:gr_map. f1 ⊆ f2). +#f2 #f1 * -f2 -f1 +#f1 #f2 #g1 #g2 #Hf #H1 #H2 #g #H0 +[ cases (gr_eq_inv_push_sn … H0 … H1) -g1 /3 width=5 by gr_sle_push/ +| cases (gr_eq_inv_next_sn … H0 … H1) -g1 /3 width=5 by gr_sle_next/ +| cases (gr_eq_inv_push_sn … H0 … H1) -g1 /3 width=5 by gr_sle_weak/ +] +qed-. + +(*** sle_eq_repl_fwd1 *) +lemma gr_sle_eq_repl_fwd_sn: + ∀f2. gr_eq_repl_fwd … (λf1. f1 ⊆ f2). +#f2 @gr_eq_repl_sym /2 width=3 by gr_sle_eq_repl_back_sn/ +qed-. + +(*** sle_eq_repl_back2 *) +corec lemma gr_sle_eq_repl_back_dx: + ∀f1. gr_eq_repl_back … (λf2. f1 ⊆ f2). +#f1 #f2 * -f1 -f2 +#f1 #f2 #g1 #g2 #Hf #H1 #H2 #g #H0 +[ cases (gr_eq_inv_push_sn … H0 … H2) -g2 /3 width=5 by gr_sle_push/ +| cases (gr_eq_inv_next_sn … H0 … H2) -g2 /3 width=5 by gr_sle_next/ +| cases (gr_eq_inv_next_sn … H0 … H2) -g2 /3 width=5 by gr_sle_weak/ +] +qed-. + +(*** sle_eq_repl_fwd2 *) +lemma gr_sle_eq_repl_fwd_dx: + ∀f1. gr_eq_repl_fwd … (λf2. f1 ⊆ f2). +#f1 @gr_eq_repl_sym /2 width=3 by gr_sle_eq_repl_back_dx/ +qed-. + +(*** sle_refl_eq *) +lemma gr_sle_refl_eq: + ∀f1,f2. f1 ≡ f2 → f1 ⊆ f2. +/2 width=3 by gr_sle_eq_repl_back_dx/ qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isd.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isd.ma new file mode 100644 index 000000000..27211194b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isd.ma @@ -0,0 +1,40 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isd.ma". +include "ground/relocation/gr_sle.ma". + +(* INCLUSION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with isdiv ****************************************************) + +(*** sle_isdiv_dx *) +corec lemma gr_sle_isd_dx: + ∀f2. 𝛀❪f2❫ → ∀f1. f1 ⊆ f2. +#f2 * -f2 +#f2 #g2 #Hf2 #H2 #f1 cases (gr_map_split_tl f1) * +/3 width=5 by gr_sle_weak, gr_sle_next/ +qed. + +(* Inversion lemmas with isdiv **********************************************) + +(*** sle_inv_isdiv_sn *) +corec lemma gr_sle_inv_isd_sn: + ∀f1,f2. f1 ⊆ f2 → 𝛀❪f1❫ → 𝛀❪f2❫. +#f1 #f2 * -f1 -f2 +#f1 #f2 #g1 #g2 #Hf * * #H +[1,3: elim (gr_isd_inv_push … H) // ] +lapply (gr_isd_inv_next … H ??) -H +/3 width=3 by gr_isd_next/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isi.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isi.ma new file mode 100644 index 000000000..b05a5da6c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_isi.ma @@ -0,0 +1,40 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isi.ma". +include "ground/relocation/gr_sle.ma". + +(* INCLUSION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with isid *****************************************************) + +(*** sle_isid_sn *) +corec lemma gr_sle_isi_sn: + ∀f1. 𝐈❪f1❫ → ∀f2. f1 ⊆ f2. +#f1 * -f1 +#f1 #g1 #Hf1 #H1 #f2 cases (gr_map_split_tl f2) * +/3 width=5 by gr_sle_weak, gr_sle_push/ +qed. + +(* Inversion lemmas with isid ***********************************************) + +(*** sle_inv_isid_dx *) +corec lemma gr_sle_inv_isi_dx: + ∀f1,f2. f1 ⊆ f2 → 𝐈❪f2❫ → 𝐈❪f1❫. +#f1 #f2 * -f1 -f2 +#f1 #f2 #g1 #g2 #Hf * * #H +[2,3: elim (gr_isi_inv_next … H) // ] +lapply (gr_isi_inv_push … H ??) -H +/3 width=3 by gr_isi_push/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_pushs.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_pushs.ma new file mode 100644 index 000000000..e31471cad --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_pushs.ma @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_pushs.ma". +include "ground/relocation/gr_sle.ma". + +(* INCLUSION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with iterated push ********************************************) + +(*** sle_pushs *) +lemma gr_sle_pushs: + ∀f1,f2. f1 ⊆ f2 → ∀n. ⫯*[n] f1 ⊆ ⫯*[n] f2. +#f1 #f2 #Hf12 #n @(nat_ind_succ … n) -n +/2 width=5 by gr_sle_push/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_sle.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_sle.ma new file mode 100644 index 000000000..eeebb6dae --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_sle.ma @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_sle.ma". + +(* INCLUSION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Main properties **********************************************************) + +(*** sle_trans *) +corec theorem gr_sle_trans: + Transitive … gr_sle. +#f1 #f * -f1 -f +#f1 #f #g1 #g #Hf #H1 #H #g2 #H0 +[ cases (gr_sle_inv_push_sn … H0 … H) * +|*: cases (gr_sle_inv_next_sn … H0 … H) +] -g +/3 width=5 by gr_sle_push, gr_sle_next, gr_sle_weak/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_tls.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_tls.ma new file mode 100644 index 000000000..102c37ceb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sle_tls.ma @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tls.ma". +include "ground/relocation/gr_sle.ma". + +(* INCLUSION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with iterated tail ********************************************) + +(*** sle_tls *) +lemma gr_sle_tls: + ∀f1,f2. f1 ⊆ f2 → ∀n. ⫱*[n] f1 ⊆ ⫱*[n] f2. +#f1 #f2 #Hf12 #n @(nat_ind_succ … n) -n +/2 width=5 by gr_sle_tl/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor.ma new file mode 100644 index 000000000..7152502c2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor.ma @@ -0,0 +1,340 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/runion_3.ma". +include "ground/xoa/or_3.ma". +include "ground/xoa/ex_3_2.ma". +include "ground/relocation/gr_tl.ma". + +(* RELATIONAL UNION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(*** sor *) +coinductive gr_sor: relation3 gr_map gr_map gr_map ≝ +(*** sor_pp *) +| gr_sor_push_bi (f1) (f2) (f) (g1) (g2) (g): + gr_sor f1 f2 f → ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → gr_sor g1 g2 g +(*** sor_np *) +| gr_sor_next_push (f1) (f2) (f) (g1) (g2) (g): + gr_sor f1 f2 f → ↑f1 = g1 → ⫯f2 = g2 → ↑f = g → gr_sor g1 g2 g +(*** sor_pn *) +| gr_sor_push_next (f1) (f2) (f) (g1) (g2) (g): + gr_sor f1 f2 f → ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → gr_sor g1 g2 g +(*** sor_nn *) +| gr_sor_next_bi (f1) (f2) (f) (g1) (g2) (g): + gr_sor f1 f2 f → ↑f1 = g1 → ↑f2 = g2 → ↑f = g → gr_sor g1 g2 g +. + +interpretation + "relational union (generic relocation maps)" + 'RUnion f1 f2 f = (gr_sor f1 f2 f). + +(* Basic properties *********************************************************) + +(*** sor_idem *) +corec lemma gr_sor_idem: + ∀f. f ⋓ f ≘ f. +#f cases (gr_map_split_tl f) #H +[ @(gr_sor_push_bi … H H H) +| @(gr_sor_next_bi … H H H) +] -H // +qed. + +(*** sor_comm *) +corec lemma gr_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 +[ @gr_sor_push_bi | @gr_sor_push_next | @gr_sor_next_push | @gr_sor_next_bi ] /2 width=7 by/ +qed-. + +(* Basic inversion lemmas ***************************************************) + +(*** sor_inv_ppx *) +lemma gr_sor_inv_push_bi: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → + ∃∃f. f1 ⋓ f2 ≘ f & ⫯f = g. +#g1 #g2 #g * -g1 -g2 -g +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct +try (>(eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. + +(*** sor_inv_npx *) +lemma gr_sor_inv_next_push: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → + ∃∃f. f1 ⋓ f2 ≘ f & ↑f = g. +#g1 #g2 #g * -g1 -g2 -g +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct +try (>(eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. + +(*** sor_inv_pnx *) +lemma gr_sor_inv_push_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → + ∃∃f. f1 ⋓ f2 ≘ f & ↑f = g. +#g1 #g2 #g * -g1 -g2 -g +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct +try (>(eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. + +(*** sor_inv_nnx *) +lemma gr_sor_inv_next_bi: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → + ∃∃f. f1 ⋓ f2 ≘ f & ↑f = g. +#g1 #g2 #g * -g1 -g2 -g +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct +try (>(eq_inv_gr_push_bi … Hx1) -x1) try (>(eq_inv_gr_next_bi … Hx1) -x1) +try elim (eq_inv_gr_push_next … Hx1) try elim (eq_inv_gr_next_push … Hx1) +try (>(eq_inv_gr_push_bi … Hx2) -x2) try (>(eq_inv_gr_next_bi … Hx2) -x2) +try elim (eq_inv_gr_push_next … Hx2) try elim (eq_inv_gr_next_push … Hx2) +/2 width=3 by ex2_intro/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +(*** sor_inv_ppn *) +lemma gr_sor_inv_push_bi_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ↑f = g → ⊥. +#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 +elim (gr_sor_inv_push_bi … H … H1 H2) -g1 -g2 #x #_ #H destruct +/2 width=3 by eq_inv_gr_push_next/ +qed-. + +(*** sor_inv_nxp *) +lemma gr_sor_inv_next_sn_push: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f. ↑f1 = g1 → ⫯f = g → ⊥. +#g1 #g2 #g #H #f1 #f #H1 #H0 +elim (gr_map_split_tl g2) #H2 +[ elim (gr_sor_inv_next_push … H … H1 H2) +| elim (gr_sor_inv_next_bi … H … H1 H2) +] -g1 #x #H +/2 width=3 by eq_inv_gr_next_push/ +qed-. + +(*** sor_inv_xnp *) +lemma gr_sor_inv_next_dx_push: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f2,f. ↑f2 = g2 → ⫯f = g → ⊥. +#g1 #g2 #g #H #f2 #f #H2 #H0 +elim (gr_map_split_tl g1) #H1 +[ elim (gr_sor_inv_push_next … H … H1 H2) +| elim (gr_sor_inv_next_bi … H … H1 H2) +] -g2 #x #H +/2 width=3 by eq_inv_gr_next_push/ +qed-. + +(*** sor_inv_ppp *) +lemma gr_sor_inv_push_bi_push: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → f1 ⋓ f2 ≘ f. +#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 +elim (gr_sor_inv_push_bi … H … H1 H2) -g1 -g2 #x #Hx #H destruct +<(eq_inv_gr_push_bi … H) -f // +qed-. + +(*** sor_inv_npn *) +lemma gr_sor_inv_next_push_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f2,f. ↑f1 = g1 → ⫯f2 = g2 → ↑f = g → f1 ⋓ f2 ≘ f. +#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 +elim (gr_sor_inv_next_push … H … H1 H2) -g1 -g2 #x #Hx #H destruct +<(eq_inv_gr_next_bi … H) -f // +qed-. + +(*** sor_inv_pnn *) +lemma gr_sor_inv_push_next_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ⋓ f2 ≘ f. +#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 +elim (gr_sor_inv_push_next … H … H1 H2) -g1 -g2 #x #Hx #H destruct +<(eq_inv_gr_next_bi … H) -f // +qed-. + +(*** sor_inv_nnn *) +lemma gr_sor_inv_next_bi_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f2,f. ↑f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ⋓ f2 ≘ f. +#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 +elim (gr_sor_inv_next_bi … H … H1 H2) -g1 -g2 #x #Hx #H destruct +<(eq_inv_gr_next_bi … H) -f // +qed-. + +(*** sor_inv_pxp *) +lemma gr_sor_inv_push_sn_push: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f. ⫯f1 = g1 → ⫯f = g → + ∃∃f2. f1 ⋓ f2 ≘ f & ⫯f2 = g2. +#g1 #g2 #g #H #f1 #f #H1 #H0 +elim (gr_map_split_tl g2) #H2 +[ /3 width=7 by gr_sor_inv_push_bi_push, ex2_intro/ +| elim (gr_sor_inv_next_dx_push … H … H2 H0) +] +qed-. + +(*** sor_inv_xpp *) +lemma gr_sor_inv_push_dx_push: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f2,f. ⫯f2 = g2 → ⫯f = g → + ∃∃f1. f1 ⋓ f2 ≘ f & ⫯f1 = g1. +#g1 #g2 #g #H #f2 #f #H2 #H0 +elim (gr_map_split_tl g1) #H1 +[ /3 width=7 by gr_sor_inv_push_bi_push, ex2_intro/ +| elim (gr_sor_inv_next_sn_push … H … H1 H0) +] +qed-. + +(*** sor_inv_pxn *) +lemma gr_sor_inv_push_sn_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f. ⫯f1 = g1 → ↑f = g → + ∃∃f2. f1 ⋓ f2 ≘ f & ↑f2 = g2. +#g1 #g2 #g #H #f1 #f #H1 #H0 +elim (gr_map_split_tl g2) #H2 +[ elim (gr_sor_inv_push_bi_next … H … H1 H2 H0) +| /3 width=7 by gr_sor_inv_push_next_next, ex2_intro/ +] +qed-. + +(*** sor_inv_xpn *) +lemma gr_sor_inv_push_dx_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f2,f. ⫯f2 = g2 → ↑f = g → + ∃∃f1. f1 ⋓ f2 ≘ f & ↑f1 = g1. +#g1 #g2 #g #H #f2 #f #H2 #H0 +elim (gr_map_split_tl g1) #H1 +[ elim (gr_sor_inv_push_bi_next … H … H1 H2 H0) +| /3 width=7 by gr_sor_inv_next_push_next, ex2_intro/ +] +qed-. + +(*** sor_inv_xxp *) +lemma gr_sor_inv_push: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f. ⫯f = g → + ∃∃f1,f2. f1 ⋓ f2 ≘ f & ⫯f1 = g1 & ⫯f2 = g2. +#g1 #g2 #g #H #f #H0 +elim (gr_map_split_tl g1) #H1 +[ elim (gr_sor_inv_push_sn_push … H … H1 H0) -g /2 width=5 by ex3_2_intro/ +| elim (gr_sor_inv_next_sn_push … H … H1 H0) +] +qed-. + +(*** sor_inv_nxn *) +lemma gr_sor_inv_next_sn_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f1,f. ↑f1 = g1 → ↑f = g → + ∨∨ ∃∃f2. f1 ⋓ f2 ≘ f & ⫯f2 = g2 + | ∃∃f2. f1 ⋓ f2 ≘ f & ↑f2 = g2. +#g1 #g2 elim (gr_map_split_tl g2) +/4 width=7 by gr_sor_inv_next_push_next, gr_sor_inv_next_bi_next, ex2_intro, or_intror, or_introl/ +qed-. + +(*** sor_inv_xnn *) +lemma gr_sor_inv_next_dx_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → + ∀f2,f. ↑f2 = g2 → ↑f = g → + ∨∨ ∃∃f1. f1 ⋓ f2 ≘ f & ⫯f1 = g1 + | ∃∃f1. f1 ⋓ f2 ≘ f & ↑f1 = g1. +#g1 elim (gr_map_split_tl g1) +/4 width=7 by gr_sor_inv_push_next_next, gr_sor_inv_next_bi_next, ex2_intro, or_intror, or_introl/ +qed-. + +(*** sor_inv_xxn *) +lemma gr_sor_inv_next: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f. ↑f = g → + ∨∨ ∃∃f1,f2. f1 ⋓ f2 ≘ f & ↑f1 = g1 & ⫯f2 = g2 + | ∃∃f1,f2. f1 ⋓ f2 ≘ f & ⫯f1 = g1 & ↑f2 = g2 + | ∃∃f1,f2. f1 ⋓ f2 ≘ f & ↑f1 = g1 & ↑f2 = g2. +#g1 #g2 #g #H #f #H0 +elim (gr_map_split_tl g1) #H1 +[ elim (gr_sor_inv_push_sn_next … H … H1 H0) -g + /3 width=5 by or3_intro1, ex3_2_intro/ +| elim (gr_sor_inv_next_sn_next … H … H1 H0) -g * + /3 width=5 by or3_intro0, or3_intro2, ex3_2_intro/ +] +qed-. + +(* Properties with tail *****************************************************) + +(*** sor_tl *) +lemma gr_sor_tl: + ∀f1,f2,f. f1 ⋓ f2 ≘ f → ⫱f1 ⋓ ⫱f2 ≘ ⫱f. +#f1 cases (gr_map_split_tl f1) #H1 +#f2 cases (gr_map_split_tl f2) #H2 +#f #Hf +[ cases (gr_sor_inv_push_bi … Hf … H1 H2) +| cases (gr_sor_inv_push_next … Hf … H1 H2) +| cases (gr_sor_inv_next_push … Hf … H1 H2) +| cases (gr_sor_inv_next_bi … Hf … H1 H2) +] -Hf #g #Hg #H destruct // +qed. + +(*** sor_xxn_tl *) +lemma gr_sor_next_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 (gr_sor_inv_next … H … H0) -H -H0 * +/3 width=5 by ex3_2_intro, or_introl, or_intror/ +qed-. + +(*** sor_xnx_tl *) +lemma gr_sor_next_dx_tl: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f2. ↑f2 = g2 → + ∃∃f1,f. f1 ⋓ f2 ≘ f & ⫱g1 = f1 & ↑f = g. +#g1 elim (gr_map_split_tl g1) #H1 #g2 #g #H #f2 #H2 +[ elim (gr_sor_inv_push_next … H … H1 H2) +| elim (gr_sor_inv_next_bi … H … H1 H2) +] -g2 +/3 width=5 by ex3_2_intro/ +qed-. + +(*** sor_nxx_tl *) +lemma gr_sor_next_sn_tl: + ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1. ↑f1 = g1 → + ∃∃f2,f. f1 ⋓ f2 ≘ f & ⫱g2 = f2 & ↑f = g. +#g1 #g2 elim (gr_map_split_tl g2) #H2 #g #H #f1 #H1 +[ elim (gr_sor_inv_next_push … H … H1 H2) +| elim (gr_sor_inv_next_bi … H … H1 H2) +] -g1 +/3 width=5 by ex3_2_intro/ +qed-. + +(* Inversion lemmas with tail ***********************************************) + +(*** sor_inv_tl_sn *) +lemma gr_sor_inv_tl_sn: + ∀f1,f2,f. ⫱f1 ⋓ f2 ≘ f → f1 ⋓ ↑f2 ≘ ↑f. +#f1 #f2 #f elim (gr_map_split_tl f1) +/2 width=7 by gr_sor_push_next, gr_sor_next_bi/ +qed-. + +(*** sor_inv_tl_dx *) +lemma gr_sor_inv_tl_dx: + ∀f1,f2,f. f1 ⋓ ⫱f2 ≘ f → ↑f1 ⋓ f2 ≘ ↑f. +#f1 #f2 #f elim (gr_map_split_tl f2) +/2 width=7 by gr_sor_next_push, gr_sor_next_bi/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_coafter_ist_isf.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_coafter_ist_isf.ma new file mode 100644 index 000000000..4595f8f8f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_coafter_ist_isf.ma @@ -0,0 +1,76 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_isf.ma". +include "ground/relocation/gr_coafter_isi.ma". +include "ground/relocation/gr_coafter_ist_isi.ma". +include "ground/relocation/gr_sor_isi.ma". + +(* RELATIONAL UNION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with coafter and ist and isf ****************************************************) + +(*** coafter_sor *) +lemma gr_sor_coafter_dx_tans: + ∀f. 𝐅❪f❫ → ∀f2. 𝐓❪f2❫ → ∀f1. f2 ~⊚ f1 ≘ f → ∀f1a,f1b. f1a ⋓ f1b ≘ f1 → + ∃∃fa,fb. f2 ~⊚ f1a ≘ fa & f2 ~⊚ f1b ≘ fb & fa ⋓ fb ≘ f. +@gr_isf_ind +[ #f #Hf #f2 #Hf2 #f1 #Hf #f1a #f1b #Hf1 + lapply (gr_coafter_des_ist_sn_isi … Hf ??) -Hf // #H2f1 + elim (gr_sor_inv_isi … Hf1) -Hf1 // + /3 width=5 by gr_coafter_isi_dx, gr_sor_idem, ex3_2_intro/ +| #f #_ #IH #f2 #Hf2 #f1 #H1 #f1a #f1b #H2 + elim (gr_coafter_inv_push … H1) -H1 [1,3: * |*: // ] + [ #g2 #g1 #Hf #Hgf2 #Hgf1 + elim (gr_sor_inv_push … H2) -H2 [ |*: // ] #ga #gb #Hg1 + lapply (gr_ist_inv_push … Hf2 … Hgf2) -Hf2 #Hg2 + elim (IH … Hf … Hg1) // -f1 -g1 -IH -Hg2 + /3 width=11 by gr_coafter_refl, gr_sor_push_bi, ex3_2_intro/ + | #g2 #Hf #Hgf2 + lapply (gr_ist_inv_next … Hf2 … Hgf2) -Hf2 #Hg2 + elim (IH … Hf … H2) // -f1 -IH -Hg2 + /3 width=11 by gr_coafter_next, gr_sor_push_bi, ex3_2_intro/ + ] +| #f #_ #IH #f2 #Hf2 #f1 #H1 #f1a #f1b #H2 + elim (gr_coafter_inv_next … H1) -H1 [ |*: // ] #g2 #g1 #Hf #Hgf2 #Hgf1 + lapply (gr_ist_inv_push … Hf2 … Hgf2) -Hf2 #Hg2 + elim (gr_sor_inv_next … H2) -H2 [1,3,4: * |*: // ] #ga #gb #Hg1 + elim (IH … Hf … Hg1) // -f1 -g1 -IH -Hg2 + /3 width=11 by gr_coafter_refl, gr_coafter_push, gr_sor_next_push, gr_sor_push_next, gr_sor_next_bi, ex3_2_intro/ +] +qed-. + +(*** coafter_inv_sor *) +lemma gr_sor_coafter_div: + ∀f. 𝐅❪f❫ → ∀f2. 𝐓❪f2❫ → ∀f1. f2 ~⊚ f1 ≘ f → ∀fa,fb. fa ⋓ fb ≘ f → + ∃∃f1a,f1b. f2 ~⊚ f1a ≘ fa & f2 ~⊚ f1b ≘ fb & f1a ⋓ f1b ≘ f1. +@gr_isf_ind +[ #f #Hf #f2 #Hf2 #f1 #H1f #fa #fb #H2f + elim (gr_sor_inv_isi … H2f) -H2f // + lapply (gr_coafter_des_ist_sn_isi … H1f ??) -H1f // + /3 width=5 by ex3_2_intro, gr_coafter_isi_dx, gr_sor_isi_bi_isi/ +| #f #_ #IH #f2 #Hf2 #f1 #H1 #fa #fb #H2 + elim (gr_sor_inv_push … H2) -H2 [ |*: // ] #ga #gb #H2f + elim (gr_coafter_inv_push … H1) -H1 [1,3: * |*: // ] #g2 [ #g1 ] #H1f #Hgf2 + [ lapply (gr_ist_inv_push … Hf2 … Hgf2) | lapply (gr_ist_inv_next … Hf2 … Hgf2) ] -Hf2 #Hg2 + elim (IH … Hg2 … H1f … H2f) -f -Hg2 + /3 width=11 by gr_sor_push_bi, ex3_2_intro, gr_coafter_refl, gr_coafter_next/ +| #f #_ #IH #f2 #Hf2 #f1 #H1 #fa #fb #H2 + elim (gr_coafter_inv_next … H1) -H1 [ |*: // ] #g2 #g1 #H1f #Hgf2 + lapply (gr_ist_inv_push … Hf2 … Hgf2) -Hf2 #Hg2 + elim (gr_sor_inv_next … H2) -H2 [1,3,4: * |*: // ] #ga #gb #H2f + elim (IH … Hg2 … H1f … H2f) -f -Hg2 + /3 width=11 by gr_sor_next_push, gr_sor_push_next, gr_sor_next_bi, ex3_2_intro, gr_coafter_refl, gr_coafter_push/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_eq.ma new file mode 100644 index 000000000..1e9f130c2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_eq.ma @@ -0,0 +1,65 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/gr_tl_eq.ma". +include "ground/relocation/gr_sor.ma". + +(* RELATIONAL UNION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with gr_eq *********************************************************) + +(*** sor_eq_repl_back1 *) +corec lemma gr_sor_eq_repl_back_sn: + ∀f2,f. gr_eq_repl_back … (λf1. f1 ⋓ f2 ≘ f). +#f2 #f #f1 * -f1 -f2 -f +#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x #Hx +try cases (gr_eq_inv_push_sn … Hx … H1) try cases (gr_eq_inv_next_sn … Hx … H1) -g1 +/3 width=7 by gr_sor_push_bi, gr_sor_next_push, gr_sor_push_next, gr_sor_next_bi/ +qed-. + +(*** sor_eq_repl_fwd1 *) +lemma gr_sor_eq_repl_fwd_sn: + ∀f2,f. gr_eq_repl_fwd … (λf1. f1 ⋓ f2 ≘ f). +#f2 #f @gr_eq_repl_sym /2 width=3 by gr_sor_eq_repl_back_sn/ +qed-. + +(*** sor_eq_repl_back2 *) +corec lemma gr_sor_eq_repl_back_dx: + ∀f1,f. gr_eq_repl_back … (λf2. f1 ⋓ f2 ≘ f). +#f1 #f #f2 * -f1 -f2 -f +#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx +try cases (gr_eq_inv_push_sn … Hx … H2) try cases (gr_eq_inv_next_sn … Hx … H2) -g2 +/3 width=7 by gr_sor_push_bi, gr_sor_next_push, gr_sor_push_next, gr_sor_next_bi/ +qed-. + +(*** sor_eq_repl_fwd2 *) +lemma gr_sor_eq_repl_fwd_dx: + ∀f1,f. gr_eq_repl_fwd … (λf2. f1 ⋓ f2 ≘ f). +#f1 #f @gr_eq_repl_sym /2 width=3 by gr_sor_eq_repl_back_dx/ +qed-. + +(*** sor_eq_repl_back3 *) +corec lemma gr_sor_eq_repl_back: + ∀f1,f2. gr_eq_repl_back … (λf. f1 ⋓ f2 ≘ f). +#f1 #f2 #f * -f1 -f2 -f +#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx +try cases (gr_eq_inv_push_sn … Hx … H0) try cases (gr_eq_inv_next_sn … Hx … H0) -g +/3 width=7 by gr_sor_push_bi, gr_sor_next_push, gr_sor_push_next, gr_sor_next_bi/ +qed-. + +(*** sor_eq_repl_fwd3 *) +lemma gr_sor_eq_repl_fwd: + ∀f1,f2. gr_eq_repl_fwd … (λf. f1 ⋓ f2 ≘ f). +#f1 #f2 @gr_eq_repl_sym /2 width=3 by gr_sor_eq_repl_back/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_fcla.ma b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_fcla.ma new file mode 100644 index 000000000..a1b8e8feb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground/relocation/gr_sor_fcla.ma @@ -0,0 +1,71 @@ +(**************************************************************************) +(* ___ *) +(* ||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_1.ma". +include "ground/xoa/ex_4_2.ma". +include "ground/arith/nat_plus.ma". +include "ground/arith/nat_le_max.ma". +include "ground/relocation/gr_fcla_eq.ma". +include "ground/relocation/gr_sor_isi.ma". + +(* RELATIONAL UNION FOR GENERIC RELOCATION MAPS ***********************************************************) + +(* Properties with finite colength assignment *******************************) + +(*** sor_fcla_ex *) +lemma gr_sor_fcla_bi: + ∀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 gr_sor_isi_sn, ex4_2_intro/ +#f1 #n1 #Hf1 #IH #f2 #n2 * -f2 -n2 /3 width=6 by gr_fcla_push, gr_fcla_next, ex4_2_intro, gr_sor_isi_dx/ +#f2 #n2 #Hf2 elim (IH … Hf2) -IH -Hf2 -Hf1 [2,4: #f #n (injective_push … Hx1) >(injective_push … Hx2) -x2 -x1 - /2 width=3 by ex2_intro/ -| #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct - elim (discr_push_next … Hx2) -| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct - elim (discr_push_next … Hx1) -] -qed-. - -lemma after_inv_pnx: ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → - ∃∃f. f1 ⊚ f2 ≘ f & ↑f = g. -#g1 #g2 #g * -g1 -g2 -g #f1 #f2 #f #g1 -[ #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct - elim (discr_next_push … Hx2) -| #g2 #g #Hf #H1 #H2 #H3 #x1 #x2 #Hx1 #Hx2 destruct - >(injective_push … Hx1) >(injective_next … Hx2) -x2 -x1 - /2 width=3 by ex2_intro/ -| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct - elim (discr_push_next … Hx1) -] -qed-. - -lemma after_inv_nxx: ∀g1,f2,g. g1 ⊚ f2 ≘ g → ∀f1. ↑f1 = g1 → - ∃∃f. f1 ⊚ f2 ≘ f & ↑f = g. -#g1 #f2 #g * -g1 -f2 -g #f1 #f2 #f #g1 -[ #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct - elim (discr_next_push … Hx1) -| #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct - elim (discr_next_push … Hx1) -| #g #Hf #H1 #H #x1 #Hx1 destruct - >(injective_next … Hx1) -x1 - /2 width=3 by ex2_intro/ -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma after_inv_ppp: ∀g1,g2,g. g1 ⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → f1 ⊚ f2 ≘ f. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (after_inv_ppx … Hg … H1 H2) -g1 -g2 -#x #Hf #Hx destruct <(injective_push … Hx) -f // -qed-. - -lemma after_inv_ppn: ∀g1,g2,g. g1 ⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ↑f = g → ⊥. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (after_inv_ppx … Hg … H1 H2) -g1 -g2 -#x #Hf #Hx destruct elim (discr_push_next … Hx) -qed-. - -lemma after_inv_pnn: ∀g1,g2,g. g1 ⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ⊚ f2 ≘ f. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (after_inv_pnx … Hg … H1 H2) -g1 -g2 -#x #Hf #Hx destruct <(injective_next … Hx) -f // -qed-. - -lemma after_inv_pnp: ∀g1,g2,g. g1 ⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ⫯f = g → ⊥. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H elim (after_inv_pnx … Hg … H1 H2) -g1 -g2 -#x #Hf #Hx destruct elim (discr_next_push … Hx) -qed-. - -lemma after_inv_nxn: ∀g1,f2,g. g1 ⊚ f2 ≘ g → - ∀f1,f. ↑f1 = g1 → ↑f = g → f1 ⊚ f2 ≘ f. -#g1 #f2 #g #Hg #f1 #f #H1 #H elim (after_inv_nxx … Hg … H1) -g1 -#x #Hf #Hx destruct <(injective_next … Hx) -f // -qed-. - -lemma after_inv_nxp: ∀g1,f2,g. g1 ⊚ f2 ≘ g → - ∀f1,f. ↑f1 = g1 → ⫯f = g → ⊥. -#g1 #f2 #g #Hg #f1 #f #H1 #H elim (after_inv_nxx … Hg … H1) -g1 -#x #Hf #Hx destruct elim (discr_next_push … Hx) -qed-. - -lemma after_inv_pxp: ∀g1,g2,g. g1 ⊚ g2 ≘ g → - ∀f1,f. ⫯f1 = g1 → ⫯f = g → - ∃∃f2. f1 ⊚ f2 ≘ f & ⫯f2 = g2. -#g1 * * [2: #m2] #g2 #g #Hg #f1 #f #H1 #H -[ elim (after_inv_pnp … Hg … H1 … H) -g1 -g -f1 -f // -| lapply (after_inv_ppp … Hg … H1 … H) -g1 -g /2 width=3 by ex2_intro/ -] -qed-. - -lemma after_inv_pxn: ∀g1,g2,g. g1 ⊚ g2 ≘ g → - ∀f1,f. ⫯f1 = g1 → ↑f = g → - ∃∃f2. f1 ⊚ f2 ≘ f & ↑f2 = g2. -#g1 * * [2: #m2] #g2 #g #Hg #f1 #f #H1 #H -[ lapply (after_inv_pnn … Hg … H1 … H) -g1 -g /2 width=3 by ex2_intro/ -| elim (after_inv_ppn … Hg … H1 … H) -g1 -g -f1 -f // -] -qed-. - -lemma after_inv_xxp: ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f. ⫯f = g → - ∃∃f1,f2. f1 ⊚ f2 ≘ f & ⫯f1 = g1 & ⫯f2 = g2. -* * [2: #m1 ] #g1 #g2 #g #Hg #f #H -[ elim (after_inv_nxp … Hg … H) -g2 -g -f // -| elim (after_inv_pxp … Hg … H) -g /2 width=5 by ex3_2_intro/ -] -qed-. - -lemma after_inv_xxn: ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f. ↑f = g → - (∃∃f1,f2. f1 ⊚ f2 ≘ f & ⫯f1 = g1 & ↑f2 = g2) ∨ - ∃∃f1. f1 ⊚ g2 ≘ f & ↑f1 = g1. -* * [2: #m1 ] #g1 #g2 #g #Hg #f #H -[ /4 width=5 by after_inv_nxn, or_intror, ex2_intro/ -| elim (after_inv_pxn … Hg … H) -g - /3 width=5 by or_introl, ex3_2_intro/ -] -qed-. - -lemma after_inv_pxx: ∀g1,g2,g. g1 ⊚ g2 ≘ g → ∀f1. ⫯f1 = g1 → - (∃∃f2,f. f1 ⊚ f2 ≘ f & ⫯f2 = g2 & ⫯f = g) ∨ - (∃∃f2,f. f1 ⊚ f2 ≘ f & ↑f2 = g2 & ↑f = g). -#g1 * * [2: #m2 ] #g2 #g #Hg #f1 #H -[ elim (after_inv_pnx … Hg … H) -g1 - /3 width=5 by or_intror, ex3_2_intro/ -| elim (after_inv_ppx … Hg … H) -g1 - /3 width=5 by or_introl, ex3_2_intro/ -] -qed-. - -(* Basic properties *********************************************************) - -corec lemma after_eq_repl_back2: ∀f1,f. eq_repl_back (λf2. f2 ⊚ f1 ≘ f). -#f1 #f #f2 * -f2 -f1 -f -#f21 #f1 #f #g21 [1,2: #g1 ] #g #Hf #H21 [1,2: #H1 ] #H #g22 #H0 -[ cases (eq_inv_px … H0 … H21) -g21 /3 width=7 by after_refl/ -| cases (eq_inv_px … H0 … H21) -g21 /3 width=7 by after_push/ -| cases (eq_inv_nx … H0 … H21) -g21 /3 width=5 by after_next/ -] -qed-. - -lemma after_eq_repl_fwd2: ∀f1,f. eq_repl_fwd (λf2. f2 ⊚ f1 ≘ f). -#f1 #f @eq_repl_sym /2 width=3 by after_eq_repl_back2/ -qed-. - -corec lemma after_eq_repl_back1: ∀f2,f. eq_repl_back (λf1. f2 ⊚ f1 ≘ f). -#f2 #f #f1 * -f2 -f1 -f -#f2 #f11 #f #g2 [1,2: #g11 ] #g #Hf #H2 [1,2: #H11 ] #H #g2 #H0 -[ cases (eq_inv_px … H0 … H11) -g11 /3 width=7 by after_refl/ -| cases (eq_inv_nx … H0 … H11) -g11 /3 width=7 by after_push/ -| @(after_next … H2 H) /2 width=5 by/ -] -qed-. - -lemma after_eq_repl_fwd1: ∀f2,f. eq_repl_fwd (λf1. f2 ⊚ f1 ≘ f). -#f2 #f @eq_repl_sym /2 width=3 by after_eq_repl_back1/ -qed-. - -corec lemma after_eq_repl_back0: ∀f1,f2. eq_repl_back (λf. f2 ⊚ f1 ≘ f). -#f2 #f1 #f * -f2 -f1 -f -#f2 #f1 #f01 #g2 [1,2: #g1 ] #g01 #Hf01 #H2 [1,2: #H1 ] #H01 #g02 #H0 -[ cases (eq_inv_px … H0 … H01) -g01 /3 width=7 by after_refl/ -| cases (eq_inv_nx … H0 … H01) -g01 /3 width=7 by after_push/ -| cases (eq_inv_nx … H0 … H01) -g01 /3 width=5 by after_next/ -] -qed-. - -lemma after_eq_repl_fwd0: ∀f2,f1. eq_repl_fwd (λf. f2 ⊚ f1 ≘ f). -#f2 #f1 @eq_repl_sym /2 width=3 by after_eq_repl_back0/ -qed-. - -(* Main properties **********************************************************) - -corec theorem after_trans1: ∀f0,f3,f4. f0 ⊚ f3 ≘ f4 → - ∀f1,f2. f1 ⊚ f2 ≘ f0 → - ∀f. f2 ⊚ f3 ≘ f → f1 ⊚ f ≘ f4. -#f0 #f3 #f4 * -f0 -f3 -f4 #f0 #f3 #f4 #g0 [1,2: #g3 ] #g4 -[ #Hf4 #H0 #H3 #H4 #g1 #g2 #Hg0 #g #Hg - cases (after_inv_xxp … Hg0 … H0) -g0 - #f1 #f2 #Hf0 #H1 #H2 - cases (after_inv_ppx … Hg … H2 H3) -g2 -g3 - #f #Hf #H /3 width=7 by after_refl/ -| #Hf4 #H0 #H3 #H4 #g1 #g2 #Hg0 #g #Hg - cases (after_inv_xxp … Hg0 … H0) -g0 - #f1 #f2 #Hf0 #H1 #H2 - cases (after_inv_pnx … Hg … H2 H3) -g2 -g3 - #f #Hf #H /3 width=7 by after_push/ -| #Hf4 #H0 #H4 #g1 #g2 #Hg0 #g #Hg - cases (after_inv_xxn … Hg0 … H0) -g0 * - [ #f1 #f2 #Hf0 #H1 #H2 - cases (after_inv_nxx … Hg … H2) -g2 - #f #Hf #H /3 width=7 by after_push/ - | #f1 #Hf0 #H1 /3 width=6 by after_next/ - ] -] -qed-. - -corec theorem after_trans2: ∀f1,f0,f4. f1 ⊚ f0 ≘ f4 → - ∀f2, f3. f2 ⊚ f3 ≘ f0 → - ∀f. f1 ⊚ f2 ≘ f → f ⊚ f3 ≘ f4. -#f1 #f0 #f4 * -f1 -f0 -f4 #f1 #f0 #f4 #g1 [1,2: #g0 ] #g4 -[ #Hf4 #H1 #H0 #H4 #g2 #g3 #Hg0 #g #Hg - cases (after_inv_xxp … Hg0 … H0) -g0 - #f2 #f3 #Hf0 #H2 #H3 - cases (after_inv_ppx … Hg … H1 H2) -g1 -g2 - #f #Hf #H /3 width=7 by after_refl/ -| #Hf4 #H1 #H0 #H4 #g2 #g3 #Hg0 #g #Hg - cases (after_inv_xxn … Hg0 … H0) -g0 * - [ #f2 #f3 #Hf0 #H2 #H3 - cases (after_inv_ppx … Hg … H1 H2) -g1 -g2 - #f #Hf #H /3 width=7 by after_push/ - | #f2 #Hf0 #H2 - cases (after_inv_pnx … Hg … H1 H2) -g1 -g2 - #f #Hf #H /3 width=6 by after_next/ - ] -| #Hf4 #H1 #H4 #f2 #f3 #Hf0 #g #Hg - cases (after_inv_nxx … Hg … H1) -g1 - #f #Hg #H /3 width=6 by after_next/ -] -qed-. - -(* Main inversion lemmas ****************************************************) - -corec theorem after_mono: ∀f1,f2,x,y. f1 ⊚ f2 ≘ x → f1 ⊚ f2 ≘ y → x ≡ y. -#f1 #f2 #x #y * -f1 -f2 -x -#f1 #f2 #x #g1 [1,2: #g2 ] #g #Hx #H1 [1,2: #H2 ] #H0x #Hy -[ cases (after_inv_ppx … Hy … H1 H2) -g1 -g2 /3 width=8 by eq_push/ -| cases (after_inv_pnx … Hy … H1 H2) -g1 -g2 /3 width=8 by eq_next/ -| cases (after_inv_nxx … Hy … H1) -g1 /3 width=8 by eq_next/ -] -qed-. - -lemma after_mono_eq: ∀f1,f2,f. f1 ⊚ f2 ≘ f → ∀g1,g2,g. g1 ⊚ g2 ≘ g → - f1 ≡ g1 → f2 ≡ g2 → f ≡ g. -/4 width=4 by after_mono, after_eq_repl_back1, after_eq_repl_back2/ qed-. - -(* Properties on tls ********************************************************) - -(* Note: this requires ↑ on first n *) -lemma after_tls: ∀n,f1,f2,f. @❪𝟏, f1❫ ≘ ↑n → - f1 ⊚ f2 ≘ f → ⫱*[n]f1 ⊚ f2 ≘ ⫱*[n]f. -#n @(nat_ind_succ … n) -n // -#n #IH #f1 #f2 #f #Hf1 #Hf -cases (at_inv_pxn … Hf1) -Hf1 [ |*: // ] #g1 #Hg1 #H1 -cases (after_inv_nxx … Hf … H1) -Hf #g #Hg #H0 destruct -nsucc_inj - elim (at_inv_xxn … Hf2) -Hf2 [1,3: * |*: // ] - [ #g2 #j1 #Hg2 #H1 #H2 destruct >nsucc_inj in Hf; #Hf - elim (after_inv_pnx … Hf) -Hf [ |*: // ] #g #Hg #H destruct - nsucc_inj #Hf - elim (after_inv_nxx … Hf) -Hf [2,3: // ] #g #Hg #H destruct - elim (at_inv_xxn … Hf2) -Hf2 [1,3: * |*: // ] - [ #g2 #j1 #Hg2 #H1 #H2 destruct (injective_push … Hf) -g destruct /2 width=3 by ex2_intro/ -| #f #i1 #i2 #_ #g #j2 * #_ #x #x1 #_ #H elim (discr_push_next … H) -] -qed-. - -lemma at_inv_xnx: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → ∀g. ↑g = f → - ∃∃j2. @❪i1,g❫ ≘ j2 & ↑j2 = i2. -#f #i1 #i2 * -f -i1 -i2 -[ #f #g #j1 #j2 * #_ #_ #x #H elim (discr_next_push … H) -| #f #i1 #i2 #_ #g #j1 #j2 * #_ #_ #x #H elim (discr_next_push … H) -| #f #i1 #i2 #Hi #g #j2 * * #x #H >(injective_next … H) -g /2 width=3 by ex2_intro/ -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -alias symbol "UpArrow" (instance 3) = "successor (positive integers)". -lemma at_inv_ppn: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → - ∀g,j2. 𝟏 = i1 → ⫯g = f → ↑j2 = i2 → ⊥. -#f #i1 #i2 #Hf #g #j2 #H1 #H <(at_inv_ppx … Hf … H1 H) -f -g -i1 -i2 -#H destruct -qed-. - -alias symbol "UpArrow" (instance 7) = "successor (positive integers)". -lemma at_inv_npp: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → - ∀g,j1. ↑j1 = i1 → ⫯g = f → 𝟏 = i2 → ⊥. -#f #i1 #i2 #Hf #g #j1 #H1 #H elim (at_inv_npx … Hf … H1 H) -f -i1 -#x2 #Hg * -i2 #H destruct -qed-. - -lemma at_inv_npn: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → - ∀g,j1,j2. ↑j1 = i1 → ⫯g = f → ↑j2 = i2 → @❪j1,g❫ ≘ j2. -#f #i1 #i2 #Hf #g #j1 #j2 #H1 #H elim (at_inv_npx … Hf … H1 H) -f -i1 -#x2 #Hg * -i2 #H destruct // -qed-. - -lemma at_inv_xnp: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → - ∀g. ↑g = f → 𝟏 = i2 → ⊥. -#f #i1 #i2 #Hf #g #H elim (at_inv_xnx … Hf … H) -f -#x2 #Hg * -i2 #H destruct -qed-. - -lemma at_inv_xnn: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → - ∀g,j2. ↑g = f → ↑j2 = i2 → @❪i1,g❫ ≘ j2. -#f #i1 #i2 #Hf #g #j2 #H elim (at_inv_xnx … Hf … H) -f -#x2 #Hg * -i2 #H destruct // -qed-. - -lemma at_inv_pxp: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → 𝟏 = i1 → 𝟏 = i2 → ∃g. ⫯g = f. -#f elim (pn_split … f) * /2 width=2 by ex_intro/ -#g #H #i1 #i2 #Hf #H1 #H2 cases (at_inv_xnp … Hf … H H2) -qed-. - -lemma at_inv_pxn: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → ∀j2. 𝟏 = i1 → ↑j2 = i2 → - ∃∃g. @❪i1,g❫ ≘ j2 & ↑g = f. -#f elim (pn_split … f) * -#g #H #i1 #i2 #Hf #j2 #H1 #H2 -[ elim (at_inv_ppn … Hf … H1 H H2) -| /3 width=5 by at_inv_xnn, ex2_intro/ -] -qed-. - -alias symbol "UpArrow" (instance 5) = "successor (positive integers)". -lemma at_inv_nxp: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → - ∀j1. ↑j1 = i1 → 𝟏 = i2 → ⊥. -#f elim (pn_split f) * -#g #H #i1 #i2 #Hf #j1 #H1 #H2 -[ elim (at_inv_npp … Hf … H1 H H2) -| elim (at_inv_xnp … Hf … H H2) -] -qed-. - -lemma at_inv_nxn: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → ∀j1,j2. ↑j1 = i1 → ↑j2 = i2 → - (∃∃g. @❪j1,g❫ ≘ j2 & ⫯g = f) ∨ - ∃∃g. @❪i1,g❫ ≘ j2 & ↑g = f. -#f elim (pn_split f) * -/4 width=7 by at_inv_xnn, at_inv_npn, ex2_intro, or_intror, or_introl/ -qed-. - -(* Note: the following inversion lemmas must be checked *) -lemma at_inv_xpx: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → ∀g. ⫯g = f → - ∨∨ ∧∧ 𝟏 = i1 & 𝟏 = i2 - | ∃∃j1,j2. @❪j1,g❫ ≘ j2 & ↑j1 = i1 & ↑j2 = i2. -#f * [2: #i1 ] #i2 #Hf #g #H -[ elim (at_inv_npx … Hf … H) -f /3 width=5 by or_intror, ex3_2_intro/ -| >(at_inv_ppx … Hf … H) -f /3 width=1 by conj, or_introl/ -] -qed-. - -lemma at_inv_xpp: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → ∀g. ⫯g = f → 𝟏 = i2 → 𝟏 = i1. -#f #i1 #i2 #Hf #g #H elim (at_inv_xpx … Hf … H) -f * // -#j1 #j2 #_ #_ * -i2 #H destruct -qed-. - -lemma at_inv_xpn: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → ∀g,j2. ⫯g = f → ↑j2 = i2 → - ∃∃j1. @❪j1,g❫ ≘ j2 & ↑j1 = i1. -#f #i1 #i2 #Hf #g #j2 #H elim (at_inv_xpx … Hf … H) -f * -[ #_ * -i2 #H destruct -| #x1 #x2 #Hg #H1 * -i2 #H destruct /2 width=3 by ex2_intro/ -] -qed-. - -lemma at_inv_xxp: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → 𝟏 = i2 → - ∃∃g. 𝟏 = i1 & ⫯g = f. -#f elim (pn_split f) * -#g #H #i1 #i2 #Hf #H2 -[ /3 width=6 by at_inv_xpp, ex2_intro/ -| elim (at_inv_xnp … Hf … H H2) -] -qed-. - -lemma at_inv_xxn: ∀f,i1,i2. @❪i1,f❫ ≘ i2 → ∀j2. ↑j2 = i2 → - (∃∃g,j1. @❪j1,g❫ ≘ j2 & ↑j1 = i1 & ⫯g = f) ∨ - ∃∃g. @❪i1,g❫ ≘ j2 & ↑g = f. -#f elim (pn_split f) * -#g #H #i1 #i2 #Hf #j2 #H2 -[ elim (at_inv_xpn … Hf … H H2) -i2 /3 width=5 by or_introl, ex3_2_intro/ -| lapply (at_inv_xnn … Hf … H H2) -i2 /3 width=3 by or_intror, ex2_intro/ -] -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma at_increasing: ∀i2,i1,f. @❪i1,f❫ ≘ i2 → i1 ≤ i2. -#i2 elim i2 -i2 -[ #i1 #f #Hf elim (at_inv_xxp … Hf) -Hf // -| #i2 #IH * // - #i1 #f #Hf elim (at_inv_nxn … Hf) -Hf [1,4: * |*: // ] - /3 width=2 by ple_succ_bi, ple_succ_dx/ -] -qed-. - -lemma at_increasing_strict: ∀g,i1,i2. @❪i1,g❫ ≘ i2 → ∀f. ↑f = g → - i1 < i2 ∧ @❪i1,f❫ ≘ ↓i2. -#g #i1 #i2 #Hg #f #H elim (at_inv_xnx … Hg … H) -Hg -H -/4 width=2 by conj, at_increasing, ple_succ_bi/ -qed-. - -lemma at_fwd_id_ex: ∀f,i. @❪i,f❫ ≘ i → ∃g. ⫯g = f. -#f elim (pn_split f) * /2 width=2 by ex_intro/ -#g #H #i #Hf elim (at_inv_xnx … Hf … H) -Hf -H -#j2 #Hg #H destruct lapply (at_increasing … Hg) -Hg -#H elim (plt_ge_false … H) -H // -qed-. - -(* Basic properties *********************************************************) - -corec lemma at_eq_repl_back: ∀i1,i2. eq_repl_back (λf. @❪i1,f❫ ≘ i2). -#i1 #i2 #f1 #H1 cases H1 -f1 -i1 -i2 -[ #f1 #g1 #j1 #j2 #H #H1 #H2 #f2 #H12 cases (eq_inv_px … H12 … H) -g1 /2 width=2 by at_refl/ -| #f1 #i1 #i2 #Hf1 #g1 #j1 #j2 #H #H1 #H2 #f2 #H12 cases (eq_inv_px … H12 … H) -g1 /3 width=7 by at_push/ -| #f1 #i1 #i2 #Hf1 #g1 #j2 #H #H2 #f2 #H12 cases (eq_inv_nx … H12 … H) -g1 /3 width=5 by at_next/ -] -qed-. - -lemma at_eq_repl_fwd: ∀i1,i2. eq_repl_fwd (λf. @❪i1,f❫ ≘ i2). -#i1 #i2 @eq_repl_sym /2 width=3 by at_eq_repl_back/ -qed-. - -lemma at_le_ex: ∀j2,i2,f. @❪i2,f❫ ≘ j2 → ∀i1. i1 ≤ i2 → - ∃∃j1. @❪i1,f❫ ≘ j1 & j1 ≤ j2. -#j2 elim j2 -j2 [2: #j2 #IH ] #i2 #f #Hf -[ elim (at_inv_xxn … Hf) -Hf [1,3: * |*: // ] - #g [ #x2 ] #Hg [ #H2 ] #H0 - [ * /3 width=3 by at_refl, ex2_intro/ - #i1 #Hi12 destruct lapply (ple_inv_succ_bi … Hi12) -Hi12 - #Hi12 elim (IH … Hg … Hi12) -x2 -IH - /3 width=7 by at_push, ex2_intro, ple_succ_bi/ - | #i1 #Hi12 elim (IH … Hg … Hi12) -IH -i2 - /3 width=5 by at_next, ex2_intro, ple_succ_bi/ - ] -| elim (at_inv_xxp … Hf) -Hf // - #g * -i2 #H2 #i1 #Hi12 <(ple_inv_unit_dx … Hi12) - /3 width=3 by at_refl, ex2_intro/ -] -qed-. - -lemma at_id_le: ∀i1,i2. i1 ≤ i2 → ∀f. @❪i2,f❫ ≘ i2 → @❪i1,f❫ ≘ i1. -#i1 #i2 #H @(ple_ind_alt … H) -i1 -i2 [ #i2 | #i1 #i2 #_ #IH ] -#f #Hf elim (at_fwd_id_ex … Hf) /4 width=7 by at_inv_npn, at_push, at_refl/ -qed-. - -(* Main properties **********************************************************) - -theorem at_monotonic: ∀j2,i2,f. @❪i2,f❫ ≘ j2 → ∀j1,i1. @❪i1,f❫ ≘ j1 → - i1 < i2 → j1 < j2. -#j2 elim j2 -j2 -[ #i2 #f #H2f elim (at_inv_xxp … H2f) -H2f // - #g #H21 #_ #j1 #i1 #_ #Hi elim (plt_ge_false … Hi) -Hi // -| #j2 #IH #i2 #f #H2f * // - #j1 #i1 #H1f #Hi elim (plt_inv_gen … Hi) - #_ #Hi2 elim (at_inv_nxn … H2f (↓i2)) -H2f [1,3: * |*: // ] - #g #H2g #H - [ elim (at_inv_xpn … H1f … H) -f - /4 width=8 by plt_inv_succ_bi, plt_succ_bi/ - | /4 width=8 by at_inv_xnn, plt_succ_bi/ - ] -] -qed-. - -theorem at_inv_monotonic: ∀j1,i1,f. @❪i1,f❫ ≘ j1 → ∀j2,i2. @❪i2,f❫ ≘ j2 → - j1 < j2 → i1 < i2. -#j1 elim j1 -j1 -[ #i1 #f #H1f elim (at_inv_xxp … H1f) -H1f // - #g * -i1 #H #j2 #i2 #H2f #Hj lapply (plt_des_gen … Hj) -Hj - #H22 elim (at_inv_xpn … H2f … (↓j2) H) -f // -| #j1 #IH * - [ #f #H1f elim (at_inv_pxn … H1f) -H1f [ |*: // ] - #g #H1g #H #j2 #i2 #H2f #Hj elim (plt_inv_succ_sn … Hj) -Hj - /3 width=7 by at_inv_xnn/ - | #i1 #f #H1f #j2 #i2 #H2f #Hj elim (plt_inv_succ_sn … Hj) -Hj - #Hj #H22 elim (at_inv_nxn … H1f) -H1f [1,4: * |*: // ] - #g #Hg #H - [ elim (at_inv_xpn … H2f … (↓j2) H) -f - /3 width=7 by plt_succ_bi/ - | /3 width=7 by at_inv_xnn/ - ] - ] -] -qed-. - -theorem at_mono: ∀f,i,i1. @❪i,f❫ ≘ i1 → ∀i2. @❪i,f❫ ≘ i2 → i2 = i1. -#f #i #i1 #H1 #i2 #H2 elim (pnat_split_lt_eq_gt i2 i1) // -#Hi elim (plt_ge_false i i) /3 width=6 by at_inv_monotonic, eq_sym/ -qed-. - -theorem at_inj: ∀f,i1,i. @❪i1,f❫ ≘ i → ∀i2. @❪i2,f❫ ≘ i → i1 = i2. -#f #i1 #i #H1 #i2 #H2 elim (pnat_split_lt_eq_gt i2 i1) // -#Hi elim (plt_ge_false i i) /2 width=6 by at_monotonic/ -qed-. - -theorem at_div_comm: ∀f2,g2,f1,g1. - H_at_div f2 g2 f1 g1 → H_at_div g2 f2 g1 f1. -#f2 #g2 #f1 #g1 #IH #jg #jf #j #Hg #Hf -elim (IH … Hf Hg) -IH -j /2 width=3 by ex2_intro/ -qed-. - -theorem at_div_pp: ∀f2,g2,f1,g1. - H_at_div f2 g2 f1 g1 → H_at_div (⫯f2) (⫯g2) (⫯f1) (⫯g1). -#f2 #g2 #f1 #g1 #IH #jf #jg #j #Hf #Hg -elim (at_inv_xpx … Hf) -Hf [1,2: * |*: // ] -[ #H1 #H2 destruct -IH - lapply (at_inv_xpp … Hg ???) -Hg [4: |*: // ] #H destruct - /3 width=3 by at_refl, ex2_intro/ -| #xf #i #Hf2 #H1 #H2 destruct - lapply (at_inv_xpn … Hg ????) -Hg [5: * |*: // ] #xg #Hg2 #H destruct - elim (IH … Hf2 Hg2) -IH -i /3 width=9 by at_push, ex2_intro/ -] -qed-. - -theorem at_div_nn: ∀f2,g2,f1,g1. - H_at_div f2 g2 f1 g1 → H_at_div (↑f2) (↑g2) (f1) (g1). -#f2 #g2 #f1 #g1 #IH #jf #jg #j #Hf #Hg -elim (at_inv_xnx … Hf) -Hf [ |*: // ] #i #Hf2 #H destruct -lapply (at_inv_xnn … Hg ????) -Hg [5: |*: // ] #Hg2 -elim (IH … Hf2 Hg2) -IH -i /2 width=3 by ex2_intro/ -qed-. - -theorem at_div_np: ∀f2,g2,f1,g1. - H_at_div f2 g2 f1 g1 → H_at_div (↑f2) (⫯g2) (f1) (↑g1). -#f2 #g2 #f1 #g1 #IH #jf #jg #j #Hf #Hg -elim (at_inv_xnx … Hf) -Hf [ |*: // ] #i #Hf2 #H destruct -lapply (at_inv_xpn … Hg ????) -Hg [5: * |*: // ] #xg #Hg2 #H destruct -elim (IH … Hf2 Hg2) -IH -i /3 width=7 by at_next, ex2_intro/ -qed-. - -theorem at_div_pn: ∀f2,g2,f1,g1. - H_at_div f2 g2 f1 g1 → H_at_div (⫯f2) (↑g2) (↑f1) (g1). -/4 width=6 by at_div_np, at_div_comm/ qed-. - -(* Properties on tls ********************************************************) - -(* Note: this requires ↑ on first n *) -lemma at_pxx_tls: ∀n,f. @❪𝟏,f❫ ≘ ↑n → @❪𝟏,⫱*[n]f❫ ≘ 𝟏. -#n @(nat_ind_succ … n) -n // -#n #IH #f #Hf -cases (at_inv_pxn … Hf) -Hf [ |*: // ] #g #Hg #H0 destruct -(injective_push … Hx1) >(injective_push … Hx2) -x2 -x1 - /2 width=3 by ex2_intro/ -| #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct - elim (discr_push_next … Hx2) -| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct - elim (discr_push_next … Hx1) -] -qed-. - -lemma coafter_inv_pnx: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → - ∃∃f. f1 ~⊚ f2 ≘ f & ↑f = g. -#g1 #g2 #g * -g1 -g2 -g #f1 #f2 #f #g1 -[ #g2 #g #_ #_ #H2 #_ #x1 #x2 #_ #Hx2 destruct - elim (discr_next_push … Hx2) -| #g2 #g #Hf #H1 #H2 #H3 #x1 #x2 #Hx1 #Hx2 destruct - >(injective_push … Hx1) >(injective_next … Hx2) -x2 -x1 - /2 width=3 by ex2_intro/ -| #g #_ #H1 #_ #x1 #x2 #Hx1 #_ destruct - elim (discr_push_next … Hx1) -] -qed-. - -lemma coafter_inv_nxx: ∀g1,f2,g. g1 ~⊚ f2 ≘ g → ∀f1. ↑f1 = g1 → - ∃∃f. f1 ~⊚ f2 ≘ f & ⫯f = g. -#g1 #f2 #g * -g1 -f2 -g #f1 #f2 #f #g1 -[ #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct - elim (discr_next_push … Hx1) -| #g2 #g #_ #H1 #_ #_ #x1 #Hx1 destruct - elim (discr_next_push … Hx1) -| #g #Hf #H1 #H #x1 #Hx1 destruct - >(injective_next … Hx1) -x1 - /2 width=3 by ex2_intro/ -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma coafter_inv_ppp: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → f1 ~⊚ f2 ≘ f. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H -elim (coafter_inv_ppx … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct -<(injective_push … Hx) -f // -qed-. - -lemma coafter_inv_ppn: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ↑f = g → ⊥. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H -elim (coafter_inv_ppx … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct -elim (discr_push_next … Hx) -qed-. - -lemma coafter_inv_pnn: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ~⊚ f2 ≘ f. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H -elim (coafter_inv_pnx … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct -<(injective_next … Hx) -f // -qed-. - -lemma coafter_inv_pnp: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ⫯f = g → ⊥. -#g1 #g2 #g #Hg #f1 #f2 #f #H1 #H2 #H -elim (coafter_inv_pnx … Hg … H1 H2) -g1 -g2 #x #Hf #Hx destruct -elim (discr_next_push … Hx) -qed-. - -lemma coafter_inv_nxp: ∀g1,f2,g. g1 ~⊚ f2 ≘ g → - ∀f1,f. ↑f1 = g1 → ⫯f = g → f1 ~⊚ f2 ≘ f. -#g1 #f2 #g #Hg #f1 #f #H1 #H -elim (coafter_inv_nxx … Hg … H1) -g1 #x #Hf #Hx destruct -<(injective_push … Hx) -f // -qed-. - -lemma coafter_inv_nxn: ∀g1,f2,g. g1 ~⊚ f2 ≘ g → - ∀f1,f. ↑f1 = g1 → ↑f = g → ⊥. -#g1 #f2 #g #Hg #f1 #f #H1 #H -elim (coafter_inv_nxx … Hg … H1) -g1 #x #Hf #Hx destruct -elim (discr_push_next … Hx) -qed-. - -lemma coafter_inv_pxp: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - ∀f1,f. ⫯f1 = g1 → ⫯f = g → - ∃∃f2. f1 ~⊚ f2 ≘ f & ⫯f2 = g2. -#g1 #g2 #g #Hg #f1 #f #H1 #H elim (pn_split g2) * #f2 #H2 -[ lapply (coafter_inv_ppp … Hg … H1 H2 H) -g1 -g /2 width=3 by ex2_intro/ -| elim (coafter_inv_pnp … Hg … H1 H2 H) -] -qed-. - -lemma coafter_inv_pxn: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - ∀f1,f. ⫯f1 = g1 → ↑f = g → - ∃∃f2. f1 ~⊚ f2 ≘ f & ↑f2 = g2. -#g1 #g2 #g #Hg #f1 #f #H1 #H elim (pn_split g2) * #f2 #H2 -[ elim (coafter_inv_ppn … Hg … H1 H2 H) -| lapply (coafter_inv_pnn … Hg … H1 … H) -g1 -g /2 width=3 by ex2_intro/ -] -qed-. - -lemma coafter_inv_xxn: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f. ↑f = g → - ∃∃f1,f2. f1 ~⊚ f2 ≘ f & ⫯f1 = g1 & ↑f2 = g2. -#g1 #g2 #g #Hg #f #H elim (pn_split g1) * #f1 #H1 -[ elim (coafter_inv_pxn … Hg … H1 H) -g /2 width=5 by ex3_2_intro/ -| elim (coafter_inv_nxn … Hg … H1 H) -] -qed-. - -lemma coafter_inv_xnn: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - ∀f2,f. ↑f2 = g2 → ↑f = g → - ∃∃f1. f1 ~⊚ f2 ≘ f & ⫯f1 = g1. -#g1 #g2 #g #Hg #f2 #f #H2 destruct #H -elim (coafter_inv_xxn … Hg … H) -g -#z1 #z2 #Hf #H1 #H2 destruct /2 width=3 by ex2_intro/ -qed-. - -lemma coafter_inv_xxp: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f. ⫯f = g → - (∃∃f1,f2. f1 ~⊚ f2 ≘ f & ⫯f1 = g1 & ⫯f2 = g2) ∨ - ∃∃f1. f1 ~⊚ g2 ≘ f & ↑f1 = g1. -#g1 #g2 #g #Hg #f #H elim (pn_split g1) * #f1 #H1 -[ elim (coafter_inv_pxp … Hg … H1 H) -g - /3 width=5 by or_introl, ex3_2_intro/ -| /4 width=5 by coafter_inv_nxp, or_intror, ex2_intro/ -] -qed-. - -lemma coafter_inv_pxx: ∀g1,g2,g. g1 ~⊚ g2 ≘ g → ∀f1. ⫯f1 = g1 → - (∃∃f2,f. f1 ~⊚ f2 ≘ f & ⫯f2 = g2 & ⫯f = g) ∨ - (∃∃f2,f. f1 ~⊚ f2 ≘ f & ↑f2 = g2 & ↑f = g). -#g1 #g2 #g #Hg #f1 #H1 elim (pn_split g2) * #f2 #H2 -[ elim (coafter_inv_ppx … Hg … H1 H2) -g1 - /3 width=5 by or_introl, ex3_2_intro/ -| elim (coafter_inv_pnx … Hg … H1 H2) -g1 - /3 width=5 by or_intror, ex3_2_intro/ -] -qed-. - -(* Basic properties *********************************************************) - -corec lemma coafter_eq_repl_back2: ∀f1,f. eq_repl_back (λf2. f2 ~⊚ f1 ≘ f). -#f1 #f #f2 * -f2 -f1 -f -#f21 #f1 #f #g21 [1,2: #g1 ] #g #Hf #H21 [1,2: #H1 ] #H #g22 #H0 -[ cases (eq_inv_px … H0 … H21) -g21 /3 width=7 by coafter_refl/ -| cases (eq_inv_px … H0 … H21) -g21 /3 width=7 by coafter_push/ -| cases (eq_inv_nx … H0 … H21) -g21 /3 width=5 by coafter_next/ -] -qed-. - -lemma coafter_eq_repl_fwd2: ∀f1,f. eq_repl_fwd (λf2. f2 ~⊚ f1 ≘ f). -#f1 #f @eq_repl_sym /2 width=3 by coafter_eq_repl_back2/ -qed-. - -corec lemma coafter_eq_repl_back1: ∀f2,f. eq_repl_back (λf1. f2 ~⊚ f1 ≘ f). -#f2 #f #f1 * -f2 -f1 -f -#f2 #f11 #f #g2 [1,2: #g11 ] #g #Hf #H2 [1,2: #H11 ] #H #g2 #H0 -[ cases (eq_inv_px … H0 … H11) -g11 /3 width=7 by coafter_refl/ -| cases (eq_inv_nx … H0 … H11) -g11 /3 width=7 by coafter_push/ -| @(coafter_next … H2 H) /2 width=5 by/ -] -qed-. - -lemma coafter_eq_repl_fwd1: ∀f2,f. eq_repl_fwd (λf1. f2 ~⊚ f1 ≘ f). -#f2 #f @eq_repl_sym /2 width=3 by coafter_eq_repl_back1/ -qed-. - -corec lemma coafter_eq_repl_back0: ∀f1,f2. eq_repl_back (λf. f2 ~⊚ f1 ≘ f). -#f2 #f1 #f * -f2 -f1 -f -#f2 #f1 #f01 #g2 [1,2: #g1 ] #g01 #Hf01 #H2 [1,2: #H1 ] #H01 #g02 #H0 -[ cases (eq_inv_px … H0 … H01) -g01 /3 width=7 by coafter_refl/ -| cases (eq_inv_nx … H0 … H01) -g01 /3 width=7 by coafter_push/ -| cases (eq_inv_px … H0 … H01) -g01 /3 width=5 by coafter_next/ -] -qed-. - -lemma coafter_eq_repl_fwd0: ∀f2,f1. eq_repl_fwd (λf. f2 ~⊚ f1 ≘ f). -#f2 #f1 @eq_repl_sym /2 width=3 by coafter_eq_repl_back0/ -qed-. - -(* Main inversion lemmas ****************************************************) - -corec theorem coafter_mono: ∀f1,f2,x,y. f1 ~⊚ f2 ≘ x → f1 ~⊚ f2 ≘ y → x ≡ y. -#f1 #f2 #x #y * -f1 -f2 -x -#f1 #f2 #x #g1 [1,2: #g2 ] #g #Hx #H1 [1,2: #H2 ] #H0x #Hy -[ cases (coafter_inv_ppx … Hy … H1 H2) -g1 -g2 /3 width=8 by eq_push/ -| cases (coafter_inv_pnx … Hy … H1 H2) -g1 -g2 /3 width=8 by eq_next/ -| cases (coafter_inv_nxx … Hy … H1) -g1 /3 width=8 by eq_push/ -] -qed-. - -lemma coafter_mono_eq: ∀f1,f2,f. f1 ~⊚ f2 ≘ f → ∀g1,g2,g. g1 ~⊚ g2 ≘ g → - f1 ≡ g1 → f2 ≡ g2 → f ≡ g. -/4 width=4 by coafter_mono, coafter_eq_repl_back1, coafter_eq_repl_back2/ qed-. - -(* Forward lemmas with pushs ************************************************) - -lemma coafter_fwd_pushs: ∀k,l,g2,f1,g. g2 ~⊚ ⫯*[l]f1 ≘ g → @↑❪l, g2❫ ≘ k → - ∃∃f. ⫱*[k]g2 ~⊚ f1 ≘ f & ⫯*[k] f = g. -#k @(nat_ind_succ … k) -k -[ #l #g2 #f1 #g #Hg #H - elim (rm_nat_inv_xxp … H) -H [|*: // ] #f2 #H1 #H2 destruct - /2 width=3 by ex2_intro/ -| #k #IH * [| #l ] #g2 #f1 #g #Hg #H - [ elim (rm_nat_inv_pxn … H) -H [|*: // ] #f2 #Hlk #H destruct - elim (coafter_inv_nxx … Hg) -Hg [|*: // ] #f #Hf #H destruct - elim (IH … Hf Hlk) -IH -Hf -Hlk /2 width=3 by ex2_intro/ - | elim (rm_nat_inv_nxn … H) -H [1,4: * |*: // ] #f2 #Hlk #H destruct - [ elim (coafter_inv_ppx … Hg) -Hg [|*: // ] #f #Hf #H destruct - elim (IH … Hf Hlk) -IH -Hf -Hlk /2 width=3 by ex2_intro/ - | elim (coafter_inv_nxx … Hg) -Hg [|*: // ] #f #Hf #H destruct - elim (IH … Hf Hlk) -IH -Hf -Hlk /2 width=3 by ex2_intro/ - ] - ] -] -qed-. - -(* Inversion lemmas with tail ***********************************************) - -lemma coafter_inv_tl1: ∀g2,g1,g. g2 ~⊚ ⫱g1 ≘ g → - ∃∃f. ⫯g2 ~⊚ g1 ≘ f & ⫱f = g. -#g2 #g1 #g elim (pn_split g1) * #f1 #H1 #H destruct -[ /3 width=7 by coafter_refl, ex2_intro/ -| @(ex2_intro … (↑g)) /2 width=7 by coafter_push/ (**) (* full auto fails *) -] -qed-. - -lemma coafter_inv_tl0: ∀g2,g1,g. g2 ~⊚ g1 ≘ ⫱g → - ∃∃f1. ⫯g2 ~⊚ f1 ≘ g & ⫱f1 = g1. -#g2 #g1 #g elim (pn_split g) * #f #H0 #H destruct -[ /3 width=7 by coafter_refl, ex2_intro/ -| @(ex2_intro … (↑g1)) /2 width=7 by coafter_push/ (**) (* full auto fails *) -] -qed-. - -(* Properties with iterated tail ********************************************) - -lemma coafter_tls: ∀l2,l1,f1,f2,f. @↑❪l1, f1❫ ≘ l2 → - f1 ~⊚ f2 ≘ f → ⫱*[l2]f1 ~⊚ ⫱*[l1]f2 ≘ ⫱*[l2]f. -#l2 @(nat_ind_succ … l2) -l2 [ #l1 | #l2 #IH * [| #l1 ] ] #f1 #f2 #f #Hf1 #Hf -[ elim (rm_nat_inv_xxp … Hf1) -Hf1 [ |*: // ] #g1 #Hg1 #H1 destruct // -| elim (rm_nat_inv_pxn … Hf1) -Hf1 [ |*: // ] #g1 #Hg1 #H1 - elim (coafter_inv_nxx … Hf … H1) -Hf #g #Hg #H0 destruct - lapply (IH … Hg1 Hg) -IH -Hg1 -Hg // -| elim (rm_nat_inv_xxn … Hf1) -Hf1 [1,3: * |*: // ] #g1 [ #k1 ] #Hg1 [ #H ] #H1 - [ elim (coafter_inv_pxx … Hf … H1) -Hf * #g2 #g #Hg #H2 #H0 destruct - lapply (IH … Hg1 Hg) -IH -Hg1 -Hg #H // - | elim (coafter_inv_nxx … Hf … H1) -Hf #g #Hg #H0 destruct - lapply (IH … Hg1 Hg) -IH -Hg1 -Hg #H // - ] -] -qed. - -lemma coafter_tls_O: ∀k,f1,f2,f. @↑❪𝟎, f1❫ ≘ k → - f1 ~⊚ f2 ≘ f → ⫱*[k]f1 ~⊚ f2 ≘ ⫱*[k]f. -/2 width=1 by coafter_tls/ qed. - -(* Note: this does not require ↑ first and second j *) -lemma coafter_tls_succ: ∀g2,g1,g. g2 ~⊚ g1 ≘ g → - ∀j. @❪𝟏, g2❫ ≘ j → ⫱*[j]g2 ~⊚ ⫱g1 ≘ ⫱*[j]g. -#g2 #g1 #g #Hg #j #Hg2 -lapply (rm_nat_pred_bi … Hg2) -Hg2 #Hg2 -lapply (coafter_tls … Hg2 … Hg) -Hg #Hg -lapply (at_pxx_tls … Hg2) -Hg2 #H -elim (at_inv_pxp … H) -H [ |*: // ] #f2 #H2 -elim (coafter_inv_pxx … Hg … H2) -Hg * #f1 #f #Hf #H1 #H0 ->(npsucc_pred j) IH // -] -qed-. - -(* Basic properties *********************************************************) - -lemma fcla_eq_repl_back: ∀n. eq_repl_back … (λf. 𝐂❪f❫ ≘ n). -#n #f1 #H elim H -f1 -n /3 width=3 by fcla_isid, isid_eq_repl_back/ -#f1 #n #_ #IH #g2 #H [ elim (eq_inv_px … H) | elim (eq_inv_nx … H) ] -H -/3 width=3 by fcla_push, fcla_next/ -qed-. - -lemma fcla_eq_repl_fwd: ∀n. eq_repl_fwd … (λf. 𝐂❪f❫ ≘ n). -#n @eq_repl_sym /2 width=3 by fcla_eq_repl_back/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isdiv.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isdiv.ma deleted file mode 100644 index fa421497a..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isdiv.ma +++ /dev/null @@ -1,104 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/relations/isdivergent_1.ma". -include "ground/relocation/rtmap_nexts.ma". -include "ground/relocation/rtmap_tls.ma". - -(* RELOCATION MAP ***********************************************************) - -coinductive isdiv: predicate rtmap ≝ -| isdiv_next: ∀f,g. isdiv f → ↑f = g → isdiv g -. - -interpretation "test for divergence (rtmap)" - 'IsDivergent f = (isdiv f). - -(* Basic inversion lemmas ***************************************************) - -lemma isdiv_inv_gen: ∀g. 𝛀❪g❫ → ∃∃f. 𝛀❪f❫ & ↑f = g. -#g * -g -#f #g #Hf * /2 width=3 by ex2_intro/ -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma isdiv_inv_next: ∀g. 𝛀❪g❫ → ∀f. ↑f = g → 𝛀❪f❫. -#g #H elim (isdiv_inv_gen … H) -H -#f #Hf * -g #g #H >(injective_next … H) -H // -qed-. - -lemma isdiv_inv_push: ∀g. 𝛀❪g❫ → ∀f. ⫯f = g → ⊥. -#g #H elim (isdiv_inv_gen … H) -H -#f #Hf * -g #g #H elim (discr_push_next … H) -qed-. - -(* Main inversion lemmas ****************************************************) - -corec theorem isdiv_inv_eq_repl: ∀f1,f2. 𝛀❪f1❫ → 𝛀❪f2❫ → f1 ≡ f2. -#f1 #f2 #H1 #H2 -cases (isdiv_inv_gen … H1) -H1 -cases (isdiv_inv_gen … H2) -H2 -/3 width=5 by eq_next/ -qed-. - -(* Basic properties *********************************************************) - -corec lemma isdiv_eq_repl_back: eq_repl_back … isdiv. -#f1 #H cases (isdiv_inv_gen … H) -H -#g1 #Hg1 #H1 #f2 #Hf cases (eq_inv_nx … Hf … H1) -f1 -/3 width=3 by isdiv_next/ -qed-. - -lemma isdiv_eq_repl_fwd: eq_repl_fwd … isdiv. -/3 width=3 by isdiv_eq_repl_back, eq_repl_sym/ qed-. - -(* Alternative definition ***************************************************) - -corec lemma eq_next_isdiv: ∀f. ↑f ≡ f → 𝛀❪f❫. -#f #H cases (eq_inv_nx … H) -H /4 width=3 by isdiv_next, eq_trans/ -qed. - -corec lemma eq_next_inv_isdiv: ∀f. 𝛀❪f❫ → ↑f ≡ f. -#f * -f -#f #g #Hf #Hg @(eq_next … Hg) [2: @eq_next_inv_isdiv // | skip ] -@eq_f // -qed-. - -(* Properties with iterated next ********************************************) - -lemma isdiv_nexts: ∀n,f. 𝛀❪f❫ → 𝛀❪↑*[n]f❫. -#n @(nat_ind_succ … n) -n /3 width=3 by isdiv_next/ -qed. - -(* Inversion lemmas with iterated next **************************************) - -lemma isdiv_inv_nexts: ∀n,g. 𝛀❪↑*[n]g❫ → 𝛀❪g❫. -#n @(nat_ind_succ … n) -n /3 width=3 by isdiv_inv_next/ -qed. - -(* Properties with tail *****************************************************) - -lemma isdiv_tl: ∀f. 𝛀❪f❫ → 𝛀❪⫱f❫. -#f cases (pn_split f) * #g * -f #H -[ elim (isdiv_inv_push … H) -H // -| /2 width=3 by isdiv_inv_next/ -] -qed. - -(* Properties with iterated tail ********************************************) - -lemma isdiv_tls: ∀n,g. 𝛀❪g❫ → 𝛀❪⫱*[n]g❫. -#n @(nat_ind_succ … n) -n /3 width=1 by isdiv_tl/ -qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isfin.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isfin.ma deleted file mode 100644 index 7da7f85ad..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isfin.ma +++ /dev/null @@ -1,96 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/relations/isfinite_1.ma". -include "ground/relocation/rtmap_fcla.ma". - -(* RELOCATION MAP ***********************************************************) - -definition isfin: predicate rtmap ≝ - λf. ∃n. 𝐂❪f❫ ≘ n. - -interpretation "test for finite colength (rtmap)" - 'IsFinite f = (isfin f). - -(* Basic eliminators ********************************************************) - -lemma isfin_ind (R:predicate rtmap): (∀f. 𝐈❪f❫ → R f) → - (∀f. 𝐅❪f❫ → R f → R (⫯f)) → - (∀f. 𝐅❪f❫ → R f → R (↑f)) → - ∀f. 𝐅❪f❫ → R f. -#R #IH1 #IH2 #IH3 #f #H elim H -H -#n #H elim H -f -n /3 width=2 by ex_intro/ -qed-. - -(* Basic inversion lemmas ***************************************************) - -lemma isfin_inv_push: ∀g. 𝐅❪g❫ → ∀f. ⫯f = g → 𝐅❪f❫. -#g * /3 width=4 by fcla_inv_px, ex_intro/ -qed-. - -lemma isfin_inv_next: ∀g. 𝐅❪g❫ → ∀f. ↑f = g → 𝐅❪f❫. -#g * #n #H #f #H0 elim (fcla_inv_nx … H … H0) -g -/2 width=2 by ex_intro/ -qed-. - -(* Basic properties *********************************************************) - -lemma isfin_eq_repl_back: eq_repl_back … isfin. -#f1 * /3 width=4 by fcla_eq_repl_back, ex_intro/ -qed-. - -lemma isfin_eq_repl_fwd: eq_repl_fwd … isfin. -/3 width=3 by isfin_eq_repl_back, eq_repl_sym/ qed-. - -lemma isfin_isid: ∀f. 𝐈❪f❫ → 𝐅❪f❫. -/3 width=2 by fcla_isid, ex_intro/ qed. - -lemma isfin_push: ∀f. 𝐅❪f❫ → 𝐅❪⫯f❫. -#f * /3 width=2 by fcla_push, ex_intro/ -qed. - -lemma isfin_next: ∀f. 𝐅❪f❫ → 𝐅❪↑f❫. -#f * /3 width=2 by fcla_next, ex_intro/ -qed. - -(* Properties with iterated push ********************************************) - -lemma isfin_pushs: ∀n,f. 𝐅❪f❫ → 𝐅❪⫯*[n]f❫. -#n @(nat_ind_succ … n) -n /3 width=3 by isfin_push/ -qed. - -(* Inversion lemmas with iterated push **************************************) - -lemma isfin_inv_pushs: ∀n,g. 𝐅❪⫯*[n]g❫ → 𝐅❪g❫. -#n @(nat_ind_succ … n) -n /3 width=3 by isfin_inv_push/ -qed. - -(* Properties with tail *****************************************************) - -lemma isfin_tl: ∀f. 𝐅❪f❫ → 𝐅❪⫱f❫. -#f elim (pn_split f) * #g #H #Hf destruct -/3 width=3 by isfin_inv_push, isfin_inv_next/ -qed. - -(* Inversion lemmas with tail ***********************************************) - -lemma isfin_inv_tl: ∀f. 𝐅❪⫱f❫ → 𝐅❪f❫. -#f elim (pn_split f) * /2 width=1 by isfin_next, isfin_push/ -qed-. - -(* Inversion lemmas with iterated tail **************************************) - -lemma isfin_inv_tls: ∀n,f. 𝐅❪⫱*[n]f❫ → 𝐅❪f❫. -#n @(nat_ind_succ … n) -n /3 width=1 by isfin_inv_tl/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isid.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isid.ma deleted file mode 100644 index f52700b3e..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isid.ma +++ /dev/null @@ -1,103 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/relations/isidentity_1.ma". -include "ground/relocation/rtmap_tls.ma". - -(* RELOCATION MAP ***********************************************************) - -coinductive isid: predicate rtmap ≝ -| isid_push: ∀f,g. isid f → ⫯f = g → isid g -. - -interpretation "test for identity (rtmap)" - 'IsIdentity f = (isid f). - -(* Basic inversion lemmas ***************************************************) - -lemma isid_inv_gen: ∀g. 𝐈❪g❫ → ∃∃f. 𝐈❪f❫ & ⫯f = g. -#g * -g -#f #g #Hf * /2 width=3 by ex2_intro/ -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma isid_inv_push: ∀g. 𝐈❪g❫ → ∀f. ⫯f = g → 𝐈❪f❫. -#g #H elim (isid_inv_gen … H) -H -#f #Hf * -g #g #H >(injective_push … H) -H // -qed-. - -lemma isid_inv_next: ∀g. 𝐈❪g❫ → ∀f. ↑f = g → ⊥. -#g #H elim (isid_inv_gen … H) -H -#f #Hf * -g #g #H elim (discr_next_push … H) -qed-. - -(* Main inversion lemmas ****************************************************) - -corec theorem isid_inv_eq_repl: ∀f1,f2. 𝐈❪f1❫ → 𝐈❪f2❫ → f1 ≡ f2. -#f1 #f2 #H1 #H2 -cases (isid_inv_gen … H1) -H1 -cases (isid_inv_gen … H2) -H2 -/3 width=5 by eq_push/ -qed-. - -(* Basic properties *********************************************************) - -corec lemma isid_eq_repl_back: eq_repl_back … isid. -#f1 #H cases (isid_inv_gen … H) -H -#g1 #Hg1 #H1 #f2 #Hf cases (eq_inv_px … Hf … H1) -f1 -/3 width=3 by isid_push/ -qed-. - -lemma isid_eq_repl_fwd: eq_repl_fwd … isid. -/3 width=3 by isid_eq_repl_back, eq_repl_sym/ qed-. - -(* Alternative definition ***************************************************) - -corec lemma eq_push_isid: ∀f. ⫯f ≡ f → 𝐈❪f❫. -#f #H cases (eq_inv_px … H) -H /4 width=3 by isid_push, eq_trans/ -qed. - -corec lemma eq_push_inv_isid: ∀f. 𝐈❪f❫ → ⫯f ≡ f. -#f * -f -#f #g #Hf #Hg @(eq_push … Hg) [2: @eq_push_inv_isid // | skip ] -@eq_f // -qed-. - -(* Properties with iterated push ********************************************) - -lemma isid_pushs: ∀n,f. 𝐈❪f❫ → 𝐈❪⫯*[n]f❫. -#n @(nat_ind_succ … n) -n /3 width=3 by isid_push/ -qed. - -(* Inversion lemmas with iterated push **************************************) - -lemma isid_inv_pushs: ∀n,g. 𝐈❪⫯*[n]g❫ → 𝐈❪g❫. -#n @(nat_ind_succ … n) -n /3 width=3 by isid_inv_push/ -qed. - -(* Properties with tail *****************************************************) - -lemma isid_tl: ∀f. 𝐈❪f❫ → 𝐈❪⫱f❫. -#f cases (pn_split f) * #g * -f #H -[ /2 width=3 by isid_inv_push/ -| elim (isid_inv_next … H) -H // -] -qed. - -(* Properties with iterated tail ********************************************) - -lemma isid_tls: ∀n,g. 𝐈❪g❫ → 𝐈❪⫱*[n]g❫. -#n @(nat_ind_succ … n) -n /3 width=1 by isid_tl/ -qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_istot.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_istot.ma deleted file mode 100644 index f93936acf..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_istot.ma +++ /dev/null @@ -1,101 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/relations/ist_1.ma". -include "ground/relocation/rtmap_at.ma". - -(* RELOCATION MAP ***********************************************************) - -definition istot: predicate rtmap ≝ λf. ∀i. ∃j. @❪i,f❫ ≘ j. - -interpretation "test for totality (rtmap)" - 'IsT f = (istot f). - -(* Basic inversion lemmas ***************************************************) - -lemma istot_inv_push: ∀g. 𝐓❪g❫ → ∀f. ⫯f = g → 𝐓❪f❫. -#g #Hg #f #H #i elim (Hg (↑i)) -Hg -#j #Hg elim (at_inv_npx … Hg … H) -Hg -H /2 width=3 by ex_intro/ -qed-. - -lemma istot_inv_next: ∀g. 𝐓❪g❫ → ∀f. ↑f = g → 𝐓❪f❫. -#g #Hg #f #H #i elim (Hg i) -Hg -#j #Hg elim (at_inv_xnx … Hg … H) -Hg -H /2 width=2 by ex_intro/ -qed-. - -(* Properties on tl *********************************************************) - -lemma istot_tl: ∀f. 𝐓❪f❫ → 𝐓❪⫱f❫. -#f cases (pn_split f) * -#g * -f /2 width=3 by istot_inv_next, istot_inv_push/ -qed. - -(* Properties on tls ********************************************************) - -lemma istot_tls: ∀n,f. 𝐓❪f❫ → 𝐓❪⫱*[n]f❫. -#n @(nat_ind_succ … n) -n // -#n #IH #f #Hf (H2f … Hf) in ⊢ (???%); -H2f // -qed. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isuni.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isuni.ma deleted file mode 100644 index 0607f8343..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_isuni.ma +++ /dev/null @@ -1,56 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/relations/isuniform_1.ma". -include "ground/relocation/rtmap_isfin.ma". - -(* RELOCATION MAP ***********************************************************) - -inductive isuni: predicate rtmap ≝ -| isuni_isid: ∀f. 𝐈❪f❫ → isuni f -| isuni_next: ∀f. isuni f → ∀g. ↑f = g → isuni g -. - -interpretation "test for uniformity (rtmap)" - 'IsUniform f = (isuni f). - -(* Basic inversion lemmas ***************************************************) - -lemma isuni_inv_push: ∀g. 𝐔❪g❫ → ∀f. ⫯f = g → 𝐈❪f❫. -#g * -g /2 width=3 by isid_inv_push/ -#f #_ #g #H #x #Hx destruct elim (discr_push_next … Hx) -qed-. - -lemma isuni_inv_next: ∀g. 𝐔❪g❫ → ∀f. ↑f = g → 𝐔❪f❫. -#g * -g #f #Hf -[ #x #Hx elim (isid_inv_next … Hf … Hx) -| #g #H #x #Hx destruct /2 width=1 by injective_push/ -] -qed-. - -lemma isuni_split: ∀g. 𝐔❪g❫ → (∃∃f. 𝐈❪f❫ & ⫯f = g) ∨ (∃∃f.𝐔❪f❫ & ↑f = g). -#g #H elim (pn_split g) * #f #Hf -/4 width=3 by isuni_inv_next, isuni_inv_push, or_introl, or_intror, ex2_intro/ -qed-. - -(* basic forward lemmas *****************************************************) - -lemma isuni_fwd_push: ∀g. 𝐔❪g❫ → ∀f. ⫯f = g → 𝐔❪f❫. -/3 width=3 by isuni_inv_push, isuni_isid/ qed-. - -(* Forward lemmas with test for finite colength *****************************) - -lemma isuni_fwd_isfin: ∀f. 𝐔❪f❫ → 𝐅❪f❫. -#f #H elim H -f /3 width=1 by isfin_next, isfin_isid/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat.ma deleted file mode 100644 index b46b617fb..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat.ma +++ /dev/null @@ -1,247 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||M|| *) -(* ||A|| A project by Andrea Asperti *) -(* ||T|| *) -(* ||I|| Developers: *) -(* ||T|| The HELM team. *) -(* ||A|| http://helm.tcs.unibo.it *) -(* \ / *) -(* \ / This file is distributed under the terms of the *) -(* v GNU General Public License Version 2 *) -(* *) -(**************************************************************************) - -include "ground/notation/relations/ratsucc_3.ma". -include "ground/arith/nat_lt_pred.ma". -include "ground/relocation/rtmap_at.ma". - -(* NON-NEGATIVE APPLICATION FOR RELOCATION MAPS *****************************) - -definition rm_nat: relation3 rtmap nat nat ≝ - λf,l1,l2. @❪↑l1,f❫ ≘ ↑l2. - -interpretation - "relational non-negative application (relocation maps)" - 'RAtSucc l1 f l2 = (rm_nat f l1 l2). - -(* Basic properties *********************************************************) - -lemma rm_nat_refl (f) (g) (k1) (k2): - (⫯f) = g → 𝟎 = k1 → 𝟎 = k2 → @↑❪k1,g❫ ≘ k2. -#f #g #k1 #k2 #H1 #H2 #H3 destruct -/2 width=2 by at_refl/ -qed. - -lemma rm_nat_push (f) (l1) (l2) (g) (k1) (k2): - @↑❪l1,f❫ ≘ l2 → ⫯f = g → ↑l1 = k1 → ↑l2 = k2 → @↑❪k1,g❫ ≘ k2. -#f #l1 #l2 #g #k1 #k2 #Hf #H1 #H2 #H3 destruct -/2 width=7 by at_push/ -qed. - -lemma rm_nat_next (f) (l1) (l2) (g) (k2): - @↑❪l1,f❫ ≘ l2 → ↑f = g → ↑l2 = k2 → @↑❪l1,g❫ ≘ k2. -#f #l1 #l2 #g #k2 #Hf #H1 #H2 destruct -/2 width=5 by at_next/ -qed. - -lemma rm_nat_pred_bi (f) (i1) (i2): - @❪i1,f❫ ≘ i2 → @↑❪↓i1,f❫ ≘ ↓i2. -#f #i1 #i2 ->(npsucc_pred i1) in ⊢ (%→?); >(npsucc_pred i2) in ⊢ (%→?); -// -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma rm_nat_inv_ppx (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀g. 𝟎 = l1 → ⫯g = f → 𝟎 = l2. -#f #l1 #l2 #H #g #H1 #H2 destruct -lapply (at_inv_ppx … H ???) -H -/2 width=2 by eq_inv_npsucc_bi/ -qed-. - -lemma rm_nat_inv_npx (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀g,k1. ↑k1 = l1 → ⫯g = f → - ∃∃k2. @↑❪k1,g❫ ≘ k2 & ↑k2 = l2. -#f #l1 #l2 #H #g #k1 #H1 #H2 destruct -elim (at_inv_npx … H) -H [|*: // ] #k2 #Hg ->(npsucc_pred (↑l2)) #H -@(ex2_intro … (↓k2)) // -(npsucc_pred (k2)) in ⊢ (%→?→?); #Hg #H -@(ex2_intro … (↓k2)) // -(eq_inv_nsucc_bi … H) -k2 // -qed-. - -lemma rm_nat_inv_xnp (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀g. ↑g = f → 𝟎 = l2 → ⊥. -#f #l1 #l2 #Hf #g #H elim (rm_nat_inv_xnx … Hf … H) -f -#x2 #Hg * -l2 /2 width=3 by eq_inv_zero_nsucc/ -qed-. - -lemma rm_nat_inv_xnn (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀g,k2. ↑g = f → ↑k2 = l2 → @↑❪l1,g❫ ≘ k2. -#f #l1 #l2 #Hf #g #k2 #H elim (rm_nat_inv_xnx … Hf … H) -f -#x2 #Hg * -l2 #H >(eq_inv_nsucc_bi … H) -k2 // -qed-. - -lemma rm_nat_inv_pxp (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → 𝟎 = l1 → 𝟎 = l2 → ∃g. ⫯g = f. -#f elim (pn_split … f) * /2 width=2 by ex_intro/ -#g #H #l1 #l2 #Hf #H1 #H2 cases (rm_nat_inv_xnp … Hf … H H2) -qed-. - -lemma rm_nat_inv_pxn (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀k2. 𝟎 = l1 → ↑k2 = l2 → - ∃∃g. @↑❪l1,g❫ ≘ k2 & ↑g = f. -#f elim (pn_split … f) * -#g #H #l1 #l2 #Hf #k2 #H1 #H2 -[ elim (rm_nat_inv_ppn … Hf … H1 H H2) -| /3 width=5 by rm_nat_inv_xnn, ex2_intro/ -] -qed-. - -lemma rm_nat_inv_nxp (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀k1. ↑k1 = l1 → 𝟎 = l2 → ⊥. -#f elim (pn_split f) * -#g #H #l1 #l2 #Hf #k1 #H1 #H2 -[ elim (rm_nat_inv_npp … Hf … H1 H H2) -| elim (rm_nat_inv_xnp … Hf … H H2) -] -qed-. - -lemma rm_nat_inv_nxn (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀k1,k2. ↑k1 = l1 → ↑k2 = l2 → - ∨∨ ∃∃g. @↑❪k1,g❫ ≘ k2 & ⫯g = f - | ∃∃g. @↑❪l1,g❫ ≘ k2 & ↑g = f. -#f elim (pn_split f) * -/4 width=7 by rm_nat_inv_xnn, rm_nat_inv_npn, ex2_intro, or_intror, or_introl/ -qed-. - -(* Note: the following inversion lemmas must be checked *) -lemma rm_nat_inv_xpx (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀g. ⫯g = f → - ∨∨ ∧∧ 𝟎 = l1 & 𝟎 = l2 - | ∃∃k1,k2. @↑❪k1,g❫ ≘ k2 & ↑k1 = l1 & ↑k2 = l2. -#f * [2: #l1 ] #l2 #Hf #g #H -[ elim (rm_nat_inv_npx … Hf … H) -f /3 width=5 by or_intror, ex3_2_intro/ -| >(rm_nat_inv_ppx … Hf … H) -f /3 width=1 by conj, or_introl/ -] -qed-. - -lemma rm_nat_inv_xpp (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀g. ⫯g = f → 𝟎 = l2 → 𝟎 = l1. -#f #l1 #l2 #Hf #g #H elim (rm_nat_inv_xpx … Hf … H) -f * // -#k1 #k2 #_ #_ * -l2 #H elim (eq_inv_zero_nsucc … H) -qed-. - -lemma rm_nat_inv_xpn (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → ∀g,k2. ⫯g = f → ↑k2 = l2 → - ∃∃k1. @↑❪k1,g❫ ≘ k2 & ↑k1 = l1. -#f #l1 #l2 #Hf #g #k2 #H elim (rm_nat_inv_xpx … Hf … H) -f * -[ #_ * -l2 #H elim (eq_inv_nsucc_zero … H) -| #x1 #x2 #Hg #H1 * -l2 #H - lapply (eq_inv_nsucc_bi … H) -H #H destruct - /2 width=3 by ex2_intro/ -] -qed-. - -lemma rm_nat_inv_xxp (f) (l1) (l2): - @↑❪l1,f❫ ≘ l2 → 𝟎 = l2 → ∃∃g. 𝟎 = l1 & ⫯g = f. -#f elim (pn_split f) * -#g #H #l1 #l2 #Hf #H2 -[ /3 width=6 by rm_nat_inv_xpp, ex2_intro/ -| elim (rm_nat_inv_xnp … Hf … H H2) -] -qed-. - -lemma rm_nat_inv_xxn (f) (l1) (l2): @↑❪l1,f❫ ≘ l2 → ∀k2. ↑k2 = l2 → - ∨∨ ∃∃g,k1. @↑❪k1,g❫ ≘ k2 & ↑k1 = l1 & ⫯g = f - | ∃∃g. @↑❪l1,g❫ ≘ k2 & ↑g = f. -#f elim (pn_split f) * -#g #H #l1 #l2 #Hf #k2 #H2 -[ elim (rm_nat_inv_xpn … Hf … H H2) -l2 /3 width=5 by or_introl, ex3_2_intro/ -| lapply (rm_nat_inv_xnn … Hf … H H2) -l2 /3 width=3 by or_intror, ex2_intro/ -] -qed-. - -(* Main destructions ********************************************************) - -theorem rm_nat_monotonic (k2) (l2) (f): - @↑❪l2,f❫ ≘ k2 → ∀k1,l1. @↑❪l1,f❫ ≘ k1 → l1 < l2 → k1 < k2. -#k2 @(nat_ind_succ … k2) -k2 -[ #l2 #f #H2f elim (rm_nat_inv_xxp … H2f) -H2f // - #g #H21 #_ #k1 #l1 #_ #Hi destruct - elim (nlt_inv_zero_dx … Hi) -| #k2 #IH #l2 #f #H2f #k1 @(nat_ind_succ … k1) -k1 // - #k1 #_ #l1 #H1f #Hl elim (nlt_inv_gen … Hl) - #_ #Hl2 elim (rm_nat_inv_nxn … H2f (↓l2)) -H2f [1,3: * |*: // ] - #g #H2g #H - [ elim (rm_nat_inv_xpn … H1f … H) -f - /4 width=8 by nlt_inv_succ_bi, nlt_succ_bi/ - | /4 width=8 by rm_nat_inv_xnn, nlt_succ_bi/ - ] -] -qed-. - -theorem rm_nat_inv_monotonic (k1) (l1) (f): - @↑❪l1,f❫ ≘ k1 → ∀k2,l2. @↑❪l2,f❫ ≘ k2 → k1 < k2 → l1 < l2. -#k1 @(nat_ind_succ … k1) -k1 -[ #l1 #f #H1f elim (rm_nat_inv_xxp … H1f) -H1f // - #g * -l1 #H #k2 #l2 #H2f #Hk - lapply (nlt_des_gen … Hk) -Hk #H22 - elim (rm_nat_inv_xpn … H2f … (↓k2) H) -f // -| #k1 #IH #l1 @(nat_ind_succ … l1) -l1 - [ #f #H1f elim (rm_nat_inv_pxn … H1f) -H1f [ |*: // ] - #g #H1g #H #k2 #l2 #H2f #Hj elim (nlt_inv_succ_sn … Hj) -Hj - /3 width=7 by rm_nat_inv_xnn/ - | #l1 #_ #f #H1f #k2 #l2 #H2f #Hj elim (nlt_inv_succ_sn … Hj) -Hj - #Hj #H22 elim (rm_nat_inv_nxn … H1f) -H1f [1,4: * |*: // ] - #g #Hg #H - [ elim (rm_nat_inv_xpn … H2f … (↓k2) H) -f - /3 width=7 by nlt_succ_bi/ - | /3 width=7 by rm_nat_inv_xnn/ - ] - ] -] -qed-. - -theorem rm_nat_mono (f) (l) (l1) (l2): - @↑❪l,f❫ ≘ l1 → @↑❪l,f❫ ≘ l2 → l2 = l1. -#f #l #l1 #l2 #H1 #H2 elim (nat_split_lt_eq_gt l2 l1) // -#Hi elim (nlt_ge_false l l) /3 width=6 by rm_nat_inv_monotonic, eq_sym/ -qed-. - -theorem rm_nat_inj (f) (l1) (l2) (l): - @↑❪l1,f❫ ≘ l → @↑❪l2,f❫ ≘ l → l1 = l2. -#f #l1 #l2 #l #H1 #H2 elim (nat_split_lt_eq_gt l2 l1) // -#Hi elim (nlt_ge_false l l) /2 width=6 by rm_nat_monotonic/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat_uni.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat_uni.ma deleted file mode 100644 index 3faf3c95c..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nat_uni.ma +++ /dev/null @@ -1,30 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||M|| *) -(* ||A|| A project by Andrea Asperti *) -(* ||T|| *) -(* ||I|| Developers: *) -(* ||T|| The HELM team. *) -(* ||A|| http://helm.tcs.unibo.it *) -(* \ / *) -(* \ / This file is distributed under the terms of the *) -(* v GNU General Public License Version 2 *) -(* *) -(**************************************************************************) - -include "ground/arith/nat_plus.ma". -include "ground/relocation/rtmap_uni.ma". -include "ground/relocation/rtmap_nat.ma". - -(* NON-NEGATIVE APPLICATION FOR RELOCATION MAPS *****************************) - -(* Properties with uniform relocations **************************************) - -lemma rm_nat_uni (n) (l): @↑❪l,𝐔❨n❩❫ ≘ l+n. -#n @(nat_ind_succ … n) -n /2 width=5 by rm_nat_next/ -qed. - -(* Inversion lemmas with uniform relocations ********************************) - -lemma rm_nat_inv_uni (n) (l) (k): @↑❪l,𝐔❨n❩❫ ≘ k → k = l+n. -/2 width=4 by rm_nat_mono/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nexts.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nexts.ma deleted file mode 100644 index 128c26d64..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nexts.ma +++ /dev/null @@ -1,63 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/functions/uparrowstar_2.ma". -include "ground/arith/nat_succ_iter.ma". -include "ground/relocation/rtmap_eq.ma". - -(* RELOCATION MAP ***********************************************************) - -definition nexts (f:rtmap) (n:nat) ≝ next^n f. - -interpretation "nexts (rtmap)" 'UpArrowStar n f = (nexts f n). - -(* Basic properties *********************************************************) - -lemma nexts_O: ∀f. f = ↑*[𝟎] f. -// qed. - -lemma nexts_S: ∀f,n. ↑↑*[n] f = ↑*[↑n] f. -#f #n @(niter_succ … next) -qed. - -lemma nexts_eq_repl: ∀n. eq_repl (λf1,f2. ↑*[n] f1 ≡ ↑*[n] f2). -#n @(nat_ind_succ … n) -n /3 width=5 by eq_next/ -qed. - -(* Advanced properties ******************************************************) - -lemma nexts_swap: ∀f,n. ↑↑*[n] f = ↑*[n] ↑f. -#f #n @(niter_appl … next) -qed. - -lemma nexts_xn: ∀n,f. ↑*[n] ↑f = ↑*[↑n] f. -// qed. - -(* Basic_inversion lemmas *****************************************************) - -lemma eq_inv_nexts_sn: ∀n,f1,g2. ↑*[n] f1 ≡ g2 → - ∃∃f2. f1 ≡ f2 & ↑*[n] f2 = g2. -#n @(nat_ind_succ … n) -n /2 width=3 by ex2_intro/ -#n #IH #f1 #g2 #H elim (eq_inv_nx … H) -H [|*: // ] -#f0 #Hf10 #H1 elim (IH … Hf10) -IH -Hf10 #f2 #Hf12 #H2 destruct -/2 width=3 by ex2_intro/ -qed-. - -lemma eq_inv_nexts_dx: ∀n,f2,g1. g1 ≡ ↑*[n] f2 → - ∃∃f1. f1 ≡ f2 & ↑*[n] f1 = g1. -#n @(nat_ind_succ … n) -n /2 width=3 by ex2_intro/ -#n #IH #f2 #g1 #H elim (eq_inv_xn … H) -H [|*: // ] -#f0 #Hf02 #H1 elim (IH … Hf02) -IH -Hf02 #f1 #Hf12 #H2 destruct -/2 width=3 by ex2_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_pushs.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_pushs.ma deleted file mode 100644 index 5c43f1872..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_pushs.ma +++ /dev/null @@ -1,63 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/functions/upspoonstar_2.ma". -include "ground/arith/nat_succ_iter.ma". -include "ground/relocation/rtmap_eq.ma". - -(* RELOCATION MAP ***********************************************************) - -definition pushs (f:rtmap) (n:nat) ≝ push^n f. - -interpretation "pushs (rtmap)" 'UpSpoonStar n f = (pushs f n). - -(* Basic properties *********************************************************) - -lemma pushs_O: ∀f. f = ⫯*[𝟎] f. -// qed. - -lemma pushs_S: ∀f,n. ⫯⫯*[n] f = ⫯*[↑n] f. -#f #n @(niter_succ … push) -qed. - -lemma pushs_eq_repl: ∀n. eq_repl (λf1,f2. ⫯*[n] f1 ≡ ⫯*[n] f2). -#n @(nat_ind_succ … n) -n /3 width=5 by eq_push/ -qed. - -(* Advanced properties ******************************************************) - -lemma push_swap (n) (f): ⫯⫯*[n] f = ⫯*[n] ⫯f. -#n #f @(niter_appl … push) -qed. - -lemma pushs_xn: ∀n,f. ⫯*[n] ⫯f = ⫯*[↑n] f. -// qed. - -(* Basic_inversion lemmas *****************************************************) - -lemma eq_inv_pushs_sn: ∀n,f1,g2. ⫯*[n] f1 ≡ g2 → - ∃∃f2. f1 ≡ f2 & ⫯*[n] f2 = g2. -#n @(nat_ind_succ … n) -n /2 width=3 by ex2_intro/ -#n #IH #f1 #g2 #H elim (eq_inv_px … H) -H [|*: // ] -#f0 #Hf10 #H1 elim (IH … Hf10) -IH -Hf10 #f2 #Hf12 #H2 destruct -/2 width=3 by ex2_intro/ -qed-. - -lemma eq_inv_pushs_dx: ∀n,f2,g1. g1 ≡ ⫯*[n] f2 → - ∃∃f1. f1 ≡ f2 & ⫯*[n] f1 = g1. -#n @(nat_ind_succ … n) -n /2 width=3 by ex2_intro/ -#n #IH #f2 #g1 #H elim (eq_inv_xp … H) -H [|*: // ] -#f0 #Hf02 #H1 elim (IH … Hf02) -IH -Hf02 #f1 #Hf12 #H2 destruct -/2 width=3 by ex2_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sand.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sand.ma deleted file mode 100644 index ad8db01d7..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sand.ma +++ /dev/null @@ -1,118 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/notation/relations/rintersection_3.ma". -include "ground/relocation/rtmap_sle.ma". - -coinductive sand: relation3 rtmap rtmap rtmap ≝ -| sand_pp: ∀f1,f2,f,g1,g2,g. sand f1 f2 f → ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → sand g1 g2 g -| sand_np: ∀f1,f2,f,g1,g2,g. sand f1 f2 f → ↑f1 = g1 → ⫯f2 = g2 → ⫯f = g → sand g1 g2 g -| sand_pn: ∀f1,f2,f,g1,g2,g. sand f1 f2 f → ⫯f1 = g1 → ↑f2 = g2 → ⫯f = g → sand g1 g2 g -| sand_nn: ∀f1,f2,f,g1,g2,g. sand f1 f2 f → ↑f1 = g1 → ↑f2 = g2 → ↑f = g → sand g1 g2 g -. - -interpretation "intersection (rtmap)" - 'RIntersection f1 f2 f = (sand f1 f2 f). - -(* Basic inversion lemmas ***************************************************) - -lemma sand_inv_ppx: ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → - ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -lemma sand_inv_npx: ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → - ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -lemma sand_inv_pnx: ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → - ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -lemma sand_inv_nnx: ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → - ∃∃f. f1 ⋒ f2 ≘ f & ↑f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -(* Basic properties *********************************************************) - -corec lemma sand_eq_repl_back1: ∀f2,f. eq_repl_back … (λf1. f1 ⋒ f2 ≘ f). -#f2 #f #f1 * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x #Hx -try cases (eq_inv_px … Hx … H1) try cases (eq_inv_nx … Hx … H1) -g1 -/3 width=7 by sand_pp, sand_np, sand_pn, sand_nn/ -qed-. - -lemma sand_eq_repl_fwd1: ∀f2,f. eq_repl_fwd … (λf1. f1 ⋒ f2 ≘ f). -#f2 #f @eq_repl_sym /2 width=3 by sand_eq_repl_back1/ -qed-. - -corec lemma sand_eq_repl_back2: ∀f1,f. eq_repl_back … (λf2. f1 ⋒ f2 ≘ f). -#f1 #f #f2 * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx -try cases (eq_inv_px … Hx … H2) try cases (eq_inv_nx … Hx … H2) -g2 -/3 width=7 by sand_pp, sand_np, sand_pn, sand_nn/ -qed-. - -lemma sand_eq_repl_fwd2: ∀f1,f. eq_repl_fwd … (λf2. f1 ⋒ f2 ≘ f). -#f1 #f @eq_repl_sym /2 width=3 by sand_eq_repl_back2/ -qed-. - -corec lemma sand_eq_repl_back3: ∀f1,f2. eq_repl_back … (λf. f1 ⋒ f2 ≘ f). -#f1 #f2 #f * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx -try cases (eq_inv_px … Hx … H0) try cases (eq_inv_nx … Hx … H0) -g -/3 width=7 by sand_pp, sand_np, sand_pn, sand_nn/ -qed-. - -lemma sand_eq_repl_fwd3: ∀f1,f2. eq_repl_fwd … (λf. f1 ⋒ f2 ≘ f). -#f1 #f2 @eq_repl_sym /2 width=3 by sand_eq_repl_back3/ -qed-. - -corec lemma sand_refl: ∀f. f ⋒ f ≘ f. -#f cases (pn_split f) * #g #H -[ @(sand_pp … H H H) | @(sand_nn … H H H) ] -H // -qed. - -corec lemma sand_sym: ∀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 -[ @sand_pp | @sand_pn | @sand_np | @sand_nn ] /2 width=7 by/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sdj.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sdj.ma deleted file mode 100644 index f46e66089..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sdj.ma +++ /dev/null @@ -1,146 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||M|| *) -(* ||A|| A project by Andrea Asperti *) -(* ||T|| *) -(* ||I|| Developers: *) -(* ||T|| The HELM team. *) -(* ||A|| http://helm.tcs.unibo.it *) -(* \ / *) -(* \ / This file is distributed under the terms of the *) -(* v GNU General Public License Version 2 *) -(* *) -(**************************************************************************) - -include "ground/notation/relations/parallel_2.ma". -include "ground/relocation/rtmap_isid.ma". - -(* RELOCATION MAP ***********************************************************) - -coinductive sdj: relation rtmap ≝ -| sdj_pp: ∀f1,f2,g1,g2. sdj f1 f2 → ⫯f1 = g1 → ⫯f2 = g2 → sdj g1 g2 -| sdj_np: ∀f1,f2,g1,g2. sdj f1 f2 → ↑f1 = g1 → ⫯f2 = g2 → sdj g1 g2 -| sdj_pn: ∀f1,f2,g1,g2. sdj f1 f2 → ⫯f1 = g1 → ↑f2 = g2 → sdj g1 g2 -. - -interpretation "disjointness (rtmap)" - 'Parallel f1 f2 = (sdj f1 f2). - -(* Basic properties *********************************************************) - -axiom sdj_eq_repl_back1: ∀f2. eq_repl_back … (λf1. f1 ∥ f2). - -lemma sdj_eq_repl_fwd1: ∀f2. eq_repl_fwd … (λf1. f1 ∥ f2). -#f2 @eq_repl_sym /2 width=3 by sdj_eq_repl_back1/ -qed-. - -axiom sdj_eq_repl_back2: ∀f1. eq_repl_back … (λf2. f1 ∥ f2). - -lemma sdj_eq_repl_fwd2: ∀f1. eq_repl_fwd … (λf2. f1 ∥ f2). -#f1 @eq_repl_sym /2 width=3 by sdj_eq_repl_back2/ -qed-. - -corec lemma sdj_sym: symmetric … sdj. -#f1 #f2 * -f1 -f2 -#f1 #f2 #g1 #g2 #Hf #H1 #H2 -[ @(sdj_pp … H2 H1) | @(sdj_pn … H2 H1) | @(sdj_np … H2 H1) ] -g2 -g1 -/2 width=1 by/ -qed-. - -(* Basic inversion lemmas ***************************************************) - -lemma sdj_inv_pp: ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → f1 ∥ f2. -#g1 #g2 * -g1 -g2 -#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct -[ lapply (injective_push … Hx1) -Hx1 - lapply (injective_push … Hx2) -Hx2 // -| elim (discr_push_next … Hx1) -| elim (discr_push_next … Hx2) -] -qed-. - -lemma sdj_inv_np: ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → f1 ∥ f2. -#g1 #g2 * -g1 -g2 -#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct -[ elim (discr_next_push … Hx1) -| lapply (injective_next … Hx1) -Hx1 - lapply (injective_push … Hx2) -Hx2 // -| elim (discr_push_next … Hx2) -] -qed-. - -lemma sdj_inv_pn: ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → f1 ∥ f2. -#g1 #g2 * -g1 -g2 -#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct -[ elim (discr_next_push … Hx2) -| elim (discr_push_next … Hx1) -| lapply (injective_push … Hx1) -Hx1 - lapply (injective_next … Hx2) -Hx2 // -] -qed-. - -lemma sdj_inv_nn: ∀g1,g2. g1 ∥ g2 → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → ⊥. -#g1 #g2 * -g1 -g2 -#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct -[ elim (discr_next_push … Hx1) -| elim (discr_next_push … Hx2) -| elim (discr_next_push … Hx1) -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma sdj_inv_nx: ∀g1,g2. g1 ∥ g2 → ∀f1. ↑f1 = g1 → - ∃∃f2. f1 ∥ f2 & ⫯f2 = g2. -#g1 #g2 elim (pn_split g2) * #f2 #H2 #H #f1 #H1 -[ lapply (sdj_inv_np … H … H1 H2) -H /2 width=3 by ex2_intro/ -| elim (sdj_inv_nn … H … H1 H2) -] -qed-. - -lemma sdj_inv_xn: ∀g1,g2. g1 ∥ g2 → ∀f2. ↑f2 = g2 → - ∃∃f1. f1 ∥ f2 & ⫯f1 = g1. -#g1 #g2 elim (pn_split g1) * #f1 #H1 #H #f2 #H2 -[ lapply (sdj_inv_pn … H … H1 H2) -H /2 width=3 by ex2_intro/ -| elim (sdj_inv_nn … H … H1 H2) -] -qed-. - -lemma sdj_inv_xp: ∀g1,g2. g1 ∥ g2 → ∀f2. ⫯f2 = g2 → - ∨∨ ∃∃f1. f1 ∥ f2 & ⫯f1 = g1 - | ∃∃f1. f1 ∥ f2 & ↑f1 = g1. -#g1 #g2 elim (pn_split g1) * #f1 #H1 #H #f2 #H2 -[ lapply (sdj_inv_pp … H … H1 H2) | lapply (sdj_inv_np … H … H1 H2) ] -H -H2 -/3 width=3 by ex2_intro, or_introl, or_intror/ -qed-. - -lemma sdj_inv_px: ∀g1,g2. g1 ∥ g2 → ∀f1. ⫯f1 = g1 → - ∨∨ ∃∃f2. f1 ∥ f2 & ⫯f2 = g2 - | ∃∃f2. f1 ∥ f2 & ↑f2 = g2. -#g1 #g2 elim (pn_split g2) * #f2 #H2 #H #f1 #H1 -[ lapply (sdj_inv_pp … H … H1 H2) | lapply (sdj_inv_pn … H … H1 H2) ] -H -H1 -/3 width=3 by ex2_intro, or_introl, or_intror/ -qed-. - -(* Properties with isid *****************************************************) - -corec lemma sdj_isid_dx: ∀f2. 𝐈❪f2❫ → ∀f1. f1 ∥ f2. -#f2 * -f2 -#f2 #g2 #Hf2 #H2 #f1 cases (pn_split f1) * -/3 width=5 by sdj_np, sdj_pp/ -qed. - -corec lemma sdj_isid_sn: ∀f1. 𝐈❪f1❫ → ∀f2. f1 ∥ f2. -#f1 * -f1 -#f1 #g1 #Hf1 #H1 #f2 cases (pn_split f2) * -/3 width=5 by sdj_pn, sdj_pp/ -qed. - -(* Inversion lemmas with isid ***********************************************) - -corec lemma sdj_inv_refl: ∀f. f ∥ f → 𝐈❪f❫. -#f cases (pn_split f) * #g #Hg #H -[ lapply (sdj_inv_pp … H … Hg Hg) -H /3 width=3 by isid_push/ -| elim (sdj_inv_nn … H … Hg Hg) -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sle.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sle.ma deleted file mode 100644 index 002e6eac7..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sle.ma +++ /dev/null @@ -1,191 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||M|| *) -(* ||A|| A project by Andrea Asperti *) -(* ||T|| *) -(* ||I|| Developers: *) -(* ||T|| The HELM team. *) -(* ||A|| http://helm.tcs.unibo.it *) -(* \ / *) -(* \ / This file is distributed under the terms of the *) -(* v GNU General Public License Version 2 *) -(* *) -(**************************************************************************) - -include "ground/relocation/rtmap_isid.ma". -include "ground/relocation/rtmap_isdiv.ma". - -(* RELOCATION MAP ***********************************************************) - -coinductive sle: relation rtmap ≝ -| sle_push: ∀f1,f2,g1,g2. sle f1 f2 → ⫯f1 = g1 → ⫯f2 = g2 → sle g1 g2 -| sle_next: ∀f1,f2,g1,g2. sle f1 f2 → ↑f1 = g1 → ↑f2 = g2 → sle g1 g2 -| sle_weak: ∀f1,f2,g1,g2. sle f1 f2 → ⫯f1 = g1 → ↑f2 = g2 → sle g1 g2 -. - -interpretation "inclusion (rtmap)" - 'subseteq f1 f2 = (sle f1 f2). - -(* Basic properties *********************************************************) - -axiom sle_eq_repl_back1: ∀f2. eq_repl_back … (λf1. f1 ⊆ f2). - -lemma sle_eq_repl_fwd1: ∀f2. eq_repl_fwd … (λf1. f1 ⊆ f2). -#f2 @eq_repl_sym /2 width=3 by sle_eq_repl_back1/ -qed-. - -axiom sle_eq_repl_back2: ∀f1. eq_repl_back … (λf2. f1 ⊆ f2). - -lemma sle_eq_repl_fwd2: ∀f1. eq_repl_fwd … (λf2. f1 ⊆ f2). -#f1 @eq_repl_sym /2 width=3 by sle_eq_repl_back2/ -qed-. - -corec lemma sle_refl: ∀f. f ⊆ f. -#f cases (pn_split f) * #g #H -[ @(sle_push … H H) | @(sle_next … H H) ] -H // -qed. - -lemma sle_refl_eq: ∀f1,f2. f1 ≡ f2 → f1 ⊆ f2. -/2 width=3 by sle_eq_repl_back2/ qed. - -(* Basic inversion lemmas ***************************************************) - -lemma sle_inv_xp: ∀g1,g2. g1 ⊆ g2 → ∀f2. ⫯f2 = g2 → - ∃∃f1. f1 ⊆ f2 & ⫯f1 = g1. -#g1 #g2 * -g1 -g2 -#f1 #f2 #g1 #g2 #H #H1 #H2 #x2 #Hx2 destruct -[ lapply (injective_push … Hx2) -Hx2 /2 width=3 by ex2_intro/ ] -elim (discr_push_next … Hx2) -qed-. - -lemma sle_inv_nx: ∀g1,g2. g1 ⊆ g2 → ∀f1. ↑f1 = g1 → - ∃∃f2. f1 ⊆ f2 & ↑f2 = g2. -#g1 #g2 * -g1 -g2 -#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #Hx1 destruct -[2: lapply (injective_next … Hx1) -Hx1 /2 width=3 by ex2_intro/ ] -elim (discr_next_push … Hx1) -qed-. - -lemma sle_inv_pn: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → f1 ⊆ f2. -#g1 #g2 * -g1 -g2 -#f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct -[ elim (discr_next_push … Hx2) -| elim (discr_push_next … Hx1) -| lapply (injective_push … Hx1) -Hx1 - lapply (injective_next … Hx2) -Hx2 // -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma sle_inv_pp: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → f1 ⊆ f2. -#g1 #g2 #H #f1 #f2 #H1 #H2 elim (sle_inv_xp … H … H2) -g2 -#x1 #H #Hx1 destruct lapply (injective_push … Hx1) -Hx1 // -qed-. - -lemma sle_inv_nn: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → f1 ⊆ f2. -#g1 #g2 #H #f1 #f2 #H1 #H2 elim (sle_inv_nx … H … H1) -g1 -#x2 #H #Hx2 destruct lapply (injective_next … Hx2) -Hx2 // -qed-. - -lemma sle_inv_px: ∀g1,g2. g1 ⊆ g2 → ∀f1. ⫯f1 = g1 → - (∃∃f2. f1 ⊆ f2 & ⫯f2 = g2) ∨ ∃∃f2. f1 ⊆ f2 & ↑f2 = g2. -#g1 #g2 elim (pn_split g2) * #f2 #H2 #H #f1 #H1 -[ lapply (sle_inv_pp … H … H1 H2) | lapply (sle_inv_pn … H … H1 H2) ] -H -H1 -/3 width=3 by ex2_intro, or_introl, or_intror/ -qed-. - -lemma sle_inv_xn: ∀g1,g2. g1 ⊆ g2 → ∀f2. ↑f2 = g2 → - (∃∃f1. f1 ⊆ f2 & ⫯f1 = g1) ∨ ∃∃f1. f1 ⊆ f2 & ↑f1 = g1. -#g1 #g2 elim (pn_split g1) * #f1 #H1 #H #f2 #H2 -[ lapply (sle_inv_pn … H … H1 H2) | lapply (sle_inv_nn … H … H1 H2) ] -H -H2 -/3 width=3 by ex2_intro, or_introl, or_intror/ -qed-. - -(* Main properties **********************************************************) - -corec theorem sle_trans: Transitive … sle. -#f1 #f * -f1 -f -#f1 #f #g1 #g #Hf #H1 #H #g2 #H0 -[ cases (sle_inv_px … H0 … H) * |*: cases (sle_inv_nx … H0 … H) ] -g -/3 width=5 by sle_push, sle_next, sle_weak/ -qed-. - -(* Properties with iterated push ********************************************) - -lemma sle_pushs: ∀f1,f2. f1 ⊆ f2 → ∀n. ⫯*[n] f1 ⊆ ⫯*[n] f2. -#f1 #f2 #Hf12 #n @(nat_ind_succ … n) -n -/2 width=5 by sle_push/ -qed. - -(* Properties with tail *****************************************************) - -lemma sle_px_tl: ∀g1,g2. g1 ⊆ g2 → ∀f1. ⫯f1 = g1 → f1 ⊆ ⫱g2. -#g1 #g2 #H #f1 #H1 elim (sle_inv_px … H … H1) -H -H1 * // -qed. - -lemma sle_xn_tl: ∀g1,g2. g1 ⊆ g2 → ∀f2. ↑f2 = g2 → ⫱g1 ⊆ f2. -#g1 #g2 #H #f2 #H2 elim (sle_inv_xn … H … H2) -H -H2 * // -qed. - -lemma sle_tl: ∀f1,f2. f1 ⊆ f2 → ⫱f1 ⊆ ⫱f2. -#f1 elim (pn_split f1) * #g1 #H1 #f2 #H -[ lapply (sle_px_tl … H … H1) -H // -| elim (sle_inv_nx … H … H1) -H // -] -qed. - -(* Inversion lemmas with tail ***********************************************) - -lemma sle_inv_tl_sn: ∀f1,f2. ⫱f1 ⊆ f2 → f1 ⊆ ↑f2. -#f1 elim (pn_split f1) * #g1 #H destruct -/2 width=5 by sle_next, sle_weak/ -qed-. - -lemma sle_inv_tl_dx: ∀f1,f2. f1 ⊆ ⫱f2 → ⫯f1 ⊆ f2. -#f1 #f2 elim (pn_split f2) * #g2 #H destruct -/2 width=5 by sle_push, sle_weak/ -qed-. - -(* Properties with iteraded tail ********************************************) - -lemma sle_tls: ∀f1,f2. f1 ⊆ f2 → ∀n. ⫱*[n] f1 ⊆ ⫱*[n] f2. -#f1 #f2 #Hf12 #n @(nat_ind_succ … n) -n -/2 width=5 by sle_tl/ -qed. - -(* Properties with isid *****************************************************) - -corec lemma sle_isid_sn: ∀f1. 𝐈❪f1❫ → ∀f2. f1 ⊆ f2. -#f1 * -f1 -#f1 #g1 #Hf1 #H1 #f2 cases (pn_split f2) * -/3 width=5 by sle_weak, sle_push/ -qed. - -(* Inversion lemmas with isid ***********************************************) - -corec lemma sle_inv_isid_dx: ∀f1,f2. f1 ⊆ f2 → 𝐈❪f2❫ → 𝐈❪f1❫. -#f1 #f2 * -f1 -f2 -#f1 #f2 #g1 #g2 #Hf * * #H -[2,3: elim (isid_inv_next … H) // ] -lapply (isid_inv_push … H ??) -H -/3 width=3 by isid_push/ -qed-. - -(* Properties with isdiv ****************************************************) - -corec lemma sle_isdiv_dx: ∀f2. 𝛀❪f2❫ → ∀f1. f1 ⊆ f2. -#f2 * -f2 -#f2 #g2 #Hf2 #H2 #f1 cases (pn_split f1) * -/3 width=5 by sle_weak, sle_next/ -qed. - -(* Inversion lemmas with isdiv **********************************************) - -corec lemma sle_inv_isdiv_sn: ∀f1,f2. f1 ⊆ f2 → 𝛀❪f1❫ → 𝛀❪f2❫. -#f1 #f2 * -f1 -f2 -#f1 #f2 #g1 #g2 #Hf * * #H -[1,3: elim (isdiv_inv_push … H) // ] -lapply (isdiv_inv_next … H ??) -H -/3 width=3 by isdiv_next/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sor.ma b/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sor.ma deleted file mode 100644 index bcc705521..000000000 --- a/matita/matita/contribs/lambdadelta/ground/relocation/rtmap_sor.ma +++ /dev/null @@ -1,557 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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/or_3.ma". -include "ground/xoa/ex_3_1.ma". -include "ground/xoa/ex_4_2.ma". -include "ground/notation/relations/runion_3.ma". -include "ground/arith/nat_plus.ma". -include "ground/arith/nat_le_max.ma". -include "ground/relocation/rtmap_isfin.ma". -include "ground/relocation/rtmap_sle.ma". - -coinductive sor: relation3 rtmap rtmap rtmap ≝ -| sor_pp: ∀f1,f2,f,g1,g2,g. sor f1 f2 f → ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → sor g1 g2 g -| sor_np: ∀f1,f2,f,g1,g2,g. sor f1 f2 f → ↑f1 = g1 → ⫯f2 = g2 → ↑f = g → sor g1 g2 g -| sor_pn: ∀f1,f2,f,g1,g2,g. sor f1 f2 f → ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → sor g1 g2 g -| sor_nn: ∀f1,f2,f,g1,g2,g. sor f1 f2 f → ↑f1 = g1 → ↑f2 = g2 → ↑f = g → sor g1 g2 g -. - -interpretation "union (rtmap)" - 'RUnion f1 f2 f = (sor f1 f2 f). - -(* Basic inversion lemmas ***************************************************) - -lemma sor_inv_ppx: ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → - ∃∃f. f1 ⋓ f2 ≘ f & ⫯f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -lemma sor_inv_npx: ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → - ∃∃f. f1 ⋓ f2 ≘ f & ↑f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -lemma sor_inv_pnx: ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → - ∃∃f. f1 ⋓ f2 ≘ f & ↑f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -lemma sor_inv_nnx: ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → - ∃∃f. f1 ⋓ f2 ≘ f & ↑f = g. -#g1 #g2 #g * -g1 -g2 -g -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct -try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1) -try elim (discr_push_next … Hx1) try elim (discr_next_push … Hx1) -try (>(injective_push … Hx2) -x2) try (>(injective_next … Hx2) -x2) -try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2) -/2 width=3 by ex2_intro/ -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma sor_inv_ppn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ↑f = g → ⊥. -#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 -elim (sor_inv_ppx … H … H1 H2) -g1 -g2 #x #_ #H destruct -/2 width=3 by discr_push_next/ -qed-. - -lemma sor_inv_nxp: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f. ↑f1 = g1 → ⫯f = g → ⊥. -#g1 #g2 #g #H #f1 #f #H1 #H0 -elim (pn_split g2) * #f2 #H2 -[ elim (sor_inv_npx … H … H1 H2) -| elim (sor_inv_nnx … H … H1 H2) -] -g1 -g2 #x #_ #H destruct -/2 width=3 by discr_next_push/ -qed-. - -lemma sor_inv_xnp: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f2,f. ↑f2 = g2 → ⫯f = g → ⊥. -#g1 #g2 #g #H #f2 #f #H2 #H0 -elim (pn_split g1) * #f1 #H1 -[ elim (sor_inv_pnx … H … H1 H2) -| elim (sor_inv_nnx … H … H1 H2) -] -g1 -g2 #x #_ #H destruct -/2 width=3 by discr_next_push/ -qed-. - -lemma sor_inv_ppp: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → f1 ⋓ f2 ≘ f. -#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 -elim (sor_inv_ppx … H … H1 H2) -g1 -g2 #x #Hx #H destruct -<(injective_push … H) -f // -qed-. - -lemma sor_inv_npn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f2,f. ↑f1 = g1 → ⫯f2 = g2 → ↑f = g → f1 ⋓ f2 ≘ f. -#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 -elim (sor_inv_npx … H … H1 H2) -g1 -g2 #x #Hx #H destruct -<(injective_next … H) -f // -qed-. - -lemma sor_inv_pnn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f2,f. ⫯f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ⋓ f2 ≘ f. -#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 -elim (sor_inv_pnx … H … H1 H2) -g1 -g2 #x #Hx #H destruct -<(injective_next … H) -f // -qed-. - -lemma sor_inv_nnn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f2,f. ↑f1 = g1 → ↑f2 = g2 → ↑f = g → f1 ⋓ f2 ≘ f. -#g1 #g2 #g #H #f1 #f2 #f #H1 #H2 #H0 -elim (sor_inv_nnx … H … H1 H2) -g1 -g2 #x #Hx #H destruct -<(injective_next … H) -f // -qed-. - -lemma sor_inv_pxp: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f. ⫯f1 = g1 → ⫯f = g → - ∃∃f2. f1 ⋓ f2 ≘ f & ⫯f2 = g2. -#g1 #g2 #g #H #f1 #f #H1 #H0 -elim (pn_split g2) * #f2 #H2 -[ /3 width=7 by sor_inv_ppp, ex2_intro/ -| elim (sor_inv_xnp … H … H2 H0) -] -qed-. - -lemma sor_inv_xpp: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f2,f. ⫯f2 = g2 → ⫯f = g → - ∃∃f1. f1 ⋓ f2 ≘ f & ⫯f1 = g1. -#g1 #g2 #g #H #f2 #f #H2 #H0 -elim (pn_split g1) * #f1 #H1 -[ /3 width=7 by sor_inv_ppp, ex2_intro/ -| elim (sor_inv_nxp … H … H1 H0) -] -qed-. - -lemma sor_inv_pxn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f. ⫯f1 = g1 → ↑f = g → - ∃∃f2. f1 ⋓ f2 ≘ f & ↑f2 = g2. -#g1 #g2 #g #H #f1 #f #H1 #H0 -elim (pn_split g2) * #f2 #H2 -[ elim (sor_inv_ppn … H … H1 H2 H0) -| /3 width=7 by sor_inv_pnn, ex2_intro/ -] -qed-. - -lemma sor_inv_xpn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f2,f. ⫯f2 = g2 → ↑f = g → - ∃∃f1. f1 ⋓ f2 ≘ f & ↑f1 = g1. -#g1 #g2 #g #H #f2 #f #H2 #H0 -elim (pn_split g1) * #f1 #H1 -[ elim (sor_inv_ppn … H … H1 H2 H0) -| /3 width=7 by sor_inv_npn, ex2_intro/ -] -qed-. - -lemma sor_inv_xxp: ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f. ⫯f = g → - ∃∃f1,f2. f1 ⋓ f2 ≘ f & ⫯f1 = g1 & ⫯f2 = g2. -#g1 #g2 #g #H #f #H0 -elim (pn_split g1) * #f1 #H1 -[ elim (sor_inv_pxp … H … H1 H0) -g /2 width=5 by ex3_2_intro/ -| elim (sor_inv_nxp … H … H1 H0) -] -qed-. - -lemma sor_inv_nxn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f1,f. ↑f1 = g1 → ↑f = g → - (∃∃f2. f1 ⋓ f2 ≘ f & ⫯f2 = g2) ∨ - ∃∃f2. f1 ⋓ f2 ≘ f & ↑f2 = g2. -#g1 #g2 elim (pn_split g2) * -/4 width=7 by sor_inv_npn, sor_inv_nnn, ex2_intro, or_intror, or_introl/ -qed-. - -lemma sor_inv_xnn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → - ∀f2,f. ↑f2 = g2 → ↑f = g → - (∃∃f1. f1 ⋓ f2 ≘ f & ⫯f1 = g1) ∨ - ∃∃f1. f1 ⋓ f2 ≘ f & ↑f1 = g1. -#g1 elim (pn_split g1) * -/4 width=7 by sor_inv_pnn, sor_inv_nnn, ex2_intro, or_intror, or_introl/ -qed-. - -lemma sor_inv_xxn: ∀g1,g2,g. g1 ⋓ g2 ≘ g → ∀f. ↑f = g → - ∨∨ ∃∃f1,f2. f1 ⋓ f2 ≘ f & ↑f1 = g1 & ⫯f2 = g2 - | ∃∃f1,f2. f1 ⋓ f2 ≘ f & ⫯f1 = g1 & ↑f2 = g2 - | ∃∃f1,f2. f1 ⋓ f2 ≘ f & ↑f1 = g1 & ↑f2 = g2. -#g1 #g2 #g #H #f #H0 -elim (pn_split g1) * #f1 #H1 -[ elim (sor_inv_pxn … H … H1 H0) -g - /3 width=5 by or3_intro1, ex3_2_intro/ -| elim (sor_inv_nxn … H … H1 H0) -g * - /3 width=5 by or3_intro0, or3_intro2, ex3_2_intro/ -] -qed-. - -(* Main inversion lemmas ****************************************************) - -corec theorem sor_mono: ∀f1,f2,x,y. f1 ⋓ f2 ≘ x → f1 ⋓ f2 ≘ y → x ≡ y. -#f1 #f2 #x #y * -f1 -f2 -x -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #H -[ cases (sor_inv_ppx … H … H1 H2) -| cases (sor_inv_npx … H … H1 H2) -| cases (sor_inv_pnx … H … H1 H2) -| cases (sor_inv_nnx … H … H1 H2) -] -g1 -g2 -/3 width=5 by eq_push, eq_next/ -qed-. - -(* Basic properties *********************************************************) - -corec lemma sor_eq_repl_back1: ∀f2,f. eq_repl_back … (λf1. f1 ⋓ f2 ≘ f). -#f2 #f #f1 * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x #Hx -try cases (eq_inv_px … Hx … H1) try cases (eq_inv_nx … Hx … H1) -g1 -/3 width=7 by sor_pp, sor_np, sor_pn, sor_nn/ -qed-. - -lemma sor_eq_repl_fwd1: ∀f2,f. eq_repl_fwd … (λf1. f1 ⋓ f2 ≘ f). -#f2 #f @eq_repl_sym /2 width=3 by sor_eq_repl_back1/ -qed-. - -corec lemma sor_eq_repl_back2: ∀f1,f. eq_repl_back … (λf2. f1 ⋓ f2 ≘ f). -#f1 #f #f2 * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx -try cases (eq_inv_px … Hx … H2) try cases (eq_inv_nx … Hx … H2) -g2 -/3 width=7 by sor_pp, sor_np, sor_pn, sor_nn/ -qed-. - -lemma sor_eq_repl_fwd2: ∀f1,f. eq_repl_fwd … (λf2. f1 ⋓ f2 ≘ f). -#f1 #f @eq_repl_sym /2 width=3 by sor_eq_repl_back2/ -qed-. - -corec lemma sor_eq_repl_back3: ∀f1,f2. eq_repl_back … (λf. f1 ⋓ f2 ≘ f). -#f1 #f2 #f * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx -try cases (eq_inv_px … Hx … H0) try cases (eq_inv_nx … Hx … H0) -g -/3 width=7 by sor_pp, sor_np, sor_pn, sor_nn/ -qed-. - -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_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_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-. - -(* 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 @(nat_ind_succ … 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 -#f1 #g1 #Hf1 #H1 #f2 cases (pn_split f2) * -/3 width=7 by sor_pp, sor_pn/ -qed. - -corec lemma sor_isid_dx: ∀f2. 𝐈❪f2❫ → ∀f1. f1 ⋓ f2 ≘ f1. -#f2 * -f2 -#f2 #g2 #Hf2 #H2 #f1 cases (pn_split f1) * -/3 width=7 by sor_pp, sor_np/ -qed. - -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/ -qed-. - -lemma sor_isid_inv_dx: ∀f1,f2,f. f1 ⋓ f2 ≘ f → 𝐈❪f2❫ → f1 ≡ f. -/3 width=4 by sor_isid_dx, sor_mono/ -qed-. - -corec lemma sor_fwd_isid1: ∀f1,f2,f. f1 ⋓ f2 ≘ f → 𝐈❪f❫ → 𝐈❪f1❫. -#f1 #f2 #f * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H #Hg -[ /4 width=6 by isid_inv_push, isid_push/ ] -cases (isid_inv_next … Hg … H) -qed-. - -corec lemma sor_fwd_isid2: ∀f1,f2,f. f1 ⋓ f2 ≘ f → 𝐈❪f❫ → 𝐈❪f2❫. -#f1 #f2 #f * -f1 -f2 -f -#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H #Hg -[ /4 width=6 by isid_inv_push, isid_push/ ] -cases (isid_inv_next … Hg … H) -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 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 [2,4: #f #n + + Generic relocation maps are streams of booleans + (delayed anniversary milestone). + Primitive arithmetics library. diff --git a/matita/matita/contribs/lambdadelta/ground/web/ground_src.tbl b/matita/matita/contribs/lambdadelta/ground/web/ground_src.tbl index 54733490f..7078e2afc 100644 --- a/matita/matita/contribs/lambdadelta/ground/web/ground_src.tbl +++ b/matita/matita/contribs/lambdadelta/ground/web/ground_src.tbl @@ -10,7 +10,7 @@ table { } ] class "water" - [ { "generic rt-transition counter" * } { + [ { "generic rt-transition counters" * } { [ { "" * } { [ "rtc_ist ( 𝐓❪?,?❫ )" "rtc_ist_shift" "rtc_ist_plus" "rtc_ist_max" * ] [ "rtc_ism ( 𝐌❪?,?❫ )" "rtc_ism_shift" "rtc_ism_plus" "rtc_ism_max" "rtc_ism_max_shift" * ] @@ -20,27 +20,53 @@ table { } ] class "green" - [ { "multiple relocation" * } { + [ { "relocation maps" * } { + [ { "finite relocation with pairs" * } { + [ "fr2_nat ( @❪?,?❫ ≘ ? )" "fr2_nat_nat" * ] + [ "fr2_minus ( ? ▭ ? ≘ ? )" * ] + [ "fr2_append ( ?@@? )" * ] + [ "fr2_plus ( ?+? )" * ] + [ "fr2_map ( ◊ ) ( ❨?,?❩;? )" * ] + ] + [ { "generic relocation" * } { + [ "gr_sor ( ? ⋓ ? ≘ ? )" "gr_sor_eq" "gr_sor_tls" "gr_sor_isi" "gr_sor_fcla" "gr_sor_isf" "gr_sor_coafter_ist_isf" "gr_sor_sle" "gr_sor_sor" "gr_sor_sor_sle" * ] + [ "gr_sand ( ? ⋒ ? ≘ ? )" "gr_sand_eq" * ] + [ "gr_sdj ( ? ∥ ? )" "gr_sdj_eq" "gr_sdj_isi" * ] + [ "gr_sle ( ? ⊆ ? )" "gr_sle_eq" "gr_sle_pushs" "gr_sle_tls" "gr_sle_isi" "gr_sle_isd" "gr_sle_sle" * ] + [ "gr_coafter ( ? ~⊚ ? ≘ ? )" "gr_coafter_eq" "gr_coafter_uni_pushs" "gr_coafter_pat_tls" "gr_coafter_nat_tls" "gr_coafter_nat_tls_pushs" "gr_coafter_isi" "gr_coafter_isu" "gr_coafter_ist_isi" "gr_coafter_ist_isf" "gr_coafter_coafter" "gr_coafter_coafter_ist" * ] + [ "gr_after ( ? ⊚ ? ≘ ? )" "gr_after_eq" "gr_after_uni" "gr_after_basic" "gr_after_pat" "gr_after_pat_tls" "gr_after_pat_uni" "gr_after_nat_uni" "gr_after_isi" "gr_after_isu" "gr_after_ist" "gr_after_ist_isi" "gr_after_after" "gr_after_after_ist" * ] + [ "gr_isd ( 𝛀❪?❫ )" "gr_isd_eq" "gr_isd_tl" "gr_isd_nexts" "gr_isd_tls" * ] + [ "gr_ist ( 𝐓❪?❫ )" "gr_ist_tls" "gr_ist_isi" "gr_ist_ist" * ] + [ "gr_isf ( 𝐅❪?❫ )" "gr_isf_eq" "gr_isf_tl" "gr_isf_pushs" "fr_isf_tls" "gr_ifs_uni" "gr_isf_isu" * ] + [ "gr_fcla ( 𝐂❪?❫ ≘ ? )" "gr_fcla_eq" "fcla_uni" "gr_fcla_fcla" * ] + [ "gr_isu ( 𝐔❪?❫ )" "gr_isu_tl" "gr_isu_uni" * ] + [ "gr_isi ( 𝐈❪?❫ )" "gr_isi_eq" "gr_isi_tl" "gr_isi_pushs" "gr_isi_tls" "gr_isi_id" "gr_isi_uni" "gr_isi_pat" * ] + [ "gr_nat ( @↑❪?,?❫ ≘ ? )" "gr_nat_uni" "gr_nat_basic" "gr_nat_nat" * ] + [ "gr_pat ( @❪?,?❫ ≘ ? )" "gr_pat_lt" "gr_pat_eq" "gr_pat_tls" "gr_pat_id" "gr_pat_uni" "gr_pat_basic" "gr_pat_pat" "gr_pat_pat_id" * ] + [ "gr_basic ( 𝐛❨?,?❩ )" * ] + [ "gr_uni ( 𝐮❨?❩ )" "gr_uni_eq" * ] + [ "gr_id ( 𝐢 ) " "gr_id_eq" * ] + [ "gr_tls ( ⫱*[?]? )" "gr_tls_eq" "gr_tls_pushs" "gr_tls_pushs_eq" "gr_tls_nexts_eq" * ] + [ "gr_nexts ( ↑*[?]? )" "gr_nexts_eq" * ] + [ "gr_pushs ( ⫯*[?]? )" "gr_pushs_eq" * ] + [ "gr_tl ( ⫱? )" "gr_tl_eq" "gr_tl_eq_eq" * ] + [ "gr_eq ( ? ≡ ? )" * ] + [ "gr_map ( ⫯? ) ( ↑? )" * ] + ] +(* [ { "" * } { - [ "rtmap" "rtmap_eq ( ? ≡ ? )" "rtmap_pushs ( ⫯*[?]? )" "rtmap_nexts ( ↑*[?]? )" - "rtmap_tl ( ⫱? )" "rtmap_tls ( ⫱*[?]? )" "rtmap_isid ( 𝐈❪?❫ )" "rtmap_id" "rtmap_isdiv ( 𝛀❪?❫ )" - "rtmap_fcla ( 𝐂❪?❫ ≘ ? )" "rtmap_isfin ( 𝐅❪?❫ )" "rtmap_isuni ( 𝐔❪?❫ )" "rtmap_uni ( 𝐔❨?❩ )" - "rtmap_sle ( ? ⊆ ? )" "rtmap_sdj ( ? ∥ ? )" "rtmap_sand ( ? ⋒ ? ≘ ? )" "rtmap_sor ( ? ⋓ ? ≘ ? )" - "rtmap_at ( @❪?,?❫ ≘ ? )" "rtmap_istot ( 𝐓❪?❫ )" "rtmap_after ( ? ⊚ ? ≘ ? )" "rtmap_coafter ( ? ~⊚ ? ≘ ? )" - "rtmap_basic ( 𝐁❨?,?❩ )" "rtmap_basic_after" - * ] [ "nstream ( ⫯? ) ( ↑? )" "nstream_eq" "" "" - "" "" "nstream_isid" "nstream_id ( 𝐈𝐝 )" "" + "" "" "nstream_isid" "nstream_id ( 𝐢 )" "" "" "" "" "" "" "" "" "nstream_sor" "" "nstream_istot ( ?@❨?❩ )" "nstream_after ( ? ∘ ? )" "nstream_coafter ( ? ~∘ ? )" "nstream_basic" "" * ] +*) (* [ "trace ( ∥?∥ )" "trace_at ( @❪?,?❫ ≘ ? )" "trace_after ( ? ⊚ ? ≘ ? )" "trace_isid ( 𝐈❪?❫ )" "trace_isun ( 𝐔❪?❫ )" "trace_sle ( ? ⊆ ? )" "trace_sor ( ? ⋓ ? ≘ ? )" "trace_snot ( ∁ ? )" * ] *) - [ "mr2 ( ◊ ) ( ❨?,?❩;? )" "mr2_append ( ? @@? )" "mr2_at ( @❪?,?❫ ≘ ? )" "mr2_plus ( ? + ? )" "mr2_minus ( ? ▭ ? ≘ ? )" * ] } ] } @@ -90,8 +116,14 @@ table { ] class "yellow" [ { "extensions to the library" * } { + [ { "streams" * } { + [ "stream_tls ( ⫰*{?}[?]? )" "stream_tls_eq" * ] + [ "stream_hdtl ( ⫰{?}? )" * ] + [ "stream_eq ( ? ≗{?} ? )" "stream_eq_eq" * ] + [ "stream ( ? ⨮{?} ? )" * ] + } + ] [ { "" * } { - [ "stream ( ? ⨮{?} ? )" "stream_eq ( ? ≗{?} ? )" "stream_hdtl ( ⫰{?}? )" "stream_tls ( ⫰*{?}[?]? )" * ] [ "list ( Ⓔ{?} ) ( ? ⨮{?} ? )" "list_eq" "list_length ( |?| )" * ] [ "bool ( Ⓕ ) ( Ⓣ )" "bool_or" "bool_and" * ] [ "ltc" "ltc_ctc" * ] diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma index ec5c69191..d67deff75 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma @@ -217,7 +217,7 @@ fact drops_fwd_drop2_aux: ∀b,f2,X,Y. ⇩*[b,f2] X ≘ Y → ∀I,K. Y = K.ⓘ[ | #f2 #I #L1 #L2 #_ #IHL #J #K #H elim (IHL … H) -IHL /3 width=7 by after_next, ex3_2_intro, drops_drop/ | #f2 #I1 #I2 #L1 #L2 #HL #_ #_ #J #K #H destruct - lapply (after_isid_dx 𝐈𝐝 … f2) /3 width=9 by after_push, ex3_2_intro, drops_drop/ + lapply (after_isid_dx 𝐢 … f2) /3 width=9 by after_push, ex3_2_intro, drops_drop/ ] qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_drops.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_drops.ma index dd8ee277c..ab924e9b8 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_drops.ma @@ -88,7 +88,7 @@ qed-. (* Basic_2A1: includes: drop_mono *) lemma drops_mono: ∀b1,f,L,L1. ⇩*[b1,f] L ≘ L1 → ∀b2,L2. ⇩*[b2,f] L ≘ L2 → L1 = L2. -#b1 #f #L #L1 lapply (after_isid_dx 𝐈𝐝 … f) +#b1 #f #L #L1 lapply (after_isid_dx 𝐢 … f) /3 width=8 by drops_conf, drops_fwd_isid/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lex_tc.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lex_tc.ma index 5dadd4e18..2f86bf51c 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/lex_tc.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lex_tc.ma @@ -46,7 +46,7 @@ qed-. lemma lex_CTC (R): s_rs_transitive … R (λ_. lex R) → TC … (lex R) ⊆ lex (CTC … R). #R #HR #L1 #L2 #HL12 -lapply (monotonic_TC … (sex cfull (cext2 R) 𝐈𝐝) … HL12) -HL12 +lapply (monotonic_TC … (sex cfull (cext2 R) 𝐢) … HL12) -HL12 [ #L1 #L2 * /3 width=3 by sex_eq_repl_fwd, eq_id_inv_isid/ | /5 width=9 by s_rs_transitive_lex_inv_isid, sex_tc_dx, sex_co, ext2_tc, ex2_intro/ ] diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts.ma index 3aef874bc..3f78beb36 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts.ma @@ -112,13 +112,13 @@ qed-. (* Basic_2A1: includes: lift_inj *) lemma lifts_inj: ∀f. is_inj2 … (lifts f). -#f #T1 #U #H1 #T2 #H2 lapply (after_isid_dx 𝐈𝐝 … f) +#f #T1 #U #H1 #T2 #H2 lapply (after_isid_dx 𝐢 … f) /3 width=6 by lifts_div3, lifts_fwd_isid/ qed-. (* Basic_2A1: includes: lift_mono *) lemma lifts_mono: ∀f,T. is_mono … (lifts f T). -#f #T #U1 #H1 #U2 #H2 lapply (after_isid_sn 𝐈𝐝 … f) +#f #T #U1 #H1 #U2 #H2 lapply (after_isid_sn 𝐢 … f) /3 width=6 by lifts_conf, lifts_fwd_isid/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts_bind.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts_bind.ma index 39f9c2310..0e18b44fd 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts_bind.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts_bind.ma @@ -43,11 +43,11 @@ qed-. (* Advanced proprerties *****************************************************) lemma liftsb_inj: ∀f. is_inj2 … (liftsb f). -#f #T1 #U #H1 #T2 #H2 lapply (after_isid_dx 𝐈𝐝 … f) +#f #T1 #U #H1 #T2 #H2 lapply (after_isid_dx 𝐢 … f) /3 width=6 by liftsb_div3, liftsb_fwd_isid/ qed-. lemma liftsb_mono: ∀f,T. is_mono … (liftsb f T). -#f #T #U1 #H1 #U2 #H2 lapply (after_isid_sn 𝐈𝐝 … f) +#f #T #U1 #H1 #U2 #H2 lapply (after_isid_sn 𝐢 … f) /3 width=6 by liftsb_conf, liftsb_fwd_isid/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/gcp_cr.ma b/matita/matita/contribs/lambdadelta/static_2/static/gcp_cr.ma index af61cbd4f..589fc597c 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/gcp_cr.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/gcp_cr.ma @@ -104,7 +104,7 @@ lemma acr_gcr: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → letin s ≝ 0 (* one sort must exist *) lapply (cp1 … H1RP G L s) #HK lapply (s2 … IHB G L (Ⓔ) … HK) // #HB - lapply (H (𝐈𝐝) L (⋆s) T ? ? ?) -H + lapply (H (𝐢) L (⋆s) T ? ? ?) -H /3 width=6 by s1, cp3, drops_refl, lifts_refl/ | #G #L #Vs #HVs #T #H1T #H2T #f #L0 #V0 #X #HL0 #H #HB elim (lifts_inv_applv1 … H) -H #V0s #T0 #HV0s #HT0 #H destruct diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rex_lex.ma b/matita/matita/contribs/lambdadelta/static_2/static/rex_lex.ma index c40731941..e43cd5459 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex_lex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex_lex.ma @@ -34,7 +34,7 @@ lemma rex_inv_req_lex (R): ∀L1,L2,T. L1 ⪤[R,T] L2 → ∃∃L. L1 ≡[T] L & L ⪤[R] L2. #R #H1R #H2R #L1 #L2 #T * #f1 #Hf1 #HL -elim (sex_sdj_split_dx … ceq_ext … HL 𝐈𝐝) -HL +elim (sex_sdj_split_dx … ceq_ext … HL 𝐢) -HL [ #L0 #HL10 #HL02 lapply (sex_sdj … HL02 f1 ?) /2 width=1 by sdj_isid_sn/ #H /3 width=5 by (* 2x *) ex2_intro/ @@ -50,7 +50,7 @@ lemma rex_fwd_lex_req (R): ∀L1,L2,T. L1 ⪤[R,T] L2 → ∃∃L. L1 ⪤[R] L & L ≡[T] L2. #R #H1R #H2R #L1 #L2 #T * #f1 #Hf1 #HL -elim (sex_sdj_split_sn … ceq_ext … HL 𝐈𝐝 ?) -HL +elim (sex_sdj_split_sn … ceq_ext … HL 𝐢 ?) -HL [ #L0 #HL10 #HL02 |*: /2 width=1 by ext2_refl, sdj_isid_dx/ ] -H1R lapply (sex_sdj … HL10 f1 ?) /2 width=1 by sdj_isid_sn/ #H elim (frees_sex_conf_fsge … Hf1 … H) // -H2R -H #f0 #Hf0 #Hf01 -- 2.39.2