From: Claudio Sacerdoti Coen Date: Fri, 27 Sep 2019 14:52:38 +0000 (+0200) Subject: Merge branch 'declarative' into matita-lablgtk3 X-Git-Tag: make_still_working~229^2~1^2~1 X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=commitdiff_plain;h=5b5dca0c118dfbe3ba8f0514ef07549544eb7810;hp=4112b9f87a555bfc4c3cd06bae652cd2382cad8b Merge branch 'declarative' into matita-lablgtk3 --- diff --git a/.gitignore b/.gitignore index 59fdc3df1..e7228e3ba 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ helm/www/lambdadelta/xslt/documentation_3.xsl helm/www/lambdadelta/xslt/sitemap.xsl helm/www/lambdadelta/xslt/versions.xsl helm/www/lambdadelta/xslt/core.xsl +helm/www/lambdadelta/xslt/changes.xsl helm/www/lambdadelta/xslt/chc_45.xsl helm/www/lambdadelta/xslt/xhtbl.xsl @@ -75,3 +76,5 @@ matita/matita/contribs/lambdadelta/token matita/matita/contribs/lambdadelta/2A matita/matita/contribs/lambdadelta/*/*_probe.txt matita/matita/contribs/lambdadelta/*/web/*_sum.tbl + +matita/matita/contribs/convergence/ diff --git a/README b/README index 4aad3fc69..4d1a6c03b 100644 --- a/README +++ b/README @@ -1,3 +1,3 @@ -matita : current version: 0.99.3 +matita : current version: 0.99.4 matitaB: new version: 0.5.8 helm : old version: 0.5.8 with additional material diff --git a/helm/www/lambdadelta/alt.sh b/helm/www/lambdadelta/alt.sh new file mode 100644 index 000000000..80a326f64 --- /dev/null +++ b/helm/www/lambdadelta/alt.sh @@ -0,0 +1 @@ +sed s?lambdadelta.info?www.cs.unibo.it/~fguidi/lambdadelta?g html/$1.html > html/$1.alt.html diff --git a/helm/www/lambdadelta/css/martha.css b/helm/www/lambdadelta/css/martha.css index 68e956194..59c7c821a 100644 --- a/helm/www/lambdadelta/css/martha.css +++ b/helm/www/lambdadelta/css/martha.css @@ -1,23 +1,40 @@ @charset "UTF-8"; -/* menus ********************************************************************/ +/* term selection ***********************************************************/ -td { - padding: inherit; +.term:hover > .term:not(:hover) { + opacity: 0.35; } +/* log table ****************************************************************/ + +.log { + width: 100%; + border-collapse: collapse; +} + +.log_cell { + border-color: initial; + border-style: solid none; + border-width: thin; + padding: 2px; +} + +/* forms ********************************************************************/ + .text { display: inline-block; list-style: none; margin: initial; padding: initial; - white-space: nowrap; + white-space: nowrap; } .menu { display: none; border-style: solid; border-width: thin; + border-collapse: collapse; position: absolute; } @@ -25,14 +42,34 @@ td { display: inline-block; } +.menu_cell { + padding: 2px; +} + +.menu_empty { + padding: inherit; +} + +.menu_sep { + padding: inherit; + border-top-style: solid; + border-top-width: thin; +} + /* buttons ******************************************************************/ +.type { + font: inherit; +} + .button { - color: inherit; background-color: inherit; - border-style: none; + border-style: none; + color: inherit; + font: inherit; margin: initial; padding: initial; + text-align: inherit; } .button:hover { @@ -83,13 +120,13 @@ a:active { /* font families ************************************************************/ .monospace { - font-family:monospace; + font-family: monospace; "Courier New", Courier; } /* line heights *************************************************************/ .l_150 { - line-height:150%; + line-height: 150%; } /* font sizes ***************************************************************/ @@ -100,21 +137,25 @@ a:active { /* foreground colors (equalized to gray 8F) *********************************/ +.f_white { + color:#FFFFFF; +} + .f_gray { color:#8F8F8F; } .f_wine { - color:#FF52A0; -} + color:#FF52A0; +} .f_magenta { - color:#FF41FF; -} + color:#FF41FF; +} .f_prune { - color:#C65DFF; -} + color:#C65DFF; +} .f_blue { color:#8181FF; @@ -187,7 +228,7 @@ a:active { } .b_cyan { - background-color:#6CFFFF; + background-color:#6CFFFF; } .b_water { @@ -214,8 +255,30 @@ a:active { background-color:#FFC0C0; } +.b_black { + background-color:#000000; +} + /* background colors (equalized to gray EB) *********************************/ .b_gray_EB { background-color:#EBEBEB; } + +.b_blue_EB { + background-color:#E8E8FF; +} + +.b_orange_EB { + background-color:#FFEBB1; +} + +.b_red_EB { + background-color:#FFE2E2; +} + +/* background colors (equalized to gray 48) *********************************/ + +.b_gray_48 { + background-color:#484848; +} diff --git a/helm/www/lambdadelta/images/bronze-03BB.png b/helm/www/lambdadelta/images/bronze-03BB.png new file mode 100644 index 000000000..3cf590000 Binary files /dev/null and b/helm/www/lambdadelta/images/bronze-03BB.png differ diff --git a/helm/www/lambdadelta/web/home/changes.ldw.xml b/helm/www/lambdadelta/web/home/changes.ldw.xml new file mode 100644 index 000000000..4287ac584 --- /dev/null +++ b/helm/www/lambdadelta/web/home/changes.ldw.xml @@ -0,0 +1,17 @@ + + + + + + Changes + + + + +
+ diff --git a/helm/www/lambdadelta/web/home/changes.tbl b/helm/www/lambdadelta/web/home/changes.tbl new file mode 100644 index 000000000..d25be28c7 --- /dev/null +++ b/helm/www/lambdadelta/web/home/changes.tbl @@ -0,0 +1,118 @@ +name "changes" + +table { + class "gray" + [ "version" [ "aspect" [ "" "changes" ]] + ] + + class "orange" + [ { "λδ-2B" + "(unreleased)" * } + { + [ [{ "equivalences" * }] + { "+" "+" "+" "-" } + { "equivalence for full rt-reduction (terms)" + "equivalence for whd rt-reduction (terms)" + "equivalence for extended rt-reduction (terms, referred lenvs, closures)" + "syntactic equivalence (closures) removed" + } + ] + [ [{ "weights" * }] + { "+" } + { "switch in primitive order relations for closures to enable the exclusion binder" + } + ] + [ [{ "relocation" * }] + { "" } + { "" + } + ] + [ [{ "syntax" * }] + { "+" } + { "exclusion binder for lenvs" + } + ] + [ [{ "ground" * }] + { "+" "*" "+" "-" } + { "rt-transition counters" + "generic reference transforming maps as streams of non-negative integers" + "extensional equality, labelled transitive closures and streams" + "non-negative integers with infinity removed" + } + ] + } + ] + + class "orange" + [ { "λδ-2A" + "(October 2014)" * } + { + [ [{ "equivalences" * }] + { "+" } + { "syntactic equivalence (selected lenvs, referred lenvs, closures)" + } + ] + [ [{ "weights" * }] + { "*" "-" } + { "primitive order relations for closures" + "complex weight (terms) removed" + } + ] + [ [{ "relocation" * }] + { "-" } + { "level update functions removed" + } + ] + [ [{ "syntax" * }] + { "+" "+" "+" "-" "-" } + { "polarized binders for terms" + "non-negative integer global references for terms" + "syntactic support for genvs with typed abstraction, abbreviation" + "numbered sorts, application, type annotation removed from lenvs" + "exclusion binder removed from terms and lenvs" + } + ] + [ [{ "ground" * }] + { "+" "+" } + { "lists and non-negative integers with infinity" + "library extension for transitive closures and booleans" + } + ] + } + ] + + class "red" + [ { "λδ-1A" + "(November 2006)" * } + { + [ [{ "equivalences" * }] + { "" } + { "equivalence for outer reduction (terms)" + } + ] + [ [{ "weights" * }] + { "" "" "" } + { "order relations (terms, lenvs, closures) based on weights" + "simple weights (terms, lenvs, closures)" + "complex weight (terms)" + } + ] + [ [{ "relocation" * }] + { "" } + { "level update functions" + } + ] + [ [{ "syntax" * }] + { "" "" } + { "lenvs with non-negative integer sorts, application, typed abstraction, abbreviation, exclusion, type annotation" + "terms with non-negative integer sorts and local references, application, typed abstraction, abbreviation, exclusion, type annotation" } + ] + [ [{ "ground" * }] + { "" "" } + { "finite reference transforming maps as compositions of basic ones" + "library extension for logic and non-negative integers" + } + ] + } + ] + +} + +class "center" { 2 } diff --git a/helm/www/lambdadelta/web/home/home.ldw.xml b/helm/www/lambdadelta/web/home/home.ldw.xml index 8e6135836..e773b460b 100644 --- a/helm/www/lambdadelta/web/home/home.ldw.xml +++ b/helm/www/lambdadelta/web/home/home.ldw.xml @@ -30,6 +30,9 @@ to view this site correctly, please select a font with Unicode support. + + + diff --git a/helm/www/lambdadelta/xslt/ld_web_root.xsl b/helm/www/lambdadelta/xslt/ld_web_root.xsl index 3fbc83b45..82ce7d781 100644 --- a/helm/www/lambdadelta/xslt/ld_web_root.xsl +++ b/helm/www/lambdadelta/xslt/ld_web_root.xsl @@ -190,6 +190,14 @@ + + [Official bronze sponsor of Unicode Consortium] + +

diff --git a/matita/.merlin b/matita/.merlin new file mode 100644 index 000000000..92f60a69a --- /dev/null +++ b/matita/.merlin @@ -0,0 +1,9 @@ +S components/* +S matita + +B components/* +B matita + +PKG lablgtk3 helm-content helm-ng_disambiguation helm-content_pres helm-ng_extraction helm-disambiguation helm-ng_kernel helm-extlib helm-ng_library helm-getter helm-ng_paramodulation helm-grafite helm-ng_refiner helm-grafite_engine helm-ng_tactics helm-grafite_parser helm-registry helm-library helm-syntax_extensions helm-logger helm-thread helm-ng_cic_content helm-xml + +FLG -rectypes diff --git a/matita/Makefile b/matita/Makefile index 35ff6ad59..208091758 100644 --- a/matita/Makefile +++ b/matita/Makefile @@ -93,8 +93,8 @@ dist_pre: dist_export: dist/configure rm -rf $(DISTDIR) mkdir $(DISTDIR) - svn export components $(DISTDIR)/components - svn export matita $(DISTDIR)/matita + git archive matita-lablgtk3 components | tar -x -C $(DISTDIR) + git archive matita-lablgtk3 matita | tar -x -C $(DISTDIR) (cd $(DISTDIR) && find . -name .depend -exec rm \{\} \;) (cd $(DISTDIR) && find . -name .depend.opt -exec rm \{\} \;) (cd $(DISTDIR) && rm -rf $(CLEAN_ON_DIST)) diff --git a/matita/components/METAS/meta.helm-content_pres.src b/matita/components/METAS/meta.helm-content_pres.src index f9540fa62..0e361298e 100644 --- a/matita/components/METAS/meta.helm-content_pres.src +++ b/matita/components/METAS/meta.helm-content_pres.src @@ -1,4 +1,4 @@ -requires="helm-content helm-syntax_extensions camlp5.gramlib ulex08 helm-grafite" +requires="helm-content helm-syntax_extensions camlp5.gramlib ulex-camlp5 helm-grafite" version="0.0.1" archive(byte)="content_pres.cma" archive(native)="content_pres.cmxa" diff --git a/matita/components/METAS/meta.helm-grafite_parser.src b/matita/components/METAS/meta.helm-grafite_parser.src index 91bfdab4c..c415c72b0 100644 --- a/matita/components/METAS/meta.helm-grafite_parser.src +++ b/matita/components/METAS/meta.helm-grafite_parser.src @@ -1,4 +1,4 @@ -requires="helm-grafite ulex08 helm-ng_disambiguation helm-ng_library helm-content_pres" +requires="helm-grafite ulex-camlp5 helm-ng_disambiguation helm-ng_library helm-content_pres" version="0.0.1" archive(byte)="grafite_parser.cma" archive(native)="grafite_parser.cmxa" diff --git a/matita/components/Makefile.common b/matita/components/Makefile.common index 7a4727c76..74a54a821 100644 --- a/matita/components/Makefile.common +++ b/matita/components/Makefile.common @@ -20,7 +20,7 @@ endif PREPROCOPTIONS = -pp camlp5o SYNTAXOPTIONS = -syntax camlp5o PREREQ = -OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread -rectypes $(ANNOTOPTION) +OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread -rectypes $(ANNOTOPTION) -w @A-52-4-34-37-45-9-44-48-6-32-20-58-7-57-3 # -57-3 for ocaml 4.0.5 OCAMLDEBUGOPTIONS = -g #OCAML_PROF=p -p a OCAMLARCHIVEOPTIONS = diff --git a/matita/components/binaries/matitadep/matitadep.ml b/matita/components/binaries/matitadep/matitadep.ml index 054f90f4a..d21af12a3 100644 --- a/matita/components/binaries/matitadep/matitadep.ml +++ b/matita/components/binaries/matitadep/matitadep.ml @@ -1,8 +1,8 @@ -module StringSet = Set.Make (String) +module StringSet = Set.Make (String) type file = { - ddeps: string list; (* direct dependences *) - rdeps: StringSet.t option (* recursive dependences *) + ddeps: string list; (* direct dependences *) + rdeps: StringSet.t option (* recursive dependences *) } let graph = Hashtbl.create 503 @@ -10,111 +10,124 @@ let graph = Hashtbl.create 503 let debug = ref 0 let rec purge dname vdeps = match vdeps with - | [] -> vdeps - | hd :: tl -> if hd = dname then tl else hd :: purge dname tl + | [] -> vdeps + | hd :: tl -> if hd = dname then tl else hd :: purge dname tl let add fname = - if fname = "" then () else - if Hashtbl.mem graph fname then () else - Hashtbl.add graph fname {ddeps = []; rdeps = None} + if fname = "" then () else + if Hashtbl.mem graph fname then () else + Hashtbl.add graph fname {ddeps = []; rdeps = None} let add_ddep fname dname = - if dname = "" then () else - let file = Hashtbl.find graph fname in - Hashtbl.replace graph fname {file with ddeps = dname :: file.ddeps} + if dname = "" then () else + let file = Hashtbl.find graph fname in + Hashtbl.replace graph fname {file with ddeps = dname :: file.ddeps} let init fname dname = - if !debug land 1 > 0 then Printf.eprintf "init: %s: %s.\n" fname dname; - add fname; add dname; add_ddep fname dname + if !debug land 1 > 0 then Printf.eprintf "init: %s: %s.\n" fname dname; + add fname; add dname; add_ddep fname dname (* vdeps: visited dependences for loop detection *) let rec compute_from_file vdeps fname file = match file.rdeps with - | Some rdeps -> rdeps - | None -> - if !debug land 2 > 0 then Printf.eprintf " compute file: %s\n" fname; - let vdeps = fname :: vdeps in - List.iter (redundant vdeps fname file.ddeps) file.ddeps; - let rdeps = compute_from_ddeps vdeps file.ddeps in - Hashtbl.replace graph fname {file with rdeps = Some rdeps}; - rdeps + | Some rdeps -> rdeps + | None -> + if !debug land 2 > 0 then Printf.eprintf " compute file: %s\n" fname; + let vdeps = fname :: vdeps in + List.iter (redundant vdeps fname file.ddeps) file.ddeps; + let rdeps = compute_from_ddeps vdeps file.ddeps in + Hashtbl.replace graph fname {file with rdeps = Some rdeps}; + rdeps and compute_from_dname vdeps rdeps dname = - if List.mem dname vdeps then begin - let loop = purge dname (List.rev vdeps) in - Printf.printf "circular: %s\n" (String.concat " " loop); - StringSet.add dname rdeps - end else - let file = Hashtbl.find graph dname in - StringSet.add dname (StringSet.union (compute_from_file vdeps dname file) rdeps) + if List.mem dname vdeps then begin + let loop = purge dname (List.rev vdeps) in + Printf.printf "circular: %s\n" (String.concat " " loop); + StringSet.add dname rdeps + end else + let file = Hashtbl.find graph dname in + StringSet.add dname (StringSet.union (compute_from_file vdeps dname file) rdeps) -and compute_from_ddeps vdeps ddeps = - List.fold_left (compute_from_dname vdeps) StringSet.empty ddeps +and compute_from_ddeps vdeps ddeps = + List.fold_left (compute_from_dname vdeps) StringSet.empty ddeps and redundant vdeps fname ddeps dname = - let rdeps = compute_from_ddeps vdeps (purge dname ddeps) in - if StringSet.mem dname rdeps then - Printf.printf "%s: redundant %s\n" fname dname + let rdeps = compute_from_ddeps vdeps (purge dname ddeps) in + if StringSet.mem dname rdeps then + Printf.printf "%s: redundant %s\n" fname dname -let check () = - let iter fname file = ignore (compute_from_file [] fname file) in - Hashtbl.iter iter graph +let check () = + let iter fname file = ignore (compute_from_file [] fname file) in + Hashtbl.iter iter graph let get_unions () = - let map1 ddeps dname = StringSet.add dname ddeps in - let map2 fname file (fnames, ddeps) = - StringSet.add fname fnames, List.fold_left map1 ddeps file.ddeps - in - Hashtbl.fold map2 graph (StringSet.empty, StringSet.empty) + let map1 ddeps dname = StringSet.add dname ddeps in + let map2 fname file (fnames, ddeps) = + StringSet.add fname fnames, List.fold_left map1 ddeps file.ddeps + in + Hashtbl.fold map2 graph (StringSet.empty, StringSet.empty) let get_leafs () = - let map fname file fnames = - if file.ddeps = [] then StringSet.add fname fnames else fnames - in - Hashtbl.fold map graph StringSet.empty + let map fname file fnames = + if file.ddeps = [] then StringSet.add fname fnames else fnames + in + Hashtbl.fold map graph StringSet.empty let top () = - let iter fname = Printf.printf "top: %s\n" fname in - let fnames, ddeps = get_unions () in - StringSet.iter iter (StringSet.diff fnames ddeps) + let iter fname = Printf.printf "top: %s\n" fname in + let fnames, ddeps = get_unions () in + StringSet.iter iter (StringSet.diff fnames ddeps) let leaf () = - let iter fname = Printf.printf "leaf: %s\n" fname in - let fnames = get_leafs () in - StringSet.iter iter fnames - -let rec read ich = - let line = input_line ich in - begin try Scanf.sscanf line "%s@:include \"%s@\"." init - with Scanf.Scan_failure _ -> - begin try Scanf.sscanf line "./%s@:include \"%s@\"." init - with Scanf.Scan_failure _ -> - begin try Scanf.sscanf line "%s@:(*%s@*)" (fun _ _ -> ()) - with Scanf.Scan_failure _ -> - Printf.eprintf "unknown line: %s.\n" line - end - end - end; - read ich - + let iter fname = Printf.printf "leaf: %s\n" fname in + let fnames = get_leafs () in + StringSet.iter iter fnames + +let back fname = + Printf.printf "backward: %s\n" fname; + try match (Hashtbl.find graph fname).rdeps with + | None -> () + | Some rdeps -> + let iter fname = Printf.printf "%s\n" fname in + StringSet.iter iter rdeps + with Not_found -> () + +let rec read ich = + let line = input_line ich in + begin try Scanf.sscanf line "%s@:include \"%s@\"." init + with Scanf.Scan_failure _ -> + begin try Scanf.sscanf line "./%s@:include \"%s@\"." init + with Scanf.Scan_failure _ -> + begin try Scanf.sscanf line "%s@:(*%s@*)" (fun _ _ -> ()) + with Scanf.Scan_failure _ -> + Printf.eprintf "unknown line: %s.\n" line + end + end + end; + read ich + let _ = - let show_check = ref false in - let show_top = ref false in - let show_leaf = ref false in - let process_file name = () in - let show () = - if !show_check then check (); - if !show_top then top (); - if !show_leaf then leaf () - in - let help = "matitadep [-clt | -d ] < " in - let help_c = " Print the redundant and looping arcs of the dependences graph" in - let help_d = " Set these debug options" in - let help_l = " Print the leaf nodes of the dependences graph" in - let help_t = " Print the top nodes of the dependences graph" in - Arg.parse [ - "-c", Arg.Set show_check, help_c; - "-d", Arg.Int (fun x -> debug := x), help_d; - "-l", Arg.Set show_leaf, help_l; - "-t", Arg.Set show_top, help_t; - ] process_file help; - try read stdin with End_of_file -> show () + let show_check = ref false in + let show_top = ref false in + let show_leaf = ref false in + let show_back = ref "" in + let process_file name = () in + let show () = + if !show_check then check (); + if !show_top then top (); + if !show_leaf then leaf (); + if !show_back <> "" then back !show_back + in + let help = "matitadep [-clt | -d | -b ] < " in + let help_b = " Print the backward dependences of this node" in + let help_c = " Print the redundant and looping arcs of the dependences graph" in + let help_d = " Set these debug options" in + let help_l = " Print the leaf nodes of the dependences graph" in + let help_t = " Print the top nodes of the dependences graph" in + Arg.parse [ + "-b", Arg.String ((:=) show_back), help_b; + "-c", Arg.Set show_check, help_c; + "-d", Arg.Int ((:=) debug), help_d; + "-l", Arg.Set show_leaf, help_l; + "-t", Arg.Set show_top, help_t; + ] process_file help; + try read stdin with End_of_file -> show () diff --git a/matita/components/binaries/xoa/Makefile b/matita/components/binaries/xoa/Makefile index dd5a763f7..1933a2003 100644 --- a/matita/components/binaries/xoa/Makefile +++ b/matita/components/binaries/xoa/Makefile @@ -1,6 +1,6 @@ EXEC = xoa VERSION=0.2.0 -REQUIRES = helm-grafite +REQUIRES = helm-registry include ../Makefile.common diff --git a/matita/components/binaries/xoa/xoa.ml b/matita/components/binaries/xoa/xoa.ml index 219b90660..c5604f1e6 100644 --- a/matita/components/binaries/xoa/xoa.ml +++ b/matita/components/binaries/xoa/xoa.ml @@ -19,67 +19,76 @@ let incremental = ref true let separate = ref false let clear () = - incremental := true; - separate := false; - R.clear () + incremental := true; + separate := false; + R.clear () let unm_ex s = - Scanf.sscanf s "%u %u" A.mk_exists + Scanf.sscanf s "%u %u" A.mk_exists let unm_or s = - Scanf.sscanf s "%u" A.mk_or + Scanf.sscanf s "%u" A.mk_or let unm_and s = - Scanf.sscanf s "%u" A.mk_and + Scanf.sscanf s "%u" A.mk_and let process_centralized conf = - let preamble = L.get_preamble conf in - if R.has "xoa.objects" && R.has "xoa.notations" then begin - let ooch = L.open_out preamble (R.get_string "xoa.objects") in - let noch = L.open_out preamble (R.get_string "xoa.notations") in - List.iter (L.out_include ooch) (R.get_list R.string "xoa.include"); - L.out_include ooch (R.get_string "xoa.notations" ^ ".ma"); - List.iter (E.generate ooch noch) (R.get_list unm_ex "xoa.ex"); - List.iter (E.generate ooch noch) (R.get_list unm_or "xoa.or"); - List.iter (E.generate ooch noch) (R.get_list unm_and "xoa.and"); - close_out noch; close_out ooch - end + let preamble = L.get_preamble conf in + if R.has "xoa.objects" && R.has "xoa.notations" then begin + let ooch = L.open_out preamble (R.get_string "xoa.objects") in + let noch = L.open_out preamble (R.get_string "xoa.notations") in + List.iter (L.out_include ooch) (R.get_list R.string "xoa.include"); + L.out_include ooch (R.get_string "xoa.notations" ^ ".ma"); + List.iter (E.generate ooch noch) (R.get_list unm_ex "xoa.ex"); + List.iter (E.generate ooch noch) (R.get_list unm_or "xoa.or"); + List.iter (E.generate ooch noch) (R.get_list unm_and "xoa.and"); + close_out noch; close_out ooch + end -let generate (p, o, n) = function - | A.Exists (c, v) as d -> +let generate (p, o, n) d = + let oname, nname = match d with + | A.Exists (c, v) -> let oname = Printf.sprintf "%s/ex_%u_%u" o c v in let nname = Printf.sprintf "%s/ex_%u_%u" n c v in - if !incremental && L.exists_out oname && L.exists_out nname then () else - begin - let ooch = L.open_out p oname in - let noch = L.open_out p nname in - List.iter (L.out_include ooch) (R.get_list R.string "xoa.include"); - L.out_include ooch (nname ^ ".ma"); - E.generate ooch noch d; - close_out noch; close_out ooch - end - | A.Or c -> () - | A.And c -> () + oname, nname + | A.Or c -> + let oname = Printf.sprintf "%s/or_%u" o c in + let nname = Printf.sprintf "%s/or_%u" n c in + oname, nname + | A.And c -> + let oname = Printf.sprintf "%s/and_%u" o c in + let nname = Printf.sprintf "%s/and_%u" n c in + oname, nname + in + if !incremental && L.exists_out oname && L.exists_out nname then () else + begin + let ooch = L.open_out p oname in + let noch = L.open_out p nname in + List.iter (L.out_include ooch) (R.get_list R.string "xoa.include"); + L.out_include ooch (nname ^ ".ma"); + E.generate ooch noch d; + close_out noch; close_out ooch + end let process_distributed conf = - let preamble = L.get_preamble conf in - if R.has "xoa.objects" && R.has "xoa.notations" then begin - let st = preamble, R.get_string "xoa.objects", R.get_string "xoa.notations" in - List.iter (generate st) (R.get_list unm_ex "xoa.ex"); - List.iter (generate st) (R.get_list unm_or "xoa.or"); - List.iter (generate st) (R.get_list unm_and "xoa.and"); - end + let preamble = L.get_preamble conf in + if R.has "xoa.objects" && R.has "xoa.notations" then begin + let st = preamble, R.get_string "xoa.objects", R.get_string "xoa.notations" in + List.iter (generate st) (R.get_list unm_ex "xoa.ex"); + List.iter (generate st) (R.get_list unm_or "xoa.or"); + List.iter (generate st) (R.get_list unm_and "xoa.and"); + end let process conf = - if !separate then process_distributed conf else process_centralized conf + if !separate then process_distributed conf else process_centralized conf let _ = - let help = "Usage: xoa [ -Xs | ]*\n" in - let help_X = " Clear configuration" in - let help_s = " Generate separate objects" in - let help_u = " Update existing separate files" in - Arg.parse [ - "-X", Arg.Unit clear, help_X; - "-s", Arg.Set separate, help_s; - "-u", Arg.Clear incremental, help_u; - ] process help + let help = "Usage: xoa [ -Xs | ]*\n" in + let help_X = " Clear configuration" in + let help_s = " Generate separate objects" in + let help_u = " Update existing separate files" in + Arg.parse [ + "-X", Arg.Unit clear, help_X; + "-s", Arg.Set separate, help_s; + "-u", Arg.Clear incremental, help_u; + ] process help diff --git a/matita/components/content/.depend b/matita/components/content/.depend index 369dbbdc4..6b7755819 100644 --- a/matita/components/content/.depend +++ b/matita/components/content/.depend @@ -1,14 +1,36 @@ +content.cmo : \ + content.cmi +content.cmx : \ + content.cmi content.cmi : -notationUtil.cmi : notationPt.cmo -notationEnv.cmi : notationPt.cmo -notationPp.cmi : notationPt.cmo notationEnv.cmi +notationEnv.cmo : \ + notationUtil.cmi \ + notationPt.cmo \ + notationEnv.cmi +notationEnv.cmx : \ + notationUtil.cmx \ + notationPt.cmx \ + notationEnv.cmi +notationEnv.cmi : \ + notationPt.cmo +notationPp.cmo : \ + notationPt.cmo \ + notationEnv.cmi \ + notationPp.cmi +notationPp.cmx : \ + notationPt.cmx \ + notationEnv.cmx \ + notationPp.cmi +notationPp.cmi : \ + notationPt.cmo \ + notationEnv.cmi notationPt.cmo : notationPt.cmx : -content.cmo : content.cmi -content.cmx : content.cmi -notationUtil.cmo : notationPt.cmo notationUtil.cmi -notationUtil.cmx : notationPt.cmx notationUtil.cmi -notationEnv.cmo : notationUtil.cmi notationPt.cmo notationEnv.cmi -notationEnv.cmx : notationUtil.cmx notationPt.cmx notationEnv.cmi -notationPp.cmo : notationPt.cmo notationEnv.cmi notationPp.cmi -notationPp.cmx : notationPt.cmx notationEnv.cmx notationPp.cmi +notationUtil.cmo : \ + notationPt.cmo \ + notationUtil.cmi +notationUtil.cmx : \ + notationPt.cmx \ + notationUtil.cmi +notationUtil.cmi : \ + notationPt.cmo diff --git a/matita/components/content/.depend.opt b/matita/components/content/.depend.opt index 7bb00ba9b..4ef84ec5d 100644 --- a/matita/components/content/.depend.opt +++ b/matita/components/content/.depend.opt @@ -1,14 +1,22 @@ +content.cmx : \ + content.cmi content.cmi : -notationUtil.cmi : notationPt.cmx -notationEnv.cmi : notationPt.cmx -notationPp.cmi : notationPt.cmx notationEnv.cmi -notationPt.cmo : +notationEnv.cmx : \ + notationUtil.cmx \ + notationPt.cmx \ + notationEnv.cmi +notationEnv.cmi : \ + notationPt.cmx +notationPp.cmx : \ + notationPt.cmx \ + notationEnv.cmx \ + notationPp.cmi +notationPp.cmi : \ + notationPt.cmx \ + notationEnv.cmi notationPt.cmx : -content.cmo : content.cmi -content.cmx : content.cmi -notationUtil.cmo : notationPt.cmx notationUtil.cmi -notationUtil.cmx : notationPt.cmx notationUtil.cmi -notationEnv.cmo : notationUtil.cmi notationPt.cmx notationEnv.cmi -notationEnv.cmx : notationUtil.cmx notationPt.cmx notationEnv.cmi -notationPp.cmo : notationPt.cmx notationEnv.cmi notationPp.cmi -notationPp.cmx : notationPt.cmx notationEnv.cmx notationPp.cmi +notationUtil.cmx : \ + notationPt.cmx \ + notationUtil.cmi +notationUtil.cmi : \ + notationPt.cmx diff --git a/matita/components/content/notationEnv.ml b/matita/components/content/notationEnv.ml index be9171a8d..164fec0e8 100644 --- a/matita/components/content/notationEnv.ml +++ b/matita/components/content/notationEnv.ml @@ -93,7 +93,7 @@ let lookup_list env name = | ty, _ -> raise (Type_mismatch (name, ty)) let opt_binding_some (n, (ty, v)) = (n, (OptType ty, OptValue (Some v))) -let opt_binding_none (n, (ty, v)) = (n, (OptType ty, OptValue None)) +let opt_binding_none (n, (ty, _v)) = (n, (OptType ty, OptValue None)) let opt_binding_of_name (n, ty) = (n, (OptType ty, OptValue None)) let list_binding_of_name (n, ty) = (n, (ListType ty, ListValue [])) let opt_declaration (n, ty) = (n, OptType ty) diff --git a/matita/components/content/notationPp.ml b/matita/components/content/notationPp.ml index 369a0fa28..038d75d9c 100644 --- a/matita/components/content/notationPp.ml +++ b/matita/components/content/notationPp.ml @@ -110,7 +110,7 @@ let rec pp_term (status : #NCic.status) ?(pp_parens = true) t = (match typ with None -> "" | Some t -> sprintf " return %s" (pp_term t)) (pp_patterns status patterns) | Ast.Cast (t1, t2) -> sprintf "(%s: %s)" (pp_term ~pp_parens:true t1) (pp_term ~pp_parens:true t2) - | Ast.LetIn ((var,t2), t1, t3) -> + | Ast.LetIn ((var,_t2), t1, t3) -> (* let t2 = match t2 with None -> Ast.Implicit | Some t -> t in *) sprintf "let %s \\def %s in %s" (pp_term var) (* (pp_term ~pp_parens:true t2) *) @@ -251,8 +251,8 @@ and pp_variable = function | Ast.NumVar s -> "number " ^ s | Ast.IdentVar s -> "ident " ^ s | Ast.TermVar (s,Ast.Self _) -> s - | Ast.TermVar (s,Ast.Level l) -> "term " ^string_of_int l - | Ast.Ascription (t, n) -> assert false + | Ast.TermVar (_s,Ast.Level l) -> "term " ^string_of_int l + | Ast.Ascription (_t, _n) -> assert false | Ast.FreshVar n -> "fresh " ^ n let _pp_term = ref (pp_term ~pp_parens:false) diff --git a/matita/components/content/notationUtil.ml b/matita/components/content/notationUtil.ml index 82096f80b..02530eff5 100644 --- a/matita/components/content/notationUtil.ml +++ b/matita/components/content/notationUtil.ml @@ -111,7 +111,7 @@ let visit_variable k = function | Ast.Ascription (t, s) -> Ast.Ascription (k t, s) let variables_of_term t = - let rec vars = ref [] in + let vars = ref [] in let add_variable v = if List.mem v !vars then () else vars := v :: !vars @@ -145,7 +145,7 @@ let names_of_term t = List.map aux (variables_of_term t) let keywords_of_term t = - let rec keywords = ref [] in + let keywords = ref [] in let add_keyword k = keywords := k :: !keywords in let rec aux = function | Ast.AttributedTerm (_, t) -> aux t @@ -166,7 +166,7 @@ let rec strip_attributes t = | Ast.AttributedTerm (_, term) -> strip_attributes term | Ast.Magic m -> Ast.Magic (visit_magic strip_attributes m) | Ast.Variable _ as t -> t - | t -> assert false + | _t -> assert false in visit_ast ~special_k strip_attributes t @@ -177,7 +177,7 @@ let rec get_idrefs = | _ -> [] let meta_names_of_term term = - let rec names = ref [] in + let names = ref [] in let add_name n = if List.mem n !names then () else names := n :: !names @@ -186,7 +186,7 @@ let meta_names_of_term term = | Ast.AttributedTerm (_, term) -> aux term | Ast.Appl terms -> List.iter aux terms | Ast.Binder (_, _, body) -> aux body - | Ast.Case (term, indty, outty_opt, patterns) -> + | Ast.Case (term, _indty, outty_opt, patterns) -> aux term ; aux_opt outty_opt ; List.iter aux_branch patterns @@ -218,7 +218,7 @@ let meta_names_of_term term = aux term and aux_pattern = function - Ast.Pattern (head, _, vars) -> List.iter aux_capture_var vars + Ast.Pattern (_head, _, vars) -> List.iter aux_capture_var vars | Ast.Wildcard -> () and aux_substs substs = List.iter (fun (_, term) -> aux term) substs and aux_meta_substs meta_substs = List.iter aux_opt meta_substs @@ -350,8 +350,8 @@ let rec freshen_term ?(index = ref 0) term = | _ -> assert false in match term with - | Ast.Symbol (s, instance) -> Ast.Symbol (s, fresh_instance ()) - | Ast.Num (s, instance) -> Ast.Num (s, fresh_instance ()) + | Ast.Symbol (s, _instance) -> Ast.Symbol (s, fresh_instance ()) + | Ast.Num (s, _instance) -> Ast.Num (s, fresh_instance ()) | t -> visit_ast ~special_k freshen_term t let freshen_obj obj = diff --git a/matita/components/content_pres/.depend b/matita/components/content_pres/.depend index 4deb6e591..0f1c00964 100644 --- a/matita/components/content_pres/.depend +++ b/matita/components/content_pres/.depend @@ -1,38 +1,92 @@ -renderingAttrs.cmi : -cicNotationLexer.cmi : -cicNotationParser.cmi : -mpresentation.cmi : +box.cmo : \ + renderingAttrs.cmi \ + box.cmi +box.cmx : \ + renderingAttrs.cmx \ + box.cmi box.cmi : -content2presMatcher.cmi : -termContentPres.cmi : cicNotationParser.cmi -boxPp.cmi : mpresentation.cmi cicNotationPres.cmi box.cmi -cicNotationPres.cmi : mpresentation.cmi box.cmi -content2pres.cmi : termContentPres.cmi cicNotationPres.cmi -renderingAttrs.cmo : renderingAttrs.cmi -renderingAttrs.cmx : renderingAttrs.cmi -cicNotationLexer.cmo : cicNotationLexer.cmi -cicNotationLexer.cmx : cicNotationLexer.cmi -cicNotationParser.cmo : cicNotationLexer.cmi cicNotationParser.cmi -cicNotationParser.cmx : cicNotationLexer.cmx cicNotationParser.cmi -mpresentation.cmo : mpresentation.cmi -mpresentation.cmx : mpresentation.cmi -box.cmo : renderingAttrs.cmi box.cmi -box.cmx : renderingAttrs.cmx box.cmi -content2presMatcher.cmo : content2presMatcher.cmi -content2presMatcher.cmx : content2presMatcher.cmi -termContentPres.cmo : renderingAttrs.cmi content2presMatcher.cmi \ - cicNotationParser.cmi termContentPres.cmi -termContentPres.cmx : renderingAttrs.cmx content2presMatcher.cmx \ - cicNotationParser.cmx termContentPres.cmi -boxPp.cmo : renderingAttrs.cmi mpresentation.cmi cicNotationPres.cmi box.cmi \ +boxPp.cmo : \ + renderingAttrs.cmi \ + mpresentation.cmi \ + cicNotationPres.cmi \ + box.cmi \ boxPp.cmi -boxPp.cmx : renderingAttrs.cmx mpresentation.cmx cicNotationPres.cmx box.cmx \ +boxPp.cmx : \ + renderingAttrs.cmx \ + mpresentation.cmx \ + cicNotationPres.cmx \ + box.cmx \ boxPp.cmi -cicNotationPres.cmo : renderingAttrs.cmi mpresentation.cmi box.cmi \ +boxPp.cmi : \ + mpresentation.cmi \ + cicNotationPres.cmi \ + box.cmi +cicNotationLexer.cmo : \ + cicNotationLexer.cmi +cicNotationLexer.cmx : \ + cicNotationLexer.cmi +cicNotationLexer.cmi : +cicNotationParser.cmo : \ + cicNotationLexer.cmi \ + cicNotationParser.cmi +cicNotationParser.cmx : \ + cicNotationLexer.cmx \ + cicNotationParser.cmi +cicNotationParser.cmi : +cicNotationPres.cmo : \ + renderingAttrs.cmi \ + mpresentation.cmi \ + box.cmi \ + cicNotationPres.cmi +cicNotationPres.cmx : \ + renderingAttrs.cmx \ + mpresentation.cmx \ + box.cmx \ cicNotationPres.cmi -cicNotationPres.cmx : renderingAttrs.cmx mpresentation.cmx box.cmx \ +cicNotationPres.cmi : \ + mpresentation.cmi \ + box.cmi +content2pres.cmo : \ + termContentPres.cmi \ + renderingAttrs.cmi \ + mpresentation.cmi \ + cicNotationPres.cmi \ + box.cmi \ + content2pres.cmi +content2pres.cmx : \ + termContentPres.cmx \ + renderingAttrs.cmx \ + mpresentation.cmx \ + cicNotationPres.cmx \ + box.cmx \ + content2pres.cmi +content2pres.cmi : \ + termContentPres.cmi \ cicNotationPres.cmi -content2pres.cmo : termContentPres.cmi renderingAttrs.cmi mpresentation.cmi \ - cicNotationPres.cmi box.cmi content2pres.cmi -content2pres.cmx : termContentPres.cmx renderingAttrs.cmx mpresentation.cmx \ - cicNotationPres.cmx box.cmx content2pres.cmi +content2presMatcher.cmo : \ + content2presMatcher.cmi +content2presMatcher.cmx : \ + content2presMatcher.cmi +content2presMatcher.cmi : +mpresentation.cmo : \ + mpresentation.cmi +mpresentation.cmx : \ + mpresentation.cmi +mpresentation.cmi : +renderingAttrs.cmo : \ + renderingAttrs.cmi +renderingAttrs.cmx : \ + renderingAttrs.cmi +renderingAttrs.cmi : +termContentPres.cmo : \ + renderingAttrs.cmi \ + content2presMatcher.cmi \ + cicNotationParser.cmi \ + termContentPres.cmi +termContentPres.cmx : \ + renderingAttrs.cmx \ + content2presMatcher.cmx \ + cicNotationParser.cmx \ + termContentPres.cmi +termContentPres.cmi : \ + cicNotationParser.cmi diff --git a/matita/components/content_pres/.depend.opt b/matita/components/content_pres/.depend.opt index 4deb6e591..1e74dfbf4 100644 --- a/matita/components/content_pres/.depend.opt +++ b/matita/components/content_pres/.depend.opt @@ -1,38 +1,55 @@ -renderingAttrs.cmi : -cicNotationLexer.cmi : -cicNotationParser.cmi : -mpresentation.cmi : +box.cmx : \ + renderingAttrs.cmx \ + box.cmi box.cmi : -content2presMatcher.cmi : -termContentPres.cmi : cicNotationParser.cmi -boxPp.cmi : mpresentation.cmi cicNotationPres.cmi box.cmi -cicNotationPres.cmi : mpresentation.cmi box.cmi -content2pres.cmi : termContentPres.cmi cicNotationPres.cmi -renderingAttrs.cmo : renderingAttrs.cmi -renderingAttrs.cmx : renderingAttrs.cmi -cicNotationLexer.cmo : cicNotationLexer.cmi -cicNotationLexer.cmx : cicNotationLexer.cmi -cicNotationParser.cmo : cicNotationLexer.cmi cicNotationParser.cmi -cicNotationParser.cmx : cicNotationLexer.cmx cicNotationParser.cmi -mpresentation.cmo : mpresentation.cmi -mpresentation.cmx : mpresentation.cmi -box.cmo : renderingAttrs.cmi box.cmi -box.cmx : renderingAttrs.cmx box.cmi -content2presMatcher.cmo : content2presMatcher.cmi -content2presMatcher.cmx : content2presMatcher.cmi -termContentPres.cmo : renderingAttrs.cmi content2presMatcher.cmi \ - cicNotationParser.cmi termContentPres.cmi -termContentPres.cmx : renderingAttrs.cmx content2presMatcher.cmx \ - cicNotationParser.cmx termContentPres.cmi -boxPp.cmo : renderingAttrs.cmi mpresentation.cmi cicNotationPres.cmi box.cmi \ - boxPp.cmi -boxPp.cmx : renderingAttrs.cmx mpresentation.cmx cicNotationPres.cmx box.cmx \ +boxPp.cmx : \ + renderingAttrs.cmx \ + mpresentation.cmx \ + cicNotationPres.cmx \ + box.cmx \ boxPp.cmi -cicNotationPres.cmo : renderingAttrs.cmi mpresentation.cmi box.cmi \ +boxPp.cmi : \ + mpresentation.cmi \ + cicNotationPres.cmi \ + box.cmi +cicNotationLexer.cmx : \ + cicNotationLexer.cmi +cicNotationLexer.cmi : +cicNotationParser.cmx : \ + cicNotationLexer.cmx \ + cicNotationParser.cmi +cicNotationParser.cmi : +cicNotationPres.cmx : \ + renderingAttrs.cmx \ + mpresentation.cmx \ + box.cmx \ cicNotationPres.cmi -cicNotationPres.cmx : renderingAttrs.cmx mpresentation.cmx box.cmx \ +cicNotationPres.cmi : \ + mpresentation.cmi \ + box.cmi +content2pres.cmx : \ + termContentPres.cmx \ + renderingAttrs.cmx \ + mpresentation.cmx \ + cicNotationPres.cmx \ + box.cmx \ + content2pres.cmi +content2pres.cmi : \ + termContentPres.cmi \ cicNotationPres.cmi -content2pres.cmo : termContentPres.cmi renderingAttrs.cmi mpresentation.cmi \ - cicNotationPres.cmi box.cmi content2pres.cmi -content2pres.cmx : termContentPres.cmx renderingAttrs.cmx mpresentation.cmx \ - cicNotationPres.cmx box.cmx content2pres.cmi +content2presMatcher.cmx : \ + content2presMatcher.cmi +content2presMatcher.cmi : +mpresentation.cmx : \ + mpresentation.cmi +mpresentation.cmi : +renderingAttrs.cmx : \ + renderingAttrs.cmi +renderingAttrs.cmi : +termContentPres.cmx : \ + renderingAttrs.cmx \ + content2presMatcher.cmx \ + cicNotationParser.cmx \ + termContentPres.cmi +termContentPres.cmi : \ + cicNotationParser.cmi diff --git a/matita/components/content_pres/Makefile b/matita/components/content_pres/Makefile index 655ffbe8f..28d403a70 100644 --- a/matita/components/content_pres/Makefile +++ b/matita/components/content_pres/Makefile @@ -16,19 +16,15 @@ INTERFACE_FILES = \ IMPLEMENTATION_FILES = \ $(INTERFACE_FILES:%.mli=%.ml) -cicNotationPres.cmi: OCAMLOPTIONS += -rectypes -cicNotationPres.cmo: OCAMLOPTIONS += -rectypes -cicNotationPres.cmx: OCAMLOPTIONS += -rectypes - all: clean: LOCAL_LINKOPTS = -package helm-content_pres -linkpkg cicNotationLexer.cmo: OCAMLC = $(OCAMLC_P4) -cicNotationParser.cmo: OCAMLC = $(OCAMLC_P4) +cicNotationParser.cmo: OCAMLC = $(OCAMLC_P4) -w -27 cicNotationLexer.cmx: OCAMLOPT = $(OCAMLOPT_P4) -cicNotationParser.cmx: OCAMLOPT = $(OCAMLOPT_P4) +cicNotationParser.cmx: OCAMLOPT = $(OCAMLOPT_P4) -w -27 cicNotationLexer.ml.annot: OCAMLC = $(OCAMLC_P4) cicNotationParser.ml.annot: OCAMLC = $(OCAMLC_P4) @@ -39,7 +35,7 @@ include ../Makefile.common # soon as we have ocaml 3.09 everywhere and "loc" occurrences are replaced by # "_loc" occurrences UTF8DIR := $(shell $(OCAMLFIND) query helm-syntax_extensions) -ULEXDIR := $(shell $(OCAMLFIND) query ulex08) +ULEXDIR := $(shell $(OCAMLFIND) query ulex-camlp5) MY_SYNTAXOPTIONS = -pp "camlp5o -I $(UTF8DIR) -I $(ULEXDIR) pa_extend.cmo pa_ulex.cma pa_unicode_macro.cma -loc loc" cicNotationLexer.cmo: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS) cicNotationParser.cmo: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS) diff --git a/matita/components/content_pres/boxPp.ml b/matita/components/content_pres/boxPp.ml index 45c8b6c20..1d99a8bb0 100644 --- a/matita/components/content_pres/boxPp.ml +++ b/matita/components/content_pres/boxPp.ml @@ -136,15 +136,15 @@ let render_to_strings ~map_unicode_to_tex choose_action size markup = let spacing = want_spacing attrs in let children' = List.map aux_box children in (fun size -> - let (size', renderings) as res = + let (size', _renderings) as res = render_row max_size spacing children' in if size' <= size then (* children fit in a row *) res else (* break needed, re-render using a Box.V *) aux_box (Box.V (attrs, children)) size) - | Box.V (attrs, []) -> assert false - | Box.V (attrs, [child]) -> aux_box child + | Box.V (_attrs, []) -> assert false + | Box.V (_attrs, [child]) -> aux_box child | Box.V (attrs, hd :: tl) -> let indent = want_indent attrs in let hd_f = aux_box hd in @@ -163,8 +163,8 @@ let render_to_strings ~map_unicode_to_tex choose_action size markup = in let rows = hd_rendering @ List.concat tl_renderings in max_len rows, rows) - | Box.HOV (attrs, []) -> assert false - | Box.HOV (attrs, [child]) -> aux_box child + | Box.HOV (_attrs, []) -> assert false + | Box.HOV (_attrs, [child]) -> aux_box child | Box.HOV (attrs, children) -> let spacing = want_spacing attrs in let indent = want_indent attrs in @@ -216,7 +216,7 @@ let render_to_strings ~map_unicode_to_tex choose_action size markup = let href = try let _,_,href = - List.find (fun (ns,na,value) -> ns = Some "xlink" && na = "href") attrs + List.find (fun (ns,na,_value) -> ns = Some "xlink" && na = "href") attrs in Some href with Not_found -> None in @@ -240,7 +240,7 @@ let render_to_strings ~map_unicode_to_tex choose_action size markup = in fixed_rendering href s | Pres.Mspace _ -> fixed_rendering href string_space - | Pres.Mrow (attrs, children) -> + | Pres.Mrow (_attrs, children) -> let children' = List.map aux_mpres children in (fun size -> render_row size false children') | Pres.Mfrac (_, m, n) -> diff --git a/matita/components/content_pres/cicNotationParser.ml b/matita/components/content_pres/cicNotationParser.ml index 1e6860281..8c7460346 100644 --- a/matita/components/content_pres/cicNotationParser.ml +++ b/matita/components/content_pres/cicNotationParser.ml @@ -189,8 +189,8 @@ let extract_term_production status pattern = and aux_magic magic = match magic with | Ast.Opt p -> - let p_bindings, p_atoms, p_names, p_action = inner_pattern p in - let action (env_opt : NotationEnv.t option) (loc : Ast.location) = + let _p_bindings, p_atoms, p_names, p_action = inner_pattern p in + let action (env_opt : NotationEnv.t option) (_loc : Ast.location) = match env_opt with | Some env -> List.map Env.opt_binding_some env | None -> List.map Env.opt_binding_of_name p_names diff --git a/matita/components/content_pres/cicNotationPres.ml b/matita/components/content_pres/cicNotationPres.ml index 04440ffe7..fe9b5f869 100644 --- a/matita/components/content_pres/cicNotationPres.ml +++ b/matita/components/content_pres/cicNotationPres.ml @@ -25,8 +25,6 @@ (* $Id$ *) -open Printf - module Ast = NotationPt module Mpres = Mpresentation @@ -194,7 +192,7 @@ let add_parens child_prec curr_prec t = match t with | Mpresentation.Mobject (_, box) -> mpres_of_box (Box.H ([], [ open_box_paren; box; closed_box_paren ])) - | mpres -> Mpresentation.Mrow ([], [open_paren; t; closed_paren]) + | _mpres -> Mpresentation.Mrow ([], [open_paren; t; closed_paren]) end else ((*prerr_endline ("NOT adding parens around: "^ BoxPp.render_to_string (function x::_->x|_->assert false) @@ -311,7 +309,7 @@ let render status ~lookup_uri ?(prec=(-1)) = | t -> prerr_endline ("unexpected ast: " ^ NotationPp.pp_term status t); assert false - and aux_attributes xmlattrs mathonly xref prec t = + and aux_attributes _xmlattrs mathonly _xref prec t = let reset = ref false in let inferred_level = ref None in let expected_level = ref None in @@ -352,7 +350,7 @@ let render status ~lookup_uri ?(prec=(-1)) = in (* prerr_endline (NotationPp.pp_term t); *) aux_attribute t - and aux_literal xmlattrs xref prec l = + and aux_literal xmlattrs xref _prec l = let attrs = make_href xmlattrs xref in (match l with | `Symbol s -> Mpres.Mo (attrs, to_unicode s) diff --git a/matita/components/content_pres/content2pres.ml b/matita/components/content_pres/content2pres.ml index 880024ad9..7918772f4 100644 --- a/matita/components/content_pres/content2pres.ml +++ b/matita/components/content_pres/content2pres.ml @@ -85,7 +85,7 @@ let make_args_for_apply term2pres args = let make_arg_for_apply is_first arg row = let res = match arg with - Con.Aux n -> assert false + Con.Aux _n -> assert false | Con.Premise prem -> let name = (match prem.Con.premise_binder with @@ -404,16 +404,16 @@ and conclude_aux term2pres ?skip_initial_lambdas_internal is_top_down conclude = (match p.Con.premise_binder with | None -> assert false; (* unnamed hypothesis ??? *) | Some s -> B.Text([],s)) - | err -> assert false) in + | _err -> assert false) in (match conclude.Con.conclude_conclusion with None -> B.b_h [] [B.b_kw "by"; B.b_space; arg] - | Some c -> + | Some _c -> B.b_h [] [B.b_kw "by"; B.b_space; arg] ) else if conclude.Con.conclude_method = "Intros+LetTac" then (match conclude.Con.conclude_args with - [Con.ArgProof p] -> + [Con.ArgProof _p] -> (match conclude.Con.conclude_args with [Con.ArgProof p] -> proof2pres0 term2pres ?skip_initial_lambdas_internal true p false @@ -538,11 +538,11 @@ and args2pres term2pres l = List.map (arg2pres term2pres) l and arg2pres term2pres = function Con.Aux n -> B.b_kw ("aux " ^ n) - | Con.Premise prem -> B.b_kw "premise" - | Con.Lemma lemma -> B.b_kw "lemma" + | Con.Premise _prem -> B.b_kw "premise" + | Con.Lemma _lemma -> B.b_kw "lemma" | Con.Term (_,t) -> term2pres t | Con.ArgProof p -> proof2pres0 term2pres true p false - | Con.ArgMethod s -> B.b_kw "method" + | Con.ArgMethod _s -> B.b_kw "method" and case term2pres conclude = let proof_conclusion = @@ -557,7 +557,7 @@ and case term2pres conclude = let case_on = let case_arg = (match arg with - Con.Aux n -> B.b_kw "an aux???" + Con.Aux _n -> B.b_kw "an aux???" | Con.Premise prem -> (match prem.Con.premise_binder with None -> B.b_kw "previous" @@ -565,8 +565,8 @@ and case term2pres conclude = | Con.Lemma lemma -> B.Object ([], P.Mi([],lemma.Con.lemma_name)) | Con.Term (_,t) -> term2pres t - | Con.ArgProof p -> B.b_kw "a proof???" - | Con.ArgMethod s -> B.b_kw "a method???") + | Con.ArgProof _p -> B.b_kw "a proof???" + | Con.ArgMethod _s -> B.b_kw "a method???") in (make_concl "we proceed by cases on" case_arg) in let to_prove = @@ -588,7 +588,7 @@ and byinduction term2pres conclude = let induction_on = let arg = (match inductive_arg with - Con.Aux n -> B.b_kw "an aux???" + Con.Aux _n -> B.b_kw "an aux???" | Con.Premise prem -> (match prem.Con.premise_binder with None -> B.b_kw "previous" @@ -596,8 +596,8 @@ and byinduction term2pres conclude = | Con.Lemma lemma -> B.Object ([], P.Mi([],lemma.Con.lemma_name)) | Con.Term (_,t) -> term2pres t - | Con.ArgProof p -> B.b_kw "a proof???" - | Con.ArgMethod s -> B.b_kw "a method???") in + | Con.ArgProof _p -> B.b_kw "a proof???" + | Con.ArgMethod _s -> B.b_kw "a method???") in (make_concl "we proceed by induction on" arg) in let to_prove = B.H ([], [make_concl "to prove" proof_conclusion ; B.Text([],".")]) in @@ -690,14 +690,14 @@ and falseind term2pres conclude = | Some t -> term2pres t) in let case_arg = (match conclude.Con.conclude_args with - [Con.Aux(n);_;case_arg] -> case_arg + [Con.Aux(_n);_;case_arg] -> case_arg | _ -> assert false; (* List.map (ContentPp.parg 0) conclude.Con.conclude_args; assert false *)) in let arg = (match case_arg with - Con.Aux n -> assert false + Con.Aux _n -> assert false | Con.Premise prem -> (match prem.Con.premise_binder with None -> [B.b_kw "Contradiction, hence"] @@ -713,14 +713,14 @@ and falseind term2pres conclude = and andind term2pres conclude = let proof,case_arg = (match conclude.Con.conclude_args with - [Con.Aux(n);_;Con.ArgProof proof;case_arg] -> proof,case_arg + [Con.Aux(_n);_;Con.ArgProof proof;case_arg] -> proof,case_arg | _ -> assert false; (* List.map (ContentPp.parg 0) conclude.Con.conclude_args; assert false *)) in let arg = (match case_arg with - Con.Aux n -> assert false + Con.Aux _n -> assert false | Con.Premise prem -> (match prem.Con.premise_binder with None -> [] @@ -730,7 +730,7 @@ and andind term2pres conclude = B.Object([], P.Mi([],lemma.Con.lemma_name))] | _ -> assert false) in match proof.Con.proof_context with - `Hypothesis hyp1::`Hypothesis hyp2::tl -> + `Hypothesis hyp1::`Hypothesis hyp2::_tl -> let preshyp1 = B.H ([], [B.Text([],"("); @@ -763,14 +763,14 @@ and andind term2pres conclude = and exists term2pres conclude = let proof = (match conclude.Con.conclude_args with - [Con.Aux(n);_;Con.ArgProof proof;_] -> proof + [Con.Aux(_n);_;Con.ArgProof proof;_] -> proof | _ -> assert false; (* List.map (ContentPp.parg 0) conclude.Con.conclude_args; assert false *)) in match proof.Con.proof_context with - `Declaration decl::`Hypothesis hyp::tl - | `Hypothesis decl::`Hypothesis hyp::tl -> + `Declaration decl::`Hypothesis hyp::_tl + | `Hypothesis decl::`Hypothesis hyp::_tl -> let presdecl = B.H ([], [(B.b_kw "let"); @@ -982,7 +982,7 @@ let njoint_def2pres term2pres joint_kind defs = let nobj2pres0 ?skip_initial_lambdas ?(skip_thm_and_qed=false) term2pres - (id,metasenv,obj : NotationPt.term Content.cobj) + (_id,metasenv,obj : NotationPt.term Content.cobj) = match obj with | `Def (Content.Const, thesis, `Proof p) -> diff --git a/matita/components/content_pres/content2presMatcher.ml b/matita/components/content_pres/content2presMatcher.ml index ee62e06e6..f6319c735 100644 --- a/matita/components/content_pres/content2presMatcher.ml +++ b/matita/components/content_pres/content2presMatcher.ml @@ -25,11 +25,8 @@ (* $Id$ *) -open Printf - module Ast = NotationPt module Env = NotationEnv -module Pp = NotationPp module Util = NotationUtil let get_tag term0 = @@ -84,7 +81,7 @@ struct Ast.Variable (Ast.TermVar (name,Ast.Level 0)) in let rec aux = function - | Ast.AttributedTerm (_, t) -> assert false + | Ast.AttributedTerm (_, _t) -> assert false | Ast.Literal _ | Ast.Layout _ -> assert false | Ast.Variable v -> Ast.Variable v @@ -169,7 +166,7 @@ input *) and compile_magic = function - | Ast.Fold (kind, p_base, names, p_rec) -> + | Ast.Fold (_kind, p_base, names, p_rec) -> let p_rec_decls = Env.declarations_of_term p_rec in (* LUCA: p_rec_decls should not contain "names" *) let acc_name = try List.hd names with Failure _ -> assert false in @@ -184,7 +181,7 @@ input let rec aux term = match compiled_rec term with | None -> aux_base term - | Some (env', ctors', _) -> + | Some (env', _ctors', _) -> begin let acc = Env.lookup_term env' acc_name in let env'' = Env.remove_name env' acc_name in @@ -220,7 +217,7 @@ input | Some (env', ctors', 0) -> let env' = List.map - (fun (name, (ty, v)) as binding -> + (fun (name, (_ty, _v)) as binding -> if List.exists (fun (name', _) -> name = name') p_opt_decls then Env.opt_binding_some binding else binding) diff --git a/matita/components/content_pres/termContentPres.ml b/matita/components/content_pres/termContentPres.ml index 49d9241b9..84f4a2f72 100644 --- a/matita/components/content_pres/termContentPres.ml +++ b/matita/components/content_pres/termContentPres.ml @@ -44,7 +44,7 @@ let resolve_binder = function let add_level_info prec t = Ast.AttributedTerm (`Level prec, t) -let rec top_pos t = add_level_info ~-1 t +let top_pos t = add_level_info ~-1 t let rec remove_level_info = function @@ -347,7 +347,7 @@ let instantiate21 idrefs env l1 = Ast.AttributedTerm (attr, subst_singleton pos env t) | t -> NotationUtil.group (subst pos env t) and subst pos env = function - | Ast.AttributedTerm (attr, t) -> + | Ast.AttributedTerm (_attr, t) -> (* prerr_endline ("loosing attribute " ^ NotationPp.pp_attribute attr); *) subst pos env t | Ast.Variable var -> @@ -378,7 +378,7 @@ let instantiate21 idrefs env l1 = | Ast.Literal l as t -> let t = add_idrefs idrefs t in (match l with - | `Keyword k -> [ add_keyword_attrs t ] + | `Keyword _k -> [ add_keyword_attrs t ] | _ -> [ t ]) | Ast.Layout l -> [ Ast.Layout (subst_layout pos env l) ] | t -> [ NotationUtil.visit_ast (subst_singleton pos env) t ] @@ -587,7 +587,7 @@ let instantiate_level2 status env term = in let rec aux env term = match term with - | Ast.AttributedTerm (a, term) -> (*Ast.AttributedTerm (a, *)aux env term + | Ast.AttributedTerm (_a, term) -> (*Ast.AttributedTerm (a, *)aux env term | Ast.Appl terms -> Ast.Appl (List.map (aux env) terms) | Ast.Binder (binder, var, body) -> Ast.Binder (binder, aux_capture_var env var, aux env body) @@ -632,8 +632,8 @@ let instantiate_level2 status env term = Ast.Pattern (head, hrefs, vars) -> Ast.Pattern (head, hrefs, List.map (aux_capture_var env) vars) | Ast.Wildcard -> Ast.Wildcard - and aux_definition env (params, var, term, i) = - (List.map (aux_capture_var env) params, aux_capture_var env var, aux env term, i) + (*and aux_definition env (params, var, term, i) = + (List.map (aux_capture_var env) params, aux_capture_var env var, aux env term, i)*) and aux_substs env substs = List.map (fun (name, term) -> (name, aux env term)) substs and aux_meta_substs env meta_substs = List.map (aux_opt env) meta_substs @@ -646,7 +646,7 @@ let instantiate_level2 status env term = | Ast.TermVar (name,(Ast.Level l|Ast.Self l)) -> Ast.AttributedTerm (`Level l,Env.lookup_term env name) | Ast.FreshVar name -> Ast.Ident (lookup_fresh_name name, None) - | Ast.Ascription (term, name) -> assert false + | Ast.Ascription (_term, _name) -> assert false and aux_magic env = function | Ast.Default (some_pattern, none_pattern) -> let some_pattern_names = NotationUtil.names_of_term some_pattern in @@ -714,7 +714,7 @@ let instantiate_level2 status env term = | _ -> assert false in instantiate_fold_right env) - | Ast.If (_, p_true, p_false) as t -> + | Ast.If (_, _p_true, _p_false) as t -> aux env (NotationUtil.find_branch (Ast.Magic t)) | Ast.Fail -> assert false | _ -> assert false diff --git a/matita/components/disambiguation/.depend b/matita/components/disambiguation/.depend index 735bea7f7..2f1e0bd9e 100644 --- a/matita/components/disambiguation/.depend +++ b/matita/components/disambiguation/.depend @@ -1,11 +1,24 @@ +disambiguate.cmo : \ + disambiguateTypes.cmi \ + disambiguate.cmi +disambiguate.cmx : \ + disambiguateTypes.cmx \ + disambiguate.cmi +disambiguate.cmi : \ + disambiguateTypes.cmi +disambiguateTypes.cmo : \ + disambiguateTypes.cmi +disambiguateTypes.cmx : \ + disambiguateTypes.cmi disambiguateTypes.cmi : -disambiguate.cmi : disambiguateTypes.cmi -multiPassDisambiguator.cmi : disambiguateTypes.cmi disambiguate.cmi -disambiguateTypes.cmo : disambiguateTypes.cmi -disambiguateTypes.cmx : disambiguateTypes.cmi -disambiguate.cmo : disambiguateTypes.cmi disambiguate.cmi -disambiguate.cmx : disambiguateTypes.cmx disambiguate.cmi -multiPassDisambiguator.cmo : disambiguateTypes.cmi disambiguate.cmi \ +multiPassDisambiguator.cmo : \ + disambiguateTypes.cmi \ + disambiguate.cmi \ multiPassDisambiguator.cmi -multiPassDisambiguator.cmx : disambiguateTypes.cmx disambiguate.cmx \ +multiPassDisambiguator.cmx : \ + disambiguateTypes.cmx \ + disambiguate.cmx \ multiPassDisambiguator.cmi +multiPassDisambiguator.cmi : \ + disambiguateTypes.cmi \ + disambiguate.cmi diff --git a/matita/components/disambiguation/.depend.opt b/matita/components/disambiguation/.depend.opt index 735bea7f7..867ae4666 100644 --- a/matita/components/disambiguation/.depend.opt +++ b/matita/components/disambiguation/.depend.opt @@ -1,11 +1,15 @@ +disambiguate.cmx : \ + disambiguateTypes.cmx \ + disambiguate.cmi +disambiguate.cmi : \ + disambiguateTypes.cmi +disambiguateTypes.cmx : \ + disambiguateTypes.cmi disambiguateTypes.cmi : -disambiguate.cmi : disambiguateTypes.cmi -multiPassDisambiguator.cmi : disambiguateTypes.cmi disambiguate.cmi -disambiguateTypes.cmo : disambiguateTypes.cmi -disambiguateTypes.cmx : disambiguateTypes.cmi -disambiguate.cmo : disambiguateTypes.cmi disambiguate.cmi -disambiguate.cmx : disambiguateTypes.cmx disambiguate.cmi -multiPassDisambiguator.cmo : disambiguateTypes.cmi disambiguate.cmi \ - multiPassDisambiguator.cmi -multiPassDisambiguator.cmx : disambiguateTypes.cmx disambiguate.cmx \ +multiPassDisambiguator.cmx : \ + disambiguateTypes.cmx \ + disambiguate.cmx \ multiPassDisambiguator.cmi +multiPassDisambiguator.cmi : \ + disambiguateTypes.cmi \ + disambiguate.cmi diff --git a/matita/components/disambiguation/disambiguate.ml b/matita/components/disambiguation/disambiguate.ml index f27c723b0..8bd266370 100644 --- a/matita/components/disambiguation/disambiguate.ml +++ b/matita/components/disambiguation/disambiguate.ml @@ -51,8 +51,8 @@ type 'a disambiguator_input = string * int * 'a type domain = domain_tree list and domain_tree = Node of Stdpp.location list * domain_item * domain -let mono_uris_callback ~selection_mode ?ok - ?(enable_button_for_non_vars = true) ~title ~msg ~id = +let mono_uris_callback ~selection_mode:_ ?ok:(_) + ?enable_button_for_non_vars:(_ = true) ~title:(_) ~msg:(_) ~id:(_) = if Helm_registry.get_opt_default Helm_registry.get_bool ~default:true "matita.auto_disambiguation" then @@ -69,7 +69,7 @@ let set_choose_interp_callback f = _choose_interp_callback := f let interactive_user_uri_choice = !_choose_uris_callback let interactive_interpretation_choice interp = !_choose_interp_callback interp -let input_or_locate_uri ~(title:string) ?id () = None +let input_or_locate_uri ~title:(_:string) ?id:(_) () = None (* Zack: I try to avoid using this callback. I therefore assume that * the presence of an identifier that can't be resolved via "locate" * query is a syntax error *) @@ -139,7 +139,7 @@ let resolve ~env ~mk_choice (item: domain_item) arg = match snd (mk_choice (Environment.find item env)), arg with `Num_interp f, `Num_arg n -> f n | `Sym_interp f, `Args l -> f l - | `Sym_interp f, `Num_arg n -> (* Implicit number! *) f [] + | `Sym_interp f, `Num_arg _n -> (* Implicit number! *) f [] | _,_ -> assert false with Not_found -> failwith ("Domain item not found: " ^ @@ -149,7 +149,7 @@ let resolve ~env ~mk_choice (item: domain_item) arg = let find_in_context name context = let rec aux acc = function | [] -> raise Not_found - | Some hd :: tl when hd = name -> acc + | Some hd :: _tl when hd = name -> acc | _ :: tl -> aux (acc + 1) tl in aux 1 context @@ -231,7 +231,7 @@ let rec domain_of_term ?(loc = HExtlib.dummy_floc) ~context = function | _ :: tl -> get_first_constructor tl in let do_branch = function - Ast.Pattern (head, _, args), term -> + Ast.Pattern (_head, _, args), term -> let (term_context, args_domain) = List.fold_left (fun (cont, dom) (name, typ) -> @@ -284,8 +284,8 @@ let rec domain_of_term ?(loc = HExtlib.dummy_floc) ~context = function | Ast.NRef _ -> [] | Ast.NCic _ -> [] | Ast.Implicit _ -> [] - | Ast.Num (num, i) -> [ Node ([loc], Num i, []) ] - | Ast.Meta (index, local_context) -> + | Ast.Num (_num, i) -> [ Node ([loc], Num i, []) ] + | Ast.Meta (_index, local_context) -> List.fold_left (fun dom term -> dom @ domain_of_term_option ~loc ~context term) [] local_context @@ -352,7 +352,7 @@ let domain_of_obj ~context ast = (fun (context,res) (name,ty,_,_) -> Some name::context, res @ domain_of_term context ty ) (context_w_types,[]) fields) - | Ast.LetRec (kind, defs, _) -> + | Ast.LetRec (_kind, defs, _) -> let add_defs context = List.fold_left (fun acc (_, (var, _), _, _) -> string_of_name var :: acc @@ -393,7 +393,7 @@ let domain_diff dom1 dom2 = (match elt with Symbol (symb',_) when symb = symb' -> true | _ -> false) - | Num i -> + | Num _i -> (match elt with Num _ -> true | _ -> false) @@ -449,7 +449,7 @@ let disambiguate_thing let aliases, todo_dom = let rec aux (aliases,acc) = function | [] -> aliases, acc - | (Node (locs, item,extra) as node) :: tl -> + | Node (locs, item,extra) :: tl -> let choices = lookup_choices item in if List.length choices = 0 then (* Quick failure *) diff --git a/matita/components/disambiguation/disambiguateTypes.ml b/matita/components/disambiguation/disambiguateTypes.ml index 50d1d59da..19c16d130 100644 --- a/matita/components/disambiguation/disambiguateTypes.ml +++ b/matita/components/disambiguation/disambiguateTypes.ml @@ -53,10 +53,10 @@ struct let find k env = match k with - Symbol (sym,n) -> + Symbol (sym,_n) -> (try find k env with Not_found -> find (Symbol (sym,0)) env) - | Num n -> + | Num _n -> (try find k env with Not_found -> find (Num 0) env) | _ -> find k env diff --git a/matita/components/disambiguation/multiPassDisambiguator.ml b/matita/components/disambiguation/multiPassDisambiguator.ml index b1cf9aed0..1ee9df14e 100644 --- a/matita/components/disambiguation/multiPassDisambiguator.ml +++ b/matita/components/disambiguation/multiPassDisambiguator.ml @@ -25,8 +25,6 @@ (* $Id$ *) -open Printf - let debug = ref false;; let debug_print s = if !debug then prerr_endline (Lazy.force s) else ();; @@ -119,7 +117,7 @@ let disambiguate_thing ~description_of_alias ~passes ~aliases ~universe ~f thing let try_pass (fresh_instances, (_, aliases, universe), use_coercions) = f ~fresh_instances ~aliases ~universe ~use_coercions thing in - let set_aliases (instances,(use_mono_aliases,_,_),_) (_, user_asked as res) = + let set_aliases (_instances,(use_mono_aliases,_,_),_) (_, user_asked as res) = if use_mono_aliases then drop_aliases ~minimize_instances:true ~description_of_alias res (* one shot aliases *) else if user_asked then diff --git a/matita/components/extlib/.depend b/matita/components/extlib/.depend index e7b0a3bc7..c4c6d7e8a 100644 --- a/matita/components/extlib/.depend +++ b/matita/components/extlib/.depend @@ -1,27 +1,51 @@ +componentsConf.cmo : \ + componentsConf.cmi +componentsConf.cmx : \ + componentsConf.cmi componentsConf.cmi : +discrimination_tree.cmo : \ + trie.cmi \ + hExtlib.cmi \ + discrimination_tree.cmi +discrimination_tree.cmx : \ + trie.cmx \ + hExtlib.cmx \ + discrimination_tree.cmi +discrimination_tree.cmi : +graphvizPp.cmo : \ + graphvizPp.cmi +graphvizPp.cmx : \ + graphvizPp.cmi +graphvizPp.cmi : +hExtlib.cmo : \ + hExtlib.cmi +hExtlib.cmx : \ + hExtlib.cmi hExtlib.cmi : +hLog.cmo : \ + hLog.cmi +hLog.cmx : \ + hLog.cmi +hLog.cmi : +hMarshal.cmo : \ + hExtlib.cmi \ + hMarshal.cmi +hMarshal.cmx : \ + hExtlib.cmx \ + hMarshal.cmi hMarshal.cmi : +hTopoSort.cmo : \ + hTopoSort.cmi +hTopoSort.cmx : \ + hTopoSort.cmi +hTopoSort.cmi : +patternMatcher.cmo : \ + patternMatcher.cmi +patternMatcher.cmx : \ + patternMatcher.cmi patternMatcher.cmi : -hLog.cmi : +trie.cmo : \ + trie.cmi +trie.cmx : \ + trie.cmi trie.cmi : -discrimination_tree.cmi : -hTopoSort.cmi : -graphvizPp.cmi : -componentsConf.cmo : componentsConf.cmi -componentsConf.cmx : componentsConf.cmi -hExtlib.cmo : hExtlib.cmi -hExtlib.cmx : hExtlib.cmi -hMarshal.cmo : hExtlib.cmi hMarshal.cmi -hMarshal.cmx : hExtlib.cmx hMarshal.cmi -patternMatcher.cmo : patternMatcher.cmi -patternMatcher.cmx : patternMatcher.cmi -hLog.cmo : hLog.cmi -hLog.cmx : hLog.cmi -trie.cmo : trie.cmi -trie.cmx : trie.cmi -discrimination_tree.cmo : trie.cmi hExtlib.cmi discrimination_tree.cmi -discrimination_tree.cmx : trie.cmx hExtlib.cmx discrimination_tree.cmi -hTopoSort.cmo : hTopoSort.cmi -hTopoSort.cmx : hTopoSort.cmi -graphvizPp.cmo : graphvizPp.cmi -graphvizPp.cmx : graphvizPp.cmi diff --git a/matita/components/extlib/.depend.opt b/matita/components/extlib/.depend.opt index e7b0a3bc7..72b64d1cf 100644 --- a/matita/components/extlib/.depend.opt +++ b/matita/components/extlib/.depend.opt @@ -1,27 +1,30 @@ +componentsConf.cmx : \ + componentsConf.cmi componentsConf.cmi : +discrimination_tree.cmx : \ + trie.cmx \ + hExtlib.cmx \ + discrimination_tree.cmi +discrimination_tree.cmi : +graphvizPp.cmx : \ + graphvizPp.cmi +graphvizPp.cmi : +hExtlib.cmx : \ + hExtlib.cmi hExtlib.cmi : +hLog.cmx : \ + hLog.cmi +hLog.cmi : +hMarshal.cmx : \ + hExtlib.cmx \ + hMarshal.cmi hMarshal.cmi : +hTopoSort.cmx : \ + hTopoSort.cmi +hTopoSort.cmi : +patternMatcher.cmx : \ + patternMatcher.cmi patternMatcher.cmi : -hLog.cmi : +trie.cmx : \ + trie.cmi trie.cmi : -discrimination_tree.cmi : -hTopoSort.cmi : -graphvizPp.cmi : -componentsConf.cmo : componentsConf.cmi -componentsConf.cmx : componentsConf.cmi -hExtlib.cmo : hExtlib.cmi -hExtlib.cmx : hExtlib.cmi -hMarshal.cmo : hExtlib.cmi hMarshal.cmi -hMarshal.cmx : hExtlib.cmx hMarshal.cmi -patternMatcher.cmo : patternMatcher.cmi -patternMatcher.cmx : patternMatcher.cmi -hLog.cmo : hLog.cmi -hLog.cmx : hLog.cmi -trie.cmo : trie.cmi -trie.cmx : trie.cmi -discrimination_tree.cmo : trie.cmi hExtlib.cmi discrimination_tree.cmi -discrimination_tree.cmx : trie.cmx hExtlib.cmx discrimination_tree.cmi -hTopoSort.cmo : hTopoSort.cmi -hTopoSort.cmx : hTopoSort.cmi -graphvizPp.cmo : graphvizPp.cmi -graphvizPp.cmx : graphvizPp.cmi diff --git a/matita/components/extlib/discrimination_tree.ml b/matita/components/extlib/discrimination_tree.ml index cdc498e9c..1a8147f7d 100644 --- a/matita/components/extlib/discrimination_tree.ml +++ b/matita/components/extlib/discrimination_tree.ml @@ -157,8 +157,8 @@ and type data = A.elt and type dataset = A.t = (* the equivalent of skip, but on the index, thus the list of trees that are rooted just after the term represented by the tree root are returned (we are skipping the root) *) - let skip_root = function DiscriminationTree.Node (value, map) -> - let rec get n = function DiscriminationTree.Node (v, m) as tree -> + let skip_root = function DiscriminationTree.Node (_value, map) -> + let rec get n = function DiscriminationTree.Node (_v, m) as tree -> if n = 0 then [tree] else PSMap.fold (fun k v res -> (get (n-1 + arity_of k) v) @ res) m [] in @@ -171,7 +171,7 @@ and type data = A.elt and type dataset = A.t = match tree, path with | DiscriminationTree.Node (Some s, _), [] -> s | DiscriminationTree.Node (None, _), [] -> A.empty - | DiscriminationTree.Node (_, map), Variable::path when unif -> + | DiscriminationTree.Node (_, _map), Variable::path when unif -> List.fold_left A.union A.empty (List.map (retrieve path) (skip_root tree)) | DiscriminationTree.Node (_, map), node::path -> @@ -239,7 +239,7 @@ and type data = A.elt and type dataset = A.t = (List.map (fun s, w -> HExtlib.filter_map (fun x -> - try Some (x, w + snd (List.find (fun (s,w) -> A.mem x s) l2)) + try Some (x, w + snd (List.find (fun (s,_w) -> A.mem x s) l2)) with Not_found -> None) (A.elements s)) l1) @@ -254,7 +254,7 @@ and type data = A.elt and type dataset = A.t = match tree, path with | DiscriminationTree.Node (Some s, _), [] -> S.singleton (s, n) | DiscriminationTree.Node (None, _), [] -> S.empty - | DiscriminationTree.Node (_, map), Variable::path when unif -> + | DiscriminationTree.Node (_, _map), Variable::path when unif -> List.fold_left S.union S.empty (List.map (retrieve n path) (skip_root tree)) | DiscriminationTree.Node (_, map), node::path -> diff --git a/matita/components/extlib/hExtlib.ml b/matita/components/extlib/hExtlib.ml index 8871a35df..b7b664ff2 100644 --- a/matita/components/extlib/hExtlib.ml +++ b/matita/components/extlib/hExtlib.ml @@ -302,7 +302,7 @@ let list_iter_sep ~sep f = in aux -let rec list_findopt f l = +let list_findopt f l = let rec aux k = function | [] -> None | x::tl -> @@ -316,13 +316,13 @@ let split_nth n l = let rec aux acc n l = match n, l with | 0, _ -> List.rev acc, l - | n, [] -> raise (Failure "HExtlib.split_nth") + | _, [] -> raise (Failure "HExtlib.split_nth") | n, hd :: tl -> aux (hd :: acc) (n - 1) tl in aux [] n l let list_last l = let l = List.rev l in - try List.hd l with exn -> raise (Failure "HExtlib.list_last") + try List.hd l with _ -> raise (Failure "HExtlib.list_last") ;; let rec list_assoc_all a = function @@ -460,12 +460,12 @@ let input_file fname = let input_all ic = let size = 10240 in let buf = Buffer.create size in - let s = String.create size in + let s = Bytes.create size in (try while true do let bytes = input ic s 0 size in if bytes = 0 then raise End_of_file - else Buffer.add_substring buf s 0 bytes + else Buffer.add_subbytes buf s 0 bytes done with End_of_file -> ()); Buffer.contents buf diff --git a/matita/components/extlib/hLog.ml b/matita/components/extlib/hLog.ml index 4ad2b5ba4..74cacb408 100644 --- a/matita/components/extlib/hLog.ml +++ b/matita/components/extlib/hLog.ml @@ -25,8 +25,6 @@ (* $Id$ *) -open Printf - type log_tag = [ `Debug | `Error | `Message | `Warning ] type log_callback = log_tag -> string -> unit diff --git a/matita/components/extlib/hMarshal.ml b/matita/components/extlib/hMarshal.ml index cb4976e7d..c61977894 100644 --- a/matita/components/extlib/hMarshal.ml +++ b/matita/components/extlib/hMarshal.ml @@ -46,8 +46,8 @@ let save ~fmt ~version ~fname data = HExtlib.chmod 0o664 fname let expect ic fname s = - let len = String.length s in - let buf = String.create len in + let len = Bytes.length s in + let buf = Bytes.create len in really_input ic buf 0 len; if buf <> s then raise (Corrupt_file fname) @@ -61,8 +61,8 @@ let load ~fmt ~version ~fname = if fmt' <> Hashtbl.hash fmt then raise (Format_mismatch fname); let version' = input_binary_int ic in (* field 2 *) if version' <> version then raise (Version_mismatch fname); - expect ic fname fmt; (* field 3 *) - expect ic fname (string_of_int version); (* field 4 *) + expect ic fname (Bytes.of_string fmt); (* field 3 *) + expect ic fname (Bytes.of_string (string_of_int version)); (* field 4 *) let checksum' = input_binary_int ic in (* field 5 *) let marshalled' = HExtlib.input_all ic in (* field 6 *) if checksum' <> Hashtbl.hash marshalled' then diff --git a/matita/components/extlib/patternMatcher.ml b/matita/components/extlib/patternMatcher.ml index f57c3ea6c..fa8c6061e 100644 --- a/matita/components/extlib/patternMatcher.ml +++ b/matita/components/extlib/patternMatcher.ml @@ -25,8 +25,6 @@ (* $Id$ *) -open Printf - type pattern_kind = Variable | Constructor type tag_t = int @@ -121,7 +119,7 @@ struct | _ -> kfail () (*CSC: was assert false, but it did happen*)) let success_closure ksucc = - (fun matched_terms constructors terms -> + (fun matched_terms constructors _terms -> (* prerr_endline "success_closure"; *) ksucc matched_terms constructors) diff --git a/matita/components/extlib/trie.ml b/matita/components/extlib/trie.ml index f60b2d45c..e9e7e3f7b 100644 --- a/matita/components/extlib/trie.ml +++ b/matita/components/extlib/trie.ml @@ -113,7 +113,7 @@ module Make (M : Map.S) = struct in traverse [] t - let rec fold f t acc = + let fold f t acc = let rec traverse revp t acc = match t with | Node (None,m) -> M.fold (fun x -> traverse (x::revp)) m acc diff --git a/matita/components/getter/.depend b/matita/components/getter/.depend index 59c0b896e..aa9063835 100644 --- a/matita/components/getter/.depend +++ b/matita/components/getter/.depend @@ -1,38 +1,89 @@ -http_getter_wget.cmi : +http_getter.cmo : \ + http_getter_wget.cmi \ + http_getter_types.cmo \ + http_getter_storage.cmi \ + http_getter_misc.cmi \ + http_getter_logger.cmi \ + http_getter_env.cmi \ + http_getter_const.cmi \ + http_getter_common.cmi \ + http_getter.cmi +http_getter.cmx : \ + http_getter_wget.cmx \ + http_getter_types.cmx \ + http_getter_storage.cmx \ + http_getter_misc.cmx \ + http_getter_logger.cmx \ + http_getter_env.cmx \ + http_getter_const.cmx \ + http_getter_common.cmx \ + http_getter.cmi +http_getter.cmi : \ + http_getter_types.cmo +http_getter_common.cmo : \ + http_getter_types.cmo \ + http_getter_misc.cmi \ + http_getter_logger.cmi \ + http_getter_env.cmi \ + http_getter_common.cmi +http_getter_common.cmx : \ + http_getter_types.cmx \ + http_getter_misc.cmx \ + http_getter_logger.cmx \ + http_getter_env.cmx \ + http_getter_common.cmi +http_getter_common.cmi : \ + http_getter_types.cmo +http_getter_const.cmo : \ + http_getter_const.cmi +http_getter_const.cmx : \ + http_getter_const.cmi +http_getter_const.cmi : +http_getter_env.cmo : \ + http_getter_types.cmo \ + http_getter_misc.cmi \ + http_getter_logger.cmi \ + http_getter_const.cmi \ + http_getter_env.cmi +http_getter_env.cmx : \ + http_getter_types.cmx \ + http_getter_misc.cmx \ + http_getter_logger.cmx \ + http_getter_const.cmx \ + http_getter_env.cmi +http_getter_env.cmi : \ + http_getter_types.cmo +http_getter_logger.cmo : \ + http_getter_logger.cmi +http_getter_logger.cmx : \ + http_getter_logger.cmi http_getter_logger.cmi : +http_getter_misc.cmo : \ + http_getter_logger.cmi \ + http_getter_misc.cmi +http_getter_misc.cmx : \ + http_getter_logger.cmx \ + http_getter_misc.cmi http_getter_misc.cmi : -http_getter_const.cmi : -http_getter_env.cmi : http_getter_types.cmo +http_getter_storage.cmo : \ + http_getter_wget.cmi \ + http_getter_types.cmo \ + http_getter_misc.cmi \ + http_getter_env.cmi \ + http_getter_storage.cmi +http_getter_storage.cmx : \ + http_getter_wget.cmx \ + http_getter_types.cmx \ + http_getter_misc.cmx \ + http_getter_env.cmx \ + http_getter_storage.cmi http_getter_storage.cmi : -http_getter_common.cmi : http_getter_types.cmo -http_getter.cmi : http_getter_types.cmo http_getter_types.cmo : http_getter_types.cmx : -http_getter_wget.cmo : http_getter_types.cmo http_getter_wget.cmi -http_getter_wget.cmx : http_getter_types.cmx http_getter_wget.cmi -http_getter_logger.cmo : http_getter_logger.cmi -http_getter_logger.cmx : http_getter_logger.cmi -http_getter_misc.cmo : http_getter_logger.cmi http_getter_misc.cmi -http_getter_misc.cmx : http_getter_logger.cmx http_getter_misc.cmi -http_getter_const.cmo : http_getter_const.cmi -http_getter_const.cmx : http_getter_const.cmi -http_getter_env.cmo : http_getter_types.cmo http_getter_misc.cmi \ - http_getter_logger.cmi http_getter_const.cmi http_getter_env.cmi -http_getter_env.cmx : http_getter_types.cmx http_getter_misc.cmx \ - http_getter_logger.cmx http_getter_const.cmx http_getter_env.cmi -http_getter_storage.cmo : http_getter_wget.cmi http_getter_types.cmo \ - http_getter_misc.cmi http_getter_env.cmi http_getter_storage.cmi -http_getter_storage.cmx : http_getter_wget.cmx http_getter_types.cmx \ - http_getter_misc.cmx http_getter_env.cmx http_getter_storage.cmi -http_getter_common.cmo : http_getter_types.cmo http_getter_misc.cmi \ - http_getter_logger.cmi http_getter_env.cmi http_getter_common.cmi -http_getter_common.cmx : http_getter_types.cmx http_getter_misc.cmx \ - http_getter_logger.cmx http_getter_env.cmx http_getter_common.cmi -http_getter.cmo : http_getter_wget.cmi http_getter_types.cmo \ - http_getter_storage.cmi http_getter_misc.cmi http_getter_logger.cmi \ - http_getter_env.cmi http_getter_const.cmi http_getter_common.cmi \ - http_getter.cmi -http_getter.cmx : http_getter_wget.cmx http_getter_types.cmx \ - http_getter_storage.cmx http_getter_misc.cmx http_getter_logger.cmx \ - http_getter_env.cmx http_getter_const.cmx http_getter_common.cmx \ - http_getter.cmi +http_getter_wget.cmo : \ + http_getter_types.cmo \ + http_getter_wget.cmi +http_getter_wget.cmx : \ + http_getter_types.cmx \ + http_getter_wget.cmi +http_getter_wget.cmi : diff --git a/matita/components/getter/.depend.opt b/matita/components/getter/.depend.opt index 7c2b60586..cb0f289ac 100644 --- a/matita/components/getter/.depend.opt +++ b/matita/components/getter/.depend.opt @@ -1,38 +1,50 @@ -http_getter_wget.cmi : +http_getter.cmx : \ + http_getter_wget.cmx \ + http_getter_types.cmx \ + http_getter_storage.cmx \ + http_getter_misc.cmx \ + http_getter_logger.cmx \ + http_getter_env.cmx \ + http_getter_const.cmx \ + http_getter_common.cmx \ + http_getter.cmi +http_getter.cmi : \ + http_getter_types.cmx +http_getter_common.cmx : \ + http_getter_types.cmx \ + http_getter_misc.cmx \ + http_getter_logger.cmx \ + http_getter_env.cmx \ + http_getter_common.cmi +http_getter_common.cmi : \ + http_getter_types.cmx +http_getter_const.cmx : \ + http_getter_const.cmi +http_getter_const.cmi : +http_getter_env.cmx : \ + http_getter_types.cmx \ + http_getter_misc.cmx \ + http_getter_logger.cmx \ + http_getter_const.cmx \ + http_getter_env.cmi +http_getter_env.cmi : \ + http_getter_types.cmx +http_getter_logger.cmx : \ + http_getter_logger.cmi http_getter_logger.cmi : +http_getter_misc.cmx : \ + http_getter_logger.cmx \ + http_getter_misc.cmi http_getter_misc.cmi : -http_getter_const.cmi : -http_getter_env.cmi : http_getter_types.cmx +http_getter_storage.cmx : \ + http_getter_wget.cmx \ + http_getter_types.cmx \ + http_getter_misc.cmx \ + http_getter_env.cmx \ + http_getter_storage.cmi http_getter_storage.cmi : -http_getter_common.cmi : http_getter_types.cmx -http_getter.cmi : http_getter_types.cmx -http_getter_types.cmo : http_getter_types.cmx : -http_getter_wget.cmo : http_getter_types.cmx http_getter_wget.cmi -http_getter_wget.cmx : http_getter_types.cmx http_getter_wget.cmi -http_getter_logger.cmo : http_getter_logger.cmi -http_getter_logger.cmx : http_getter_logger.cmi -http_getter_misc.cmo : http_getter_logger.cmi http_getter_misc.cmi -http_getter_misc.cmx : http_getter_logger.cmx http_getter_misc.cmi -http_getter_const.cmo : http_getter_const.cmi -http_getter_const.cmx : http_getter_const.cmi -http_getter_env.cmo : http_getter_types.cmx http_getter_misc.cmi \ - http_getter_logger.cmi http_getter_const.cmi http_getter_env.cmi -http_getter_env.cmx : http_getter_types.cmx http_getter_misc.cmx \ - http_getter_logger.cmx http_getter_const.cmx http_getter_env.cmi -http_getter_storage.cmo : http_getter_wget.cmi http_getter_types.cmx \ - http_getter_misc.cmi http_getter_env.cmi http_getter_storage.cmi -http_getter_storage.cmx : http_getter_wget.cmx http_getter_types.cmx \ - http_getter_misc.cmx http_getter_env.cmx http_getter_storage.cmi -http_getter_common.cmo : http_getter_types.cmx http_getter_misc.cmi \ - http_getter_logger.cmi http_getter_env.cmi http_getter_common.cmi -http_getter_common.cmx : http_getter_types.cmx http_getter_misc.cmx \ - http_getter_logger.cmx http_getter_env.cmx http_getter_common.cmi -http_getter.cmo : http_getter_wget.cmi http_getter_types.cmx \ - http_getter_storage.cmi http_getter_misc.cmi http_getter_logger.cmi \ - http_getter_env.cmi http_getter_const.cmi http_getter_common.cmi \ - http_getter.cmi -http_getter.cmx : http_getter_wget.cmx http_getter_types.cmx \ - http_getter_storage.cmx http_getter_misc.cmx http_getter_logger.cmx \ - http_getter_env.cmx http_getter_const.cmx http_getter_common.cmx \ - http_getter.cmi +http_getter_wget.cmx : \ + http_getter_types.cmx \ + http_getter_wget.cmi +http_getter_wget.cmi : diff --git a/matita/components/getter/http_getter.ml b/matita/components/getter/http_getter.ml index 4e431ee81..4de03eab2 100644 --- a/matita/components/getter/http_getter.ml +++ b/matita/components/getter/http_getter.ml @@ -89,18 +89,18 @@ let getter_url () = Helm_registry.get "getter.url" (* Remote interface: getter methods implemented using a remote getter *) (* *) -let getxml_remote uri = not_implemented "getxml_remote" -let getxslt_remote uri = not_implemented "getxslt_remote" -let getdtd_remote uri = not_implemented "getdtd_remote" +let getxml_remote _uri = not_implemented "getxml_remote" +let getxslt_remote _uri = not_implemented "getxslt_remote" +let getdtd_remote _uri = not_implemented "getdtd_remote" let clean_cache_remote () = not_implemented "clean_cache_remote" let list_servers_remote () = not_implemented "list_servers_remote" -let add_server_remote ~logger ~position name = +let add_server_remote ~logger:_ ~position:_ _name = not_implemented "add_server_remote" -let remove_server_remote ~logger position = +let remove_server_remote ~logger:_ _position = not_implemented "remove_server_remote" let getalluris_remote () = not_implemented "getalluris_remote" -let ls_remote lsuri = not_implemented "ls_remote" -let exists_remote uri = not_implemented "exists_remote" +let ls_remote _lsuri = not_implemented "ls_remote" +let exists_remote _uri = not_implemented "exists_remote" (* *) let resolve_remote ~writable uri = @@ -132,7 +132,7 @@ let resolve_remote ~writable uri = | Exception e -> raise e | Resolved url -> url -let deref_index_theory ~local uri = +let deref_index_theory ~local:_ uri = (* if Http_getter_storage.exists ~local (uri ^ xml_suffix) then uri *) if is_theory_uri uri && Filename.basename uri = "index.theory" then strip_trailing_slash (Filename.dirname uri) ^ theory_suffix @@ -229,7 +229,7 @@ let store_obj tbl o = | s when Pcre.pmatch ~rex:body_ann_RE s -> (true, No, Ann, No) | s when Pcre.pmatch ~rex:proof_tree_RE s -> (false, No, No, Yes) | s when Pcre.pmatch ~rex:proof_tree_ann_RE s -> (true, No, No, Ann) - | s -> no_flags + | _s -> no_flags in Hashtbl.replace tbl basepart (oldflags ++ newflags) end diff --git a/matita/components/getter/http_getter_common.ml b/matita/components/getter/http_getter_common.ml index ddce33f5d..4c817d8f0 100644 --- a/matita/components/getter/http_getter_common.ml +++ b/matita/components/getter/http_getter_common.ml @@ -60,7 +60,7 @@ let rec uri_of_string = function Cic_uri (Theory (Pcre.replace ~pat:"^theory:" uri)) | uri -> raise (Invalid_URI uri) -let patch_xsl ?(via_http = true) () = +let patch_xsl ?via_http:(_ = true) () = fun line -> let mk_patch_fun tag line = Pcre.replace @@ -125,7 +125,7 @@ let return_file | (None, None) -> [] in Http_daemon.send_basic_headers ~code:(`Code 200) outchan; - Http_daemon.send_headers headers outchan; + Http_daemon.send_headers ~headers outchan; Http_daemon.send_CRLF outchan end; match gunzip, patch_fun with diff --git a/matita/components/getter/http_getter_logger.ml b/matita/components/getter/http_getter_logger.ml index 1d774c102..91e7c8a93 100644 --- a/matita/components/getter/http_getter_logger.ml +++ b/matita/components/getter/http_getter_logger.ml @@ -55,7 +55,7 @@ let log ?(level = 1) s = let msg = "[HTTP-Getter] " ^ s in match (!logfile, !logchan) with | None, _ -> prerr_endline msg - | Some fname, Some oc -> + | Some _fname, Some oc -> output_string oc msg; output_string oc "\n"; flush oc diff --git a/matita/components/getter/http_getter_misc.ml b/matita/components/getter/http_getter_misc.ml index f7dffd066..38a943bc5 100644 --- a/matita/components/getter/http_getter_misc.ml +++ b/matita/components/getter/http_getter_misc.ml @@ -33,7 +33,7 @@ open Printf let file_scheme_prefix = "file://" let trailing_dot_gz_RE = Pcre.regexp "\\.gz$" (* for g{,un}zip *) -let url_RE = Pcre.regexp "^([\\w.-]+)(:(\\d+))?(/.*)?$" +(*let url_RE = Pcre.regexp "^([\\w.-]+)(:(\\d+))?(/.*)?$"*) let http_scheme_RE = Pcre.regexp ~flags:[`CASELESS] "^http://" let file_scheme_RE = Pcre.regexp ~flags:[`CASELESS] ("^" ^ file_scheme_prefix) let dir_sep_RE = Pcre.regexp "/" @@ -47,7 +47,7 @@ let local_url = with Not_found -> None let bufsiz = 16384 (* for file system I/O *) -let tcp_bufsiz = 4096 (* for TCP I/O *) +(*let tcp_bufsiz = 4096 (* for TCP I/O *)*) let fold_file f init fname = let ic = open_in fname in @@ -67,12 +67,12 @@ let iter_buf_size = 10240 let iter_file_data f fname = let ic = open_in fname in - let buf = String.create iter_buf_size in + let buf = Bytes.create iter_buf_size in try while true do let bytes = input ic buf 0 iter_buf_size in if bytes = 0 then raise End_of_file; - f (String.sub buf 0 bytes) + f (Bytes.to_string (Bytes.sub buf 0 bytes)) done with End_of_file -> close_in ic @@ -93,7 +93,7 @@ let cp src dst = let ic = open_in src in try let oc = open_out dst in - let buf = String.create bufsiz in + let buf = Bytes.create bufsiz in (try while true do let bytes = input ic buf 0 bufsiz in @@ -137,7 +137,7 @@ let wget ?output url = (let oc = open_out (match output with Some f -> f | None -> Filename.basename url) in - Http_user_agent.get_iter (fun data -> output_string oc data) url; + Http_user_agent.get_iter (fun data -> output_bytes oc data) url; close_out oc) | scheme -> (* unsupported scheme *) failwith ("Http_getter_misc.wget: unsupported scheme: " ^ scheme) @@ -147,7 +147,7 @@ let gzip ?(keep = false) ?output fname = Http_getter_logger.log ~level:3 (sprintf "gzipping %s (keep: %b, output: %s)" fname keep output); let (ic, oc) = (open_in fname, Gzip.open_out output) in - let buf = String.create bufsiz in + let buf = Bytes.create bufsiz in (try while true do let bytes = input ic buf 0 bufsiz in @@ -179,7 +179,7 @@ let gunzip ?(keep = false) ?output fname = try let ic = Gzip.open_in_chan zic in let oc = open_out output in - let buf = String.create bufsiz in + let buf = Bytes.create bufsiz in (try while true do let bytes = Gzip.input ic buf 0 bufsiz in @@ -240,11 +240,11 @@ let http_get url = let fname = Pcre.replace ~rex:file_scheme_RE url in try let size = (Unix.stat fname).Unix.st_size in - let buf = String.create size in + let buf = Bytes.create size in let ic = open_in fname in really_input ic buf 0 size ; close_in ic; - Some buf + Some (Bytes.to_string buf) with Unix.Unix_error (Unix.ENOENT, "stat", _) -> None end else (* other URL, pass it to Http_user_agent *) try @@ -298,11 +298,11 @@ let extension s = let temp_file_of_uri uri = let flat_string s s' c = - let cs = String.copy s in + let cs = Bytes.of_string s in for i = 0 to (String.length s) - 1 do if String.contains s' s.[i] then cs.[i] <- c done; - cs + Bytes.to_string cs in let user = try Unix.getlogin () with _ -> "" in Filename.open_temp_file (user ^ flat_string uri ".-=:;!?/&" '_') "" diff --git a/matita/components/getter/http_getter_storage.ml b/matita/components/getter/http_getter_storage.ml index c17435f6a..4ff552a4b 100644 --- a/matita/components/getter/http_getter_storage.ml +++ b/matita/components/getter/http_getter_storage.ml @@ -37,7 +37,7 @@ let index_fname = "INDEX" (******************************* HELPERS **************************************) -let trailing_slash_RE = Pcre.regexp "/$" +(*let trailing_slash_RE = Pcre.regexp "/$"*) let relative_RE_raw = "(^[^/]+(/[^/]+)*/?$)" let relative_RE = Pcre.regexp relative_RE_raw let file_scheme_RE_raw = "(^file://)" @@ -115,7 +115,7 @@ let keep_first l = let lookup uri = let matches = HExtlib.filter_map - (fun (rex, _, l, _ as entry) -> + (fun (rex, _, _l, _ as entry) -> try let got = Pcre.extract ~full_match:true ~rex uri in Some (entry, String.length got.(0)) diff --git a/matita/components/getter/http_getter_wget.ml b/matita/components/getter/http_getter_wget.ml index 571479d78..0f44f07d5 100644 --- a/matita/components/getter/http_getter_wget.ml +++ b/matita/components/getter/http_getter_wget.ml @@ -40,7 +40,7 @@ let get url = let get_and_save url dest_filename = let out_channel = open_out dest_filename in (try - Http_user_agent.get_iter (output_string out_channel) url; + Http_user_agent.get_iter (output_bytes out_channel) url; with exn -> close_out out_channel; Sys.remove dest_filename; @@ -49,11 +49,11 @@ let get_and_save url dest_filename = let get_and_save_to_tmp url = let flat_string s s' c = - let cs = String.copy s in + let cs = Bytes.of_string s in for i = 0 to (String.length s) - 1 do if String.contains s' s.[i] then cs.[i] <- c done; - cs + Bytes.to_string cs in let user = try Unix.getlogin () with _ -> "" in let tmp_file = diff --git a/matita/components/grafite/.depend b/matita/components/grafite/.depend index e70c83c77..bf8b5d3f5 100644 --- a/matita/components/grafite/.depend +++ b/matita/components/grafite/.depend @@ -1,5 +1,10 @@ -grafiteAstPp.cmi : grafiteAst.cmo grafiteAst.cmo : grafiteAst.cmx : -grafiteAstPp.cmo : grafiteAst.cmo grafiteAstPp.cmi -grafiteAstPp.cmx : grafiteAst.cmx grafiteAstPp.cmi +grafiteAstPp.cmo : \ + grafiteAst.cmo \ + grafiteAstPp.cmi +grafiteAstPp.cmx : \ + grafiteAst.cmx \ + grafiteAstPp.cmi +grafiteAstPp.cmi : \ + grafiteAst.cmo diff --git a/matita/components/grafite/.depend.opt b/matita/components/grafite/.depend.opt index 4a1ca42e9..be6de9f62 100644 --- a/matita/components/grafite/.depend.opt +++ b/matita/components/grafite/.depend.opt @@ -1,5 +1,6 @@ -grafiteAstPp.cmi : grafiteAst.cmx -grafiteAst.cmo : grafiteAst.cmx : -grafiteAstPp.cmo : grafiteAst.cmx grafiteAstPp.cmi -grafiteAstPp.cmx : grafiteAst.cmx grafiteAstPp.cmi +grafiteAstPp.cmx : \ + grafiteAst.cmx \ + grafiteAstPp.cmi +grafiteAstPp.cmi : \ + grafiteAst.cmx diff --git a/matita/components/grafite/grafiteAstPp.ml b/matita/components/grafite/grafiteAstPp.ml index 60c466068..42d7df864 100644 --- a/matita/components/grafite/grafiteAstPp.ml +++ b/matita/components/grafite/grafiteAstPp.ml @@ -71,7 +71,7 @@ let rec pp_ntactic status ~map_unicode_to_tex = let pp_tactic_pattern = pp_tactic_pattern ~map_unicode_to_tex in function | NApply (_,t) -> "@" ^ NotationPp.pp_term status t - | NSmartApply (_,t) -> "fixme" + | NSmartApply (_,_t) -> "fixme" | NAuto (_,(None,flgs)) -> "nautobatch" ^ String.concat " " (List.map (fun a,b -> a ^ "=" ^ b) flgs) @@ -79,26 +79,26 @@ let rec pp_ntactic status ~map_unicode_to_tex = "nautobatch" ^ " by " ^ (String.concat "," (List.map (NotationPp.pp_term status) l)) ^ String.concat " " (List.map (fun a,b -> a ^ "=" ^ b) flgs) - | NCases (_,what,where) -> "ncases " ^ NotationPp.pp_term status what ^ + | NCases (_,what,_where) -> "ncases " ^ NotationPp.pp_term status what ^ "...to be implemented..." ^ " " ^ "...to be implemented..." | NConstructor (_,None,l) -> "@ " ^ String.concat " " (List.map (NotationPp.pp_term status) l) | NConstructor (_,Some x,l) -> "@" ^ string_of_int x ^ " " ^ String.concat " " (List.map (NotationPp.pp_term status) l) | NCase1 (_,n) -> "*" ^ n ^ ":" - | NChange (_,what,wwhat) -> "nchange " ^ "...to be implemented..." ^ + | NChange (_,_what,wwhat) -> "nchange " ^ "...to be implemented..." ^ " with " ^ NotationPp.pp_term status wwhat | NCut (_,t) -> "ncut " ^ NotationPp.pp_term status t (*| NDiscriminate (_,t) -> "ndiscriminate " ^ NotationPp.pp_term status t | NSubst (_,t) -> "nsubst " ^ NotationPp.pp_term status t *) | NClear (_,l) -> "nclear " ^ String.concat " " l - | NDestruct (_,dom,skip) -> "ndestruct ..." - | NElim (_,what,where) -> "nelim " ^ NotationPp.pp_term status what ^ + | NDestruct (_,_dom,_skip) -> "ndestruct ..." + | NElim (_,what,_where) -> "nelim " ^ NotationPp.pp_term status what ^ "...to be implemented..." ^ " " ^ "...to be implemented..." | NId _ -> "nid" | NIntro (_,n) -> "#" ^ n | NIntros (_,l) -> "#" ^ String.concat " " l - | NInversion (_,what,where) -> "ninversion " ^ NotationPp.pp_term status what ^ + | NInversion (_,what,_where) -> "ninversion " ^ NotationPp.pp_term status what ^ "...to be implemented..." ^ " " ^ "...to be implemented..." | NLApply (_,t) -> "lapply " ^ NotationPp.pp_term status t | NRewrite (_,dir,n,where) -> "nrewrite " ^ @@ -164,11 +164,14 @@ let rec pp_ntactic status ~map_unicode_to_tex = String.concat " " (List.map (function (id,term) -> "(" ^ id ^ ": (" ^ NotationPp.pp_term status term ^ "))") args) + | PrintStack _ -> "print_stack" ;; let pp_nmacro status = function | NCheck (_, term) -> Printf.sprintf "ncheck %s" (NotationPp.pp_term status term) | Screenshot (_, name) -> Printf.sprintf "screenshot \"%s\"" name + | NAutoInteractive _ + | NIntroGuess _ -> assert false (* TODO *) ;; let pp_l1_pattern = NotationPp.pp_term @@ -194,7 +197,7 @@ let pp_precedence i = sprintf "with precedence %d" i let pp_argument_pattern = function | NotationPt.IdentArg (eta_depth, name) -> let eta_buf = Buffer.create 5 in - for i = 1 to eta_depth do + for _i = 1 to eta_depth do Buffer.add_string eta_buf "\\eta." done; sprintf "%s%s" (Buffer.contents eta_buf) name diff --git a/matita/components/grafite_engine/.depend b/matita/components/grafite_engine/.depend index e6d4942c6..bffffc1b8 100644 --- a/matita/components/grafite_engine/.depend +++ b/matita/components/grafite_engine/.depend @@ -1,11 +1,23 @@ -grafiteTypes.cmi : -nCicCoercDeclaration.cmi : grafiteTypes.cmi -grafiteEngine.cmi : grafiteTypes.cmi -grafiteTypes.cmo : grafiteTypes.cmi -grafiteTypes.cmx : grafiteTypes.cmi -nCicCoercDeclaration.cmo : grafiteTypes.cmi nCicCoercDeclaration.cmi -nCicCoercDeclaration.cmx : grafiteTypes.cmx nCicCoercDeclaration.cmi -grafiteEngine.cmo : nCicCoercDeclaration.cmi grafiteTypes.cmi \ +grafiteEngine.cmo : \ + nCicCoercDeclaration.cmi \ + grafiteTypes.cmi \ grafiteEngine.cmi -grafiteEngine.cmx : nCicCoercDeclaration.cmx grafiteTypes.cmx \ +grafiteEngine.cmx : \ + nCicCoercDeclaration.cmx \ + grafiteTypes.cmx \ grafiteEngine.cmi +grafiteEngine.cmi : \ + grafiteTypes.cmi +grafiteTypes.cmo : \ + grafiteTypes.cmi +grafiteTypes.cmx : \ + grafiteTypes.cmi +grafiteTypes.cmi : +nCicCoercDeclaration.cmo : \ + grafiteTypes.cmi \ + nCicCoercDeclaration.cmi +nCicCoercDeclaration.cmx : \ + grafiteTypes.cmx \ + nCicCoercDeclaration.cmi +nCicCoercDeclaration.cmi : \ + grafiteTypes.cmi diff --git a/matita/components/grafite_engine/.depend.opt b/matita/components/grafite_engine/.depend.opt index e6d4942c6..6e9ccb21a 100644 --- a/matita/components/grafite_engine/.depend.opt +++ b/matita/components/grafite_engine/.depend.opt @@ -1,11 +1,14 @@ -grafiteTypes.cmi : -nCicCoercDeclaration.cmi : grafiteTypes.cmi -grafiteEngine.cmi : grafiteTypes.cmi -grafiteTypes.cmo : grafiteTypes.cmi -grafiteTypes.cmx : grafiteTypes.cmi -nCicCoercDeclaration.cmo : grafiteTypes.cmi nCicCoercDeclaration.cmi -nCicCoercDeclaration.cmx : grafiteTypes.cmx nCicCoercDeclaration.cmi -grafiteEngine.cmo : nCicCoercDeclaration.cmi grafiteTypes.cmi \ - grafiteEngine.cmi -grafiteEngine.cmx : nCicCoercDeclaration.cmx grafiteTypes.cmx \ +grafiteEngine.cmx : \ + nCicCoercDeclaration.cmx \ + grafiteTypes.cmx \ grafiteEngine.cmi +grafiteEngine.cmi : \ + grafiteTypes.cmi +grafiteTypes.cmx : \ + grafiteTypes.cmi +grafiteTypes.cmi : +nCicCoercDeclaration.cmx : \ + grafiteTypes.cmx \ + nCicCoercDeclaration.cmi +nCicCoercDeclaration.cmi : \ + grafiteTypes.cmi diff --git a/matita/components/grafite_engine/grafiteEngine.ml b/matita/components/grafite_engine/grafiteEngine.ml index 93396d2bd..71f036904 100644 --- a/matita/components/grafite_engine/grafiteEngine.ml +++ b/matita/components/grafite_engine/grafiteEngine.ml @@ -40,7 +40,7 @@ let basic_eval_unification_hint (t,n) status = let inject_unification_hint = let basic_eval_unification_hint (t,n) - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference + ~refresh_uri_in_universe:_ ~refresh_uri_in_term ~refresh_uri_in_reference:_ ~alias_only status = if not alias_only then @@ -88,7 +88,7 @@ let basic_eval_interpretation ~alias_only (dsc, (symbol, args), cic_appl_pattern let inject_interpretation = let basic_eval_interpretation (dsc, (symbol, args), cic_appl_pattern) - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference + ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_ ~refresh_uri_in_reference:_ ~alias_only = let rec refresh = @@ -117,8 +117,8 @@ let basic_eval_alias (mode,diff) status = ;; let inject_alias = - let basic_eval_alias (mode,diff) ~refresh_uri_in_universe ~refresh_uri_in_term - ~refresh_uri_in_reference ~alias_only = + let basic_eval_alias (mode,diff) ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_ + ~refresh_uri_in_reference:_ ~alias_only:_ = basic_eval_alias (mode,diff) in GrafiteTypes.Serializer.register#run "alias" basic_eval_alias @@ -138,7 +138,7 @@ let basic_eval_input_notation (l1,l2) status = let inject_input_notation = let basic_eval_input_notation (l1,l2) - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference + ~refresh_uri_in_universe:_ ~refresh_uri_in_term ~refresh_uri_in_reference ~alias_only status = if not alias_only then @@ -169,7 +169,7 @@ let basic_eval_output_notation (l1,l2) status = let inject_output_notation = let basic_eval_output_notation (l1,l2) - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference + ~refresh_uri_in_universe:_ ~refresh_uri_in_term ~refresh_uri_in_reference ~alias_only status = if not alias_only then @@ -195,8 +195,8 @@ let eval_output_notation status data= ;; let record_index_obj = - let aux l ~refresh_uri_in_universe - ~refresh_uri_in_term ~refresh_uri_in_reference ~alias_only status + let aux l ~refresh_uri_in_universe:_ + ~refresh_uri_in_term ~refresh_uri_in_reference:_ ~alias_only status = let refresh_uri_in_term = refresh_uri_in_term (status:>NCic.status) in if not alias_only then @@ -297,8 +297,8 @@ let basic_extract_ocaml_obj obj status = let inject_extract_obj = let basic_extract_obj info - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference - ~alias_only status + ~refresh_uri_in_universe:__ ~refresh_uri_in_term:_ ~refresh_uri_in_reference + ~alias_only:_ status = let info= NCicExtraction.refresh_uri_in_info ~refresh_uri_in_reference info in status#set_extraction_db @@ -309,8 +309,8 @@ let inject_extract_obj = let inject_extract_ocaml_obj = let basic_extract_ocaml_obj info - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference - ~alias_only status + ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_ ~refresh_uri_in_reference + ~alias_only:_ status = let info= OcamlExtractionTable.refresh_uri_in_info ~refresh_uri_in_reference ~refresh_uri:NCicLibrary.refresh_uri info in status#set_ocaml_extraction_db @@ -358,7 +358,7 @@ let index_eq print uri (status:#NCic.status) = let record_index_eq = let basic_index_eq uri - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference + ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_ ~refresh_uri_in_reference:_ ~alias_only status = if not alias_only then index_eq false (NCicLibrary.refresh_uri uri) status else @@ -381,7 +381,7 @@ let index_eq_for_auto status uri = let inject_constraint = let basic_eval_add_constraint (acyclic,u1,u2) - ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference + ~refresh_uri_in_universe ~refresh_uri_in_term:_ ~refresh_uri_in_reference:_ ~alias_only status = if not alias_only then @@ -508,8 +508,8 @@ let eval_ng_tac tac = | GrafiteAst.RewritingStep (_,rhs,just,cont) -> Declarative.rewritingstep (text,prefix_len,rhs) (match just with - `Term t -> just_to_tacstatus_just just text prefix_len - | `Auto params -> just_to_tacstatus_just just text prefix_len + `Term _ + | `Auto _ -> just_to_tacstatus_just just text prefix_len |`Proof -> `Proof |`SolveWith t -> `SolveWith (text,prefix_len,t) ) @@ -604,7 +604,7 @@ let extract_uris status uris = let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = match cmd with - | GrafiteAst.Include (loc, mode, fname) -> + | GrafiteAst.Include (_loc, mode, fname) -> let _root, baseuri, fullpath, _rrelpath = Librarian.baseuri_of_script ~include_paths fname in let baseuri = NUri.uri_of_string baseuri in @@ -615,7 +615,7 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = ~alias_only ~baseuri ~fname:fullpath status in OcamlExtraction.print_open status (NCicLibrary.get_transitively_included status) - | GrafiteAst.UnificationHint (loc, t, n) -> eval_unification_hint status t n + | GrafiteAst.UnificationHint (_loc, t, n) -> eval_unification_hint status t n | GrafiteAst.NCoercion (loc, name, compose, None) -> let status, t, ty, source, target = let o_t = NotationPt.Ident (name,None) in @@ -646,7 +646,7 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = GrafiteAst.NCoercion (loc, name, compose, Some (t, ty, source, target)) in eval_ncommand ~include_paths opts status (text,prefix_len,cmd) - | GrafiteAst.NCoercion (loc, name, compose, Some (t, ty, source, target)) -> + | GrafiteAst.NCoercion (_loc, name, compose, Some (t, ty, source, target)) -> let status, composites = NCicCoercDeclaration.eval_ncoercion status name compose t ty source target in @@ -654,11 +654,11 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = let mode = GrafiteAst.WithPreferences in (* MATITA 1.0: fixme *) let aliases = GrafiteDisambiguate.aliases_for_objs status composites in eval_alias status (mode,aliases) - | GrafiteAst.NQed (loc,index) -> + | GrafiteAst.NQed (_loc,index) -> if status#ng_mode <> `ProofMode then raise (GrafiteTypes.Command_error "Not in proof mode") else - let uri,height,menv,subst,obj_kind = status#obj in + let uri,_height,menv,subst,obj_kind = status#obj in if menv <> [] then raise (GrafiteTypes.Command_error"You can't Qed an incomplete theorem") @@ -761,7 +761,7 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = let status = match nobj with NCic.Inductive (is_ind,leftno,itl,_) -> List.fold_left (fun status it -> - (let _,ind_name,ty,cl = it in + (let _,ind_name,_ty,_cl = it in List.fold_left (fun status outsort -> let status = status#set_ng_mode `ProofMode in @@ -787,11 +787,11 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = | _ -> status in let status = match nobj with - NCic.Inductive (is_ind,leftno,itl,_) -> + NCic.Inductive (_is_ind,leftno,itl,_) -> (* first leibniz *) let status' = List.fold_left (fun status it -> - let _,ind_name,ty,cl = it in + let _,ind_name,_ty,_cl = it in let status = status#set_ng_mode `ProofMode in try (let status,invobj = @@ -818,7 +818,7 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = (* then JMeq *) List.fold_left (fun status it -> - let _,ind_name,ty,cl = it in + let _,ind_name,_ty,_cl = it in let status = status#set_ng_mode `ProofMode in try (let status,invobj = @@ -873,7 +873,7 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = exn -> NCicLibrary.time_travel old_status; raise exn) - | GrafiteAst.NCopy (log,tgt,src_uri, map) -> + | GrafiteAst.NCopy (_loc,tgt,src_uri, map) -> if status#ng_mode <> `CommandMode then raise (GrafiteTypes.Command_error "Not in command mode") else @@ -904,14 +904,14 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = let status = subst_metasenv_and_fix_names status in let status = status#set_ng_mode `ProofMode in eval_ncommand ~include_paths opts status ("",0,GrafiteAst.NQed(Stdpp.dummy_loc,false)) - | GrafiteAst.NObj (loc,obj,index) -> + | GrafiteAst.NObj (_loc,obj,index) -> if status#ng_mode <> `CommandMode then raise (GrafiteTypes.Command_error "Not in command mode") else let status,obj = GrafiteDisambiguate.disambiguate_nobj status ~baseuri:status#baseuri (text,prefix_len,obj) in - let uri,height,nmenv,nsubst,nobj = obj in + let _uri,_height,nmenv,_nsubst,_nobj = obj in let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in let status = status#set_obj obj in let status = status#set_stack ninitial_stack in @@ -922,12 +922,12 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = eval_ncommand ~include_paths opts status ("",0,GrafiteAst.NQed(Stdpp.dummy_loc,index)) | _ -> status) - | GrafiteAst.NDiscriminator (loc, indty) -> + | GrafiteAst.NDiscriminator (_loc, indty) -> if status#ng_mode <> `CommandMode then raise (GrafiteTypes.Command_error "Not in command mode") else let status = status#set_ng_mode `ProofMode in - let metasenv,subst,status,indty = + let _metasenv,_subst,status,indty = GrafiteDisambiguate.disambiguate_nterm status `XTNone [] [] [] (text,prefix_len,indty) in let indtyno, (_,_,tys,_,_),leftno = match indty with NCic.Const ((NReference.Ref (_,NReference.Ind (_,indtyno,leftno))) as r) -> @@ -942,7 +942,7 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = [] -> eval_ncommand ~include_paths opts status ("",0,GrafiteAst.NQed(Stdpp.dummy_loc,false)) | _ -> prerr_endline ("Discriminator: non empty metasenv"); status) - | GrafiteAst.NInverter (loc, name, indty, selection, sort) -> + | GrafiteAst.NInverter (_loc, name, indty, selection, sort) -> if status#ng_mode <> `CommandMode then raise (GrafiteTypes.Command_error "Not in command mode") else @@ -962,7 +962,7 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = "ninverter: found target %s, which is not a sort" (status#ppterm ~metasenv ~subst ~context:[] sort))) in let status = status#set_ng_mode `ProofMode in - let metasenv,subst,status,indty = + let _metasenv,_subst,status,indty = GrafiteDisambiguate.disambiguate_nterm status `XTNone [] [] subst (text,prefix_len,indty) in let indtyno,(_,leftno,tys,_,_) = @@ -983,16 +983,16 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = eval_ncommand ~include_paths opts status ("",0,GrafiteAst.NQed(Stdpp.dummy_loc,false)) | _ -> assert false) - | GrafiteAst.NUnivConstraint (loc,acyclic,u1,u2) -> + | GrafiteAst.NUnivConstraint (_loc,acyclic,u1,u2) -> eval_add_constraint status acyclic [`Type,u1] [`Type,u2] (* ex lexicon commands *) - | GrafiteAst.Interpretation (loc, dsc, (symbol, args), cic_appl_pattern) -> + | GrafiteAst.Interpretation (_loc, dsc, (symbol, args), cic_appl_pattern) -> let cic_appl_pattern = GrafiteDisambiguate.disambiguate_cic_appl_pattern status args cic_appl_pattern in eval_interpretation status (dsc,(symbol, args),cic_appl_pattern) - | GrafiteAst.Notation (loc, dir, l1, associativity, precedence, l2) -> + | GrafiteAst.Notation (_loc, dir, l1, associativity, precedence, l2) -> let l1 = CicNotationParser.check_l1_pattern l1 (dir = Some `RightToLeft) precedence associativity @@ -1003,23 +1003,23 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = in if dir <> Some `LeftToRight then eval_output_notation status (l1,l2) else status - | GrafiteAst.Alias (loc, spec) -> + | GrafiteAst.Alias (_loc, spec) -> let diff = (*CSC: Warning: this code should be factorized with the corresponding code in DisambiguatePp *) match spec with - | GrafiteAst.Ident_alias (id,uri) -> + | GrafiteAst.Ident_alias (id,_uri) -> [DisambiguateTypes.Id id,spec] - | GrafiteAst.Symbol_alias (symb, instance, desc) -> + | GrafiteAst.Symbol_alias (symb, instance, _desc) -> [DisambiguateTypes.Symbol (symb,instance),spec] - | GrafiteAst.Number_alias (instance,desc) -> + | GrafiteAst.Number_alias (instance,_desc) -> [DisambiguateTypes.Num instance,spec] in let mode = GrafiteAst.WithPreferences in(*assert false in (* VEDI SOPRA *) MATITA 1.0*) eval_alias status (mode,diff) ;; -let eval_comment opts status (text,prefix_len,c) = status +let eval_comment _opts status (_text,_prefix_len,_c) = status let rec eval_executable ~include_paths opts status (text,prefix_len,ex) = match ex with diff --git a/matita/components/grafite_engine/nCicCoercDeclaration.ml b/matita/components/grafite_engine/nCicCoercDeclaration.ml index 74a7eb6a4..a2ed8044a 100644 --- a/matita/components/grafite_engine/nCicCoercDeclaration.ml +++ b/matita/components/grafite_engine/nCicCoercDeclaration.ml @@ -152,7 +152,7 @@ disambiguation error"))) aux 0 [] ty in let status, tgt, arity = - let metasenv,subst,status,tgt = + let _metasenv,subst,status,tgt = GrafiteDisambiguate.disambiguate_nterm status `XTSort [] [] [] ("",0,tgt) in let tgt = NCicUntrusted.apply_subst status subst [] tgt in @@ -182,7 +182,7 @@ let fresh_uri status prefix suffix = exception Stop;; -let close_graph name t s d to_s from_d p a status = +let close_graph _name t s d to_s from_d _p a status = let c = List.find (function (_,_,NCic.Appl (x::_),_,_) -> x = t | _ -> assert false) @@ -228,7 +228,7 @@ let close_graph name t s d to_s from_d p a status = let pos = match p with | NCic.Meta (p,_) -> pos_in_list p (List.map fst metasenv) - | t -> raise Stop + | _t -> raise Stop in let ty = NCicTypeChecker.typeof status ~metasenv:[] ~subst:[] [] bo in let src,tgt = src_tgt_of_ty_cpos_arity status ty pos arity in @@ -292,8 +292,8 @@ let record_ncoercion = let d = refresh_uri_in_term d in basic_index_ncoercion (name,compose,t,s,d,p,a) in - let aux_l l ~refresh_uri_in_universe ~refresh_uri_in_term - ~refresh_uri_in_reference ~alias_only status + let aux_l l ~refresh_uri_in_universe:_ ~refresh_uri_in_term + ~refresh_uri_in_reference:_ ~alias_only status = if not alias_only then List.fold_right (aux ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCic.status))) l status diff --git a/matita/components/grafite_parser/.depend b/matita/components/grafite_parser/.depend index 752b0d88d..13f0fb882 100644 --- a/matita/components/grafite_parser/.depend +++ b/matita/components/grafite_parser/.depend @@ -1,6 +1,11 @@ +grafiteParser.cmo : \ + grafiteParser.cmi +grafiteParser.cmx : \ + grafiteParser.cmi grafiteParser.cmi : -print_grammar.cmi : grafiteParser.cmi -grafiteParser.cmo : grafiteParser.cmi -grafiteParser.cmx : grafiteParser.cmi -print_grammar.cmo : print_grammar.cmi -print_grammar.cmx : print_grammar.cmi +print_grammar.cmo : \ + print_grammar.cmi +print_grammar.cmx : \ + print_grammar.cmi +print_grammar.cmi : \ + grafiteParser.cmi diff --git a/matita/components/grafite_parser/.depend.opt b/matita/components/grafite_parser/.depend.opt index 752b0d88d..4b014236d 100644 --- a/matita/components/grafite_parser/.depend.opt +++ b/matita/components/grafite_parser/.depend.opt @@ -1,6 +1,7 @@ +grafiteParser.cmx : \ + grafiteParser.cmi grafiteParser.cmi : -print_grammar.cmi : grafiteParser.cmi -grafiteParser.cmo : grafiteParser.cmi -grafiteParser.cmx : grafiteParser.cmi -print_grammar.cmo : print_grammar.cmi -print_grammar.cmx : print_grammar.cmi +print_grammar.cmx : \ + print_grammar.cmi +print_grammar.cmi : \ + grafiteParser.cmi diff --git a/matita/components/grafite_parser/Makefile b/matita/components/grafite_parser/Makefile index 164153916..b5b20bb60 100644 --- a/matita/components/grafite_parser/Makefile +++ b/matita/components/grafite_parser/Makefile @@ -14,7 +14,7 @@ clean: # soon as we have ocaml 3.09 everywhere and "loc" occurrences are replaced by # "_loc" occurrences UTF8DIR = $(shell $(OCAMLFIND) query helm-syntax_extensions) -ULEXDIR = $(shell $(OCAMLFIND) query ulex08) +ULEXDIR = $(shell $(OCAMLFIND) query ulex-camlp5) MY_SYNTAXOPTIONS = -pp "camlp5o -I $(UTF8DIR) -I $(ULEXDIR) pa_extend.cmo pa_ulex.cma pa_unicode_macro.cma -loc loc" grafiteParser.cmo: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS) grafiteParser.cmx: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS) @@ -22,8 +22,8 @@ depend: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS) depend.opt: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS) # # -grafiteParser.cmo: OCAMLC = $(OCAMLC_P4) -grafiteParser.cmx: OCAMLOPT = $(OCAMLOPT_P4) +grafiteParser.cmo: OCAMLC = $(OCAMLC_P4) -w -27 +grafiteParser.cmx: OCAMLOPT = $(OCAMLOPT_P4) -w -27 include ../../Makefile.defs include ../Makefile.common diff --git a/matita/components/grafite_parser/print_grammar.ml b/matita/components/grafite_parser/print_grammar.ml index 738ceb4da..9fea12e40 100644 --- a/matita/components/grafite_parser/print_grammar.ml +++ b/matita/components/grafite_parser/print_grammar.ml @@ -105,7 +105,7 @@ let needs_brackets t = count_brothers t > 1 let visit_description desc fmt self = - let skip s = true in + let skip _s = true in let inline s = List.mem s [ "int" ] in let rec visit_entry e ?level todo is_son = @@ -140,7 +140,7 @@ let visit_description desc fmt self = (fun x -> Sself :: x) (flatten_tree suff) @ flatten_tree pref) todo is_son - and visit_tree name t todo is_son = + and visit_tree name t todo _is_son = if List.for_all (List.for_all is_symbol_dummy) t then todo else ( Format.fprintf fmt "@["; (match name with diff --git a/matita/components/library/.depend b/matita/components/library/.depend index 6f2769b94..2cf0d4213 100644 --- a/matita/components/library/.depend +++ b/matita/components/library/.depend @@ -1,9 +1,15 @@ +librarian.cmo : \ + librarian.cmi +librarian.cmx : \ + librarian.cmi librarian.cmi : -libraryMisc.cmi : +libraryClean.cmo : \ + libraryClean.cmi +libraryClean.cmx : \ + libraryClean.cmi libraryClean.cmi : -librarian.cmo : librarian.cmi -librarian.cmx : librarian.cmi -libraryMisc.cmo : libraryMisc.cmi -libraryMisc.cmx : libraryMisc.cmi -libraryClean.cmo : libraryClean.cmi -libraryClean.cmx : libraryClean.cmi +libraryMisc.cmo : \ + libraryMisc.cmi +libraryMisc.cmx : \ + libraryMisc.cmi +libraryMisc.cmi : diff --git a/matita/components/library/.depend.opt b/matita/components/library/.depend.opt index 6f2769b94..d960dc9be 100644 --- a/matita/components/library/.depend.opt +++ b/matita/components/library/.depend.opt @@ -1,9 +1,9 @@ +librarian.cmx : \ + librarian.cmi librarian.cmi : -libraryMisc.cmi : +libraryClean.cmx : \ + libraryClean.cmi libraryClean.cmi : -librarian.cmo : librarian.cmi -librarian.cmx : librarian.cmi -libraryMisc.cmo : libraryMisc.cmi -libraryMisc.cmx : libraryMisc.cmi -libraryClean.cmo : libraryClean.cmi -libraryClean.cmx : libraryClean.cmi +libraryMisc.cmx : \ + libraryMisc.cmi +libraryMisc.cmi : diff --git a/matita/components/library/librarian.ml b/matita/components/library/librarian.ml index 13fccbfa2..bcb84fd67 100644 --- a/matita/components/library/librarian.ml +++ b/matita/components/library/librarian.ml @@ -41,7 +41,7 @@ let find_root path = let path = absolutize path in let paths = List.rev (Str.split (Str.regexp "/") path) in let rec build = function - | he::tl as l -> ("/" ^ String.concat "/" (List.rev l) ^ "/") :: build tl + | _he::tl as l -> ("/" ^ String.concat "/" (List.rev l) ^ "/") :: build tl | [] -> ["/"] in let paths = List.map HExtlib.normalize_path (build paths) in @@ -78,7 +78,7 @@ let load_root_file rootpath = let find_root_for ~include_paths file = let include_paths = "" :: Sys.getcwd () :: include_paths in - let rec find_path_for file = + let find_path_for file = try HExtlib.find_in include_paths file with Failure "find_in" -> HLog.error ("We are in: " ^ Sys.getcwd ()); diff --git a/matita/components/library/libraryClean.ml b/matita/components/library/libraryClean.ml index 8d7818992..1b3df75f8 100644 --- a/matita/components/library/libraryClean.ml +++ b/matita/components/library/libraryClean.ml @@ -25,16 +25,14 @@ (* $Id$ *) -open Printf - let debug = false let debug_prerr = if debug then prerr_endline else ignore -module HGT = Http_getter_types;; -module HG = Http_getter;; +(*module HGT = Http_getter_types;;*) +(*module HG = Http_getter;;*) (*module UM = UriManager;;*) -let decompile = ref (fun ~baseuri -> assert false);; +let decompile = ref (fun ~baseuri:_ -> assert false);; let set_decompile_cb f = decompile := f;; (* @@ -219,11 +217,11 @@ let moo_root_dir = lazy ( ;; *) -let rec close_db cache_of_processed_baseuri uris next = +let close_db _cache_of_processed_baseuri uris _next = uris (* MATITA 1.0 *) ;; -let clean_baseuris ?(verbose=true) buris = +let clean_baseuris ?verbose:(_=true) _buris = (* MATITA 1.0 *) () (* let cache_of_processed_baseuri = Hashtbl.create 1024 in let buris = List.map Http_getter_misc.strip_trailing_slash buris in diff --git a/matita/components/logger/.depend b/matita/components/logger/.depend index d1b4c3716..26c231a99 100644 --- a/matita/components/logger/.depend +++ b/matita/components/logger/.depend @@ -1,3 +1,5 @@ +helmLogger.cmo : \ + helmLogger.cmi +helmLogger.cmx : \ + helmLogger.cmi helmLogger.cmi : -helmLogger.cmo : helmLogger.cmi -helmLogger.cmx : helmLogger.cmi diff --git a/matita/components/logger/.depend.opt b/matita/components/logger/.depend.opt index d1b4c3716..f68fdd43e 100644 --- a/matita/components/logger/.depend.opt +++ b/matita/components/logger/.depend.opt @@ -1,3 +1,3 @@ +helmLogger.cmx : \ + helmLogger.cmi helmLogger.cmi : -helmLogger.cmo : helmLogger.cmi -helmLogger.cmx : helmLogger.cmi diff --git a/matita/components/logger/helmLogger.ml b/matita/components/logger/helmLogger.ml index c41674754..467c05464 100644 --- a/matita/components/logger/helmLogger.ml +++ b/matita/components/logger/helmLogger.ml @@ -15,7 +15,7 @@ type html_msg = [ `Error of html_tag | `Msg of html_tag ] type logger_fun = ?append_NL:bool -> html_msg -> unit -let rec string_of_html_tag = +let string_of_html_tag = let rec aux indent = let indent_str = String.make indent ' ' in function diff --git a/matita/components/ng_cic_content/.depend b/matita/components/ng_cic_content/.depend index 01e2f5b1e..d870b57dc 100644 --- a/matita/components/ng_cic_content/.depend +++ b/matita/components/ng_cic_content/.depend @@ -1,6 +1,12 @@ -ncic2astMatcher.cmi : +interpretations.cmo : \ + ncic2astMatcher.cmi \ + interpretations.cmi +interpretations.cmx : \ + ncic2astMatcher.cmx \ + interpretations.cmi interpretations.cmi : -ncic2astMatcher.cmo : ncic2astMatcher.cmi -ncic2astMatcher.cmx : ncic2astMatcher.cmi -interpretations.cmo : ncic2astMatcher.cmi interpretations.cmi -interpretations.cmx : ncic2astMatcher.cmx interpretations.cmi +ncic2astMatcher.cmo : \ + ncic2astMatcher.cmi +ncic2astMatcher.cmx : \ + ncic2astMatcher.cmi +ncic2astMatcher.cmi : diff --git a/matita/components/ng_cic_content/.depend.opt b/matita/components/ng_cic_content/.depend.opt index 01e2f5b1e..b526a0df5 100644 --- a/matita/components/ng_cic_content/.depend.opt +++ b/matita/components/ng_cic_content/.depend.opt @@ -1,6 +1,7 @@ -ncic2astMatcher.cmi : +interpretations.cmx : \ + ncic2astMatcher.cmx \ + interpretations.cmi interpretations.cmi : -ncic2astMatcher.cmo : ncic2astMatcher.cmi -ncic2astMatcher.cmx : ncic2astMatcher.cmi -interpretations.cmo : ncic2astMatcher.cmi interpretations.cmi -interpretations.cmx : ncic2astMatcher.cmx interpretations.cmi +ncic2astMatcher.cmx : \ + ncic2astMatcher.cmi +ncic2astMatcher.cmi : diff --git a/matita/components/ng_cic_content/interpretations.ml b/matita/components/ng_cic_content/interpretations.ml index 47b1ac063..794859369 100644 --- a/matita/components/ng_cic_content/interpretations.ml +++ b/matita/components/ng_cic_content/interpretations.ml @@ -107,7 +107,7 @@ let add_idrefs = List.fold_right (fun idref t -> Ast.AttributedTerm (`IdRef idref, t)) let instantiate32 idrefs env symbol args = - let rec instantiate_arg = function + let instantiate_arg = function | Ast.IdentArg (n, name) -> let t = try List.assoc name env @@ -267,7 +267,7 @@ let nast_of_cic0 status | NCic.Lambda (n,s,t) -> idref (Ast.Binder (`Lambda,(Ast.Ident (n,None), Some (k ~context s)), k ~context:((n,NCic.Decl s)::context) t)) - | NCic.LetIn (n,s,ty,NCic.Rel 1) -> + | NCic.LetIn (_n,s,ty,NCic.Rel 1) -> idref (Ast.Cast (k ~context ty, k ~context s)) | NCic.LetIn (n,s,ty,t) -> idref (Ast.LetIn ((Ast.Ident (n,None), Some (k ~context s)), k ~context @@ -324,7 +324,7 @@ let nast_of_cic0 status in let rec eat_branch n ctx ty pat = match (ty, pat) with - | NCic.Prod (name, s, t), _ when n > 0 -> + | NCic.Prod (_name, _s, t), _ when n > 0 -> eat_branch (pred n) ctx t pat | NCic.Prod (_, _, t), NCic.Lambda (name, s, t') -> let cv, rhs = eat_branch 0 ((name,NCic.Decl s)::ctx) t t' in @@ -431,7 +431,7 @@ let nmap_context0 status ~idref ~metasenv ~subst context = ) context ([],[])) ;; -let nmap_sequent0 status ~idref ~metasenv ~subst (i,(n,context,ty)) = +let nmap_sequent0 status ~idref ~metasenv ~subst (i,(_n,context,ty)) = let module K = Content in let nast_of_cic = nast_of_cic1 status ~idref ~output_type:`Term ~metasenv ~subst in @@ -457,7 +457,7 @@ let gen_id prefix seed = res ;; -let build_def_item seed context metasenv id n t ty = +let build_def_item seed _context _metasenv id n t ty = let module K = Content in (* try @@ -543,7 +543,7 @@ let build_inductive b seed = K.inductive_constructors = build_constructors seed cl } in -let build_fixpoint b seed = +let build_fixpoint _b seed = fun (_,n,_,ty,t) -> let t = nast_of_cic ~context:[] t in let ty = nast_of_cic ~context:[] ty in diff --git a/matita/components/ng_disambiguation/.depend b/matita/components/ng_disambiguation/.depend index 79fd839b2..7462feedb 100644 --- a/matita/components/ng_disambiguation/.depend +++ b/matita/components/ng_disambiguation/.depend @@ -1,14 +1,26 @@ -nnumber_notation.cmi : +disambiguateChoices.cmo : \ + nnumber_notation.cmi \ + disambiguateChoices.cmi +disambiguateChoices.cmx : \ + nnumber_notation.cmx \ + disambiguateChoices.cmi disambiguateChoices.cmi : -nCicDisambiguate.cmi : -grafiteDisambiguate.cmi : -nnumber_notation.cmo : nnumber_notation.cmi -nnumber_notation.cmx : nnumber_notation.cmi -disambiguateChoices.cmo : nnumber_notation.cmi disambiguateChoices.cmi -disambiguateChoices.cmx : nnumber_notation.cmx disambiguateChoices.cmi -nCicDisambiguate.cmo : nCicDisambiguate.cmi -nCicDisambiguate.cmx : nCicDisambiguate.cmi -grafiteDisambiguate.cmo : nCicDisambiguate.cmi disambiguateChoices.cmi \ +grafiteDisambiguate.cmo : \ + nCicDisambiguate.cmi \ + disambiguateChoices.cmi \ grafiteDisambiguate.cmi -grafiteDisambiguate.cmx : nCicDisambiguate.cmx disambiguateChoices.cmx \ +grafiteDisambiguate.cmx : \ + nCicDisambiguate.cmx \ + disambiguateChoices.cmx \ grafiteDisambiguate.cmi +grafiteDisambiguate.cmi : +nCicDisambiguate.cmo : \ + nCicDisambiguate.cmi +nCicDisambiguate.cmx : \ + nCicDisambiguate.cmi +nCicDisambiguate.cmi : +nnumber_notation.cmo : \ + nnumber_notation.cmi +nnumber_notation.cmx : \ + nnumber_notation.cmi +nnumber_notation.cmi : diff --git a/matita/components/ng_disambiguation/.depend.opt b/matita/components/ng_disambiguation/.depend.opt index 79fd839b2..6904cfd3b 100644 --- a/matita/components/ng_disambiguation/.depend.opt +++ b/matita/components/ng_disambiguation/.depend.opt @@ -1,14 +1,15 @@ -nnumber_notation.cmi : +disambiguateChoices.cmx : \ + nnumber_notation.cmx \ + disambiguateChoices.cmi disambiguateChoices.cmi : -nCicDisambiguate.cmi : -grafiteDisambiguate.cmi : -nnumber_notation.cmo : nnumber_notation.cmi -nnumber_notation.cmx : nnumber_notation.cmi -disambiguateChoices.cmo : nnumber_notation.cmi disambiguateChoices.cmi -disambiguateChoices.cmx : nnumber_notation.cmx disambiguateChoices.cmi -nCicDisambiguate.cmo : nCicDisambiguate.cmi -nCicDisambiguate.cmx : nCicDisambiguate.cmi -grafiteDisambiguate.cmo : nCicDisambiguate.cmi disambiguateChoices.cmi \ - grafiteDisambiguate.cmi -grafiteDisambiguate.cmx : nCicDisambiguate.cmx disambiguateChoices.cmx \ +grafiteDisambiguate.cmx : \ + nCicDisambiguate.cmx \ + disambiguateChoices.cmx \ grafiteDisambiguate.cmi +grafiteDisambiguate.cmi : +nCicDisambiguate.cmx : \ + nCicDisambiguate.cmi +nCicDisambiguate.cmi : +nnumber_notation.cmx : \ + nnumber_notation.cmi +nnumber_notation.cmi : diff --git a/matita/components/ng_disambiguation/grafiteDisambiguate.ml b/matita/components/ng_disambiguation/grafiteDisambiguate.ml index 9cfbbc8c0..3ada62287 100644 --- a/matita/components/ng_disambiguation/grafiteDisambiguate.ml +++ b/matita/components/ng_disambiguation/grafiteDisambiguate.ml @@ -57,9 +57,9 @@ class virtual status = let eval_with_new_aliases status f = let status = status#set_disambiguate_db { status#disambiguate_db with new_aliases = [] } in - let res = f status in - let new_aliases = status#disambiguate_db.new_aliases in - new_aliases,res + let new_status = f status in + let new_aliases = new_status#disambiguate_db.new_aliases in + new_aliases,new_status ;; let dump_aliases out msg status = @@ -122,7 +122,7 @@ let ncic_mk_choice status = function let desc,f = DisambiguateChoices.nlookup_num_by_dsc dsc in desc, `Num_interp (fun num -> match f with `Num_interp f -> f num | _ -> assert false) - | GrafiteAst.Ident_alias (name, uri) -> + | GrafiteAst.Ident_alias (_name, uri) -> uri, `Sym_interp (fun l->assert(l = []); let nref = NReference.reference_of_string uri in @@ -139,7 +139,7 @@ let mk_implicit b = ;; let nlookup_in_library - interactive_user_uri_choice input_or_locate_uri item + _interactive_user_uri_choice _input_or_locate_uri item = match item with | DisambiguateTypes.Id id -> @@ -206,8 +206,8 @@ let disambiguate_npattern status (text, prefix_len, (wanted, hyp_paths, goal_pat (wanted, hyp_paths, goal_path) ;; -let disambiguate_reduction_kind text prefix_len = function - | `Unfold (Some t) -> assert false (* MATITA 1.0 *) +let disambiguate_reduction_kind _text _prefix_len = function + | `Unfold (Some _t) -> assert false (* MATITA 1.0 *) | `Normalize | `Simpl | `Unfold None diff --git a/matita/components/ng_disambiguation/grafiteDisambiguate.mli b/matita/components/ng_disambiguation/grafiteDisambiguate.mli index c462af36f..019051255 100644 --- a/matita/components/ng_disambiguation/grafiteDisambiguate.mli +++ b/matita/components/ng_disambiguation/grafiteDisambiguate.mli @@ -40,7 +40,7 @@ class virtual status : end val eval_with_new_aliases: - #status as 'status -> ('status -> 'a) -> + #status as 'status -> ('status -> (#status as 'a)) -> (DisambiguateTypes.domain_item * GrafiteAst.alias_spec) list * 'a val set_proof_aliases: diff --git a/matita/components/ng_extraction/.depend b/matita/components/ng_extraction/.depend index c2ad6ff86..d5062ccd7 100644 --- a/matita/components/ng_extraction/.depend +++ b/matita/components/ng_extraction/.depend @@ -1,34 +1,101 @@ -nCicExtraction.cmi : -coq.cmi : -ocamlExtractionTable.cmi : miniml.cmo coq.cmi -mlutil.cmi : ocamlExtractionTable.cmi miniml.cmo coq.cmi -common.cmi : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi -extraction.cmi : ocamlExtractionTable.cmi miniml.cmo coq.cmi -ocaml.cmi : ocamlExtractionTable.cmi miniml.cmo coq.cmi -ocamlExtraction.cmi : ocamlExtractionTable.cmi -miniml.cmo : coq.cmi -miniml.cmx : coq.cmx -nCicExtraction.cmo : nCicExtraction.cmi -nCicExtraction.cmx : nCicExtraction.cmi -coq.cmo : coq.cmi -coq.cmx : coq.cmi -ocamlExtractionTable.cmo : miniml.cmo coq.cmi ocamlExtractionTable.cmi -ocamlExtractionTable.cmx : miniml.cmx coq.cmx ocamlExtractionTable.cmi -mlutil.cmo : ocamlExtractionTable.cmi miniml.cmo coq.cmi mlutil.cmi -mlutil.cmx : ocamlExtractionTable.cmx miniml.cmx coq.cmx mlutil.cmi -common.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi \ +common.cmo : \ + ocamlExtractionTable.cmi \ + mlutil.cmi \ + coq.cmi \ common.cmi -common.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \ +common.cmx : \ + ocamlExtractionTable.cmx \ + mlutil.cmx \ + coq.cmx \ common.cmi -extraction.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi \ - common.cmi extraction.cmi -extraction.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \ - common.cmx extraction.cmi -ocaml.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi \ - common.cmi ocaml.cmi -ocaml.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \ - common.cmx ocaml.cmi -ocamlExtraction.cmo : ocamlExtractionTable.cmi ocaml.cmi extraction.cmi \ - coq.cmi ocamlExtraction.cmi -ocamlExtraction.cmx : ocamlExtractionTable.cmx ocaml.cmx extraction.cmx \ - coq.cmx ocamlExtraction.cmi +common.cmi : \ + ocamlExtractionTable.cmi \ + coq.cmi +coq.cmo : \ + coq.cmi +coq.cmx : \ + coq.cmi +coq.cmi : +extraction.cmo : \ + ocamlExtractionTable.cmi \ + mlutil.cmi \ + miniml.cmo \ + coq.cmi \ + common.cmi \ + extraction.cmi +extraction.cmx : \ + ocamlExtractionTable.cmx \ + mlutil.cmx \ + miniml.cmx \ + coq.cmx \ + common.cmx \ + extraction.cmi +extraction.cmi : \ + ocamlExtractionTable.cmi \ + miniml.cmo +miniml.cmo : \ + coq.cmi +miniml.cmx : \ + coq.cmx +mlutil.cmo : \ + ocamlExtractionTable.cmi \ + miniml.cmo \ + coq.cmi \ + mlutil.cmi +mlutil.cmx : \ + ocamlExtractionTable.cmx \ + miniml.cmx \ + coq.cmx \ + mlutil.cmi +mlutil.cmi : \ + ocamlExtractionTable.cmi \ + miniml.cmo \ + coq.cmi +nCicExtraction.cmo : \ + nCicExtraction.cmi +nCicExtraction.cmx : \ + nCicExtraction.cmi +nCicExtraction.cmi : +ocaml.cmo : \ + ocamlExtractionTable.cmi \ + mlutil.cmi \ + miniml.cmo \ + coq.cmi \ + common.cmi \ + ocaml.cmi +ocaml.cmx : \ + ocamlExtractionTable.cmx \ + mlutil.cmx \ + miniml.cmx \ + coq.cmx \ + common.cmx \ + ocaml.cmi +ocaml.cmi : \ + ocamlExtractionTable.cmi \ + miniml.cmo \ + coq.cmi +ocamlExtraction.cmo : \ + ocamlExtractionTable.cmi \ + ocaml.cmi \ + extraction.cmi \ + coq.cmi \ + ocamlExtraction.cmi +ocamlExtraction.cmx : \ + ocamlExtractionTable.cmx \ + ocaml.cmx \ + extraction.cmx \ + coq.cmx \ + ocamlExtraction.cmi +ocamlExtraction.cmi : \ + ocamlExtractionTable.cmi +ocamlExtractionTable.cmo : \ + miniml.cmo \ + coq.cmi \ + ocamlExtractionTable.cmi +ocamlExtractionTable.cmx : \ + miniml.cmx \ + coq.cmx \ + ocamlExtractionTable.cmi +ocamlExtractionTable.cmi : \ + miniml.cmo \ + coq.cmi diff --git a/matita/components/ng_extraction/.depend.opt b/matita/components/ng_extraction/.depend.opt index 968d8ffe9..a527ad0c4 100644 --- a/matita/components/ng_extraction/.depend.opt +++ b/matita/components/ng_extraction/.depend.opt @@ -1,34 +1,61 @@ -nCicExtraction.cmi : -coq.cmi : -ocamlExtractionTable.cmi : miniml.cmx coq.cmi -mlutil.cmi : ocamlExtractionTable.cmi miniml.cmx coq.cmi -common.cmi : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi -extraction.cmi : ocamlExtractionTable.cmi miniml.cmx coq.cmi -ocaml.cmi : ocamlExtractionTable.cmi miniml.cmx coq.cmi -ocamlExtraction.cmi : ocamlExtractionTable.cmi -miniml.cmo : coq.cmi -miniml.cmx : coq.cmx -nCicExtraction.cmo : nCicExtraction.cmi -nCicExtraction.cmx : nCicExtraction.cmi -coq.cmo : coq.cmi -coq.cmx : coq.cmi -ocamlExtractionTable.cmo : miniml.cmx coq.cmi ocamlExtractionTable.cmi -ocamlExtractionTable.cmx : miniml.cmx coq.cmx ocamlExtractionTable.cmi -mlutil.cmo : ocamlExtractionTable.cmi miniml.cmx coq.cmi mlutil.cmi -mlutil.cmx : ocamlExtractionTable.cmx miniml.cmx coq.cmx mlutil.cmi -common.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi \ - common.cmi -common.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \ +common.cmx : \ + ocamlExtractionTable.cmx \ + mlutil.cmx \ + coq.cmx \ common.cmi -extraction.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi \ - common.cmi extraction.cmi -extraction.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \ - common.cmx extraction.cmi -ocaml.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi \ - common.cmi ocaml.cmi -ocaml.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \ - common.cmx ocaml.cmi -ocamlExtraction.cmo : ocamlExtractionTable.cmi ocaml.cmi extraction.cmi \ - coq.cmi ocamlExtraction.cmi -ocamlExtraction.cmx : ocamlExtractionTable.cmx ocaml.cmx extraction.cmx \ - coq.cmx ocamlExtraction.cmi +common.cmi : \ + ocamlExtractionTable.cmi \ + coq.cmi +coq.cmx : \ + coq.cmi +coq.cmi : +extraction.cmx : \ + ocamlExtractionTable.cmx \ + mlutil.cmx \ + miniml.cmx \ + coq.cmx \ + common.cmx \ + extraction.cmi +extraction.cmi : \ + ocamlExtractionTable.cmi \ + miniml.cmx +miniml.cmx : \ + coq.cmx +mlutil.cmx : \ + ocamlExtractionTable.cmx \ + miniml.cmx \ + coq.cmx \ + mlutil.cmi +mlutil.cmi : \ + ocamlExtractionTable.cmi \ + miniml.cmx \ + coq.cmi +nCicExtraction.cmx : \ + nCicExtraction.cmi +nCicExtraction.cmi : +ocaml.cmx : \ + ocamlExtractionTable.cmx \ + mlutil.cmx \ + miniml.cmx \ + coq.cmx \ + common.cmx \ + ocaml.cmi +ocaml.cmi : \ + ocamlExtractionTable.cmi \ + miniml.cmx \ + coq.cmi +ocamlExtraction.cmx : \ + ocamlExtractionTable.cmx \ + ocaml.cmx \ + extraction.cmx \ + coq.cmx \ + ocamlExtraction.cmi +ocamlExtraction.cmi : \ + ocamlExtractionTable.cmi +ocamlExtractionTable.cmx : \ + miniml.cmx \ + coq.cmx \ + ocamlExtractionTable.cmi +ocamlExtractionTable.cmi : \ + miniml.cmx \ + coq.cmi diff --git a/matita/components/ng_extraction/Makefile b/matita/components/ng_extraction/Makefile index 8bbda655e..46f6f14de 100644 --- a/matita/components/ng_extraction/Makefile +++ b/matita/components/ng_extraction/Makefile @@ -16,9 +16,6 @@ IMPLEMENTATION_FILES = \ miniml.ml $(INTERFACE_FILES:%.mli=%.ml) EXTRA_OBJECTS_TO_INSTALL = EXTRA_OBJECTS_TO_CLEAN = -%.cmo: OCAMLOPTIONS += -w Ae -%.cmi: OCAMLOPTIONS += -w Ae -%.cmx: OCAMLOPTIONS += -w Ae include ../../Makefile.defs include ../Makefile.common diff --git a/matita/components/ng_extraction/common.ml b/matita/components/ng_extraction/common.ml index fffc09974..be8f3d968 100644 --- a/matita/components/ng_extraction/common.ml +++ b/matita/components/ng_extraction/common.ml @@ -10,7 +10,7 @@ open Coq open OcamlExtractionTable -open Miniml +(*open Miniml*) open Mlutil (*s Some pretty-print utility functions. *) @@ -41,13 +41,13 @@ let rec lowercase_id id = if id = "" then "x" else if id.[0] = '_' then lowercase_id (String.sub id 1 (String.length id - 1)) else if is_invalid_id id then lowercase_id ("x" ^ id) else - String.uncapitalize id + String.uncapitalize_ascii id let rec uppercase_id id = if id = "" then "T" else if id.[0] = '_' then uppercase_id (String.sub id 1 (String.length id - 1)) else if is_invalid_id id then uppercase_id ("x" ^ id) else - String.capitalize id + String.capitalize_ascii id type kind = Term | Type | Cons @@ -108,7 +108,7 @@ let safe_name_of_reference status r = NUri.name_of_uri uri | _ -> NCicPp.r2s status true r -let maybe_capitalize b n = if b then String.capitalize n else n +let maybe_capitalize b n = if b then String.capitalize_ascii n else n let modname_of_filename status capitalize name = try @@ -116,7 +116,7 @@ let modname_of_filename status capitalize name = status, maybe_capitalize capitalize name with Not_found -> let globs = Idset.elements (get_modnames status) in - let s = next_ident_away (String.uncapitalize name) globs in + let s = next_ident_away (String.uncapitalize_ascii name) globs in let status = add_modname status s in let status = add_modname_for_filename status name s in status, maybe_capitalize capitalize s diff --git a/matita/components/ng_extraction/common.mli b/matita/components/ng_extraction/common.mli index 2cf44e003..96550bd4d 100644 --- a/matita/components/ng_extraction/common.mli +++ b/matita/components/ng_extraction/common.mli @@ -9,8 +9,8 @@ (*i $Id: common.mli 14641 2011-11-06 11:59:10Z herbelin $ i*) open Coq -open Miniml -open Mlutil +(**open Miniml +open Mlutil*) open OcamlExtractionTable (** By default, in module Format, you can do horizontal placing of blocks diff --git a/matita/components/ng_extraction/coq.ml b/matita/components/ng_extraction/coq.ml index f68562c20..7e0ff35c6 100644 --- a/matita/components/ng_extraction/coq.ml +++ b/matita/components/ng_extraction/coq.ml @@ -25,7 +25,7 @@ let cut_ident skip_quote s = numpart (n-1) n' else if code_of_0 <= c && c <= code_of_9 then numpart (n-1) (n-1) - else if skip_quote & (c = Char.code '\'' || c = Char.code '_') then + else if skip_quote && (c = Char.code '\'' || c = Char.code '_') then numpart (n-1) (n-1) else n' @@ -34,9 +34,9 @@ let cut_ident skip_quote s = let forget_subscript id = let numstart = cut_ident false id in - let newid = String.make (numstart+1) '0' in + let newid = Bytes.make (numstart+1) '0' in String.blit id 0 newid 0 numstart; - newid + Bytes.to_string newid (* Namegen.ml *) @@ -58,18 +58,18 @@ let lift_subscript id = add (carrypos-1) end else begin - let newid = String.copy id in - String.fill newid (carrypos+1) (len-1-carrypos) '0'; + let newid = Bytes.of_string id in + Bytes.fill newid (carrypos+1) (len-1-carrypos) '0'; newid.[carrypos] <- Char.chr (Char.code c + 1); - newid + Bytes.to_string newid end else begin - let newid = id^"0" in + let newid = Bytes.of_string (id^"0") in if carrypos < len-1 then begin - String.fill newid (carrypos+1) (len-1-carrypos) '0'; + Bytes.fill newid (carrypos+1) (len-1-carrypos) '0'; newid.[carrypos+1] <- '1' end; - newid + Bytes.to_string newid end in add (len-1) @@ -187,7 +187,7 @@ let array_map2 f v1 v2 = if Array.length v1 == 0 then [| |] else begin - let res = Array.create (Array.length v1) (f v1.(0) v2.(0)) in + let res = Array.make (Array.length v1) (f v1.(0) v2.(0)) in for i = 1 to pred (Array.length v1) do res.(i) <- f v1.(i) v2.(i) done; @@ -324,7 +324,7 @@ let rec pr_com ft s = let n = String.index s '\n' in String.sub s 0 n, Some (String.sub s (n+1) (String.length s - n - 1)) with Not_found -> s,None in - com_if ft (Lazy.lazy_from_val()); + com_if ft (Lazy.from_val()); (* let s1 = if String.length s1 <> 0 && s1.[0] = ' ' then (Format.pp_print_space ft (); String.sub s1 1 (String.length s1 - 1)) @@ -347,26 +347,26 @@ let pp_dirs ft = in let rec pp_cmd = function | Ppcmd_print(n,s) -> - com_if ft (Lazy.lazy_from_val()); Format.pp_print_as ft n s + com_if ft (Lazy.from_val()); Format.pp_print_as ft n s | Ppcmd_box(bty,ss) -> (* Prevent evaluation of the stream! *) - com_if ft (Lazy.lazy_from_val()); + com_if ft (Lazy.from_val()); pp_open_box bty ; if not (Format.over_max_boxes ()) then Stream.iter pp_cmd ss; Format.pp_close_box ft () - | Ppcmd_open_box bty -> com_if ft (Lazy.lazy_from_val()); pp_open_box bty + | Ppcmd_open_box bty -> com_if ft (Lazy.from_val()); pp_open_box bty | Ppcmd_close_box -> Format.pp_close_box ft () | Ppcmd_close_tbox -> Format.pp_close_tbox ft () | Ppcmd_white_space n -> - com_if ft (Lazy.lazy_from_fun (fun()->Format.pp_print_break ft n 0)) + com_if ft (Lazy.from_fun (fun()->Format.pp_print_break ft n 0)) | Ppcmd_print_break(m,n) -> - com_if ft (Lazy.lazy_from_fun(fun()->Format.pp_print_break ft m n)) + com_if ft (Lazy.from_fun(fun()->Format.pp_print_break ft m n)) | Ppcmd_set_tab -> Format.pp_set_tab ft () | Ppcmd_print_tbreak(m,n) -> - com_if ft (Lazy.lazy_from_fun(fun()->Format.pp_print_tbreak ft m n)) + com_if ft (Lazy.from_fun(fun()->Format.pp_print_tbreak ft m n)) | Ppcmd_force_newline -> com_brk ft; Format.pp_force_newline ft () | Ppcmd_print_if_broken -> - com_if ft (Lazy.lazy_from_fun(fun()->Format.pp_print_if_newline ft ())) + com_if ft (Lazy.from_fun(fun()->Format.pp_print_if_newline ft ())) | Ppcmd_comment i -> let coms = split_com [] [] i !comments in (* Format.pp_open_hvbox ft 0;*) diff --git a/matita/components/ng_extraction/extraction.ml b/matita/components/ng_extraction/extraction.ml index 382801b61..be8099598 100644 --- a/matita/components/ng_extraction/extraction.ml +++ b/matita/components/ng_extraction/extraction.ml @@ -207,7 +207,7 @@ let sign_with_implicits _r s = (* Enriching a exception message *) -let rec handle_exn _r _n _fn_name = function x -> x +let handle_exn _r _n _fn_name = function x -> x (*CSC: only for pretty printing | MLexn s -> (try Scanf.sscanf s "UNBOUND %d" @@ -1014,7 +1014,7 @@ and extract_case context mle (ip,c,br) status mlt = (* [decomp_lams_eta env c t] finds the number [n] of products in the type [t], and decompose the term [c] in [n] lambdas, with eta-expansion if needed. *) -let rec decomp_lams_eta_n n m status context c t = +let decomp_lams_eta_n n m status context c t = let rels = fst (splay_prod_n status context n t) in let rels',c = decompose_lam c in let d = n - m in diff --git a/matita/components/ng_extraction/extraction.mli b/matita/components/ng_extraction/extraction.mli index a5ab1b055..a45dff55c 100644 --- a/matita/components/ng_extraction/extraction.mli +++ b/matita/components/ng_extraction/extraction.mli @@ -10,9 +10,7 @@ (*s Extraction from Coq terms to Miniml. *) -open Coq open Miniml -open OcamlExtractionTable val extract: #OcamlExtractionTable.status as 'status -> NCic.obj -> diff --git a/matita/components/ng_extraction/mlutil.ml b/matita/components/ng_extraction/mlutil.ml index 52881e183..9f553762a 100644 --- a/matita/components/ng_extraction/mlutil.ml +++ b/matita/components/ng_extraction/mlutil.ml @@ -168,7 +168,7 @@ module Mlenv = struct let clean_free mle = let rem = ref Metaset.empty and add = ref Metaset.empty in - let clean m = match m.contents with + let clean m = match m.Miniml.contents with | None -> () | Some u -> rem := Metaset.add m !rem; add := find_free !add u in @@ -238,18 +238,18 @@ let type_maxvar t = (*s What are the type variables occurring in [t]. *) -let intset_union_map_list f l = - List.fold_left (fun s t -> Intset.union s (f t)) Intset.empty l +(*let intset_union_map_list f l = + List.fold_left (fun s t -> Intset.union s (f t)) Intset.empty l*) -let intset_union_map_array f a = - Array.fold_left (fun s t -> Intset.union s (f t)) Intset.empty a +(*let intset_union_map_array f a = + Array.fold_left (fun s t -> Intset.union s (f t)) Intset.empty a*) -let rec type_listvar = function +(*let rec type_listvar = function | Tmeta {contents = Some t} -> type_listvar t | Tvar i | Tvar' i -> Intset.singleton i | Tarr (a,b) -> Intset.union (type_listvar a) (type_listvar b) | Tglob (_,l) -> intset_union_map_list type_listvar l - | _ -> Intset.empty + | _ -> Intset.empty*) (*s From [a -> b -> c] to [[a;b],c]. *) @@ -467,12 +467,12 @@ let ast_occurs_itvl k k' t = (*s Number of occurences of [Rel k] (resp. [Rel 1]) in [t]. *) -let nb_occur_k k t = +(*let nb_occur_k k t = let cpt = ref 0 in ast_iter_rel (fun i -> if i = k then incr cpt) t; - !cpt + !cpt*) -let nb_occur t = nb_occur_k 1 t +(*let nb_occur t = nb_occur_k 1 t*) (* Number of occurences of [Rel 1] in [t], with special treatment of match: occurences in different branches aren't added, but we rather use max. *) @@ -596,7 +596,7 @@ let rec many_lams id a = function | 0 -> a | n -> many_lams id (MLlam (id,a)) (pred n) -let anonym_lams a n = many_lams anonymous a n +(*let anonym_lams a n = many_lams anonymous a n*) let anonym_tmp_lams a n = many_lams (Tmp anonymous_name) a n let dummy_lams a n = many_lams Dummy a n @@ -629,7 +629,7 @@ let rec test_eta_args_lift k n = function (*s Computes an eta-reduction. *) -let eta_red e = +(*let eta_red e = let ids,t = collect_lams e in let n = List.length ids in if n = 0 then e @@ -649,12 +649,12 @@ let eta_red e = if test_eta_args_lift 0 p args && not (ast_occurs_itvl 1 p body) then named_lams ids (ast_lift (-p) body) else e - | _ -> e + | _ -> e*) (*s Computes all head linear beta-reductions possible in [(t a)]. Non-linear head beta-redex become let-in. *) -let rec linear_beta_red a t = match a,t with +(*let rec linear_beta_red a t = match a,t with | [], _ -> t | a0::a, MLlam (id,t) -> (match nb_occur_match t with @@ -663,11 +663,11 @@ let rec linear_beta_red a t = match a,t with | _ -> let a = List.map (ast_lift 1) a in MLletin (id, a0, linear_beta_red a t)) - | _ -> MLapp (t, a) + | _ -> MLapp (t, a)*) -let rec tmp_head_lams = function +(*let rec tmp_head_lams = function | MLlam (id, t) -> MLlam (tmp_id id, tmp_head_lams t) - | e -> e + | e -> e*) (*s Applies a substitution [s] of constants by their body, plus linear beta reductions at modified positions. @@ -675,7 +675,7 @@ let rec tmp_head_lams = function reduction (this helps the inlining of recursors). *) -let rec ast_glob_subst _s _t = assert false (*CSC: reimplement match t with +let ast_glob_subst _s _t = assert false (*CSC: reimplement match t with | MLapp ((MLglob ((ConstRef kn) as refe)) as f, a) -> let a = List.map (fun e -> tmp_head_lams (ast_glob_subst s e)) a in (try linear_beta_red a (Refmap'.find refe s) @@ -789,7 +789,7 @@ let rec merge_ids ids ids' = match ids,ids' with let is_exn = function MLexn _ -> true | _ -> false -let rec permut_case_fun br _acc = +let permut_case_fun br _acc = let nb = ref max_int in Array.iter (fun (_,_,t) -> let ids, c = collect_lams t in @@ -1168,7 +1168,7 @@ let optimize_fix a = (* Utility functions used in the decision of inlining. *) -let rec ml_size = function +(*let rec ml_size = function | MLapp(t,l) -> List.length l + ml_size t + ml_size_list l | MLlam(_,t) -> 1 + ml_size t | MLcons(_,_,l) -> ml_size_list l @@ -1181,14 +1181,14 @@ let rec ml_size = function and ml_size_list l = List.fold_left (fun a t -> a + ml_size t) 0 l -and ml_size_array l = Array.fold_left (fun a t -> a + ml_size t) 0 l +and ml_size_array l = Array.fold_left (fun a t -> a + ml_size t) 0 l*) -let is_fix = function MLfix _ -> true | _ -> false +(*let is_fix = function MLfix _ -> true | _ -> false*) -let rec is_constr = function +(*let rec is_constr = function | MLcons _ -> true | MLlam(_,t) -> is_constr t - | _ -> false + | _ -> false*) (*s Strictness *) @@ -1198,11 +1198,11 @@ let rec is_constr = function it begins by at least one non-strict lambda, since the corresponding argument to [t] might be unevaluated in the expanded code. *) -exception Toplevel +(*exception Toplevel*) -let lift n l = List.map ((+) n) l +(*let lift n l = List.map ((+) n) l*) -let pop n l = List.map (fun x -> if x<=n then raise Toplevel else x-n) l +(*let pop n l = List.map (fun x -> if x<=n then raise Toplevel else x-n) l*) (* This function returns a list of de Bruijn indices of non-strict variables, or raises [Toplevel] if it has an internal non-strict variable. @@ -1212,7 +1212,7 @@ let pop n l = List.map (fun x -> if x<=n then raise Toplevel else x-n) l variable to the candidates? We use this flag to check only the external lambdas, those that will correspond to arguments. *) -let rec non_stricts add cand = function +(*let rec non_stricts add cand = function | MLlam (_id,t) -> let cand = lift 1 cand in let cand = if add then 1::cand else cand in @@ -1242,20 +1242,20 @@ let rec non_stricts add cand = function let n = List.length i in let cand = lift n cand in let cand = pop n (non_stricts add cand t) in - List.merge (fun c1 c2 -> c1 - c2) cand c) [] v + List.merge (-) cand c) [] v (* [merge] may duplicates some indices, but I don't mind. *) | MLmagic t -> non_stricts add cand t | _ -> - cand + cand*) (* The real test: we are looking for internal non-strict variables, so we start with no candidates, and the only positive answer is via the [Toplevel] exception. *) -let is_not_strict t = +(*let is_not_strict t = try let _ = non_stricts true [] t in false - with Toplevel -> true + with Toplevel -> true*) (*s Inlining decision *) @@ -1278,7 +1278,7 @@ let is_not_strict t = restriction for the moment. *) -let inline_test _r _t = +(*let inline_test _r _t = (*CSC:if not (auto_inline ()) then*) false (* else @@ -1289,7 +1289,7 @@ let inline_test _r _t = let t1 = eta_red t in let t2 = snd (collect_lams t1) in not (is_fix t2) && ml_size t < 12 && is_not_strict t -*) +*)*) (*CSC: (not) reimplemented let con_of_string s = @@ -1313,9 +1313,9 @@ let manual_inline_set = ] Cset_env.empty*) -let manual_inline = function (*CSC: +(*let manual_inline = function (*CSC: | ConstRef c -> Cset_env.mem c manual_inline_set - |*) _ -> false + |*) _ -> false*) (* If the user doesn't say he wants to keep [t], we inline in two cases: \begin{itemize} diff --git a/matita/components/ng_extraction/nCicExtraction.ml b/matita/components/ng_extraction/nCicExtraction.ml index 12261145e..18b7086f5 100644 --- a/matita/components/ng_extraction/nCicExtraction.ml +++ b/matita/components/ng_extraction/nCicExtraction.ml @@ -844,7 +844,7 @@ let object_of_constant status ~metasenv ref bo ty = (fun p1 n -> HExtlib.map_option (fun (_,k) -> (*CSC: BUG here, clashes*) - String.uncapitalize (fst n),k) p1) + String.uncapitalize_ascii (fst n),k) p1) ctx0 ctx in let bo = typ_of status ~metasenv ctx bo in @@ -962,15 +962,15 @@ let (|>) f g = fun x -> g (f x) ;; -let curry f x y = +(*let curry f x y = f (x, y) -;; +;;*) let uncurry f (x, y) = f x y ;; -let rec char_list_of_string s = +let char_list_of_string s = let l = String.length s in let rec aux buffer s = function @@ -1013,8 +1013,10 @@ let rec capitalize_marked_positions s = | [] -> s | x::xs -> if x < String.length s then - let c = Char.uppercase (String.get s x) in - let _ = String.set s x c in + let c = Char.uppercase_ascii (String.get s x) in + let b = Bytes.of_string s in + let _ = Bytes.set b x c in + let s = Bytes.to_string b in capitalize_marked_positions s xs else capitalize_marked_positions s xs @@ -1028,12 +1030,12 @@ let contract_underscores_and_capitalise = let idiomatic_haskell_type_name_of_string = contract_underscores_and_capitalise |> - String.capitalize + String.capitalize_ascii ;; let idiomatic_haskell_term_name_of_string = contract_underscores_and_capitalise |> - String.uncapitalize + String.uncapitalize_ascii ;; let classify_reference status ref = @@ -1223,7 +1225,7 @@ let rec pp_obj status (_,ref,obj_kind) = ) il) (* inductive and records missing *) -let rec infos_of (info,_,obj_kind) = +let infos_of (info,_,obj_kind) = info @ match obj_kind with LetRec l -> List.concat (List.map (fun (infos,_,_) -> infos) l) diff --git a/matita/components/ng_extraction/ocaml.ml b/matita/components/ng_extraction/ocaml.ml index 2ef1afaa0..213db1eb2 100644 --- a/matita/components/ng_extraction/ocaml.ml +++ b/matita/components/ng_extraction/ocaml.ml @@ -115,7 +115,7 @@ let pp_fields status r fields = (*s Pretty-printing of types. [par] is a boolean indicating whether parentheses are needed or not. *) -let rec pp_type status par vl t = +let pp_type status par vl t = let rec pp_rec status par = function | Tmeta _ | Tvar' _ | Taxiom -> assert false | Tvar i -> (try status,pp_tvar (List.nth vl (pred i)) diff --git a/matita/components/ng_kernel/.depend b/matita/components/ng_kernel/.depend index a55f87284..aa395ccc3 100644 --- a/matita/components/ng_kernel/.depend +++ b/matita/components/ng_kernel/.depend @@ -1,41 +1,126 @@ -nUri.cmi : -nReference.cmi : nUri.cmi -nCicUtils.cmi : nCic.cmo -nCicSubstitution.cmi : nCic.cmo -nCicEnvironment.cmi : nUri.cmi nReference.cmi nCic.cmo -nCicReduction.cmi : nCic.cmo -nCicTypeChecker.cmi : nUri.cmi nReference.cmi nCic.cmo -nCicUntrusted.cmi : nCic.cmo -nCicPp.cmi : nReference.cmi nCic.cmo -nCic.cmo : nUri.cmi nReference.cmi -nCic.cmx : nUri.cmx nReference.cmx -nUri.cmo : nUri.cmi -nUri.cmx : nUri.cmi -nReference.cmo : nUri.cmi nReference.cmi -nReference.cmx : nUri.cmx nReference.cmi -nCicUtils.cmo : nReference.cmi nCic.cmo nCicUtils.cmi -nCicUtils.cmx : nReference.cmx nCic.cmx nCicUtils.cmi -nCicSubstitution.cmo : nReference.cmi nCicUtils.cmi nCic.cmo \ +nCic.cmo : \ + nUri.cmi \ + nReference.cmi +nCic.cmx : \ + nUri.cmx \ + nReference.cmx +nCicEnvironment.cmo : \ + nUri.cmi \ + nReference.cmi \ + nCic.cmo \ + nCicEnvironment.cmi +nCicEnvironment.cmx : \ + nUri.cmx \ + nReference.cmx \ + nCic.cmx \ + nCicEnvironment.cmi +nCicEnvironment.cmi : \ + nUri.cmi \ + nReference.cmi \ + nCic.cmo +nCicPp.cmo : \ + nUri.cmi \ + nReference.cmi \ + nCicSubstitution.cmi \ + nCicReduction.cmi \ + nCicEnvironment.cmi \ + nCic.cmo \ + nCicPp.cmi +nCicPp.cmx : \ + nUri.cmx \ + nReference.cmx \ + nCicSubstitution.cmx \ + nCicReduction.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ + nCicPp.cmi +nCicPp.cmi : \ + nReference.cmi \ + nCic.cmo +nCicReduction.cmo : \ + nReference.cmi \ + nCicUtils.cmi \ + nCicSubstitution.cmi \ + nCicEnvironment.cmi \ + nCic.cmo \ + nCicReduction.cmi +nCicReduction.cmx : \ + nReference.cmx \ + nCicUtils.cmx \ + nCicSubstitution.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ + nCicReduction.cmi +nCicReduction.cmi : \ + nCic.cmo +nCicSubstitution.cmo : \ + nCicUtils.cmi \ + nCic.cmo \ nCicSubstitution.cmi -nCicSubstitution.cmx : nReference.cmx nCicUtils.cmx nCic.cmx \ +nCicSubstitution.cmx : \ + nCicUtils.cmx \ + nCic.cmx \ nCicSubstitution.cmi -nCicEnvironment.cmo : nUri.cmi nReference.cmi nCic.cmo nCicEnvironment.cmi -nCicEnvironment.cmx : nUri.cmx nReference.cmx nCic.cmx nCicEnvironment.cmi -nCicReduction.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \ - nCicEnvironment.cmi nCic.cmo nCicReduction.cmi -nCicReduction.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \ - nCicEnvironment.cmx nCic.cmx nCicReduction.cmi -nCicTypeChecker.cmo : nUri.cmi nReference.cmi nCicUtils.cmi \ - nCicSubstitution.cmi nCicReduction.cmi nCicEnvironment.cmi nCic.cmo \ +nCicSubstitution.cmi : \ + nCic.cmo +nCicTypeChecker.cmo : \ + nUri.cmi \ + nReference.cmi \ + nCicUtils.cmi \ + nCicSubstitution.cmi \ + nCicReduction.cmi \ + nCicEnvironment.cmi \ + nCic.cmo \ nCicTypeChecker.cmi -nCicTypeChecker.cmx : nUri.cmx nReference.cmx nCicUtils.cmx \ - nCicSubstitution.cmx nCicReduction.cmx nCicEnvironment.cmx nCic.cmx \ +nCicTypeChecker.cmx : \ + nUri.cmx \ + nReference.cmx \ + nCicUtils.cmx \ + nCicSubstitution.cmx \ + nCicReduction.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ nCicTypeChecker.cmi -nCicUntrusted.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \ - nCicReduction.cmi nCicEnvironment.cmi nCic.cmo nCicUntrusted.cmi -nCicUntrusted.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \ - nCicReduction.cmx nCicEnvironment.cmx nCic.cmx nCicUntrusted.cmi -nCicPp.cmo : nUri.cmi nReference.cmi nCicSubstitution.cmi nCicReduction.cmi \ - nCicEnvironment.cmi nCic.cmo nCicPp.cmi -nCicPp.cmx : nUri.cmx nReference.cmx nCicSubstitution.cmx nCicReduction.cmx \ - nCicEnvironment.cmx nCic.cmx nCicPp.cmi +nCicTypeChecker.cmi : \ + nUri.cmi \ + nReference.cmi \ + nCic.cmo +nCicUntrusted.cmo : \ + nReference.cmi \ + nCicUtils.cmi \ + nCicSubstitution.cmi \ + nCicReduction.cmi \ + nCicEnvironment.cmi \ + nCic.cmo \ + nCicUntrusted.cmi +nCicUntrusted.cmx : \ + nReference.cmx \ + nCicUtils.cmx \ + nCicSubstitution.cmx \ + nCicReduction.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ + nCicUntrusted.cmi +nCicUntrusted.cmi : \ + nCic.cmo +nCicUtils.cmo : \ + nCic.cmo \ + nCicUtils.cmi +nCicUtils.cmx : \ + nCic.cmx \ + nCicUtils.cmi +nCicUtils.cmi : \ + nCic.cmo +nReference.cmo : \ + nUri.cmi \ + nReference.cmi +nReference.cmx : \ + nUri.cmx \ + nReference.cmi +nReference.cmi : \ + nUri.cmi +nUri.cmo : \ + nUri.cmi +nUri.cmx : \ + nUri.cmi +nUri.cmi : diff --git a/matita/components/ng_kernel/.depend.opt b/matita/components/ng_kernel/.depend.opt index 5b0507784..fe01e3cc1 100644 --- a/matita/components/ng_kernel/.depend.opt +++ b/matita/components/ng_kernel/.depend.opt @@ -1,41 +1,74 @@ -nUri.cmi : -nReference.cmi : nUri.cmi -nCicUtils.cmi : nCic.cmx -nCicSubstitution.cmi : nCic.cmx -nCicEnvironment.cmi : nUri.cmi nReference.cmi nCic.cmx -nCicReduction.cmi : nCic.cmx -nCicTypeChecker.cmi : nUri.cmi nReference.cmi nCic.cmx -nCicUntrusted.cmi : nCic.cmx -nCicPp.cmi : nReference.cmi nCic.cmx -nCic.cmo : nUri.cmi nReference.cmi -nCic.cmx : nUri.cmx nReference.cmx -nUri.cmo : nUri.cmi -nUri.cmx : nUri.cmi -nReference.cmo : nUri.cmi nReference.cmi -nReference.cmx : nUri.cmx nReference.cmi -nCicUtils.cmo : nReference.cmi nCic.cmx nCicUtils.cmi -nCicUtils.cmx : nReference.cmx nCic.cmx nCicUtils.cmi -nCicSubstitution.cmo : nReference.cmi nCicUtils.cmi nCic.cmx \ - nCicSubstitution.cmi -nCicSubstitution.cmx : nReference.cmx nCicUtils.cmx nCic.cmx \ +nCic.cmx : \ + nUri.cmx \ + nReference.cmx +nCicEnvironment.cmx : \ + nUri.cmx \ + nReference.cmx \ + nCic.cmx \ + nCicEnvironment.cmi +nCicEnvironment.cmi : \ + nUri.cmi \ + nReference.cmi \ + nCic.cmx +nCicPp.cmx : \ + nUri.cmx \ + nReference.cmx \ + nCicSubstitution.cmx \ + nCicReduction.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ + nCicPp.cmi +nCicPp.cmi : \ + nReference.cmi \ + nCic.cmx +nCicReduction.cmx : \ + nReference.cmx \ + nCicUtils.cmx \ + nCicSubstitution.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ + nCicReduction.cmi +nCicReduction.cmi : \ + nCic.cmx +nCicSubstitution.cmx : \ + nCicUtils.cmx \ + nCic.cmx \ nCicSubstitution.cmi -nCicEnvironment.cmo : nUri.cmi nReference.cmi nCic.cmx nCicEnvironment.cmi -nCicEnvironment.cmx : nUri.cmx nReference.cmx nCic.cmx nCicEnvironment.cmi -nCicReduction.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \ - nCicEnvironment.cmi nCic.cmx nCicReduction.cmi -nCicReduction.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \ - nCicEnvironment.cmx nCic.cmx nCicReduction.cmi -nCicTypeChecker.cmo : nUri.cmi nReference.cmi nCicUtils.cmi \ - nCicSubstitution.cmi nCicReduction.cmi nCicEnvironment.cmi nCic.cmx \ +nCicSubstitution.cmi : \ + nCic.cmx +nCicTypeChecker.cmx : \ + nUri.cmx \ + nReference.cmx \ + nCicUtils.cmx \ + nCicSubstitution.cmx \ + nCicReduction.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ nCicTypeChecker.cmi -nCicTypeChecker.cmx : nUri.cmx nReference.cmx nCicUtils.cmx \ - nCicSubstitution.cmx nCicReduction.cmx nCicEnvironment.cmx nCic.cmx \ - nCicTypeChecker.cmi -nCicUntrusted.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \ - nCicReduction.cmi nCicEnvironment.cmi nCic.cmx nCicUntrusted.cmi -nCicUntrusted.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \ - nCicReduction.cmx nCicEnvironment.cmx nCic.cmx nCicUntrusted.cmi -nCicPp.cmo : nUri.cmi nReference.cmi nCicSubstitution.cmi nCicReduction.cmi \ - nCicEnvironment.cmi nCic.cmx nCicPp.cmi -nCicPp.cmx : nUri.cmx nReference.cmx nCicSubstitution.cmx nCicReduction.cmx \ - nCicEnvironment.cmx nCic.cmx nCicPp.cmi +nCicTypeChecker.cmi : \ + nUri.cmi \ + nReference.cmi \ + nCic.cmx +nCicUntrusted.cmx : \ + nReference.cmx \ + nCicUtils.cmx \ + nCicSubstitution.cmx \ + nCicReduction.cmx \ + nCicEnvironment.cmx \ + nCic.cmx \ + nCicUntrusted.cmi +nCicUntrusted.cmi : \ + nCic.cmx +nCicUtils.cmx : \ + nCic.cmx \ + nCicUtils.cmi +nCicUtils.cmi : \ + nCic.cmx +nReference.cmx : \ + nUri.cmx \ + nReference.cmi +nReference.cmi : \ + nUri.cmi +nUri.cmx : \ + nUri.cmi +nUri.cmi : diff --git a/matita/components/ng_kernel/Makefile b/matita/components/ng_kernel/Makefile index 35b89f3b1..31dd1e9c4 100644 --- a/matita/components/ng_kernel/Makefile +++ b/matita/components/ng_kernel/Makefile @@ -16,9 +16,6 @@ IMPLEMENTATION_FILES = \ nCic.ml $(INTERFACE_FILES:%.mli=%.ml) EXTRA_OBJECTS_TO_INSTALL = EXTRA_OBJECTS_TO_CLEAN = -%.cmo: OCAMLOPTIONS += -w Ae -%.cmi: OCAMLOPTIONS += -w Ae -%.cmx: OCAMLOPTIONS += -w Ae include ../../Makefile.defs include ../Makefile.common diff --git a/matita/components/ng_kernel/nCicReduction.ml b/matita/components/ng_kernel/nCicReduction.ml index 52cdb3840..7542a52e0 100644 --- a/matita/components/ng_kernel/nCicReduction.ml +++ b/matita/components/ng_kernel/nCicReduction.ml @@ -18,7 +18,7 @@ module E = NCicEnvironment exception AssertFailure of string Lazy.t;; let debug = ref false;; -let pp m = if !debug then prerr_endline (Lazy.force m) else ();; +(*let pp m = if !debug then prerr_endline (Lazy.force m) else ();;*) module type Strategy = sig type stack_term diff --git a/matita/components/ng_kernel/nCicSubstitution.ml b/matita/components/ng_kernel/nCicSubstitution.ml index 0ca566cc3..603be63da 100644 --- a/matita/components/ng_kernel/nCicSubstitution.ml +++ b/matita/components/ng_kernel/nCicSubstitution.ml @@ -12,9 +12,6 @@ (* $Id$ *) module C = NCic -module Ref = NReference - -let debug_print = fun _ -> ();; let lift_from status ?(no_implicit=true) k n = let rec liftaux k = function diff --git a/matita/components/ng_kernel/nCicTypeChecker.ml b/matita/components/ng_kernel/nCicTypeChecker.ml index b60734508..24217d6ae 100644 --- a/matita/components/ng_kernel/nCicTypeChecker.ml +++ b/matita/components/ng_kernel/nCicTypeChecker.ml @@ -1376,7 +1376,7 @@ let _ = NCicReduction.set_get_relevance get_relevance;; let indent = ref 0;; let debug = true;; -let logger = +let _logger = let do_indent () = String.make !indent ' ' in (function | `Start_type_checking s -> diff --git a/matita/components/ng_kernel/nCicUtils.ml b/matita/components/ng_kernel/nCicUtils.ml index f22e02a7e..398df307e 100644 --- a/matita/components/ng_kernel/nCicUtils.ml +++ b/matita/components/ng_kernel/nCicUtils.ml @@ -12,7 +12,6 @@ (* $Id$ *) module C = NCic -module Ref = NReference exception Subst_not_found of int exception Meta_not_found of int diff --git a/matita/components/ng_library/.depend b/matita/components/ng_library/.depend index a571a865c..72fc77177 100644 --- a/matita/components/ng_library/.depend +++ b/matita/components/ng_library/.depend @@ -1,3 +1,5 @@ +nCicLibrary.cmo : \ + nCicLibrary.cmi +nCicLibrary.cmx : \ + nCicLibrary.cmi nCicLibrary.cmi : -nCicLibrary.cmo : nCicLibrary.cmi -nCicLibrary.cmx : nCicLibrary.cmi diff --git a/matita/components/ng_library/.depend.opt b/matita/components/ng_library/.depend.opt index a571a865c..ee5e8bd16 100644 --- a/matita/components/ng_library/.depend.opt +++ b/matita/components/ng_library/.depend.opt @@ -1,3 +1,3 @@ +nCicLibrary.cmx : \ + nCicLibrary.cmi nCicLibrary.cmi : -nCicLibrary.cmo : nCicLibrary.cmi -nCicLibrary.cmx : nCicLibrary.cmi diff --git a/matita/components/ng_library/Makefile b/matita/components/ng_library/Makefile index 861f19acd..20157a09e 100644 --- a/matita/components/ng_library/Makefile +++ b/matita/components/ng_library/Makefile @@ -8,9 +8,6 @@ IMPLEMENTATION_FILES = \ $(INTERFACE_FILES:%.mli=%.ml) EXTRA_OBJECTS_TO_INSTALL = EXTRA_OBJECTS_TO_CLEAN = -%.cmo: OCAMLOPTIONS += -w Ae -%.cmi: OCAMLOPTIONS += -w Ae -%.cmx: OCAMLOPTIONS += -w Ae all: %: %.ml $(PACKAGE).cma diff --git a/matita/components/ng_paramodulation/.depend b/matita/components/ng_paramodulation/.depend index 5f4f1cc56..b9c453ab4 100644 --- a/matita/components/ng_paramodulation/.depend +++ b/matita/components/ng_paramodulation/.depend @@ -1,45 +1,164 @@ +foSubst.cmo : \ + terms.cmi \ + foSubst.cmi +foSubst.cmx : \ + terms.cmx \ + foSubst.cmi +foSubst.cmi : \ + terms.cmi +foUnif.cmo : \ + terms.cmi \ + orderings.cmi \ + foUtils.cmi \ + foSubst.cmi \ + foUnif.cmi +foUnif.cmx : \ + terms.cmx \ + orderings.cmx \ + foUtils.cmx \ + foSubst.cmx \ + foUnif.cmi +foUnif.cmi : \ + terms.cmi \ + orderings.cmi +foUtils.cmo : \ + terms.cmi \ + orderings.cmi \ + foSubst.cmi \ + foUtils.cmi +foUtils.cmx : \ + terms.cmx \ + orderings.cmx \ + foSubst.cmx \ + foUtils.cmi +foUtils.cmi : \ + terms.cmi \ + orderings.cmi +index.cmo : \ + terms.cmi \ + orderings.cmi \ + foUtils.cmi \ + index.cmi +index.cmx : \ + terms.cmx \ + orderings.cmx \ + foUtils.cmx \ + index.cmi +index.cmi : \ + terms.cmi \ + orderings.cmi +nCicBlob.cmo : \ + terms.cmi \ + foUtils.cmi \ + nCicBlob.cmi +nCicBlob.cmx : \ + terms.cmx \ + foUtils.cmx \ + nCicBlob.cmi +nCicBlob.cmi : \ + terms.cmi +nCicParamod.cmo : \ + terms.cmi \ + pp.cmi \ + paramod.cmi \ + orderings.cmi \ + nCicProof.cmi \ + nCicBlob.cmi \ + nCicParamod.cmi +nCicParamod.cmx : \ + terms.cmx \ + pp.cmx \ + paramod.cmx \ + orderings.cmx \ + nCicProof.cmx \ + nCicBlob.cmx \ + nCicParamod.cmi +nCicParamod.cmi : \ + terms.cmi +nCicProof.cmo : \ + terms.cmi \ + pp.cmi \ + nCicBlob.cmi \ + foSubst.cmi \ + nCicProof.cmi +nCicProof.cmx : \ + terms.cmx \ + pp.cmx \ + nCicBlob.cmx \ + foSubst.cmx \ + nCicProof.cmi +nCicProof.cmi : \ + terms.cmi +orderings.cmo : \ + terms.cmi \ + foSubst.cmi \ + orderings.cmi +orderings.cmx : \ + terms.cmx \ + foSubst.cmx \ + orderings.cmi +orderings.cmi : \ + terms.cmi +paramod.cmo : \ + terms.cmi \ + superposition.cmi \ + pp.cmi \ + orderings.cmi \ + index.cmi \ + foUtils.cmi \ + paramod.cmi +paramod.cmx : \ + terms.cmx \ + superposition.cmx \ + pp.cmx \ + orderings.cmx \ + index.cmx \ + foUtils.cmx \ + paramod.cmi +paramod.cmi : \ + terms.cmi \ + orderings.cmi +pp.cmo : \ + terms.cmi \ + pp.cmi +pp.cmx : \ + terms.cmx \ + pp.cmi +pp.cmi : \ + terms.cmi +stats.cmo : \ + terms.cmi \ + stats.cmi +stats.cmx : \ + terms.cmx \ + stats.cmi +stats.cmi : \ + terms.cmi \ + orderings.cmi +superposition.cmo : \ + terms.cmi \ + pp.cmi \ + orderings.cmi \ + index.cmi \ + foUtils.cmi \ + foUnif.cmi \ + foSubst.cmi \ + superposition.cmi +superposition.cmx : \ + terms.cmx \ + pp.cmx \ + orderings.cmx \ + index.cmx \ + foUtils.cmx \ + foUnif.cmx \ + foSubst.cmx \ + superposition.cmi +superposition.cmi : \ + terms.cmi \ + orderings.cmi \ + index.cmi +terms.cmo : \ + terms.cmi +terms.cmx : \ + terms.cmi terms.cmi : -pp.cmi : terms.cmi -foSubst.cmi : terms.cmi -orderings.cmi : terms.cmi -foUtils.cmi : terms.cmi orderings.cmi -foUnif.cmi : terms.cmi orderings.cmi -index.cmi : terms.cmi orderings.cmi -superposition.cmi : terms.cmi orderings.cmi index.cmi -stats.cmi : terms.cmi orderings.cmi -paramod.cmi : terms.cmi orderings.cmi -nCicBlob.cmi : terms.cmi -nCicProof.cmi : terms.cmi -nCicParamod.cmi : terms.cmi -terms.cmo : terms.cmi -terms.cmx : terms.cmi -pp.cmo : terms.cmi pp.cmi -pp.cmx : terms.cmx pp.cmi -foSubst.cmo : terms.cmi foSubst.cmi -foSubst.cmx : terms.cmx foSubst.cmi -orderings.cmo : terms.cmi pp.cmi foSubst.cmi orderings.cmi -orderings.cmx : terms.cmx pp.cmx foSubst.cmx orderings.cmi -foUtils.cmo : terms.cmi orderings.cmi foSubst.cmi foUtils.cmi -foUtils.cmx : terms.cmx orderings.cmx foSubst.cmx foUtils.cmi -foUnif.cmo : terms.cmi orderings.cmi foUtils.cmi foSubst.cmi foUnif.cmi -foUnif.cmx : terms.cmx orderings.cmx foUtils.cmx foSubst.cmx foUnif.cmi -index.cmo : terms.cmi pp.cmi orderings.cmi foUtils.cmi foUnif.cmi index.cmi -index.cmx : terms.cmx pp.cmx orderings.cmx foUtils.cmx foUnif.cmx index.cmi -superposition.cmo : terms.cmi pp.cmi orderings.cmi index.cmi foUtils.cmi \ - foUnif.cmi foSubst.cmi superposition.cmi -superposition.cmx : terms.cmx pp.cmx orderings.cmx index.cmx foUtils.cmx \ - foUnif.cmx foSubst.cmx superposition.cmi -stats.cmo : terms.cmi stats.cmi -stats.cmx : terms.cmx stats.cmi -paramod.cmo : terms.cmi superposition.cmi pp.cmi orderings.cmi index.cmi \ - foUtils.cmi foUnif.cmi paramod.cmi -paramod.cmx : terms.cmx superposition.cmx pp.cmx orderings.cmx index.cmx \ - foUtils.cmx foUnif.cmx paramod.cmi -nCicBlob.cmo : terms.cmi foUtils.cmi nCicBlob.cmi -nCicBlob.cmx : terms.cmx foUtils.cmx nCicBlob.cmi -nCicProof.cmo : terms.cmi pp.cmi nCicBlob.cmi foSubst.cmi nCicProof.cmi -nCicProof.cmx : terms.cmx pp.cmx nCicBlob.cmx foSubst.cmx nCicProof.cmi -nCicParamod.cmo : terms.cmi pp.cmi paramod.cmi orderings.cmi nCicProof.cmi \ - nCicBlob.cmi nCicParamod.cmi -nCicParamod.cmx : terms.cmx pp.cmx paramod.cmx orderings.cmx nCicProof.cmx \ - nCicBlob.cmx nCicParamod.cmi diff --git a/matita/components/ng_paramodulation/.depend.opt b/matita/components/ng_paramodulation/.depend.opt index 5f4f1cc56..32cbf605d 100644 --- a/matita/components/ng_paramodulation/.depend.opt +++ b/matita/components/ng_paramodulation/.depend.opt @@ -1,45 +1,98 @@ +foSubst.cmx : \ + terms.cmx \ + foSubst.cmi +foSubst.cmi : \ + terms.cmi +foUnif.cmx : \ + terms.cmx \ + orderings.cmx \ + foUtils.cmx \ + foSubst.cmx \ + foUnif.cmi +foUnif.cmi : \ + terms.cmi \ + orderings.cmi +foUtils.cmx : \ + terms.cmx \ + orderings.cmx \ + foSubst.cmx \ + foUtils.cmi +foUtils.cmi : \ + terms.cmi \ + orderings.cmi +index.cmx : \ + terms.cmx \ + orderings.cmx \ + foUtils.cmx \ + index.cmi +index.cmi : \ + terms.cmi \ + orderings.cmi +nCicBlob.cmx : \ + terms.cmx \ + foUtils.cmx \ + nCicBlob.cmi +nCicBlob.cmi : \ + terms.cmi +nCicParamod.cmx : \ + terms.cmx \ + pp.cmx \ + paramod.cmx \ + orderings.cmx \ + nCicProof.cmx \ + nCicBlob.cmx \ + nCicParamod.cmi +nCicParamod.cmi : \ + terms.cmi +nCicProof.cmx : \ + terms.cmx \ + pp.cmx \ + nCicBlob.cmx \ + foSubst.cmx \ + nCicProof.cmi +nCicProof.cmi : \ + terms.cmi +orderings.cmx : \ + terms.cmx \ + foSubst.cmx \ + orderings.cmi +orderings.cmi : \ + terms.cmi +paramod.cmx : \ + terms.cmx \ + superposition.cmx \ + pp.cmx \ + orderings.cmx \ + index.cmx \ + foUtils.cmx \ + paramod.cmi +paramod.cmi : \ + terms.cmi \ + orderings.cmi +pp.cmx : \ + terms.cmx \ + pp.cmi +pp.cmi : \ + terms.cmi +stats.cmx : \ + terms.cmx \ + stats.cmi +stats.cmi : \ + terms.cmi \ + orderings.cmi +superposition.cmx : \ + terms.cmx \ + pp.cmx \ + orderings.cmx \ + index.cmx \ + foUtils.cmx \ + foUnif.cmx \ + foSubst.cmx \ + superposition.cmi +superposition.cmi : \ + terms.cmi \ + orderings.cmi \ + index.cmi +terms.cmx : \ + terms.cmi terms.cmi : -pp.cmi : terms.cmi -foSubst.cmi : terms.cmi -orderings.cmi : terms.cmi -foUtils.cmi : terms.cmi orderings.cmi -foUnif.cmi : terms.cmi orderings.cmi -index.cmi : terms.cmi orderings.cmi -superposition.cmi : terms.cmi orderings.cmi index.cmi -stats.cmi : terms.cmi orderings.cmi -paramod.cmi : terms.cmi orderings.cmi -nCicBlob.cmi : terms.cmi -nCicProof.cmi : terms.cmi -nCicParamod.cmi : terms.cmi -terms.cmo : terms.cmi -terms.cmx : terms.cmi -pp.cmo : terms.cmi pp.cmi -pp.cmx : terms.cmx pp.cmi -foSubst.cmo : terms.cmi foSubst.cmi -foSubst.cmx : terms.cmx foSubst.cmi -orderings.cmo : terms.cmi pp.cmi foSubst.cmi orderings.cmi -orderings.cmx : terms.cmx pp.cmx foSubst.cmx orderings.cmi -foUtils.cmo : terms.cmi orderings.cmi foSubst.cmi foUtils.cmi -foUtils.cmx : terms.cmx orderings.cmx foSubst.cmx foUtils.cmi -foUnif.cmo : terms.cmi orderings.cmi foUtils.cmi foSubst.cmi foUnif.cmi -foUnif.cmx : terms.cmx orderings.cmx foUtils.cmx foSubst.cmx foUnif.cmi -index.cmo : terms.cmi pp.cmi orderings.cmi foUtils.cmi foUnif.cmi index.cmi -index.cmx : terms.cmx pp.cmx orderings.cmx foUtils.cmx foUnif.cmx index.cmi -superposition.cmo : terms.cmi pp.cmi orderings.cmi index.cmi foUtils.cmi \ - foUnif.cmi foSubst.cmi superposition.cmi -superposition.cmx : terms.cmx pp.cmx orderings.cmx index.cmx foUtils.cmx \ - foUnif.cmx foSubst.cmx superposition.cmi -stats.cmo : terms.cmi stats.cmi -stats.cmx : terms.cmx stats.cmi -paramod.cmo : terms.cmi superposition.cmi pp.cmi orderings.cmi index.cmi \ - foUtils.cmi foUnif.cmi paramod.cmi -paramod.cmx : terms.cmx superposition.cmx pp.cmx orderings.cmx index.cmx \ - foUtils.cmx foUnif.cmx paramod.cmi -nCicBlob.cmo : terms.cmi foUtils.cmi nCicBlob.cmi -nCicBlob.cmx : terms.cmx foUtils.cmx nCicBlob.cmi -nCicProof.cmo : terms.cmi pp.cmi nCicBlob.cmi foSubst.cmi nCicProof.cmi -nCicProof.cmx : terms.cmx pp.cmx nCicBlob.cmx foSubst.cmx nCicProof.cmi -nCicParamod.cmo : terms.cmi pp.cmi paramod.cmi orderings.cmi nCicProof.cmi \ - nCicBlob.cmi nCicParamod.cmi -nCicParamod.cmx : terms.cmx pp.cmx paramod.cmx orderings.cmx nCicProof.cmx \ - nCicBlob.cmx nCicParamod.cmi diff --git a/matita/components/ng_paramodulation/foUnif.ml b/matita/components/ng_paramodulation/foUnif.ml index 0946873b9..c6d130512 100644 --- a/matita/components/ng_paramodulation/foUnif.ml +++ b/matita/components/ng_paramodulation/foUnif.ml @@ -58,12 +58,12 @@ module Founif (B : Orderings.Blob) = struct Subst.build_subst i t subst | Terms.Var i, t when occurs_check subst i t -> raise (UnificationFailure (lazy "Inference.unification.unif")) - | Terms.Var i, t when (List.mem i locked_vars) -> + | Terms.Var i, _t when (List.mem i locked_vars) -> raise (UnificationFailure (lazy "Inference.unification.unif")) | Terms.Var i, t -> Subst.build_subst i t subst | t, Terms.Var i when occurs_check subst i t -> raise (UnificationFailure (lazy "Inference.unification.unif")) - | t, Terms.Var i when (List.mem i locked_vars) -> + | _t, Terms.Var i when (List.mem i locked_vars) -> raise (UnificationFailure (lazy "Inference.unification.unif")) | t, Terms.Var i -> Subst.build_subst i t subst | Terms.Node l1, Terms.Node l2 -> ( @@ -90,7 +90,7 @@ module Founif (B : Orderings.Blob) = struct in match s, t with | s, t when U.eq_foterm s t -> subst - | Terms.Var i, Terms.Var j + | Terms.Var i, Terms.Var _j when (not (List.exists (fun (_,k) -> k=t) subst)) -> let subst = Subst.build_subst i t subst in subst diff --git a/matita/components/ng_paramodulation/index.ml b/matita/components/ng_paramodulation/index.ml index 49af5e089..c1e12a34d 100644 --- a/matita/components/ng_paramodulation/index.ml +++ b/matita/components/ng_paramodulation/index.ml @@ -13,8 +13,8 @@ module Index(B : Orderings.Blob) = struct module U = FoUtils.Utils(B) - module Unif = FoUnif.Founif(B) - module Pp = Pp.Pp(B) + (*module Unif = FoUnif.Founif(B)*) + (*module Pp = Pp.Pp(B)*) module ClauseOT = struct @@ -44,7 +44,7 @@ module Index(B : Orderings.Blob) = struct let path_string_of = let rec aux arity = function | Terms.Leaf a -> [Constant (a, arity)] - | Terms.Var i -> (* assert (arity = 0); *) [Variable] + | Terms.Var _i -> (* assert (arity = 0); *) [Variable] (* FIXME : should this be allowed or not ? | Terms.Node (Terms.Var _::_) -> assert false *) @@ -87,12 +87,12 @@ module Index(B : Orderings.Blob) = struct op t l (Terms.Left2Right, c) | (_,Terms.Equation (_,r,_,Terms.Lt),_,_) as c -> op t r (Terms.Right2Left, c) - | (_,Terms.Equation (l,r,_,Terms.Incomparable),vl,_) as c -> + | (_,Terms.Equation (l,r,_,Terms.Incomparable),_vl,_) as c -> op (op t l (Terms.Left2Right, c)) r (Terms.Right2Left, c) - | (_,Terms.Equation (l,r,_,Terms.Invertible),vl,_) as c -> + | (_,Terms.Equation (l,_r,_,Terms.Invertible),_vl,_) as c -> op t l (Terms.Left2Right, c) - | (_,Terms.Equation (_,r,_,Terms.Eq),_,_) -> assert false + | (_,Terms.Equation (_,_r,_,Terms.Eq),_,_) -> assert false | (_,Terms.Predicate p,_,_) as c -> op t p (Terms.Nodir, c) ;; diff --git a/matita/components/ng_paramodulation/nCicBlob.ml b/matita/components/ng_paramodulation/nCicBlob.ml index be5158452..b1f2cfa6f 100644 --- a/matita/components/ng_paramodulation/nCicBlob.ml +++ b/matita/components/ng_paramodulation/nCicBlob.ml @@ -55,10 +55,10 @@ with type t = NCic.term and type input = NCic.term = struct | NReference.Fix(_,_,h) -> h | _ -> 0 -external old_hash_param : - int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc";; + external old_hash_param : + int -> int -> 'a -> int = "caml_hash_univ_param" (*[@@noalloc]*);; -let old_hash = old_hash_param 10 100;; + let old_hash = old_hash_param 10 100;; let compare_refs (NReference.Ref (u1,r1)) (NReference.Ref (u2,r2)) = let x = height_of_ref r2 - height_of_ref r1 in diff --git a/matita/components/ng_paramodulation/nCicParamod.ml b/matita/components/ng_paramodulation/nCicParamod.ml index 199e101fa..1827d8098 100644 --- a/matita/components/ng_paramodulation/nCicParamod.ml +++ b/matita/components/ng_paramodulation/nCicParamod.ml @@ -205,7 +205,7 @@ let is_equation status metasenv subst context ty = NCicMetaSubst.saturate status ~delta:0 metasenv subst context ty 0 in match hty with - | NCic.Appl (eq ::tl) when eq = CB.eqP -> true + | NCic.Appl (eq ::_) when eq = CB.eqP -> true | _ -> false ;; diff --git a/matita/components/ng_paramodulation/nCicProof.ml b/matita/components/ng_paramodulation/nCicProof.ml index 60f2cbafc..f34b35748 100644 --- a/matita/components/ng_paramodulation/nCicProof.ml +++ b/matita/components/ng_paramodulation/nCicProof.ml @@ -131,7 +131,7 @@ let debug c _ = c;; NCic.Implicit `Term; eq; NCic.Implicit `Term]; ;; - let trans eq p = + let trans eq _p = let u= NUri.uri_of_string "cic:/matita/ng/properties/relations/trans.con" in let u = NReference.reference_of_spec u (NReference.Fix(0,1,3)) in NCic.Appl[NCic.Const u; NCic.Implicit `Type; NCic.Implicit `Term; @@ -180,7 +180,7 @@ let debug c _ = c;; List.fold_left (fun (i,acc) t -> i+1, - let f = extract status amount vl f in + let _f = extract status amount vl f in if i = n then let imp = NCic.Implicit `Term in NCic.Appl (dag::imp::imp::imp(* f *)::imp::imp:: @@ -201,15 +201,15 @@ let debug c _ = c;; let module Pp = Pp.Pp(NCicBlob) in let module Subst = FoSubst in - let compose subst1 subst2 = + (*let compose subst1 subst2 = let s1 = List.map (fun (x,t) -> (x, Subst.apply_subst subst2 t)) subst1 in let s2 = List.filter (fun (m,_) -> not (List.mem_assoc m s1)) subst2 in s1 @ s2 - in + in*) let position i l = let rec aux = function | [] -> assert false - | (j,_) :: tl when i = j -> 1 + | (j,_) :: _ when i = j -> 1 | _ :: tl -> 1 + aux tl in aux l @@ -287,7 +287,7 @@ let debug c _ = c;; (* prerr_endline (if ongoal then "on goal" else "not on goal"); prerr_endline (Pp.pp_substitution subst); *) (* let subst = if ongoal then res_subst else subst in *) - let id, id1,(lit,vl,proof) = + let id, id1,(lit,vl,_proof) = if ongoal then let lit,vl,proof = get_literal id1 in id1,id,(Subst.apply_subst res_subst lit, diff --git a/matita/components/ng_paramodulation/orderings.ml b/matita/components/ng_paramodulation/orderings.ml index d24a5742e..d5f35a3a3 100644 --- a/matita/components/ng_paramodulation/orderings.ml +++ b/matita/components/ng_paramodulation/orderings.ml @@ -131,8 +131,8 @@ let compare_weights (h1, w1) (h2, w2) = if var1 = var2 then let diffs = (w1 - w2) + diffs in let r = Pervasives.compare w1 w2 in - let lt = lt or (r < 0) in - let gt = gt or (r > 0) in + let lt = lt || (r < 0) in + let gt = gt || (r > 0) in if lt && gt then XINCOMPARABLE else aux hdiff (lt, gt) diffs tl1 tl2 else if var1 < var2 then @@ -208,7 +208,7 @@ module NRKBO (B : Terms.Blob) = struct let name = "nrkbo" include B - module Pp = Pp.Pp(B) + (*module Pp = Pp.Pp(B)*) let eq_foterm = eq_foterm B.eq;; @@ -224,7 +224,7 @@ exception UnificationFailure of string Lazy.t;; in match s, t with | s, t when eq_foterm s t -> subst - | Terms.Var i, Terms.Var j + | Terms.Var i, Terms.Var _j when (not (List.exists (fun (_,k) -> k=t) subst)) -> let subst = FoSubst.build_subst i t subst in subst @@ -290,7 +290,7 @@ module KBO (B : Terms.Blob) = struct let name = "kbo" include B - module Pp = Pp.Pp(B) + (*module Pp = Pp.Pp(B)*) let eq_foterm = eq_foterm B.eq;; @@ -356,7 +356,7 @@ module LPO (B : Terms.Blob) = struct let name = "lpo" include B - module Pp = Pp.Pp(B) + (*module Pp = Pp.Pp(B)*) let eq_foterm = eq_foterm B.eq;; diff --git a/matita/components/ng_paramodulation/paramod.ml b/matita/components/ng_paramodulation/paramod.ml index 66a801187..e38179c77 100644 --- a/matita/components/ng_paramodulation/paramod.ml +++ b/matita/components/ng_paramodulation/paramod.ml @@ -12,7 +12,7 @@ (* $Id: orderings.ml 9869 2009-06-11 22:52:38Z denes $ *) let print s = prerr_endline (Lazy.force s) ;; -let noprint s = ();; +let noprint _s = ();; let debug = noprint;; let monster = 100;; @@ -65,7 +65,7 @@ module type Paramod = module Paramod (B : Orderings.Blob) = struct module Pp = Pp.Pp (B) - module FU = FoUnif.Founif(B) + (*module FU = FoUnif.Founif(B)*) module IDX = Index.Index(B) module Sup = Superposition.Superposition(B) module Utils = FoUtils.Utils(B) @@ -363,7 +363,7 @@ module Paramod (B : Orderings.Blob) = struct debug (lazy("Last chance " ^ string_of_float (Unix.gettimeofday()))); let actives_l, active_t = actives in - let passive_t,wset,_ = passives in + let passive_t,_wset,_ = passives in let _ = noprint (lazy ("Actives :" ^ (String.concat ";\n" @@ -493,8 +493,8 @@ module Paramod (B : Orderings.Blob) = struct let newstatus = List.fold_left (fun acc g -> - let bag,maxvar,actives,passives,g_actives,g_passives = acc in - let g_passives = + let _bag,_maxvar,_actives,_passives,_g_actives,g_passives = acc in + let _g_passives = remove_passive_goal g_passives g in let current = snd g in let _ = @@ -511,7 +511,7 @@ module Paramod (B : Orderings.Blob) = struct let l = let rec traverse ongoal (accg,acce) i = match Terms.get_from_bag i bag with - | (id,_,_,Terms.Exact _),_,_ -> + | (_id,_,_,Terms.Exact _),_,_ -> if ongoal then [i],acce else if (List.mem i acce) then accg,acce else accg,acce@[i] | (_,_,_,Terms.Step (_,i1,i2,_,_,_)),_,_ -> @@ -573,8 +573,8 @@ module Paramod (B : Orderings.Blob) = struct ;; let demod s goal = - let bag,maxvar,actives,passives,g_actives,g_passives = s in - let (bag,maxvar), g = mk_goal (bag,maxvar) goal in + let bag,maxvar,actives,_passives,_g_actives,_g_passives = s in + let (bag,_maxvar), g = mk_goal (bag,maxvar) goal in let bag, ((i,_,_,_) as g1) = Sup.demodulate bag g (snd actives) in if g1 = g then GaveUp else compute_result bag i [] (* @@ -584,7 +584,7 @@ let demod s goal = let fast_eq_check s goal = let (_,_,_,_,_,g_passives) as s = initialize_goal s goal in - if is_passive_g_set_empty g_passives then Error "not an equation" + if is_passive_g_set_empty g_passives then (Error "not an equation" : szsontology) else try goal_narrowing 0 2 None s @@ -598,7 +598,7 @@ let fast_eq_check s goal = let nparamod ~useage ~max_steps ?timeout s goal = let bag,maxvar,actives,passives,g_actives,g_passives = initialize_goal s goal in - if is_passive_g_set_empty g_passives then Error "not an equation" + if is_passive_g_set_empty g_passives then (Error "not an equation" : szsontology) else try given_clause ~useage ~noinfer:false bag maxvar 0 0 max_steps timeout actives passives g_actives g_passives diff --git a/matita/components/ng_paramodulation/pp.ml b/matita/components/ng_paramodulation/pp.ml index 64af9ab17..3f2a5cecc 100644 --- a/matita/components/ng_paramodulation/pp.ml +++ b/matita/components/ng_paramodulation/pp.ml @@ -70,7 +70,7 @@ let pp_proof bag ~formatter:f p = Format.fprintf f "%d: Exact (" eq; pp_foterm f t; Format.fprintf f ")@;"; - | Terms.Step (rule,eq1,eq2,dir,pos,subst) -> + | Terms.Step (rule,eq1,eq2,dir,_pos,_subst) -> Format.fprintf f "%d: %s(" eq (string_of_rule rule); Format.fprintf f "|%d with %d dir %s))" eq1 eq2 diff --git a/matita/components/ng_paramodulation/stats.ml b/matita/components/ng_paramodulation/stats.ml index fd68f0fe7..da00eb551 100644 --- a/matita/components/ng_paramodulation/stats.ml +++ b/matita/components/ng_paramodulation/stats.ml @@ -115,8 +115,8 @@ module Stats (B : Terms.Blob) = else dependencies op tl acc else dependencies op tl acc - | ((Terms.Node (Terms.Leaf op1::t) as x),y) - | (y,(Terms.Node (Terms.Leaf op1::t) as x)) when leaf_count x > leaf_count y -> + | ((Terms.Node (Terms.Leaf op1::_t) as x),y) + | (y,(Terms.Node (Terms.Leaf op1::_t) as x)) when leaf_count x > leaf_count y -> let rec term_leaves = function | Terms.Node l -> List.fold_left (fun acc x -> acc @ (term_leaves x)) [] l | Terms.Leaf x -> [x] diff --git a/matita/components/ng_paramodulation/superposition.ml b/matita/components/ng_paramodulation/superposition.ml index 13b876bed..801e56b26 100644 --- a/matita/components/ng_paramodulation/superposition.ml +++ b/matita/components/ng_paramodulation/superposition.ml @@ -111,7 +111,7 @@ module Superposition (B : Orderings.Blob) = | Terms.Leaf _ as t -> let bag,subst,t,id = f bag t pos ctx id in assert (subst=[]); bag,t,id - | Terms.Var i as t -> + | Terms.Var _ as t -> let t= Subst.apply_subst subst t in bag,t,id | Terms.Node (hd::l) -> @@ -181,7 +181,7 @@ module Superposition (B : Orderings.Blob) = (IDX.DT.retrieve_generalizations table) subterm in list_first - (fun (dir, (id,lit,vl,_)) -> + (fun (dir, (id,lit,_vl,_)) -> match lit with | Terms.Predicate _ -> assert false | Terms.Equation (l,r,_,o) -> @@ -227,7 +227,7 @@ module Superposition (B : Orderings.Blob) = (IDX.DT.retrieve_generalizations table) subterm in list_first - (fun (dir, ((id,lit,vl,_) as c)) -> + (fun (dir, ((id,lit,_vl,_) as c)) -> debug (lazy("candidate: " ^ Pp.pp_unit_clause c)); match lit with @@ -280,7 +280,7 @@ module Superposition (B : Orderings.Blob) = (bag,subst,newside,id) ;; - let rec demodulate bag (id, literal, vl, pr) table = + let demodulate bag (id, literal, vl, _pr) table = debug (lazy ("demodulate " ^ (string_of_int id))); match literal with | Terms.Predicate t -> (* assert false *) @@ -341,7 +341,7 @@ module Superposition (B : Orderings.Blob) = let is_identity_goal = function | _, Terms.Equation (_,_,_,Terms.Eq), _, _ -> Some [] - | _, Terms.Equation (l,r,_,_), vl, proof -> + | _, Terms.Equation (l,r,_,_), _vl, _proof -> (try Some (Unif.unification (* vl *) [] l r) with FoUnif.UnificationFailure _ -> None) | _, Terms.Predicate _, _, _ -> assert false @@ -389,7 +389,7 @@ module Superposition (B : Orderings.Blob) = let f b c = let id, dir, l, r, vl = match c with - | (d, (id,Terms.Equation (l,r,ty,_),vl,_))-> id, d, l, r, vl + | (d, (id,Terms.Equation (l,r,_ty,_),vl,_))-> id, d, l, r, vl |_ -> assert false in let reverse = (dir = Terms.Left2Right) = b in @@ -508,7 +508,7 @@ module Superposition (B : Orderings.Blob) = let rec orphan_murder bag acc i = match Terms.get_from_bag i bag with | (_,_,_,Terms.Exact _),discarded,_ -> (discarded,acc) - | (_,_,_,Terms.Step (_,i1,i2,_,_,_)),true,_ -> (true,acc) + | (_,_,_,Terms.Step (_,_i1,_i2,_,_,_)),true,_ -> (true,acc) | (_,_,_,Terms.Step (_,i1,i2,_,_,_)),false,_ -> if (List.mem i acc) then (false,acc) else match orphan_murder bag acc i1 with @@ -570,7 +570,7 @@ module Superposition (B : Orderings.Blob) = match simplify ctable maxvar bag c with |bag,None -> (bag,alist,atable) (* an active clause as been discarded *) - |bag,Some c1 -> + |bag,Some _c1 -> bag, c :: alist, IDX.index_unit_clause atable c) (bag,[],IDX.DT.empty) alist in @@ -671,7 +671,7 @@ module Superposition (B : Orderings.Blob) = else match (is_identity_goal clause) with | Some subst -> raise (Success (bag,maxvar,clause,subst)) | None -> - let (id,lit,vl,_) = clause in + let (_id,lit,vl,_) = clause in (* this optimization makes sense only if we demodulated, since in that case the clause should have been turned into an identity *) if (vl = [] && not(no_demod)) @@ -706,10 +706,10 @@ module Superposition (B : Orderings.Blob) = (* =================== inference ===================== *) (* this is OK for both the sup_left and sup_right inference steps *) - let superposition table varlist subterm pos context = + let superposition table _varlist subterm pos context = let cands = IDX.DT.retrieve_unifiables table subterm in HExtlib.filter_map - (fun (dir, (id,lit,vl,_ (*as uc*))) -> + (fun (dir, (id,lit,_vl,_ (*as uc*))) -> match lit with | Terms.Predicate _ -> assert false | Terms.Equation (l,r,_,o) -> diff --git a/matita/components/ng_refiner/.depend b/matita/components/ng_refiner/.depend index d8295760a..6d211ffe5 100644 --- a/matita/components/ng_refiner/.depend +++ b/matita/components/ng_refiner/.depend @@ -1,27 +1,62 @@ -nDiscriminationTree.cmi : +nCicCoercion.cmo : \ + nDiscriminationTree.cmi \ + nCicUnifHint.cmi \ + nCicMetaSubst.cmi \ + nCicCoercion.cmi +nCicCoercion.cmx : \ + nDiscriminationTree.cmx \ + nCicUnifHint.cmx \ + nCicMetaSubst.cmx \ + nCicCoercion.cmi +nCicCoercion.cmi : \ + nCicUnifHint.cmi +nCicMetaSubst.cmo : \ + nCicMetaSubst.cmi +nCicMetaSubst.cmx : \ + nCicMetaSubst.cmi nCicMetaSubst.cmi : -nCicUnifHint.cmi : -nCicCoercion.cmi : nCicUnifHint.cmi +nCicRefineUtil.cmo : \ + nCicMetaSubst.cmi \ + nCicRefineUtil.cmi +nCicRefineUtil.cmx : \ + nCicMetaSubst.cmx \ + nCicRefineUtil.cmi nCicRefineUtil.cmi : -nCicUnification.cmi : nCicCoercion.cmi -nCicRefiner.cmi : nCicCoercion.cmi -nDiscriminationTree.cmo : nDiscriminationTree.cmi -nDiscriminationTree.cmx : nDiscriminationTree.cmi -nCicMetaSubst.cmo : nCicMetaSubst.cmi -nCicMetaSubst.cmx : nCicMetaSubst.cmi -nCicUnifHint.cmo : nDiscriminationTree.cmi nCicMetaSubst.cmi \ +nCicRefiner.cmo : \ + nCicUnification.cmi \ + nCicRefineUtil.cmi \ + nCicMetaSubst.cmi \ + nCicCoercion.cmi \ + nCicRefiner.cmi +nCicRefiner.cmx : \ + nCicUnification.cmx \ + nCicRefineUtil.cmx \ + nCicMetaSubst.cmx \ + nCicCoercion.cmx \ + nCicRefiner.cmi +nCicRefiner.cmi : \ + nCicCoercion.cmi +nCicUnifHint.cmo : \ + nDiscriminationTree.cmi \ + nCicMetaSubst.cmi \ nCicUnifHint.cmi -nCicUnifHint.cmx : nDiscriminationTree.cmx nCicMetaSubst.cmx \ +nCicUnifHint.cmx : \ + nDiscriminationTree.cmx \ + nCicMetaSubst.cmx \ nCicUnifHint.cmi -nCicCoercion.cmo : nDiscriminationTree.cmi nCicUnifHint.cmi \ - nCicMetaSubst.cmi nCicCoercion.cmi -nCicCoercion.cmx : nDiscriminationTree.cmx nCicUnifHint.cmx \ - nCicMetaSubst.cmx nCicCoercion.cmi -nCicRefineUtil.cmo : nCicMetaSubst.cmi nCicRefineUtil.cmi -nCicRefineUtil.cmx : nCicMetaSubst.cmx nCicRefineUtil.cmi -nCicUnification.cmo : nCicUnifHint.cmi nCicMetaSubst.cmi nCicUnification.cmi -nCicUnification.cmx : nCicUnifHint.cmx nCicMetaSubst.cmx nCicUnification.cmi -nCicRefiner.cmo : nCicUnification.cmi nCicRefineUtil.cmi nCicMetaSubst.cmi \ - nCicCoercion.cmi nCicRefiner.cmi -nCicRefiner.cmx : nCicUnification.cmx nCicRefineUtil.cmx nCicMetaSubst.cmx \ - nCicCoercion.cmx nCicRefiner.cmi +nCicUnifHint.cmi : +nCicUnification.cmo : \ + nCicUnifHint.cmi \ + nCicMetaSubst.cmi \ + nCicUnification.cmi +nCicUnification.cmx : \ + nCicUnifHint.cmx \ + nCicMetaSubst.cmx \ + nCicUnification.cmi +nCicUnification.cmi : \ + nCicCoercion.cmi +nDiscriminationTree.cmo : \ + nDiscriminationTree.cmi +nDiscriminationTree.cmx : \ + nDiscriminationTree.cmi +nDiscriminationTree.cmi : diff --git a/matita/components/ng_refiner/.depend.opt b/matita/components/ng_refiner/.depend.opt index d8295760a..a25cbdb11 100644 --- a/matita/components/ng_refiner/.depend.opt +++ b/matita/components/ng_refiner/.depend.opt @@ -1,27 +1,36 @@ -nDiscriminationTree.cmi : +nCicCoercion.cmx : \ + nDiscriminationTree.cmx \ + nCicUnifHint.cmx \ + nCicMetaSubst.cmx \ + nCicCoercion.cmi +nCicCoercion.cmi : \ + nCicUnifHint.cmi +nCicMetaSubst.cmx : \ + nCicMetaSubst.cmi nCicMetaSubst.cmi : -nCicUnifHint.cmi : -nCicCoercion.cmi : nCicUnifHint.cmi +nCicRefineUtil.cmx : \ + nCicMetaSubst.cmx \ + nCicRefineUtil.cmi nCicRefineUtil.cmi : -nCicUnification.cmi : nCicCoercion.cmi -nCicRefiner.cmi : nCicCoercion.cmi -nDiscriminationTree.cmo : nDiscriminationTree.cmi -nDiscriminationTree.cmx : nDiscriminationTree.cmi -nCicMetaSubst.cmo : nCicMetaSubst.cmi -nCicMetaSubst.cmx : nCicMetaSubst.cmi -nCicUnifHint.cmo : nDiscriminationTree.cmi nCicMetaSubst.cmi \ +nCicRefiner.cmx : \ + nCicUnification.cmx \ + nCicRefineUtil.cmx \ + nCicMetaSubst.cmx \ + nCicCoercion.cmx \ + nCicRefiner.cmi +nCicRefiner.cmi : \ + nCicCoercion.cmi +nCicUnifHint.cmx : \ + nDiscriminationTree.cmx \ + nCicMetaSubst.cmx \ nCicUnifHint.cmi -nCicUnifHint.cmx : nDiscriminationTree.cmx nCicMetaSubst.cmx \ - nCicUnifHint.cmi -nCicCoercion.cmo : nDiscriminationTree.cmi nCicUnifHint.cmi \ - nCicMetaSubst.cmi nCicCoercion.cmi -nCicCoercion.cmx : nDiscriminationTree.cmx nCicUnifHint.cmx \ - nCicMetaSubst.cmx nCicCoercion.cmi -nCicRefineUtil.cmo : nCicMetaSubst.cmi nCicRefineUtil.cmi -nCicRefineUtil.cmx : nCicMetaSubst.cmx nCicRefineUtil.cmi -nCicUnification.cmo : nCicUnifHint.cmi nCicMetaSubst.cmi nCicUnification.cmi -nCicUnification.cmx : nCicUnifHint.cmx nCicMetaSubst.cmx nCicUnification.cmi -nCicRefiner.cmo : nCicUnification.cmi nCicRefineUtil.cmi nCicMetaSubst.cmi \ - nCicCoercion.cmi nCicRefiner.cmi -nCicRefiner.cmx : nCicUnification.cmx nCicRefineUtil.cmx nCicMetaSubst.cmx \ - nCicCoercion.cmx nCicRefiner.cmi +nCicUnifHint.cmi : +nCicUnification.cmx : \ + nCicUnifHint.cmx \ + nCicMetaSubst.cmx \ + nCicUnification.cmi +nCicUnification.cmi : \ + nCicCoercion.cmi +nDiscriminationTree.cmx : \ + nDiscriminationTree.cmi +nDiscriminationTree.cmi : diff --git a/matita/components/ng_refiner/Makefile b/matita/components/ng_refiner/Makefile index 79871a567..612078e3e 100644 --- a/matita/components/ng_refiner/Makefile +++ b/matita/components/ng_refiner/Makefile @@ -14,9 +14,6 @@ IMPLEMENTATION_FILES = \ $(INTERFACE_FILES:%.mli=%.ml) EXTRA_OBJECTS_TO_INSTALL = EXTRA_OBJECTS_TO_CLEAN = -%.cmo: OCAMLOPTIONS += -w Ae -%.cmi: OCAMLOPTIONS += -w Ae -%.cmx: OCAMLOPTIONS += -w Ae include ../../Makefile.defs include ../Makefile.common diff --git a/matita/components/ng_refiner/nCicMetaSubst.ml b/matita/components/ng_refiner/nCicMetaSubst.ml index 0207c9231..beeeeeb6b 100644 --- a/matita/components/ng_refiner/nCicMetaSubst.ml +++ b/matita/components/ng_refiner/nCicMetaSubst.ml @@ -53,7 +53,7 @@ let newmeta,maxmeta,pushmaxmeta,popmaxmeta = (fun () -> incr maxmeta; !maxmeta), (fun () -> !maxmeta), (fun () -> pushedmetas := !maxmeta::!pushedmetas; maxmeta := 0), - (fun () -> match !pushedmetas with [] -> assert false | hd::tl -> pushedmetas := tl) + (fun () -> match !pushedmetas with [] -> assert false | _hd::tl -> pushedmetas := tl) ;; exception NotFound of [`NotInTheList | `NotWellTyped];; @@ -525,8 +525,7 @@ let delift status ~unify metasenv subst context n l t = raise (NotFound `NotWellTyped) | TypeNotGood | NCicTypeChecker.AssertFailure _ - | NCicReduction.AssertFailure _ - | NCicTypeChecker.TypeCheckerFailure _ -> + | NCicReduction.AssertFailure _ -> raise (NotFound `NotWellTyped)) with NotFound reason -> (* This is the case where we fail even first order unification. *) diff --git a/matita/components/ng_refiner/nCicRefineUtil.ml b/matita/components/ng_refiner/nCicRefineUtil.ml index 30ae05577..508e891f3 100644 --- a/matita/components/ng_refiner/nCicRefineUtil.ml +++ b/matita/components/ng_refiner/nCicRefineUtil.ml @@ -25,8 +25,8 @@ (* $Id: cicUtil.ml 10153 2009-07-28 15:17:51Z sacerdot $ *) -exception Meta_not_found of int -exception Subst_not_found of int +(*exception Meta_not_found of int +exception Subst_not_found of int*) (* syntactic_equality up to the *) (* distinction between fake dependent products *) diff --git a/matita/components/ng_refiner/nCicRefiner.ml b/matita/components/ng_refiner/nCicRefiner.ml index 15fcc069a..0523ef8b2 100644 --- a/matita/components/ng_refiner/nCicRefiner.ml +++ b/matita/components/ng_refiner/nCicRefiner.ml @@ -608,15 +608,15 @@ and try_coercions status pp (lazy "WWW: trying coercions -- inner check"); match infty, expty, t with (* `XTSort|`XTProd|`XTInd + Match not implemented *) - | _,`XTSome expty, C.Match (Ref.Ref (_,Ref.Ind (_,tyno,leftno)) as r,outty,m,pl) -> + | _,`XTSome expty, C.Match (Ref.Ref (_,Ref.Ind (_,_tyno,_leftno)) as r,outty,m,pl) -> (*{{{*) pp (lazy "CASE"); (* {{{ helper functions *) let get_cl_and_left_p refit outty = match refit with - | Ref.Ref (uri, Ref.Ind (_,tyno,leftno)) -> + | Ref.Ref (_uri, Ref.Ind (_,tyno,_leftno)) -> let _, leftno, itl, _, _ = NCicEnvironment.get_checked_indtys status r in let _, _, ty, cl = List.nth itl tyno in - let constructorsno = List.length cl in + (*let constructorsno = List.length cl in*) let count_pis t = let rec aux ctx t = match NCicReduction.whd status ~subst ~delta:max_int ctx t with @@ -700,7 +700,7 @@ and try_coercions status (NCicSubstitution.lift status 1 mty) (NCicSubstitution.lift status 1 m) tgt in C.Prod (name, src, t), k - | C.Const (Ref.Ref (_,Ref.Ind (_,_,leftno)) as r) -> + | C.Const (Ref.Ref (_,Ref.Ind (_,_,_leftno)) as r) -> let k = let k = C.Const(Ref.mk_constructor i r) in NCicUntrusted.mk_appl k par @@ -716,8 +716,8 @@ and try_coercions status (NCicReduction.head_beta_reduce status ~delta:max_int (NCicUntrusted.mk_appl outty [k])))),[mty,m,mty,k] | C.Appl (C.Const (Ref.Ref (_,Ref.Ind (_,_,leftno)) as r)::pl) -> - let left_p,right_p = HExtlib.split_nth leftno pl in - let has_rights = right_p <> [] in + let left_p,_right_p = HExtlib.split_nth leftno pl in + (*let has_rights = right_p <> [] in*) let k = let k = C.Const(Ref.mk_constructor i r) in NCicUntrusted.mk_appl k (left_p@par) @@ -819,7 +819,7 @@ and try_coercions status in (* }}} end helper functions *) (* constructors types with left params already instantiated *) let outty = NCicUntrusted.apply_subst status subst context outty in - let cl, left_p, leftno,rno = + let cl, _left_p, leftno,rno = get_cl_and_left_p r outty in let right_p, mty = @@ -930,7 +930,7 @@ and try_coercions status pp (lazy ("LAM: coerced = " ^ status#ppterm ~metasenv ~subst ~context coerced)); metasenv, subst, coerced, expty (*}}}*) | _ -> raise exc - with exc2 -> + with _ -> let expty = match expty with `XTSome expty -> expty @@ -1312,7 +1312,7 @@ let typeof_obj let rec aux context (metasenv,subst) = function | C.Meta _ -> metasenv, subst | C.Implicit _ -> metasenv, subst - | C.Appl (C.Rel i :: args) as t + | C.Appl (C.Rel i :: args) when i > List.length context - len -> let lefts, _ = HExtlib.split_nth leftno args in let ctxlen = List.length context in diff --git a/matita/components/ng_refiner/nCicUnifHint.ml b/matita/components/ng_refiner/nCicUnifHint.ml index a0d767c3a..5c7f92f99 100644 --- a/matita/components/ng_refiner/nCicUnifHint.ml +++ b/matita/components/ng_refiner/nCicUnifHint.ml @@ -332,8 +332,8 @@ let look_for_hint (status:#status) metasenv subst context t1 t2 = end ;; -let pp_hint t p = - let context, t = +let pp_hint _t _p = +(* let context, t = let rec aux ctx = function | NCic.Prod (name, ty, rest) -> aux ((name, NCic.Decl ty) :: ctx) rest | t -> ctx, t @@ -349,7 +349,6 @@ let pp_hint t p = in let buff = Buffer.create 100 in let fmt = Format.formatter_of_buffer buff in -(* F.fprintf "@[" F.fprintf "@[" (* pp_ctx [] context *) @@ -405,9 +404,9 @@ let generate_dot_file (status:#status) fmt = (HintSet.elements dataset); ); List.iter (fun x, l -> Pp.node x ~attrs:["label",l] fmt) !nodes; - List.iter (fun x, y, l, _, _ -> + List.iter (fun x, y, _l, _, _ -> Pp.raw (Printf.sprintf "%s -- %s [ label=\"%s\" ];\n" x y "?") fmt) !edges; edges := List.sort (fun (_,_,_,p1,_) (_,_,_,p2,_) -> p1 - p2) !edges; - List.iter (fun x, y, _, p, l -> pp_hint l p) !edges; + List.iter (fun _x, _y, _, p, l -> pp_hint l p) !edges; ;; diff --git a/matita/components/ng_tactics/.depend b/matita/components/ng_tactics/.depend index 57784f373..4d386aaa4 100644 --- a/matita/components/ng_tactics/.depend +++ b/matita/components/ng_tactics/.depend @@ -1,35 +1,94 @@ -continuationals.cmo : continuationals.cmi -continuationals.cmx : continuationals.cmi +continuationals.cmo : \ + continuationals.cmi +continuationals.cmx : \ + continuationals.cmi continuationals.cmi : -declarative.cmo : nnAuto.cmi nTactics.cmi nTacStatus.cmi nCicElim.cmi \ - continuationals.cmi declarative.cmi -declarative.cmx : nnAuto.cmx nTactics.cmx nTacStatus.cmx nCicElim.cmx \ - continuationals.cmx declarative.cmi -declarative.cmi : nnAuto.cmi nTacStatus.cmi -nCicElim.cmo : nCicElim.cmi -nCicElim.cmx : nCicElim.cmi +declarative.cmo : \ + nnAuto.cmi \ + nTactics.cmi \ + nTacStatus.cmi \ + nCicElim.cmi \ + continuationals.cmi \ + declarative.cmi +declarative.cmx : \ + nnAuto.cmx \ + nTactics.cmx \ + nTacStatus.cmx \ + nCicElim.cmx \ + continuationals.cmx \ + declarative.cmi +declarative.cmi : \ + nnAuto.cmi \ + nTacStatus.cmi +nCicElim.cmo : \ + nCicElim.cmi +nCicElim.cmx : \ + nCicElim.cmi nCicElim.cmi : -nCicTacReduction.cmo : nCicTacReduction.cmi -nCicTacReduction.cmx : nCicTacReduction.cmi +nCicTacReduction.cmo : \ + nCicTacReduction.cmi +nCicTacReduction.cmx : \ + nCicTacReduction.cmi nCicTacReduction.cmi : -nDestructTac.cmo : nTactics.cmi nTacStatus.cmi continuationals.cmi \ +nDestructTac.cmo : \ + nTactics.cmi \ + nTacStatus.cmi \ + continuationals.cmi \ nDestructTac.cmi -nDestructTac.cmx : nTactics.cmx nTacStatus.cmx continuationals.cmx \ +nDestructTac.cmx : \ + nTactics.cmx \ + nTacStatus.cmx \ + continuationals.cmx \ nDestructTac.cmi -nDestructTac.cmi : nTacStatus.cmi -nInversion.cmo : nTactics.cmi nTacStatus.cmi nCicElim.cmi \ - continuationals.cmi nInversion.cmi -nInversion.cmx : nTactics.cmx nTacStatus.cmx nCicElim.cmx \ - continuationals.cmx nInversion.cmi -nInversion.cmi : nTacStatus.cmi -nTacStatus.cmo : nCicTacReduction.cmi continuationals.cmi nTacStatus.cmi -nTacStatus.cmx : nCicTacReduction.cmx continuationals.cmx nTacStatus.cmi -nTacStatus.cmi : continuationals.cmi -nTactics.cmo : nTacStatus.cmi nCicElim.cmi continuationals.cmi nTactics.cmi -nTactics.cmx : nTacStatus.cmx nCicElim.cmx continuationals.cmx nTactics.cmi -nTactics.cmi : nTacStatus.cmi -nnAuto.cmo : nTactics.cmi nTacStatus.cmi nCicTacReduction.cmi \ - continuationals.cmi nnAuto.cmi -nnAuto.cmx : nTactics.cmx nTacStatus.cmx nCicTacReduction.cmx \ - continuationals.cmx nnAuto.cmi -nnAuto.cmi : nTacStatus.cmi +nDestructTac.cmi : \ + nTacStatus.cmi +nInversion.cmo : \ + nTactics.cmi \ + nTacStatus.cmi \ + nCicElim.cmi \ + continuationals.cmi \ + nInversion.cmi +nInversion.cmx : \ + nTactics.cmx \ + nTacStatus.cmx \ + nCicElim.cmx \ + continuationals.cmx \ + nInversion.cmi +nInversion.cmi : \ + nTacStatus.cmi +nTacStatus.cmo : \ + nCicTacReduction.cmi \ + continuationals.cmi \ + nTacStatus.cmi +nTacStatus.cmx : \ + nCicTacReduction.cmx \ + continuationals.cmx \ + nTacStatus.cmi +nTacStatus.cmi : \ + continuationals.cmi +nTactics.cmo : \ + nTacStatus.cmi \ + nCicElim.cmi \ + continuationals.cmi \ + nTactics.cmi +nTactics.cmx : \ + nTacStatus.cmx \ + nCicElim.cmx \ + continuationals.cmx \ + nTactics.cmi +nTactics.cmi : \ + nTacStatus.cmi +nnAuto.cmo : \ + nTactics.cmi \ + nTacStatus.cmi \ + nCicTacReduction.cmi \ + continuationals.cmi \ + nnAuto.cmi +nnAuto.cmx : \ + nTactics.cmx \ + nTacStatus.cmx \ + nCicTacReduction.cmx \ + continuationals.cmx \ + nnAuto.cmi +nnAuto.cmi : \ + nTacStatus.cmi diff --git a/matita/components/ng_tactics/.depend.opt b/matita/components/ng_tactics/.depend.opt index 420a5dbc6..ca420895d 100644 --- a/matita/components/ng_tactics/.depend.opt +++ b/matita/components/ng_tactics/.depend.opt @@ -1,33 +1,55 @@ +continuationals.cmx : \ + continuationals.cmi continuationals.cmi : -nCicTacReduction.cmi : -nTacStatus.cmi : continuationals.cmi +declarative.cmx : \ + nnAuto.cmx \ + nTactics.cmx \ + nTacStatus.cmx \ + nCicElim.cmx \ + continuationals.cmx \ + declarative.cmi +declarative.cmi : \ + nnAuto.cmi \ + nTacStatus.cmi +nCicElim.cmx : \ + nCicElim.cmi nCicElim.cmi : -nTactics.cmi : nTacStatus.cmi -declarative.cmi : nTacStatus.cmi -nnAuto.cmi : nTacStatus.cmi -nDestructTac.cmi : nTacStatus.cmi -nInversion.cmi : nTacStatus.cmi -continuationals.cmo : continuationals.cmi -continuationals.cmx : continuationals.cmi -nCicTacReduction.cmo : nCicTacReduction.cmi -nCicTacReduction.cmx : nCicTacReduction.cmi -nTacStatus.cmo : nCicTacReduction.cmi continuationals.cmi nTacStatus.cmi -nTacStatus.cmx : nCicTacReduction.cmx continuationals.cmx nTacStatus.cmi -nCicElim.cmo : nCicElim.cmi -nCicElim.cmx : nCicElim.cmi -nTactics.cmo : nTacStatus.cmi nCicElim.cmi continuationals.cmi nTactics.cmi -nTactics.cmx : nTacStatus.cmx nCicElim.cmx continuationals.cmx nTactics.cmi -declarative.cmo : nTactics.cmi declarative.cmi -declarative.cmx : nTactics.cmx declarative.cmi -nnAuto.cmo : nTactics.cmi nTacStatus.cmi nCicTacReduction.cmi \ - continuationals.cmi nnAuto.cmi -nnAuto.cmx : nTactics.cmx nTacStatus.cmx nCicTacReduction.cmx \ - continuationals.cmx nnAuto.cmi -nDestructTac.cmo : nTactics.cmi nTacStatus.cmi continuationals.cmi \ - nDestructTac.cmi -nDestructTac.cmx : nTactics.cmx nTacStatus.cmx continuationals.cmx \ +nCicTacReduction.cmx : \ + nCicTacReduction.cmi +nCicTacReduction.cmi : +nDestructTac.cmx : \ + nTactics.cmx \ + nTacStatus.cmx \ + continuationals.cmx \ nDestructTac.cmi -nInversion.cmo : nTactics.cmi nTacStatus.cmi nCicElim.cmi \ - continuationals.cmi nInversion.cmi -nInversion.cmx : nTactics.cmx nTacStatus.cmx nCicElim.cmx \ - continuationals.cmx nInversion.cmi +nDestructTac.cmi : \ + nTacStatus.cmi +nInversion.cmx : \ + nTactics.cmx \ + nTacStatus.cmx \ + nCicElim.cmx \ + continuationals.cmx \ + nInversion.cmi +nInversion.cmi : \ + nTacStatus.cmi +nTacStatus.cmx : \ + nCicTacReduction.cmx \ + continuationals.cmx \ + nTacStatus.cmi +nTacStatus.cmi : \ + continuationals.cmi +nTactics.cmx : \ + nTacStatus.cmx \ + nCicElim.cmx \ + continuationals.cmx \ + nTactics.cmi +nTactics.cmi : \ + nTacStatus.cmi +nnAuto.cmx : \ + nTactics.cmx \ + nTacStatus.cmx \ + nCicTacReduction.cmx \ + continuationals.cmx \ + nnAuto.cmi +nnAuto.cmi : \ + nTacStatus.cmi diff --git a/matita/components/ng_tactics/continuationals.ml b/matita/components/ng_tactics/continuationals.ml index 5538a3c2d..dc54c89dd 100644 --- a/matita/components/ng_tactics/continuationals.ml +++ b/matita/components/ng_tactics/continuationals.ml @@ -51,7 +51,7 @@ struct let rec aux acc depth = function | [] -> acc - | (locs, todos, conts, tag, p) :: tl -> + | (locs, todos, conts, tag, _p) :: tl -> let acc = List.fold_left (fun acc -> env acc depth tag) acc locs in let acc = List.fold_left (fun acc -> cont acc depth tag) acc conts in let acc = List.fold_left (fun acc -> todo acc depth tag) acc todos in diff --git a/matita/components/ng_tactics/declarative.ml b/matita/components/ng_tactics/declarative.ml index 4fa6b5bcb..d96e66811 100644 --- a/matita/components/ng_tactics/declarative.ml +++ b/matita/components/ng_tactics/declarative.ml @@ -43,19 +43,18 @@ let extract_first_goal_from_status status = let s = status#stack in match s with | [] -> fail (lazy "There's nothing to prove") - | (g1, _, k, tag1, _) :: tl -> + | (g1, _, _k, _tag1, _) :: _tl -> let goals = filter_open g1 in match goals with [] -> fail (lazy "No goals under focus") - | loc::tl -> + | loc::_tl -> let goal = goal_of_loc (loc) in goal ;; let extract_conclusion_type status goal = let gty = get_goalty status goal in let ctx = ctx_of gty in - let status,gty = term_of_cic_term status gty ctx in - gty + term_of_cic_term status gty ctx ;; let alpha_eq_tacterm_kerterm ty t status goal = @@ -83,7 +82,7 @@ let clear_volatile_params_tac status = | (g,t,k,tag,p)::tl -> let rec remove_volatile = function [] -> [] - | (k,v as hd')::tl' -> + | (k,_v as hd')::tl' -> let re = Str.regexp "volatile_.*" in if Str.string_match re k 0 then remove_volatile tl' @@ -107,7 +106,7 @@ let add_parameter_tac key value status = *) let lambda_abstract_tac id t1 status goal = match extract_conclusion_type status goal with - | NCic.Prod (_,t,_) -> + | status,NCic.Prod (_,t,_) -> if alpha_eq_tacterm_kerterm t1 t status goal then let (_,_,t1) = t1 in block_tac [exact_tac ("",0,(Ast.Binder (`Lambda,(Ast.Ident (id,None),Some t1),Ast.Implicit @@ -136,12 +135,12 @@ let suppose t1 id status = ;; let assert_tac t1 t2 status goal continuation = - let t = extract_conclusion_type status goal in + let status,t = extract_conclusion_type status goal in if alpha_eq_tacterm_kerterm t1 t status goal then match t2 with | None -> continuation | Some t2 -> - let status,res = are_convertible t1 t2 status goal in + let _status,res = are_convertible t1 t2 status goal in if res then continuation else raise NotEquivalentTypes @@ -161,7 +160,7 @@ let branch_dot_tac status = let status_parameter key status = match status#stack with [] -> "" - | (g,t,k,tag,p)::_ -> try List.assoc key p with _ -> "" + | (_g,_t,_k,_tag,p)::_ -> try List.assoc key p with _ -> "" ;; let beta_rewriting_step t status = @@ -238,7 +237,6 @@ let we_need_to_prove t id status = let by_just_we_proved just ty id status = let goal = extract_first_goal_from_status status in - let wrappedjust = just in let just = mk_just status goal just in match id with | None -> @@ -412,12 +410,12 @@ let print_goals_names_tac s (status:#NTacStatus.tac_status) = (* Useful as it does not change the order in the list *) let rec list_change_assoc k v = function [] -> [] - | (k',v' as hd) :: tl -> if k' = k then (k',v) :: tl else hd :: (list_change_assoc k v tl) + | (k',_v' as hd) :: tl -> if k' = k then (k',v) :: tl else hd :: (list_change_assoc k v tl) ;; let add_names_to_goals_tac (cl:NCic.constructor list ref) (status:#NTacStatus.tac_status) = let add_name_to_goal name goal metasenv = - let (mattrs,ctx,t as conj) = try List.assoc goal metasenv with _ -> assert false in + let (mattrs,ctx,t) = try List.assoc goal metasenv with _ -> assert false in let mattrs = (`Name name) :: (List.filter (function `Name _ -> false | _ -> true) mattrs) in let newconj = (mattrs,ctx,t) in list_change_assoc goal newconj metasenv @@ -427,7 +425,7 @@ let add_names_to_goals_tac (cl:NCic.constructor list ref) (status:#NTacStatus.ta * the new goals, when they are still under focus *) match status#stack with [] -> fail (lazy "Can not add names to an empty stack") - | (g,_,_,_,_) :: tl -> + | (g,_,_,_,_) :: _tl -> let rec sublist n = function [] -> [] | hd :: tl -> if n = 0 then [] else hd :: (sublist (n-1) tl) @@ -567,7 +565,7 @@ let rec loc_of_goal goal l = let has_focused_goal status = match status#stack with [] -> false - | ([],_,_,_,_) :: tl -> false + | ([],_,_,_,_) :: _tl -> false | _ -> true ;; diff --git a/matita/components/ng_tactics/nCicElim.ml b/matita/components/ng_tactics/nCicElim.ml index 582f7353b..5a5c7ba38 100644 --- a/matita/components/ng_tactics/nCicElim.ml +++ b/matita/components/ng_tactics/nCicElim.ml @@ -50,7 +50,7 @@ let mk_elim status uri leftno it (outsort,suffix) pragma = let p_name = mk_id "Q_" in let params,ty = NCicReduction.split_prods status ~subst:[] [] leftno ty in let params = List.rev_map (function name,_ -> mk_id name) params in - let args,sort = NCicReduction.split_prods status ~subst:[] [] (-1) ty in + let args,_sort = NCicReduction.split_prods status ~subst:[] [] (-1) ty in let args = List.rev_map (function name,_ -> mk_id name) args in let rec_arg = mk_id (fresh_name ()) in let mk_prods = @@ -77,7 +77,7 @@ let mk_elim status uri leftno it (outsort,suffix) pragma = List.map (function (_,name,ty) -> let _,ty = NCicReduction.split_prods status ~subst:[] [] leftno ty in - let cargs,ty= my_split_prods status ~subst:[] [] (-1) ty in + let cargs,_ty= my_split_prods status ~subst:[] [] (-1) ty in let cargs_recargs_nih = List.fold_left (fun (acc,nih) -> function @@ -248,7 +248,7 @@ let pp (status: #NCic.status) = in let rec eat_branch n rels ty pat = match (ty, pat) with - | NCic.Prod (name, s, t), _ when n > 0 -> + | NCic.Prod (_name, _s, t), _ when n > 0 -> eat_branch (pred n) rels t pat | NCic.Prod (_, _, t), NCic.Lambda (name, s, t') -> let cv, rhs = eat_branch 0 ((mk_id name)::rels) t t' in diff --git a/matita/components/ng_tactics/nDestructTac.ml b/matita/components/ng_tactics/nDestructTac.ml index f03baa656..f25114817 100644 --- a/matita/components/ng_tactics/nDestructTac.ml +++ b/matita/components/ng_tactics/nDestructTac.ml @@ -130,7 +130,7 @@ let arg_list nleft t = let nargs it nleft consno = pp (lazy (Printf.sprintf "nargs %d %d" nleft consno)); - let _,indname,_,cl = it in + let _,_indname,_,cl = it in let _,_,t_k = List.nth cl consno in List.length (arg_list nleft t_k) ;; @@ -327,14 +327,14 @@ let mk_discriminator ~use_jmeq ?(force=false) name it leftno status baseuri = NotationPt.Theorem (name, principle, Some (NotationPt.Implicit (`Tagged "inv")), attrs)) in - let uri,height,nmenv,nsubst,nobj = theorem in + let _uri,_height,nmenv,_nsubst,_nobj = theorem in let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in let status = status#set_obj theorem in let status = status#set_stack ninitial_stack in let status = subst_metasenv_and_fix_names status in (* PHASE 3: we finally prove the discrimination principle *) - let dbranch it ~use_jmeq leftno consno = + let dbranch it ~use_jmeq:__ leftno consno = let refl_id = mk_sym "refl" in pp (lazy (Printf.sprintf "dbranch %d %d" leftno consno)); let nlist = HExtlib.list_seq 0 (nargs it leftno consno) in @@ -482,7 +482,7 @@ let subst_tac ~context ~dir skip cur_eq = else let gen_tac x = (fun s -> - let x' = String.concat " " x in + (*let x' = String.concat " " x in*) let x = List.map mk_id x in (* let s = NTactics.print_tac false ("@generalize " ^ x') s in *) generalize0_tac x s) in @@ -619,7 +619,7 @@ let select_eq ctx acc domain status goal = | _ -> status, `NonEq in match kind with | `Identity -> - let status, goalty = term_of_cic_term status (get_goalty status goal) ctx in + let status, _goalty = term_of_cic_term status (get_goalty status goal) ctx in status, Some (List.length ctx - i), kind | `Cycle | `Blob | `NonEq -> aux (i+1) (* XXX: skip cyclic/blob equations for now *) | _ -> diff --git a/matita/components/ng_tactics/nInversion.ml b/matita/components/ng_tactics/nInversion.ml index 8267fd877..f1da10cb7 100644 --- a/matita/components/ng_tactics/nInversion.ml +++ b/matita/components/ng_tactics/nInversion.ml @@ -71,7 +71,7 @@ let rec jmeqpatt = function let rec mk_arrows ~jmeq xs ys selection target = match selection,xs,ys with [],[],[] -> target - | false :: l,x::xs,y::ys -> mk_arrows ~jmeq xs ys l target + | false :: l,_x::xs,_y::ys -> mk_arrows ~jmeq xs ys l target | true :: l,x::xs,y::ys when jmeq -> NotationPt.Binder (`Forall, (mk_id "_", Some (mk_appl [mk_sym "jmsimeq" ; @@ -95,7 +95,7 @@ let subst_metasenv_and_fix_names status = status#set_obj(u,h,NCicUntrusted.apply_subst_metasenv status subst metasenv,subst,o) ;; -let mk_inverter ~jmeq name is_ind it leftno ?selection outsort (status: #NCic.status) baseuri = +let mk_inverter ~jmeq name _is_ind it leftno ?selection outsort (status: #NCic.status) baseuri = pp (lazy ("leftno = " ^ string_of_int leftno)); let _,ind_name,ty,cl = it in pp (lazy ("arity: " ^ status#ppterm ~metasenv:[] ~subst:[] ~context:[] ty)); @@ -142,7 +142,7 @@ let mk_inverter ~jmeq name is_ind it leftno ?selection outsort (status: #NCic.st in (hypaux 1 ncons) in - let outsort, suffix = NCicElim.ast_of_sort outsort in + let outsort, _suffix = NCicElim.ast_of_sort outsort in let theorem = mk_prods xs (NotationPt.Binder (`Forall, (mk_id "Hterm", Some (mk_appl (List.map mk_id (ind_name::xs)))), @@ -156,7 +156,7 @@ let mk_inverter ~jmeq name is_ind it leftno ?selection outsort (status: #NCic.st NotationPt.Theorem (name,theorem, Some (NotationPt.Implicit (`Tagged "inv")), attrs)) in - let uri,height,nmenv,nsubst,nobj = theorem in + let _uri,_height,nmenv,_nsubst,_nobj = theorem in let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in let status = status#set_obj theorem in let status = status#set_stack ninitial_stack in @@ -205,6 +205,6 @@ NotationPt.Implicit (`Tagged "end")); let mk_inverter name is_ind it leftno ?selection outsort status baseuri = try mk_inverter ~jmeq:true name is_ind it leftno ?selection outsort status baseuri - with NTacStatus.Error (s,_) -> + with NTacStatus.Error (_s,_) -> mk_inverter ~jmeq:false name is_ind it leftno ?selection outsort status baseuri ;; diff --git a/matita/components/ng_tactics/nTacStatus.ml b/matita/components/ng_tactics/nTacStatus.ml index 1001d9808..118261af0 100644 --- a/matita/components/ng_tactics/nTacStatus.ml +++ b/matita/components/ng_tactics/nTacStatus.ml @@ -97,24 +97,24 @@ let ctx_of (c,_) = c ;; let mk_cic_term c t = c,t ;; let ppterm (status:#pstatus) t = - let uri,height,metasenv,subst,obj = status#obj in + let _uri,_height,metasenv,subst,_obj = status#obj in let context,t = t in status#ppterm ~metasenv ~subst ~context t ;; let ppcontext (status: #pstatus) c = - let uri,height,metasenv,subst,obj = status#obj in + let _uri,_height,metasenv,subst,_obj = status#obj in status#ppcontext ~metasenv ~subst c ;; let ppterm_and_context (status: #pstatus) t = - let uri,height,metasenv,subst,obj = status#obj in + let _uri,_height,metasenv,subst,_obj = status#obj in let context,t = t in status#ppcontext ~metasenv ~subst context ^ "\n ⊢ "^ status#ppterm ~metasenv ~subst ~context t ;; -let relocate status destination (source,t as orig) = +let relocate status destination (source,_t as orig) = pp(lazy("relocate:\n" ^ ppterm_and_context status orig)); pp(lazy("relocate in:\n" ^ ppcontext status destination)); let rc = @@ -134,13 +134,13 @@ let relocate status destination (source,t as orig) = compute_ops (e::ctx) (cl1,cl2) else [ `Delift ctx; `Lift (List.rev ex) ] - | (n1, NCic.Def (b1,t1) as e)::cl1 as ex, (n2, NCic.Decl t2)::cl2 -> + | (n1, NCic.Def (_b1,t1) as e)::cl1 as ex, (n2, NCic.Decl t2)::cl2 -> if n1 = n2 && NCicReduction.are_convertible status ctx ~subst ~metasenv t1 t2 then compute_ops (e::ctx) (cl1,cl2) else [ `Delift ctx; `Lift (List.rev ex) ] - | (n1, NCic.Decl _)::cl1 as ex, (n2, NCic.Def _)::cl2 -> + | (_n1, NCic.Decl _)::_cl1 as ex, (_n2, NCic.Def _)::_cl2 -> [ `Delift ctx; `Lift (List.rev ex) ] | _::_ as ex, [] -> [ `Lift (List.rev ex) ] | [], _::_ -> [ `Delift ctx ] @@ -235,7 +235,7 @@ let normalize status ?delta ctx t = let are_convertible status ctx a b = let status, (_,a) = relocate status ctx a in let status, (_,b) = relocate status ctx b in - let n,h,metasenv,subst,o = status#obj in + let _n,_h,metasenv,subst,_o = status#obj in let res = NCicReduction.are_convertible status metasenv subst ctx a b in status, res ;; @@ -378,7 +378,7 @@ let select_term else let _,_,_,subst,_ = status#obj in match t with - | NCic.Meta (i,lc) when List.mem_assoc i subst -> + | NCic.Meta (i,_lc) when List.mem_assoc i subst -> let _,_,t,_ = NCicUtils.lookup_subst i subst in aux ctx (status,already_found) t | NCic.Meta _ -> (status,already_found),t diff --git a/matita/components/ng_tactics/nTactics.ml b/matita/components/ng_tactics/nTactics.ml index a8a78999a..721d9165b 100644 --- a/matita/components/ng_tactics/nTactics.ml +++ b/matita/components/ng_tactics/nTactics.ml @@ -312,7 +312,7 @@ let assumption_tac status = distribute_tac (fun status goal -> let find_in_context name context = let rec aux acc = function | [] -> raise Not_found - | (hd,_) :: tl when hd = name -> acc + | (hd,_) :: _ when hd = name -> acc | _ :: tl -> aux (acc + 1) tl in aux 1 context @@ -503,7 +503,7 @@ let analyze_indty_tac ~what indtyref = let goalty = get_goalty status goal in let status, what = disambiguate status (ctx_of goalty) what `XTInd in let status, ty_what = typeof status (ctx_of what) what in - let status, (r,consno,lefts,rights,cl) = analyse_indty status ty_what in + let _status, (r,consno,lefts,rights,cl) = analyse_indty status ty_what in let leftno = List.length lefts in let rightno = List.length rights in indtyref := Some { @@ -704,7 +704,7 @@ let assert0_tac (hyps,concl) = distribute_tac (fun status goal -> let assert_tac seqs status = match status#stack with | [] -> assert false - | (g,_,_,_,_) :: s -> + | (g,_,_,_,_) :: _s -> assert (List.length g = List.length seqs); (match seqs with [] -> id_tac diff --git a/matita/components/ng_tactics/nnAuto.ml b/matita/components/ng_tactics/nnAuto.ml index cb73e873e..3ac6040dc 100644 --- a/matita/components/ng_tactics/nnAuto.ml +++ b/matita/components/ng_tactics/nnAuto.ml @@ -13,7 +13,7 @@ open Printf let print ?(depth=0) s = prerr_endline (String.make (2*depth) ' '^Lazy.force s) -let noprint ?(depth=0) _ = () +let noprint ?depth:(_=0) _ = () let debug_print = noprint open Continuationals.Stack @@ -66,7 +66,7 @@ let is_relevant tbl item = else true with Not_found -> true -let print_stat status tbl = +let print_stat _status tbl = let l = RefHash.fold (fun a v l -> (a,v)::l) tbl [] in let relevance v = float !(v.uses) /. float !(v.nominations) in let vcompare (_,v1) (_,v2) = @@ -322,7 +322,7 @@ let index_local_equations eq_cache ?(flag=false) status = end ;; -let index_local_equations2 eq_cache status open_goal lemmas ?(flag=false) nohyps = +let index_local_equations2 eq_cache status open_goal lemmas ?flag:(_=false) nohyps = noprint (lazy "indexing equations"); let eq_cache,lemmas = match lemmas with @@ -360,7 +360,7 @@ let index_local_equations2 eq_cache status open_goal lemmas ?(flag=false) nohyps eq_cache lemmas ;; -let fast_eq_check_tac ~params s = +let fast_eq_check_tac ~params:_ s = let unit_eq = index_local_equations s#eq_cache s in dist_fast_eq_check unit_eq s ;; @@ -371,7 +371,7 @@ let paramod eq_cache status goal = | s::_ -> s ;; -let paramod_tac ~params s = +let paramod_tac ~params:_ s = let unit_eq = index_local_equations s#eq_cache s in NTactics.distribute_tac (paramod unit_eq) s ;; @@ -420,7 +420,7 @@ let close_wrt_context status = (fun ty ctx_entry -> match ctx_entry with | name, NCic.Decl t -> NCic.Prod(name,t,ty) - | name, NCic.Def(bo, _) -> NCicSubstitution.subst status bo ty) + | _name, NCic.Def(bo, _) -> NCicSubstitution.subst status bo ty) ;; let args_for_context ?(k=1) ctx = @@ -428,8 +428,8 @@ let args_for_context ?(k=1) ctx = List.fold_left (fun (n,l) ctx_entry -> match ctx_entry with - | name, NCic.Decl t -> n+1,NCic.Rel(n)::l - | name, NCic.Def(bo, _) -> n+1,l) + | _name, NCic.Decl _t -> n+1,NCic.Rel(n)::l + | _name, NCic.Def(_bo, _) -> n+1,l) (k,[]) ctx in args @@ -448,7 +448,7 @@ let refresh metasenv = List.fold_left (fun (metasenv,subst) (i,(iattr,ctx,ty)) -> let ikind = NCicUntrusted.kind_of_meta iattr in - let metasenv,j,instance,ty = + let metasenv,_j,instance,ty = NCicMetaSubst.mk_meta ~attrs:iattr metasenv ctx ~with_type:ty ikind in let s_entry = i,(iattr, ctx, instance, ty) in @@ -464,12 +464,12 @@ let close_metasenv status metasenv subst = *) let metasenv = NCicUntrusted.sort_metasenv status subst metasenv in List.fold_left - (fun (subst,objs) (i,(iattr,ctx,ty)) -> + (fun (subst,objs) (i,(_iattr,ctx,ty)) -> let ty = NCicUntrusted.apply_subst status subst ctx ty in let ctx = NCicUntrusted.apply_subst_context status ~fix_projections:true subst ctx in - let (uri,_,_,_,obj) as okind = + let (uri,_,_,_,_obj) as okind = constant_for_meta status ctx ty i in try NCicEnvironment.check_and_add_obj status okind; @@ -521,7 +521,7 @@ let replace_meta status i args target = | _ -> let args = List.map (NCicSubstitution.subst_meta status lc) args in NCic.Appl(NCic.Rel k::args)) - | NCic.Meta (j,lc) as m -> + | NCic.Meta (_j,lc) as m -> (match lc with _,NCic.Irl _ -> m | n,NCic.Ctx l -> @@ -536,7 +536,7 @@ let replace_meta status i args target = let close_wrt_metasenv status subst = List.fold_left - (fun ty (i,(iattr,ctx,mty)) -> + (fun ty (i,(_iattr,ctx,mty)) -> let mty = NCicUntrusted.apply_subst status subst ctx mty in let ctx = NCicUntrusted.apply_subst_context status ~fix_projections:true @@ -591,8 +591,8 @@ let saturate_to_ref status metasenv subst ctx nref ty = aux metasenv ty [] let smart_apply t unit_eq status g = - let n,h,metasenv,subst,o = status#obj in - let gname, ctx, gty = List.assoc g metasenv in + let n,h,metasenv,_subst,o = status#obj in + let _gname, ctx, gty = List.assoc g metasenv in (* let ggty = mk_cic_term context gty in *) let status, t = disambiguate status ctx t `XTNone in let status,t = term_of_cic_term status t ctx in @@ -633,7 +633,7 @@ let smart_apply t unit_eq status g = debug_print(lazy("ritorno da fast_eq_check")); res with - | NCicEnvironment.ObjectNotFound s as e -> + | NCicEnvironment.ObjectNotFound _s as e -> raise (Error (lazy "eq_coerc non yet defined",Some e)) | Error _ as e -> debug_print (lazy "error"); raise e (* FG: for now we catch TypeCheckerFailure; to be understood *) @@ -957,7 +957,7 @@ let init_cache ?(facts=[]) ?(under_inspection=[],[]) unit_eq = unit_eq; trace = trace} -let only signature _context candidate = true +let only _signature _context _candidate = true (* (* TASSI: nel trie ci mettiamo solo il body, non il ty *) let candidate_ty = @@ -1016,9 +1016,9 @@ let rec stack_goals level gs = let open_goals level status = stack_goals level status#stack ;; -let try_candidate ?(smart=0) flags depth status eq_cache ctx t = +let try_candidate ?(smart=0) _flags depth status eq_cache _ctx t = try - let old_og_no = List.length (open_goals (depth+1) status) in + (*let old_og_no = List.length (open_goals (depth+1) status) in*) debug_print ~depth (lazy ("try " ^ (string_of_int smart) ^ " : " ^ (NotationPp.pp_term status) t)); let status = @@ -1054,7 +1054,7 @@ let try_candidate ?(smart=0) flags depth status eq_cache ctx t = debug_print ~depth (lazy "strange application"); None) else *) (incr candidate_no; Some ((!candidate_no,t),status)) - with Error (msg,exn) -> debug_print ~depth (lazy "failed"); None + with Error _ -> debug_print ~depth (lazy "failed"); None ;; let sort_of status subst metasenv ctx t = @@ -1100,12 +1100,12 @@ let is_a_needed_uri s = s = "cic:/matita/basics/logic/eq_f2.con" || s = "cic:/matita/basics/logic/eq_f.con" -let get_candidates ?(smart=true) ~pfailed depth flags status cache signature gty = +let get_candidates ?(smart=true) ~pfailed depth flags status cache _signature gty = let universe = status#auto_cache in let _,_,metasenv,subst,_ = status#obj in let context = ctx_of gty in let _, raw_gty = term_of_cic_term status gty context in - let is_prod, is_eq = + let is_prod, _is_eq = let status, t = term_of_cic_term status gty context in let t = NCicReduction.whd status subst context t in match t with @@ -1238,7 +1238,7 @@ let applicative_case ~pfailed depth signature status flags gty cache = flags status tcache signature gty in let sm = if is_eq || is_prod then 0 else 2 in - let sm1 = if flags.last then 2 else 0 in + (*let sm1 = if flags.last then 2 else 0 in *) let maxd = (depth + 1 = flags.maxdepth) in let try_candidates only_one sm acc candidates = List.fold_left @@ -1364,7 +1364,7 @@ let is_prod status = let intro ~depth status facts name = let status = NTactics.intro_tac name status in - let _, ctx, ngty = current_goal status in + let _, ctx, _ngty = current_goal status in let t = mk_cic_term ctx (NCic.Rel 1) in let status, keys = keys_of_term status t in let facts = List.fold_left (add_to_th t) facts keys in @@ -1586,7 +1586,7 @@ match status#stack with List.for_all (fun i -> IntSet.mem i others) (HExtlib.filter_map is_open g) -let top_cache ~depth top status ?(use_given_only=false) cache = +let top_cache ~depth:_ top status ?(use_given_only=false) cache = if top then let unit_eq = index_local_equations status#eq_cache status ~flag:use_given_only in {cache with unit_eq = unit_eq} @@ -1680,7 +1680,7 @@ let rec auto_clusters ?(top=false) flags signature cache depth ?(use_given_only= and (* BRAND NEW VERSION *) -auto_main flags signature cache depth status ?(use_given_only=false): unit= +auto_main flags signature cache depth ?(use_given_only=false) status: unit= debug_print ~depth (lazy "entering auto main"); debug_print ~depth (pptrace status cache.trace); debug_print ~depth (lazy ("stack length = " ^ @@ -1691,28 +1691,28 @@ auto_main flags signature cache depth status ?(use_given_only=false): unit= match goals with | [] when depth = 0 -> raise (Proved (status,cache.trace)) | [] -> - let status = NTactics.merge_tac status in - let cache = - let l,tree = cache.under_inspection in - match l with - | [] -> cache (* possible because of intros that cleans the cache *) - | a::tl -> let tree = rm_from_th a tree a in - {cache with under_inspection = tl,tree} - in - auto_clusters flags signature cache (depth-1) status ~use_given_only - | orig::_ -> - if depth > 0 && move_to_side depth status - then - let status = NTactics.merge_tac status in - let cache = - let l,tree = cache.under_inspection in - match l with - | [] -> cache (* possible because of intros that cleans the cache*) - | a::tl -> let tree = rm_from_th a tree a in - {cache with under_inspection = tl,tree} - in - auto_clusters flags signature cache (depth-1) status ~use_given_only - else + let status = NTactics.merge_tac status in + let cache = + let l,tree = cache.under_inspection in + match l with + | [] -> cache (* possible because of intros that cleans the cache *) + | a::tl -> let tree = rm_from_th a tree a in + {cache with under_inspection = tl,tree} + in + auto_clusters flags signature cache (depth-1) status ~use_given_only + | _orig::_ -> + if depth > 0 && move_to_side depth status + then + let status = NTactics.merge_tac status in + let cache = + let l,tree = cache.under_inspection in + match l with + | [] -> cache (* possible because of intros that cleans the cache*) + | a::tl -> let tree = rm_from_th a tree a in + {cache with under_inspection = tl,tree} + in + auto_clusters flags signature cache (depth-1) status ~use_given_only + else let ng = List.length goals in (* moved inside auto_clusters *) if ng > flags.maxwidth then begin @@ -1931,7 +1931,7 @@ let candidates_from_ctx univ ctx status = Ast.Ident("rewrite_r",None); Ast.Ident("rewrite_l",None) ]) -let auto_lowtac ~params:(univ,flags as params) status goal = +let auto_lowtac ~params:(univ,flags) status goal = let gty = get_goalty status goal in let ctx = ctx_of gty in let candidates = candidates_from_ctx univ ctx status in diff --git a/matita/components/registry/.depend b/matita/components/registry/.depend index 67113e67f..edb72af84 100644 --- a/matita/components/registry/.depend +++ b/matita/components/registry/.depend @@ -1,3 +1,5 @@ +helm_registry.cmo : \ + helm_registry.cmi +helm_registry.cmx : \ + helm_registry.cmi helm_registry.cmi : -helm_registry.cmo : helm_registry.cmi -helm_registry.cmx : helm_registry.cmi diff --git a/matita/components/registry/.depend.opt b/matita/components/registry/.depend.opt index 67113e67f..c8aaec531 100644 --- a/matita/components/registry/.depend.opt +++ b/matita/components/registry/.depend.opt @@ -1,3 +1,3 @@ +helm_registry.cmx : \ + helm_registry.cmi helm_registry.cmi : -helm_registry.cmo : helm_registry.cmi -helm_registry.cmx : helm_registry.cmi diff --git a/matita/components/registry/helm_registry.ml b/matita/components/registry/helm_registry.ml index 08b1bb76f..f3309633b 100644 --- a/matita/components/registry/helm_registry.ml +++ b/matita/components/registry/helm_registry.ml @@ -54,7 +54,7 @@ let starts_with prefix = String.sub s 0 prefix_len = prefix with Invalid_argument _ -> false -let hashtbl_keys tbl = Hashtbl.fold (fun k _ acc -> k :: acc) tbl [] +(*let hashtbl_keys tbl = Hashtbl.fold (fun k _ acc -> k :: acc) tbl []*) let hashtbl_pairs tbl = Hashtbl.fold (fun k v acc -> (k,v) :: acc) tbl [] (** *) @@ -85,16 +85,16 @@ let valid_key_rex = Str.regexp ("^" ^ valid_key_rex_raw ^ "$") let interpolated_key_rex = Str.regexp ("\\$(" ^ valid_key_rex_raw ^ ")") let dot_rex = Str.regexp "\\." let spaces_rex = Str.regexp "[ \t\n\r]+" -let heading_spaces_rex = Str.regexp "^[ \t\n\r]+" +(*let heading_spaces_rex = Str.regexp "^[ \t\n\r]+"*) let margin_blanks_rex = Str.regexp "^\\([ \t\n\r]*\\)\\([^ \t\n\r]*\\)\\([ \t\n\r]*\\)$" let strip_blanks s = Str.global_replace margin_blanks_rex "\\2" s -let split s = +(*let split s = (* trailing blanks are removed per default by split *) - Str.split spaces_rex (Str.global_replace heading_spaces_rex "" s) -let merge l = String.concat " " l + Str.split spaces_rex (Str.global_replace heading_spaces_rex "" s)*) +(*let merge l = String.concat " " l*) let handle_type_error f x = try f x with exn -> raise (Type_error (Printexc.to_string exn)) @@ -128,10 +128,10 @@ let quad fst_unmarshaller snd_unmarshaller trd_unmarshaller fth_unmarshaller v = | _ -> raise (Type_error "not a quad") (* escapes for xml configuration file *) -let (escape, unescape) = +(*let (escape, unescape) = let (in_enc, out_enc) = (`Enc_utf8, `Enc_utf8) in (Netencoding.Html.encode ~in_enc ~out_enc (), - Netencoding.Html.decode ~in_enc ~out_enc ~entity_base:`Xml ()) + Netencoding.Html.decode ~in_enc ~out_enc ~entity_base:`Xml ())*) let key_is_valid key = if not (Str.string_match valid_key_rex key 0) then @@ -145,7 +145,7 @@ let set' ?(replace=false) registry ~key ~value = let unset registry = Hashtbl.remove registry -let env_var_of_key s = String.uppercase (Str.global_replace dot_rex "_" s) +let env_var_of_key s = String.uppercase_ascii (Str.global_replace dot_rex "_" s) let singleton = function | [] -> diff --git a/matita/components/syntax_extensions/.depend.opt b/matita/components/syntax_extensions/.depend.opt index 24f371ca7..84b72a664 100644 --- a/matita/components/syntax_extensions/.depend.opt +++ b/matita/components/syntax_extensions/.depend.opt @@ -1,5 +1,5 @@ +utf8Macro.cmx : \ + utf8MacroTable.cmx \ + utf8Macro.cmi utf8Macro.cmi : -utf8MacroTable.cmo : utf8MacroTable.cmx : -utf8Macro.cmo : utf8MacroTable.cmx utf8Macro.cmi -utf8Macro.cmx : utf8MacroTable.cmx utf8Macro.cmi diff --git a/matita/components/thread/.depend b/matita/components/thread/.depend index d68336af1..7bf942ba0 100644 --- a/matita/components/thread/.depend +++ b/matita/components/thread/.depend @@ -1,6 +1,10 @@ -threadSafe.cmi : +extThread.cmo : \ + extThread.cmi +extThread.cmx : \ + extThread.cmi extThread.cmi : -threadSafe.cmo : threadSafe.cmi -threadSafe.cmx : threadSafe.cmi -extThread.cmo : extThread.cmi -extThread.cmx : extThread.cmi +threadSafe.cmo : \ + threadSafe.cmi +threadSafe.cmx : \ + threadSafe.cmi +threadSafe.cmi : diff --git a/matita/components/thread/.depend.opt b/matita/components/thread/.depend.opt index d68336af1..e022019db 100644 --- a/matita/components/thread/.depend.opt +++ b/matita/components/thread/.depend.opt @@ -1,6 +1,6 @@ -threadSafe.cmi : +extThread.cmx : \ + extThread.cmi extThread.cmi : -threadSafe.cmo : threadSafe.cmi -threadSafe.cmx : threadSafe.cmi -extThread.cmo : extThread.cmi -extThread.cmx : extThread.cmi +threadSafe.cmx : \ + threadSafe.cmi +threadSafe.cmi : diff --git a/matita/components/xml/.depend b/matita/components/xml/.depend index fd3f626b9..2ed17ef38 100644 --- a/matita/components/xml/.depend +++ b/matita/components/xml/.depend @@ -1,6 +1,10 @@ +xml.cmo : \ + xml.cmi +xml.cmx : \ + xml.cmi xml.cmi : +xmlPushParser.cmo : \ + xmlPushParser.cmi +xmlPushParser.cmx : \ + xmlPushParser.cmi xmlPushParser.cmi : -xml.cmo : xml.cmi -xml.cmx : xml.cmi -xmlPushParser.cmo : xmlPushParser.cmi -xmlPushParser.cmx : xmlPushParser.cmi diff --git a/matita/components/xml/.depend.opt b/matita/components/xml/.depend.opt index fd3f626b9..31b27a176 100644 --- a/matita/components/xml/.depend.opt +++ b/matita/components/xml/.depend.opt @@ -1,6 +1,6 @@ +xml.cmx : \ + xml.cmi xml.cmi : +xmlPushParser.cmx : \ + xmlPushParser.cmi xmlPushParser.cmi : -xml.cmo : xml.cmi -xml.cmx : xml.cmi -xmlPushParser.cmo : xmlPushParser.cmi -xmlPushParser.cmx : xmlPushParser.cmi diff --git a/matita/components/xml/xml.ml b/matita/components/xml/xml.ml index 0e3a4bcc2..c6bbd66b5 100644 --- a/matita/components/xml/xml.ml +++ b/matita/components/xml/xml.ml @@ -92,7 +92,7 @@ let pp_gen f strm = pp_r m s | [< >] -> () and print_spaces m = - for i = 1 to m do f " " done + for _i = 1 to m do f " " done in pp_r 0 strm ;; @@ -104,7 +104,7 @@ let pp_to_outchan strm oc = ;; let pp_to_gzipchan strm oc = - pp_gen (fun s -> Gzip.output oc s 0 (String.length s)) strm + pp_gen (fun s -> Gzip.output oc (Bytes.of_string s) 0 (String.length s)) strm ;; (** pretty printer to string *) diff --git a/matita/components/xml/xmlPushParser.ml b/matita/components/xml/xmlPushParser.ml index 4f57e1242..b809068f5 100644 --- a/matita/components/xml/xmlPushParser.ml +++ b/matita/components/xml/xmlPushParser.ml @@ -94,12 +94,12 @@ let parse expat_parser = aux (`Channel ic); close_in ic | `Gzip_channel ic -> - let buf = String.create gzip_bufsize in + let buf = Bytes.create gzip_bufsize in (try while true do let bytes = Gzip.input ic buf 0 gzip_bufsize in if bytes = 0 then raise End_of_file; - parse_fun (String.sub buf 0 bytes) + parse_fun (Bytes.to_string (Bytes.sub buf 0 bytes)) done with End_of_file -> final expat_parser) | `Gzip_file fname -> diff --git a/matita/configure.ac b/matita/configure.ac index 0670278be..04b7da8bd 100644 --- a/matita/configure.ac +++ b/matita/configure.ac @@ -5,7 +5,7 @@ AC_INIT(matita/matitaTypes.ml) DEBUG_DEFAULT="true" DEFAULT_DBHOST="mysql://mowgli.cs.unibo.it" RT_BASE_DIR_DEFAULT="`pwd`/matita" -MATITA_VERSION="0.99.3" +MATITA_VERSION="0.99.4" DISTRIBUTED="yes" # "yes" for distributed tarballs # End of distribution settings @@ -24,11 +24,11 @@ if test $HAVE_OCAMLFIND = "yes"; then else AC_MSG_ERROR(could not find ocamlfind) fi -AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc2, yes, no) +AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc3, yes, no) if test $HAVE_LABLGLADECC = "yes"; then - LABLGLADECC="lablgladecc2" + LABLGLADECC="lablgladecc3" else - AC_MSG_ERROR(could not find lablgladecc2) + AC_MSG_ERROR(could not find lablgladecc3) fi AC_CHECK_PROG(HAVE_CAMLP5O, camlp5o, yes, no) if test $HAVE_CAMLP5O = "yes"; then @@ -40,16 +40,17 @@ fi # look for METAS dir LIBSPATH="`pwd`/components" -OCAMLPATH="$LIBSPATH/METAS" +OCAMLPATHL="$LIBSPATH/METAS" +OCAMLPATH="$OCAMLPATHL:$OCAMLPATH" # creating META.* echo -n "creating METAs ... " -for f in $OCAMLPATH/meta.*.src; do +for f in $OCAMLPATHL/meta.*.src; do basename=`basename $f` metaname=`echo $basename | sed 's/meta\.\(.*\)\.src/\1/'` dirname=`echo $metaname | sed 's/^helm-//'` - metafile="$OCAMLPATH/META.$metaname" + metafile="$OCAMLPATHL/META.$metaname" cp $f $metafile echo "directory=\"$LIBSPATH/$dirname\"" >> $metafile done @@ -57,20 +58,24 @@ echo "done" # (libs) findlib requisites +#gdome2 \ +#mysql \ FINDLIB_LIBSREQUIRES="\ expat \ -gdome2 \ http \ -lablgtk2 \ -lablgtk2.sourceview2 \ -mysql \ +pcre \ +str \ +unix \ +lablgtk3 \ +lablgtk3-sourceview3 \ netstring \ -ulex08 \ +ulex-camlp5 \ zip \ " # (Matita) findlib requisites +#lablgtk3.glade \ FINDLIB_COMREQUIRES="\ helm-disambiguation \ helm-grafite \ @@ -87,9 +92,9 @@ $FINDLIB_COMREQUIRES \ " FINDLIB_REQUIRES="\ $FINDLIB_CREQUIRES \ -lablgtk2.glade \ -lablgtk2.sourceview2 \ +lablgtk3-sourceview3 \ " + for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES do AC_MSG_CHECKING(for $r ocaml library) diff --git a/matita/matita/.depend b/matita/matita/.depend index 271861428..c8ed208c3 100644 --- a/matita/matita/.depend +++ b/matita/matita/.depend @@ -12,11 +12,9 @@ lablGraphviz.cmo : lablGraphviz.cmi lablGraphviz.cmx : lablGraphviz.cmi lablGraphviz.cmi : matita.cmo : predefined_virtuals.cmi matitaScript.cmi matitaMisc.cmi \ - matitaInit.cmi matitaGui.cmi matitaGtkMisc.cmi buildTimeConf.cmo \ - applyTransformation.cmi + matitaInit.cmi matitaGui.cmi buildTimeConf.cmo applyTransformation.cmi matita.cmx : predefined_virtuals.cmx matitaScript.cmx matitaMisc.cmx \ - matitaInit.cmx matitaGui.cmx matitaGtkMisc.cmx buildTimeConf.cmx \ - applyTransformation.cmx + matitaInit.cmx matitaGui.cmx buildTimeConf.cmx applyTransformation.cmx matitaEngine.cmo : applyTransformation.cmi matitaEngine.cmi matitaEngine.cmx : applyTransformation.cmx matitaEngine.cmi matitaEngine.cmi : applyTransformation.cmi @@ -25,9 +23,9 @@ matitaExcPp.cmx : matitaEngine.cmx matitaExcPp.cmi matitaExcPp.cmi : matitaGeneratedGui.cmo : matitaGeneratedGui.cmx : -matitaGtkMisc.cmo : matitaTypes.cmi matitaGeneratedGui.cmo buildTimeConf.cmo \ +matitaGtkMisc.cmo : matitaGeneratedGui.cmo buildTimeConf.cmo \ matitaGtkMisc.cmi -matitaGtkMisc.cmx : matitaTypes.cmx matitaGeneratedGui.cmx buildTimeConf.cmx \ +matitaGtkMisc.cmx : matitaGeneratedGui.cmx buildTimeConf.cmx \ matitaGtkMisc.cmi matitaGtkMisc.cmi : matitaGeneratedGui.cmo matitaGui.cmo : matitaTypes.cmi matitaScript.cmi matitaMisc.cmi \ @@ -37,6 +35,8 @@ matitaGui.cmx : matitaTypes.cmx matitaScript.cmx matitaMisc.cmx \ matitaMathView.cmx matitaGuiTypes.cmi matitaGtkMisc.cmx \ matitaGeneratedGui.cmx matitaExcPp.cmx buildTimeConf.cmx matitaGui.cmi matitaGui.cmi : matitaGuiTypes.cmi +matitaGuiInit.cmo : +matitaGuiInit.cmx : matitaGuiTypes.cmi : matitaGeneratedGui.cmo applyTransformation.cmi matitaInit.cmo : matitaExcPp.cmi buildTimeConf.cmo matitaInit.cmi matitaInit.cmx : matitaExcPp.cmx buildTimeConf.cmx matitaInit.cmi diff --git a/matita/matita/.depend.opt b/matita/matita/.depend.opt index 6f4370e52..f1994ce59 100644 --- a/matita/matita/.depend.opt +++ b/matita/matita/.depend.opt @@ -21,7 +21,6 @@ matita.cmx : \ matitaMisc.cmx \ matitaInit.cmx \ matitaGui.cmx \ - matitaGtkMisc.cmx \ buildTimeConf.cmx \ applyTransformation.cmx matitaEngine.cmx : \ @@ -35,7 +34,6 @@ matitaExcPp.cmx : \ matitaExcPp.cmi : matitaGeneratedGui.cmx : matitaGtkMisc.cmx : \ - matitaTypes.cmx \ matitaGeneratedGui.cmx \ buildTimeConf.cmx \ matitaGtkMisc.cmi @@ -54,6 +52,7 @@ matitaGui.cmx : \ matitaGui.cmi matitaGui.cmi : \ matitaGuiTypes.cmi +matitaGuiInit.cmx : matitaGuiTypes.cmi : \ matitaGeneratedGui.cmx \ applyTransformation.cmi diff --git a/matita/matita/Makefile b/matita/matita/Makefile index caf0f82ff..d40a15c7a 100644 --- a/matita/matita/Makefile +++ b/matita/matita/Makefile @@ -11,7 +11,7 @@ else ANNOTOPTION = endif -OCAML_FLAGS = -pp $(CAMLP5O) -rectypes $(ANNOTOPTION) +OCAML_FLAGS = -pp $(CAMLP5O) -rectypes $(ANNOTOPTION) -w @A-52-4-34-37-45-9-44-48-6-32-20-58-7 OCAMLDEP_FLAGS = -pp $(CAMLP5O) PKGS = -package "$(MATITA_REQUIRES)" CPKGS = -package "$(MATITA_CREQUIRES)" @@ -61,7 +61,7 @@ MAINCMLI = \ matitaclean.mli \ $(NULL) # objects for matita (GTK GUI) -ML = buildTimeConf.ml matitaGeneratedGui.ml $(MLI:%.mli=%.ml) +ML = buildTimeConf.ml matitaGuiInit.ml matitaGeneratedGui.ml $(MLI:%.mli=%.ml) # objects for matitac (batch compiler) CML = buildTimeConf.ml $(CMLI:%.mli=%.ml) MAINCML = $(MAINCMLI:%.mli=%.ml) @@ -142,11 +142,9 @@ matitaclean: matitac matitaclean.opt: matitac.opt $(H)test -f $@ || ln -s $< $@ -matitaGeneratedGui.ml: matita.glade.utf8 +matitaGeneratedGui.ml: matita.ui $(H)$(LABLGLADECC) -embed $< > matitaGeneratedGui.ml -matita.glade.utf8: matita.glade - $(H)xmllint --encode UTF8 $< > $@ .PHONY: clean clean: @@ -162,7 +160,6 @@ clean: .PHONY: distclean distclean: clean $(H)$(MAKE) -C dist/ clean - $(H)rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli $(H)rm -f buildTimeConf.ml $(H)rm -f matita.glade.bak matita.gladep.bak $(H)rm -f matita.conf.xml.sample @@ -204,7 +201,7 @@ cleantests.opt: $(foreach d,$(TEST_DIRS_OPT),$(d)-cleantests-opt) # {{{ Distribution stuff -dist_pre: matitaGeneratedGui.ml +dist_pre: $(MAKE) -C dist/ dist_pre WHERE = $(DESTDIR)/$(RT_BASE_DIR) diff --git a/matita/matita/applyTransformation.ml b/matita/matita/applyTransformation.ml index f761a153b..2ae27ee63 100644 --- a/matita/matita/applyTransformation.ml +++ b/matita/matita/applyTransformation.ml @@ -66,7 +66,7 @@ let ntxt_of_cic_context ~metasenv ~subst = Content2pres.ncontext2pres ((new NCicPp.status)#ppcontext ~metasenv ~subst) -let ntxt_of_cic_subst ~map_unicode_to_tex size status ~metasenv ?use_subst subst = +let ntxt_of_cic_subst ~map_unicode_to_tex:_ _size _status ~metasenv ?use_subst subst = [], "<<>>\n" ^ (new NCicPp.status)#ppsubst ~metasenv ?use_subst subst @@ -75,11 +75,11 @@ class status = object(self) inherit Interpretations.status inherit TermContentPres.status - method ppterm ~context ~subst ~metasenv ?margin ?inside_fix t = + method ppterm ~context ~subst ~metasenv ?margin:(_) ?inside_fix:(_) t = snd (ntxt_of_cic_term ~map_unicode_to_tex:false 80 self ~metasenv ~subst ~context t) - method ppcontext ?sep ~subst ~metasenv context = + method ppcontext ?sep:(_) ~subst ~metasenv context = snd (ntxt_of_cic_context ~map_unicode_to_tex:false 80 self ~metasenv ~subst context) diff --git a/matita/matita/broken_lib/binding/db.ma b/matita/matita/broken_lib/binding/db.ma new file mode 100644 index 000000000..534874f21 --- /dev/null +++ b/matita/matita/broken_lib/binding/db.ma @@ -0,0 +1,110 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basics/lists/list.ma". + +axiom alpha : Type[0]. +notation "𝔸" non associative with precedence 90 for @{'alphabet}. +interpretation "set of names" 'alphabet = alpha. + +inductive tp : Type[0] ≝ +| top : tp +| arr : tp → tp → tp. +inductive tm : Type[0] ≝ +| var : nat → tm +| par : 𝔸 → tm +| abs : tp → tm → tm +| app : tm → tm → tm. + +let rec Nth T n (l:list T) on n ≝ + match l with + [ nil ⇒ None ? + | cons hd tl ⇒ match n with + [ O ⇒ Some ? hd + | S n0 ⇒ Nth T n0 tl ] ]. + +inductive judg : list tp → tm → tp → Prop ≝ +| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t +| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u +| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u). + +definition Env := list (𝔸 × tp). + +axiom vclose_env : Env → list tp. +axiom vclose_tm : Env → tm → tm. +axiom Lam : 𝔸 → tp → tm → tm. +definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T. +definition dom ≝ λG:Env.map ?? (fst ??) G. + +definition sctx ≝ 𝔸 × tm. +axiom swap_tm : 𝔸 → 𝔸 → tm → tm. +definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M. + +axiom in_list : ∀A:Type[0].A → list A → Prop. +interpretation "list membership" 'mem x l = (in_list ? x l). +interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)). + +axiom in_Env : 𝔸 × tp → Env → Prop. +notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. +interpretation "Env membership" 'lefttriangle x l = (in_Env x l). + +let rec FV M ≝ match M with + [ par X ⇒ [X] + | app M1 M2 ⇒ FV M1@FV M2 + | abs T M0 ⇒ FV M0 + | _ ⇒ [ ] ]. + +(* axiom Lookup : 𝔸 → Env → option tp. *) + +(* forma alto livello del judgment + t_abs* : ∀G,T,X,M,U. + (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) → + Judg G (Lam X T (M[X])) (arr T U) *) + +(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *) + +axiom Judg_ind : ∀P:Env → tm → tp → Prop. + (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) → + (∀G,M,N,T,U. + Judg G M (arr T U) → Judg G N T → + P G M (arr T U) → P G N T → P G (app M N) U) → + (∀G,T1,T2,X,M1. + (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) → + (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) → + P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) → + ∀G,M,T.Judg G M T → P G M T. + +axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T. +axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U. +axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U). + +definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2. +interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2). + +axiom daemon : ∀P:Prop.P. + +theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T. +#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?) +@(Judg_ind … HJ) +[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub // +| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2 + [| @IH1 // | @IH2 // ] +| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH + [ (* trivial property of Lam *) @daemon + | (* trivial property of subenv *) @daemon ] +] +qed. + +(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e + ricorsione *) \ No newline at end of file diff --git a/matita/matita/broken_lib/binding/fp.ma b/matita/matita/broken_lib/binding/fp.ma new file mode 100644 index 000000000..14ba2f774 --- /dev/null +++ b/matita/matita/broken_lib/binding/fp.ma @@ -0,0 +1,296 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "binding/names.ma". + +(* permutations *) +definition finite_perm : ∀X:Nset.(X → X) → Prop ≝ + λX,f.injective X X f ∧ surjective X X f ∧ ∃l.∀x.x ∉ l → f x = x. + +(* maps a permutation to a list of parameters *) +definition Pi_list : ∀X:Nset.(X → X) → list X → list X ≝ + λX,p,xl.map ?? (λx.p x) xl. + +interpretation "permutation of X list" 'middot p x = (Pi_list p x). + +definition swap : ∀N:Nset.N → N → N → N ≝ + λN,u,v,x.match (x == u) with + [true ⇒ v + |false ⇒ match (x == v) with + [true ⇒ u + |false ⇒ x]]. + +axiom swap_right : ∀N,x,y.swap N x y y = x. +(* +#N x y;nnormalize;nrewrite > (p_eqb3 ? y y …);//; +nlapply (refl ? (y ≟ x));ncases (y ≟ x) in ⊢ (???% → %);nnormalize;//; +#H1;napply p_eqb1;//; +nqed. +*) + +axiom swap_left : ∀N,x,y.swap N x y x = y. +(* +#N x y;nnormalize;nrewrite > (p_eqb3 ? x x …);//; +nqed. +*) + +axiom swap_other : ∀N,x,y,z.x ≠ z → y ≠ z → swap N x y z = z. +(* +#N x y z H1 H2;nnormalize;nrewrite > (p_eqb4 …); +##[nrewrite > (p_eqb4 …);//;@;ncases H2;/2/; +##|@;ncases H1;/2/ +##] +nqed. +*) + +axiom swap_inv : ∀N,x,y,z.swap N x y (swap N x y z) = z. +(* +#N x y z;nlapply (refl ? (x ≟ z));ncases (x ≟ z) in ⊢ (???% → ?);#H1 +##[nrewrite > (p_eqb1 … H1);nrewrite > (swap_left …);//; +##|nlapply (refl ? (y ≟ z));ncases (y ≟ z) in ⊢ (???% → ?);#H2 + ##[nrewrite > (p_eqb1 … H2);nrewrite > (swap_right …);//; + ##|nrewrite > (swap_other …) in ⊢ (??(????%)?);/2/; + nrewrite > (swap_other …);/2/; + ##] +##] +nqed. +*) + +axiom swap_fp : ∀N,x1,x2.finite_perm ? (swap N x1 x2). +(* +#N x1 x2;@ +##[@ + ##[nwhd;#xa xb;nnormalize;nlapply (refl ? (xa ≟ x1)); + ncases (xa ≟ x1) in ⊢ (???% → %);#H1 + ##[nrewrite > (p_eqb1 … H1);nlapply (refl ? (xb ≟ x1)); + ncases (xb ≟ x1) in ⊢ (???% → %);#H2 + ##[nrewrite > (p_eqb1 … H2);// + ##|nlapply (refl ? (xb ≟ x2)); + ncases (xb ≟ x2) in ⊢ (???% → %);#H3 + ##[nnormalize;#H4;nrewrite > H4 in H3; + #H3;nrewrite > H3 in H2;#H2;ndestruct (H2) + ##|nnormalize;#H4;nrewrite > H4 in H3; + nrewrite > (p_eqb3 …);//;#H5;ndestruct (H5) + ##] + ##] + ##|nlapply (refl ? (xa ≟ x2)); + ncases (xa ≟ x2) in ⊢ (???% → %);#H2 + ##[nrewrite > (p_eqb1 … H2);nlapply (refl ? (xb ≟ x1)); + ncases (xb ≟ x1) in ⊢ (???% → %);#H3 + ##[nnormalize;#H4;nrewrite > H4 in H3; + #H3;nrewrite > (p_eqb1 … H3);@ + ##|nnormalize;nlapply (refl ? (xb ≟ x2)); + ncases (xb ≟ x2) in ⊢ (???% → %);#H4 + ##[nrewrite > (p_eqb1 … H4);// + ##|nnormalize;#H5;nrewrite > H5 in H3; + nrewrite > (p_eqb3 …);//;#H6;ndestruct (H6); + ##] + ##] + ##|nnormalize;nlapply (refl ? (xb ≟ x1)); + ncases (xb ≟ x1) in ⊢ (???% → %);#H3 + ##[nnormalize;#H4;nrewrite > H4 in H2;nrewrite > (p_eqb3 …);//; + #H5;ndestruct (H5) + ##|nlapply (refl ? (xb ≟ x2)); + ncases (xb ≟ x2) in ⊢ (???% → %);#H4 + ##[nnormalize;#H5;nrewrite > H5 in H1;nrewrite > (p_eqb3 …);//; + #H6;ndestruct (H6) + ##|nnormalize;// + ##] + ##] + ##] + ##] + ##|nwhd;#z;nnormalize;nlapply (refl ? (z ≟ x1)); + ncases (z ≟ x1) in ⊢ (???% → %);#H1 + ##[nlapply (refl ? (z ≟ x2)); + ncases (z ≟ x2) in ⊢ (???% → %);#H2 + ##[@ z;nrewrite > H1;nrewrite > H2;napply p_eqb1;// + ##|@ x2;nrewrite > (p_eqb4 …); + ##[nrewrite > (p_eqb3 …);//; + nnormalize;napply p_eqb1;// + ##|nrewrite < (p_eqb1 … H1);@;#H3;nrewrite > H3 in H2; + nrewrite > (p_eqb3 …);//;#H2;ndestruct (H2) + ##] + ##] + ##|nlapply (refl ? (z ≟ x2)); + ncases (z ≟ x2) in ⊢ (???% → %);#H2 + ##[@ x1;nrewrite > (p_eqb3 …);//; + napply p_eqb1;nnormalize;// + ##|@ z;nrewrite > H1;nrewrite > H2;@; + ##] + ##] + ##] +##|@ [x1;x2];#x0 H1;nrewrite > (swap_other …) + ##[@ + ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;/2/; + ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;//; + ##] +##] +nqed. +*) + +axiom inj_swap : ∀N,u,v.injective ?? (swap N u v). +(* +#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//; +nqed. +*) + +axiom surj_swap : ∀N,u,v.surjective ?? (swap N u v). +(* +#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//; +nqed. +*) + +axiom finite_swap : ∀N,u,v.∃l.∀x.x ∉ l → swap N u v x = x. +(* +#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//; +nqed. +*) + +(* swaps two lists of parameters +definition Pi_swap_list : ∀xl,xl':list X.X → X ≝ + λxl,xl',x.foldr2 ??? (λu,v,r.swap ? u v r) x xl xl'. + +nlemma fp_swap_list : + ∀xl,xl'.finite_perm ? (Pi_swap_list xl xl'). +#xl xl';@ +##[@; + ##[ngeneralize in match xl';nelim xl + ##[nnormalize;//; + ##|#x0 xl0;#IH xl'';nelim xl'' + ##[nnormalize;// + ##|#x1 xl1 IH1 y0 y1;nchange in ⊢ (??%% → ?) with (swap ????); + #H1;nlapply (inj_swap … H1);#H2; + nlapply (IH … H2);// + ##] + ##] + ##|ngeneralize in match xl';nelim xl + ##[nnormalize;#_;#z;@z;@ + ##|#x' xl0 IH xl'';nelim xl'' + ##[nnormalize;#z;@z;@ + ##|#x1 xl1 IH1 z; + nchange in ⊢ (??(λ_.???%)) with (swap ????); + ncases (surj_swap X x' x1 z);#x2 H1; + ncases (IH xl1 x2);#x3 H2;@ x3; + nrewrite < H2;napply H1 + ##] + ##] + ##] +##|ngeneralize in match xl';nelim xl + ##[#;@ [];#;@ + ##|#x0 xl0 IH xl'';ncases xl'' + ##[@ [];#;@ + ##|#x1 xl1;ncases (IH xl1);#xl2 H1; + ncases (finite_swap X x0 x1);#xl3 H2; + @ (xl2@xl3);#x2 H3; + nchange in ⊢ (??%?) with (swap ????); + nrewrite > (H1 …); + ##[nrewrite > (H2 …);//;@;#H4;ncases H3;#H5;napply H5; + napply in_list_to_in_list_append_r;// + ##|@;#H4;ncases H3;#H5;napply H5; + napply in_list_to_in_list_append_l;// + ##] + ##] + ##] +##] +nqed. + +(* the 'reverse' swap of lists of parameters + composing Pi_swap_list and Pi_swap_list_r yields the identity function + (see the Pi_swap_list_inv lemma) *) +ndefinition Pi_swap_list_r : ∀xl,xl':list X. Pi ≝ + λxl,xl',x.foldl2 ??? (λr,u,v.swap ? u v r ) x xl xl'. + +nlemma fp_swap_list_r : + ∀xl,xl'.finite_perm ? (Pi_swap_list_r xl xl'). +#xl xl';@ +##[@; + ##[ngeneralize in match xl';nelim xl + ##[nnormalize;//; + ##|#x0 xl0;#IH xl'';nelim xl'' + ##[nnormalize;// + ##|#x1 xl1 IH1 y0 y1;nwhd in ⊢ (??%% → ?); + #H1;nlapply (IH … H1);#H2; + napply (inj_swap … H2); + ##] + ##] + ##|ngeneralize in match xl';nelim xl + ##[nnormalize;#_;#z;@z;@ + ##|#x' xl0 IH xl'';nelim xl'' + ##[nnormalize;#z;@z;@ + ##|#x1 xl1 IH1 z;nwhd in ⊢ (??(λ_.???%)); + ncases (IH xl1 z);#x2 H1; + ncases (surj_swap X x' x1 x2);#x3 H2; + @ x3;nrewrite < H2;napply H1; + ##] + ##] + ##] +##|ngeneralize in match xl';nelim xl + ##[#;@ [];#;@ + ##|#x0 xl0 IH xl'';ncases xl'' + ##[@ [];#;@ + ##|#x1 xl1; + ncases (IH xl1);#xl2 H1; + ncases (finite_swap X x0 x1);#xl3 H2; + @ (xl2@xl3);#x2 H3;nwhd in ⊢ (??%?); + nrewrite > (H2 …); + ##[nrewrite > (H1 …);//;@;#H4;ncases H3;#H5;napply H5; + napply in_list_to_in_list_append_l;// + ##|@;#H4;ncases H3;#H5;napply H5; + napply in_list_to_in_list_append_r;// + ##] + ##] + ##] +##] +nqed. + +nlemma Pi_swap_list_inv : + ∀xl1,xl2,x. + Pi_swap_list xl1 xl2 (Pi_swap_list_r xl1 xl2 x) = x. +#xl;nelim xl +##[#;@ +##|#x1 xl1 IH xl';ncases xl' + ##[#;@ + ##|#x2 xl2;#x; + nchange in ⊢ (??%?) with + (swap ??? (Pi_swap_list ?? + (Pi_swap_list_r ?? (swap ????)))); + nrewrite > (IH xl2 ?);napply swap_inv; + ##] +##] +nqed. + +nlemma Pi_swap_list_fresh : + ∀x,xl1,xl2.x ∉ xl1 → x ∉ xl2 → Pi_swap_list xl1 xl2 x = x. +#x xl1;nelim xl1 +##[#;@ +##|#x3 xl3 IH xl2' H1;ncases xl2' + ##[#;@ + ##|#x4 xl4 H2;ncut (x ∉ xl3 ∧ x ∉ xl4); + ##[@ + ##[@;#H3;ncases H1;#H4;napply H4;/2/; + ##|@;#H3;ncases H2;#H4;napply H4;/2/ + ##] + ##] *; #H1' H2'; + nchange in ⊢ (??%?) with (swap ????); + nrewrite > (swap_other …) + ##[napply IH;//; + ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???); + nrewrite > (IH …);//;@;#H3;ncases H2;#H4;napply H4;//; + ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???); + nrewrite > (IH …);//;@;#H3;ncases H1;#H4;napply H4;// + ##] + ##] +##] +nqed. +*) \ No newline at end of file diff --git a/matita/matita/broken_lib/binding/ln.ma b/matita/matita/broken_lib/binding/ln.ma new file mode 100644 index 000000000..ca7f574ed --- /dev/null +++ b/matita/matita/broken_lib/binding/ln.ma @@ -0,0 +1,716 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basics/lists/list.ma". +include "basics/deqsets.ma". +include "binding/names.ma". +include "binding/fp.ma". + +axiom alpha : Nset. +notation "𝔸" non associative with precedence 90 for @{'alphabet}. +interpretation "set of names" 'alphabet = alpha. + +inductive tp : Type[0] ≝ +| top : tp +| arr : tp → tp → tp. +inductive pretm : Type[0] ≝ +| var : nat → pretm +| par : 𝔸 → pretm +| abs : tp → pretm → pretm +| app : pretm → pretm → pretm. + +let rec Nth T n (l:list T) on n ≝ + match l with + [ nil ⇒ None ? + | cons hd tl ⇒ match n with + [ O ⇒ Some ? hd + | S n0 ⇒ Nth T n0 tl ] ]. + +let rec vclose_tm_aux u x k ≝ match u with + [ var n ⇒ if (leb k n) then var (S n) else u + | par x0 ⇒ if (x0 == x) then (var k) else u + | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k) + | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ]. +definition vclose_tm ≝ λu,x.vclose_tm_aux u x O. + +definition vopen_var ≝ λn,x,k.match eqb n k with + [ true ⇒ par x + | false ⇒ match leb n k with + [ true ⇒ var n + | false ⇒ var (pred n) ] ]. + +let rec vopen_tm_aux u x k ≝ match u with + [ var n ⇒ vopen_var n x k + | par x0 ⇒ u + | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k) + | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ]. +definition vopen_tm ≝ λu,x.vopen_tm_aux u x O. + +let rec FV u ≝ match u with + [ par x ⇒ [x] + | app v1 v2 ⇒ FV v1@FV v2 + | abs s v ⇒ FV v + | _ ⇒ [ ] ]. + +definition lam ≝ λx,s,u.abs s (vclose_tm u x). + +let rec Pi_map_tm p u on u ≝ match u with +[ par x ⇒ par (p x) +| var _ ⇒ u +| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2) +| abs s v ⇒ abs s (Pi_map_tm p v) ]. + +interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x). + +notation "hvbox(u⌈x⌉)" + with precedence 45 + for @{ 'open $u $x }. + +(* +notation "hvbox(u⌈x⌉)" + with precedence 45 + for @{ 'open $u $x }. +notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }. +*) +interpretation "ln term variable open" 'open u x = (vopen_tm u x). +notation < "hvbox(ν x break . u)" + with precedence 20 +for @{'nu $x $u }. +notation > "ν list1 x sep , . term 19 u" with precedence 20 + for ${ fold right @{$u} rec acc @{'nu $x $acc)} }. +interpretation "ln term variable close" 'nu x u = (vclose_tm u x). + +let rec tm_height u ≝ match u with +[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2)) +| abs s v ⇒ S (tm_height v) +| _ ⇒ O ]. + +theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n. +#n (cases n) // #a #abs cases (?:False) /2/ qed. + +theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0]. +(∀m.(∀p. p < m → P p) → P m) → P n. +#n #P #H +cut (∀q:nat. q ≤ n → P q) /2/ +(elim n) + [#q #HleO (* applica male *) + @(le_n_O_rect_Type0 ? HleO) + @H #p #ltpO cases (?:False) /2/ (* 3 *) + |#p #Hind #q #HleS + @H #a #lta @Hind @le_S_S_to_le /2/ + ] +qed. + +lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n. +#n elim n +[ #m normalize #H destruct(H) +| #n0 #IH * // #m normalize #H @le_S_S @IH // ] +qed. + +lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u. +#x #u elim u +[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk + [ >Hnk >eqb_n_n normalize >(\b ?) // + | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb + [ >Hleb normalize >(?:leb k n = false) // + @lt_to_leb_false @not_eq_to_le_to_lt /2/ + | >Hleb normalize >(?:leb k (pred n) = true) normalize + [ cases (leb_false_to_lt … Hleb) // + | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ] +| #y normalize #Hy >(\bf ?) // @(not_to_not … Hy) // +| #s #v #IH normalize #Hv #k >IH // @Hv +| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k + >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ] + @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ] +qed. + +corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u. +#x #u #Hu @nominal_eta_aux // +qed. + +lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v. +#v #x elim v +[ #n #k normalize cases (eqb n k) // cases (leb n k) // +| #u #k % +| #s #u #IH #k normalize >IH % +| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ] +qed. + +corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v. +#v #x @eq_height_vopen_aux +qed. + +theorem pretm_ind_plus_aux : + ∀P:pretm → Type[0]. + (∀x:𝔸.P (par x)) → + (∀n:ℕ.P (var n)) → + (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → + ∀C:list 𝔸. + (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → + ∀n,u.tm_height u ≤ n → P u. +#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??) +#m cases m +[ #_ * /2/ + [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/ + | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (max ??)) + [ #H @H @Hfalse|*:skip] ] ] +-m #m #IH * /2/ +[ #s #v whd in ⊢ (?%?→?); #Hv + lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy + >(?:abs s v = lam y s (v⌈y⌉)) + [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ] + @Hlam + [ @(not_to_not … Hy) @in_list_to_in_list_append_r + | @(not_to_not … Hy) @in_list_to_in_list_append_l ] + @IH [| @Hv | >eq_height_vopen % ] +| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ + [ @IH [| @Hv | @le_max_1 ] | @IH [| @Hv | @le_max_2 ] ] ] +qed. + +corollary pretm_ind_plus : + ∀P:pretm → Type[0]. + (∀x:𝔸.P (par x)) → + (∀n:ℕ.P (var n)) → + (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → + ∀C:list 𝔸. + (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → + ∀u.P u. +#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/ +qed. + +(* maps a permutation to a list of terms *) +definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 . + +(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*) + +(* +inductive tm : pretm → Prop ≝ +| tm_par : ∀x:𝔸.tm (par x) +| tm_app : ∀u,v.tm u → tm v → tm (app u v) +| tm_lam : ∀x,s,u.tm u → tm (lam x s u). + +inductive ctx_aux : nat → pretm → Prop ≝ +| ctx_var : ∀n,k.n < k → ctx_aux k (var n) +| ctx_par : ∀x,k.ctx_aux k (par x) +| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v) +(* è sostituibile da ctx_lam ? *) +| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u). +*) + +inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝ +| toc_var : ∀n.n < k → tm_or_ctx k (var n) +| toc_par : ∀x.tm_or_ctx k (par x) +| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v) +| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u). + +definition tm ≝ λt.tm_or_ctx O t. +definition ctx ≝ λt.tm_or_ctx 1 t. + +definition check_tm ≝ λu,k. + pretm_ind_plus ? + (λ_.true) + (λn.leb (S n) k) + (λv1,v2,rv1,rv2.rv1 ∧ rv2) + [] (λx,s,v,px,pC,rv.rv) + u. + +axiom pretm_ind_plus_app : ∀P,u,v,C,H1,H2,H3,H4. + pretm_ind_plus P H1 H2 H3 C H4 (app u v) = + H3 u v (pretm_ind_plus P H1 H2 H3 C H4 u) (pretm_ind_plus P H1 H2 H3 C H4 v). + +axiom pretm_ind_plus_lam : ∀P,x,s,u,C,px,pC,H1,H2,H3,H4. + pretm_ind_plus P H1 H2 H3 C H4 (lam x s (u⌈x⌉)) = + H4 x s u px pC (pretm_ind_plus P H1 H2 H3 C H4 (u⌈x⌉)). + +record TM : Type[0] ≝ { + pretm_of_TM :> pretm; + tm_of_TM : check_tm pretm_of_TM O = true +}. + +record CTX : Type[0] ≝ { + pretm_of_CTX :> pretm; + ctx_of_CTX : check_tm pretm_of_CTX 1 = true +}. + +inductive tm2 : pretm → Type[0] ≝ +| tm_par : ∀x.tm2 (par x) +| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v) +| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)). + +(* +inductive tm' : pretm → Prop ≝ +| tm_par : ∀x.tm' (par x) +| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v) +| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)). +*) + +lemma pi_vclose_tm : + ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u). +#z1 #z2 #x #u +change with (vclose_tm_aux ???) in match (vclose_tm ??); +change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u normalize // +[ #n #k cases (leb k n) normalize % +| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 normalize + [ cases (true_or_false (x0==x)) #H2 >H2 normalize + [ <(\P H2) >H1 normalize >(\b (refl ? z2)) % + | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize + [ >(\P H3) in H2; >H1 #Hfalse destruct (Hfalse) + | cases (true_or_false (x==z2)) #H4 >H4 normalize + [ cases (true_or_false (z2==z1)) #H5 >H5 normalize // + >(\P H5) in H4; >H3 #Hfalse destruct (Hfalse) + | >(\bf ?) // @sym_not_eq @(\Pf H4) ] + ] + ] + | cases (true_or_false (x0==x)) #H2 >H2 normalize + [ <(\P H2) >H1 normalize >(\b (refl ??)) % + | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize + [ cases (true_or_false (x0==z2)) #H4 >H4 normalize + [ cases (true_or_false (z1==z2)) #H5 >H5 normalize // + <(\P H5) in H4; <(\P H3) >H2 #Hfalse destruct (Hfalse) + | >H4 % ] + | cases (true_or_false (x0==z2)) #H4 >H4 normalize + [ cases (true_or_false (x==z2)) #H5 >H5 normalize + [ <(\P H5) in H4; >H2 #Hfalse destruct (Hfalse) + | >(\bf ?) // @sym_not_eq @(\Pf H3) ] + | cases (true_or_false (x==z2)) #H5 >H5 normalize + [ >H1 % + | >H2 % ] + ] + ] + ] + ] +] +qed. + +lemma pi_vopen_tm : + ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉). +#z1 #z2 #x #u +change with (vopen_tm_aux ???) in match (vopen_tm ??); +change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u normalize // +#n #k cases (true_or_false (eqb n k)) #H1 >H1 normalize // +cases (true_or_false (leb n k)) #H2 >H2 normalize // +qed. + +lemma pi_lam : + ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u). +#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) % +qed. + +lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u). +#z1 #z2 #u elim u // +[ #s #v normalize // +| #v1 #v2 normalize /2/ ] +qed. + +lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u. +#z1 #z2 #u elim u [1,3,4:normalize //] +#x whd in ⊢ (??%?); >swap_inv % +qed. + +lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l. +#x #l #z1 #z2 #Hin elim Hin +[ #x0 #l0 % +| #x1 #x2 #l0 #Hin #IH %2 @IH ] +qed. + +lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u). +#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/ +#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3 +[ @(not_to_not … Hx) -Hx #Hx + <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list // +| #y #Hy <(swap_inv ? z1 z2 y) + eqv_FV @eqv_in_list // +] +qed. + +lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u. +#x #u elim u normalize // +[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?); + [ cases (true_or_false (eqb (S n) k)) #H1 >H1 + [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H + cases (le_to_not_lt … H) -H #H cases (H ?) % + | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ] + | cases (true_or_false (eqb n k)) #H1 >H1 normalize + [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H + * #H cases (H ?) % + | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H; + [ #H destruct (H) | /2/ ] + ] + ] +| #x0 #k cases (true_or_false (x0==x)) #H1 >H1 normalize // >(\P H1) >eqb_n_n % ] +qed. + +lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux +qed. + +(* +theorem tm_to_tm : ∀t.tm' t → tm t. +#t #H elim H +*) + +lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2. +#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/ +qed. + +lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k). +#u #x elim u // +[ #n #k normalize cases (leb k n) normalize // +| #x0 #k normalize cases (true_or_false (x0==x)) #H >H normalize // + lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) % +| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) /2/ ] +qed. + +lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). // +qed. + +lemma check_tm_true_to_toc : ∀u,k.check_tm u k = true → tm_or_ctx k u. +#u @(pretm_ind_plus ???? [ ] ? u) +[ #x #k #_ %2 +| #n #k change with (leb (S n) k) in ⊢ (??%?→?); #H % @leb_true_to_le // +| #v1 #v2 #rv1 #rv2 #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?); + >pretm_ind_plus_app #H cases (andb_true ?? H) -H #Hv1 #Hv2 %3 + [ @rv1 @Hv1 | @rv2 @Hv2 ] +| #x #s #v #Hx #_ #rv #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?); + >pretm_ind_plus_lam // #Hv %4 @rv @Hv ] +qed. + +lemma toc_to_check_tm_true : ∀u,k.tm_or_ctx k u → check_tm u k = true. +#u #k #Hu elim Hu // +[ #n #Hn change with (leb (S n) k) in ⊢ (??%?); @le_to_leb_true @Hn +| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 change with (pretm_ind_plus ???????) in ⊢ (??%?); + >pretm_ind_plus_app change with (check_tm v1 k ∧ check_tm v2 k) in ⊢ (??%?); /2/ +| #x #s #v #Hv #IH <(vclose_vopen x v) change with (pretm_ind_plus ???????) in ⊢ (??%?); + >pretm_ind_plus_lam [| // | @fresh_vclose_tm ] >(vclose_vopen x v) @IH ] +qed. + +lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u. +#z1 #z2 #u elim u +[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other // + [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] // +|1: // +| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1] +| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2 + >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ] + >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ] +] +qed. + +theorem tm_to_tm2 : ∀u.tm u → tm2 u. +#t #Ht elim Ht +[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn) +| @tm_par +| #u #v #Hu #Hv @tm_app +| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam + [ @fresh_vclose_tm + | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ] +] +qed. + +theorem tm2_to_tm : ∀u.tm2 u → tm u. +#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH // +qed. + +(* define PAR APP LAM *) +definition PAR ≝ λx.mk_TM (par x) ?. // qed. +definition APP ≝ λu,v:TM.mk_TM (app u v) ?. +change with (pretm_ind_plus ???????) in match (check_tm ??); >pretm_ind_plus_app +change with (check_tm ??) in match (pretm_ind_plus ???????); change with (check_tm ??) in match (pretm_ind_plus ???????) in ⊢ (??(??%)?); +@andb_elim >(tm_of_TM u) >(tm_of_TM v) % qed. +definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?. +change with (pretm_ind_plus ???????) in match (check_tm ??); <(vclose_vopen x u) +>pretm_ind_plus_lam [| // | @fresh_vclose_tm ] +change with (check_tm ??) in match (pretm_ind_plus ???????); >vclose_vopen +@(tm_of_TM u) qed. + +axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉). +(* needs true_plus_false + +#u #x #k #Hu elim Hu +[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2] + normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ] + normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ] + #n0 #_ #Hn0 % @le_S_S_to_le // +| #x0 %2 +| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 // +| #x0 #s #v #Hv #IH normalize @daemon +] +qed. +*) + +definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) ?. +@toc_to_check_tm_true @vopen_tm_down @check_tm_true_to_toc @ctx_of_CTX qed. + +axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u). + +definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) ?. +@toc_to_check_tm_true @vclose_tm_up @check_tm_true_to_toc @tm_of_TM qed. + +interpretation "ln wf term variable open" 'open u x = (vopen_TM u x). +interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x). + +theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉). +#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta // +qed. + +lemma TM_to_tm2 : ∀u:TM.tm2 u. +#u @tm_to_tm2 @check_tm_true_to_toc @tm_of_TM qed. + +theorem TM_ind_plus_weak : + ∀P:pretm → Type[0]. + (∀x:𝔸.P (PAR x)) → + (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) → + ∀C:list 𝔸. + (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C → + (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) → + ∀u:TM.P u. +#P #Hpar #Happ #C #Hlam #u elim (TM_to_tm2 u) // +[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2) + @toc_to_check_tm_true @tm2_to_tm // +| #x #s #v #Hx #pv #IH + lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0 + >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉)) + [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ] + @(Hlam x0 s (mk_CTX v ?) ??) + [ <(nominal_eta … Hx) @toc_to_check_tm_true @vclose_tm_up @tm2_to_tm @pv // + | @(not_to_not … Hx0) @in_list_to_in_list_append_r + | @(not_to_not … Hx0) @in_list_to_in_list_append_l + | @IH ] +] +qed. + +lemma eq_mk_TM : ∀u,v.u = v → ∀pu,pv.mk_TM u pu = mk_TM v pv. +#u #v #Heq >Heq #pu #pv % +qed. + +lemma eq_P : ∀T:Type[0].∀t1,t2:T.t1 = t2 → ∀P:T → Type[0].P t1 → P t2. // qed. + +theorem TM_ind_plus : + ∀P:TM → Type[0]. + (∀x:𝔸.P (PAR x)) → + (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) → + ∀C:list 𝔸. + (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C → + (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) → + ∀u:TM.P u. +#P #Hpar #Happ #C #Hlam * #u #pu +>(?:mk_TM u pu = + mk_TM u (toc_to_check_tm_true … (tm2_to_tm … (tm_to_tm2 … (check_tm_true_to_toc … pu))))) [|%] +elim (tm_to_tm2 u ?) // +[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2) +| #x #s #v #Hx #pv #IH + lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0 + lapply (Hlam x0 s (mk_CTX v ?) ???) + [2: @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 + |4: @toc_to_check_tm_true <(nominal_eta x v) // @vclose_tm_up @tm2_to_tm @pv // + | #y #Hy whd in match (vopen_TM ??); + >(?:mk_TM (v⌈y⌉) ? = mk_TM (v⌈y⌉) (toc_to_check_tm_true (v⌈y⌉) O (tm2_to_tm (v⌈y⌉) (pv y Hy)))) + [@IH|%] + | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0 + | @eq_P @eq_mk_TM whd in match (vopen_TM ??); @tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ] +] +qed. + +notation +"hvbox('nominal' u 'return' out 'with' + [ 'xpar' ident x ⇒ f1 + | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2 + | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])" +with precedence 48 +for @{ TM_ind_plus $out (λ${ident x}:?.$f1) + (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2) + $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3) + $u }. + +(* include "basics/jmeq.ma".*) + +definition subst ≝ (λu:TM.λx,v. + nominal u return (λ_.TM) with + [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ] (* u instead of PAR x0 does not work, u stays the same at every rec call! *) + | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2 + | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]). + +lemma subst_def : ∀u,x,v.subst u x v = + nominal u return (λ_.TM) with + [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ] + | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2 + | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]. // +qed. + +axiom TM_ind_plus_LAM : + ∀x,s,u,out,f1,f2,C,f3,Hx1,Hx2. + TM_ind_plus out f1 f2 C f3 (LAM x s (u⌈x⌉)) = + f3 x s u Hx1 Hx2 (λy,Hy.TM_ind_plus ? f1 f2 C f3 ?). + +axiom TM_ind_plus_APP : + ∀u1,u2,out,f1,f2,C,f3. + TM_ind_plus out f1 f2 C f3 (APP u1 u2) = + f2 u1 u2 (TM_ind_plus out f1 f2 C f3 ?) (TM_ind_plus out f1 f2 C f3 ?). + +lemma eq_mk_CTX : ∀u,v.u = v → ∀pu,pv.mk_CTX u pu = mk_CTX v pv. +#u #v #Heq >Heq #pu #pv % +qed. + +lemma vclose_vopen_TM : ∀x.∀u:TM.((νx.u)⌈x⌉) = u. +#x * #u #pu @eq_mk_TM @vclose_vopen qed. + +lemma nominal_eta_CTX : ∀x.∀u:CTX.x ∉ FV u → (νx.(u⌈x⌉)) = u. +#x * #u #pu #Hx @eq_mk_CTX @nominal_eta // qed. + +theorem TM_alpha : ∀x,y,s.∀u:CTX.x ∉ FV u → y ∉ FV u → LAM x s (u⌈x⌉) = LAM y s (u⌈y⌉). +#x #y #s #u #Hx #Hy @eq_mk_TM @tm_alpha // qed. + +axiom in_vopen_CTX : ∀x,y.∀v:CTX.x ∈ FV (v⌈y⌉) → x = y ∨ x ∈ FV v. + +theorem subst_fresh : ∀u,v:TM.∀x.x ∉ FV u → subst u x v = u. +#u #v #x @(TM_ind_plus … (x::FV v) … u) +[ #x0 normalize in ⊢ (%→?); #Hx normalize in ⊢ (??%?); + >(\bf ?) [| @(not_to_not … Hx) #Heq >Heq % ] % +| #u1 #u2 #IH1 #IH2 normalize in ⊢ (%→?); #Hx + >subst_def >TM_ind_plus_APP @eq_mk_TM @eq_f2 @eq_f + [ subst_def >TM_ind_plus_LAM [|@HC|@Hx0] + @eq_f nominal_eta_CTX // + cases (in_vopen_CTX … Hx) // #Heq >Heq in HC; * #HC @False_ind @HC % +] +qed. + +example subst_LAM_same : ∀x,s,u,v. subst (LAM x s u) x v = LAM x s u. +#x #s #u #v >subst_def <(vclose_vopen_TM x u) +lapply (p_fresh … (FV (νx.u)@x::FV v)) letin x0 ≝ (N_fresh … (FV (νx.u)@x::FV v)) #Hx0 +>(TM_alpha x x0) +[| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 | @fresh_vclose_tm ] +>TM_ind_plus_LAM [| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0 | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 ] +@eq_f change with (subst ((νx.u)⌈x0⌉) x v) in ⊢ (??%?); @subst_fresh +@(not_to_not … Hx0) #Hx0' cases (in_vopen_CTX … Hx0') +[ #Heq >Heq @in_list_to_in_list_append_r % +| #Hfalse @False_ind cases (fresh_vclose_tm u x) #H @H @Hfalse ] +qed. + +(* +notation > "Λ ident x. ident T [ident x] ↦ P" + with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}. + +notation < "Λ ident x. ident T [ident x] ↦ P" + with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}. +*) + +(* +notation +"hvbox('nominal' u 'with' + [ 'xpar' ident x ⇒ f1 + | 'xapp' ident v1 ident v2 ⇒ f2 + | 'xlam' ident x # C s w ⇒ f3 ])" +with precedence 48 +for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) + (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) + $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. +*) + +(* +notation +"hvbox('nominal' u 'with' + [ 'xpar' ident x ^ f1 + | 'xapp' ident v1 ident v2 ^ f2 ])" +(* | 'xlam' ident x # C s w ^ f3 ]) *) +with precedence 48 +for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) + (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) + $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. +*) +notation +"hvbox('nominal' u 'with' + [ 'xpar' ident x ^ f1 + | 'xapp' ident v1 ident v2 ^ f2 ])" +with precedence 48 +for @{ tm2_ind_plus ? (λ${ident x}:?.$f1) + (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) + $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. + +axiom in_Env : 𝔸 × tp → Env → Prop. +notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. +interpretation "Env membership" 'lefttriangle x l = (in_Env x l). + + + +inductive judg : list tp → tm → tp → Prop ≝ +| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t +| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u +| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u). + +definition Env := list (𝔸 × tp). + +axiom vclose_env : Env → list tp. +axiom vclose_tm : Env → tm → tm. +axiom Lam : 𝔸 → tp → tm → tm. +definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T. +definition dom ≝ λG:Env.map ?? (fst ??) G. + +definition sctx ≝ 𝔸 × tm. +axiom swap_tm : 𝔸 → 𝔸 → tm → tm. +definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M. + +axiom in_list : ∀A:Type[0].A → list A → Prop. +interpretation "list membership" 'mem x l = (in_list ? x l). +interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)). + +axiom in_Env : 𝔸 × tp → Env → Prop. +notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. +interpretation "Env membership" 'lefttriangle x l = (in_Env x l). + +(* axiom Lookup : 𝔸 → Env → option tp. *) + +(* forma alto livello del judgment + t_abs* : ∀G,T,X,M,U. + (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) → + Judg G (Lam X T (M[X])) (arr T U) *) + +(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *) + +axiom Judg_ind : ∀P:Env → tm → tp → Prop. + (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) → + (∀G,M,N,T,U. + Judg G M (arr T U) → Judg G N T → + P G M (arr T U) → P G N T → P G (app M N) U) → + (∀G,T1,T2,X,M1. + (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) → + (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) → + P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) → + ∀G,M,T.Judg G M T → P G M T. + +axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T. +axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U. +axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U). + +definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2. +interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2). + +axiom daemon : ∀P:Prop.P. + +theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T. +#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?) +@(Judg_ind … HJ) +[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub // +| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2 + [| @IH1 // | @IH2 // ] +| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH + [ (* trivial property of Lam *) @daemon + | (* trivial property of subenv *) @daemon ] +] +qed. + +(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e + ricorsione *) \ No newline at end of file diff --git a/matita/matita/broken_lib/binding/ln_concrete.ma b/matita/matita/broken_lib/binding/ln_concrete.ma new file mode 100644 index 000000000..bdafdb1a0 --- /dev/null +++ b/matita/matita/broken_lib/binding/ln_concrete.ma @@ -0,0 +1,683 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basics/lists/list.ma". +include "basics/deqsets.ma". +include "binding/names.ma". +include "binding/fp.ma". + +definition alpha : Nset ≝ X. check alpha +notation "𝔸" non associative with precedence 90 for @{'alphabet}. +interpretation "set of names" 'alphabet = alpha. + +inductive tp : Type[0] ≝ +| top : tp +| arr : tp → tp → tp. +inductive pretm : Type[0] ≝ +| var : nat → pretm +| par : 𝔸 → pretm +| abs : tp → pretm → pretm +| app : pretm → pretm → pretm. + +let rec Nth T n (l:list T) on n ≝ + match l with + [ nil ⇒ None ? + | cons hd tl ⇒ match n with + [ O ⇒ Some ? hd + | S n0 ⇒ Nth T n0 tl ] ]. + +let rec vclose_tm_aux u x k ≝ match u with + [ var n ⇒ if (leb k n) then var (S n) else u + | par x0 ⇒ if (x0 == x) then (var k) else u + | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k) + | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ]. +definition vclose_tm ≝ λu,x.vclose_tm_aux u x O. + +definition vopen_var ≝ λn,x,k.match eqb n k with + [ true ⇒ par x + | false ⇒ match leb n k with + [ true ⇒ var n + | false ⇒ var (pred n) ] ]. + +let rec vopen_tm_aux u x k ≝ match u with + [ var n ⇒ vopen_var n x k + | par x0 ⇒ u + | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k) + | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ]. +definition vopen_tm ≝ λu,x.vopen_tm_aux u x O. + +let rec FV u ≝ match u with + [ par x ⇒ [x] + | app v1 v2 ⇒ FV v1@FV v2 + | abs s v ⇒ FV v + | _ ⇒ [ ] ]. + +definition lam ≝ λx,s,u.abs s (vclose_tm u x). + +let rec Pi_map_tm p u on u ≝ match u with +[ par x ⇒ par (p x) +| var _ ⇒ u +| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2) +| abs s v ⇒ abs s (Pi_map_tm p v) ]. + +interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x). + +notation "hvbox(u⌈x⌉)" + with precedence 45 + for @{ 'open $u $x }. + +(* +notation "hvbox(u⌈x⌉)" + with precedence 45 + for @{ 'open $u $x }. +notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }. +*) +interpretation "ln term variable open" 'open u x = (vopen_tm u x). +notation < "hvbox(ν x break . u)" + with precedence 20 +for @{'nu $x $u }. +notation > "ν list1 x sep , . term 19 u" with precedence 20 + for ${ fold right @{$u} rec acc @{'nu $x $acc)} }. +interpretation "ln term variable close" 'nu x u = (vclose_tm u x). + +let rec tm_height u ≝ match u with +[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2)) +| abs s v ⇒ S (tm_height v) +| _ ⇒ O ]. + +theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n. +#n (cases n) // #a #abs cases (?:False) /2/ qed. + +theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0]. +(∀m.(∀p. p < m → P p) → P m) → P n. +#n #P #H +cut (∀q:nat. q ≤ n → P q) /2/ +(elim n) + [#q #HleO (* applica male *) + @(le_n_O_rect_Type0 ? HleO) + @H #p #ltpO cases (?:False) /2/ (* 3 *) + |#p #Hind #q #HleS + @H #a #lta @Hind @le_S_S_to_le /2/ + ] +qed. + +lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n. +#n elim n +[ #m normalize #H destruct(H) +| #n0 #IH * // #m normalize #H @le_S_S @IH // ] +qed. + +lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u. +#x #u elim u +[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk + [ >Hnk >eqb_n_n whd in ⊢ (??%?); >(\b ?) // + | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb + [ >Hleb normalize >(?:leb k n = false) // + @lt_to_leb_false @not_eq_to_le_to_lt /2/ + | >Hleb normalize >(?:leb k (pred n) = true) normalize + [ cases (leb_false_to_lt … Hleb) // + | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ] +| #y normalize in ⊢ (%→?→?); #Hy whd in ⊢ (?→??%?); >(\bf ?) // @(not_to_not … Hy) // +| #s #v #IH normalize #Hv #k >IH // @Hv +| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k + >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ] + @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ] +qed. + +corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u. +#x #u #Hu @nominal_eta_aux // +qed. + +lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v. +#v #x elim v +[ #n #k normalize cases (eqb n k) // cases (leb n k) // +| #u #k % +| #s #u #IH #k normalize >IH % +| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ] +qed. + +corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v. +#v #x @eq_height_vopen_aux +qed. + +theorem pretm_ind_plus_aux : + ∀P:pretm → Type[0]. + (∀x:𝔸.P (par x)) → + (∀n:ℕ.P (var n)) → + (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → + ∀C:list 𝔸. + (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → + ∀n,u.tm_height u ≤ n → P u. +#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??) +#m cases m +[ #_ * /2/ + [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/ + | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (S (max ??))) /2/ ] ] +-m #m #IH * /2/ +[ #s #v whd in ⊢ (?%?→?); #Hv + lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy + >(?:abs s v = lam y s (v⌈y⌉)) + [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ] + @Hlam + [ @(not_to_not … Hy) @in_list_to_in_list_append_r + | @(not_to_not … Hy) @in_list_to_in_list_append_l ] + @IH [| @Hv | >eq_height_vopen % ] +| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ + [ @IH [| @Hv | // ] | @IH [| @Hv | // ] ] ] +qed. + +corollary pretm_ind_plus : + ∀P:pretm → Type[0]. + (∀x:𝔸.P (par x)) → + (∀n:ℕ.P (var n)) → + (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → + ∀C:list 𝔸. + (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → + ∀u.P u. +#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/ +qed. + +(* maps a permutation to a list of terms *) +definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 . + +(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*) + +(* +inductive tm : pretm → Prop ≝ +| tm_par : ∀x:𝔸.tm (par x) +| tm_app : ∀u,v.tm u → tm v → tm (app u v) +| tm_lam : ∀x,s,u.tm u → tm (lam x s u). + +inductive ctx_aux : nat → pretm → Prop ≝ +| ctx_var : ∀n,k.n < k → ctx_aux k (var n) +| ctx_par : ∀x,k.ctx_aux k (par x) +| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v) +(* è sostituibile da ctx_lam ? *) +| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u). +*) + +inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝ +| toc_var : ∀n.n < k → tm_or_ctx k (var n) +| toc_par : ∀x.tm_or_ctx k (par x) +| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v) +| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u). + +definition tm ≝ λt.tm_or_ctx O t. +definition ctx ≝ λt.tm_or_ctx 1 t. + +record TM : Type[0] ≝ { + pretm_of_TM :> pretm; + tm_of_TM : tm pretm_of_TM +}. + +record CTX : Type[0] ≝ { + pretm_of_CTX :> pretm; + ctx_of_CTX : ctx pretm_of_CTX +}. + +inductive tm2 : pretm → Type[0] ≝ +| tm_par : ∀x.tm2 (par x) +| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v) +| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)). + +(* +inductive tm' : pretm → Prop ≝ +| tm_par : ∀x.tm' (par x) +| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v) +| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)). +*) + +axiom swap_inj : ∀N.∀z1,z2,x,y.swap N z1 z2 x = swap N z1 z2 y → x = y. + +lemma pi_vclose_tm : + ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u). +#z1 #z2 #x #u +change with (vclose_tm_aux ???) in match (vclose_tm ??); +change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u +[3:whd in ⊢ (?→?→(?→ ??%%)→?→??%%); // +|4:whd in ⊢ (?→?→(?→??%%)→(?→??%%)→?→??%%); // +| #n #k whd in ⊢ (??(??%)%); cases (leb k n) normalize % +| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 whd in ⊢ (??%%); + [ cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%); + [ <(\P H2) >H1 whd in ⊢ (??(??%)%); >(\b ?) // >(\b ?) // + | >H2 whd in match (swap ????); >H1 + whd in match (if false then var k else ?); + whd in match (if true then z2 else ?); >(\bf ?) + [ >(\P H1) >swap_left % + | <(swap_inv ? z1 z2 z2) in ⊢ (?(??%?)); % #H3 + lapply (swap_inj … H3) >swap_right #H4

H1 #H destruct (H) ] + ] + | >(?:(swap ? z1 z2 x0 == swap ? z1 z2 x) = (x0 == x)) + [| cases (true_or_false (x0==x)) #H2 >H2 + [ >(\P H2) @(\b ?) % + | @(\bf ?) % #H >(swap_inj … H) in H2; >(\b ?) // #H0 destruct (H0) ] ] + cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%); + [ <(\P H2) >H1 >(\b (refl ??)) % + | >H1 >H2 % ] + ] + ] +qed. + +lemma pi_vopen_tm : + ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉). +#z1 #z2 #x #u +change with (vopen_tm_aux ???) in match (vopen_tm ??); +change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u // +[2: #s #v whd in ⊢ ((?→??%%)→?→??%%); // +|3: #v1 #v2 whd in ⊢ ((?→??%%)→(?→??%%)→?→??%%); /2/ ] +#n #k whd in ⊢ (??(??%)%); cases (true_or_false (eqb n k)) #H1 >H1 // +cases (true_or_false (leb n k)) #H2 >H2 normalize // +qed. + +lemma pi_lam : + ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u). +#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) % +qed. + +lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u). +#z1 #z2 #u elim u // +[ #s #v #H @H +| #v1 #v2 whd in ⊢ (??%%→??%%→??%%); #H1 #H2 >H1 >H2 + whd in ⊢ (???(????%)); /2/ ] +qed. + +lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u. +#z1 #z2 #u elim u +[1: #n % +|3: #s #v whd in ⊢ (?→??%%); // +|4: #v1 #v2 #Hv1 #Hv2 whd in ⊢ (??%%); // ] +#x whd in ⊢ (??%?); >swap_inv % +qed. + +lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l. +#x #l #z1 #z2 #Hin elim Hin +[ #x0 #l0 % +| #x1 #x2 #l0 #Hin #IH %2 @IH ] +qed. + +lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u). +#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/ +#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3 +[ @(not_to_not … Hx) -Hx #Hx + <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list // +| #y #Hy <(swap_inv ? z1 z2 y) + eqv_FV @eqv_in_list // +] +qed. + +lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u. +#x #u elim u [1,3,4:normalize //] +[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?); + [ cases (true_or_false (eqb (S n) k)) #H1 >H1 + [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H + cases (le_to_not_lt … H) -H #H cases (H ?) % + | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ] + | cases (true_or_false (eqb n k)) #H1 >H1 normalize + [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H + * #H cases (H ?) % + | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H; + [ #H destruct (H) | /2/ ] + ] + ] +| #x0 #k whd in ⊢ (??(?%??)?); cases (true_or_false (x0==x)) + #H1 >H1 normalize // >(\P H1) >eqb_n_n % ] +qed. + +lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux +qed. + +(* +theorem tm_to_tm : ∀t.tm' t → tm t. +#t #H elim H +*) + +lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2. +#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/ +qed. + +lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k). +#u #x elim u // +[ #n #k normalize cases (leb k n) normalize // +| #x0 #k whd in ⊢ (?(???(?%))); cases (true_or_false (x0==x)) #H >H normalize // + lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) % +| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) -Hin #Hin + [ cases (IH1 k) -IH1 #IH1 @IH1 @Hin | cases (IH2 k) -IH2 #IH2 @IH2 @Hin ] +qed. + +lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). // +qed. + +lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u. +#z1 #z2 #u elim u +[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other // + [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] // +|1: // +| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1] +| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2 + >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ] + >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ] +] +qed. + +theorem tm_to_tm2 : ∀u.tm u → tm2 u. +#t #Ht elim Ht +[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn) +| @tm_par +| #u #v #Hu #Hv @tm_app +| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam + [ @fresh_vclose_tm + | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ] +] +qed. + +theorem tm2_to_tm : ∀u.tm2 u → tm u. +#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH // +qed. + +definition PAR ≝ λx.mk_TM (par x) ?. // qed. +definition APP ≝ λu,v:TM.mk_TM (app u v) ?./2/ qed. +definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?./2/ qed. + +axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉). +(* needs true_plus_false + +#u #x #k #Hu elim Hu +[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2] + normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ] + normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ] + #n0 #_ #Hn0 % @le_S_S_to_le // +| #x0 %2 +| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 // +| #x0 #s #v #Hv #IH normalize @daemon +] +qed. +*) + +definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) (vopen_tm_down …). @ctx_of_CTX qed. + +axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u). + +definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) (vclose_tm_up …). @tm_of_TM qed. + +interpretation "ln wf term variable open" 'open u x = (vopen_TM u x). +interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x). + +theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉). +#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta // +qed. + +theorem TM_ind_plus : +(* non si può dare il principio in modo dipendente (almeno utilizzando tm2) + la "prova" purtroppo è in Type e non si può garantire che sia esattamente + quella che ci aspetteremmo + *) + ∀P:pretm → Type[0]. + (∀x:𝔸.P (PAR x)) → + (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) → + ∀C:list 𝔸. + (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C → + (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) → + ∀u:TM.P u. +#P #Hpar #Happ #C #Hlam * #u #pu elim (tm_to_tm2 u pu) // +[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …)) /2/ +| #x #s #v #Hx #pv #IH + lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0 + >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉)) + [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ] + @(Hlam x0 s (mk_CTX v ?) ??) + [ <(nominal_eta … Hx) @vclose_tm_up @tm2_to_tm @pv // + | @(not_to_not … Hx0) @in_list_to_in_list_append_r + | @(not_to_not … Hx0) @in_list_to_in_list_append_l + | @IH ] +] +qed. + +notation +"hvbox('nominal' u 'return' out 'with' + [ 'xpar' ident x ⇒ f1 + | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2 + | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])" +with precedence 48 +for @{ TM_ind_plus $out (λ${ident x}:?.$f1) + (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2) + $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3) + $u }. + +(* include "basics/jmeq.ma".*) + +definition subst ≝ (λu:TM.λx,v. + nominal u return (λ_.TM) with + [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ] + | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2 + | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]). + +lemma fasfd : ∀s,v. pretm_of_TM (subst (LAM O s (PAR 1)) O v) = pretm_of_TM (LAM O s (PAR 1)). +#s #v normalize in ⊢ (??%?); + + +theorem tm2_ind_plus : +(* non si può dare il principio in modo dipendente (almeno utilizzando tm2) *) + ∀P:pretm → Type[0]. + (∀x:𝔸.P (par x)) → + (∀v1,v2.tm2 v1 → tm2 v2 → P v1 → P v2 → P (app v1 v2)) → + ∀C:list 𝔸. + (∀x,s,v.x ∉ FV v → x ∉ C → (∀y.y ∉ FV v → tm2 (v⌈y⌉)) → + (∀y.y ∉ FV v → P (v⌈y⌉)) → P (lam x s (v⌈x⌉))) → + ∀u.tm2 u → P u. +#P #Hpar #Happ #C #Hlam #u #pu elim pu /2/ +#x #s #v #px #pv #IH +lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy +>(?:lam x s (v⌈x⌉) = lam y s (v⌈y⌉)) [| @tm_alpha // @(not_to_not … Hy) @in_list_to_in_list_append_r ] +@Hlam /2/ lapply Hy -Hy @not_to_not #Hy +[ @in_list_to_in_list_append_r @Hy | @in_list_to_in_list_append_l @Hy ] +qed. + +definition check_tm ≝ + λu.pretm_ind_plus ? (λ_.true) (λ_.false) + (λv1,v2,r1,r2.r1 ∧ r2) [ ] (λx,s,v,pv1,pv2,rv.rv) u. + +(* +lemma check_tm_complete : ∀u.tm u → check_tm u = true. +#u #pu @(tm2_ind_plus … [ ] … (tm_to_tm2 ? pu)) // +[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 +| #x #s #v #Hx1 #Hx2 #Hv #IH +*) + +notation +"hvbox('nominal' u 'return' out 'with' + [ 'xpar' ident x ⇒ f1 + | 'xapp' ident v1 ident v2 ident pv1 ident pv2 ident recv1 ident recv2 ⇒ f2 + | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident pw ident recw ⇒ f3 ])" +with precedence 48 +for @{ tm2_ind_plus $out (λ${ident x}:?.$f1) + (λ${ident v1}:?.λ${ident v2}:?.λ${ident pv1}:?.λ${ident pv2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2) + $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident pw}:?.λ${ident recw}:?.$f3) + ? (tm_to_tm2 ? $u) }. +(* notation +"hvbox('nominal' u 'with' + [ 'xlam' ident x # C ident s ident w ⇒ f3 ])" +with precedence 48 +for @{ tm2_ind_plus ??? + $C (λ${ident x}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?. + λ${ident pw}:?.λ${ident recw}:?.$f3) $u (tm_to_tm2 ??) }. +*) + + +definition subst ≝ (λu.λpu:tm u.λx,v. + nominal pu return (λ_.pretm) with + [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ] + | xapp v1 v2 pv1 pv2 recv1 recv2 ⇒ app recv1 recv2 + | xlam ❨y # x::FV v❩ s w py1 py2 pw recw ⇒ lam y s (recw y py1) ]). + +lemma fasfd : ∀x,s,u,p1,v. subst (lam x s u) p1 x v = lam x s u. +#x #s #u #p1 #v + + +definition subst ≝ λu.λpu:tm u.λx,y. + tm2_ind_plus ? + (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ]) + (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2) + (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1)) + u (tm_to_tm2 … pu). +check subst +definition subst ≝ λu.λpu:tm u.λx,v. + nominal u with + [ xlam y # (x::FV v) s w ^ ? ]. + +(* +notation > "Λ ident x. ident T [ident x] ↦ P" + with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}. + +notation < "Λ ident x. ident T [ident x] ↦ P" + with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}. +*) + +(* +notation +"hvbox('nominal' u 'with' + [ 'xpar' ident x ⇒ f1 + | 'xapp' ident v1 ident v2 ⇒ f2 + | 'xlam' ident x # C s w ⇒ f3 ])" +with precedence 48 +for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) + (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) + $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. +*) + +(* +notation +"hvbox('nominal' u 'with' + [ 'xpar' ident x ^ f1 + | 'xapp' ident v1 ident v2 ^ f2 ])" +(* | 'xlam' ident x # C s w ^ f3 ]) *) +with precedence 48 +for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) + (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) + $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. +*) +notation +"hvbox('nominal' u 'with' + [ 'xpar' ident x ^ f1 + | 'xapp' ident v1 ident v2 ^ f2 ])" +with precedence 48 +for @{ tm2_ind_plus ? (λ${ident x}:?.$f1) + (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) + $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. + + +definition subst ≝ λu.λpu:tm u.λx,v. + nominal u with + [ xpar x0 ^ match x == x0 with [ true ⇒ v | false ⇒ u ] + | xapp v1 v2 ^ ? ]. + | xlam y # (x::FV v) s w ^ ? ]. + + + (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ]) + (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2) + (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1)) + u (tm_to_tm2 … pu). + + +*) +definition subst ≝ λu.λpu:tm u.λx,v. + tm2_ind_plus ? + (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ]) + (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2) + (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1)) + u (tm_to_tm2 … pu). + +check subst + + +axiom in_Env : 𝔸 × tp → Env → Prop. +notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. +interpretation "Env membership" 'lefttriangle x l = (in_Env x l). + + + +inductive judg : list tp → tm → tp → Prop ≝ +| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t +| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u +| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u). + +definition Env := list (𝔸 × tp). + +axiom vclose_env : Env → list tp. +axiom vclose_tm : Env → tm → tm. +axiom Lam : 𝔸 → tp → tm → tm. +definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T. +definition dom ≝ λG:Env.map ?? (fst ??) G. + +definition sctx ≝ 𝔸 × tm. +axiom swap_tm : 𝔸 → 𝔸 → tm → tm. +definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M. + +axiom in_list : ∀A:Type[0].A → list A → Prop. +interpretation "list membership" 'mem x l = (in_list ? x l). +interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)). + +axiom in_Env : 𝔸 × tp → Env → Prop. +notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. +interpretation "Env membership" 'lefttriangle x l = (in_Env x l). + +let rec FV M ≝ match M with + [ par X ⇒ [X] + | app M1 M2 ⇒ FV M1@FV M2 + | abs T M0 ⇒ FV M0 + | _ ⇒ [ ] ]. + +(* axiom Lookup : 𝔸 → Env → option tp. *) + +(* forma alto livello del judgment + t_abs* : ∀G,T,X,M,U. + (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) → + Judg G (Lam X T (M[X])) (arr T U) *) + +(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *) + +axiom Judg_ind : ∀P:Env → tm → tp → Prop. + (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) → + (∀G,M,N,T,U. + Judg G M (arr T U) → Judg G N T → + P G M (arr T U) → P G N T → P G (app M N) U) → + (∀G,T1,T2,X,M1. + (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) → + (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) → + P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) → + ∀G,M,T.Judg G M T → P G M T. + +axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T. +axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U. +axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U). + +definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2. +interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2). + +axiom daemon : ∀P:Prop.P. + +theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T. +#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?) +@(Judg_ind … HJ) +[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub // +| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2 + [| @IH1 // | @IH2 // ] +| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH + [ (* trivial property of Lam *) @daemon + | (* trivial property of subenv *) @daemon ] +] +qed. + +(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e + ricorsione *) \ No newline at end of file diff --git a/matita/matita/broken_lib/binding/names.ma b/matita/matita/broken_lib/binding/names.ma new file mode 100644 index 000000000..bc5f07d43 --- /dev/null +++ b/matita/matita/broken_lib/binding/names.ma @@ -0,0 +1,78 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basics/logic.ma". +include "basics/lists/in.ma". +include "basics/types.ma". + +(*interpretation "list membership" 'mem x l = (in_list ? x l).*) + +record Nset : Type[1] ≝ +{ + (* carrier is specified as a coercion: when an object X of type Nset is + given, but something of type Type is expected, Matita will insert a + hidden coercion: the user sees "X", but really means "carrier X" *) + carrier :> DeqSet; + N_fresh : list carrier → carrier; + p_fresh : ∀l.N_fresh l ∉ l +}. + +definition maxlist ≝ + λl.foldr ?? (λx,acc.max x acc) 0 l. + +definition natfresh ≝ λl.S (maxlist l). + +lemma le_max_1 : ∀x,y.x ≤ max x y. /2/ +qed. + +lemma le_max_2 : ∀x,y.y ≤ max x y. /2/ +qed. + +lemma le_maxlist : ∀l,x.x ∈ l → x ≤ maxlist l. +#l elim l +[#x #Hx @False_ind cases (not_in_list_nil ? x) #H1 /2/ +|#y #tl #IH #x #H1 change with (max ??) in ⊢ (??%); + cases (in_list_cons_case ???? H1);#H2; + [ >H2 @le_max_1 + | whd in ⊢ (??%); lapply (refl ? (leb y (maxlist tl))); + cases (leb y (maxlist tl)) in ⊢ (???% → %);#H3 + [ @IH // + | lapply (IH ? H2) #H4 + lapply (leb_false_to_not_le … H3) #H5 + lapply (not_le_to_lt … H5) #H6 + @(transitive_le … H4) + @(transitive_le … H6) %2 % + ] + ] +] +qed. + +(* prove freshness for nat *) +lemma lt_l_natfresh_l : ∀l,x.x ∈ l → x < natfresh l. +#l #x #H1 @le_S_S /2/ +qed. + +(*naxiom p_Xfresh : ∀l.∀x:Xcarr.x ∈ l → x ≠ ntm (Xfresh l) ∧ x ≠ ntp (Xfresh l).*) +lemma p_natfresh : ∀l.natfresh l ∉ l. +#l % #H1 lapply (lt_l_natfresh_l … H1) #H2 +cases (lt_to_not_eq … H2) #H3 @H3 % +qed. + +include "basics/finset.ma". + +definition X : Nset ≝ mk_Nset DeqNat …. +[ @natfresh +| @p_natfresh +] +qed. \ No newline at end of file diff --git a/matita/matita/broken_lib/turing/multi_to_mono/multi_to_mono.ma b/matita/matita/broken_lib/turing/multi_to_mono/multi_to_mono.ma new file mode 100644 index 000000000..0e9bce53e --- /dev/null +++ b/matita/matita/broken_lib/turing/multi_to_mono/multi_to_mono.ma @@ -0,0 +1,397 @@ +include "turing/auxiliary_machines1.ma". +include "turing/multi_to_mono/shift_trace_machines.ma". + +(******************************************************************************) +(* mtiL: complete move L for tape i. We reaching the left border of trace i, *) +(* add a blank if there is no more tape, then move the i-trace and finally *) +(* come back to the head position. *) +(******************************************************************************) + +(* we say that a tape is regular if for any trace after the first blank we + only have other blanks *) + +definition all_blanks_in ≝ λsig,l. + ∀x. mem ? x l → x = blank sig. + +definition regular_i ≝ λsig,n.λl:list (multi_sig sig n).λi. + all_blanks_in ? (after_blank ? (trace sig n i l)). + +definition regular_trace ≝ λsig,n,a.λls,rs:list (multi_sig sig n).λi. + Or (And (regular_i sig n (a::ls) i) (regular_i sig n rs i)) + (And (regular_i sig n ls i) (regular_i sig n (a::rs) i)). + +axiom regular_tail: ∀sig,n,l,i. + regular_i sig n l i → regular_i sig n (tail ? l) i. + +axiom regular_extend: ∀sig,n,l,i. + regular_i sig n l i → regular_i sig n (l@[all_blank sig n]) i. + +axiom all_blank_after_blank: ∀sig,n,l1,b,l2,i. + nth i ? (vec … b) (blank ?) = blank ? → + regular_i sig n (l1@b::l2) i → all_blanks_in ? (trace sig n i l2). + +lemma regular_trace_extl: ∀sig,n,a,ls,rs,i. + regular_trace sig n a ls rs i → + regular_trace sig n a (ls@[all_blank sig n]) rs i. +#sig #n #a #ls #rs #i * + [* #H1 #H2 % % // @(regular_extend … H1) + |* #H1 #H2 %2 % // @(regular_extend … H1) + ] +qed. + +lemma regular_cons_hd_rs: ∀sig,n.∀a:multi_sig sig n.∀ls,rs1,rs2,i. + regular_trace sig n a ls (rs1@rs2) i → + regular_trace sig n a ls (rs1@((hd ? rs2 (all_blank …))::(tail ? rs2))) i. +#sig #n #a #ls #rs1 #rs2 #i cases rs2 [2: #b #tl #H @H] +*[* #H1 >append_nil #H2 %1 % + [@H1 | whd in match (hd ???); @(regular_extend … rs1) //] + |* #H1 >append_nil #H2 %2 % + [@H1 | whd in match (hd ???); @(regular_extend … (a::rs1)) //] + ] +qed. + +lemma eq_trace_to_regular : ∀sig,n.∀a1,a2:multi_sig sig n.∀ls1,ls2,rs1,rs2,i. + nth i ? (vec … a1) (blank ?) = nth i ? (vec … a2) (blank ?) → + trace sig n i ls1 = trace sig n i ls2 → + trace sig n i rs1 = trace sig n i rs2 → + regular_trace sig n a1 ls1 rs1 i → + regular_trace sig n a2 ls2 rs2 i. +#sig #n #a1 #a2 #ls1 #ls2 #rs1 #rs2 #i #H1 #H2 #H3 #H4 +whd in match (regular_trace ??????); whd in match (regular_i ????); +whd in match (regular_i ?? rs2 ?); whd in match (regular_i ?? ls2 ?); +whd in match (regular_i ?? (a2::rs2) ?); whd in match (trace ????); +(Ht1a Hcur) in Ht2a; /2 by / + |#ls #a #rs #Htin #Hreg #Hreg2 -Ht1a cases (Ht1b … Htin) + [* #Hnb #Ht1 -Ht1b -Ht2a >Ht1 in Ht2b; >Htin #H + %{a} %{[ ]} %{ls} + %[%[%[%[%[@Hreg|@Hreg2]|@Hnb]|//]|//]|@H normalize % #H1 destruct (H1)] + |* + [(* we find the blank *) + * #ls1 * #b * #ls2 * * * #H1 #H2 #H3 #Ht1 + >Ht1 in Ht2b; #Hout -Ht1b + %{b} %{(a::ls1)} %{ls2} + %[%[%[%[%[>H1 in Hreg; #H @H + |#j #jneqi whd in match (hd ???); whd in match (tail ??); +

H1 //] + |@Hout normalize % normalize #H destruct (H) + ] + |* #b * #lss * * #H1 #H2 #Ht1 -Ht1b >Ht1 in Ht2a; + whd in match (left ??); whd in match (right ??); #Hout + %{(all_blank …)} %{(lss@[b])} %{[]} + %[%[%[%[%[

blank_all_blank //] + |

reverse_append >reverse_single @Hout normalize // + ] + ] + ] +qed. + +(******************************************************************************) + +definition shift_i_L ≝ λsig,n,i. + ncombf_r (multi_sig …) (shift_i sig n i) (all_blank sig n) · + mti sig n i · + extend ? (all_blank sig n). + +definition R_shift_i_L ≝ λsig,n,i,t1,t2. + (∀a,ls,rs. + t1 = midtape ? ls a rs → + ((∃rs1,b,rs2,a1,rss. + rs = rs1@b::rs2 ∧ + nth i ? (vec … b) (blank ?) = (blank ?) ∧ + (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧ + shift_l sig n i (a::rs1) (a1::rss) ∧ + t2 = midtape (multi_sig sig n) ((reverse ? (a1::rss))@ls) b rs2) ∨ + (∃b,rss. + (∀x. mem ? x rs → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧ + shift_l sig n i (a::rs) (rss@[b]) ∧ + t2 = midtape (multi_sig sig n) + ((reverse ? (rss@[b]))@ls) (all_blank sig n) [ ]))). + +definition R_shift_i_L_new ≝ λsig,n,i,t1,t2. + (∀a,ls,rs. + t1 = midtape ? ls a rs → + ∃rs1,b,rs2,rss. + b = hd ? rs2 (all_blank sig n) ∧ + nth i ? (vec … b) (blank ?) = (blank ?) ∧ + rs = rs1@rs2 ∧ + (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧ + shift_l sig n i (a::rs1) rss ∧ + t2 = midtape (multi_sig sig n) ((reverse ? rss)@ls) b (tail ? rs2)). + +theorem sem_shift_i_L: ∀sig,n,i. shift_i_L sig n i ⊨ R_shift_i_L sig n i. +#sig #n #i +@(sem_seq_app ?????? + (sem_ncombf_r (multi_sig sig n) (shift_i sig n i)(all_blank sig n)) + (sem_seq ????? (ssem_mti sig n i) + (sem_extend ? (all_blank sig n)))) +#tin #tout * #t1 * * #Ht1a #Ht1b * #t2 * * #Ht2a #Ht2b * #Htout1 #Htout2 +#a #ls #rs cases rs + [#Htin %2 %{(shift_i sig n i a (all_blank sig n))} %{[ ]} + %[%[#x @False_ind | @daemon] + |lapply (Ht1a … Htin) -Ht1a -Ht1b #Ht1 + lapply (Ht2a … Ht1) -Ht2a -Ht2b #Ht2 >Ht2 in Htout1; + >Ht1 whd in match (left ??); whd in match (right ??); #Htout @Htout // + ] + |#a1 #rs1 #Htin + lapply (Ht1b … Htin) -Ht1a -Ht1b #Ht1 + lapply (Ht2b … Ht1) -Ht2a -Ht2b * + [(* a1 is blank *) * #H1 #H2 %1 + %{[ ]} %{a1} %{rs1} %{(shift_i sig n i a a1)} %{[ ]} + %[%[%[%[// |//] |#x @False_ind] | @daemon] + |>Htout2 [>H2 >reverse_single @Ht1 |>H2 >Ht1 normalize % #H destruct (H)] + ] + |* + [* #rs10 * #b * #rs2 * #rss * * * * #H1 #H2 #H3 #H4 + #Ht2 %1 + %{(a1::rs10)} %{b} %{rs2} %{(shift_i sig n i a a1)} %{rss} + %[%[%[%[>H1 //|//] |@H3] |@daemon ] + |>reverse_cons >associative_append + >H2 in Htout2; #Htout >Htout [@Ht2| >Ht2 normalize % #H destruct (H)] + ] + |* #b * #rss * * #H1 #H2 + #Ht2 %2 + %{(shift_i sig n i b (all_blank sig n))} %{(shift_i sig n i a a1::rss)} + %[%[@H1 |@daemon ] + |>Ht2 in Htout1; #Htout >Htout // + whd in match (left ??); whd in match (right ??); + >reverse_append >reverse_single >associative_append >reverse_cons + >associative_append // + ] + ] + ] + ] +qed. + +theorem sem_shift_i_L_new: ∀sig,n,i. + shift_i_L sig n i ⊨ R_shift_i_L_new sig n i. +#sig #n #i +@(Realize_to_Realize … (sem_shift_i_L sig n i)) +#t1 #t2 #H #a #ls #rs #Ht1 lapply (H a ls rs Ht1) * + [* #rs1 * #b * #rs2 * #a1 * #rss * * * * #H1 #H2 #H3 #H4 #Ht2 + %{rs1} %{b} %{(b::rs2)} %{(a1::rss)} + %[%[%[%[%[//|@H2]|@H1]|@H3]|@H4] | whd in match (tail ??); @Ht2] + |* #b * #rss * * #H1 #H2 #Ht2 + %{rs} %{(all_blank sig n)} %{[]} %{(rss@[b])} + %[%[%[%[%[//|@blank_all_blank]|//]|@H1]|@H2] | whd in match (tail ??); @Ht2] + ] +qed. + + +(******************************************************************************* +The following machine implements a full move of for a trace: we reach the left +border, shift the i-th trace and come back to the head position. *) + +(* this exclude the possibility that traces do not overlap: the head must +remain inside all traces *) + +definition mtiL ≝ λsig,n,i. + move_to_blank_L sig n i · + shift_i_L sig n i · + move_until ? L (no_head sig n). + +definition Rmtil ≝ λsig,n,i,t1,t2. + ∀ls,a,rs. + t1 = midtape (multi_sig sig n) ls a rs → + nth n ? (vec … a) (blank ?) = head ? → + (∀i.regular_trace sig n a ls rs i) → + (* next: we cannot be on rightof on trace i *) + (nth i ? (vec … a) (blank ?) = (blank ?) + → nth i ? (vec … (hd ? rs (all_blank …))) (blank ?) ≠ (blank ?)) → + no_head_in … ls → + no_head_in … rs → + (∃ls1,a1,rs1. + t2 = midtape (multi_sig …) ls1 a1 rs1 ∧ + (∀i.regular_trace … a1 ls1 rs1 i) ∧ + (∀j. j ≤ n → j ≠ i → to_blank_i ? n j (a1::ls1) = to_blank_i ? n j (a::ls)) ∧ + (∀j. j ≤ n → j ≠ i → to_blank_i ? n j rs1 = to_blank_i ? n j rs) ∧ + (to_blank_i ? n i ls1 = to_blank_i ? n i (a::ls)) ∧ + (to_blank_i ? n i (a1::rs1)) = to_blank_i ? n i rs). + +theorem sem_Rmtil: ∀sig,n,i. i < n → mtiL sig n i ⊨ Rmtil sig n i. +#sig #n #i #lt_in +@(sem_seq_app ?????? + (sem_move_to_blank_L … ) + (sem_seq ????? (sem_shift_i_L_new …) + (ssem_move_until_L ? (no_head sig n)))) +#tin #tout * #t1 * * #_ #Ht1 * #t2 * #Ht2 * #_ #Htout +(* we start looking into Rmitl *) +#ls #a #rs #Htin (* tin is a midtape *) +#Hhead #Hreg #no_rightof #Hnohead_ls #Hnohead_rs +cut (regular_i sig n (a::ls) i) + [cases (Hreg i) * // + cases (true_or_false (nth i ? (vec … a) (blank ?) == (blank ?))) #Htest + [#_ @daemon (* absurd, since hd rs non e' blank *) + |#H #_ @daemon]] #Hreg1 +lapply (Ht1 … Htin Hreg1 ?) [#j #_ @Hreg] -Ht1 -Htin +* #b * #ls1 * #ls2 * * * * * #reg_ls1_i #reg_ls1_j #Hno_blankb #Hhead #Hls1 #Ht1 +lapply (Ht2 … Ht1) -Ht2 -Ht1 +* #rs1 * #b0 * #rs2 * #rss * * * * * #Hb0 #Hb0blank #Hrs1 #Hrs1b #Hrss #Ht2 +(* we need to recover the position of the head of the emulated machine + that is the head of ls1. This is somewhere inside rs1 *) +cut (∃rs11. rs1 = (reverse ? ls1)@rs11) + [cut (ls1 = [ ] ∨ ∃aa,tlls1. ls1 = aa::tlls1) + [cases ls1 [%1 // | #aa #tlls1 %2 %{aa} %{tlls1} //]] * + [#H1ls1 %{rs1} >H1ls1 // + |* #aa * #tlls1 #H1ls1 >H1ls1 in Hrs1; + cut (aa = a) [>H1ls1 in Hls1; #H @(to_blank_hd … H)] #eqaa >eqaa + #Hrs1_aux cases (compare_append … (sym_eq … Hrs1_aux)) #l * + [* #H1 #H2 %{l} @H1 + |(* this is absurd : if l is empty, the case is as before. + if l is not empty then it must start with a blank, since it is the + first character in rs2. But in this case we would have a blank + inside ls1=a::tls1 that is absurd *) + @daemon + ]]] + * #rs11 #H1 +cut (rs = rs11@rs2) + [@(injective_append_l … (reverse … ls1)) >Hrs1 H2 >trace_append @mem_append_l2 + lapply Hb0 cases rs2 + [whd in match (hd ???); #H >H in H3; whd in match (no_head ???); + >all_blank_n normalize -H #H destruct (H); @False_ind + |#c #r #H4 %1 >H4 // + ] + |* + [(* we reach the head position *) + (* cut (trace sig n j (a1::ls20)=trace sig n j (ls1@b::ls2)) *) + * #ls10 * #a1 * #ls20 * * * #Hls20 #Ha1 #Hnh #Htout + cut (∀j.j ≠ i → + trace sig n j (reverse (multi_sig sig n) rs1@b::ls2) = + trace sig n j (ls10@a1::ls20)) + [#j #ineqj >append_cons trace_def reverse_map >map_append @eq_f @Hls20 ] + #Htracej + cut (trace sig n i (reverse (multi_sig sig n) (rs1@[b0])@ls2) = + trace sig n i (ls10@a1::ls20)) + [>trace_def Hcut + lapply (trace_shift … lt_in … Hrss) [//] whd in match (tail ??); #Htr reverse_map >map_append trace_def in ⊢ (%→?); trace_def in ⊢ (%→?); H1 in Htracei; >reverse_append >reverse_single >reverse_append + >reverse_reverse >associative_append >associative_append + @daemon + ] #H3 + cut (∀j. j ≠ i → + trace sig n j (reverse (multi_sig sig n) ls10@rs2) = trace sig n j rs) + [#j #jneqi @(injective_append_l … (trace sig n j (reverse ? ls1))) + >map_append >map_append >Hrs1 >H1 >associative_append + eqji (* by cases wether a1 is blank *) + @daemon + |#jneqi lapply (reg_ls1_j … jneqi) #H4 + >reverse_cons >associative_append >Hb0 @regular_cons_hd_rs + @(eq_trace_to_regular … H4) + [(proj2 … (H2 … jneqi)) >hd_trace % + |(proj2 … (H2 … jneqi)) >tail_trace % + |@sym_eq @Hrs_j // + ] + ]] + |#j #lejn #jneqi <(Hls1 … lejn) + >to_blank_i_def >to_blank_i_def @eq_f @sym_eq @(proj2 … (H2 j jneqi))] + |#j #lejn #jneqi >reverse_cons >associative_append >Hb0 + to_blank_i_def >to_blank_i_def @eq_f @Hrs_j //] + |<(Hls1 i) [2:@lt_to_le //] + lapply (all_blank_after_blank … reg_ls1_i) + [@(\P ?) @daemon] #allb_ls2 + whd in match (to_blank_i ????); <(proj2 … H3) + @daemon ] + |>reverse_cons >associative_append + cut (to_blank_i sig n i rs = to_blank_i sig n i (rs11@[b0])) [@daemon] + #Hcut >Hcut >(to_blank_i_chop … b0 (a1::reverse …ls10)) [2: @Hb0blank] + >to_blank_i_def >to_blank_i_def @eq_f + >trace_def >trace_def @injective_reverse >reverse_map >reverse_cons + >reverse_reverse >reverse_map >reverse_append >reverse_single @sym_eq + @(proj1 … H3) + ] + |(*we do not find the head: this is absurd *) + * #b1 * #lss * * #H2 @False_ind + cut (∀x0. mem ? x0 (trace sig n n (b0::reverse ? rss@ls2)) → x0 ≠ head ?) + [@daemon] -H2 #H2 + lapply (trace_shift_neq sig n i n … lt_in … Hrss) + [@lt_to_not_eq @lt_in | // ] + #H3 @(absurd + (nth n ? (vec … (hd ? (ls1@[b]) (all_blank sig n))) (blank ?) = head ?)) + [>Hhead // + |@H2 >trace_def %2 H3 >H1 >trace_def >reverse_map >reverse_cons >reverse_append + >reverse_reverse >associative_append (assert false : < advance: ?statement:string -> unit -> unit; status: GrafiteTypes.status >));; let register_matita_script_current f = matita_script_current := f;; @@ -174,9 +172,9 @@ let string_of_dom_node node = *) class clickableMathView obj = -let text_width = 80 in +(*let text_width = 80 in*) object (self) - inherit GSourceView2.source_view obj + inherit GSourceView3.source_view obj method strings_of_selection = (assert false : (paste_kind * string) list) @@ -197,7 +195,7 @@ object (self) self#buffer#apply_tag all_tag ~start:(self#buffer#get_iter `START) ~stop:(self#buffer#get_iter `END); ignore(all_tag#connect#event - ~callback:(fun ~origin event pos -> + ~callback:(fun ~origin:_ event _pos -> match GdkEvent.get_type event with | `MOTION_NOTIFY -> Gdk.Window.set_cursor @@ -209,12 +207,12 @@ object (self) | _ -> false)); let hyperlink_tag = self#buffer#create_tag [] in ignore(hyperlink_tag#connect#event - ~callback:(fun ~origin event pos -> + ~callback:(fun ~origin:_ event pos -> let offset = (new GText.iter pos)#offset in let _,_,href = try List.find - (fun (start,stop,href) -> start <= offset && offset <= stop + (fun (start,stop,_href) -> start <= offset && offset <= stop ) hyperlinks with Not_found -> assert false @@ -235,7 +233,7 @@ object (self) false | _ -> false)); List.iter - ( fun (start,stop,(href : string)) -> + ( fun (start,stop,(_href : string)) -> self#buffer#apply_tag hyperlink_tag ~start:(self#buffer#get_iter_at_char start) ~stop:(self#buffer#get_iter_at_char (stop+1)); @@ -690,7 +688,7 @@ let cicMathView (*?auto_indent ?highlight_current_line ?indent_on_tab ?indent_wi Gobject.set_params (Gobject.try_cast obj "GtkSourceView") pl; new _cicMathView obj)(*)) ?auto_indent ?highlight_current_line ?indent_on_tab ?indent_width ?insert_spaces_instead_of_tabs ?right_margin_position ?show_line_marks ?show_line_numbers ?show_right_margin ?smart_home_end ?tab_width ?editable ?cursor_visible ?justification ?wrap_mode ?accepts_tab ?border_width*) [] ?width ?height ?packing ?show () :> cicMathView) -let screenshot status sequents metasenv subst (filename as ofn) = +let screenshot _status _sequents _metasenv _subst (_filename (*as ofn*)) = () (*MATITA 1.0 let w = GWindow.window ~title:"screenshot" () in let width = 500 in diff --git a/matita/matita/contribs/lambdadelta/Makefile b/matita/matita/contribs/lambdadelta/Makefile index 9d87f9909..59cf50f6e 100644 --- a/matita/matita/contribs/lambdadelta/Makefile +++ b/matita/matita/contribs/lambdadelta/Makefile @@ -95,7 +95,7 @@ $(DEP_INPUT): LINE = $(MAS:%=%:include \"\".) $(DEP_INPUT): $(MAS) Makefile @echo " GREP include" - $(H)grep "include \"" $^ > $(DEP_INPUT) + $(H)grep "include \"" $(MAS) > $(DEP_INPUT) $(H)echo "$(LINE)" | sed -e 's/\"\. /\"\.\n/g' >> $(DEP_INPUT) # dep ######################################################################## diff --git a/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cnv_eta.ma b/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cnv_eta.ma index 704301fe0..17be9f2dd 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cnv_eta.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cnv_eta.ma @@ -17,13 +17,14 @@ include "basic_2/dynamic/cnv.ma". (* EXAMPLES *****************************************************************) -(* Extended validy (basic_2B) vs. restricted validity (basic_1A) ************) +(* Extended validy (λδ-2A) vs. restricted validity (λδ-1B) ******************) (* Note: extended validity of a closure, height of cnv_appl > 1 *) -lemma cnv_extended (h) (p): ∀G,L,s. ⦃G, L.ⓛ⋆s.ⓛⓛ{p}⋆s.⋆s.ⓛ#0⦄ ⊢ ⓐ#2.#0 ![Ⓕ,h]. +lemma cnv_extended (h) (p) (G) (L): + ∀s. ⦃G,L.ⓛ⋆s.ⓛⓛ{p}⋆s.⋆s.ⓛ#0⦄ ⊢ ⓐ#2.#0 ![h,𝛚]. #h #p #G #L #s @(cnv_appl … 2 p … (⋆s) … (⋆s)) -[ #H destruct +[ // | /4 width=1 by cnv_sort, cnv_zero, cnv_lref/ | /4 width=1 by cnv_bind, cnv_zero/ | /5 width=3 by cpm_cpms, cpm_lref, cpm_ell, lifts_sort/ @@ -32,15 +33,16 @@ lemma cnv_extended (h) (p): ∀G,L,s. ⦃G, L.ⓛ⋆s.ⓛⓛ{p}⋆s.⋆s.ⓛ#0 qed. (* Note: restricted validity of the η-expanded closure, height of cnv_appl = 1 **) -lemma vnv_restricted (h) (p): ∀G,L,s. ⦃G, L.ⓛ⋆s.ⓛⓛ{p}⋆s.⋆s.ⓛⓛ{p}⋆s.ⓐ#0.#1⦄ ⊢ ⓐ#2.#0 ![Ⓣ,h]. +lemma cnv_restricted (h) (p) (G) (L): + ∀s. ⦃G,L.ⓛ⋆s.ⓛⓛ{p}⋆s.⋆s.ⓛⓛ{p}⋆s.ⓐ#0.#1⦄ ⊢ ⓐ#2.#0 ![h,𝟐]. #h #p #G #L #s @(cnv_appl … 1 p … (⋆s) … (ⓐ#0.#2)) -[ /2 width=1 by/ +[ // | /4 width=1 by cnv_sort, cnv_zero, cnv_lref/ | @cnv_zero @cnv_bind // @(cnv_appl … 1 p … (⋆s) … (⋆s)) - [ /2 width=1 by/ + [ // | /2 width=1 by cnv_sort, cnv_zero/ | /4 width=1 by cnv_sort, cnv_zero, cnv_lref, cnv_bind/ | /2 width=3 by cpms_ell, lifts_sort/ diff --git a/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cpr_omega.ma b/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cpr_omega.ma index bb4edfd67..72b4b347c 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cpr_omega.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/examples/ex_cpr_omega.ma @@ -51,7 +51,7 @@ lapply (cpm_inv_appl1 … H) -H * * qed-. lemma cpr_inv_Delta_sn (h) (G) (L) (s): - ∀X. ⦃G, L⦄ ⊢ Delta s ➡[h] X → Delta s = X. + ∀X. ⦃G,L⦄ ⊢ Delta s ➡[h] X → Delta s = X. #h #G #L #s #X #H elim (cpm_inv_abst1 … H) -H #X1 #X2 #H1 #H2 #H destruct lapply (cpr_inv_sort1 … H1) -H1 #H destruct @@ -60,19 +60,19 @@ qed-. (* Main properties **********************************************************) -theorem cpr_Omega_12 (h) (G) (L) (s): ⦃G, L⦄ ⊢ Omega1 s ➡[h] Omega2 s. +theorem cpr_Omega_12 (h) (G) (L) (s): ⦃G,L⦄ ⊢ Omega1 s ➡[h] Omega2 s. /2 width=1 by cpm_beta/ qed. -theorem cpr_Omega_23 (h) (G) (L) (s): ⦃G, L⦄ ⊢ Omega2 s ➡[h] Omega3 s. +theorem cpr_Omega_23 (h) (G) (L) (s): ⦃G,L⦄ ⊢ Omega2 s ➡[h] Omega3 s. /5 width=3 by cpm_eps, cpm_appl, cpm_bind, cpm_delta, Delta_lifts/ qed. -theorem cpr_Omega_31 (h) (G) (L) (s): ⦃G, L⦄ ⊢ Omega3 s ➡[h] Omega1 s. +theorem cpr_Omega_31 (h) (G) (L) (s): ⦃G,L⦄ ⊢ Omega3 s ➡[h] Omega1 s. /4 width=3 by cpm_zeta, Delta_lifts, lifts_flat/ qed. (* Main inversion properties ************************************************) theorem cpr_inv_Omega1_sn (h) (G) (L) (s): - ∀X. ⦃G, L⦄ ⊢ Omega1 s ➡[h] X → + ∀X. ⦃G,L⦄ ⊢ Omega1 s ➡[h] X → ∨∨ Omega1 s = X | Omega2 s = X. #h #G #L #s #X #H elim (cpm_inv_appl1 … H) -H * [ #W2 #T2 #HW2 #HT2 #H destruct @@ -87,7 +87,7 @@ theorem cpr_inv_Omega1_sn (h) (G) (L) (s): ] qed-. -theorem cpr_Omega_21_false (h) (G) (L) (s): ⦃G, L⦄ ⊢ Omega2 s ➡[h] Omega1 s → ⊥. +theorem cpr_Omega_21_false (h) (G) (L) (s): ⦃G,L⦄ ⊢ Omega2 s ➡[h] Omega1 s → ⊥. #h #G #L #s #H elim (cpm_inv_bind1 … H) -H * [ #W #T #_ #_ whd in ⊢ (??%?→?); #H destruct | #X #H #_ #_ #_ diff --git a/matita/matita/contribs/lambdadelta/apps_2/examples/ex_fpbg_refl.ma b/matita/matita/contribs/lambdadelta/apps_2/examples/ex_fpbg_refl.ma index 257015d95..b41ddae8a 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/examples/ex_fpbg_refl.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/examples/ex_fpbg_refl.ma @@ -36,22 +36,22 @@ lemma ApplDelta_lifts (f:rtmap) (s0) (s): ⬆*[f] (ApplDelta s0 s) ≘ (ApplDelta s0 s). /5 width=1 by lifts_sort, lifts_lref, lifts_bind, lifts_flat/ qed. -lemma cpr_ApplOmega_12 (h) (G) (L) (s0) (s): ⦃G, L⦄ ⊢ ApplOmega1 s0 s ➡[h] ApplOmega2 s0 s. +lemma cpr_ApplOmega_12 (h) (G) (L) (s0) (s): ⦃G,L⦄ ⊢ ApplOmega1 s0 s ➡[h] ApplOmega2 s0 s. /2 width=1 by cpm_beta/ qed. -lemma cpr_ApplOmega_23 (h) (G) (L) (s0) (s): ⦃G, L⦄ ⊢ ApplOmega2 s0 s ➡[h] ApplOmega3 s0 s. +lemma cpr_ApplOmega_23 (h) (G) (L) (s0) (s): ⦃G,L⦄ ⊢ ApplOmega2 s0 s ➡[h] ApplOmega3 s0 s. /6 width=3 by cpm_eps, cpm_appl, cpm_bind, cpm_delta, ApplDelta_lifts/ qed. -lemma cpr_ApplOmega_34 (h) (G) (L) (s0) (s): ⦃G, L⦄ ⊢ ApplOmega3 s0 s ➡[h] ApplOmega4 s0 s. +lemma cpr_ApplOmega_34 (h) (G) (L) (s0) (s): ⦃G,L⦄ ⊢ ApplOmega3 s0 s ➡[h] ApplOmega4 s0 s. /4 width=3 by cpm_zeta, ApplDelta_lifts, lifts_sort, lifts_flat/ qed. -lemma cpxs_ApplOmega_14 (h) (G) (L) (s0) (s): ⦃G, L⦄ ⊢ ApplOmega1 s0 s ⬈*[h] ApplOmega4 s0 s. +lemma cpxs_ApplOmega_14 (h) (G) (L) (s0) (s): ⦃G,L⦄ ⊢ ApplOmega1 s0 s ⬈*[h] ApplOmega4 s0 s. /5 width=4 by cpxs_strap1, cpm_fwd_cpx/ qed. -lemma fqup_ApplOmega_41 (G) (L) (s0) (s): ⦃G,L,ApplOmega4 s0 s⦄ ⊐+ ⦃G,L,ApplOmega1 s0 s⦄. +lemma fqup_ApplOmega_41 (G) (L) (s0) (s): ⦃G,L,ApplOmega4 s0 s⦄ ⬂+ ⦃G,L,ApplOmega1 s0 s⦄. /2 width=1 by/ qed. (* Main properties **********************************************************) -theorem fpbg_refl (h) (o) (G) (L) (s0) (s): ⦃G,L,ApplOmega1 s0 s⦄ >[h,o] ⦃G,L,ApplOmega1 s0 s⦄. +theorem fpbg_refl (h) (G) (L) (s0) (s): ⦃G,L,ApplOmega1 s0 s⦄ >[h] ⦃G,L,ApplOmega1 s0 s⦄. /3 width=5 by fpbs_fpbg_trans, fqup_fpbg, cpxs_fpbs/ qed. diff --git a/matita/matita/contribs/lambdadelta/apps_2/functional/flifts_flifts_basic.ma b/matita/matita/contribs/lambdadelta/apps_2/functional/flifts_flifts_basic.ma index 9b7f6fa2b..7ebdc5dab 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/functional/flifts_flifts_basic.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/functional/flifts_flifts_basic.ma @@ -23,7 +23,7 @@ theorem flifts_basic_swap (T) (d1) (d2) (h1) (h2): d2 ≤ d1 → ↑[d2,h2]↑[d1,h1]T = ↑[h2+d1,h1]↑[d2,h2]T. /3 width=1 by flifts_comp, basic_swap/ qed-. (* -lemma flift_join: ∀e1,e2,T. ⬆[e1, e2] ↑[0, e1] T ≡ ↑[0, e1 + e2] T. +lemma flift_join: ∀e1,e2,T. ⬆[e1,e2] ↑[0,e1] T ≡ ↑[0,e1 + e2] T. #e1 #e2 #T lapply (flift_lift T 0 (e1+e2)) #H elim (lift_split … H e1 e1) -H // #U #H diff --git a/matita/matita/contribs/lambdadelta/apps_2/functional/mf_cpr.ma b/matita/matita/contribs/lambdadelta/apps_2/functional/mf_cpr.ma index 2e7f3d5ef..059a1f66f 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/functional/mf_cpr.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/functional/mf_cpr.ma @@ -20,9 +20,9 @@ include "apps_2/functional/mf_exteq.ma". (* Properties with relocation ***********************************************) -lemma mf_delta_drops (h) (G): ∀K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 → +lemma mf_delta_drops (h) (G): ∀K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡[h] V2 → ∀T,L,l. ⬇*[l] L ≘ K.ⓓV1 → - ∀gv,lv. ⦃G, L⦄ ⊢ ●[gv,⇡[l←#l]lv]T ➡[h] ●[gv,⇡[l←↑[↑l]V2]lv]T. + ∀gv,lv. ⦃G,L⦄ ⊢ ●[gv,⇡[l←#l]lv]T ➡[h] ●[gv,⇡[l←↑[↑l]V2]lv]T. #h #G #K #V1 #V2 #HV #T elim T -T * // [ #i #L #l #HKL #gv #lv >mf_lref >mf_lref diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/deq.ma b/matita/matita/contribs/lambdadelta/apps_2/models/deq.ma index 5d0f2d324..849ad9dd4 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/deq.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/deq.ma @@ -19,7 +19,7 @@ include "static_2/syntax/genv.ma". (* DENOTATIONAL EQUIVALENCE ************************************************) definition deq (M): relation4 genv lenv term term ≝ - λG,L,T1,T2. ∀gv,lv. lv ϵ ⟦L⟧[gv] → ⟦T1⟧[gv, lv] ≗{M} ⟦T2⟧[gv, lv]. + λG,L,T1,T2. ∀gv,lv. lv ϵ ⟦L⟧[gv] → ⟦T1⟧[gv,lv] ≗{M} ⟦T2⟧[gv,lv]. interpretation "denotational equivalence (model)" 'RingEq M G L T1 T2 = (deq M G L T1 T2). diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/deq_cpr.ma b/matita/matita/contribs/lambdadelta/apps_2/models/deq_cpr.ma index 181acf2e6..3e085aeea 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/deq_cpr.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/deq_cpr.ma @@ -21,7 +21,7 @@ include "apps_2/models/deq.ma". (* Forward lemmas with context-sensitive parallel reduction for terms *******) lemma cpr_fwd_deq (h) (M): is_model M → is_extensional M → - ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 → ⦃G, L⦄ ⊢ T1 ≗{M} T2. + ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → ⦃G,L⦄ ⊢ T1 ≗{M} T2. #h #M #H1M #H2M #G #L #T1 #T2 #H @(cpr_ind … H) -G -L -T1 -T2 [ /2 width=2 by deq_refl/ | #G #K #V1 #V2 #W2 #_ #IH #HVW2 #gv #v #H diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/li.ma b/matita/matita/contribs/lambdadelta/apps_2/models/li.ma index 4d36f1427..b3ad39157 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/li.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/li.ma @@ -20,7 +20,7 @@ include "apps_2/notation/models/inwbrackets_4.ma". inductive li (M) (gv): relation2 lenv (evaluation M) ≝ | li_atom: ∀lv. li M gv (⋆) lv -| li_abbr: ∀lv,d,L,V. li M gv L lv → ⟦V⟧[gv, lv] = d → li M gv (L.ⓓV) (⫯[0←d]lv) +| li_abbr: ∀lv,d,L,V. li M gv L lv → ⟦V⟧[gv,lv] = d → li M gv (L.ⓓV) (⫯[0←d]lv) | li_abst: ∀lv,d,L,W. li M gv L lv → li M gv (L.ⓛW) (⫯[0←d]lv) | li_unit: ∀lv,d,I,L. li M gv L lv → li M gv (L.ⓤ{I}) (⫯[0←d]lv) | li_veq : ∀lv1,lv2,L. li M gv L lv1 → lv1 ≗ lv2 → li M gv L lv2 diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/model_props.ma b/matita/matita/contribs/lambdadelta/apps_2/models/model_props.ma index b3acfc262..d06b4efda 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/model_props.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/model_props.ma @@ -26,34 +26,34 @@ record is_model (M): Prop ≝ { (* Note: application: compatibility *) mp: compatible_3 … (ap M) (sq M) (sq M) (sq M); (* Note: interpretation: sort *) - ms: ∀gv,lv,s. ⟦⋆s⟧{M}[gv, lv] ≗ sv M s; + ms: ∀gv,lv,s. ⟦⋆s⟧{M}[gv,lv] ≗ sv M s; (* Note: interpretation: local reference *) - ml: ∀gv,lv,i. ⟦#i⟧{M}[gv, lv] ≗ lv i; + ml: ∀gv,lv,i. ⟦#i⟧{M}[gv,lv] ≗ lv i; (* Note: interpretation: global reference *) - mg: ∀gv,lv,l. ⟦§l⟧{M}[gv, lv] ≗ gv l; + mg: ∀gv,lv,l. ⟦§l⟧{M}[gv,lv] ≗ gv l; (* Note: interpretation: intensional binder *) - mi: ∀p,gv1,gv2,lv1,lv2,W,T. ⟦W⟧{M}[gv1, lv1] ≗ ⟦W⟧{M}[gv2, lv2] → - (∀d. ⟦T⟧{M}[gv1, ⫯[0←d]lv1] ≗ ⟦T⟧{M}[gv2, ⫯[0←d]lv2]) → - ⟦ⓛ{p}W.T⟧[gv1, lv1] ≗ ⟦ⓛ{p}W.T⟧[gv2, lv2]; + mi: ∀p,gv1,gv2,lv1,lv2,W,T. ⟦W⟧{M}[gv1,lv1] ≗ ⟦W⟧{M}[gv2,lv2] → + (∀d. ⟦T⟧{M}[gv1,⫯[0←d]lv1] ≗ ⟦T⟧{M}[gv2,⫯[0←d]lv2]) → + ⟦ⓛ{p}W.T⟧[gv1,lv1] ≗ ⟦ⓛ{p}W.T⟧[gv2,lv2]; (* Note: interpretation: abbreviation *) - md: ∀p,gv,lv,V,T. ⟦ⓓ{p}V.T⟧{M}[gv, lv] ≗ ⟦V⟧[gv, lv] ⊕[p] ⟦T⟧[gv, ⫯[0←⟦V⟧[gv, lv]]lv]; + md: ∀p,gv,lv,V,T. ⟦ⓓ{p}V.T⟧{M}[gv,lv] ≗ ⟦V⟧[gv,lv] ⊕[p] ⟦T⟧[gv,⫯[0←⟦V⟧[gv,lv]]lv]; (* Note: interpretation: application *) - ma: ∀gv,lv,V,T. ⟦ⓐV.T⟧{M}[gv, lv] ≗ ⟦V⟧[gv, lv] @ ⟦T⟧[gv, lv]; + ma: ∀gv,lv,V,T. ⟦ⓐV.T⟧{M}[gv,lv] ≗ ⟦V⟧[gv,lv] @ ⟦T⟧[gv,lv]; (* Note: interpretation: ζ-equivalence *) mz: ∀d1,d2. d1 ⊕{M}[Ⓣ] d2 ≗ d2; (* Note: interpretation: ϵ-equivalence *) - me: ∀gv,lv,W,T. ⟦ⓝW.T⟧{M}[gv, lv] ≗ ⟦T⟧[gv, lv]; + me: ∀gv,lv,W,T. ⟦ⓝW.T⟧{M}[gv,lv] ≗ ⟦T⟧[gv,lv]; (* Note: interpretation: β-requivalence *) - mb: ∀p,gv,lv,d,W,T. d @ ⟦ⓛ{p}W.T⟧{M}[gv, lv] ≗ d ⊕[p] ⟦T⟧[gv, ⫯[0←d]lv]; + mb: ∀p,gv,lv,d,W,T. d @ ⟦ⓛ{p}W.T⟧{M}[gv,lv] ≗ d ⊕[p] ⟦T⟧[gv,⫯[0←d]lv]; (* Note: interpretation: θ-requivalence *) mh: ∀p,d1,d2,d3. d1 @ (d2 ⊕{M}[p] d3) ≗ d2 ⊕[p] (d1 @ d3) }. record is_extensional (M): Prop ≝ { (* Note: interpretation: extensional abstraction *) - mx: ∀p,gv1,gv2,lv1,lv2,W1,W2,T1,T2. ⟦W1⟧{M}[gv1, lv1] ≗ ⟦W2⟧{M}[gv2, lv2] → - (∀d. ⟦T1⟧{M}[gv1, ⫯[0←d]lv1] ≗ ⟦T2⟧{M}[gv2, ⫯[0←d]lv2]) → - ⟦ⓛ{p}W1.T1⟧[gv1, lv1] ≗ ⟦ⓛ{p}W2.T2⟧[gv2, lv2] + mx: ∀p,gv1,gv2,lv1,lv2,W1,W2,T1,T2. ⟦W1⟧{M}[gv1,lv1] ≗ ⟦W2⟧{M}[gv2,lv2] → + (∀d. ⟦T1⟧{M}[gv1,⫯[0←d]lv1] ≗ ⟦T2⟧{M}[gv2,⫯[0←d]lv2]) → + ⟦ⓛ{p}W1.T1⟧[gv1,lv1] ≗ ⟦ⓛ{p}W2.T2⟧[gv2,lv2] }. record is_injective (M): Prop ≝ { diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/tm.ma b/matita/matita/contribs/lambdadelta/apps_2/models/tm.ma index a0f7b84d1..00358c9a2 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/tm.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/tm.ma @@ -20,7 +20,7 @@ include "apps_2/models/model.ma". definition tm_dd ≝ term. -definition tm_sq (h) (T1) (T2) ≝ ⦃⋆, ⋆⦄ ⊢ T1 ⬌*[h] T2. +definition tm_sq (h) (T1) (T2) ≝ ⦃⋆,⋆⦄ ⊢ T1 ⬌*[h] T2. definition tm_sv (s) ≝ ⋆s. diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/veq.ma b/matita/matita/contribs/lambdadelta/apps_2/models/veq.ma index 4d3d16c1e..3d9e440a7 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/veq.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/veq.ma @@ -83,7 +83,7 @@ qed-. lemma ti_comp (M): is_model M → ∀T,gv1,gv2. gv1 ≗ gv2 → ∀lv1,lv2. lv1 ≗ lv2 → - ⟦T⟧[gv1, lv1] ≗{M} ⟦T⟧[gv2, lv2]. + ⟦T⟧[gv1,lv1] ≗{M} ⟦T⟧[gv2,lv2]. #M #HM #T elim T -T * [||| #p * | * ] [ /4 width=5 by seq_trans, seq_sym, ms/ | /4 width=5 by seq_sym, ml, mq/ 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 d7a225140..13a0f9113 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/veq_lifts.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/veq_lifts.ma @@ -22,7 +22,7 @@ include "apps_2/models/veq.ma". fact lifts_fwd_vpush_aux (M): is_model M → is_extensional M → ∀f,T1,T2. ⬆*[f] T1 ≘ T2 → ∀m. 𝐁❴m,1❵ = f → - ∀gv,lv,d. ⟦T1⟧[gv, lv] ≗{M} ⟦T2⟧[gv, ⫯[m←d]lv]. + ∀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 @(mq … H1M) [4,5: /3 width=2 by seq_sym, ms/ |1,2: skip ] @@ -67,5 +67,5 @@ qed-. lemma lifts_SO_fwd_vpush (M) (gv): is_model M → is_extensional M → ∀T1,T2. ⬆*[1] T1 ≘ T2 → - ∀lv,d. ⟦T1⟧[gv, lv] ≗{M} ⟦T2⟧[gv, ⫯[0←d]lv]. + ∀lv,d. ⟦T1⟧[gv,lv] ≗{M} ⟦T2⟧[gv,⫯[0←d]lv]. /2 width=3 by lifts_fwd_vpush_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/vpushs.ma b/matita/matita/contribs/lambdadelta/apps_2/models/vpushs.ma index dabd2c431..34e9de237 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/vpushs.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/vpushs.ma @@ -20,7 +20,7 @@ include "apps_2/models/veq.ma". inductive vpushs (M) (gv) (lv): relation2 lenv (evaluation M) ≝ | vpushs_atom: vpushs M gv lv (⋆) lv -| vpushs_abbr: ∀v,d,K,V. vpushs M gv lv K v → ⟦V⟧[gv, v] = d → vpushs M gv lv (K.ⓓV) (⫯[0←d]v) +| vpushs_abbr: ∀v,d,K,V. vpushs M gv lv K v → ⟦V⟧[gv,v] = d → vpushs M gv lv (K.ⓓV) (⫯[0←d]v) | vpushs_abst: ∀v,d,K,V. vpushs M gv lv K v → vpushs M gv lv (K.ⓛV) (⫯[0←d]v) | vpushs_unit: ∀v,d,I,K. vpushs M gv lv K v → vpushs M gv lv (K.ⓤ{I}) (⫯[0←d]v) | vpushs_repl: ∀v1,v2,L. vpushs M gv lv L v1 → v1 ≗ v2 → vpushs M gv lv L v2 @@ -51,7 +51,7 @@ lemma vpushs_inv_atom (M) (gv) (lv): is_model M → fact vpushs_inv_abbr_aux (M) (gv) (lv): is_model M → ∀y,L. L ⨁{M}[gv] lv ≘ y → ∀K,V. K.ⓓV = L → - ∃∃v. K ⨁[gv] lv ≘ v & ⫯[0←⟦V⟧[gv, v]]v ≗ y. + ∃∃v. K ⨁[gv] lv ≘ v & ⫯[0←⟦V⟧[gv,v]]v ≗ y. #M #gv #lv #HM #y #L #H elim H -y -L [ #Y #X #H destruct | #v #d #K #V #Hv #Hd #_ #Y #X #H destruct @@ -66,7 +66,7 @@ qed-. lemma vpushs_inv_abbr (M) (gv) (lv): is_model M → ∀y,K,V. K.ⓓV ⨁{M}[gv] lv ≘ y → - ∃∃v. K ⨁[gv] lv ≘ v & ⫯[0←⟦V⟧[gv, v]]v ≗ y. + ∃∃v. K ⨁[gv] lv ≘ v & ⫯[0←⟦V⟧[gv,v]]v ≗ y. /2 width=3 by vpushs_inv_abbr_aux/ qed-. fact vpushs_inv_abst_aux (M) (gv) (lv): is_model M → diff --git a/matita/matita/contribs/lambdadelta/apps_2/models/vpushs_fold.ma b/matita/matita/contribs/lambdadelta/apps_2/models/vpushs_fold.ma index 59f9b3e84..8ac169986 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/models/vpushs_fold.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/models/vpushs_fold.ma @@ -21,8 +21,8 @@ include "apps_2/models/vpushs.ma". lemma vpushs_fold (M): is_model M → is_extensional M → ∀L,T1,T2,gv,lv. - (∀v. L ⨁[gv] lv ≘ v → ⟦T1⟧[gv, v] ≗ ⟦T2⟧[gv, v]) → - ⟦L+T1⟧[gv, lv] ≗{M} ⟦L+T2⟧[gv, lv]. + (∀v. L ⨁[gv] lv ≘ v → ⟦T1⟧[gv,v] ≗ ⟦T2⟧[gv,v]) → + ⟦L+T1⟧[gv,lv] ≗{M} ⟦L+T2⟧[gv,lv]. #M #H1M #H2M #L elim L -L [| #K * [| * ]] [ #T1 #T2 #gv #lv #H12 >fold_atom >fold_atom @@ -44,8 +44,8 @@ qed. (* Inversion lemmas with fold for restricted closures ***********************) lemma vpushs_inv_fold (M): is_model M → is_injective M → - ∀L,T1,T2,gv,lv. ⟦L+T1⟧[gv, lv] ≗{M} ⟦L+T2⟧[gv, lv] → - ∀v. L ⨁[gv] lv ≘ v → ⟦T1⟧[gv, v] ≗ ⟦T2⟧[gv, v]. + ∀L,T1,T2,gv,lv. ⟦L+T1⟧[gv,lv] ≗{M} ⟦L+T2⟧[gv,lv] → + ∀v. L ⨁[gv] lv ≘ v → ⟦T1⟧[gv,v] ≗ ⟦T2⟧[gv,v]. #M #H1M #H2M #L elim L -L [| #K * [| * ]] [ #T1 #T2 #gv #lv >fold_atom >fold_atom #H12 #v #H diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma index c3fa8e11b..4b51fb944 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma @@ -12,40 +12,34 @@ (* *) (**************************************************************************) +include "static_2/syntax/ac.ma". include "basic_2/notation/relations/exclaim_5.ma". -include "basic_2/notation/relations/exclaim_4.ma". -include "basic_2/notation/relations/exclaimstar_4.ma". include "basic_2/rt_computation/cpms.ma". (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* activate genv *) (* Basic_2A1: uses: snv *) -inductive cnv (a) (h): relation3 genv lenv term ≝ -| cnv_sort: ∀G,L,s. cnv a h G L (⋆s) -| cnv_zero: ∀I,G,K,V. cnv a h G K V → cnv a h G (K.ⓑ{I}V) (#0) -| cnv_lref: ∀I,G,K,i. cnv a h G K (#i) → cnv a h G (K.ⓘ{I}) (#↑i) -| cnv_bind: ∀p,I,G,L,V,T. cnv a h G L V → cnv a h G (L.ⓑ{I}V) T → cnv a h G L (ⓑ{p,I}V.T) -| cnv_appl: ∀n,p,G,L,V,W0,T,U0. (a = Ⓣ → n ≤ 1) → cnv a h G L V → cnv a h G L T → - ⦃G, L⦄ ⊢ V ➡*[1, h] W0 → ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0 → cnv a h G L (ⓐV.T) -| cnv_cast: ∀G,L,U,T,U0. cnv a h G L U → cnv a h G L T → - ⦃G, L⦄ ⊢ U ➡*[h] U0 → ⦃G, L⦄ ⊢ T ➡*[1, h] U0 → cnv a h G L (ⓝU.T) +inductive cnv (h) (a): relation3 genv lenv term ≝ +| cnv_sort: ∀G,L,s. cnv h a G L (⋆s) +| cnv_zero: ∀I,G,K,V. cnv h a G K V → cnv h a G (K.ⓑ{I}V) (#0) +| cnv_lref: ∀I,G,K,i. cnv h a G K (#i) → cnv h a G (K.ⓘ{I}) (#↑i) +| cnv_bind: ∀p,I,G,L,V,T. cnv h a G L V → cnv h a G (L.ⓑ{I}V) T → cnv h a G L (ⓑ{p,I}V.T) +| cnv_appl: ∀n,p,G,L,V,W0,T,U0. ad a n → cnv h a G L V → cnv h a G L T → + ⦃G,L⦄ ⊢ V ➡*[1,h] W0 → ⦃G,L⦄ ⊢ T ➡*[n,h] ⓛ{p}W0.U0 → cnv h a G L (ⓐV.T) +| cnv_cast: ∀G,L,U,T,U0. cnv h a G L U → cnv h a G L T → + ⦃G,L⦄ ⊢ U ➡*[h] U0 → ⦃G,L⦄ ⊢ T ➡*[1,h] U0 → cnv h a G L (ⓝU.T) . interpretation "context-sensitive native validity (term)" - 'Exclaim a h G L T = (cnv a h G L T). - -interpretation "context-sensitive restricted native validity (term)" - 'Exclaim h G L T = (cnv true h G L T). - -interpretation "context-sensitive extended native validity (term)" - 'ExclaimStar h G L T = (cnv false h G L T). + 'Exclaim h a G L T = (cnv h a G L T). (* Basic inversion lemmas ***************************************************) -fact cnv_inv_zero_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → X = #0 → - ∃∃I,K,V. ⦃G, K⦄ ⊢ V ![a, h] & L = K.ⓑ{I}V. -#a #h #G #L #X * -G -L -X +fact cnv_inv_zero_aux (h) (a): + ∀G,L,X. ⦃G,L⦄ ⊢ X ![h,a] → X = #0 → + ∃∃I,K,V. ⦃G,K⦄ ⊢ V ![h,a] & L = K.ⓑ{I}V. +#h #a #G #L #X * -G -L -X [ #G #L #s #H destruct | #I #G #K #V #HV #_ /2 width=5 by ex2_3_intro/ | #I #G #K #i #_ #H destruct @@ -55,13 +49,15 @@ fact cnv_inv_zero_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → X = #0 → ] qed-. -lemma cnv_inv_zero (a) (h): ∀G,L. ⦃G, L⦄ ⊢ #0 ![a, h] → - ∃∃I,K,V. ⦃G, K⦄ ⊢ V ![a, h] & L = K.ⓑ{I}V. +lemma cnv_inv_zero (h) (a): + ∀G,L. ⦃G,L⦄ ⊢ #0 ![h,a] → + ∃∃I,K,V. ⦃G,K⦄ ⊢ V ![h,a] & L = K.ⓑ{I}V. /2 width=3 by cnv_inv_zero_aux/ qed-. -fact cnv_inv_lref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀i. X = #(↑i) → - ∃∃I,K. ⦃G, K⦄ ⊢ #i ![a, h] & L = K.ⓘ{I}. -#a #h #G #L #X * -G -L -X +fact cnv_inv_lref_aux (h) (a): + ∀G,L,X. ⦃G,L⦄ ⊢ X ![h,a] → ∀i. X = #(↑i) → + ∃∃I,K. ⦃G,K⦄ ⊢ #i ![h,a] & L = K.ⓘ{I}. +#h #a #G #L #X * -G -L -X [ #G #L #s #j #H destruct | #I #G #K #V #_ #j #H destruct | #I #G #L #i #Hi #j #H destruct /2 width=4 by ex2_2_intro/ @@ -71,12 +67,13 @@ fact cnv_inv_lref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀i. X = ] qed-. -lemma cnv_inv_lref (a) (h): ∀G,L,i. ⦃G, L⦄ ⊢ #↑i ![a, h] → - ∃∃I,K. ⦃G, K⦄ ⊢ #i ![a, h] & L = K.ⓘ{I}. +lemma cnv_inv_lref (h) (a): + ∀G,L,i. ⦃G,L⦄ ⊢ #↑i ![h,a] → + ∃∃I,K. ⦃G,K⦄ ⊢ #i ![h,a] & L = K.ⓘ{I}. /2 width=3 by cnv_inv_lref_aux/ qed-. -fact cnv_inv_gref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀l. X = §l → ⊥. -#a #h #G #L #X * -G -L -X +fact cnv_inv_gref_aux (h) (a): ∀G,L,X. ⦃G,L⦄ ⊢ X ![h,a] → ∀l. X = §l → ⊥. +#h #a #G #L #X * -G -L -X [ #G #L #s #l #H destruct | #I #G #K #V #_ #l #H destruct | #I #G #K #i #_ #l #H destruct @@ -87,14 +84,14 @@ fact cnv_inv_gref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀l. X = qed-. (* Basic_2A1: uses: snv_inv_gref *) -lemma cnv_inv_gref (a) (h): ∀G,L,l. ⦃G, L⦄ ⊢ §l ![a, h] → ⊥. +lemma cnv_inv_gref (h) (a): ∀G,L,l. ⦃G,L⦄ ⊢ §l ![h,a] → ⊥. /2 width=8 by cnv_inv_gref_aux/ qed-. -fact cnv_inv_bind_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → - ∀p,I,V,T. X = ⓑ{p,I}V.T → - ∧∧ ⦃G, L⦄ ⊢ V ![a, h] - & ⦃G, L.ⓑ{I}V⦄ ⊢ T ![a, h]. -#a #h #G #L #X * -G -L -X +fact cnv_inv_bind_aux (h) (a): + ∀G,L,X. ⦃G,L⦄ ⊢ X ![h,a] → + ∀p,I,V,T. X = ⓑ{p,I}V.T → + ∧∧ ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L.ⓑ{I}V⦄ ⊢ T ![h,a]. +#h #a #G #L #X * -G -L -X [ #G #L #s #q #Z #X1 #X2 #H destruct | #I #G #K #V #_ #q #Z #X1 #X2 #H destruct | #I #G #K #i #_ #q #Z #X1 #X2 #H destruct @@ -105,15 +102,16 @@ fact cnv_inv_bind_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → qed-. (* Basic_2A1: uses: snv_inv_bind *) -lemma cnv_inv_bind (a) (h): ∀p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T ![a, h] → - ∧∧ ⦃G, L⦄ ⊢ V ![a, h] - & ⦃G, L.ⓑ{I}V⦄ ⊢ T ![a, h]. +lemma cnv_inv_bind (h) (a): + ∀p,I,G,L,V,T. ⦃G,L⦄ ⊢ ⓑ{p,I}V.T ![h,a] → + ∧∧ ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L.ⓑ{I}V⦄ ⊢ T ![h,a]. /2 width=4 by cnv_inv_bind_aux/ qed-. -fact cnv_inv_appl_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀V,T. X = ⓐV.T → - ∃∃n,p,W0,U0. a = Ⓣ → n ≤ 1 & ⦃G, L⦄ ⊢ V ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ V ➡*[1, h] W0 & ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0. -#a #h #G #L #X * -L -X +fact cnv_inv_appl_aux (h) (a): + ∀G,L,X. ⦃G,L⦄ ⊢ X ![h,a] → ∀V,T. X = ⓐV.T → + ∃∃n,p,W0,U0. ad a n & ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L⦄ ⊢ T ![h,a] & + ⦃G,L⦄ ⊢ V ➡*[1,h] W0 & ⦃G,L⦄ ⊢ T ➡*[n,h] ⓛ{p}W0.U0. +#h #a #G #L #X * -L -X [ #G #L #s #X1 #X2 #H destruct | #I #G #K #V #_ #X1 #X2 #H destruct | #I #G #K #i #_ #X1 #X2 #H destruct @@ -124,15 +122,17 @@ fact cnv_inv_appl_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀V,T. X qed-. (* Basic_2A1: uses: snv_inv_appl *) -lemma cnv_inv_appl (a) (h): ∀G,L,V,T. ⦃G, L⦄ ⊢ ⓐV.T ![a, h] → - ∃∃n,p,W0,U0. a = Ⓣ → n ≤ 1 & ⦃G, L⦄ ⊢ V ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ V ➡*[1, h] W0 & ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0. +lemma cnv_inv_appl (h) (a): + ∀G,L,V,T. ⦃G,L⦄ ⊢ ⓐV.T ![h,a] → + ∃∃n,p,W0,U0. ad a n & ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L⦄ ⊢ T ![h,a] & + ⦃G,L⦄ ⊢ V ➡*[1,h] W0 & ⦃G,L⦄ ⊢ T ➡*[n,h] ⓛ{p}W0.U0. /2 width=3 by cnv_inv_appl_aux/ qed-. -fact cnv_inv_cast_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀U,T. X = ⓝU.T → - ∃∃U0. ⦃G, L⦄ ⊢ U ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ U ➡*[h] U0 & ⦃G, L⦄ ⊢ T ➡*[1, h] U0. -#a #h #G #L #X * -G -L -X +fact cnv_inv_cast_aux (h) (a): + ∀G,L,X. ⦃G,L⦄ ⊢ X ![h,a] → ∀U,T. X = ⓝU.T → + ∃∃U0. ⦃G,L⦄ ⊢ U ![h,a] & ⦃G,L⦄ ⊢ T ![h,a] & + ⦃G,L⦄ ⊢ U ➡*[h] U0 & ⦃G,L⦄ ⊢ T ➡*[1,h] U0. +#h #a #G #L #X * -G -L -X [ #G #L #s #X1 #X2 #H destruct | #I #G #K #V #_ #X1 #X2 #H destruct | #I #G #K #i #_ #X1 #X2 #H destruct @@ -142,23 +142,32 @@ fact cnv_inv_cast_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀U,T. X ] qed-. -(* Basic_2A1: uses: snv_inv_appl *) -lemma cnv_inv_cast (a) (h): ∀G,L,U,T. ⦃G, L⦄ ⊢ ⓝU.T ![a, h] → - ∃∃U0. ⦃G, L⦄ ⊢ U ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ U ➡*[h] U0 & ⦃G, L⦄ ⊢ T ➡*[1, h] U0. +(* Basic_2A1: uses: snv_inv_cast *) +lemma cnv_inv_cast (h) (a): + ∀G,L,U,T. ⦃G,L⦄ ⊢ ⓝU.T ![h,a] → + ∃∃U0. ⦃G,L⦄ ⊢ U ![h,a] & ⦃G,L⦄ ⊢ T ![h,a] & + ⦃G,L⦄ ⊢ U ➡*[h] U0 & ⦃G,L⦄ ⊢ T ➡*[1,h] U0. /2 width=3 by cnv_inv_cast_aux/ qed-. (* Basic forward lemmas *****************************************************) -lemma cnv_fwd_flat (a) (h) (I) (G) (L): - ∀V,T. ⦃G, L⦄ ⊢ ⓕ{I}V.T ![a,h] → - ∧∧ ⦃G, L⦄ ⊢ V ![a,h] & ⦃G, L⦄ ⊢ T ![a,h]. -#a #h * #G #L #V #T #H +lemma cnv_fwd_flat (h) (a) (I) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ⓕ{I}V.T ![h,a] → + ∧∧ ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L⦄ ⊢ T ![h,a]. +#h #a * #G #L #V #T #H [ elim (cnv_inv_appl … H) #n #p #W #U #_ #HV #HT #_ #_ | elim (cnv_inv_cast … H) #U #HV #HT #_ #_ ] -H /2 width=1 by conj/ qed-. +lemma cnv_fwd_pair_sn (h) (a) (I) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ②{I}V.T ![h,a] → ⦃G,L⦄ ⊢ V ![h,a]. +#h #a * [ #p ] #I #G #L #V #T #H +[ elim (cnv_inv_bind … H) -H #HV #_ +| elim (cnv_fwd_flat … H) -H #HV #_ +] // +qed-. + (* Basic_2A1: removed theorems 3: shnv_cast shnv_inv_cast snv_shnv_cast *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma index 7f71bea7c..e96946f06 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma @@ -15,13 +15,13 @@ include "basic_2/rt_computation/cpms_aaa.ma". include "basic_2/dynamic/cnv.ma". -(* CONTEXT_SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Forward lemmas on atomic arity assignment for terms **********************) (* Basic_2A1: uses: snv_fwd_aaa *) -lemma cnv_fwd_aaa (a) (h): ∀G,L,T. ⦃G, L⦄ ⊢ T ![a, h] → ∃A. ⦃G, L⦄ ⊢ T ⁝ A. -#a #h #G #L #T #H elim H -G -L -T +lemma cnv_fwd_aaa (h) (a): ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a] → ∃A. ⦃G,L⦄ ⊢ T ⁝ A. +#h #a #G #L #T #H elim H -G -L -T [ /2 width=2 by aaa_sort, ex_intro/ | #I #G #L #V #_ * /3 width=2 by aaa_zero, ex_intro/ | #I #G #L #K #_ * /3 width=2 by aaa_lref, ex_intro/ @@ -43,18 +43,39 @@ qed-. (* Forward lemmas with t_bound rt_transition for terms **********************) -lemma cnv_fwd_cpm_SO (a) (h) (G) (L): - ∀T. ⦃G, L⦄ ⊢ T ![a, h] → ∃U. ⦃G,L⦄ ⊢ T ➡[1,h] U. -#a #h #G #L #T #H +lemma cnv_fwd_cpm_SO (h) (a) (G) (L): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∃U. ⦃G,L⦄ ⊢ T ➡[1,h] U. +#h #a #G #L #T #H elim (cnv_fwd_aaa … H) -H #A #HA /2 width=2 by aaa_cpm_SO/ qed-. (* Forward lemmas with t_bound rt_computation for terms *********************) -lemma cnv_fwd_cpms_total (a) (h) (n) (G) (L): - ∀T. ⦃G, L⦄ ⊢ T ![a, h] → ∃U. ⦃G,L⦄ ⊢ T ➡*[n,h] U. -#a #h #n #G #L #T #H +lemma cnv_fwd_cpms_total (h) (a) (n) (G) (L): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∃U. ⦃G,L⦄ ⊢ T ➡*[n,h] U. +#h #a #n #G #L #T #H elim (cnv_fwd_aaa … H) -H #A #HA -/2 width=2 by aaa_cpms_total/ +/2 width=2 by cpms_total_aaa/ qed-. + +lemma cnv_fwd_cpms_abst_dx_le (h) (a) (G) (L) (W) (p): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → + ∀n1,U1. ⦃G,L⦄ ⊢ T ➡*[n1,h] ⓛ{p}W.U1 → ∀n2. n1 ≤ n2 → + ∃∃U2. ⦃G,L⦄ ⊢ T ➡*[n2,h] ⓛ{p}W.U2 & ⦃G,L.ⓛW⦄ ⊢ U1 ➡*[n2-n1,h] U2. +#h #a #G #L #W #p #T #H +elim (cnv_fwd_aaa … H) -H #A #HA +/2 width=2 by cpms_abst_dx_le_aaa/ +qed-. + +(* Advanced properties ******************************************************) + +lemma cnv_appl_ge (h) (a) (n1) (p) (G) (L): + ∀n2. n1 ≤ n2 → ad a n2 → + ∀V. ⦃G,L⦄ ⊢ V ![h,a] → ∀T. ⦃G,L⦄ ⊢ T ![h,a] → + ∀X. ⦃G,L⦄ ⊢ V ➡*[1,h] X → ∀W. ⦃G,L⦄ ⊢ W ➡*[h] X → + ∀U. ⦃G,L⦄ ⊢ T ➡*[n1,h] ⓛ{p}W.U → ⦃G,L⦄ ⊢ ⓐV.T ![h,a]. +#h #a #n1 #p #G #L #n2 #Hn12 #Ha #V #HV #T #HT #X #HVX #W #HW #X #HTX +elim (cnv_fwd_cpms_abst_dx_le … HT … HTX … Hn12) #U #HTU #_ -n1 +/4 width=11 by cnv_appl, cpms_bind, cpms_cprs_trans/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_acle.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_acle.ma new file mode 100644 index 000000000..4a4a015ac --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_acle.ma @@ -0,0 +1,42 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/syntax/acle.ma". +include "basic_2/dynamic/cnv_aaa.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* Properties with preorder for applicability domains ***********************) + +lemma cnv_acle_trans (h) (a1) (a2): + a1 ⊆ a2 → ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a1] → ⦃G,L⦄ ⊢ T ![h,a2]. +#h #a1 #a2 #Ha12 #G #L #T #H elim H -G -L -T +[ /1 width=1 by cnv_sort/ +| /3 width=1 by cnv_zero/ +| /3 width=1 by cnv_lref/ +| /3 width=1 by cnv_bind/ +| #n1 #p #G #L #V #W #T #U #Hn1 #_ #_ #HVW #HTU #IHV #IHT + elim (Ha12 … Hn1) -a1 #n2 #Hn2 #Hn12 + /3 width=11 by cnv_appl_ge/ +| /3 width=3 by cnv_cast/ +] +qed-. + +lemma cnv_acle_omega (h) (a): + ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a] → ⦃G,L⦄ ⊢ T ![h,𝛚]. +/3 width=3 by cnv_acle_trans, acle_omega/ qed-. + +lemma cnv_acle_one (h) (a) (n): + ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,𝟏] → ad a n → ⦃G,L⦄ ⊢ T ![h,a]. +/3 width=3 by cnv_acle_trans, acle_one/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpce.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpce.ma new file mode 100644 index 000000000..a4b4078d8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpce.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 "basic_2/rt_computation/cpmuwe_cpmuwe.ma". +include "basic_2/rt_conversion/cpce_drops.ma". +include "basic_2/dynamic/cnv_cpmuwe.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* Properties with context-sensitive parallel eta-conversion for terms ******) + +lemma cpce_total_cnv (h) (a) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → ∃T2. ⦃G,L⦄ ⊢ T1 ⬌η[h] T2. +#h #a #G #L #T1 #HT1 +lapply (cnv_fwd_csx … HT1) #H +generalize in match HT1; -HT1 +@(csx_ind_fpbg … H) -G -L -T1 +#G #L * * +[ #s #_ #_ /2 width=2 by cpce_sort, ex_intro/ +| #i #H1i #IH #H2i + elim (drops_ldec_dec L i) [ * #K #W #HLK | -H1i -IH #HnX ] + [ lapply (cnv_inv_lref_pair … H2i … HLK) -H2i #H2W + lapply (csx_inv_lref_pair_drops … HLK H1i) -H1i #H1W + elim (cpmuwe_total_csx … H1W) -H1W #X #n #HWX + elim (abst_dec X) [ * | -IH ] + [ #p #V1 #U #H destruct + lapply (cpmuwe_fwd_cpms … HWX) -HWX #HWX + elim (IH G K V1) -IH + [ #V2 #HV12 + elim (lifts_total V2 (𝐔❴↑i❵)) #W2 #HVW2 + /3 width=12 by cpce_eta_drops, ex_intro/ + | /3 width=6 by cnv_cpms_trans, cnv_fwd_pair_sn/ + | /4 width=6 by fqup_cpms_fwd_fpbg, fpbg_fqu_trans, fqup_lref/ + ] + | #HnX + @(ex_intro … (#i)) + @cpce_zero_drops #n0 #p #K0 #W0 #V0 #U0 #HLK0 #HWU0 + lapply (drops_mono … HLK0 … HLK) -i -L #H destruct + lapply (cpmuwe_abst … HWU0) -HWU0 #HWU0 + elim (cnv_cpmuwe_mono … H2W … HWU0 … HWX) #_ #H -a -n -n0 -W + elim (tweq_inv_abst_sn … H) -V0 -U0 #V0 #U0 #H destruct + /2 width=4 by/ + ] + | /5 width=3 by cpce_zero_drops, ex1_2_intro, ex_intro/ + ] +| #l #_ #_ /2 width=2 by cpce_gref, ex_intro/ +| #p #I #V1 #T1 #_ #IH #H + elim (cnv_inv_bind … H) -H #HV1 #HT1 + elim (IH … HV1) [| /3 width=1 by fpb_fpbg, fpb_fqu, fqu_pair_sn/ ] #V2 #HV12 + elim (IH … HT1) [| /4 width=1 by fpb_fpbg, fpb_fqu, fqu_bind_dx/ ] #T2 #HT12 + /3 width=2 by cpce_bind, ex_intro/ +| #I #V1 #T1 #_ #IH #H + elim (cnv_fwd_flat … H) -H #HV1 #HT1 + elim (IH … HV1) [| /3 width=1 by fpb_fpbg, fpb_fqu, fqu_pair_sn/ ] #V2 #HV12 + elim (IH … HT1) [| /3 width=1 by fpb_fpbg, fpb_fqu, fqu_flat_dx/ ] #T2 #HT12 + /3 width=2 by cpce_flat, ex_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpcs.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpcs.ma index ba4b824ce..5ed59b739 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpcs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpcs.ma @@ -12,27 +12,19 @@ (* *) (**************************************************************************) -include "basic_2/rt_equivalence/cpcs_cprs.ma". -include "basic_2/dynamic/cnv_preserve.ma". +include "basic_2/rt_computation/csx_aaa.ma". +include "basic_2/rt_equivalence/cpcs_csx.ma". +include "basic_2/dynamic/cnv_aaa.ma". (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) -(* Forward lemmas with r-equivalence ****************************************) +(* Properties with r-equivalence ********************************************) -lemma cnv_cpms_conf_eq (a) (h) (n) (G) (L): - ∀T. ⦃G,L⦄ ⊢ T ![a,h] → - ∀T1. ⦃G,L⦄ ⊢ T ➡*[n,h] T1 → ∀T2. ⦃G,L⦄ ⊢ T ➡*[n,h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. -#a #h #n #G #L #T #HT #T1 #HT1 #T2 #HT2 -elim (cnv_cpms_conf … HT … HT1 … HT2) -T [h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄⊢#i![a,h] → +fact cnv_cpm_conf_lpr_atom_delta_aux (h) (a) (G) (L) (i): + (∀G0,L0,T0. ⦃G,L,#i⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄⊢#i![h,a] → ∀K,V. ⬇*[i]L ≘ K.ⓓV → ∀n,XV. ⦃G,K⦄ ⊢ V ➡[n,h] XV → ∀X. ⬆*[↑i]XV ≘ X → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ #i ➡*[n,h] T & ⦃G,L2⦄ ⊢ X ➡*[h] T. -#a #h #o #G #L #i #IH #HT #K #V #HLK #n #XV #HVX #X #HXV #L1 #HL1 #L2 #HL2 -lapply (cnv_lref_fwd_drops … HT … HLK) -HT #HV +#h #a #G #L #i #IH #HT #K #V #HLK #n #XV #HVX #X #HXV #L1 #HL1 #L2 #HL2 +lapply (cnv_inv_lref_pair … HT … HLK) -HT #HV elim (lpr_drops_conf … HLK … HL1) -HL1 // #Y1 #H1 #HLK1 elim (lpr_inv_pair_sn … H1) -H1 #K1 #V1 #HK1 #HV1 #H destruct elim (lpr_drops_conf … HLK … HL2) -HL2 // #Y2 #H2 #HLK2 @@ -53,16 +53,16 @@ elim (cpms_lifts_sn … HVX … HLK2 … HXV) -XV -HLK2 #XV #HVX #HXV /3 width=6 by cpms_delta_drops, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_atom_ell_aux (a) (h) (o) (G) (L) (i): - (∀G0,L0,T0. ⦃G,L,#i⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄⊢#i![a,h] → +fact cnv_cpm_conf_lpr_atom_ell_aux (h) (a) (G) (L) (i): + (∀G0,L0,T0. ⦃G,L,#i⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄⊢#i![h,a] → ∀K,W. ⬇*[i]L ≘ K.ⓛW → ∀n,XW. ⦃G,K⦄ ⊢ W ➡[n,h] XW → ∀X. ⬆*[↑i]XW ≘ X → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ #i ➡*[↑n,h] T & ⦃G,L2⦄ ⊢ X ➡*[h] T. -#a #h #o #G #L #i #IH #HT #K #W #HLK #n #XW #HWX #X #HXW #L1 #HL1 #L2 #HL2 -lapply (cnv_lref_fwd_drops … HT … HLK) -HT #HW +#h #a #G #L #i #IH #HT #K #W #HLK #n #XW #HWX #X #HXW #L1 #HL1 #L2 #HL2 +lapply (cnv_inv_lref_pair … HT … HLK) -HT #HW elim (lpr_drops_conf … HLK … HL1) -HL1 // #Y1 #H1 #HLK1 elim (lpr_inv_pair_sn … H1) -H1 #K1 #W1 #HK1 #HW1 #H destruct elim (lpr_drops_conf … HLK … HL2) -HL2 // #Y2 #H2 #HLK2 @@ -75,19 +75,19 @@ elim (cpms_lifts_sn … HWX … HLK2 … HXW) -XW -HLK2 #XW #HWX #HXW /3 width=6 by cpms_ell_drops, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_delta_delta_aux (a) (h) (o) (I) (G) (L) (i): - (∀G0,L0,T0. ⦃G,L,#i⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄⊢#i![a,h] → +fact cnv_cpm_conf_lpr_delta_delta_aux (h) (a) (I) (G) (L) (i): + (∀G0,L0,T0. ⦃G,L,#i⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄⊢#i![h,a] → ∀K1,V1. ⬇*[i]L ≘ K1.ⓑ{I}V1 → ∀K2,V2. ⬇*[i]L ≘ K2.ⓑ{I}V2 → ∀n1,XV1. ⦃G,K1⦄ ⊢ V1 ➡[n1,h] XV1 → ∀n2,XV2. ⦃G,K2⦄ ⊢ V2 ➡[n2,h] XV2 → ∀X1. ⬆*[↑i]XV1 ≘ X1 → ∀X2. ⬆*[↑i]XV2 ≘ X2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ X1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ X2 ➡*[n1-n2,h] T. -#a #h #o #I #G #L #i #IH #HT +#h #a #I #G #L #i #IH #HT #K #V #HLK #Y #X #HLY #n1 #XV1 #HVX1 #n2 #XV2 #HVX2 #X1 #HXV1 #X2 #HXV2 #L1 #HL1 #L2 #HL2 lapply (drops_mono … HLY … HLK) -HLY #H destruct -lapply (cnv_lref_fwd_drops … HT … HLK) -HT #HV +lapply (cnv_inv_lref_pair … HT … HLK) -HT #HV elim (lpr_drops_conf … HLK … HL1) -HL1 // #Y1 #H1 #HLK1 elim (lpr_inv_pair_sn … H1) -H1 #K1 #V1 #HK1 #_ #H destruct lapply (drops_isuni_fwd_drop2 … HLK1) -V1 // #HLK1 @@ -107,14 +107,14 @@ fact cnv_cpm_conf_lpr_delta_ell_aux (L) (K1) (K2) (V) (W) (i): lapply (drops_mono … HLK2 … HLK1) -L -i #H destruct qed-. -fact cnv_cpm_conf_lpr_bind_bind_aux (a) (h) (o) (p) (I) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,ⓑ{p,I}V.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓑ{p,I}V.T ![a,h] → +fact cnv_cpm_conf_lpr_bind_bind_aux (h) (a) (p) (I) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓑ{p,I}V.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓑ{p,I}V.T ![h,a] → ∀V1. ⦃G,L⦄ ⊢ V ➡[h] V1 → ∀V2. ⦃G,L⦄ ⊢ V ➡[h] V2 → ∀n1,T1. ⦃G,L.ⓑ{I}V⦄ ⊢ T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L.ⓑ{I}V⦄ ⊢ T ➡[n2,h] T2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ ⓑ{p,I}V2.T2 ➡*[n1-n2,h] T. -#a #h #o #p #I #G0 #L0 #V0 #T0 #IH #H0 +#h #a #p #I #G0 #L0 #V0 #T0 #IH #H0 #V1 #HV01 #V2 #HV02 #n1 #T1 #HT01 #n2 #T2 #HT02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_bind … H0) -H0 #HV0 #HT0 @@ -124,14 +124,14 @@ elim (cnv_cpm_conf_lpr_sub … IH … HT01 … HT02 (L1.ⓑ{I}V1) … (L2.ⓑ{I} /3 width=5 by cpms_bind_dx, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_bind_zeta_aux (a) (h) (o) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,+ⓓV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ +ⓓV.T ![a,h] → +fact cnv_cpm_conf_lpr_bind_zeta_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,+ⓓV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ +ⓓV.T ![h,a] → ∀V1. ⦃G,L⦄ ⊢V ➡[h] V1 → ∀n1,T1. ⦃G,L.ⓓV⦄ ⊢ T ➡[n1,h] T1 → ∀T2. ⬆*[1]T2 ≘ T → ∀n2,XT2. ⦃G,L⦄ ⊢ T2 ➡[n2,h] XT2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ +ⓓV1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ XT2 ➡*[n1-n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 +#h #a #G0 #L0 #V0 #T0 #IH #H0 #V1 #HV01 #n1 #T1 #HT01 #T2 #HT20 #n2 #XT2 #HXT2 #L1 #HL01 #L2 #HL02 elim (cnv_inv_bind … H0) -H0 #_ #HT0 @@ -144,14 +144,14 @@ elim (cnv_cpm_conf_lpr_sub … IH … HXT12 … HXT2 … HL01 … HL02) /3 width=3 by cpms_zeta, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_zeta_zeta_aux (a) (h) (o) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,+ⓓV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ +ⓓV.T ![a,h] → +fact cnv_cpm_conf_lpr_zeta_zeta_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,+ⓓV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ +ⓓV.T ![h,a] → ∀T1. ⬆*[1]T1 ≘ T → ∀T2. ⬆*[1]T2 ≘ T → ∀n1,XT1. ⦃G,L⦄ ⊢ T1 ➡[n1,h] XT1 → ∀n2,XT2. ⦃G,L⦄ ⊢ T2 ➡[n2,h] XT2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ XT1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ XT2 ➡*[n1-n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 +#h #a #G0 #L0 #V0 #T0 #IH #H0 #T1 #HT10 #T2 #HT20 #n1 #XT1 #HXT1 #n2 #XT2 #HXT2 #L1 #HL01 #L2 #HL02 elim (cnv_inv_bind … H0) -H0 #_ #HT0 @@ -163,14 +163,14 @@ elim (cnv_cpm_conf_lpr_sub … IH … HXT1 … HXT2 … HL01 … HL02) /2 width=3 by ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_appl_appl_aux (a) (h) (o) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,ⓐV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓐV.T ![a,h] → +fact cnv_cpm_conf_lpr_appl_appl_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓐV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓐV.T ![h,a] → ∀V1. ⦃G,L⦄ ⊢ V ➡[h] V1 → ∀V2. ⦃G,L⦄ ⊢ V ➡[h] V2 → ∀n1,T1. ⦃G,L⦄ ⊢ T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L⦄ ⊢ T ➡[n2,h] T2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓐV1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ ⓐV2.T2 ➡*[n1-n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 +#h #a #G0 #L0 #V0 #T0 #IH #H0 #V1 #HV01 #V2 #HV02 #n1 #T1 #HT01 #n2 #T2 #HT02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_appl … H0) -H0 #n0 #p0 #X01 #X02 #_ #HV0 #HT0 #_ #_ -n0 -p0 -X01 -X02 @@ -180,15 +180,15 @@ elim (cnv_cpm_conf_lpr_sub … IH … HT01 … HT02 … HL01 … HL02) [|*: /2 w /3 width=5 by cpms_appl_dx, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_appl_beta_aux (a) (h) (o) (p) (G) (L) (V) (W) (T): - (∀G0,L0,T0. ⦃G,L,ⓐV.ⓛ{p}W.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.T ![a,h] → +fact cnv_cpm_conf_lpr_appl_beta_aux (h) (a) (p) (G) (L) (V) (W) (T): + (∀G0,L0,T0. ⦃G,L,ⓐV.ⓛ{p}W.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.T ![h,a] → ∀V1. ⦃G,L⦄ ⊢ V ➡[h] V1 → ∀V2. ⦃G,L⦄ ⊢ V ➡[h] V2 → ∀W2. ⦃G,L⦄ ⊢ W ➡[h] W2 → ∀n1,T1. ⦃G,L⦄ ⊢ ⓛ{p}W.T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L.ⓛW⦄ ⊢ T ➡[n2,h] T2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓐV1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡*[n1-n2,h] T. -#a #h #o #p #G0 #L0 #V0 #W0 #T0 #IH #H0 +#h #a #p #G0 #L0 #V0 #W0 #T0 #IH #H0 #V1 #HV01 #V2 #HV02 #W2 #HW02 #n1 #X #HX #n2 #T2 #HT02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_appl … H0) -H0 #n0 #p0 #X01 #X02 #_ #HV0 #H0 #_ #_ -n0 -p0 -X01 -X02 @@ -202,16 +202,16 @@ lapply (lsubr_cpms_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 [ /2 width=1 by lsubr_ /4 width=5 by cpms_beta_dx, cpms_bind_dx, cpm_cast, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_appl_theta_aux (a) (h) (o) (p) (G) (L) (V) (W) (T): - (∀G0,L0,T0. ⦃G,L,ⓐV.ⓓ{p}W.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓐV.ⓓ{p}W.T ![a,h] → +fact cnv_cpm_conf_lpr_appl_theta_aux (h) (a) (p) (G) (L) (V) (W) (T): + (∀G0,L0,T0. ⦃G,L,ⓐV.ⓓ{p}W.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓐV.ⓓ{p}W.T ![h,a] → ∀V1. ⦃G,L⦄ ⊢ V ➡[h] V1 → ∀V2. ⦃G,L⦄ ⊢ V ➡[h] V2 → ∀W2. ⦃G,L⦄ ⊢ W ➡[h] W2 → ∀n1,T1. ⦃G,L⦄ ⊢ ⓓ{p}W.T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L.ⓓW⦄ ⊢ T ➡[n2,h] T2 → ∀U2. ⬆*[1]V2 ≘ U2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓐV1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡*[n1-n2,h] T. -#a #h #o #p #G0 #L0 #V0 #W0 #T0 #IH #H0 +#h #a #p #G0 #L0 #V0 #W0 #T0 #IH #H0 #V1 #HV01 #V2 #HV02 #W2 #HW02 #n1 #X #HX #n2 #T2 #HT02 #U2 #HVU2 #L1 #HL01 #L2 #HL02 elim (cnv_inv_appl … H0) -H0 #n0 #p0 #X01 #X02 #_ #HV0 #H0 #_ #_ -n0 -p0 -X01 -X02 @@ -233,15 +233,15 @@ elim (cpm_inv_abbr1 … HX) -HX * ] qed-. -fact cnv_cpm_conf_lpr_beta_beta_aux (a) (h) (o) (p) (G) (L) (V) (W) (T): - (∀G0,L0,T0. ⦃G,L,ⓐV.ⓛ{p}W.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.T ![a,h] → +fact cnv_cpm_conf_lpr_beta_beta_aux (h) (a) (p) (G) (L) (V) (W) (T): + (∀G0,L0,T0. ⦃G,L,ⓐV.ⓛ{p}W.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.T ![h,a] → ∀V1. ⦃G,L⦄ ⊢ V ➡[h] V1 → ∀V2. ⦃G,L⦄ ⊢ V ➡[h] V2 → ∀W1. ⦃G,L⦄ ⊢ W ➡[h] W1 → ∀W2. ⦃G,L⦄ ⊢ W ➡[h] W2 → ∀n1,T1. ⦃G,L.ⓛW⦄ ⊢ T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L.ⓛW⦄ ⊢ T ➡[n2,h] T2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓓ{p}ⓝW1.V1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡*[n1-n2,h] T. -#a #h #o #p #G0 #L0 #V0 #W0 #T0 #IH #H0 +#h #a #p #G0 #L0 #V0 #W0 #T0 #IH #H0 #V1 #HV01 #V2 #HV02 #W1 #HW01 #W2 #HW02 #n1 #T1 #HT01 #n2 #T2 #HT02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_appl … H0) -H0 #n0 #p0 #X01 #X02 #_ #HV0 #H0 #_ #_ -n0 -p0 -X01 -X02 @@ -255,16 +255,16 @@ lapply (lsubr_cpms_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_be /4 width=5 by cpms_bind_dx, cpm_eps, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_theta_theta_aux (a) (h) (o) (p) (G) (L) (V) (W) (T): - (∀G0,L0,T0. ⦃G,L,ⓐV.ⓓ{p}W.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓐV.ⓓ{p}W.T ![a,h] → +fact cnv_cpm_conf_lpr_theta_theta_aux (h) (a) (p) (G) (L) (V) (W) (T): + (∀G0,L0,T0. ⦃G,L,ⓐV.ⓓ{p}W.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓐV.ⓓ{p}W.T ![h,a] → ∀V1. ⦃G,L⦄ ⊢ V ➡[h] V1 → ∀V2. ⦃G,L⦄ ⊢ V ➡[h] V2 → ∀W1. ⦃G,L⦄ ⊢ W ➡[h] W1 → ∀W2. ⦃G,L⦄ ⊢ W ➡[h] W2 → ∀n1,T1. ⦃G,L.ⓓW⦄ ⊢ T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L.ⓓW⦄ ⊢ T ➡[n2,h] T2 → ∀U1. ⬆*[1]V1 ≘ U1 → ∀U2. ⬆*[1]V2 ≘ U2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓓ{p}W1.ⓐU1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡*[n1-n2,h] T. -#a #h #o #p #G0 #L0 #V0 #W0 #T0 #IH #H0 +#h #a #p #G0 #L0 #V0 #W0 #T0 #IH #H0 #V1 #HV01 #V2 #HV02 #W1 #HW01 #W2 #HW02 #n1 #T1 #HT01 #n2 #T2 #HT02 #U1 #HVU1 #U2 #HVU2 #L1 #HL01 #L2 #HL02 elim (cnv_inv_appl … H0) -H0 #n0 #p0 #X01 #X02 #_ #HV0 #H0 #_ #_ -n0 -p0 -X01 -X02 @@ -278,14 +278,14 @@ lapply (cpm_lifts_bi … HV2 (Ⓣ) … (L2.ⓓW2) … HVU2 … HVU) -V2 -V [ /3 /4 width=7 by cpms_appl_dx, cpms_bind_dx, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_cast_cast_aux (a) (h) (o) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓝV.T ![a,h] → +fact cnv_cpm_conf_lpr_cast_cast_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓝV.T ![h,a] → ∀n1,V1. ⦃G,L⦄ ⊢ V ➡[n1,h] V1 → ∀n2,V2. ⦃G,L⦄ ⊢ V ➡[n2,h] V2 → ∀T1. ⦃G,L⦄ ⊢ T ➡[n1,h] T1 → ∀T2. ⦃G,L⦄ ⊢ T ➡[n2,h] T2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓝV1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ ⓝV2.T2 ➡*[n1-n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 +#h #a #G0 #L0 #V0 #T0 #IH #H0 #n1 #V1 #HV01 #n2 #V2 #HV02 #T1 #HT01 #T2 #HT02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_cast … H0) -H0 #X0 #HV0 #HT0 #_ #_ -X0 @@ -295,14 +295,14 @@ elim (cnv_cpm_conf_lpr_sub … IH … HT01 … HT02 … HL01 … HL02) [|*: /2 w /3 width=5 by cpms_cast, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_cast_epsilon_aux (a) (h) (o) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓝV.T ![a,h] → +fact cnv_cpm_conf_lpr_cast_epsilon_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓝV.T ![h,a] → ∀n1,V1. ⦃G,L⦄ ⊢ V ➡[n1,h] V1 → ∀T1. ⦃G,L⦄ ⊢ T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L⦄ ⊢ T ➡[n2,h] T2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓝV1.T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ T2 ➡*[n1-n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 +#h #a #G0 #L0 #V0 #T0 #IH #H0 #n1 #V1 #HV01 #T1 #HT01 #n2 #T2 #HT02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_cast … H0) -H0 #X0 #HV0 #HT0 #_ #_ -X0 @@ -311,15 +311,15 @@ elim (cnv_cpm_conf_lpr_sub … IH … HT01 … HT02 … HL01 … HL02) [|*: /2 w /3 width=3 by cpms_eps, ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_cast_ee_aux (a) (h) (o) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr a h G0 L0 T0) → - (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓝV.T ![a,h] → +fact cnv_cpm_conf_lpr_cast_ee_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr h a G0 L0 T0) → + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓝV.T ![h,a] → ∀n1,V1. ⦃G,L⦄ ⊢ V ➡[n1,h] V1 → ∀n2,V2. ⦃G,L⦄ ⊢ V ➡[n2,h] V2 → ∀T1. ⦃G,L⦄ ⊢ T ➡[n1,h] T1 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ ⓝV1.T1 ➡*[↑n2-n1,h] T & ⦃G,L2⦄ ⊢ V2 ➡*[n1-↑n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH2 #IH1 #H0 +#h #a #G0 #L0 #V0 #T0 #IH2 #IH1 #H0 #n1 #V1 #HV01 #n2 #V2 #HV02 #T1 #HT01 #L1 #HL01 #L2 #HL02 -HV01 elim (cnv_inv_cast … H0) -H0 #X0 #HV0 #HT0 #HVX0 #HTX0 @@ -334,13 +334,13 @@ lapply (cpms_trans … HT1 … HTU) -T [h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓝV.T ![a,h] → +fact cnv_cpm_conf_lpr_epsilon_epsilon_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓝV.T ![h,a] → ∀n1,T1. ⦃G,L⦄ ⊢ T ➡[n1,h] T1 → ∀n2,T2. ⦃G,L⦄ ⊢ T ➡[n2,h] T2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ T2 ➡*[n1-n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 +#h #a #G0 #L0 #V0 #T0 #IH #H0 #n1 #T1 #HT01 #n2 #T2 #HT02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_cast … H0) -H0 #X0 #_ #HT0 #_ #_ -X0 @@ -349,14 +349,14 @@ elim (cnv_cpm_conf_lpr_sub … IH … HT01 … HT02 … HL01 … HL02) [|*: /2 w /2 width=3 by ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_epsilon_ee_aux (a) (h) (o) (G) (L) (V) (T): - (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr a h G0 L0 T0) → - (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓝV.T ![a,h] → +fact cnv_cpm_conf_lpr_epsilon_ee_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr h a G0 L0 T0) → + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓝV.T ![h,a] → ∀n1,T1. ⦃G,L⦄ ⊢ T ➡[n1,h] T1 → ∀n2,V2. ⦃G,L⦄ ⊢ V ➡[n2,h] V2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[↑n2-n1,h] T & ⦃G,L2⦄ ⊢ V2 ➡*[n1-↑n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH2 #IH1 #H0 +#h #a #G0 #L0 #V0 #T0 #IH2 #IH1 #H0 #n1 #T1 #HT01 #n2 #V2 #HV02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_cast … H0) -H0 #X0 #HV0 #HT0 #HVX0 #HTX0 @@ -371,13 +371,13 @@ lapply (cpms_trans … HT1 … HTU) -T [h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - ⦃G,L⦄ ⊢ ⓝV.T ![a,h] → +fact cnv_cpm_conf_lpr_ee_ee_aux (h) (a) (G) (L) (V) (T): + (∀G0,L0,T0. ⦃G,L,ⓝV.T⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + ⦃G,L⦄ ⊢ ⓝV.T ![h,a] → ∀n1,V1. ⦃G,L⦄ ⊢ V ➡[n1,h] V1 → ∀n2,V2. ⦃G,L⦄ ⊢ V ➡[n2,h] V2 → ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G,L1⦄ ⊢ V1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ V2 ➡*[n1-n2,h] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 +#h #a #G0 #L0 #V0 #T0 #IH #H0 #n1 #V1 #HV01 #n2 #V2 #HV02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_cast … H0) -H0 #X0 #HV0 #_ #_ #_ -X0 @@ -386,19 +386,19 @@ elim (cnv_cpm_conf_lpr_sub … IH … HV01 … HV02 … HL01 … HL02) [|*: /2 w /2 width=3 by ex2_intro/ qed-. -fact cnv_cpm_conf_lpr_aux (a) (h) (o): - ∀G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_trans_lpr a h G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) → - ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_cnv_cpm_conf_lpr a h G1 L1 T1. -#a #h #o #G0 #L0 #T0 #IH2 #IH1 #G #L * [| * [| * ]] +fact cnv_cpm_conf_lpr_aux (h) (a): + ∀G0,L0,T0. + (∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpm_trans_lpr h a G1 L1 T1) → + (∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpms_conf_lpr h a G1 L1 T1) → + ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_cnv_cpm_conf_lpr h a G1 L1 T1. +#h #a #G0 #L0 #T0 #IH2 #IH1 #G #L * [| * [| * ]] [ #I #HG0 #HL0 #HT0 #HT #n1 #X1 #HX1 #n2 #X2 #HX2 #L1 #HL1 #L2 #HL2 destruct elim (cpm_inv_atom1_drops … HX1) -HX1 * elim (cpm_inv_atom1_drops … HX2) -HX2 * - [ #H21 #H22 #H11 #H12 destruct -a -o -L + [ #H21 #H22 #H11 #H12 destruct -a -L minus_S_S >minus_S_S diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq.ma index 4919e3eae..4ea9ff53f 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq.ma @@ -15,7 +15,6 @@ include "ground_2/xoa/ex_5_1.ma". include "ground_2/xoa/ex_9_3.ma". include "basic_2/rt_transition/cpm_tdeq.ma". -include "basic_2/rt_transition/cpr.ma". include "basic_2/rt_computation/fpbg_fqup.ma". include "basic_2/dynamic/cnv_fsb.ma". @@ -23,10 +22,9 @@ include "basic_2/dynamic/cnv_fsb.ma". (* Inversion lemmas with restricted rt-transition for terms *****************) -lemma cnv_cpr_tdeq_fwd_refl (a) (h) (o) (G) (L): - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 → T1 ≛[h,o] T2 → - ⦃G, L⦄ ⊢ T1 ![a,h] → T1 = T2. -#a #h #o #G #L #T1 #T2 #H @(cpr_ind … H) -G -L -T1 -T2 +lemma cnv_cpr_tdeq_fwd_refl (h) (a) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → T1 ≛ T2 → ⦃G,L⦄ ⊢ T1 ![h,a] → T1 = T2. +#h #a #G #L #T1 #T2 #H @(cpr_ind … H) -G -L -T1 -T2 [ // | #G #K #V1 #V2 #X2 #_ #_ #_ #H1 #_ -a -G -K -V1 -V2 lapply (tdeq_inv_lref1 … H1) -H1 #H destruct // @@ -41,11 +39,11 @@ lemma cnv_cpr_tdeq_fwd_refl (a) (h) (o) (G) (L): elim (cnv_fwd_flat … H2) -H2 #HV1 #HT1 /3 width=3 by eq_f2/ | #G #K #V #T1 #X1 #X2 #HXT1 #HX12 #_ #H1 #H2 - elim (cnv_fpbg_refl_false … o … H2) -a + elim (cnv_fpbg_refl_false … H2) -a @(fpbg_tdeq_div … H1) -H1 /3 width=9 by cpm_tdneq_cpm_fpbg, cpm_zeta, tdeq_lifts_inv_pair_sn/ | #G #L #U #T1 #T2 #HT12 #_ #H1 #H2 - elim (cnv_fpbg_refl_false … o … H2) -a + elim (cnv_fpbg_refl_false … H2) -a @(fpbg_tdeq_div … H1) -H1 /3 width=6 by cpm_tdneq_cpm_fpbg, cpm_eps, tdeq_inv_pair_xy_y/ | #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H1 #_ @@ -55,11 +53,11 @@ lemma cnv_cpr_tdeq_fwd_refl (a) (h) (o) (G) (L): ] qed-. -lemma cpm_tdeq_inv_bind_sn (a) (h) (o) (n) (p) (I) (G) (L): - ∀V,T1. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T1 ![a,h] → - ∀X. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T1 ➡[n,h] X → ⓑ{p,I}V.T1 ≛[h,o] X → - ∃∃T2. ⦃G,L⦄ ⊢ V ![a,h] & ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ![a,h] & ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛[h,o] T2 & X = ⓑ{p,I}V.T2. -#a #h #o #n #p #I #G #L #V #T1 #H0 #X #H1 #H2 +lemma cpm_tdeq_inv_bind_sn (h) (a) (n) (p) (I) (G) (L): + ∀V,T1. ⦃G,L⦄ ⊢ ⓑ{p,I}V.T1 ![h,a] → + ∀X. ⦃G,L⦄ ⊢ ⓑ{p,I}V.T1 ➡[n,h] X → ⓑ{p,I}V.T1 ≛ X → + ∃∃T2. ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ![h,a] & ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛ T2 & X = ⓑ{p,I}V.T2. +#h #a #n #p #I #G #L #V #T1 #H0 #X #H1 #H2 elim (cpm_inv_bind1 … H1) -H1 * [ #XV #T2 #HXV #HT12 #H destruct elim (tdeq_inv_pair … H2) -H2 #_ #H2XV #H2T12 @@ -67,18 +65,18 @@ elim (cpm_inv_bind1 … H1) -H1 * lapply (cnv_cpr_tdeq_fwd_refl … HXV H2XV HV) #H destruct -HXV -H2XV /2 width=4 by ex5_intro/ | #X1 #HXT1 #HX1 #H1 #H destruct - elim (cnv_fpbg_refl_false … o … H0) -a + elim (cnv_fpbg_refl_false … H0) -a @(fpbg_tdeq_div … H2) -H2 /3 width=9 by cpm_tdneq_cpm_fpbg, cpm_zeta, tdeq_lifts_inv_pair_sn/ ] qed-. -lemma cpm_tdeq_inv_appl_sn (a) (h) (o) (n) (G) (L): - ∀V,T1. ⦃G,L⦄ ⊢ ⓐV.T1 ![a,h] → - ∀X. ⦃G,L⦄ ⊢ ⓐV.T1 ➡[n,h] X → ⓐV.T1 ≛[h,o] X → - ∃∃m,q,W,U1,T2. a = Ⓣ → m ≤ 1 & ⦃G,L⦄ ⊢ V ![a,h] & ⦃G, L⦄ ⊢ V ➡*[1,h] W & ⦃G, L⦄ ⊢ T1 ➡*[m,h] ⓛ{q}W.U1 - & ⦃G,L⦄⊢ T1 ![a,h] & ⦃G, L⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛[h,o] T2 & X = ⓐV.T2. -#a #h #o #n #G #L #V #T1 #H0 #X #H1 #H2 +lemma cpm_tdeq_inv_appl_sn (h) (a) (n) (G) (L): + ∀V,T1. ⦃G,L⦄ ⊢ ⓐV.T1 ![h,a] → + ∀X. ⦃G,L⦄ ⊢ ⓐV.T1 ➡[n,h] X → ⓐV.T1 ≛ X → + ∃∃m,q,W,U1,T2. ad a m & ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L⦄ ⊢ V ➡*[1,h] W & ⦃G,L⦄ ⊢ T1 ➡*[m,h] ⓛ{q}W.U1 + & ⦃G,L⦄⊢ T1 ![h,a] & ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛ T2 & X = ⓐV.T2. +#h #a #n #G #L #V #T1 #H0 #X #H1 #H2 elim (cpm_inv_appl1 … H1) -H1 * [ #XV #T2 #HXV #HT12 #H destruct elim (tdeq_inv_pair … H2) -H2 #_ #H2XV #H2T12 @@ -92,34 +90,34 @@ elim (cpm_inv_appl1 … H1) -H1 * ] qed-. -lemma cpm_tdeq_inv_cast_sn (a) (h) (o) (n) (G) (L): - ∀U1,T1. ⦃G, L⦄ ⊢ ⓝU1.T1 ![a,h] → - ∀X. ⦃G, L⦄ ⊢ ⓝU1.T1 ➡[n,h] X → ⓝU1.T1 ≛[h,o] X → - ∃∃U0,U2,T2. ⦃G,L⦄ ⊢ U1 ➡*[h] U0 & ⦃G,L⦄ ⊢ T1 ➡*[1,h] U0 - & ⦃G, L⦄ ⊢ U1 ![a,h] & ⦃G, L⦄ ⊢ U1 ➡[n,h] U2 & U1 ≛[h,o] U2 - & ⦃G, L⦄ ⊢ T1 ![a,h] & ⦃G, L⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛[h,o] T2 & X = ⓝU2.T2. -#a #h #o #n #G #L #U1 #T1 #H0 #X #H1 #H2 +lemma cpm_tdeq_inv_cast_sn (h) (a) (n) (G) (L): + ∀U1,T1. ⦃G,L⦄ ⊢ ⓝU1.T1 ![h,a] → + ∀X. ⦃G,L⦄ ⊢ ⓝU1.T1 ➡[n,h] X → ⓝU1.T1 ≛ X → + ∃∃U0,U2,T2. ⦃G,L⦄ ⊢ U1 ➡*[h] U0 & ⦃G,L⦄ ⊢ T1 ➡*[1,h] U0 + & ⦃G,L⦄ ⊢ U1 ![h,a] & ⦃G,L⦄ ⊢ U1 ➡[n,h] U2 & U1 ≛ U2 + & ⦃G,L⦄ ⊢ T1 ![h,a] & ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛ T2 & X = ⓝU2.T2. +#h #a #n #G #L #U1 #T1 #H0 #X #H1 #H2 elim (cpm_inv_cast1 … H1) -H1 [ * || * ] [ #U2 #T2 #HU12 #HT12 #H destruct elim (tdeq_inv_pair … H2) -H2 #_ #H2U12 #H2T12 elim (cnv_inv_cast … H0) -H0 #U0 #HU1 #HT1 #HU10 #HT1U0 /2 width=7 by ex9_3_intro/ | #HT1X - elim (cnv_fpbg_refl_false … o … H0) -a + elim (cnv_fpbg_refl_false … H0) -a @(fpbg_tdeq_div … H2) -H2 /3 width=6 by cpm_tdneq_cpm_fpbg, cpm_eps, tdeq_inv_pair_xy_y/ | #m #HU1X #H destruct - elim (cnv_fpbg_refl_false … o … H0) -a + elim (cnv_fpbg_refl_false … H0) -a @(fpbg_tdeq_div … H2) -H2 /3 width=6 by cpm_tdneq_cpm_fpbg, cpm_ee, tdeq_inv_pair_xy_x/ ] qed-. -lemma cpm_tdeq_inv_bind_dx (a) (h) (o) (n) (p) (I) (G) (L): - ∀X. ⦃G, L⦄ ⊢ X ![a,h] → - ∀V,T2. ⦃G, L⦄ ⊢ X ➡[n,h] ⓑ{p,I}V.T2 → X ≛[h,o] ⓑ{p,I}V.T2 → - ∃∃T1. ⦃G,L⦄ ⊢ V ![a,h] & ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ![a,h] & ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛[h,o] T2 & X = ⓑ{p,I}V.T1. -#a #h #o #n #p #I #G #L #X #H0 #V #T2 #H1 #H2 +lemma cpm_tdeq_inv_bind_dx (h) (a) (n) (p) (I) (G) (L): + ∀X. ⦃G,L⦄ ⊢ X ![h,a] → + ∀V,T2. ⦃G,L⦄ ⊢ X ➡[n,h] ⓑ{p,I}V.T2 → X ≛ ⓑ{p,I}V.T2 → + ∃∃T1. ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ![h,a] & ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛ T2 & X = ⓑ{p,I}V.T1. +#h #a #n #p #I #G #L #X #H0 #V #T2 #H1 #H2 elim (tdeq_inv_pair2 … H2) #V0 #T1 #_ #_ #H destruct elim (cpm_tdeq_inv_bind_sn … H0 … H1 H2) -H0 -H1 -H2 #T0 #HV #HT1 #H1T12 #H2T12 #H destruct /2 width=5 by ex5_intro/ @@ -127,34 +125,34 @@ qed-. (* Eliminators with restricted rt-transition for terms **********************) -lemma cpm_tdeq_ind (a) (h) (o) (n) (G) (Q:relation3 …): - (∀I,L. n = 0 → Q L (⓪{I}) (⓪{I})) → - (∀L,s. n = 1 → deg h o s 0 → Q L (⋆s) (⋆(next h s))) → - (∀p,I,L,V,T1. ⦃G,L⦄⊢ V![a,h] → ⦃G,L.ⓑ{I}V⦄⊢T1![a,h] → - ∀T2. ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛[h,o] T2 → - Q (L.ⓑ{I}V) T1 T2 → Q L (ⓑ{p,I}V.T1) (ⓑ{p,I}V.T2) - ) → - (∀m. (a = Ⓣ → m ≤ 1) → - ∀L,V. ⦃G,L⦄ ⊢ V ![a,h] → ∀W. ⦃G, L⦄ ⊢ V ➡*[1,h] W → - ∀p,T1,U1. ⦃G, L⦄ ⊢ T1 ➡*[m,h] ⓛ{p}W.U1 → ⦃G,L⦄⊢ T1 ![a,h] → - ∀T2. ⦃G, L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛[h,o] T2 → - Q L T1 T2 → Q L (ⓐV.T1) (ⓐV.T2) - ) → - (∀L,U0,U1,T1. ⦃G,L⦄ ⊢ U1 ➡*[h] U0 → ⦃G,L⦄ ⊢ T1 ➡*[1,h] U0 → - ∀U2. ⦃G, L⦄ ⊢ U1 ![a,h] → ⦃G, L⦄ ⊢ U1 ➡[n,h] U2 → U1 ≛[h,o] U2 → - ∀T2. ⦃G, L⦄ ⊢ T1 ![a,h] → ⦃G, L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛[h,o] T2 → - Q L U1 U2 → Q L T1 T2 → Q L (ⓝU1.T1) (ⓝU2.T2) - ) → - ∀L,T1. ⦃G,L⦄ ⊢ T1 ![a,h] → - ∀T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛[h,o] T2 → Q L T1 T2. -#a #h #o #n #G #Q #IH1 #IH2 #IH3 #IH4 #IH5 #L #T1 +lemma cpm_tdeq_ind (h) (a) (n) (G) (Q:relation3 …): + (∀I,L. n = 0 → Q L (⓪{I}) (⓪{I})) → + (∀L,s. n = 1 → Q L (⋆s) (⋆(⫯[h]s))) → + (∀p,I,L,V,T1. ⦃G,L⦄⊢ V![h,a] → ⦃G,L.ⓑ{I}V⦄⊢T1![h,a] → + ∀T2. ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛ T2 → + Q (L.ⓑ{I}V) T1 T2 → Q L (ⓑ{p,I}V.T1) (ⓑ{p,I}V.T2) + ) → + (∀m. ad a m → + ∀L,V. ⦃G,L⦄ ⊢ V ![h,a] → ∀W. ⦃G,L⦄ ⊢ V ➡*[1,h] W → + ∀p,T1,U1. ⦃G,L⦄ ⊢ T1 ➡*[m,h] ⓛ{p}W.U1 → ⦃G,L⦄⊢ T1 ![h,a] → + ∀T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛ T2 → + Q L T1 T2 → Q L (ⓐV.T1) (ⓐV.T2) + ) → + (∀L,U0,U1,T1. ⦃G,L⦄ ⊢ U1 ➡*[h] U0 → ⦃G,L⦄ ⊢ T1 ➡*[1,h] U0 → + ∀U2. ⦃G,L⦄ ⊢ U1 ![h,a] → ⦃G,L⦄ ⊢ U1 ➡[n,h] U2 → U1 ≛ U2 → + ∀T2. ⦃G,L⦄ ⊢ T1 ![h,a] → ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛ T2 → + Q L U1 U2 → Q L T1 T2 → Q L (ⓝU1.T1) (ⓝU2.T2) + ) → + ∀L,T1. ⦃G,L⦄ ⊢ T1 ![h,a] → + ∀T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛ T2 → Q L T1 T2. +#h #a #n #G #Q #IH1 #IH2 #IH3 #IH4 #IH5 #L #T1 @(insert_eq_0 … G) #F @(fqup_wf_ind_eq (Ⓣ) … F L T1) -L -T1 -F #G0 #L0 #T0 #IH #F #L * [| * [| * ]] [ #I #_ #_ #_ #_ #HF #X #H1X #H2X destruct -G0 -L0 -T0 elim (cpm_tdeq_inv_atom_sn … H1X H2X) -H1X -H2X * [ #H1 #H2 destruct /2 width=1 by/ - | #s #H1 #H2 #H3 #Hs destruct /2 width=1 by/ + | #s #H1 #H2 #H3 destruct /2 width=1 by/ ] | #p #I #V #T1 #HG #HL #HT #H0 #HF #X #H1X #H2X destruct elim (cpm_tdeq_inv_bind_sn … H0 … H1X H2X) -H0 -H1X -H2X #T2 #HV #HT1 #H1T12 #H2T12 #H destruct @@ -170,14 +168,14 @@ qed-. (* Advanced properties with restricted rt-transition for terms **************) -lemma cpm_tdeq_free (a) (h) (o) (n) (G) (L): - ∀T1. ⦃G, L⦄ ⊢ T1 ![a,h] → - ∀T2. ⦃G, L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛[h,o] T2 → - ∀F,K. ⦃F, K⦄ ⊢ T1 ➡[n,h] T2. -#a #h #o #n #G #L #T1 #H0 #T2 #H1 #H2 +lemma cpm_tdeq_free (h) (a) (n) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → + ∀T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛ T2 → + ∀F,K. ⦃F,K⦄ ⊢ T1 ➡[n,h] T2. +#h #a #n #G #L #T1 #H0 #T2 #H1 #H2 @(cpm_tdeq_ind … H0 … H1 H2) -L -T1 -T2 [ #I #L #H #F #K destruct // -| #L #s #H #_ #F #K destruct // +| #L #s #H #F #K destruct // | #p #I #L #V #T1 #_ #_ #T2 #_ #_ #IH #F #K /2 width=1 by cpm_bind/ | #m #_ #L #V #_ #W #_ #q #T1 #U1 #_ #_ #T2 #_ #_ #IH #F #K @@ -189,11 +187,11 @@ qed-. (* Advanced inversion lemmas with restricted rt-transition for terms ********) -lemma cpm_tdeq_inv_bind_sn_void (a) (h) (o) (n) (p) (I) (G) (L): - ∀V,T1. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T1 ![a,h] → - ∀X. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T1 ➡[n,h] X → ⓑ{p,I}V.T1 ≛[h,o] X → - ∃∃T2. ⦃G,L⦄ ⊢ V ![a,h] & ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ![a,h] & ⦃G, L.ⓧ⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛[h,o] T2 & X = ⓑ{p,I}V.T2. -#a #h #o #n #p #I #G #L #V #T1 #H0 #X #H1 #H2 +lemma cpm_tdeq_inv_bind_sn_void (h) (a) (n) (p) (I) (G) (L): + ∀V,T1. ⦃G,L⦄ ⊢ ⓑ{p,I}V.T1 ![h,a] → + ∀X. ⦃G,L⦄ ⊢ ⓑ{p,I}V.T1 ➡[n,h] X → ⓑ{p,I}V.T1 ≛ X → + ∃∃T2. ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ![h,a] & ⦃G,L.ⓧ⦄ ⊢ T1 ➡[n,h] T2 & T1 ≛ T2 & X = ⓑ{p,I}V.T2. +#h #a #n #p #I #G #L #V #T1 #H0 #X #H1 #H2 elim (cpm_tdeq_inv_bind_sn … H0 … H1 H2) -H0 -H1 -H2 #T2 #HV #HT1 #H1T12 #H2T12 #H /3 width=5 by ex5_intro, cpm_tdeq_free/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq_conf.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq_conf.ma index f45bf4d42..54cd32a9e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq_conf.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdeq_conf.ma @@ -17,36 +17,35 @@ include "basic_2/dynamic/cnv_cpm_tdeq.ma". (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) -definition IH_cnv_cpm_tdeq_conf_lpr (a) (h) (o): relation3 genv lenv term ≝ - λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] → - ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛[h,o] T1 → - ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛[h,o] T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡[n2-n1,h] T & T1 ≛[h,o] T & ⦃G, L2⦄ ⊢ T2 ➡[n1-n2,h] T & T2 ≛[h,o] T. +definition IH_cnv_cpm_tdeq_conf_lpr (h) (a): relation3 genv lenv term ≝ + λG,L0,T0. ⦃G,L0⦄ ⊢ T0 ![h,a] → + ∀n1,T1. ⦃G,L0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛ T1 → + ∀n2,T2. ⦃G,L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛ T2 → + ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L0⦄ ⊢ ➡[h] L2 → + ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡[n2-n1,h] T & T1 ≛ T & ⦃G,L2⦄ ⊢ T2 ➡[n1-n2,h] T & T2 ≛ T. (* Diamond propery with restricted rt-transition for terms ******************) -fact cnv_cpm_tdeq_conf_lpr_atom_atom_aux (h) (o) (G0) (L1) (L2) (I): - ∃∃T. ⦃G0,L1⦄ ⊢ ⓪{I} ➡[h] T & ⓪{I} ≛[h,o] T & ⦃G0, L2⦄ ⊢ ⓪{I} ➡[h] T & ⓪{I} ≛[h,o] T. -#h #o #G0 #L1 #L2 #I +fact cnv_cpm_tdeq_conf_lpr_atom_atom_aux (h) (G0) (L1) (L2) (I): + ∃∃T. ⦃G0,L1⦄ ⊢ ⓪{I} ➡[h] T & ⓪{I} ≛ T & ⦃G0,L2⦄ ⊢ ⓪{I} ➡[h] T & ⓪{I} ≛ T. +#h #G0 #L1 #L2 #I /2 width=5 by ex4_intro/ qed-. -fact cnv_cpm_tdeq_conf_lpr_atom_ess_aux (h) (o) (G0) (L1) (L2) (s): - deg h o s 0 → - ∃∃T. ⦃G0,L1⦄ ⊢ ⋆s ➡[1,h] T & ⋆s ≛[h,o] T & ⦃G0,L2⦄ ⊢ ⋆(next h s) ➡[h] T & ⋆(next h s) ≛[h,o] T. -#h #o #G0 #L1 #L2 #s #Hs -/4 width=5 by tdeq_sort, deg_next, ex4_intro/ +fact cnv_cpm_tdeq_conf_lpr_atom_ess_aux (h) (G0) (L1) (L2) (s): + ∃∃T. ⦃G0,L1⦄ ⊢ ⋆s ➡[1,h] T & ⋆s ≛ T & ⦃G0,L2⦄ ⊢ ⋆(⫯[h]s) ➡[h] T & ⋆(⫯[h]s) ≛ T. +#h #G0 #L1 #L2 #s +/3 width=5 by tdeq_sort, ex4_intro/ qed-. -fact cnv_cpm_tdeq_conf_lpr_bind_bind_aux (a) (h) (o) (p) (I) (G0) (L0) (V0) (T0): - (∀G,L,T. ⦃G0,L0,ⓑ{p,I}V0.T0⦄ ⊐+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr a h o G L T) → - ⦃G0,L0⦄ ⊢ ⓑ{p,I}V0.T0 ![a,h] → - ∀n1,T1. ⦃G0,L0.ⓑ{I}V0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛[h,o] T1 → - ∀n2,T2. ⦃G0,L0.ⓑ{I}V0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛[h,o] T2 → +fact cnv_cpm_tdeq_conf_lpr_bind_bind_aux (h) (a) (p) (I) (G0) (L0) (V0) (T0): + (∀G,L,T. ⦃G0,L0,ⓑ{p,I}V0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ ⓑ{p,I}V0.T0 ![h,a] → + ∀n1,T1. ⦃G0,L0.ⓑ{I}V0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛ T1 → + ∀n2,T2. ⦃G0,L0.ⓑ{I}V0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛ T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → - ∃∃T. ⦃G0,L1⦄ ⊢ ⓑ{p,I}V0.T1 ➡[n2-n1,h] T & ⓑ{p,I}V0.T1 ≛[h,o] T & ⦃G0,L2⦄ ⊢ ⓑ{p,I}V0.T2 ➡[n1-n2,h] T & ⓑ{p,I}V0.T2 ≛[h,o] T. -#a #h #o #p #I #G0 #L0 #V0 #T0 #IH #H0 + ∃∃T. ⦃G0,L1⦄ ⊢ ⓑ{p,I}V0.T1 ➡[n2-n1,h] T & ⓑ{p,I}V0.T1 ≛ T & ⦃G0,L2⦄ ⊢ ⓑ{p,I}V0.T2 ➡[n1-n2,h] T & ⓑ{p,I}V0.T2 ≛ T. +#h #a #p #I #G0 #L0 #V0 #T0 #IH #H0 #n1 #T1 #H1T01 #H2T01 #n2 #T2 #H1T02 #H2T02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_bind … H0) -H0 #_ #HT0 @@ -55,14 +54,14 @@ elim (IH … H1T01 H2T01 … H1T02 H2T02 (L1.ⓑ{I}V0) … (L2.ⓑ{I}V0)) [|*: / /3 width=7 by cpm_bind, tdeq_pair, ex4_intro/ qed-. -fact cnv_cpm_tdeq_conf_lpr_appl_appl_aux (a) (h) (o) (G0) (L0) (V0) (T0): - (∀G,L,T. ⦃G0,L0,ⓐV0.T0⦄ ⊐+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr a h o G L T) → - ⦃G0,L0⦄ ⊢ ⓐV0.T0 ![a,h] → - ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛[h,o] T1 → - ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛[h,o] T2 → +fact cnv_cpm_tdeq_conf_lpr_appl_appl_aux (h) (a) (G0) (L0) (V0) (T0): + (∀G,L,T. ⦃G0,L0,ⓐV0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ ⓐV0.T0 ![h,a] → + ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛ T1 → + ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛ T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → - ∃∃T. ⦃G0,L1⦄ ⊢ ⓐV0.T1 ➡[n2-n1,h] T & ⓐV0.T1 ≛[h,o] T & ⦃G0,L2⦄ ⊢ ⓐV0.T2 ➡[n1-n2,h] T & ⓐV0.T2 ≛[h,o] T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 + ∃∃T. ⦃G0,L1⦄ ⊢ ⓐV0.T1 ➡[n2-n1,h] T & ⓐV0.T1 ≛ T & ⦃G0,L2⦄ ⊢ ⓐV0.T2 ➡[n1-n2,h] T & ⓐV0.T2 ≛ T. +#h #a #G0 #L0 #V0 #T0 #IH #H0 #n1 #T1 #H1T01 #H2T01 #n2 #T2 #H1T02 #H2T02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_appl … H0) -H0 #n0 #p0 #X01 #X02 #_ #_ #HT0 #_ #_ -n0 -p0 -X01 -X02 @@ -71,16 +70,16 @@ elim (IH … H1T01 H2T01 … H1T02 H2T02 … HL01 … HL02) [|*: /2 width=1 by f /3 width=7 by cpm_appl, tdeq_pair, ex4_intro/ qed-. -fact cnv_cpm_tdeq_conf_lpr_cast_cast_aux (a) (h) (o) (G0) (L0) (V0) (T0): - (∀G,L,T. ⦃G0,L0,ⓝV0.T0⦄ ⊐+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr a h o G L T) → - ⦃G0,L0⦄ ⊢ ⓝV0.T0 ![a,h] → - ∀n1,V1. ⦃G0,L0⦄ ⊢ V0 ➡[n1,h] V1 → V0 ≛[h,o] V1 → - ∀n2,V2. ⦃G0,L0⦄ ⊢ V0 ➡[n2,h] V2 → V0 ≛[h,o] V2 → - ∀T1. ⦃G0,L0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛[h,o] T1 → - ∀T2. ⦃G0,L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛[h,o] T2 → +fact cnv_cpm_tdeq_conf_lpr_cast_cast_aux (h) (a) (G0) (L0) (V0) (T0): + (∀G,L,T. ⦃G0,L0,ⓝV0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ ⓝV0.T0 ![h,a] → + ∀n1,V1. ⦃G0,L0⦄ ⊢ V0 ➡[n1,h] V1 → V0 ≛ V1 → + ∀n2,V2. ⦃G0,L0⦄ ⊢ V0 ➡[n2,h] V2 → V0 ≛ V2 → + ∀T1. ⦃G0,L0⦄ ⊢ T0 ➡[n1,h] T1 → T0 ≛ T1 → + ∀T2. ⦃G0,L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛ T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → - ∃∃T. ⦃G0,L1⦄ ⊢ ⓝV1.T1 ➡[n2-n1,h] T & ⓝV1.T1≛[h,o]T & ⦃G0,L2⦄ ⊢ ⓝV2.T2 ➡[n1-n2,h] T & ⓝV2.T2≛[h,o]T. -#a #h #o #G0 #L0 #V0 #T0 #IH #H0 + ∃∃T. ⦃G0,L1⦄ ⊢ ⓝV1.T1 ➡[n2-n1,h] T & ⓝV1.T1 ≛ T & ⦃G0,L2⦄ ⊢ ⓝV2.T2 ➡[n1-n2,h] T & ⓝV2.T2 ≛ T. +#h #a #G0 #L0 #V0 #T0 #IH #H0 #n1 #V1 #H1V01 #H2V01 #n2 #V2 #H1V02 #H2V02 #T1 #H1T01 #H2T01 #T2 #H1T02 #H2T02 #L1 #HL01 #L2 #HL02 elim (cnv_inv_cast … H0) -H0 #X0 #HV0 #HT0 #_ #_ -X0 @@ -90,23 +89,23 @@ elim (IH … H1T01 H2T01 … H1T02 H2T02 … HL01 … HL02) [|*: /2 width=1 by f /3 width=7 by cpm_cast, tdeq_pair, ex4_intro/ qed-. -fact cnv_cpm_tdeq_conf_lpr_aux (a) (h) (o) (G0) (L0) (T0): - (∀G,L,T. ⦃G0,L0,T0⦄ ⊐+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr a h o G L T) → - ∀G,L,T. G0 = G → L0 = L → T0 = T → IH_cnv_cpm_tdeq_conf_lpr a h o G L T. -#a #h #o #G0 #L0 #T0 #IH1 #G #L * [| * [| * ]] +fact cnv_cpm_tdeq_conf_lpr_aux (h) (a) (G0) (L0) (T0): + (∀G,L,T. ⦃G0,L0,T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_conf_lpr h a G L T) → + ∀G,L,T. G0 = G → L0 = L → T0 = T → IH_cnv_cpm_tdeq_conf_lpr h a G L T. +#h #a #G0 #L0 #T0 #IH1 #G #L * [| * [| * ]] [ #I #HG0 #HL0 #HT0 #HT #n1 #X1 #H1X1 #H2X1 #n2 #X2 #H1X2 #H2X2 #L1 #HL1 #L2 #HL2 destruct elim (cpm_tdeq_inv_atom_sn … H1X1 H2X1) -H1X1 -H2X1 * elim (cpm_tdeq_inv_atom_sn … H1X2 H2X2) -H1X2 -H2X2 * [ #H21 #H22 #H11 #H12 destruct -a -L [h,o] ⦃G, L, T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ ⊐+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_cpm_trans a h o G L T) → - ∀G,L,T1. G0 = G → L0 = L → T0 = T1 → IH_cnv_cpm_tdeq_cpm_trans a h o G L T1. -#a #h #o #G0 #L0 #T0 #IH2 #IH1 #G #L * [| * [| * ]] +fact cnv_cpm_tdeq_cpm_trans_sub (h) (a) (G0) (L0) (T0): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cnv_cpm_tdeq_cpm_trans h a G L T) → + ∀G,L,T1. G0 = G → L0 = L → T0 = T1 → IH_cnv_cpm_tdeq_cpm_trans h a G L T1. +#h #a #G0 #L0 #T0 #IH2 #IH1 #G #L * [| * [| * ]] [ #I #_ #_ #_ #_ #n1 #X1 #H1X #H2X #n2 #X2 #HX2 destruct -G0 -L0 -T0 elim (cpm_tdeq_inv_atom_sn … H1X H2X) -H1X -H2X * [ #H1 #H2 destruct /2 width=4 by ex3_intro/ - | #s #H1 #H2 #H3 #Hs destruct + | #s #H1 #H2 #H3 destruct elim (cpm_inv_sort1 … HX2) -HX2 #H #Hn2 destruct >iter_n_Sm - /5 width=6 by cpm_sort, tdeq_sort, deg_iter, deg_next, ex3_intro/ + /3 width=4 by cpm_sort, tdeq_sort, ex3_intro/ ] | #p #I #V1 #T1 #HG #HL #HT #H0 #n1 #X1 #H1X #H2X #n2 #X2 #HX2 destruct elim (cpm_tdeq_inv_bind_sn … H0 … H1X H2X) -H0 -H1X -H2X #T #_ #H0T1 #H1T1 #H2T1 #H destruct @@ -88,10 +88,10 @@ fact cnv_cpm_tdeq_cpm_trans_sub (a) (h) (o) (G0) (L0) (T0): ] qed-. -fact cnv_cpm_tdeq_cpm_trans_aux (a) (h) (o) (G0) (L0) (T0): - (∀G,L,T. ⦃G0, L0, T0⦄ >[h, o] ⦃G, L, T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - IH_cnv_cpm_tdeq_cpm_trans a h o G0 L0 T0. -#a #h #o #G0 #L0 #T0 +fact cnv_cpm_tdeq_cpm_trans_aux (h) (a) (G0) (L0) (T0): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + IH_cnv_cpm_tdeq_cpm_trans h a G0 L0 T0. +#h #a #G0 #L0 #T0 @(fqup_wf_ind (Ⓣ) … G0 L0 T0) -G0 -L0 -T0 #G0 #L0 #T0 #IH #IH0 /5 width=10 by cnv_cpm_tdeq_cpm_trans_sub, fqup_fpbg_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_trans.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_trans.ma index 6d58815d0..84ef77264 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_trans.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_trans.ma @@ -14,21 +14,21 @@ include "ground_2/lib/arith_2b.ma". include "basic_2/rt_computation/cprs_cprs.ma". -include "basic_2/rt_computation/lprs_cpms.ma". include "basic_2/dynamic/cnv_drops.ma". include "basic_2/dynamic/cnv_preserve_sub.ma". +include "basic_2/dynamic/cnv_aaa.ma". include "basic_2/dynamic/lsubv_cnv.ma". (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Sub preservation propery with t-bound rt-transition for terms ************) -fact cnv_cpm_trans_lpr_aux (a) (h) (o): - ∀G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_trans_lpr a h G1 L1 T1) → - ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_cnv_cpm_trans_lpr a h G1 L1 T1. -#a #h #o #G0 #L0 #T0 #IH2 #IH1 #G1 #L1 * * [|||| * ] +fact cnv_cpm_trans_lpr_aux (h) (a): + ∀G0,L0,T0. + (∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpms_conf_lpr h a G1 L1 T1) → + (∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpm_trans_lpr h a G1 L1 T1) → + ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_cnv_cpm_trans_lpr h a G1 L1 T1. +#h #a #G0 #L0 #T0 #IH2 #IH1 #G1 #L1 * * [|||| * ] [ #s #HG0 #HL0 #HT0 #H1 #x #X #H2 #L2 #_ destruct -IH2 -IH1 -H1 elim (cpm_inv_sort1 … H2) -H2 #H #_ destruct // | #i #HG0 #HL0 #HT0 #H1 #x #X #H2 #L2 #HL12 destruct -IH2 @@ -63,13 +63,14 @@ fact cnv_cpm_trans_lpr_aux (a) (h) (o): elim (cnv_cpms_strip_lpr_sub … IH2 … HVW1 … HV12 … HL12 … HL12) [|*: /2 width=2 by fqup_fpbg/ ] -HVW1 -HV12 [h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ⦃G0,L0⦄ ⊢ T0 ![a,h] → - ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → T0 ≛[h,o] T1 → - ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡*[n2,h] T2 → T0 ≛[h,o] T2 → +fact cnv_cpms_conf_lpr_tdeq_tdeq_aux (h) (a) (G0) (L0) (T0): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ T0 ![h,a] → + ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → T0 ≛ T1 → + ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡*[n2,h] T2 → T0 ≛ T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G0,L2⦄ ⊢ T2 ➡*[n1-n2,h] T. -#a #h #o #G #L0 #T0 #IH2 #IH1 #HT0 +#h #a #G #L0 #T0 #IH2 #IH1 #HT0 #n1 #T1 #H1T01 #H2T01 #n2 #T2 #H1T02 #H2T02 #L1 #HL01 #L2 #HL02 elim (cnv_cpms_tdeq_conf_lpr_aux … IH2 IH1 … H1T01 … H1T02 … HL01 … HL02) -IH2 -IH1 -H1T01 -H1T02 -HL01 -HL02 /2 width=3 by ex2_intro/ qed-. -fact cnv_cpms_conf_lpr_refl_tdneq_sub (a) (h) (o) (G0) (L0) (T0) (m21) (m22): - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ⦃G0,L0⦄ ⊢ T0 ![a,h] → - ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛[h,o] X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → +fact cnv_cpms_conf_lpr_refl_tdneq_sub (h) (a) (G0) (L0) (T0) (m21) (m22): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ T0 ![h,a] → + ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛ X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G0,L1⦄ ⊢ T0 ➡*[m21+m22,h] T& ⦃G0,L2⦄ ⊢ T2 ➡*[h] T. -#a #h #o #G0 #L0 #T0 #m21 #m22 #IH2 #IH1 #H0 +#h #a #G0 #L0 #T0 #m21 #m22 #IH2 #IH1 #H0 #X2 #HX02 #HnX02 #T2 #HXT2 #L1 #HL01 #L2 #HL02 lapply (cnv_cpm_trans_lpr_aux … IH1 IH2 … HX02 … L0 ?) // #HX2 @@ -50,39 +50,39 @@ elim (cnv_cpm_conf_lpr_aux … IH2 IH1 … HX02 … 0 T0 … L0 … HL01) // elim (cnv_cpms_strip_lpr_sub … IH1 … HXT2 0 X2 … HL02 L0) [|*: /4 width=2 by fpb_fpbg, cpm_fpb/ ] [h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ⦃G0,L0⦄ ⊢ T0 ![a,h] → - ∀X1. ⦃G0,L0⦄ ⊢ T0 ➡[m11,h] X1 → T0 ≛[h,o] X1 → ∀T1. ⦃G0,L0⦄ ⊢ X1 ➡*[m12,h] T1 → X1 ≛[h,o] T1 → - ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛[h,o] X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → +fact cnv_cpms_conf_lpr_step_tdneq_sub (h) (a) (G0) (L0) (T0) (m11) (m12) (m21) (m22): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ T0 ![h,a] → + ∀X1. ⦃G0,L0⦄ ⊢ T0 ➡[m11,h] X1 → T0 ≛ X1 → ∀T1. ⦃G0,L0⦄ ⊢ X1 ➡*[m12,h] T1 → X1 ≛ T1 → + ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛ X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → - ((∀G,L,T. ⦃G0,L0,X1⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,X1⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ∀m21,m22. - ∀X2. ⦃G0,L0⦄ ⊢ X1 ➡[m21,h] X2 → (X1 ≛[h,o] X2 → ⊥) → - ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → - ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → - ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[m21+m22-m12,h] T & ⦃G0,L2⦄ ⊢ T2 ➡*[m12-(m21+m22),h]T + ((∀G,L,T. ⦃G0,L0,X1⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,X1⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ∀m21,m22. + ∀X2. ⦃G0,L0⦄ ⊢ X1 ➡[m21,h] X2 → (X1 ≛ X2 → ⊥) → + ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → + ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → + ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[m21+m22-m12,h] T & ⦃G0,L2⦄ ⊢ T2 ➡*[m12-(m21+m22),h]T ) → ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[m21+m22-(m11+m12),h] T & ⦃G0,L2⦄ ⊢ T2 ➡*[m11+m12-(m21+m22),h] T. -#a #h #o #G0 #L0 #T0 #m11 #m12 #m21 #m22 #IH2 #IH1 #HT0 +#h #a #G0 #L0 #T0 #m11 #m12 #m21 #m22 #IH2 #IH1 #HT0 #X1 #H1X01 #H2X01 #T1 #H1XT1 #H2XT1 #X2 #H1X02 #H2X02 #T2 #HXT2 #L1 #HL01 #L2 #HL02 #IH lapply (cnv_cpm_trans_lpr_aux … IH1 IH2 … H1X01 … L0 ?) // #HX1 lapply (cnv_cpm_trans_lpr_aux … IH1 IH2 … H1X02 … L0 ?) // #HX2 elim (cnv_cpm_conf_lpr_aux … IH2 IH1 … H1X01 … H1X02 … L0 … L0) // #Z0 #HXZ10 #HXZ20 -cut (⦃G0,L0,T0⦄ >[h,o] ⦃G0,L0,X2⦄) [ /4 width=5 by cpms_fwd_fpbs, cpm_fpb, ex2_3_intro/ ] #H1fpbg (**) (* cut *) -lapply (fpbg_fpbs_trans ??? G0 ? L0 ? Z0 ? … H1fpbg) [ /2 width=2 by cpms_fwd_fpbs/ ] #H2fpbg +cut (⦃G0, L0, T0⦄ >[h] ⦃G0, L0, X2⦄) [ /4 width=5 by cpms_fwd_fpbs, cpm_fpb, ex2_3_intro/ ] #H1fpbg (**) (* cut *) +lapply (fpbg_fpbs_trans ?? G0 ? L0 ? Z0 ? … H1fpbg) [ /2 width=2 by cpms_fwd_fpbs/ ] #H2fpbg lapply (cnv_cpms_trans_lpr_sub … IH2 … HXZ20 … L0 ?) // #HZ0 elim (IH1 … HXT2 … HXZ20 … L2 … L0) [|*: /4 width=2 by fpb_fpbg, cpm_fpb/ ] -HXT2 -HXZ20 #Z2 #HTZ2 #HZ02 -elim (tdeq_dec h o X1 Z0) #H2XZ +elim (tdeq_dec X1 Z0) #H2XZ [ -IH elim (cnv_cpms_conf_lpr_tdeq_tdeq_aux … HX1 … H1XT1 H2XT1 … HXZ10 H2XZ … L1 … L0) [2,3: // |4,5: /4 width=5 by cpm_fpbq, fpbq_fpbg_trans/ ] | -H1XT1 -H2XT1 @@ -98,15 +98,15 @@ lapply (cpms_trans … HTZ2 … HZ02) -Z2 [h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ⦃G0,L0⦄ ⊢ T0 ![a,h] → - ∀T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → T0 ≛[h,o] T1 → - ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛[h,o] X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → +fact cnv_cpms_conf_lpr_tdeq_tdneq_aux (h) (a) (G0) (L0) (T0) (n1) (m21) (m22): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ T0 ![h,a] → + ∀T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → T0 ≛ T1 → + ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛ X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[m21+m22-n1,h] T & ⦃G0,L2⦄ ⊢ T2 ➡*[n1-(m21+m22),h] T. -#a #h #o #G0 #L0 #T0 #n1 #m21 #m22 #IH2 #IH1 #HT0 +#h #a #G0 #L0 #T0 #n1 #m21 #m22 #IH2 #IH1 #HT0 #T1 #H1T01 #H2T01 generalize in match m22; generalize in match m21; -m21 -m22 generalize in match IH1; generalize in match IH2; @@ -121,22 +121,22 @@ generalize in match IH1; generalize in match IH2; ] qed-. -fact cnv_cpms_conf_lpr_tdneq_tdneq_aux (a) (h) (o) (G0) (L0) (T0) (m11) (m12) (m21) (m22): - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ⦃G0,L0⦄ ⊢ T0 ![a,h] → - ∀X1. ⦃G0,L0⦄ ⊢ T0 ➡[m11,h] X1 → (T0 ≛[h,o] X1 → ⊥) → ∀T1. ⦃G0,L0⦄ ⊢ X1 ➡*[m12,h] T1 → - ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛[h,o] X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → +fact cnv_cpms_conf_lpr_tdneq_tdneq_aux (h) (a) (G0) (L0) (T0) (m11) (m12) (m21) (m22): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ⦃G0,L0⦄ ⊢ T0 ![h,a] → + ∀X1. ⦃G0,L0⦄ ⊢ T0 ➡[m11,h] X1 → (T0 ≛ X1 → ⊥) → ∀T1. ⦃G0,L0⦄ ⊢ X1 ➡*[m12,h] T1 → + ∀X2. ⦃G0,L0⦄ ⊢ T0 ➡[m21,h] X2 → (T0 ≛ X2 → ⊥) → ∀T2. ⦃G0,L0⦄ ⊢ X2 ➡*[m22,h] T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[m21+m22-(m11+m12),h] T & ⦃G0,L2⦄ ⊢ T2 ➡*[m11+m12-(m21+m22),h] T. -#a #h #o #G0 #L0 #T0 #m11 #m12 #m21 #m22 #IH2 #IH1 #H0 +#h #a #G0 #L0 #T0 #m11 #m12 #m21 #m22 #IH2 #IH1 #H0 #X1 #HX01 #HnX01 #T1 #HXT1 #X2 #HX02 #HnX02 #T2 #HXT2 #L1 #HL01 #L2 #HL02 lapply (cnv_cpm_trans_lpr_aux … IH1 IH2 … HX01 … L0 ?) // #HX1 lapply (cnv_cpm_trans_lpr_aux … IH1 IH2 … HX02 … L0 ?) // #HX2 elim (cnv_cpm_conf_lpr_aux … IH2 IH1 … HX01 … HX02 … L0 … L0) // #Z0 #HXZ10 #HXZ20 -cut (⦃G0,L0,T0⦄ >[h,o] ⦃G0,L0,X1⦄) [ /4 width=5 by cpms_fwd_fpbs, cpm_fpb, ex2_3_intro/ ] #H1fpbg (**) (* cut *) -lapply (fpbg_fpbs_trans ??? G0 ? L0 ? Z0 ? … H1fpbg) [ /2 width=2 by cpms_fwd_fpbs/ ] #H2fpbg +cut (⦃G0, L0, T0⦄ >[h] ⦃G0, L0, X1⦄) [ /4 width=5 by cpms_fwd_fpbs, cpm_fpb, ex2_3_intro/ ] #H1fpbg (**) (* cut *) +lapply (fpbg_fpbs_trans ?? G0 ? L0 ? Z0 ? … H1fpbg) [ /2 width=2 by cpms_fwd_fpbs/ ] #H2fpbg lapply (cnv_cpms_trans_lpr_sub … IH2 … HXZ10 … L0 ?) // #HZ0 elim (IH1 … HXT1 … HXZ10 … L1 … L0) [|*: /4 width=2 by fpb_fpbg, cpm_fpb/ ] -HXT1 -HXZ10 #Z1 #HTZ1 #HZ01 elim (IH1 … HXT2 … HXZ20 … L2 … L0) [|*: /4 width=2 by fpb_fpbg, cpm_fpb/ ] -HXT2 -HXZ20 #Z2 #HTZ2 #HZ02 @@ -146,14 +146,14 @@ lapply (cpms_trans … HTZ2 … HZ02) -Z2 [h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ∀G,L,T. G0 = G → L0 = L → T0 = T → IH_cnv_cpms_conf_lpr a h G L T. -#a #h #o #G #L #T #IH2 #IH1 #G0 #L0 #T0 #HG #HL #HT +fact cnv_cpms_conf_lpr_aux (h) (a) (G0) (L0) (T0): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ∀G,L,T. G0 = G → L0 = L → T0 = T → IH_cnv_cpms_conf_lpr h a G L T. +#h #a #G #L #T #IH2 #IH1 #G0 #L0 #T0 #HG #HL #HT #HT0 #n1 #T1 #HT01 #n2 #T2 #HT02 #L1 #HL01 #L2 #HL02 destruct -elim (tdeq_dec h o T0 T1) #H2T01 -elim (tdeq_dec h o T0 T2) #H2T02 +elim (tdeq_dec T0 T1) #H2T01 +elim (tdeq_dec T0 T2) #H2T02 [ @(cnv_cpms_conf_lpr_tdeq_tdeq_aux … IH2 IH1) -IH2 -IH1 /2 width=1 by/ | elim (cpms_tdneq_fwd_step_sn_aux … HT02 HT0 H2T02 IH1 IH2) -HT02 -H2T02 #m21 #m22 #X2 #HX02 #HnX02 #HXT2 #H2 destruct diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq.ma index 1c5287e63..b0c9d9e16 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq.ma @@ -18,17 +18,17 @@ include "basic_2/dynamic/cnv_cpm_tdeq_trans.ma". (* Properties with restricted rt-computation for terms **********************) -fact cpms_tdneq_fwd_step_sn_aux (a) (h) (n) (o) (G) (L) (T1): - ∀T2. ⦃G, L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G, L⦄ ⊢ T1 ![a,h] → (T1 ≛[h,o] T2 → ⊥) → - (∀G0,L0,T0. ⦃G,L,T1⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - (∀G0,L0,T0. ⦃G,L,T1⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr a h G0 L0 T0) → - ∃∃n1,n2,T0. ⦃G, L⦄ ⊢ T1 ➡[n1,h] T0 & T1 ≛[h,o] T0 → ⊥ & ⦃G, L⦄ ⊢ T0 ➡*[n2,h] T2 & n1+n2 = n. -#a #h #n #o #G #L #T1 #T2 #H +fact cpms_tdneq_fwd_step_sn_aux (h) (a) (n) (G) (L) (T1): + ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ T1 ![h,a] → (T1 ≛ T2 → ⊥) → + (∀G0,L0,T0. ⦃G,L,T1⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + (∀G0,L0,T0. ⦃G,L,T1⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr h a G0 L0 T0) → + ∃∃n1,n2,T0. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T0 & T1 ≛ T0 → ⊥ & ⦃G,L⦄ ⊢ T0 ➡*[n2,h] T2 & n1+n2 = n. +#h #a #n #G #L #T1 #T2 #H @(cpms_ind_sn … H) -n -T1 [ #_ #H2T2 elim H2T2 -H2T2 // | #n1 #n2 #T1 #T #H1T1 #H1T2 #IH #H0T1 #H2T12 #IH2 #IH1 - elim (tdeq_dec h o T1 T) #H2T1 - [ elim (tdeq_dec h o T T2) #H2T2 + elim (tdeq_dec T1 T) #H2T1 + [ elim (tdeq_dec T T2) #H2T2 [ -IH -IH2 -IH1 -H0T1 /4 width=7 by tdeq_trans, ex4_3_intro/ | lapply (cnv_cpm_trans_lpr_aux … IH2 IH1 … H1T1 L ?) [6:|*: // ] -H1T2 -H2T12 #H0T elim (IH H0T H2T2) [|*: /4 width=5 by cpm_fpbq, fpbq_fpbg_trans/ ] -IH -IH2 -H0T -H2T2 (**) @@ -42,23 +42,23 @@ fact cpms_tdneq_fwd_step_sn_aux (a) (h) (n) (o) (G) (L) (T1): ] qed-. -fact cpms_tdeq_ind_sn (a) (h) (o) (G) (L) (T2) (Q:relation2 …): - (⦃G, L⦄ ⊢ T2 ![a,h] → Q 0 T2) → - (∀n1,n2,T1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → ⦃G, L⦄ ⊢ T1 ![a,h] → T1 ≛[h,o] T → ⦃G, L⦄ ⊢ T ➡*[n2,h] T2 → ⦃G, L⦄ ⊢ T ![a,h] → T ≛[h,o] T2 → Q n2 T → Q (n1+n2) T1) → - ∀n,T1. ⦃G, L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G, L⦄ ⊢ T1 ![a,h] → T1 ≛[h,o] T2 → - (∀G0,L0,T0. ⦃G,L,T1⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr a h G0 L0 T0) → - (∀G0,L0,T0. ⦃G,L,T1⦄ >[h,o] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr a h G0 L0 T0) → +fact cpms_tdeq_ind_sn (h) (a) (G) (L) (T2) (Q:relation2 …): + (⦃G,L⦄ ⊢ T2 ![h,a] → Q 0 T2) → + (∀n1,n2,T1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → ⦃G,L⦄ ⊢ T1 ![h,a] → T1 ≛ T → ⦃G,L⦄ ⊢ T ➡*[n2,h] T2 → ⦃G,L⦄ ⊢ T ![h,a] → T ≛ T2 → Q n2 T → Q (n1+n2) T1) → + ∀n,T1. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ T1 ![h,a] → T1 ≛ T2 → + (∀G0,L0,T0. ⦃G,L,T1⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpms_conf_lpr h a G0 L0 T0) → + (∀G0,L0,T0. ⦃G,L,T1⦄ >[h] ⦃G0,L0,T0⦄ → IH_cnv_cpm_trans_lpr h a G0 L0 T0) → Q n T1. -#a #h #o #G #L #T2 #Q #IB1 #IB2 #n #T1 #H +#h #a #G #L #T2 #Q #IB1 #IB2 #n #T1 #H @(cpms_ind_sn … H) -n -T1 [ -IB2 #H0T2 #_ #_ #_ /2 width=1 by/ | #n1 #n2 #T1 #T #H1T1 #H1T2 #IH #H0T1 #H2T12 #IH2 #IH1 -IB1 - elim (tdeq_dec h o T1 T) #H2T1 + elim (tdeq_dec T1 T) #H2T1 [ lapply (cnv_cpm_trans_lpr_aux … IH2 IH1 … H1T1 L ?) [6:|*: // ] #H0T lapply (tdeq_canc_sn … H2T1 … H2T12) -H2T12 #H2T2 /6 width=7 by cpm_fpbq, fpbq_fpbg_trans/ (**) | -IB2 -IH -IH2 -IH1 - elim (cnv_fpbg_refl_false … o … H0T1) -a -Q + elim (cnv_fpbg_refl_false … H0T1) -a -Q /3 width=8 by cpm_tdneq_cpm_cpms_tdeq_sym_fwd_fpbg/ ] ] diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq_conf.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq_conf.ma index 56b7c440d..20759ddc7 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq_conf.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpms_tdeq_conf.ma @@ -19,14 +19,14 @@ include "basic_2/dynamic/cnv_cpms_tdeq.ma". (* Sub confluence propery with restricted rt-transition for terms ***********) -fact cnv_cpms_tdeq_strip_lpr_aux (a) (h) (o) (G0) (L0) (T0): - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → ⦃G0,L0⦄ ⊢ T0 ![a,h] → T0 ≛[h,o] T1 → - ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛[h,o] T2 → +fact cnv_cpms_tdeq_strip_lpr_aux (h) (a) (G0) (L0) (T0): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → ⦃G0,L0⦄ ⊢ T0 ![h,a] → T0 ≛ T1 → + ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡[n2,h] T2 → T0 ≛ T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → - ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡[n2-n1,h] T & T1 ≛[h,o] T & ⦃G0,L2⦄ ⊢ T2 ➡*[n1-n2,h] T & T2 ≛[h,o] T. -#a #h #o #G #L0 #T0 #IH2 #IH1 #n1 #T1 #H1T01 #H0T0 #H2T01 + ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡[n2-n1,h] T & T1 ≛ T & ⦃G0,L2⦄ ⊢ T2 ➡*[n1-n2,h] T & T2 ≛ T. +#h #a #G #L0 #T0 #IH2 #IH1 #n1 #T1 #H1T01 #H0T0 #H2T01 @(cpms_tdeq_ind_sn … H1T01 H0T0 H2T01 IH1 IH2) -n1 -T0 [ #H0T1 #n2 #T2 #H1T12 #H2T12 #L1 #HL01 #L2 #HL02 [h,o] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr a h G L T) → - (∀G,L,T. ⦃G0,L0,T0⦄ >[h,o] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr a h G L T) → - ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → ⦃G0,L0⦄ ⊢ T0 ![a,h] → T0 ≛[h,o] T1 → - ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡*[n2,h] T2 → T0 ≛[h,o] T2 → +fact cnv_cpms_tdeq_conf_lpr_aux (h) (a) (G0) (L0) (T0): + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpm_trans_lpr h a G L T) → + (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH_cnv_cpms_conf_lpr h a G L T) → + ∀n1,T1. ⦃G0,L0⦄ ⊢ T0 ➡*[n1,h] T1 → ⦃G0,L0⦄ ⊢ T0 ![h,a] → T0 ≛ T1 → + ∀n2,T2. ⦃G0,L0⦄ ⊢ T0 ➡*[n2,h] T2 → T0 ≛ T2 → ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 → - ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[n2-n1,h] T & T1 ≛[h,o] T & ⦃G0,L2⦄ ⊢ T2 ➡*[n1-n2,h] T & T2 ≛[h,o] T. -#a #h #o #G #L0 #T0 #IH2 #IH1 #n1 #T1 #H1T01 #H0T0 #H2T01 + ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡*[n2-n1,h] T & T1 ≛ T & ⦃G0,L2⦄ ⊢ T2 ➡*[n1-n2,h] T & T2 ≛ T. +#h #a #G #L0 #T0 #IH2 #IH1 #n1 #T1 #H1T01 #H0T0 #H2T01 generalize in match IH1; generalize in match IH2; @(cpms_tdeq_ind_sn … H1T01 H0T0 H2T01 IH1 IH2) -n1 -T0 [ #H0T1 #IH2 #IH1 #n2 #T2 #H1T12 #H2T12 #L1 #HL01 #L2 #HL02 diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpmuwe.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpmuwe.ma new file mode 100644 index 000000000..09dcccc3d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpmuwe.ma @@ -0,0 +1,42 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/cpmuwe_csx.ma". +include "basic_2/rt_equivalence/cpes.ma". +include "basic_2/dynamic/cnv_preserve.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* Properties with t-unbound whd evaluation on terms ************************) + +lemma cnv_cpmuwe_trans (h) (a) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → + ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡*𝐍𝐖*[h,n] T2 → ⦃G,L⦄ ⊢ T2 ![h,a]. +/3 width=4 by cpmuwe_fwd_cpms, cnv_cpms_trans/ qed-. + +lemma cnv_R_cpmuwe_total (h) (a) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → ∃n. R_cpmuwe h G L T1 n. +/4 width=2 by cnv_fwd_fsb, fsb_inv_csx, R_cpmuwe_total_csx/ qed-. + +(* Main inversions with head evaluation for t-bound rt-transition on terms **) + +theorem cnv_cpmuwe_mono (h) (a) (G) (L): + ∀T0. ⦃G,L⦄ ⊢ T0 ![h,a] → + ∀n1,T1. ⦃G,L⦄ ⊢ T0 ➡*𝐍𝐖*[h,n1] T1 → + ∀n2,T2. ⦃G,L⦄ ⊢ T0 ➡*𝐍𝐖*[h,n2] T2 → + ∧∧ ⦃G,L⦄ ⊢ T1 ⬌*[h,n2-n1,n1-n2] T2 & T1 ≅ T2. +#h #a #G #L #T0 #HT0 #n1 #T1 * #HT01 #HT1 #n2 #T2 * #HT02 #HT2 +elim (cnv_cpms_conf … HT0 … HT01 … HT02) -T0 #T0 #HT10 #HT20 +/4 width=4 by cpms_div, tweq_canc_dx, conj/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpmuwe_cpme.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpmuwe_cpme.ma new file mode 100644 index 000000000..801a56a09 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpmuwe_cpme.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 "basic_2/rt_computation/cpme_aaa.ma". +include "basic_2/rt_computation/cnuw_cnuw.ma". +include "basic_2/rt_computation/cpmuwe.ma". +include "basic_2/dynamic/cnv_cpme.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* Advanced Properties with t-unbound whd evaluation on terms ***************) + +lemma cnv_R_cpmuwe_dec (h) (a) (G) (L): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∀n. Decidable (R_cpmuwe h G L T n). +#h #a #G #L #T1 #HT1 #n +elim (cnv_fwd_aaa … HT1) #A #HA +elim (cpme_total_aaa h n … HA) -HA #T2 #HT12 +elim (cnuw_dec h G L T2) #HnT1 +[ /5 width=3 by cpme_fwd_cpms, cpmuwe_intro, ex_intro, or_introl/ +| @or_intror * #T3 * #HT13 #HT3 + lapply (cnv_cpme_cpms_conf … HT1 … HT13 … HT12) -a -T1 #HT32 + /4 width=9 by cpme_fwd_cpms, cnuw_cpms_trans/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_drops.ma index e4d55446c..bb1e540fe 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_drops.ma @@ -15,14 +15,15 @@ include "basic_2/rt_computation/cpms_drops.ma". include "basic_2/dynamic/cnv.ma". -(* CONTEXT_SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Advanced dproperties *****************************************************) (* Basic_2A1: uses: snv_lref *) -lemma cnv_lref_drops (a) (h) (G): ∀I,K,V,i,L. ⦃G, K⦄ ⊢ V ![a, h] → - ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, L⦄ ⊢ #i ![a, h]. -#a #h #G #I #K #V #i elim i -i +lemma cnv_lref_drops (h) (a) (G): + ∀I,K,V,i,L. ⦃G,K⦄ ⊢ V ![h,a] → + ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G,L⦄ ⊢ #i ![h,a]. +#h #a #G #I #K #V #i elim i -i [ #L #HV #H lapply (drops_fwd_isid … H ?) -H // #H destruct /2 width=1 by cnv_zero/ @@ -35,10 +36,10 @@ qed. (* Advanced inversion lemmas ************************************************) (* Basic_2A1: uses: snv_inv_lref *) -lemma cnv_inv_lref_drops (a) (h) (G): - ∀i,L. ⦃G, L⦄ ⊢ #i ![a, h] → - ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ![a, h]. -#a #h #G #i elim i -i +lemma cnv_inv_lref_drops (h) (a) (G): + ∀i,L. ⦃G,L⦄ ⊢ #i ![h,a] → + ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G,K⦄ ⊢ V ![h,a]. +#h #a #G #i elim i -i [ #L #H elim (cnv_inv_zero … H) -H #I #K #V #HV #H destruct /3 width=5 by drops_refl, ex2_3_intro/ @@ -49,21 +50,35 @@ lemma cnv_inv_lref_drops (a) (h) (G): ] qed-. -(* Advanced forward lemmas **************************************************) - -lemma cnv_lref_fwd_drops (a) (h) (G): - ∀i,L. ⦃G, L⦄ ⊢ #i ![a, h] → - ∀I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ![a, h]. -#a #h #o #i #L #H #I #K #V #HLK +lemma cnv_inv_lref_pair (h) (a) (G): + ∀i,L. ⦃G,L⦄ ⊢ #i ![h,a] → + ∀I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G,K⦄ ⊢ V ![h,a]. +#h #a #G #i #L #H #I #K #V #HLK elim (cnv_inv_lref_drops … H) -H #Z #Y #X #HLY #HX lapply (drops_mono … HLY … HLK) -L #H destruct // -qed-. +qed-. + +lemma cnv_inv_lref_atom (h) (a) (b) (G): + ∀i,L. ⦃G,L⦄ ⊢ #i ![h,a] → ⬇*[b,𝐔❴i❵] L ≘ ⋆ → ⊥. +#h #a #b #G #i #L #H #Hi +elim (cnv_inv_lref_drops … H) -H #Z #Y #X #HLY #_ +lapply (drops_gen b … HLY) -HLY #HLY +lapply (drops_mono … HLY … Hi) -L #H destruct +qed-. + +lemma cnv_inv_lref_unit (h) (a) (G): + ∀i,L. ⦃G,L⦄ ⊢ #i ![h,a] → + ∀I,K. ⬇*[i] L ≘ K.ⓤ{I} → ⊥. +#h #a #G #i #L #H #I #K #HLK +elim (cnv_inv_lref_drops … H) -H #Z #Y #X #HLY #_ +lapply (drops_mono … HLY … HLK) -L #H destruct +qed-. (* Properties with generic slicing for local environments *******************) (* Basic_2A1: uses: snv_lift *) -lemma cnv_lifts (a) (h): ∀G. d_liftable1 (cnv a h G). -#a #h #G #K #T +lemma cnv_lifts (h) (a): ∀G. d_liftable1 (cnv h a G). +#h #a #G #K #T @(fqup_wf_ind_eq (Ⓣ) … G K T) -G -K -T #G0 #K0 #T0 #IH #G #K * * [|||| * ] [ #s #HG #HK #HT #_ #b #f #L #_ #X #H2 destruct >(lifts_inv_sort1 … H2) -X -K -f // @@ -101,8 +116,8 @@ qed-. (* Inversion lemmas with generic slicing for local environments *************) (* Basic_2A1: uses: snv_inv_lift *) -lemma cnv_inv_lifts (a) (h): ∀G. d_deliftable1 (cnv a h G). -#a #h #G #L #U +lemma cnv_inv_lifts (h) (a): ∀G. d_deliftable1 (cnv h a G). +#h #a #G #L #U @(fqup_wf_ind_eq (Ⓣ) … G L U) -G -L -U #G0 #L0 #U0 #IH #G #L * * [|||| * ] [ #s #HG #HL #HU #H1 #b #f #K #HLK #X #H2 destruct >(lifts_inv_sort2 … H2) -X -L -f // diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_eval.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_eval.ma new file mode 100644 index 000000000..d87201dad --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_eval.ma @@ -0,0 +1,106 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/cpmuwe_cpmuwe.ma". +include "basic_2/rt_equivalence/cpes_cpes.ma". +include "basic_2/dynamic/cnv_cpmuwe.ma". (**) (* should be included by the next *) +include "basic_2/dynamic/cnv_cpmuwe_cpme.ma". +include "basic_2/dynamic/cnv_cpes.ma". +include "basic_2/dynamic/cnv_preserve_cpes.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* main properties with evaluations for rt-transition on terms **************) + +theorem cnv_dec (h) (a) (G) (L) (T): ac_props a → + Decidable (⦃G,L⦄ ⊢ T ![h,a]). +#h #a #G #L #T #Ha +@(fqup_wf_ind_eq (Ⓣ) … G L T) -G -L -T #G0 #L0 #T0 #IH #G #L * * [|||| * ] +[ #s #HG #HL #HT destruct -Ha -IH + /2 width=1 by cnv_sort, or_introl/ +| #i #HG #HL #HT destruct -Ha + elim (drops_F_uni L i) [| * * ] + [ /3 width=8 by cnv_inv_lref_atom, or_intror/ + | /3 width=9 by cnv_inv_lref_unit, or_intror/ + | #I #V #K #HLK + elim (IH G K V) -IH [3: /2 width=2 by fqup_lref/ ] + [ /3 width=5 by cnv_lref_drops, or_introl/ + | /4 width=5 by cnv_inv_lref_pair, or_intror/ + ] + ] +| #l #HG #HL #HT destruct -Ha -IH + /3 width=6 by cnv_inv_gref, or_intror/ +| #p #I #V #T #HG #HL #HT destruct -Ha + elim (IH G L V) [| -IH | // ] #HV + [ elim (IH G (L.ⓑ{I}V) T) -IH [3: // ] #HT + [ /3 width=1 by cnv_bind, or_introl/ ] + ] + @or_intror #H + elim (cnv_inv_bind … H) -H /2 width=1 by/ +| #V #T #HG #HL #HT destruct + elim (IH G L V) [| -IH #HV | // ] + [ elim (IH G L T) -IH [| #HT #HV | // ] + [ #HT #HV + elim (cnv_R_cpmuwe_total … HT) #n #Hn + elim (dec_min (R_cpmuwe h G L T) … Hn) -Hn + [| /2 width=2 by cnv_R_cpmuwe_dec/ ] #n0 #_ -n + elim (ac_dec … Ha n0) -Ha + [ * #n #Ha #Hn * #X0 #HX0 #_ + elim (abst_dec X0) + [ * #p #W #U0 #H destruct + elim (cnv_cpes_dec … 1 0 … HV W) [ #HVW | #HnVW ] + [ lapply (cpmuwe_fwd_cpms … HX0) -HX0 #HTU0 + elim (cnv_fwd_cpms_abst_dx_le … HT … HTU0 … Hn) #U #HTU #_ -U0 -n0 + /3 width=7 by cnv_appl_cpes, or_introl/ +(* Note: argument type mismatch *) + | @or_intror #H -n + elim (cnv_inv_appl_cpes … H) -H #m0 #q #WX #UX #_ #_ #_ #HVWX #HTUX + lapply (cpmuwe_abst … HTUX) -HTUX #HTUX + elim (cnv_cpmuwe_mono … HT … HTUX … HX0) -a -T #H #_ + elim (cpes_fwd_abst_bi … H) -H #_ #HWX -n0 -m0 -p -q -UX -U0 + /3 width=3 by cpes_cpes_trans/ + | lapply (cnv_cpmuwe_trans … HT … HX0) -T #H + elim (cnv_inv_bind … H) -H #HW #_ // + ] +(* Note: no expected type *) + | #HnX0 + @or_intror #H + elim (cnv_inv_appl_cpes … H) -H #m0 #q #W0 #U0 #_ #_ #_ #_ #HTU0 + lapply (cpmuwe_abst … HTU0) -HTU0 #HTU0 + elim (cnv_cpmuwe_mono … HT … HTU0 … HX0) -T #_ #H + elim (tweq_inv_abst_sn … H) -W0 -U0 #W0 #U0 #H destruct + /2 width=4 by/ + ] +(* Note: failed applicability *) + | #Hge #_ #Hlt + @or_intror #H + elim (cnv_inv_appl … H) -H #m0 #q #W0 #U0 #Hm0 #_ #_ #_ #HTU0 + elim (lt_or_ge m0 n0) #H0 [| /3 width=3 by ex2_intro/ ] -Hm0 -Hge + /4 width=6 by cpmuwe_abst, ex_intro/ + ] + ] + ] + @or_intror #H + elim (cnv_inv_appl … H) -H /2 width=1 by/ +| #U #T #HG #HL #HT destruct + elim (IH G L U) [| -IH | // ] #HU + [ elim (IH G L T) -IH [3: // ] #HT + [ elim (cnv_cpes_dec … 0 1 … HU … HT) #HUT + [ /3 width=1 by cnv_cast_cpes, or_introl/ ] + ] + ] + @or_intror #H + elim (cnv_inv_cast_cpes … H) -H /2 width=1 by/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fqus.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fqus.ma index cb79dfcc8..50e4edbee 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fqus.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fqus.ma @@ -15,14 +15,15 @@ include "static_2/s_computation/fqus_fqup.ma". include "basic_2/dynamic/cnv_drops.ma". -(* CONTEXT_SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Properties with supclosure ***********************************************) (* Basic_2A1: uses: snv_fqu_conf *) -lemma cnv_fqu_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. -#a #h #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 +lemma cnv_fqu_conf (h) (a): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂ ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ T1 ![h,a] → ⦃G2,L2⦄ ⊢ T2 ![h,a]. +#h #a #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 [ #I1 #G1 #L1 #V1 #H elim (cnv_inv_zero … H) -H #I2 #L2 #V2 #HV2 #H destruct // | * [ #p #I1 | * ] #G1 #L1 #V1 #T1 #H @@ -30,7 +31,7 @@ lemma cnv_fqu_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2 | elim (cnv_inv_appl … H) -H // | elim (cnv_inv_cast … H) -H // ] -| #p #I1 #G1 #L1 #V1 #T1 #H +| #p #I1 #G1 #L1 #V1 #T1 #_ #H elim (cnv_inv_bind … H) -H // | #p #I1 #G1 #L1 #V1 #T1 #H destruct | * #G1 #L1 #V1 #T1 #H @@ -43,22 +44,25 @@ lemma cnv_fqu_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2 qed-. (* Basic_2A1: uses: snv_fquq_conf *) -lemma cnv_fquq_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. -#a #h #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -H [|*] +lemma cnv_fquq_conf (h) (a): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮ ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ T1 ![h,a] → ⦃G2,L2⦄ ⊢ T2 ![h,a]. +#h #a #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -H [|*] /2 width=5 by cnv_fqu_conf/ qed-. (* Basic_2A1: uses: snv_fqup_conf *) -lemma cnv_fqup_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. -#a #h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 +lemma cnv_fqup_conf (h) (a): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+ ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ T1 ![h,a] → ⦃G2,L2⦄ ⊢ T2 ![h,a]. +#h #a #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 /3 width=5 by fqup_strap1, cnv_fqu_conf/ qed-. (* Basic_2A1: uses: snv_fqus_conf *) -lemma cnv_fqus_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. -#a #h #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqus_inv_fqup … H) -H [|*] +lemma cnv_fqus_conf (h) (a): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂* ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ T1 ![h,a] → ⦃G2,L2⦄ ⊢ T2 ![h,a]. +#h #a #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqus_inv_fqup … H) -H [|*] /2 width=5 by cnv_fqup_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fsb.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fsb.ma index 4ce63d92a..3716f67ea 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fsb.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fsb.ma @@ -19,13 +19,23 @@ include "basic_2/dynamic/cnv_aaa.ma". (* Forward lemmas with strongly rst-normalizing closures ********************) +(* Note: this is the "big tree" theorem *) (* Basic_2A1: uses: snv_fwd_fsb *) -lemma cnv_fwd_fsb (a) (h) (o): ∀G,L,T. ⦃G, L⦄ ⊢ T ![a, h] → ≥[h, o] 𝐒⦃G, L, T⦄. -#a #h #o #G #L #T #H elim (cnv_fwd_aaa … H) -H /2 width=2 by aaa_fsb/ +lemma cnv_fwd_fsb (h) (a): + ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a] → ≥[h] 𝐒⦃G,L,T⦄. +#h #a #G #L #T #H elim (cnv_fwd_aaa … H) -H /2 width=2 by aaa_fsb/ +qed-. + +(* Forward lemmas with strongly rt-normalizing terms ************************) + +lemma cnv_fwd_csx (h) (a): + ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a] → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #a #G #L #T #H +/3 width=2 by cnv_fwd_fsb, fsb_inv_csx/ qed-. (* Inversion lemmas with proper parallel rst-computation for closures *******) -lemma cnv_fpbg_refl_false (a) (h) (o) (G) (L) (T): - ⦃G, L⦄ ⊢ T ![a,h] → ⦃G, L, T⦄ >[h,o] ⦃G, L, T⦄ → ⊥. +lemma cnv_fpbg_refl_false (h) (a): + ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a] → ⦃G,L,T⦄ >[h] ⦃G,L,T⦄ → ⊥. /3 width=7 by cnv_fwd_fsb, fsb_fpbg_refl_false/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve.ma index c4edc5508..9763d082a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve.ma @@ -19,58 +19,57 @@ include "basic_2/dynamic/cnv_cpms_conf.ma". (* Main preservation properties *********************************************) (* Basic_2A1: uses: snv_preserve *) -lemma cnv_preserve (a) (h): ∀G,L,T. ⦃G,L⦄ ⊢ T ![a,h] → - ∧∧ IH_cnv_cpms_conf_lpr a h G L T - & IH_cnv_cpm_trans_lpr a h G L T. -#a #h #G #L #T #HT -letin o ≝ (sd_O h) -lapply (cnv_fwd_fsb … o … HT) -HT #H +lemma cnv_preserve (h) (a): ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a] → + ∧∧ IH_cnv_cpms_conf_lpr h a G L T + & IH_cnv_cpm_trans_lpr h a G L T. +#h #a #G #L #T #HT +lapply (cnv_fwd_fsb … HT) -HT #H @(fsb_ind_fpbg … H) -G -L -T #G #L #T #_ #IH @conj [ letin aux ≝ cnv_cpms_conf_lpr_aux | letin aux ≝ cnv_cpm_trans_lpr_aux ] -@(aux … o … G L T) // #G0 #L0 #T0 #H +@(aux … G L T) // #G0 #L0 #T0 #H elim (IH … H) -IH -H // qed-. -theorem cnv_cpms_conf_lpr (a) (h) (G) (L) (T): IH_cnv_cpms_conf_lpr a h G L T. -#a #h #G #L #T #HT elim (cnv_preserve … HT) /2 width=1 by/ +theorem cnv_cpms_conf_lpr (h) (a) (G) (L) (T): IH_cnv_cpms_conf_lpr h a G L T. +#h #a #G #L #T #HT elim (cnv_preserve … HT) /2 width=1 by/ qed-. (* Basic_2A1: uses: snv_cpr_lpr *) -theorem cnv_cpm_trans_lpr (a) (h) (G) (L) (T): IH_cnv_cpm_trans_lpr a h G L T. -#a #h #G #L #T #HT elim (cnv_preserve … HT) /2 width=2 by/ +theorem cnv_cpm_trans_lpr (h) (a) (G) (L) (T): IH_cnv_cpm_trans_lpr h a G L T. +#h #a #G #L #T #HT elim (cnv_preserve … HT) /2 width=2 by/ qed-. (* Advanced preservation properties *****************************************) -lemma cnv_cpms_conf (a) (h) (G) (L): - ∀T0. ⦃G,L⦄ ⊢ T0 ![a,h] → +lemma cnv_cpms_conf (h) (a) (G) (L): + ∀T0. ⦃G,L⦄ ⊢ T0 ![h,a] → ∀n1,T1. ⦃G,L⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G,L⦄ ⊢ T0 ➡*[n2,h] T2 → ∃∃T. ⦃G,L⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G,L⦄ ⊢ T2 ➡*[n1-n2,h] T. /2 width=8 by cnv_cpms_conf_lpr/ qed-. (* Basic_2A1: uses: snv_cprs_lpr *) -lemma cnv_cpms_trans_lpr (a) (h) (G) (L) (T): IH_cnv_cpms_trans_lpr a h G L T. -#a #h #G #L1 #T1 #HT1 #n #T2 #H +lemma cnv_cpms_trans_lpr (h) (a) (G) (L) (T): IH_cnv_cpms_trans_lpr h a G L T. +#h #a #G #L1 #T1 #HT1 #n #T2 #H @(cpms_ind_dx … H) -n -T2 /3 width=6 by cnv_cpm_trans_lpr/ qed-. -lemma cnv_cpm_trans (a) (h) (G) (L): - ∀T1. ⦃G,L⦄ ⊢ T1 ![a,h] → - ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → ⦃G,L⦄ ⊢ T2 ![a,h]. +lemma cnv_cpm_trans (h) (a) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → + ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → ⦃G,L⦄ ⊢ T2 ![h,a]. /2 width=6 by cnv_cpm_trans_lpr/ qed-. (* Note: this is the preservation property *) -lemma cnv_cpms_trans (a) (h) (G) (L): - ∀T1. ⦃G,L⦄ ⊢ T1 ![a,h] → - ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ T2 ![a,h]. +lemma cnv_cpms_trans (h) (a) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → + ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ T2 ![h,a]. /2 width=6 by cnv_cpms_trans_lpr/ qed-. -lemma cnv_lpr_trans (a) (h) (G): - ∀L1,T. ⦃G,L1⦄ ⊢ T ![a,h] → ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T ![a,h]. +lemma cnv_lpr_trans (h) (a) (G): + ∀L1,T. ⦃G,L1⦄ ⊢ T ![h,a] → ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T ![h,a]. /2 width=6 by cnv_cpm_trans_lpr/ qed-. -lemma cnv_lprs_trans (a) (h) (G): - ∀L1,T. ⦃G,L1⦄ ⊢ T ![a,h] → ∀L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → ⦃G,L2⦄ ⊢ T ![a,h]. -#a #h #G #L1 #T #HT #L2 #H +lemma cnv_lprs_trans (h) (a) (G): + ∀L1,T. ⦃G,L1⦄ ⊢ T ![h,a] → ∀L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → ⦃G,L2⦄ ⊢ T ![h,a]. +#h #a #G #L1 #T #HT #L2 #H @(lprs_ind_dx … H) -L2 /2 width=3 by cnv_lpr_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve_cpcs.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve_cpcs.ma new file mode 100644 index 000000000..29d85f7bd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve_cpcs.ma @@ -0,0 +1,38 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_equivalence/cpcs_cprs.ma". +include "basic_2/dynamic/cnv_preserve.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* Forward lemmas with r-equivalence ****************************************) + +lemma cnv_cpms_conf_eq (h) (a) (n) (G) (L): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → + ∀T1. ⦃G,L⦄ ⊢ T ➡*[n,h] T1 → ∀T2. ⦃G,L⦄ ⊢ T ➡*[n,h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. +#h #a #n #G #L #T #HT #T1 #HT1 #T2 #HT2 +elim (cnv_cpms_conf … HT … HT1 … HT2) -T [h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_trans_lpr a h G1 L1 T1) → - ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_trans_lpr a h G1 L1 T1. -#a #h #o #G0 #L0 #T0 #IH #G1 #L1 #T1 #H01 #HT1 #n #T2 #H +fact cnv_cpms_trans_lpr_sub (h) (a): + ∀G0,L0,T0. + (∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpm_trans_lpr h a G1 L1 T1) → + ∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpms_trans_lpr h a G1 L1 T1. +#h #a #G0 #L0 #T0 #IH #G1 #L1 #T1 #H01 #HT1 #n #T2 #H @(cpms_ind_dx … H) -n -T2 /3 width=7 by fpbg_cpms_trans/ qed-. -fact cnv_cpm_conf_lpr_sub (a) (h) (o): - ∀G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) → - ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_conf_lpr a h G1 L1 T1. +fact cnv_cpm_conf_lpr_sub (h) (a): + ∀G0,L0,T0. + (∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpms_conf_lpr h a G1 L1 T1) → + ∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpm_conf_lpr h a G1 L1 T1. /3 width=8 by cpm_cpms/ qed-. -fact cnv_cpms_strip_lpr_sub (a) (h) (o): - ∀G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) → - ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_strip_lpr a h G1 L1 T1. +fact cnv_cpms_strip_lpr_sub (h) (a): + ∀G0,L0,T0. + (∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpms_conf_lpr h a G1 L1 T1) → + ∀G1,L1,T1. ⦃G0,L0,T0⦄ >[h] ⦃G1,L1,T1⦄ → IH_cnv_cpms_strip_lpr h a G1 L1 T1. /3 width=8 by cpm_cpms/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv.ma index 20b5259d0..2ff320b82 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv.ma @@ -17,21 +17,22 @@ include "basic_2/dynamic/cnv.ma". (* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE VALIDITY *************************) -inductive lsubv (a) (h) (G): relation lenv ≝ -| lsubv_atom: lsubv a h G (⋆) (⋆) -| lsubv_bind: ∀I,L1,L2. lsubv a h G L1 L2 → lsubv a h G (L1.ⓘ{I}) (L2.ⓘ{I}) -| lsubv_beta: ∀L1,L2,W,V. ⦃G, L1⦄ ⊢ ⓝW.V ![a,h] → - lsubv a h G L1 L2 → lsubv a h G (L1.ⓓⓝW.V) (L2.ⓛW) +inductive lsubv (h) (a) (G): relation lenv ≝ +| lsubv_atom: lsubv h a G (⋆) (⋆) +| lsubv_bind: ∀I,L1,L2. lsubv h a G L1 L2 → lsubv h a G (L1.ⓘ{I}) (L2.ⓘ{I}) +| lsubv_beta: ∀L1,L2,W,V. ⦃G,L1⦄ ⊢ ⓝW.V ![h,a] → + lsubv h a G L1 L2 → lsubv h a G (L1.ⓓⓝW.V) (L2.ⓛW) . interpretation "local environment refinement (native validity)" - 'LRSubEqV a h G L1 L2 = (lsubv a h G L1 L2). + 'LRSubEqV h a G L1 L2 = (lsubv h a G L1 L2). (* Basic inversion lemmas ***************************************************) -fact lsubv_inv_atom_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L1 = ⋆ → L2 = ⋆. -#a #h #G #L1 #L2 * -L1 -L2 +fact lsubv_inv_atom_sn_aux (h) (a) (G): + ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → L1 = ⋆ → L2 = ⋆. +#h #a #G #L1 #L2 * -L1 -L2 [ // | #I #L1 #L2 #_ #H destruct | #L1 #L2 #W #V #_ #_ #H destruct @@ -39,16 +40,16 @@ fact lsubv_inv_atom_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L1 = qed-. (* Basic_2A1: uses: lsubsv_inv_atom1 *) -lemma lsubv_inv_atom_sn (a) (h) (G): ∀L2. G ⊢ ⋆ ⫃![a,h] L2 → L2 = ⋆. +lemma lsubv_inv_atom_sn (h) (a) (G): + ∀L2. G ⊢ ⋆ ⫃![h,a] L2 → L2 = ⋆. /2 width=6 by lsubv_inv_atom_sn_aux/ qed-. -fact lsubv_inv_bind_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → - ∀I,K1. L1 = K1.ⓘ{I} → - ∨∨ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓘ{I} - | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & - G ⊢ K1 ⫃![a,h] K2 & - I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW. -#a #h #G #L1 #L2 * -L1 -L2 +fact lsubv_inv_bind_sn_aux (h) (a) (G): ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → + ∀I,K1. L1 = K1.ⓘ{I} → + ∨∨ ∃∃K2. G ⊢ K1 ⫃![h,a] K2 & L2 = K2.ⓘ{I} + | ∃∃K2,W,V. ⦃G,K1⦄ ⊢ ⓝW.V ![h,a] & G ⊢ K1 ⫃![h,a] K2 + & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW. +#h #a #G #L1 #L2 * -L1 -L2 [ #J #K1 #H destruct | #I #L1 #L2 #HL12 #J #K1 #H destruct /3 width=3 by ex2_intro, or_introl/ | #L1 #L2 #W #V #HWV #HL12 #J #K1 #H destruct /3 width=7 by ex4_3_intro, or_intror/ @@ -56,15 +57,16 @@ fact lsubv_inv_bind_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → qed-. (* Basic_2A1: uses: lsubsv_inv_pair1 *) -lemma lsubv_inv_bind_sn (a) (h) (G): ∀I,K1,L2. G ⊢ K1.ⓘ{I} ⫃![a,h] L2 → - ∨∨ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓘ{I} - | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & - G ⊢ K1 ⫃![a,h] K2 & - I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW. +lemma lsubv_inv_bind_sn (h) (a) (G): + ∀I,K1,L2. G ⊢ K1.ⓘ{I} ⫃![h,a] L2 → + ∨∨ ∃∃K2. G ⊢ K1 ⫃![h,a] K2 & L2 = K2.ⓘ{I} + | ∃∃K2,W,V. ⦃G,K1⦄ ⊢ ⓝW.V ![h,a] & G ⊢ K1 ⫃![h,a] K2 + & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW. /2 width=3 by lsubv_inv_bind_sn_aux/ qed-. -fact lsubv_inv_atom_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L2 = ⋆ → L1 = ⋆. -#a #h #G #L1 #L2 * -L1 -L2 +fact lsubv_inv_atom_dx_aux (h) (a) (G): + ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → L2 = ⋆ → L1 = ⋆. +#h #a #G #L1 #L2 * -L1 -L2 [ // | #I #L1 #L2 #_ #H destruct | #L1 #L2 #W #V #_ #_ #H destruct @@ -72,15 +74,17 @@ fact lsubv_inv_atom_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L2 = qed-. (* Basic_2A1: uses: lsubsv_inv_atom2 *) -lemma lsubv_inv_atom2 (a) (h) (G): ∀L1. G ⊢ L1 ⫃![a,h] ⋆ → L1 = ⋆. +lemma lsubv_inv_atom2 (h) (a) (G): + ∀L1. G ⊢ L1 ⫃![h,a] ⋆ → L1 = ⋆. /2 width=6 by lsubv_inv_atom_dx_aux/ qed-. -fact lsubv_inv_bind_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → - ∀I,K2. L2 = K2.ⓘ{I} → - ∨∨ ∃∃K1. G ⊢ K1 ⫃![a,h] K2 & L1 = K1.ⓘ{I} - | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & - G ⊢ K1 ⫃![a,h] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V. -#a #h #G #L1 #L2 * -L1 -L2 +fact lsubv_inv_bind_dx_aux (h) (a) (G): + ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → + ∀I,K2. L2 = K2.ⓘ{I} → + ∨∨ ∃∃K1. G ⊢ K1 ⫃![h,a] K2 & L1 = K1.ⓘ{I} + | ∃∃K1,W,V. ⦃G,K1⦄ ⊢ ⓝW.V ![h,a] & + G ⊢ K1 ⫃![h,a] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V. +#h #a #G #L1 #L2 * -L1 -L2 [ #J #K2 #H destruct | #I #L1 #L2 #HL12 #J #K2 #H destruct /3 width=3 by ex2_intro, or_introl/ | #L1 #L2 #W #V #HWV #HL12 #J #K2 #H destruct /3 width=7 by ex4_3_intro, or_intror/ @@ -88,17 +92,19 @@ fact lsubv_inv_bind_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → qed-. (* Basic_2A1: uses: lsubsv_inv_pair2 *) -lemma lsubv_inv_bind_dx (a) (h) (G): ∀I,L1,K2. G ⊢ L1 ⫃![a,h] K2.ⓘ{I} → - ∨∨ ∃∃K1. G ⊢ K1 ⫃![a,h] K2 & L1 = K1.ⓘ{I} - | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & - G ⊢ K1 ⫃![a,h] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V. +lemma lsubv_inv_bind_dx (h) (a) (G): + ∀I,L1,K2. G ⊢ L1 ⫃![h,a] K2.ⓘ{I} → + ∨∨ ∃∃K1. G ⊢ K1 ⫃![h,a] K2 & L1 = K1.ⓘ{I} + | ∃∃K1,W,V. ⦃G,K1⦄ ⊢ ⓝW.V ![h,a] & + G ⊢ K1 ⫃![h,a] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V. /2 width=3 by lsubv_inv_bind_dx_aux/ qed-. (* Advanced inversion lemmas ************************************************) -lemma lsubv_inv_abst_sn (a) (h) (G): ∀K1,L2,W. G ⊢ K1.ⓛW ⫃![a,h] L2 → - ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓛW. -#a #h #G #K1 #L2 #W #H +lemma lsubv_inv_abst_sn (h) (a) (G): + ∀K1,L2,W. G ⊢ K1.ⓛW ⫃![h,a] L2 → + ∃∃K2. G ⊢ K1 ⫃![h,a] K2 & L2 = K2.ⓛW. +#h #a #G #K1 #L2 #W #H elim (lsubv_inv_bind_sn … H) -H // * #K2 #XW #XV #_ #_ #H1 #H2 destruct qed-. @@ -106,8 +112,8 @@ qed-. (* Basic properties *********************************************************) (* Basic_2A1: uses: lsubsv_refl *) -lemma lsubv_refl (a) (h) (G): reflexive … (lsubv a h G). -#a #h #G #L elim L -L /2 width=1 by lsubv_atom, lsubv_bind/ +lemma lsubv_refl (h) (a) (G): reflexive … (lsubv h a G). +#h #a #G #L elim L -L /2 width=1 by lsubv_atom, lsubv_bind/ qed. (* Basic_2A1: removed theorems 3: diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cnv.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cnv.ma index b1782a021..122c30c41 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cnv.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cnv.ma @@ -19,10 +19,10 @@ include "basic_2/dynamic/lsubv_cpms.ma". (* Forward lemmas with native validity **************************************) (* Basic_2A1: uses: lsubsv_snv_trans *) -lemma lsubv_cnv_trans (a) (h) (G): - ∀L2,T. ⦃G, L2⦄ ⊢ T ![a,h] → - ∀L1. G ⊢ L1 ⫃![a,h] L2 → ⦃G, L1⦄ ⊢ T ![a,h]. -#a #h #G #L2 #T #H elim H -G -L2 -T // +lemma lsubv_cnv_trans (h) (a) (G): + ∀L2,T. ⦃G,L2⦄ ⊢ T ![h,a] → + ∀L1. G ⊢ L1 ⫃![h,a] L2 → ⦃G,L1⦄ ⊢ T ![h,a]. +#h #a #G #L2 #T #H elim H -G -L2 -T // [ #I #G #K2 #V #HV #IH #L1 #H elim (lsubv_inv_bind_dx … H) -H * /3 width=1 by cnv_zero/ | #I #G #K2 #i #_ #IH #L1 #H diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpcs.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpcs.ma index c02ec80b0..aad53743d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpcs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpcs.ma @@ -20,6 +20,6 @@ include "basic_2/dynamic/lsubv_lsubr.ma". (* Forward lemmas with context-sensitive r-equivalence for terms ************) (* Basic_2A1: uses: lsubsv_cprs_trans *) -lemma lsubv_cpcs_trans (a) (h) (G): lsub_trans … (cpcs h G) (lsubv a h G). +lemma lsubv_cpcs_trans (h) (a) (G): lsub_trans … (cpcs h G) (lsubv h a G). /3 width=6 by lsubv_fwd_lsubr, lsubr_cpcs_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpms.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpms.ma index 81d385add..6d53694c7 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpms.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_cpms.ma @@ -20,6 +20,7 @@ include "basic_2/dynamic/lsubv_lsubr.ma". (* Forward lemmas with t-bound contex-sensitive rt-computation for terms ****) (* Basic_2A1: uses: lsubsv_cprs_trans lsubsv_scpds_trans *) -lemma lsubv_cpms_trans (a) (n) (h) (G): lsub_trans … (λL. cpms h G L n) (lsubv a h G). +lemma lsubv_cpms_trans (h) (a) (n) (G): + lsub_trans … (λL. cpms h G L n) (lsubv h a G). /3 width=6 by lsubv_fwd_lsubr, lsubr_cpms_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_drops.ma index 06d302d57..6b0daf223 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_drops.ma @@ -21,11 +21,11 @@ include "basic_2/dynamic/lsubv.ma". (* Note: the premise 𝐔⦃f⦄ cannot be removed *) (* Basic_2A1: includes: lsubsv_drop_O1_conf *) -lemma lsubv_drops_conf_isuni (a) (h) (G): - ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → - ∀b,f,K1. 𝐔⦃f⦄ → ⬇*[b,f] L1 ≘ K1 → - ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & ⬇*[b,f] L2 ≘ K2. -#a #h #G #L1 #L2 #H elim H -L1 -L2 +lemma lsubv_drops_conf_isuni (h) (a) (G): + ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → + ∀b,f,K1. 𝐔⦃f⦄ → ⬇*[b,f] L1 ≘ K1 → + ∃∃K2. G ⊢ K1 ⫃![h,a] K2 & ⬇*[b,f] L2 ≘ K2. +#h #a #G #L1 #L2 #H elim H -L1 -L2 [ /2 width=3 by ex2_intro/ | #I #L1 #L2 #HL12 #IH #b #f #K1 #Hf #H elim (drops_inv_bind1_isuni … Hf H) -Hf -H * @@ -46,11 +46,11 @@ qed-. (* Note: the premise 𝐔⦃f⦄ cannot be removed *) (* Basic_2A1: includes: lsubsv_drop_O1_trans *) -lemma lsubv_drops_trans_isuni (a) (h) (G): - ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → - ∀b,f,K2. 𝐔⦃f⦄ → ⬇*[b,f] L2 ≘ K2 → - ∃∃K1. G ⊢ K1 ⫃![a,h] K2 & ⬇*[b,f] L1 ≘ K1. -#a #h #G #L1 #L2 #H elim H -L1 -L2 +lemma lsubv_drops_trans_isuni (h) (a) (G): + ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → + ∀b,f,K2. 𝐔⦃f⦄ → ⬇*[b,f] L2 ≘ K2 → + ∃∃K1. G ⊢ K1 ⫃![h,a] K2 & ⬇*[b,f] L1 ≘ K1. +#h #a #G #L1 #L2 #H elim H -L1 -L2 [ /2 width=3 by ex2_intro/ | #I #L1 #L2 #HL12 #IH #b #f #K2 #Hf #H elim (drops_inv_bind1_isuni … Hf H) -Hf -H * diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsuba.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsuba.ma index daede63b3..969751d2d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsuba.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsuba.ma @@ -20,8 +20,8 @@ include "basic_2/dynamic/lsubv.ma". (* Forward lemmas with lenv refinement for atomic arity assignment **********) (* Basic_2A1: uses: lsubsv_fwd_lsuba *) -lemma lsubsv_fwd_lsuba (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → G ⊢ L1 ⫃⁝ L2. -#a #h #G #L1 #L2 #H elim H -L1 -L2 /2 width=1 by lsuba_bind/ +lemma lsubsv_fwd_lsuba (h) (a) (G): ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → G ⊢ L1 ⫃⁝ L2. +#h #a #G #L1 #L2 #H elim H -L1 -L2 /2 width=1 by lsuba_bind/ #L1 #L2 #W #V #H #_ #IH elim (cnv_inv_cast … H) -H #W0 #HW #HV #HW0 #HVW0 elim (cnv_fwd_aaa … HW) -HW #B #HW diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubr.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubr.ma index 938c116c5..fe2f3760c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubr.ma @@ -20,6 +20,6 @@ include "basic_2/dynamic/lsubv.ma". (* Forward lemmas with restricted refinement for local environments *********) (* Basic_2A1: uses: lsubsv_fwd_lsubr *) -lemma lsubv_fwd_lsubr (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L1 ⫃ L2. -#a #h #G #L1 #L2 #H elim H -L1 -L2 /2 width=1 by lsubr_bind, lsubr_beta/ +lemma lsubv_fwd_lsubr (h) (a) (G): ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → L1 ⫃ L2. +#h #a #G #L1 #L2 #H elim H -L1 -L2 /2 width=1 by lsubr_bind, lsubr_beta/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubv.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubv.ma index d416b5f40..0108c0163 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubv.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv_lsubv.ma @@ -19,8 +19,8 @@ include "basic_2/dynamic/lsubv_cnv.ma". (* Main properties **********************************************************) (* Note: not valid in Basic_2A1 *) -theorem lsubv_trans (a) (h) (G): Transitive … (lsubv a h G). -#a #h #G #L1 #L #H elim H -L1 -L // +theorem lsubv_trans (h) (a) (G): Transitive … (lsubv h a G). +#h #a #G #L1 #L #H elim H -L1 -L // [ #I #K1 #K #HK1 #IH #Y #H elim (lsubv_inv_bind_sn … H) -H * [ #K2 #HK2 #H destruct /3 width=1 by lsubv_bind/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta.ma index 5b83675b3..c2c939388 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta.ma @@ -13,54 +13,46 @@ (**************************************************************************) include "basic_2/notation/relations/colon_6.ma". -include "basic_2/notation/relations/colon_5.ma". -include "basic_2/notation/relations/colonstar_5.ma". include "basic_2/dynamic/cnv.ma". (* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************) -definition nta (a) (h): relation4 genv lenv term term ≝ - λG,L,T,U. ⦃G,L⦄ ⊢ ⓝU.T ![a,h]. +definition nta (h) (a): relation4 genv lenv term term ≝ + λG,L,T,U. ⦃G,L⦄ ⊢ ⓝU.T ![h,a]. interpretation "native type assignment (term)" - 'Colon a h G L T U = (nta a h G L T U). - -interpretation "restricted native type assignment (term)" - 'Colon h G L T U = (nta true h G L T U). - -interpretation "extended native type assignment (term)" - 'ColonStar h G L T U = (nta false h G L T U). + 'Colon h a G L T U = (nta h a G L T U). (* Basic properties *********************************************************) (* Basic_1: was by definition: ty3_sort *) (* Basic_2A1: was by definition: nta_sort ntaa_sort *) -lemma nta_sort (a) (h) (G) (L) (s): ⦃G,L⦄ ⊢ ⋆s :[a,h] ⋆(next h s). -#a #h #G #L #s /2 width=3 by cnv_sort, cnv_cast, cpms_sort/ +lemma nta_sort (h) (a) (G) (L): ∀s. ⦃G,L⦄ ⊢ ⋆s :[h,a] ⋆(⫯[h]s). +#h #a #G #L #s /2 width=3 by cnv_sort, cnv_cast, cpms_sort/ qed. -lemma nta_bind_cnv (a) (h) (G) (K): - ∀V. ⦃G,K⦄ ⊢ V ![a,h] → - ∀I,T,U. ⦃G,K.ⓑ{I}V⦄ ⊢ T :[a,h] U → - ∀p. ⦃G,K⦄ ⊢ ⓑ{p,I}V.T :[a,h] ⓑ{p,I}V.U. -#a #h #G #K #V #HV #I #T #U #H #p +lemma nta_bind_cnv (h) (a) (G) (K): + ∀V. ⦃G,K⦄ ⊢ V ![h,a] → + ∀I,T,U. ⦃G,K.ⓑ{I}V⦄ ⊢ T :[h,a] U → + ∀p. ⦃G,K⦄ ⊢ ⓑ{p,I}V.T :[h,a] ⓑ{p,I}V.U. +#h #a #G #K #V #HV #I #T #U #H #p elim (cnv_inv_cast … H) -H #X #HU #HT #HUX #HTX /3 width=5 by cnv_bind, cnv_cast, cpms_bind_dx/ qed. (* Basic_2A1: was by definition: nta_cast *) -lemma nta_cast (a) (h) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ⦃G,L⦄ ⊢ ⓝU.T :[a,h] U. -#a #h #G #L #T #U #H +lemma nta_cast (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → ⦃G,L⦄ ⊢ ⓝU.T :[h,a] U. +#h #a #G #L #T #U #H elim (cnv_inv_cast … H) #X #HU #HT #HUX #HTX /3 width=3 by cnv_cast, cpms_eps/ qed. (* Basic_1: was by definition: ty3_cast *) -lemma nta_cast_old (a) (h) (G) (L): - ∀T0,T1. ⦃G,L⦄ ⊢ T0 :[a,h] T1 → - ∀T2. ⦃G,L⦄ ⊢ T1 :[a,h] T2 → ⦃G,L⦄ ⊢ ⓝT1.T0 :[a,h] ⓝT2.T1. -#a #h #G #L #T0 #T1 #H1 #T2 #H2 +lemma nta_cast_old (h) (a) (G) (L): + ∀T0,T1. ⦃G,L⦄ ⊢ T0 :[h,a] T1 → + ∀T2. ⦃G,L⦄ ⊢ T1 :[h,a] T2 → ⦃G,L⦄ ⊢ ⓝT1.T0 :[h,a] ⓝT2.T1. +#h #a #G #L #T0 #T1 #H1 #T2 #H2 elim (cnv_inv_cast … H1) #X1 #_ #_ #HTX1 #HTX01 elim (cnv_inv_cast … H2) #X2 #_ #_ #HTX2 #HTX12 /3 width=3 by cnv_cast, cpms_eps/ @@ -68,25 +60,25 @@ qed. (* Basic inversion lemmas ***************************************************) -lemma nta_inv_gref_sn (a) (h) (G) (L): - ∀X2,l. ⦃G,L⦄ ⊢ §l :[a,h] X2 → ⊥. -#a #h #G #L #X2 #l #H +lemma nta_inv_gref_sn (h) (a) (G) (L): + ∀X2,l. ⦃G,L⦄ ⊢ §l :[h,a] X2 → ⊥. +#h #a #G #L #X2 #l #H elim (cnv_inv_cast … H) -H #X #_ #H #_ #_ elim (cnv_inv_gref … H) qed-. (* Basic_forward lemmas *****************************************************) -lemma nta_fwd_cnv_sn (a) (h) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ⦃G,L⦄ ⊢ T ![a,h]. -#a #h #G #L #T #U #H +lemma nta_fwd_cnv_sn (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → ⦃G,L⦄ ⊢ T ![h,a]. +#h #a #G #L #T #U #H elim (cnv_inv_cast … H) -H #X #_ #HT #_ #_ // qed-. (* Note: this is nta_fwd_correct_cnv *) -lemma nta_fwd_cnv_dx (a) (h) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ⦃G,L⦄ ⊢ U ![a,h]. -#a #h #G #L #T #U #H +lemma nta_fwd_cnv_dx (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → ⦃G,L⦄ ⊢ U ![h,a]. +#h #a #G #L #T #U #H elim (cnv_inv_cast … H) -H #X #HU #_ #_ #_ // qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_aaa.ma index 0161996dd..2a3eafa28 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_aaa.ma @@ -20,9 +20,9 @@ include "basic_2/dynamic/nta.ma". (* Forward lemmas with atomic arity assignment for terms ********************) (* Note: this means that no type is a universe *) -lemma nta_fwd_aaa (a) (h) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ∃∃A. ⦃G,L⦄ ⊢ T ⁝ A & ⦃G,L⦄ ⊢ U ⁝ A. -#a #h #G #L #T #U #H +lemma nta_fwd_aaa (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → ∃∃A. ⦃G,L⦄ ⊢ T ⁝ A & ⦃G,L⦄ ⊢ U ⁝ A. +#h #a #G #L #T #U #H elim (cnv_fwd_aaa … H) -H #A #H elim (aaa_inv_cast … H) -H #HU #HT /2 width=3 by ex2_intro/ @@ -31,20 +31,20 @@ qed-. (* Advanced inversion lemmas ************************************************) (* Basic_1: uses: ty3_predicative *) -lemma nta_abst_predicative (a) (h) (p) (G) (L): - ∀W,T. ⦃G,L⦄ ⊢ ⓛ{p}W.T :[a,h] W → ⊥. -#a #h #p #G #L #W #T #H +lemma nta_abst_predicative (h) (a) (p) (G) (L): + ∀W,T. ⦃G,L⦄ ⊢ ⓛ{p}W.T :[h,a] W → ⊥. +#h #a #p #G #L #W #T #H elim (nta_fwd_aaa … H) -a -h #X #H #H1W elim (aaa_inv_abst … H) -p #B #A #H2W #_ #H destruct -T lapply (aaa_mono … H1W … H2W) -G -L -W #H elim (discr_apair_xy_x … H) qed-. -(* Basic_2A1: uses: ty3_repellent *) -theorem nta_abst_repellent (a) (h) (p) (G) (K): - ∀W,T,U1. ⦃G,K⦄ ⊢ ⓛ{p}W.T :[a,h] U1 → - ∀U2. ⦃G,K.ⓛW⦄ ⊢ T :[a,h] U2 → ⬆*[1] U1 ≘ U2 → ⊥. -#a #h #p #G #K #W #T #U1 #H1 #U2 #H2 #HU12 +(* Basic_1: uses: ty3_repellent *) +theorem nta_abst_repellent (h) (a) (p) (G) (K): + ∀W,T,U1. ⦃G,K⦄ ⊢ ⓛ{p}W.T :[h,a] U1 → + ∀U2. ⦃G,K.ⓛW⦄ ⊢ T :[h,a] U2 → ⬆*[1] U1 ≘ U2 → ⊥. +#h #a #p #G #K #W #T #U1 #H1 #U2 #H2 #HU12 elim (nta_fwd_aaa … H2) -H2 #A2 #H2T #H2U2 elim (nta_fwd_aaa … H1) -H1 #X1 #H1 #HU1 elim (aaa_inv_abst … H1) -a -h -p #B #A1 #_ #H1T #H destruct diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpcs.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpcs.ma index 100d6317b..4e505925c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpcs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpcs.ma @@ -19,10 +19,10 @@ include "basic_2/dynamic/nta.ma". (* Properties with r-equivalence for terms **********************************) -lemma nta_conv_cnv (a) (h) (G) (L) (T): - ∀U1. ⦃G,L⦄ ⊢ T :[a,h] U1 → - ∀U2. ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 ![a,h] → ⦃G,L⦄ ⊢ T :[a,h] U2. -#a #h #G #L #T #U1 #H1 #U2 #HU12 #HU2 +lemma nta_conv_cnv (h) (a) (G) (L) (T): + ∀U1. ⦃G,L⦄ ⊢ T :[h,a] U1 → + ∀U2. ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 ![h,a] → ⦃G,L⦄ ⊢ T :[h,a] U2. +#h #a #G #L #T #U1 #H1 #U2 #HU12 #HU2 elim (cnv_inv_cast … H1) -H1 #X1 #HU1 #HT #HUX1 #HTX1 lapply (cpcs_cprs_conf … HUX1 … HU12) -U1 #H elim (cpcs_inv_cprs … H) -H #X2 #HX12 #HU12 @@ -31,11 +31,11 @@ qed-. (* Basic_1: was by definition: ty3_conv *) (* Basic_2A1: was by definition: nta_conv ntaa_conv *) -lemma nta_conv (a) (h) (G) (L) (T): - ∀U1. ⦃G,L⦄ ⊢ T :[a,h] U1 → +lemma nta_conv (h) (a) (G) (L) (T): + ∀U1. ⦃G,L⦄ ⊢ T :[h,a] U1 → ∀U2. ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → - ∀W2. ⦃G,L⦄ ⊢ U2 :[a,h] W2 → ⦃G,L⦄ ⊢ T :[a,h] U2. -#a #h #G #L #T #U1 #H1 #U2 #HU12 #W2 #H2 + ∀W2. ⦃G,L⦄ ⊢ U2 :[h,a] W2 → ⦃G,L⦄ ⊢ T :[h,a] U2. +#h #a #G #L #T #U1 #H1 #U2 #HU12 #W2 #H2 /3 width=3 by nta_conv_cnv, nta_fwd_cnv_sn/ qed-. @@ -43,19 +43,19 @@ qed-. (* Basic_1: was: ty3_gen_sort *) (* Basic_2A1: was: nta_inv_sort1 *) -lemma nta_inv_sort_sn (a) (h) (G) (L) (X2): - ∀s. ⦃G,L⦄ ⊢ ⋆s :[a,h] X2 → - ∧∧ ⦃G,L⦄ ⊢ ⋆(next h s) ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![a,h]. -#a #h #G #L #X2 #s #H +lemma nta_inv_sort_sn (h) (a) (G) (L) (X2): + ∀s. ⦃G,L⦄ ⊢ ⋆s :[h,a] X2 → + ∧∧ ⦃G,L⦄ ⊢ ⋆(⫯[h]s) ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,a]. +#h #a #G #L #X2 #s #H elim (cnv_inv_cast … H) -H #X1 #HX2 #_ #HX21 #H lapply (cpms_inv_sort1 … H) -H #H destruct /3 width=1 by cpcs_cprs_sn, conj/ qed-. -lemma nta_inv_ldec_sn_cnv (a) (h) (G) (K) (V): - ∀X2. ⦃G,K.ⓛV⦄ ⊢ #0 :[a,h] X2 → - ∃∃U. ⦃G,K⦄ ⊢ V ![a,h] & ⬆*[1] V ≘ U & ⦃G,K.ⓛV⦄ ⊢ U ⬌*[h] X2 & ⦃G,K.ⓛV⦄ ⊢ X2 ![a,h]. -#a #h #G #Y #X #X2 #H +lemma nta_inv_ldec_sn_cnv (h) (a) (G) (K) (V): + ∀X2. ⦃G,K.ⓛV⦄ ⊢ #0 :[h,a] X2 → + ∃∃U. ⦃G,K⦄ ⊢ V ![h,a] & ⬆*[1] V ≘ U & ⦃G,K.ⓛV⦄ ⊢ U ⬌*[h] X2 & ⦃G,K.ⓛV⦄ ⊢ X2 ![h,a]. +#h #a #G #Y #X #X2 #H elim (cnv_inv_cast … H) -H #X1 #HX2 #H1 #HX21 #H2 elim (cnv_inv_zero … H1) -H1 #Z #K #V #HV #H destruct elim (cpms_inv_ell_sn … H2) -H2 * diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpms.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpms.ma index 8dbb60c79..f45290268 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpms.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpms.ma @@ -13,36 +13,38 @@ (**************************************************************************) include "basic_2/rt_computation/cprs_cprs.ma". -include "basic_2/rt_computation/lprs_cpms.ma". +include "basic_2/dynamic/cnv_aaa.ma". include "basic_2/dynamic/nta.ma". (* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************) (* Properties with advanced rt_computation for terms ************************) -(* Basic_2A1: was by definition nta_appl ntaa_appl *) -lemma nta_appl_abst (a) (h) (p) (G) (K): - ∀V,W. ⦃G,K⦄ ⊢ V :[a,h] W → - ∀T,U. ⦃G,K.ⓛW⦄ ⊢ T :[a,h] U → ⦃G,K⦄ ⊢ ⓐV.ⓛ{p}W.T :[a,h] ⓐV.ⓛ{p}W.U. -#a #h #p #G #K #V #W #H1 #T #U #H2 +(* Basic_2A1: uses by definition nta_appl ntaa_appl *) +lemma nta_appl_abst (h) (a) (p) (G) (L): + ∀n. ad a n → + ∀V,W. ⦃G,L⦄ ⊢ V :[h,a] W → + ∀T,U. ⦃G,L.ⓛW⦄ ⊢ T :[h,a] U → ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.T :[h,a] ⓐV.ⓛ{p}W.U. +#h #a #p #G #L #n #Ha #V #W #H1 #T #U #H2 elim (cnv_inv_cast … H1) -H1 #X1 #HW #HV #HWX1 #HVX1 elim (cnv_inv_cast … H2) -H2 #X2 #HU #HT #HUX2 #HTX2 -/4 width=7 by cnv_bind, cnv_appl, cnv_cast, cpms_appl_dx, cpms_bind_dx/ +/4 width=11 by cnv_appl_ge, cnv_cast, cnv_bind, cpms_appl_dx, cpms_bind_dx/ qed. (* Basic_1: was by definition: ty3_appl *) (* Basic_2A1: was nta_appl_old *) -lemma nta_appl (a) (h) (p) (G) (L): - ∀V,W. ⦃G,L⦄ ⊢ V :[a,h] W → - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] ⓛ{p}W.U → ⦃G,L⦄ ⊢ ⓐV.T :[a,h] ⓐV.ⓛ{p}W.U. -#a #h #p #G #L #V #W #H1 #T #U #H2 +lemma nta_appl (h) (a) (p) (G) (L): + ∀n. 1 ≤ n → ad a n → + ∀V,W. ⦃G,L⦄ ⊢ V :[h,a] W → + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] ⓛ{p}W.U → ⦃G,L⦄ ⊢ ⓐV.T :[h,a] ⓐV.ⓛ{p}W.U. +#h #a #p #G #L #n #Hn #Ha #V #W #H1 #T #U #H2 elim (cnv_inv_cast … H1) -H1 #X1 #HW #HV #HWX1 #HVX1 elim (cnv_inv_cast … H2) -H2 #X2 #HU #HT #HUX2 #HTX2 elim (cpms_inv_abst_sn … HUX2) #W0 #U0 #HW0 #HU0 #H destruct elim (cprs_conf … HWX1 … HW0) -HW0 #X0 #HX10 #HWX0 @(cnv_cast … (ⓐV.ⓛ{p}W0.U0)) (**) (* full auto too slow *) -[ /3 width=7 by cnv_appl, cpms_bind/ -| /4 width=11 by cnv_appl, cpms_cprs_trans, cpms_bind/ +[ /2 width=11 by cnv_appl_ge/ +| /3 width=11 by cnv_appl_ge, cpms_cprs_trans/ | /2 width=1 by cpms_appl_dx/ | /2 width=1 by cpms_appl_dx/ ] @@ -50,14 +52,14 @@ qed. (* Inversion lemmas with advanced rt_computation for terms ******************) -lemma nta_inv_abst_bi_cnv (a) (h) (p) (G) (K) (W): - ∀T,U. ⦃G,K⦄ ⊢ ⓛ{p}W.T :[a,h] ⓛ{p}W.U → - ∧∧ ⦃G,K⦄ ⊢ W ![a,h] & ⦃G,K.ⓛW⦄ ⊢ T :[a,h] U. -#a #h #p #G #K #W #T #U #H +lemma nta_inv_abst_bi_cnv (h) (a) (p) (G) (K) (W): + ∀T,U. ⦃G,K⦄ ⊢ ⓛ{p}W.T :[h,a] ⓛ{p}W.U → + ∧∧ ⦃G,K⦄ ⊢ W ![h,a] & ⦃G,K.ⓛW⦄ ⊢ T :[h,a] U. +#h #a #p #G #K #W #T #U #H elim (cnv_inv_cast … H) -H #X #HWU #HWT #HUX #HTX elim (cnv_inv_bind … HWU) -HWU #HW #HU elim (cnv_inv_bind … HWT) -HWT #_ #HT elim (cpms_inv_abst_sn … HUX) -HUX #W0 #X0 #_ #HUX0 #H destruct -elim (cpms_inv_abst_bi … HTX) -HTX #_ #HTX0 -W0 +elim (cpms_inv_abst_bi … HTX) -HTX #_ #_ #HTX0 -W0 /3 width=3 by cnv_cast, conj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_drops.ma index b65c1bdc8..29cce8c0c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_drops.ma @@ -19,10 +19,10 @@ include "basic_2/dynamic/nta.ma". (* Advanced properties ******************************************************) -lemma nta_ldef (a) (h) (G) (K): - ∀V,W. ⦃G,K⦄ ⊢ V :[a,h] W → - ∀U. ⬆*[1] W ≘ U → ⦃G,K.ⓓV⦄ ⊢ #0 :[a,h] U. -#a #h #G #K #V #W #H #U #HWU +lemma nta_ldef (h) (a) (G) (K): + ∀V,W. ⦃G,K⦄ ⊢ V :[h,a] W → + ∀U. ⬆*[1] W ≘ U → ⦃G,K.ⓓV⦄ ⊢ #0 :[h,a] U. +#h #a #G #K #V #W #H #U #HWU elim (cnv_inv_cast … H) -H #X #HW #HV #HWX #HVX lapply (cnv_lifts … HW (Ⓣ) … (K.ⓓV) … HWU) -HW [ /3 width=3 by drops_refl, drops_drop/ ] #HU @@ -31,18 +31,18 @@ elim (cpms_lifts_sn … HWX … (Ⓣ) … (K.ⓓV) … HWU) -W /3 width=5 by cnv_zero, cnv_cast, cpms_delta/ qed. -lemma nta_ldec_cnv (a) (h) (G) (K): - ∀W. ⦃G,K⦄ ⊢ W ![a,h] → - ∀U. ⬆*[1] W ≘ U → ⦃G,K.ⓛW⦄ ⊢ #0 :[a,h] U. -#a #h #G #K #W #HW #U #HWU +lemma nta_ldec_cnv (h) (a) (G) (K): + ∀W. ⦃G,K⦄ ⊢ W ![h,a] → + ∀U. ⬆*[1] W ≘ U → ⦃G,K.ⓛW⦄ ⊢ #0 :[h,a] U. +#h #a #G #K #W #HW #U #HWU lapply (cnv_lifts … HW (Ⓣ) … (K.ⓛW) … HWU) /3 width=5 by cnv_zero, cnv_cast, cpms_ell, drops_refl, drops_drop/ qed. -lemma nta_lref (a) (h) (I) (G) (K): - ∀T,i. ⦃G,K⦄ ⊢ #i :[a,h] T → - ∀U. ⬆*[1] T ≘ U → ⦃G,K.ⓘ{I}⦄ ⊢ #(↑i) :[a,h] U. -#a #h #I #G #K #T #i #H #U #HTU +lemma nta_lref (h) (a) (I) (G) (K): + ∀T,i. ⦃G,K⦄ ⊢ #i :[h,a] T → + ∀U. ⬆*[1] T ≘ U → ⦃G,K.ⓘ{I}⦄ ⊢ #(↑i) :[h,a] U. +#h #a #I #G #K #T #i #H #U #HTU elim (cnv_inv_cast … H) -H #X #HT #Hi #HTX #H2 lapply (cnv_lifts … HT (Ⓣ) … (K.ⓘ{I}) … HTU) -HT [ /3 width=3 by drops_refl, drops_drop/ ] #HU @@ -55,8 +55,8 @@ qed. (* Properties with generic slicing for local environments *******************) -lemma nta_lifts_sn (a) (h) (G): d_liftable2_sn … lifts (nta a h G). -#a #h #G #K #T1 #T2 #H #b #f #L #HLK #U1 #HTU1 +lemma nta_lifts_sn (h) (a) (G): d_liftable2_sn … lifts (nta a h G). +#h #a #G #K #T1 #T2 #H #b #f #L #HLK #U1 #HTU1 elim (cnv_inv_cast … H) -H #X #HT2 #HT1 #HT2X #HT1X elim (lifts_total T2 f) #U2 #HTU2 lapply (cnv_lifts … HT2 … HLK … HTU2) -HT2 #HU2 @@ -69,23 +69,23 @@ qed-. (* Basic_1: was: ty3_lift *) (* Basic_2A1: was: nta_lift ntaa_lift *) -lemma nta_lifts_bi (a) (h) (G): d_liftable2_bi … lifts (nta a h G). +lemma nta_lifts_bi (h) (a) (G): d_liftable2_bi … lifts (nta a h G). /3 width=12 by nta_lifts_sn, d_liftable2_sn_bi, lifts_mono/ qed-. (* Basic_1: was by definition: ty3_abbr *) (* Basic_2A1: was by definition: nta_ldef ntaa_ldef *) -lemma nta_ldef_drops (a) (h) (G) (K) (L) (i): - ∀V,W. ⦃G,K⦄ ⊢ V :[a,h] W → - ∀U. ⬆*[↑i] W ≘ U → ⬇*[i] L ≘ K.ⓓV → ⦃G,L⦄ ⊢ #i :[a,h] U. -#a #h #G #K #L #i #V #W #HVW #U #HWU #HLK +lemma nta_ldef_drops (h) (a) (G) (K) (L) (i): + ∀V,W. ⦃G,K⦄ ⊢ V :[h,a] W → + ∀U. ⬆*[↑i] W ≘ U → ⬇*[i] L ≘ K.ⓓV → ⦃G,L⦄ ⊢ #i :[h,a] U. +#h #a #G #K #L #i #V #W #HVW #U #HWU #HLK elim (lifts_split_trans … HWU (𝐔❴1❵) (𝐔❴i❵)) [| // ] #X #HWX #HXU /3 width=9 by nta_lifts_bi, nta_ldef/ qed. -lemma nta_ldec_drops_cnv (a) (h) (G) (K) (L) (i): - ∀W. ⦃G,K⦄ ⊢ W ![a,h] → - ∀U. ⬆*[↑i] W ≘ U → ⬇*[i] L ≘ K.ⓛW → ⦃G,L⦄ ⊢ #i :[a,h] U. -#a #h #G #K #L #i #W #HW #U #HWU #HLK +lemma nta_ldec_drops_cnv (h) (a) (G) (K) (L) (i): + ∀W. ⦃G,K⦄ ⊢ W ![h,a] → + ∀U. ⬆*[↑i] W ≘ U → ⬇*[i] L ≘ K.ⓛW → ⦃G,L⦄ ⊢ #i :[h,a] U. +#h #a #G #K #L #i #W #HW #U #HWU #HLK elim (lifts_split_trans … HWU (𝐔❴1❵) (𝐔❴i❵)) [| // ] #X #HWX #HXU /3 width=9 by nta_lifts_bi, nta_ldec_cnv/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_eval.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_eval.ma new file mode 100644 index 000000000..3a8971fd8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_eval.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 "basic_2/dynamic/cnv_eval.ma". +include "basic_2/dynamic/nta_preserve.ma". + +(* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************) + +(* Properties with evaluations for rt-transition on terms *******************) + +lemma nta_typecheck_dec (h) (a) (G) (L): ac_props a → + ∀T,U. Decidable … (⦃G,L⦄ ⊢ T :[h,a] U). +/2 width=1 by cnv_dec/ qed-. + +(* Basic_1: uses: ty3_inference *) +lemma nta_inference_dec (h) (a) (G) (L) (T): ac_props a → + Decidable (∃U. ⦃G,L⦄ ⊢ T :[h,a] U). +#h #a #G #L #T #Ha +elim (cnv_dec h … G L T Ha) -Ha #HT +[ /3 width=1 by cnv_nta_sn, or_introl/ +| @or_intror * #U #HTU + /3 width=2 by nta_fwd_cnv_sn/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_fsb.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_fsb.ma index b96b1cfd5..5aea50a66 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_fsb.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_fsb.ma @@ -23,10 +23,10 @@ include "basic_2/dynamic/nta.ma". (* Note: this might use fsb_inv_cast (still to be proved) *) (* Basic_1: uses: ty3_sn3 *) (* Basic_2A1: uses: nta_fwd_csn *) -theorem nta_fwd_fsb (a) (h) (o) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → - ∧∧ ≥[h,o] 𝐒⦃G,L,T⦄ & ≥[h,o] 𝐒⦃G,L,U⦄. -#a #h #o #G #L #T #U #H +theorem nta_fwd_fsb (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → + ∧∧ ≥[h] 𝐒⦃G,L,T⦄ & ≥[h] 𝐒⦃G,L,U⦄. +#h #a #G #L #T #U #H elim (cnv_inv_cast … H) #X #HU #HT #_ #_ -X /3 width=2 by cnv_fwd_fsb, conj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_ind.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_ind.ma index 4f9b52385..03ed818b1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_ind.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_ind.ma @@ -22,31 +22,31 @@ include "basic_2/dynamic/nta_preserve.ma". (* Advanced eliminators *****************************************************) lemma nta_ind_rest_cnv (h) (Q:relation4 …): - (∀G,L,s. Q G L (⋆s) (⋆(next h s))) → + (∀G,L,s. Q G L (⋆s) (⋆(⫯[h]s))) → (∀G,K,V,W,U. - ⦃G,K⦄ ⊢ V :[h] W → ⬆*[1] W ≘ U → + ⦃G,K⦄ ⊢ V :[h,𝟐] W → ⬆*[1] W ≘ U → Q G K V W → Q G (K.ⓓV) (#0) U ) → - (∀G,K,W,U. ⦃G,K⦄ ⊢ W ![h] → ⬆*[1] W ≘ U → Q G (K.ⓛW) (#0) U) → + (∀G,K,W,U. ⦃G,K⦄ ⊢ W ![h,𝟐] → ⬆*[1] W ≘ U → Q G (K.ⓛW) (#0) U) → (∀I,G,K,W,U,i. - ⦃G,K⦄ ⊢ #i :[h] W → ⬆*[1] W ≘ U → + ⦃G,K⦄ ⊢ #i :[h,𝟐] W → ⬆*[1] W ≘ U → Q G K (#i) W → Q G (K.ⓘ{I}) (#↑i) U ) → (∀p,I,G,K,V,T,U. - ⦃G,K⦄ ⊢ V ![h] → ⦃G,K.ⓑ{I}V⦄ ⊢ T :[h] U → + ⦃G,K⦄ ⊢ V ![h,𝟐] → ⦃G,K.ⓑ{I}V⦄ ⊢ T :[h,𝟐] U → Q G (K.ⓑ{I}V) T U → Q G K (ⓑ{p,I}V.T) (ⓑ{p,I}V.U) ) → (∀p,G,L,V,W,T,U. - ⦃G,L⦄ ⊢ V :[h] W → ⦃G,L⦄ ⊢ T :[h] ⓛ{p}W.U → + ⦃G,L⦄ ⊢ V :[h,𝟐] W → ⦃G,L⦄ ⊢ T :[h,𝟐] ⓛ{p}W.U → Q G L V W → Q G L T (ⓛ{p}W.U) → Q G L (ⓐV.T) (ⓐV.ⓛ{p}W.U) ) → - (∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h] U → Q G L T U → Q G L (ⓝU.T) U + (∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h,𝟐] U → Q G L T U → Q G L (ⓝU.T) U ) → (∀G,L,T,U1,U2. - ⦃G,L⦄ ⊢ T :[h] U1 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 ![h] → + ⦃G,L⦄ ⊢ T :[h,𝟐] U1 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 ![h,𝟐] → Q G L T U1 → Q G L T U2 ) → - ∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h] U → Q G L T U. + ∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h,𝟐] U → Q G L T U. #h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #G #L #T @(fqup_wf_ind_eq (Ⓣ) … G L T) -G -L -T #G0 #L0 #T0 #IH #G #L * * [|||| * ] [ #s #HG #HL #HT #X #H destruct -IH @@ -79,35 +79,35 @@ lemma nta_ind_rest_cnv (h) (Q:relation4 …): qed-. lemma nta_ind_ext_cnv_mixed (h) (Q:relation4 …): - (∀G,L,s. Q G L (⋆s) (⋆(next h s))) → + (∀G,L,s. Q G L (⋆s) (⋆(⫯[h]s))) → (∀G,K,V,W,U. - ⦃G,K⦄ ⊢ V :*[h] W → ⬆*[1] W ≘ U → + ⦃G,K⦄ ⊢ V :[h,𝛚] W → ⬆*[1] W ≘ U → Q G K V W → Q G (K.ⓓV) (#0) U ) → - (∀G,K,W,U. ⦃G,K⦄ ⊢ W !*[h] → ⬆*[1] W ≘ U → Q G (K.ⓛW) (#0) U) → + (∀G,K,W,U. ⦃G,K⦄ ⊢ W ![h,𝛚] → ⬆*[1] W ≘ U → Q G (K.ⓛW) (#0) U) → (∀I,G,K,W,U,i. - ⦃G,K⦄ ⊢ #i :*[h] W → ⬆*[1] W ≘ U → + ⦃G,K⦄ ⊢ #i :[h,𝛚] W → ⬆*[1] W ≘ U → Q G K (#i) W → Q G (K.ⓘ{I}) (#↑i) U ) → (∀p,I,G,K,V,T,U. - ⦃G,K⦄ ⊢ V !*[h] → ⦃G,K.ⓑ{I}V⦄ ⊢ T :*[h] U → + ⦃G,K⦄ ⊢ V ![h,𝛚] → ⦃G,K.ⓑ{I}V⦄ ⊢ T :[h,𝛚] U → Q G (K.ⓑ{I}V) T U → Q G K (ⓑ{p,I}V.T) (ⓑ{p,I}V.U) ) → (∀p,G,L,V,W,T,U. - ⦃G,L⦄ ⊢ V :*[h] W → ⦃G,L⦄ ⊢ T :*[h] ⓛ{p}W.U → + ⦃G,L⦄ ⊢ V :[h,𝛚] W → ⦃G,L⦄ ⊢ T :[h,𝛚] ⓛ{p}W.U → Q G L V W → Q G L T (ⓛ{p}W.U) → Q G L (ⓐV.T) (ⓐV.ⓛ{p}W.U) ) → (∀G,L,V,T,U. - ⦃G,L⦄ ⊢ T :*[h] U → ⦃G,L⦄ ⊢ ⓐV.U !*[h] → + ⦃G,L⦄ ⊢ T :[h,𝛚] U → ⦃G,L⦄ ⊢ ⓐV.U ![h,𝛚] → Q G L T U → Q G L (ⓐV.T) (ⓐV.U) ) → - (∀G,L,T,U. ⦃G,L⦄ ⊢ T :*[h] U → Q G L T U → Q G L (ⓝU.T) U + (∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h,𝛚] U → Q G L T U → Q G L (ⓝU.T) U ) → (∀G,L,T,U1,U2. - ⦃G,L⦄ ⊢ T :*[h] U1 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 !*[h] → + ⦃G,L⦄ ⊢ T :[h,𝛚] U1 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 ![h,𝛚] → Q G L T U1 → Q G L T U2 ) → - ∀G,L,T,U. ⦃G,L⦄ ⊢ T :*[h] U → Q G L T U. + ∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h,𝛚] U → Q G L T U. #h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #G #L #T @(fqup_wf_ind_eq (Ⓣ) … G L T) -G -L -T #G0 #L0 #T0 #IH #G #L * * [|||| * ] [ #s #HG #HL #HT #X #H destruct -IH @@ -144,35 +144,35 @@ lemma nta_ind_ext_cnv_mixed (h) (Q:relation4 …): qed-. lemma nta_ind_ext_cnv (h) (Q:relation4 …): - (∀G,L,s. Q G L (⋆s) (⋆(next h s))) → + (∀G,L,s. Q G L (⋆s) (⋆(⫯[h]s))) → (∀G,K,V,W,U. - ⦃G,K⦄ ⊢ V :*[h] W → ⬆*[1] W ≘ U → + ⦃G,K⦄ ⊢ V :[h,𝛚] W → ⬆*[1] W ≘ U → Q G K V W → Q G (K.ⓓV) (#0) U ) → - (∀G,K,W,U. ⦃G,K⦄ ⊢ W !*[h] → ⬆*[1] W ≘ U → Q G (K.ⓛW) (#0) U) → + (∀G,K,W,U. ⦃G,K⦄ ⊢ W ![h,𝛚] → ⬆*[1] W ≘ U → Q G (K.ⓛW) (#0) U) → (∀I,G,K,W,U,i. - ⦃G,K⦄ ⊢ #i :*[h] W → ⬆*[1] W ≘ U → + ⦃G,K⦄ ⊢ #i :[h,𝛚] W → ⬆*[1] W ≘ U → Q G K (#i) W → Q G (K.ⓘ{I}) (#↑i) U ) → (∀p,I,G,K,V,T,U. - ⦃G,K⦄ ⊢ V !*[h] → ⦃G,K.ⓑ{I}V⦄ ⊢ T :*[h] U → + ⦃G,K⦄ ⊢ V ![h,𝛚] → ⦃G,K.ⓑ{I}V⦄ ⊢ T :[h,𝛚] U → Q G (K.ⓑ{I}V) T U → Q G K (ⓑ{p,I}V.T) (ⓑ{p,I}V.U) ) → (∀p,G,K,V,W,T,U. - ⦃G,K⦄ ⊢ V :*[h] W → ⦃G,K.ⓛW⦄ ⊢ T :*[h] U → + ⦃G,K⦄ ⊢ V :[h,𝛚] W → ⦃G,K.ⓛW⦄ ⊢ T :[h,𝛚] U → Q G K V W → Q G (K.ⓛW) T U → Q G K (ⓐV.ⓛ{p}W.T) (ⓐV.ⓛ{p}W.U) ) → (∀G,L,V,T,U. - ⦃G,L⦄ ⊢ T :*[h] U → ⦃G,L⦄ ⊢ ⓐV.U !*[h] → + ⦃G,L⦄ ⊢ T :[h,𝛚] U → ⦃G,L⦄ ⊢ ⓐV.U ![h,𝛚] → Q G L T U → Q G L (ⓐV.T) (ⓐV.U) ) → - (∀G,L,T,U. ⦃G,L⦄ ⊢ T :*[h] U → Q G L T U → Q G L (ⓝU.T) U + (∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h,𝛚] U → Q G L T U → Q G L (ⓝU.T) U ) → (∀G,L,T,U1,U2. - ⦃G,L⦄ ⊢ T :*[h] U1 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 !*[h] → + ⦃G,L⦄ ⊢ T :[h,𝛚] U1 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 ![h,𝛚] → Q G L T U1 → Q G L T U2 ) → - ∀G,L,T,U. ⦃G,L⦄ ⊢ T :*[h] U → Q G L T U. + ∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h,𝛚] U → Q G L T U. #h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #G #L #T #U #H @(nta_ind_ext_cnv_mixed … IH1 IH2 IH3 IH4 IH5 … IH7 IH8 IH9 … H) -G -L -T -U -IH1 -IH2 -IH3 -IH4 -IH5 -IH6 -IH8 -IH9 #p #G #L #V #W #T #U #HVW #HTU #_ #IHTU diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_preserve.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_preserve.ma index 8d69b3ca2..de01c6a0d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_preserve.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_preserve.ma @@ -13,96 +13,95 @@ (**************************************************************************) include "basic_2/rt_equivalence/cpcs_cpcs.ma". -include "basic_2/dynamic/cnv_cpcs.ma". +include "basic_2/dynamic/cnv_preserve_cpcs.ma". include "basic_2/dynamic/nta.ma". (* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************) (* Properties based on preservation *****************************************) -lemma cnv_cpms_nta (a) (h) (G) (L): - ∀T. ⦃G,L⦄ ⊢ T ![a,h] → ∀U.⦃G,L⦄ ⊢ T ➡*[1,h] U → ⦃G,L⦄ ⊢ T :[a,h] U. +lemma cnv_cpms_nta (h) (a) (G) (L): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∀U.⦃G,L⦄ ⊢ T ➡*[1,h] U → ⦃G,L⦄ ⊢ T :[h,a] U. /3 width=4 by cnv_cast, cnv_cpms_trans/ qed. -lemma cnv_nta_sn (a) (h) (G) (L): - ∀T. ⦃G,L⦄ ⊢ T ![a,h] → ∃U. ⦃G,L⦄ ⊢ T :[a,h] U. -#a #h #G #L #T #HT +lemma cnv_nta_sn (h) (a) (G) (L): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∃U. ⦃G,L⦄ ⊢ T :[h,a] U. +#h #a #G #L #T #HT elim (cnv_fwd_cpm_SO … HT) #U #HTU /4 width=2 by cnv_cpms_nta, cpm_cpms, ex_intro/ qed-. (* Basic_1: was: ty3_typecheck *) -lemma nta_typecheck (a) (h) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ∃T0. ⦃G,L⦄ ⊢ ⓝU.T :[a,h] T0. +lemma nta_typecheck (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → ∃T0. ⦃G,L⦄ ⊢ ⓝU.T :[h,a] T0. /3 width=1 by cnv_cast, cnv_nta_sn/ qed-. (* Basic_1: was: ty3_correct *) (* Basic_2A1: was: ntaa_fwd_correct *) -lemma nta_fwd_correct (a) (h) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ∃T0. ⦃G,L⦄ ⊢ U :[a,h] T0. +lemma nta_fwd_correct (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → ∃T0. ⦃G,L⦄ ⊢ U :[h,a] T0. /3 width=2 by nta_fwd_cnv_dx, cnv_nta_sn/ qed-. lemma nta_pure_cnv (h) (G) (L): - ∀T,U. ⦃G,L⦄ ⊢ T :*[h] U → - ∀V. ⦃G,L⦄ ⊢ ⓐV.U !*[h] → ⦃G,L⦄ ⊢ ⓐV.T :*[h] ⓐV.U. + ∀T,U. ⦃G,L⦄ ⊢ T :[h,𝛚] U → + ∀V. ⦃G,L⦄ ⊢ ⓐV.U ![h,𝛚] → ⦃G,L⦄ ⊢ ⓐV.T :[h,𝛚] ⓐV.U. #h #G #L #T #U #H1 #V #H2 elim (cnv_inv_cast … H1) -H1 #X0 #HU #HT #HUX0 #HTX0 elim (cnv_inv_appl … H2) #n #p #X1 #X2 #_ #HV #_ #HVX1 #HUX2 elim (cnv_cpms_conf … HU … HUX0 … HUX2) -HU -HUX2 (cpr_inv_sort1 … H) // -qed. - lemma cnr_lref_free: ∀G,L,i. |L| ≤ i → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄. #G #L #i #Hi #X #H elim (cpr_inv_lref1 … H) -H // * #K #V1 #V2 #HLK lapply (drop_fwd_length_lt2 … HLK) -HLK #H elim (lt_refl_false i) /2 width=3 by lt_to_le_to_lt/ qed. - -(* Basic_1: was only: nf2_csort_lref *) -lemma cnr_lref_atom: ∀G,L,i. ⬇[i] L ≡ ⋆ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄. -#G #L #i #HL @cnr_lref_free >(drop_fwd_length … HL) -HL // -qed. - -(* Basic_1: was: nf2_abst *) -lemma cnr_abst: ∀a,G,L,W,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃W⦄ → ⦃G, L.ⓛW⦄ ⊢ ➡ 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓛ{a}W.T⦄. -#a #G #L #W #T #HW #HT #X #H -elim (cpr_inv_abst1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct ->(HW … HW0) -W0 >(HT … HT0) -T0 // -qed. - -(* Basic_1: was only: nf2_appl_lref *) -lemma cnr_appl_simple: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃V⦄ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓐV.T⦄. -#G #L #V #T #HV #HT #HS #X #H -elim (cpr_inv_appl1_simple … H) -H // #V0 #T0 #HV0 #HT0 #H destruct ->(HV … HV0) -V0 >(HT … HT0) -T0 // -qed. - -(* Basic_1: was: nf2_dec *) -axiom cnr_dec: ∀G,L,T1. ⦃G, L⦄ ⊢ ➡ 𝐍⦃T1⦄ ∨ - ∃∃T2. ⦃G, L⦄ ⊢ T1 ➡ T2 & (T1 = T2 → ⊥). - -(* Basic_1: removed theorems 1: nf2_abst_shift *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cnr/cnr_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cnr/cnr_lift.etc deleted file mode 100644 index eef9aefc8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cnr/cnr_lift.etc +++ /dev/null @@ -1,49 +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 "basic_2/reduction/cpr_lift.ma". -include "basic_2/reduction/cnr.ma". - -(* NORMAL TERMS FOR CONTEXT-SENSITIVE REDUCTION *****************************) - -(* Advanced properties ******************************************************) - -(* Basic_1: was: nf2_lref_abst *) -lemma cnr_lref_abst: ∀G,L,K,V,i. ⬇[i] L ≡ K. ⓛV → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄. -#G #L #K #V #i #HLK #X #H -elim (cpr_inv_lref1 … H) -H // * -#K0 #V1 #V2 #HLK0 #_ #_ -lapply (drop_mono … HLK … HLK0) -L #H destruct -qed. - -(* Relocation properties ****************************************************) - -(* Basic_1: was: nf2_lift *) -lemma cnr_lift: ∀G,L0,L,T,T0,c,l,k. ⦃G, L⦄ ⊢ ➡ 𝐍⦃T⦄ → - ⬇[c, l, k] L0 ≡ L → ⬆[l, k] T ≡ T0 → ⦃G, L0⦄ ⊢ ➡ 𝐍⦃T0⦄. -#G #L0 #L #T #T0 #c #l #k #HLT #HL0 #HT0 #X #H -elim (cpr_inv_lift1 … H … HL0 … HT0) -L0 #T1 #HT10 #HT1 -<(HLT … HT1) in HT0; -L #HT0 ->(lift_mono … HT10 … HT0) -T1 -X // -qed. - -(* Note: this was missing in basic_1 *) -lemma cnr_inv_lift: ∀G,L0,L,T,T0,c,l,k. ⦃G, L0⦄ ⊢ ➡ 𝐍⦃T0⦄ → - ⬇[c, l, k] L0 ≡ L → ⬆[l, k] T ≡ T0 → ⦃G, L⦄ ⊢ ➡ 𝐍⦃T⦄. -#G #L0 #L #T #T0 #c #l #k #HLT0 #HL0 #HT0 #X #H -elim (lift_total X l k) #X0 #HX0 -lapply (cpr_lift … H … HL0 … HT0 … HX0) -L #HTX0 ->(HLT0 … HTX0) in HX0; -L0 -X0 #H ->(lift_inj … H … HT0) -T0 -X -c -l -k // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cnr/prednormal_3.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cnr/prednormal_3.etc deleted file mode 100644 index a8806a1c7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cnr/prednormal_3.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ ➡ 𝐍 break ⦃ term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'PRedNormal $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/cpre.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/cpre.etc deleted file mode 100644 index d94fb6fba..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/cpre.etc +++ /dev/null @@ -1,35 +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 "basic_2/notation/relations/predeval_4.ma". -include "basic_2/computation/cprs.ma". -include "basic_2/computation/csx.ma". - -(* EVALUATION FOR CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS *************) - -definition cpre: relation4 genv lenv term term ≝ - λG,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡* T2 ∧ ⦃G, L⦄ ⊢ ➡ 𝐍⦃T2⦄. - -interpretation "evaluation for context-sensitive parallel reduction (term)" - 'PRedEval G L T1 T2 = (cpre G L T1 T2). - -(* Basic properties *********************************************************) - -(* Basic_1: was just: nf2_sn3 *) -lemma csx_cpre: ∀h,o,G,L,T1. ⦃G, L⦄ ⊢ ⬊*[h, o] T1 → ∃T2. ⦃G, L⦄ ⊢ T1 ➡* 𝐍⦃T2⦄. -#h #o #G #L #T1 #H @(csx_ind … H) -T1 -#T1 #_ #IHT1 elim (cnr_dec G L T1) /3 width=3 by ex_intro, conj/ -* #T #H1T1 #H2T1 elim (IHT1 … H2T1) -IHT1 -H2T1 /2 width=2 by cpr_cpx/ -#T2 * /4 width=3 by cprs_strap2, ex_intro, conj/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/cpre_cpre.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/cpre_cpre.etc deleted file mode 100644 index 4fd418119..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/cpre_cpre.etc +++ /dev/null @@ -1,28 +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 "basic_2/computation/cprs_cprs.ma". -include "basic_2/computation/cpre.ma". - -(* EVALUATION FOR CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS *************) - -(* Main properties *********************************************************) - -(* Basic_1: was: nf2_pr3_confluence *) -theorem cpre_mono: ∀G,L,T,T1. ⦃G, L⦄ ⊢ T ➡* 𝐍⦃T1⦄ → ∀T2. ⦃G, L⦄ ⊢ T ➡* 𝐍⦃T2⦄ → T1 = T2. -#G #L #T #T1 * #H1T1 #H2T1 #T2 * #H1T2 #H2T2 -elim (cprs_conf … H1T1 … H1T2) -T #T #HT1 ->(cprs_inv_cnr1 … HT1 H2T1) -T1 #HT2 ->(cprs_inv_cnr1 … HT2 H2T2) -T2 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/predeval_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/predeval_4.etc deleted file mode 100644 index abf7b6558..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpre/predeval_4.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ➡ * 𝐍 ⦃ break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'PRedEval $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cprs/cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cprs/cprs.etc index a51dba5d6..b20ba8ff8 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cprs/cprs.etc +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cprs/cprs.etc @@ -1,10 +1,3 @@ (* Basic_1: was: pr3_pr1 *) lemma tprs_cprs: ∀G,L,T1,T2. ⦃G, ⋆⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ T1 ➡* T2. /2 width=3 by lsubr_cprs_trans/ qed. - -(* Basic_1: was: nf2_pr3_unfold *) -lemma cprs_inv_cnr1: ∀G,L,T,U. ⦃G, L⦄ ⊢ T ➡* U → ⦃G, L⦄ ⊢ ➡ 𝐍⦃T⦄ → T = U. -#G #L #T #U #H @(cprs_ind_dx … H) -T // -#T0 #T #H1T0 #_ #IHT #H2T0 -lapply (H2T0 … H1T0) -H1T0 #H destruct /2 width=1 by/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu.etc new file mode 100644 index 000000000..19b1eaf8c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu.etc @@ -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 "basic_2/notation/relations/preditnormal_4.ma". +include "static_2/syntax/tueq.ma". +include "basic_2/rt_transition/cpm.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************) + +definition cnu (h) (G) (L): predicate term ≝ + λT1. ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≅ T2. + +interpretation + "normality for t-unbound context-sensitive parallel rt-transition (term)" + 'PRedITNormal h G L T = (cnu h G L T). + +(* Basic properties *********************************************************) + +lemma cnu_sort (h) (G) (L): ∀s. ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃⋆s⦄. +#h #G #L #s1 #n #X #H +elim (cpm_inv_sort1 … H) -H #H #_ destruct // +qed. + +lemma cnu_ctop (h) (G): ∀i. ⦃G,⋆⦄ ⊢ ⥲[h] 𝐍⦃#i⦄. +#h #G * [| #i ] #n #X #H +[ elim (cpm_inv_zero1 … H) -H * + [ #H #_ destruct // + | #Y #X1 #X2 #_ #_ #H destruct + | #m #Y #X1 #X2 #_ #_ #H destruct + ] +| elim (cpm_inv_lref1 … H) -H * + [ #H #_ destruct // + | #Z #Y #X0 #_ #_ #H destruct + ] +] +qed. + +lemma cnu_zero (h) (G) (L): ∀I. ⦃G,L.ⓤ{I}⦄ ⊢ ⥲[h] 𝐍⦃#0⦄. +#h #G #L #I #n #X #H +elim (cpm_inv_zero1 … H) -H * +[ #H #_ destruct // +| #Y #X1 #X2 #_ #_ #H destruct +| #m #Y #X1 #X2 #_ #_ #H destruct +] +qed. + +lemma cnu_gref (h) (G) (L): ∀l. ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃§l⦄. +#h #G #L #l1 #n #X #H +elim (cpm_inv_gref1 … H) -H #H #_ destruct // +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnr.etc new file mode 100644 index 000000000..ce295d3ed --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnr.etc @@ -0,0 +1,37 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_transition/cnr.ma". +include "basic_2/rt_transition/cnu.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************) + +(* Advanced properties with normal terms for r-transition *******************) + +lemma cnu_abst (h) (p) (G) (L): + ∀W. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃W⦄ → ∀T.⦃G,L.ⓛW⦄ ⊢ ⥲[h] 𝐍⦃T⦄ → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃ⓛ{p}W.T⦄. +#h #p #G #L #W1 #HW1 #T1 #HT1 #n #X #H +elim (cpm_inv_abst1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct +<(HW1 … HW12) -W2 /3 width=2 by tueq_bind/ +qed. + +lemma cnu_abbr_neg (h) (G) (L): + ∀V. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ → ∀T.⦃G,L.ⓓV⦄ ⊢ ⥲[h] 𝐍⦃T⦄ → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃-ⓓV.T⦄. +#h #G #L #V1 #HV1 #T1 #HT1 #n #X #H +elim (cpm_inv_abbr1 … H) -H * +[ #V2 #T2 #HV12 #HT12 #H destruct + <(HV1 … HV12) -V2 /3 width=2 by tueq_bind/ +| #X1 #_ #_ #H destruct +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnr_simple.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnr_simple.etc new file mode 100644 index 000000000..056c8e250 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnr_simple.etc @@ -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 "basic_2/rt_transition/cpm_simple.ma". +include "basic_2/rt_transition/cnr.ma". +include "basic_2/rt_transition/cnu.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************) + +(* Advanced properties with simple terms and normal terms for r-transition **) + +lemma cnu_appl_simple (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T⦄ → 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃ⓐV.T⦄. +#h #G #L #V1 #T1 #HV1 #HT1 #HS #n #X #H +elim (cpm_inv_appl1_simple … H HS) -H -HS #V2 #T2 #HV12 #HT12 #H destruct +lapply (HV1 … HV12) -HV1 -HV12 #H destruct +/3 width=2 by tueq_appl/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnu.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnu.etc new file mode 100644 index 000000000..2bc4d3c2d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_cnu.etc @@ -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 "static_2/syntax/tueq_tueq.ma". +include "basic_2/rt_transition/cpm_tueq.ma". +include "basic_2/rt_transition/cnu.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************) + +(* Advanced properties ******************************************************) + +lemma cnu_tueq_trans (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T1⦄ → ∀T2.T1 ≅ T2 → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T2⦄. +#h #G #L #T1 #HT1 #T2 #HT12 #n #T0 #HT20 +@(tueq_canc_sn … HT12) +elim (tueq_cpm_trans … HT12 … HT20) -T2 #T2 #HT13 #HT30 +/3 width=3 by tueq_trans/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_drops.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_drops.etc new file mode 100644 index 000000000..97e13d22a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_drops.etc @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/relocation/lifts_tueq.ma". +include "basic_2/rt_transition/cpm_drops.ma". +include "basic_2/rt_transition/cnu.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************) + +(* Advanced properties ******************************************************) + +lemma cnu_atom_drops (h) (b) (G) (L): + ∀i. ⬇*[b,𝐔❴i❵] L ≘ ⋆ → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃#i⦄. +#h #b #G #L #i #Hi #n #X #H +elim (cpm_inv_lref1_drops … H) -H * [ // || #m ] #K #V1 #V2 #HLK +lapply (drops_gen b … HLK) -HLK #HLK +lapply (drops_mono … Hi … HLK) -L #H destruct +qed. + +lemma cnu_unit_drops (h) (I) (G) (L): + ∀K,i. ⬇*[i] L ≘ K.ⓤ{I} → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃#i⦄. +#h #I #G #L #K #i #HLK #n #X #H +elim (cpm_inv_lref1_drops … H) -H * [ // || #m ] #Y #V1 #V2 #HLY +lapply (drops_mono … HLK … HLY) -L #H destruct +qed. + +(* Properties with generic relocation ***************************************) + +lemma cnu_lifts (h) (G): d_liftable1 … (cnu h G). +#h #G #K #T #HT #b #f #L #HLK #U #HTU #n #U0 #H +elim (cpm_inv_lifts_sn … H … HLK … HTU) -b -L #T0 #HTU0 #HT0 +lapply (HT … HT0) -G -K /2 width=6 by tueq_lifts_bi/ +qed-. + +(* Inversion lemmas with generic relocation *********************************) + +lemma cnu_inv_lifts (h) (G): d_deliftable1 … (cnu h G). +#h #G #L #U #HU #b #f #K #HLK #T #HTU #n #T0 #H +elim (cpm_lifts_sn … H … HLK … HTU) -b -K #U0 #HTU0 #HU0 +lapply (HU … HU0) -G -L /2 width=6 by tueq_inv_lifts_bi/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_lifts.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_lifts.etc new file mode 100644 index 000000000..051da519a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_lifts.etc @@ -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 "static_2/relocation/lifts_tueq.ma". +include "basic_2/rt_transition/cnu.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************) + +(* Advanced properties with uniform relocation for terms ********************) + +lemma cnu_lref (h) (I) (G) (L): + ∀i. ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃#i⦄ → ⦃G,L.ⓘ{I}⦄ ⊢ ⥲[h] 𝐍⦃#↑i⦄. +#h #I #G #L #i #Hi #n #X #H +elim (cpm_inv_lref1 … H) -H * +[ #H #_ destruct // +| #J #K #V #HV #HVX #H destruct + lapply (Hi … HV) -Hi -HV #HV + elim (tueq_lifts_dx … HV … HVX) -V #Xi #Hi #HX + lapply (lifts_inv_lref1_uni … Hi) -Hi #H destruct // +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_tdeq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_tdeq.etc new file mode 100644 index 000000000..f6eb1a805 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnu_tdeq.etc @@ -0,0 +1,98 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_transition/cnr_tdeq.ma". +include "basic_2/rt_transition/cnu_drops.ma". +include "basic_2/rt_transition/cnu_cnr.ma". +include "basic_2/rt_transition/cnu_cnr_simple.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************) + +(* Properties with context-free sort-irrelevant equivalence for terms *******) + +lemma cnu_dec_tdeq (h) (G) (L): + ∀T1. ∨∨ ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T1⦄ + | ∃∃n,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 & (T1 ≛ T2 → ⊥). +#h #G #L #T1 +@(fqup_wf_ind_eq (Ⓣ) … G L T1) -G -L -T1 #G0 #L0 #T0 #IH #G #L * * +[ #s #HG #HL #HT destruct -IH + /3 width=5 by cnu_sort, or_introl/ +| #i #HG #HL #HT destruct -IH + elim (drops_F_uni L i) + [ /3 width=7 by cnu_atom_drops, or_introl/ + | * * [ #I | * #V ] #K #HLK + [ /3 width=8 by cnu_unit_drops, or_introl/ + | elim (lifts_total V 𝐔❴↑i❵) #W #HVW + @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpm_delta_drops/ ] #H + lapply (tdeq_inv_lref1 … H) -H #H destruct + /2 width=5 by lifts_inv_lref2_uni_lt/ + | elim (lifts_total V 𝐔❴↑i❵) #W #HVW + @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpm_ell_drops/ ] #H + lapply (tdeq_inv_lref1 … H) -H #H destruct + /2 width=5 by lifts_inv_lref2_uni_lt/ + ] + ] +| #l #HG #HL #HT destruct -IH + /3 width=5 by cnu_gref, or_introl/ +| #p * [ cases p ] #V1 #T1 #HG #HL #HT destruct + [ elim (cpr_subst h G (L.ⓓV1) T1 0 L V1) [| /2 width=1 by drops_refl/ ] #T2 #X2 #HT12 #HXT2 -IH + elim (tdeq_dec T1 T2) [ -HT12 #HT12 | #HnT12 ] + [ elim (tdeq_inv_lifts_dx … HT12 … HXT2) -T2 #X1 #HXT1 #_ -X2 + @or_intror @(ex2_2_intro … X1) [1,2: /2 width=4 by cpm_zeta/ ] #H + /2 width=7 by tdeq_lifts_inv_pair_sn/ + | @or_intror @(ex2_2_intro … (+ⓓV1.T2)) [1,2: /2 width=2 by cpm_bind/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + | elim (cnr_dec_tdeq h G L V1) [ elim (IH G (L.ⓓV1) T1) [| * | // ] | * ] -IH + [ #HT1 #HV1 /3 width=7 by cnu_abbr_neg, or_introl/ + | #n #T2 #HT12 #HnT12 #_ + @or_intror @(ex2_2_intro … (-ⓓV1.T2)) [1,2: /2 width=2 by cpm_bind/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + | #V2 #HV12 #HnV12 + @or_intror @(ex2_2_intro … (-ⓓV2.T1)) [1,2: /2 width=2 by cpr_pair_sn/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + | elim (cnr_dec_tdeq h G L V1) [ elim (IH G (L.ⓛV1) T1) [| * | // ] | * ] -IH + [ #HT1 #HV1 /3 width=7 by cnu_abst, or_introl/ + | #n #T2 #HT12 #HnT12 #_ + @or_intror @(ex2_2_intro … (ⓛ{p}V1.T2)) [1,2: /2 width=2 by cpm_bind/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + | #V2 #HV12 #HnV12 + @or_intror @(ex2_2_intro … (ⓛ{p}V2.T1)) [1,2: /2 width=2 by cpr_pair_sn/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + ] +| * #V1 #T1 #HG #HL #HT destruct [| -IH ] + [ elim (cnr_dec_tdeq h G L V1) [ elim (IH G L T1) [| * | // ] | * ] -IH + [ #HT1 #HV1 + elim (simple_dec_ex T1) [| * #p * #W1 #U1 #H destruct ] + [ /3 width=7 by cnu_appl_simple, or_introl/ + | elim (lifts_total V1 𝐔❴1❵) #X1 #HVX1 + @or_intror @(ex2_2_intro … (ⓓ{p}W1.ⓐX1.U1)) [1,2: /2 width=3 by cpm_theta/ ] #H + elim (tdeq_inv_pair … H) -H #H destruct + | @or_intror @(ex2_2_intro … (ⓓ{p}ⓝW1.V1.U1)) [1,2: /2 width=2 by cpm_beta/ ] #H + elim (tdeq_inv_pair … H) -H #H destruct + ] + | #n #T2 #HT12 #HnT12 #_ + @or_intror @(ex2_2_intro … (ⓐV1.T2)) [1,2: /2 width=2 by cpm_appl/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + | #V2 #HV12 #HnV12 + @or_intror @(ex2_2_intro … (ⓐV2.T1)) [1,2: /2 width=2 by cpr_pair_sn/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + | @or_intror @(ex2_2_intro … T1) [1,2: /2 width=2 by cpm_eps/ ] #H + /2 width=4 by tdeq_inv_pair_xy_y/ + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnv_cpmue.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnv_cpmue.etc new file mode 100644 index 000000000..99c8606f6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnv_cpmue.etc @@ -0,0 +1,46 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/cpms_cnu.ma". +include "basic_2/rt_computation/cpmue.ma". +include "basic_2/dynamic/cnv_preserve.ma". + +(* T-UNBOUND EVALUATION FOR T-BOUND RT-TRANSITION ON TERMS ******************) + +(* Properties with evaluation for t-unbound rt-transition on terms **********) + +lemma cnv_cpmue_trans (a) (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![a,h] → + ∀T2,n. ⦃G,L⦄ ⊢ T1 ➡*[h,n] 𝐍*⦃T2⦄ → ⦃G,L⦄ ⊢ T2 ![a,h]. +/3 width=4 by cpmue_fwd_cpms, cnv_cpms_trans/ qed-. + +lemma cnv_cpmue_cpms_conf (a) (h) (G) (L): + ∀T0. ⦃G,L⦄ ⊢ T0 ![a,h] → ∀T1,n1. ⦃G,L⦄ ⊢ T0 ➡*[n1,h] T1 → + ∀T2,n2. ⦃G,L⦄ ⊢ T0 ➡*[h,n2] 𝐍*⦃T2⦄ → + ∃∃T. ⦃G,L⦄ ⊢ T1 ➡*[h,n2-n1] 𝐍*⦃T⦄ & T2 ≅ T. +#a #h #G #L #T0 #HT0 #T1 #n1 #HT01 #T2 #n2 * #HT02 #HT2 +elim (cnv_cpms_conf … HT0 … HT01 … HT02) -T0 #T0 #HT10 #HT20 +lapply (cpms_inv_cnu_sn … HT20 HT2) -HT20 #HT20 +/4 width=8 by cpmue_intro, cnu_tueq_trans, ex2_intro/ +qed-. + +(* Main properties with evaluation for t-unbound rt-transition on terms *****) + +theorem cnv_cpmue_mono (a) (h) (G) (L): + ∀T0. ⦃G,L⦄ ⊢ T0 ![a,h] → ∀T1,n1. ⦃G,L⦄ ⊢ T0 ➡*[h,n1] 𝐍*⦃T1⦄ → + ∀T2,n2. ⦃G,L⦄ ⊢ T0 ➡*[h,n2] 𝐍*⦃T2⦄ → T1 ≅ T2. +#a #h #G #L #T0 #HT0 #T1 #n1 * #HT01 #HT1 #T2 #n2 * #HT02 #HT2 +elim (cnv_cpms_conf … HT0 … HT01 … HT02) -T0 #T0 #HT10 #HT20 +/3 width=8 by cpms_inv_cnu_sn, tueq_canc_dx/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnv_cpue.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnv_cpue.etc new file mode 100644 index 000000000..a84fd5cd2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cnv_cpue.etc @@ -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 "basic_2/rt_computation/cpms_cnu.ma". +include "basic_2/rt_computation/cpue.ma". +include "basic_2/dynamic/cnv_preserve.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* Properties with evaluation for t-unbound rt-transition on terms **********) + +lemma cnv_cpue_trans (a) (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ![a,h] → + ∀T2. ⦃G,L⦄ ⊢ T1 ⥲*[h] 𝐍⦃T2⦄ → ⦃G,L⦄ ⊢ T2 ![a,h]. +#a #h #G #L #T1 #HT1 #T2 * #n #HT12 #_ +/2 width=4 by cnv_cpms_trans/ +qed-. + +lemma cnv_cpue_cpms_conf (a) (h) (n) (G) (L): + ∀T0. ⦃G,L⦄ ⊢ T0 ![a,h] → ∀T1. ⦃G,L⦄ ⊢ T0 ➡*[n,h] T1 → + ∀T2. ⦃G,L⦄ ⊢ T0 ⥲*[h] 𝐍⦃T2⦄ → + ∃∃T. ⦃G,L⦄ ⊢ T1 ⥲*[h] 𝐍⦃T⦄ & T2 ≅ T. +#a #h #n1 #G #L #T0 #HT0 #T1 #HT01 #T2 * #n2 #HT02 #HT2 +elim (cnv_cpms_conf … HT0 … HT01 … HT02) -T0 #T0 #HT10 #HT20 +lapply (cpms_inv_cnu_sn … HT20 HT2) -HT20 #HT20 +/4 width=8 by cnu_tueq_trans, ex2_intro/ +qed-. + +(* Main properties with evaluation for t-unbound rt-transition on terms *****) + +theorem cnv_cpue_mono (a) (h) (G) (L): + ∀T0. ⦃G,L⦄ ⊢ T0 ![a,h] → ∀T1. ⦃G,L⦄ ⊢ T0 ⥲*[h] 𝐍⦃T1⦄ → + ∀T2. ⦃G,L⦄ ⊢ T0 ⥲*[h] 𝐍⦃T2⦄ → T1 ≅ T2. +#a #h #G #L #T0 #HT0 #T1 * #n1 #HT01 #HT1 #T2 * #n2 #HT02 #HT2 +elim (cnv_cpms_conf … HT0 … HT01 … HT02) -T0 #T0 #HT10 #HT20 +/3 width=8 by cpms_inv_cnu_sn, tueq_canc_dx/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpm_tueq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpm_tueq.etc new file mode 100644 index 000000000..2baeeefae --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpm_tueq.etc @@ -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 "static_2/relocation/lifts_tueq.ma". +include "basic_2/rt_transition/cpm.ma". + +(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************) + +(* Properties with tail sort-irrelevant equivalence on terms ****************) + +lemma cpm_tueq_conf (h) (n) (G) (L) (T0): + ∀T1. ⦃G,L⦄ ⊢ T0 ➡[n,h] T1 → ∀T2. T0 ≅ T2 → + ∃∃T. ⦃G,L⦄ ⊢ T2 ➡[n,h] T & T1 ≅ T. +#h #n #G #L #T0 #T1 #H @(cpm_ind … H) -G -L -T0 -T1 -n +[ /2 width=3 by ex2_intro/ +| #G #L #s0 #X2 #H2 + elim (tueq_inv_sort1 … H2) -H2 #s2 #H destruct + /3 width=3 by tueq_sort, ex2_intro/ +| #n #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #X2 #H2 + >(tueq_inv_lref1 … H2) -X2 + elim (IH V0) [| // ] -IH #V #HV0 #HV1 + elim (tueq_lifts_sn … HV1 … HVW1) -V1 + /3 width=3 by cpm_delta, ex2_intro/ +| #n #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #X2 #H2 + >(tueq_inv_lref1 … H2) -X2 + elim (IH V0) [| // ] -IH #V #HV0 #HV1 + elim (tueq_lifts_sn … HV1 … HVW1) -V1 + /3 width=3 by cpm_ell, ex2_intro/ +| #n #I #G #K0 #V1 #W1 #i #_ #IH #HVW1 #X2 #H2 + >(tueq_inv_lref1 … H2) -X2 + elim (IH (#i)) [| // ] -IH #V #HV0 #HV1 + elim (tueq_lifts_sn … HV1 … HVW1) -V1 + /3 width=3 by cpm_lref, ex2_intro/ +| #n #p #I #G #L #V0 #V1 #T0 #T1 #HV01 #_ #_ #IHT #X2 #H2 + elim (tueq_inv_bind1 … H2) -H2 #T2 #HT02 #H destruct + elim (IHT … HT02) -T0 #T #HT2 #HT1 + /3 width=3 by cpm_bind, tueq_bind, ex2_intro/ +| #n #G #L #V0 #V1 #T0 #T1 #HV10 #_ #_ #IHT #X2 #H2 + elim (tueq_inv_appl1 … H2) -H2 #T2 #HT02 #H destruct + elim (IHT … HT02) -T0 #T #HT2 #HT1 + /3 width=3 by cpm_appl, tueq_appl, ex2_intro/ +| #n #G #L #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #H2 + elim (tueq_inv_cast1 … H2) -H2 #V2 #T2 #HV02 #HT02 #H destruct + elim (IHV … HV02) -V0 #V #HV2 #HV1 + elim (IHT … HT02) -T0 #T #HT2 #HT1 + /3 width=5 by cpm_cast, tueq_cast, ex2_intro/ +| #n #G #L #V0 #U0 #T0 #T1 #HTU0 #_ #IH #X2 #H2 + elim (tueq_inv_bind1 … H2) -H2 #U2 #HU02 #H destruct + elim (tueq_inv_lifts_sn … HU02 … HTU0) -U0 #T2 #HTU2 #HT02 + elim (IH … HT02) -T0 #T #HT2 #HT1 + /3 width=3 by cpm_zeta, ex2_intro/ +| #n #G #L #V0 #T0 #T1 #_ #IH #X2 #H2 + elim (tueq_inv_cast1 … H2) -H2 #V2 #T2 #_ #HT02 #H destruct + elim (IH … HT02) -V0 -T0 + /3 width=3 by cpm_eps, ex2_intro/ +| #n #G #L #V0 #T0 #T1 #_ #IH #X2 #H2 + elim (tueq_inv_cast1 … H2) -H2 #V2 #T2 #HV02 #_ #H destruct + elim (IH … HV02) -V0 -T1 + /3 width=3 by cpm_ee, ex2_intro/ +| #n #p #G #L #V0 #V1 #W0 #W1 #T0 #T1 #HV01 #HW01 #_ #_ #_ #IHT #X2 #H2 + elim (tueq_inv_appl1 … H2) -H2 #X #H2 #H destruct + elim (tueq_inv_bind1 … H2) -H2 #T2 #HT02 #H destruct + elim (IHT … HT02) -T0 + /4 width=3 by cpm_beta, tueq_cast, tueq_bind, ex2_intro/ +| #n #p #G #L #V0 #V1 #U1 #W0 #W1 #T0 #T1 #HV01 #HW01 #_ #_ #_ #IHT #HVU1 #X2 #H2 + elim (tueq_inv_appl1 … H2) -H2 #X #H2 #H destruct + elim (tueq_inv_bind1 … H2) -H2 #T2 #HT02 #H destruct + elim (IHT … HT02) -T0 #T #HT2 #HT1 + /4 width=3 by cpm_theta, tueq_appl, tueq_bind, ex2_intro/ +] +qed-. + +lemma tueq_cpm_trans (h) (n) (G) (L) (T0): + ∀T1. T1 ≅ T0 → ∀T2. ⦃G,L⦄ ⊢ T0 ➡[n,h] T2 → + ∃∃T. ⦃G,L⦄ ⊢ T1 ➡[n,h] T & T ≅ T2. +#h #n #G #L #T0 #T1 #HT10 #T2 #HT02 +elim (cpm_tueq_conf … HT02 T1) +/3 width=3 by tueq_sym, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpms_cnu.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpms_cnu.etc new file mode 100644 index 000000000..5e7790683 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpms_cnu.etc @@ -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 "basic_2/rt_transition/cnu_cnu.ma". +include "basic_2/rt_computation/cpms.ma". + +(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) + +(* Inversion lemmas with normal terms for t-unbound rt-transition ***********) + +lemma cpms_inv_cnu_sn (h) (n) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T1⦄ → T1 ≅ T2. +#h #n #G #L #T1 #T2 #H @(cpms_ind_sn … H) -T1 // +#n1 #n2 #T1 #T0 #HT10 #_ #IH #HT1 +/5 width=8 by cnu_tueq_trans, tueq_trans/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpmue.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpmue.etc new file mode 100644 index 000000000..1132c8ee5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpmue.etc @@ -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 "basic_2/notation/relations/predevalstar_6.ma". +include "basic_2/rt_transition/cnu.ma". +include "basic_2/rt_computation/cpms.ma". + +(* T-UNBOUND EVALUATION FOR T-BOUND RT-TRANSITION ON TERMS ******************) + +definition cpmue (h) (n) (G) (L): relation2 term term ≝ + λT1,T2. ∧∧ ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 & ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T2⦄. + +interpretation "t-unbound evaluation for t-bound context-sensitive parallel rt-transition (term)" + 'PRedEvalStar h n G L T1 T2 = (cpmue h n G L T1 T2). + +definition R_cpmue (h) (G) (L) (T): predicate nat ≝ + λn. ∃U. ⦃G,L⦄ ⊢ T ➡*[h,n] 𝐍*⦃U⦄. + +(* Basic properties *********************************************************) + +lemma cpmue_intro (h) (n) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T2⦄ → ⦃G,L⦄ ⊢ T1 ➡*[h,n] 𝐍*⦃T2⦄. +/2 width=1 by conj/ qed. + +(* Basic forward lemmas *****************************************************) + +lemma cpmue_fwd_cpms (h) (n) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[h,n] 𝐍*⦃T2⦄ → ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2. +#h #n #G #L #T1 #T2 * #HT12 #_ // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpmue_csx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpmue_csx.etc new file mode 100644 index 000000000..7ad451c1b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpmue_csx.etc @@ -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 "basic_2/rt_transition/cpm_cpx.ma". +include "basic_2/rt_transition/cnu_tdeq.ma". +include "basic_2/rt_computation/csx.ma". +include "basic_2/rt_computation/cpmue.ma". + +(* T-UNBOUND EVALUATION FOR T-BOUND RT-TRANSITION ON TERMS ******************) + +(* Properties with strong normalization for unbound rt-transition for terms *) + +lemma cpmue_total_csx (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ∃∃T2,n. ⦃G,L⦄ ⊢ T1 ➡*[h,n] 𝐍*⦃T2⦄. +#h #G #L #T1 #H +@(csx_ind … H) -T1 #T1 #_ #IHT1 +elim (cnu_dec_tdeq h G L T1) +[ -IHT1 #HT1 /3 width=4 by cpmue_intro, ex1_2_intro/ +| * #n1 #T0 #HT10 #HnT10 + elim (IHT1 … HnT10) -IHT1 -HnT10 [| /2 width=2 by cpm_fwd_cpx/ ] + #T2 #n2 * #HT02 #HT2 /4 width=5 by cpms_step_sn, cpmue_intro, ex1_2_intro/ +] +qed-. + +lemma R_cpmue_total_csx (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ∃n. R_cpmue h G L T1 n. +#h #G #L #T1 #H +elim (cpmue_total_csx … H) -H #T2 #n #HT12 +/3 width=3 by ex_intro (* 2x *)/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpue.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpue.etc new file mode 100644 index 000000000..a22002aed --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpue.etc @@ -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 "basic_2/notation/relations/prediteval_5.ma". +include "basic_2/rt_transition/cnu.ma". +include "basic_2/rt_computation/cpms.ma". + +(* EVALUATION FOR T-UNBOUND RT-TRANSITION ON TERMS **************************) + +definition cpue (h) (G) (L): relation2 term term ≝ + λT1,T2. ∃∃n. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 & ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T2⦄. + +interpretation "evaluation for t-unbound context-sensitive parallel rt-transition (term)" + 'PRedITEval h G L T1 T2 = (cpue h G L T1 T2). diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpue_csx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpue_csx.etc new file mode 100644 index 000000000..2ba2ddb02 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/cpue_csx.etc @@ -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 "basic_2/rt_transition/cpm_cpx.ma". +include "basic_2/rt_transition/cnu_tdeq.ma". +include "basic_2/rt_computation/csx.ma". +include "basic_2/rt_computation/cpue.ma". + +(* EVALUATION FOR T-UNBOUND RT-TRANSITION ON TERMS **************************) + +(* Properties with strong normalization for unbound rt-transition for terms *) + +lemma cpue_total_csx (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ∃T2. ⦃G,L⦄ ⊢ T1 ⥲*[h] 𝐍⦃T2⦄. +#h #G #L #T1 #H +@(csx_ind … H) -T1 #T1 #_ #IHT1 +elim (cnu_dec_tdeq h G L T1) [ /3 width=4 by ex2_intro, ex_intro/ ] * +#n1 #T0 #HT10 #HnT10 +elim (IHT1 … HnT10) -IHT1 -HnT10 [| /2 width=2 by cpm_fwd_cpx/ ] +#T2 * #n2 #HT02 #HT2 /4 width=7 by cpms_step_sn, ex2_intro, ex_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/prediteval_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/prediteval_5.etc new file mode 100644 index 000000000..b87e86381 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/cpue/prediteval_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ⥲* [ break term 46 h ] 𝐍 ⦃ break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'PRedITEval $h $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta.etc index 166fd2105..9d0831b47 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta.etc +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta.etc @@ -20,6 +20,9 @@ lemma nta_inv_lref_sn_drops (* Basic_1: uses: ty3_gen_abst_abst *) lemma nta_inv_abst_bi +(* Basic_1: uses: pc3_dec *) +lemma nta_cpcs_dec + (* Advanced properties ******************************************************) | ntaa_cast: ∀L,T,U,W. ntaa h L T U → ntaa h L U W → ntaa h L (ⓝU. T) U diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_1a.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_1a.etc new file mode 100644 index 000000000..e0ee809ff --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_1a.etc @@ -0,0 +1,37 @@ +(* FROM BASIC_1 + +(* NOTE: This can be generalized removing the last premise *) + Lemma ty3_gen_cvoid: (g:?; c:?; t1,t2:?) (ty3 g c t1 t2) -> + (e:?; u:?; d:?) (getl d c (CHead e (Bind Void) u)) -> + (a:?) (drop (1) d c a) -> + (EX y1 y2 | t1 = (lift (1) d y1) & + t2 = (lift (1) d y2) & + (ty3 g a y1 y2) + ). + +Lemma ty3_gen_appl_nf2: (g:?; c:?; w,v,x:?) (ty3 g c (THead (Flat Appl) w v) x) -> + (EX u t | (pc3 c (THead (Flat Appl) w (THead (Bind Abst) u t)) x) & + (ty3 g c v (THead (Bind Abst) u t)) & + (ty3 g c w u) & + (nf2 c (THead (Bind Abst) u t)) + ). + +Lemma ty3_arity: (g:?; c:?; t1,t2:?) (ty3 g c t1 t2) -> + (EX a1 | (arity g c t1 a1) & + (arity g c t2 (asucc g a1)) + ). + +Lemma ty3_acyclic: (g:?; c:?; t,u:?) + (ty3 g c t u) -> (pc3 c u t) -> (P:Prop) P. + +Theorem pc3_abst_dec: (g:?; c:?; u1,t1:?) (ty3 g c u1 t1) -> + (u2,t2:?) (ty3 g c u2 t2) -> + (EX u v2 | (pc3 c u1 (THead (Bind Abst) u2 u)) & + (ty3 g c (THead (Bind Abst) v2 u) t1) & + (pr3 c u2 v2) & (nf2 c v2) + ) \/ + ((u:?) (pc3 c u1 (THead (Bind Abst) u2 u)) -> False). + +file ty3_nf2_gen + +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/rdsx_csx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/rdsx_csx.etc new file mode 100644 index 000000000..cae721528 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/rdsx_csx.etc @@ -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 "basic_2/rt_computation/csx_lsubr.ma". +include "basic_2/rt_computation/csx_cpxs.ma". +include "basic_2/rt_computation/sdsx_rdsx.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Advanced properties ******************************************************) + +lemma rdsx_pair_lpxs (h) (I) (G): + ∀K1,V1. G ⊢ ⬈*[h,V1] 𝐒⦃K1⦄ → + ∀V2. ⦃G,K1⦄ ⊢ ⬈*[h] 𝐒⦃V2⦄ → + (∀K. ⦃G,K1⦄ ⊢ ⬈*[h] K → ⦃G,K⦄ ⊢ V1 ⬈*[h] V2) → + G ⊢ ⬈*[h,#0] 𝐒⦃K1.ⓑ{I}V2⦄. +#h #I #G #K1 #V1 #H +@(rdsx_ind_lpxs … H) -K1 #K1 #_ #IHK #V2 #H +@(csx_ind_cpxs … H) -V2 #V2 #HV2 #IHV #HK +@rdsx_intro_lpxs #Y #HY #HnY +elim (lpxs_inv_pair_sn … HY) -HY #K3 #V3 #HK13 #HV23 #H destruct +elim (tdeq_dec V2 V3) +[ -IHV -HV23 #HV23 + @(rdsx_rdeq_trans … (K3.ⓑ{I}V2)) [| /2 width=1 by rdeq_pair_refl/ ] + @(IHK … HK13) -IHK + [ + | + | /3 width=3 by lpxs_trans/ + ] +| -IHK -HnY #HnV23 + @(rdsx_lpxs_trans … (K1.ⓑ{I}V3)) [| /2 width=1 by lpxs_bind_refl_dx/ ] + @(IHV … HV23 HnV23) -IHV -HnV23 + #K #HK diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/dpconvstar_8.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/dpconvstar_8.etc deleted file mode 100644 index f0210a6b8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/dpconvstar_8.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 • * ⬌ * [ break term 46 h, break term 46 o, break term 46 n1, break term 46 n2 ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'DPConvStar $h $o $n1 $n2 $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes.etc deleted file mode 100644 index 657763483..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes.etc +++ /dev/null @@ -1,37 +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 "basic_2/notation/relations/dpconvstar_8.ma". -include "basic_2/computation/scpds.ma". - -(* STRATIFIED DECOMPOSED PARALLEL EQUIVALENCE FOR TERMS *********************) - -definition scpes: ∀h. sd h → nat → nat → relation4 genv lenv term term ≝ - λh,o,d1,d2,G,L,T1,T2. - ∃∃T. ⦃G, L⦄ ⊢ T1 •*➡*[h, o, d1] T & ⦃G, L⦄ ⊢ T2 •*➡*[h, o, d2] T. - -interpretation "stratified decomposed parallel equivalence (term)" - 'DPConvStar h o d1 d2 G L T1 T2 = (scpes h o d1 d2 G L T1 T2). - -(* Basic properties *********************************************************) - -lemma scpds_div: ∀h,o,G,L,T1,T2,T,d1,d2. - ⦃G, L⦄ ⊢ T1 •*➡*[h, o, d1] T → ⦃G, L⦄ ⊢ T2 •*➡*[h, o, d2] T → - ⦃G, L⦄ ⊢ T1 •*⬌*[h, o, d1, d2] T2. -/2 width=3 by ex2_intro/ qed. - -lemma scpes_sym: ∀h,o,G,L,T1,T2,d1,d2. ⦃G, L⦄ ⊢ T1 •*⬌*[h, o, d1, d2] T2 → - ⦃G, L⦄ ⊢ T2 •*⬌*[h, o, d2, d1] T1. -#h #o #G #L #T1 #T2 #L1 #d2 * /2 width=3 by scpds_div/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes_aaa.etc deleted file mode 100644 index f42ebdbc9..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes_aaa.etc +++ /dev/null @@ -1,29 +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 "basic_2/computation/scpds_aaa.ma". -include "basic_2/equivalence/scpes.ma". - -(* DECOMPOSED EXTENDED PARALLEL EQUIVALENCE FOR TERMS ***********************) - -(* Main inversion lemmas about atomic arity assignment on terms *************) - -theorem scpes_aaa_mono: ∀h,o,G,L,T1,T2,d1,d2. ⦃G, L⦄ ⊢ T1 •*⬌*[h, o, d1, d2] T2 → - ∀A1. ⦃G, L⦄ ⊢ T1 ⁝ A1 → ∀A2. ⦃G, L⦄ ⊢ T2 ⁝ A2 → - A1 = A2. -#h #o #G #L #T1 #T2 #d1 #d2 * #T #HT1 #HT2 #A1 #HA1 #A2 #HA2 -lapply (scpds_aaa_conf … HA1 … HT1) -T1 #HA1 -lapply (scpds_aaa_conf … HA2 … HT2) -T2 #HA2 -lapply (aaa_mono … HA1 … HA2) -L -T // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes_scpes.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes_scpes.etc index 24ea20ec0..6ed660a42 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes_scpes.etc +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/scpes/scpes_scpes.etc @@ -28,13 +28,6 @@ qed-. (* Advanced properties ******************************************************) -lemma scpes_refl: ∀h,o,G,L,T,d1,d2. d2 ≤ d1 → ⦃G, L⦄ ⊢ T ▪[h, o] d1 → - ⦃G, L⦄ ⊢ T •*⬌*[h, o, d2, d2] T. -#h #o #G #L #T #d1 #d2 #Hd21 #Hd1 -elim (da_lstas … Hd1 … d2) #U #HTU #_ -/3 width=3 by scpds_div, lstas_scpds/ -qed. - lemma lstas_scpes_trans: ∀h,o,G,L,T1,d0,d1. ⦃G, L⦄ ⊢ T1 ▪[h, o] d0 → d1 ≤ d0 → ∀T. ⦃G, L⦄ ⊢ T1 •*[h, d1] T → ∀T2,d,d2. ⦃G, L⦄ ⊢ T •*⬌*[h,o,d,d2] T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h,o,d1+d,d2] T2. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sdsx/sdsx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sdsx/sdsx.etc new file mode 100644 index 000000000..c721bee8f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/sdsx/sdsx.etc @@ -0,0 +1,145 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/rdsx.ma". + +(* STRONGLY NORMALIZING SELECTED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Basic_2A1: uses: lcosx *) +inductive sdsx (h) (G): rtmap → predicate lenv ≝ +| sdsx_atom: ∀f. sdsx h G f (⋆) +| sdsx_push: ∀f,I,K. sdsx h G f K → sdsx h G (⫯f) (K.ⓘ{I}) +| sdsx_unit: ∀f,I,K. sdsx h G f K → sdsx h G (↑f) (K.ⓤ{I}) +| sdsx_pair: ∀f,I,K,V. G ⊢ ⬈*[h,V] 𝐒⦃K⦄ → + sdsx h G f K → sdsx h G (↑f) (K.ⓑ{I}V) +. + +interpretation + "strong normalization for unbound context-sensitive parallel rt-transition on selected entries (local environment)" + 'PRedTySNStrong h f G L = (sdsx h G f L). + +(* Basic inversion lemmas ***************************************************) + +fact sdsx_inv_push_aux (h) (G): + ∀g,L. G ⊢ ⬈*[h,g] 𝐒⦃L⦄ → + ∀f,I,K. g = ⫯f → L = K.ⓘ{I} → G ⊢ ⬈*[h,f] 𝐒⦃K⦄. +#h #G #g #L * -g -L +[ #f #g #J #L #_ #H destruct +| #f #I #K #HK #g #J #L #H1 #H2 destruct // +| #f #I #K #_ #g #J #L #H #_ + elim (discr_next_push … H) +| #f #I #K #V #_ #_ #g #J #L #H #_ + elim (discr_next_push … H) +] +qed-. + +lemma sdsx_inv_push (h) (G): + ∀f,I,K. G ⊢ ⬈*[h,⫯f] 𝐒⦃K.ⓘ{I}⦄ → G ⊢ ⬈*[h,f] 𝐒⦃K⦄. +/2 width=6 by sdsx_inv_push_aux/ qed-. + +fact sdsx_inv_unit_aux (h) (G): + ∀g,L. G ⊢ ⬈*[h,g] 𝐒⦃L⦄ → + ∀f,I,K. g = ↑f → L = K.ⓤ{I} → G ⊢ ⬈*[h,f] 𝐒⦃K⦄. +#h #G #g #L * -g -L +[ #f #g #J #L #_ #H destruct +| #f #I #K #_ #g #J #L #H #_ + elim (discr_push_next … H) +| #f #I #K #HK #g #J #L #H1 #H2 destruct // +| #f #I #K #V #_ #_ #g #J #L #_ #H destruct +] +qed-. + +lemma sdsx_inv_unit (h) (G): + ∀f,I,K. G ⊢ ⬈*[h,↑f] 𝐒⦃K.ⓤ{I}⦄ → G ⊢ ⬈*[h,f] 𝐒⦃K⦄. +/2 width=6 by sdsx_inv_unit_aux/ qed-. + +fact sdsx_inv_pair_aux (h) (G): + ∀g,L. G ⊢ ⬈*[h,g] 𝐒⦃L⦄ → + ∀f,I,K,V. g = ↑f → L = K.ⓑ{I}V → + ∧∧ G ⊢ ⬈*[h,V] 𝐒⦃K⦄ & G ⊢ ⬈*[h,f] 𝐒⦃K⦄. +#h #G #g #L * -g -L +[ #f #g #J #L #W #_ #H destruct +| #f #I #K #_ #g #J #L #W #H #_ + elim (discr_push_next … H) +| #f #I #K #_ #g #J #L #W #_ #H destruct +| #f #I #K #V #HV #HK #g #J #L #W #H1 #H2 destruct + /2 width=1 by conj/ +] +qed-. + +(* Basic_2A1: uses: lcosx_inv_pair *) +lemma sdsx_inv_pair (h) (G): + ∀f,I,K,V. G ⊢ ⬈*[h,↑f] 𝐒⦃K.ⓑ{I}V⦄ → + ∧∧ G ⊢ ⬈*[h,V] 𝐒⦃K⦄ & G ⊢ ⬈*[h,f] 𝐒⦃K⦄. +/2 width=6 by sdsx_inv_pair_aux/ qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma sdsx_inv_pair_gen (h) (G): + ∀g,I,K,V. G ⊢ ⬈*[h,g] 𝐒⦃K.ⓑ{I}V⦄ → + ∨∨ ∃∃f. G ⊢ ⬈*[h,f] 𝐒⦃K⦄ & g = ⫯f + | ∃∃f. G ⊢ ⬈*[h,V] 𝐒⦃K⦄ & G ⊢ ⬈*[h,f] 𝐒⦃K⦄ & g = ↑f. +#h #G #g #I #K #V #H +elim (pn_split g) * #f #Hf destruct +[ lapply (sdsx_inv_push … H) -H /3 width=3 by ex2_intro, or_introl/ +| elim (sdsx_inv_pair … H) -H /3 width=3 by ex3_intro, or_intror/ +] +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma sdsx_fwd_bind (h) (G): + ∀g,I,K. G ⊢ ⬈*[h,g] 𝐒⦃K.ⓘ{I}⦄ → G ⊢ ⬈*[h,⫱g] 𝐒⦃K⦄. +#h #G #g #I #K +elim (pn_split g) * #f #Hf destruct +[ #H lapply (sdsx_inv_push … H) -H // +| cases I -I #I + [ #H lapply (sdsx_inv_unit … H) -H // + | #V #H elim (sdsx_inv_pair … H) -H // + ] +] +qed-. + +(* Basic properties *********************************************************) + +lemma sdsx_eq_repl_back (h) (G): + ∀L. eq_repl_back … (λf. G ⊢ ⬈*[h,f] 𝐒⦃L⦄). +#h #G #L #f1 #H elim H -L -f1 +[ // +| #f1 #I #L #_ #IH #x2 #H + elim (eq_inv_px … H) -H /3 width=3 by sdsx_push/ +| #f1 #I #L #_ #IH #x2 #H + elim (eq_inv_nx … H) -H /3 width=3 by sdsx_unit/ +| #f1 #I #L #V #HV #_ #IH #x2 #H + elim (eq_inv_nx … H) -H /3 width=3 by sdsx_pair/ +] +qed-. + +lemma sdsx_eq_repl_fwd (h) (G): + ∀L. eq_repl_fwd … (λf. G ⊢ ⬈*[h,f] 𝐒⦃L⦄). +#h #G #L @eq_repl_sym /2 width=3 by sdsx_eq_repl_back/ +qed-. + +(* Advanced properties ******************************************************) + +(* Basic_2A1: uses: lcosx_O *) +lemma sdsx_isid (h) (G): + ∀f. 𝐈⦃f⦄ → ∀L. G ⊢ ⬈*[h,f] 𝐒⦃L⦄. +#h #G #f #Hf #L elim L -L +/3 width=3 by sdsx_eq_repl_back, sdsx_push, eq_push_inv_isid/ +qed. + +(* Basic_2A1: removed theorems 2: + lcosx_drop_trans_lt lcosx_inv_succ +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sdsx/sdsx_rdsx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sdsx/sdsx_rdsx.etc new file mode 100644 index 000000000..9c2c7d596 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc/sdsx/sdsx_rdsx.etc @@ -0,0 +1,94 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/relocation/scl.ma". +include "basic_2/rt_computation/rdsx_drops.ma". +include "basic_2/rt_computation/rdsx_lpxs.ma". +include "basic_2/rt_computation/sdsx.ma". + +axiom pippo (h) (f) (G) (V:term): + ∀L1. G ⊢ ⬈*[h,V] 𝐒⦃L1⦄ → + ∀L2. L1 ⊐ⓧ[f] L2 → G ⊢ ⬈*[h,V] 𝐒⦃L2⦄. + + +(* STRONGLY NORMALIZING SELECTED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Properties with strongly normalizing referred local environments *********) + +(* Basic_2A1: uses: lsx_cpx_trans_lcosx *) +lemma rdsx_cpx_trans_sdsx (h): + ∀G,L0,T1,T2. ⦃G,L0⦄ ⊢ T1 ⬈[h] T2 → + ∀f. G ⊢ ⬈*[h,f] 𝐒⦃L0⦄ → ∀L. L0 ⊐ⓧ[f] L → + G ⊢ ⬈*[h,T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h,T2] 𝐒⦃L⦄. +#h #G #L0 #T1 #T2 #H @(cpx_ind … H) -G -L0 -T1 -T2 +[ // +| // +| #I #G #K0 #V1 #V2 #W2 #_ #IH #HVW2 #g #H1 #Y #H2 #H3 + elim (sdsx_inv_pair_gen … H1) -H1 * + [ #f #HK0 #H destruct + elim (scl_inv_push_sn … H2) -H2 #K #HK #H destruct + /4 width=8 by rdsx_lifts, rdsx_fwd_pair, drops_refl, drops_drop/ + | #f #HV1 #HK0 #H destruct + elim (scl_inv_next_sn … H2) -H2 #K #HK #H destruct + /4 width=8 by pippo, rdsx_lifts, drops_refl, drops_drop/ + ] +| #I0 #G #K0 #T #U #i #_ #IH #HTU #g #H1 #Y #H2 #H3 + lapply (sdsx_fwd_bind … H1) -H1 #HK0 + elim (scl_fwd_bind_sn … H2) -H2 #I #K #HK #H destruct + /6 width=8 by rdsx_inv_lifts, rdsx_lifts, drops_refl, drops_drop/ +| #p #I #G #L0 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #f #H1 #L #H2 #H3 + elim (rdsx_inv_bind_void … H3) -H3 #HV1 #HT1 + @rdsx_bind_void + [ /2 width=3 by/ + | @(IHT12 (↑f) … HT1) + [ @(sdsx_pair … H1) + | /2 width=1 by scl_next/ + + /4 width=2 by lsubsx_pair, rdsx_bind_void/ +| #I0 #G #L0 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #f #L #HL0 #HL + elim (rdsx_inv_flat … HL) -HL /3 width=2 by rdsx_flat/ +| #G #L0 #V #U1 #T1 #T2 #HTU1 #_ #IHT12 #f #L #HL0 #HL + elim (rdsx_inv_bind … HL) -HL #HV #HU1 + /5 width=8 by rdsx_inv_lifts, drops_refl, drops_drop/ +| #G #L0 #V #T1 #T2 #_ #IHT12 #f #L #HL0 #HL + elim (rdsx_inv_flat … HL) -HL /2 width=2 by/ +| #G #L0 #V1 #V2 #T #_ #IHV12 #f #L #HL0 #HL + elim (rdsx_inv_flat … HL) -HL /2 width=2 by/ +| #p #G #L0 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #f #L #HL0 #HL + elim (rdsx_inv_flat … HL) -HL #HV1 #HL + elim (rdsx_inv_bind … HL) -HL #HW1 #HT1 + /4 width=2 by lsubsx_pair, rdsx_bind_void, rdsx_flat/ +| #p #G #L0 #V1 #V2 #U2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #HVU2 #f #L #HL0 #HL + elim (rdsx_inv_flat … HL) -HL #HV1 #HL + elim (rdsx_inv_bind … HL) -HL #HW1 #HT1 + /6 width=8 by lsubsx_pair, rdsx_lifts, rdsx_bind_void, rdsx_flat, drops_refl, drops_drop/ +] +qed-. + +(* Advanced properties of strongly normalizing referred local environments **) + +(* Basic_2A1: uses: lsx_cpx_trans_O *) +lemma rdsx_cpx_trans (h): + ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → + G ⊢ ⬈*[h,T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h,T2] 𝐒⦃L⦄. +/3 width=6 by rdsx_cpx_trans_lsubsx, lsubsx_refl/ qed-. + +lemma rdsx_cpxs_trans (h): + ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → + G ⊢ ⬈*[h,T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h,T2] 𝐒⦃L⦄. +#h #G #L #T1 #T2 #H +@(cpxs_ind_dx ???????? H) -T1 // +/3 width=3 by rdsx_cpx_trans/ +qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas.ma b/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas.ma index 3c65cbd7c..c0d2b0cf1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas.ma @@ -12,27 +12,54 @@ (* *) (**************************************************************************) -include "basic_2/notation/relations/colon_7.ma". -include "basic_2/notation/relations/colon_6.ma". -include "basic_2/notation/relations/colonstar_6.ma". +include "basic_2/notation/relations/colonstar_7.ma". include "basic_2/dynamic/cnv.ma". (* ITERATED NATIVE TYPE ASSIGNMENT FOR TERMS ********************************) -definition ntas (a) (h) (n) (G) (L): relation term ≝ λT,U. - ∃∃U0. ⦃G,L⦄ ⊢ U ![a,h] & ⦃G,L⦄ ⊢ T ![a,h] & ⦃G,L⦄ ⊢ U ➡*[h] U0 & ⦃G, L⦄ ⊢ T ➡*[n,h] U0. +definition ntas (h) (a) (n) (G) (L): relation term ≝ λT,U. + ∃∃U0. ⦃G,L⦄ ⊢ U ![h,a] & ⦃G,L⦄ ⊢ T ![h,a] & ⦃G,L⦄ ⊢ U ➡*[h] U0 & ⦃G,L⦄ ⊢ T ➡*[n,h] U0. interpretation "iterated native type assignment (term)" - 'Colon a h n G L T U = (ntas a h n G L T U). - -interpretation "restricted iterated native type assignment (term)" - 'Colon h n G L T U = (ntas true h n G L T U). - -interpretation "extended iterated native type assignment (term)" - 'ColonStar h n G L T U = (ntas false h n G L T U). + 'ColonStar h a n G L T U = (ntas h a n G L T U). (* Basic properties *********************************************************) -lemma ntas_refl (a) (h) (G) (L): - ∀T. ⦃G,L⦄ ⊢ T ![a,h] → ⦃G,L⦄ ⊢ T :[a,h,0] T. +lemma ntas_intro (h) (a) (n) (G) (L): + ∀U. ⦃G,L⦄ ⊢ U ![h,a] → ∀T. ⦃G,L⦄ ⊢ T ![h,a] → + ∀U0. ⦃G,L⦄ ⊢ U ➡*[h] U0 → ⦃G,L⦄ ⊢ T ➡*[n,h] U0 → ⦃G,L⦄ ⊢ T :*[h,a,n] U. /2 width=3 by ex4_intro/ qed. + +lemma ntas_refl (h) (a) (G) (L): + ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ⦃G,L⦄ ⊢ T :*[h,a,0] T. +/2 width=3 by ntas_intro/ qed. + +lemma ntas_sort (h) (a) (n) (G) (L): + ∀s. ⦃G,L⦄ ⊢ ⋆s :*[h,a,n] ⋆((next h)^n s). +#h #a #n #G #L #s +/2 width=3 by ntas_intro, cnv_sort, cpms_sort/ +qed. + +lemma ntas_bind_cnv (h) (a) (n) (G) (K): + ∀V. ⦃G,K⦄ ⊢ V ![h,a] → + ∀I,T,U. ⦃G,K.ⓑ{I}V⦄ ⊢ T :*[h,a,n] U → + ∀p. ⦃G,K⦄ ⊢ ⓑ{p,I}V.T :*[h,a,n] ⓑ{p,I}V.U. +#h #a #n #G #K #V #HV #I #T #U +* #X #HU #HT #HUX #HTX #p +/3 width=5 by ntas_intro, cnv_bind, cpms_bind_dx/ +qed. + +(* Basic_forward lemmas *****************************************************) + +lemma ntas_fwd_cnv_sn (h) (a) (n) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :*[h,a,n] U → ⦃G,L⦄ ⊢ T ![h,a]. +#h #a #n #G #L #T #U +* #X #_ #HT #_ #_ // +qed-. + +(* Note: this is ntas_fwd_correct_cnv *) +lemma ntas_fwd_cnv_dx (h) (a) (n) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :*[h,a,n] U → ⦃G,L⦄ ⊢ U ![h,a]. +#h #a #n #G #L #T #U +* #X #HU #_ #_ #_ // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas_etc.ma b/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas_etc.ma deleted file mode 100644 index 0d531af18..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas_etc.ma +++ /dev/null @@ -1,72 +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 "basic_2/dynamic/nta_lift.ma". -include "basic_2/hod/ntas.ma". - -(* HIGHER ORDER NATIVE TYPE ASSIGNMENT ON TERMS *****************************) - -(* Advanced properties on native type assignment for terms ******************) - -lemma nta_pure_ntas: ∀h,L,U,W,Y. ⦃h, L⦄ ⊢ U :* ⓛW.Y → ∀T. ⦃h, L⦄ ⊢ T : U → - ∀V. ⦃h, L⦄ ⊢ V : W → ⦃h, L⦄ ⊢ ⓐV.T : ⓐV.U. -#h #L #U #W #Y #H @(ntas_ind_dx … H) -U /2 width=1/ /3 width=2/ -qed. - -axiom pippo: ∀h,L,T,W,Y. ⦃h, L⦄ ⊢ T :* ⓛW.Y → ∀U. ⦃h, L⦄ ⊢ T : U → - ∃Z. ⦃h, L⦄ ⊢ U :* ⓛW.Z. -(* REQUIRES SUBJECT CONVERSION -#h #L #T #W #Y #H @(ntas_ind_dx … H) -T -[ #U #HYU - elim (nta_fwd_correct … HYU) #U0 #HU0 - elim (nta_inv_bind1 … HYU) #W0 #Y0 #HW0 #HY0 #HY0U -*) - -(* Advanced inversion lemmas on native type assignment for terms ************) - -fact nta_inv_pure1_aux: ∀h,L,Z,U. ⦃h, L⦄ ⊢ Z : U → ∀X,Y. Z = ⓐY.X → - ∃∃W,V,T. ⦃h, L⦄ ⊢ Y : W & ⦃h, L⦄ ⊢ X : V & - L ⊢ ⓐY.V ⬌* U & ⦃h, L⦄ ⊢ V :* ⓛW.T. -#h #L #Z #U #H elim H -L -Z -U -[ #L #k #X #Y #H destruct -| #L #K #V #W #U #i #_ #_ #_ #_ #X #Y #H destruct -| #L #K #W #V #U #i #_ #_ #_ #_ #X #Y #H destruct -| #I #L #V #W #T #U #_ #_ #_ #_ #X #Y #H destruct -| #L #V #W #Z #U #HVW #HZU #_ #_ #X #Y #H destruct /2 width=7/ -| #L #V #W #Z #U #HZU #_ #_ #IHUW #X #Y #H destruct - elim (IHUW U Y ?) -IHUW // /3 width=9/ -| #L #Z #U #_ #_ #X #Y #H destruct -| #L #Z #U1 #U2 #V2 #_ #HU12 #_ #IHTU1 #_ #X #Y #H destruct - elim (IHTU1 ???) -IHTU1 [4: // |2,3: skip ] #W #V #T #HYW #HXV #HU1 #HVT - lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=7/ -] -qed. - -(* Basic_1: was only: ty3_gen_appl *) -lemma nta_inv_pure1: ∀h,L,Y,X,U. ⦃h, L⦄ ⊢ ⓐY.X : U → - ∃∃W,V,T. ⦃h, L⦄ ⊢ Y : W & ⦃h, L⦄ ⊢ X : V & - L ⊢ ⓐY.V ⬌* U & ⦃h, L⦄ ⊢ V :* ⓛW.T. -/2 width=3/ qed-. - -axiom nta_inv_appl1: ∀h,L,Z,Y,X,U. ⦃h, L⦄ ⊢ ⓐZ.ⓛY.X : U → - ∃∃W. ⦃h, L⦄ ⊢ Z : Y & ⦃h, L⦄ ⊢ ⓛY.X : ⓛY.W & - L ⊢ ⓐZ.ⓛY.W ⬌* U. -(* REQUIRES SUBJECT REDUCTION -#h #L #Z #Y #X #U #H -elim (nta_inv_pure1 … H) -H #W #V #T #HZW #HXV #HVU #HVT -elim (nta_inv_bind1 … HXV) -HXV #Y0 #X0 #HY0 #HX0 #HX0V -lapply (cpcs_trans … (ⓐZ.ⓛY.X0) … HVU) -HVU /2 width=1/ -HX0V #HX0U -@(ex3_1_intro … HX0U) /2 width=2/ -*) -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas_nta.ma b/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas_nta.ma index c9ae6d1eb..17259cb17 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas_nta.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/i_dynamic/ntas_nta.ma @@ -12,11 +12,68 @@ (* *) (**************************************************************************) -include "basic_2/dynamic/nta.ma". -include "basic_2/i_dynamic/ntas.ma". +include "basic_2/dynamic/nta_preserve.ma". +include "basic_2/i_dynamic/ntas_preserve.ma". (* ITERATED NATIVE TYPE ASSIGNMENT FOR TERMS ********************************) +(* Properties with native type assignment for terms *************************) + +lemma nta_ntas (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :[h,a] U → ⦃G,L⦄ ⊢ T :*[h,a,1] U. +#h #a #G #L #T #U #H +elim (cnv_inv_cast … H) -H /2 width=3 by ntas_intro/ +qed-. + +(* Inversion lemmas with native type assignment for terms *******************) + +lemma ntas_inv_nta (h) (a) (G) (L): + ∀T,U. ⦃G,L⦄ ⊢ T :*[h,a,1] U → ⦃G,L⦄ ⊢ T :[h,a] U. +#h #a #G #L #T #U +* /2 width=3 by cnv_cast/ +qed-. + +(* Note: this follows from ntas_inv_appl_sn *) +lemma nta_inv_appl_sn_ntas (h) (a) (G) (L) (V) (T): + ∀X. ⦃G,L⦄ ⊢ ⓐV.T :[h,a] X → + ∨∨ ∃∃p,W,U,U0. ad a 0 & ⦃G,L⦄ ⊢ V :[h,a] W & ⦃G,L⦄ ⊢ T :*[h,a,0] ⓛ{p}W.U0 & ⦃G,L.ⓛW⦄ ⊢ U0 :[h,a] U & ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.U ⬌*[h] X & ⦃G,L⦄ ⊢ X ![h,a] + | ∃∃n,p,W,U,U0. ad a (↑n) & ⦃G,L⦄ ⊢ V :[h,a] W & ⦃G,L⦄ ⊢ T :[h,a] U & ⦃G,L⦄ ⊢ U :*[h,a,n] ⓛ{p}W.U0 & ⦃G,L⦄ ⊢ ⓐV.U ⬌*[h] X & ⦃G,L⦄ ⊢ X ![h,a]. +#h #a #G #L #V #T #X #H +(* +lapply (nta_ntas … H) -H #H +elim (ntas_inv_appl_sn … H) -H * #n #p #W #U #U0 #Hn #Ha #HVW #HTU #HU #HUX #HX +[ elim (eq_or_gt n) #H destruct + [ (plus_minus_m_m_commutative … Hn) in HTU0; #H + elim (cpms_inv_plus … H) -H #U #HTU #HU0 + lapply (cpms_appl_dx … V V … HTU) [ // ] #H + elim (cnv_cpms_conf … HVT … HTX0 … H) -HVT -HTX0 -H (plus_minus_m_m_commutative … Hnm) in HTU0; #H + elim (cpms_inv_plus … H) -H #U #HTU #HU0 + lapply (cpms_appl_dx … V V … HTU) [ // ] #H + elim (cnv_cpms_conf … HVT … HTX0 … H) -HVT -HTX0 -H [ break term 46 h ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'PRedSubTyStarProper $h $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystarproper_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystarproper_8.ma deleted file mode 100644 index 15b61d624..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystarproper_8.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ > [ break term 46 h, break term 46 o ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'PRedSubTyStarProper $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystrong_4.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystrong_4.ma new file mode 100644 index 000000000..d36f44f40 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystrong_4.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ≥ [ term 46 h ] 𝐒 ⦃ break term 46 G, break term 46 L, break term 46 T ⦄ )" + non associative with precedence 45 + for @{ 'PRedSubTyStrong $h $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystrong_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystrong_5.ma deleted file mode 100644 index adc313743..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsubtystrong_5.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ≥ [ term 46 h, break term 46 o ] 𝐒 ⦃ break term 46 G, break term 46 L, break term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'PRedSubTyStrong $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtynormal_4.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtynormal_4.ma new file mode 100644 index 000000000..21c22eee7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtynormal_4.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬈ [ break term 46 h ] 𝐍 ⦃ break term 46 T ⦄ )" + non associative with precedence 45 + for @{ 'PRedTyNormal $h $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtynormal_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtynormal_5.ma deleted file mode 100644 index dca225a8e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtynormal_5.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬈ [ break term 46 h, break term 46 o ] 𝐍 ⦃ break term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'PRedTyNormal $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtysnstrong_4.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtysnstrong_4.ma new file mode 100644 index 000000000..6602630db --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtysnstrong_4.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( G ⊢ ⬈ * [ break term 46 h, break term 46 T ] 𝐒 ⦃ break term 46 L ⦄ )" + non associative with precedence 45 + for @{ 'PRedTySNStrong $h $T $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtysnstrong_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtysnstrong_5.ma deleted file mode 100644 index c86dc8658..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtysnstrong_5.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( G ⊢ ⬈ * [ break term 46 h, break term 46 o, break term 46 T ] 𝐒 ⦃ break term 46 L ⦄ )" - non associative with precedence 45 - for @{ 'PRedTySNStrong $h $o $T $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtystrong_4.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtystrong_4.ma new file mode 100644 index 000000000..34fb89885 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtystrong_4.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬈ * [ break term 46 h] 𝐒 ⦃ break term 46 T ⦄ )" + non associative with precedence 45 + for @{ 'PRedTyStrong $h $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtystrong_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtystrong_5.ma deleted file mode 100644 index 141a8e832..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predtystrong_5.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬈ * [ break term 46 h, break term 46 o ] 𝐒 ⦃ break term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'PRedTyStrong $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/topredtysnstrong_4.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/topredtysnstrong_4.ma new file mode 100644 index 000000000..7b0f2e412 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/topredtysnstrong_4.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( G ⊢ break term 46 L1 ⊒[ break term 46 h] break term 46 L2 )" + non associative with precedence 45 + for @{ 'ToPRedTySNStrong $h $G $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw.ma new file mode 100644 index 000000000..45b655229 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw.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 "basic_2/notation/relations/preditnormal_4.ma". +include "static_2/syntax/tweq.ma". +include "basic_2/rt_computation/cpms.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND WHD RT-TRANSITION ***************************) + +definition cnuw (h) (G) (L): predicate term ≝ + λT1. ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → T1 ≅ T2. + +interpretation + "normality for t-unbound weak head context-sensitive parallel rt-transition (term)" + 'PRedITNormal h G L T = (cnuw h G L T). + +(* Basic properties *********************************************************) + +lemma cnuw_sort (h) (G) (L): ∀s. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⋆s. +#h #G #L #s1 #n #X #H +lapply (cpms_inv_sort1 … H) -H #H destruct // +qed. + +lemma cnuw_ctop (h) (G): ∀i. ⦃G,⋆⦄ ⊢ ➡𝐍𝐖*[h] #i. +#h #G #i #n #X #H +elim (cpms_inv_lref1_ctop … H) -H #H #_ destruct // +qed. + +lemma cnuw_zero_unit (h) (G) (L): ∀I. ⦃G,L.ⓤ{I}⦄ ⊢ ➡𝐍𝐖*[h] #0. +#h #G #L #I #n #X #H +elim (cpms_inv_zero1_unit … H) -H #H #_ destruct // +qed. + +lemma cnuw_gref (h) (G) (L): ∀l. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] §l. +#h #G #L #l1 #n #X #H +elim (cpms_inv_gref1 … H) -H #H #_ destruct // +qed. + +(* Basic_inversion lemmas ***************************************************) + +lemma cnuw_inv_zero_pair (h) (I) (G) (L): ∀V. ⦃G,L.ⓑ{I}V⦄ ⊢ ➡𝐍𝐖*[h] #0 → ⊥. +#h * #G #L #V #H +elim (lifts_total V (𝐔❴1❵)) #W #HVW +[ lapply (H 0 W ?) [ /3 width=3 by cpm_cpms, cpm_delta/ ] +| lapply (H 1 W ?) [ /3 width=3 by cpm_cpms, cpm_ell/ ] +] -H #HW +lapply (tweq_inv_lref_sn … HW) -HW #H destruct +/2 width=5 by lifts_inv_lref2_uni_lt/ +qed-. + +lemma cnuw_inv_cast (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓝV.T → ⊥. +#h #G #L #V #T #H +lapply (H 0 T ?) [ /3 width=1 by cpm_cpms, cpm_eps/ ] -H #H +/2 width=3 by tweq_inv_cast_xy_y/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma cnuw_fwd_appl (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓐV.T → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T. +#h #G #L #V #T1 #HT1 #n #T2 #HT12 +lapply (HT1 n (ⓐV.T2) ?) -HT1 +/2 width=3 by cpms_appl_dx, tweq_inv_appl_bi/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_cnuw.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_cnuw.ma new file mode 100644 index 000000000..6cde759d9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_cnuw.ma @@ -0,0 +1,106 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/cnuw_simple.ma". +include "basic_2/rt_computation/cnuw_drops.ma". +include "basic_2/rt_computation/cprs_tweq.ma". +include "basic_2/rt_computation/lprs_cpms.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND WHD RT-TRANSITION ***************************) + +(* Advanced inversion lemmas ************************************************) + +lemma cnuw_inv_abbr_pos (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] +ⓓV.T → ⊥. +#h #G #L #V #T1 #H +elim (cprs_abbr_pos_twneq h G L V T1) #T2 #HT12 #HnT12 +/3 width=2 by/ +qed-. + +(* Advanced properties ******************************************************) + +lemma cnuw_abbr_neg (h) (G) (L): ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] -ⓓV.T. +#h #G #L #V1 #T1 #n #X #H +elim (cpms_inv_abbr_sn_dx … H) -H * +[ #V2 #T2 #_ #_ #H destruct /1 width=1 by tweq_abbr_neg/ +| #X1 #_ #_ #H destruct +] +qed. + +lemma cnuw_abst (h) (p) (G) (L): ∀W,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓛ{p}W.T. +#h #p #G #L #W1 #T1 #n #X #H +elim (cpms_inv_abst_sn … H) -H #W2 #T2 #_ #_ #H destruct +/1 width=1 by tweq_abst/ +qed. + +lemma cnuw_cpms_trans (h) (n) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T1 → + ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T2. +#h #n1 #G #L #T1 #HT1 #T2 #HT12 #n2 #T3 #HT23 +/4 width=5 by cpms_trans, tweq_canc_sn/ +qed-. + +lemma cnuw_dec_ex (h) (G) (L): + ∀T1. ∨∨ ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T1 + | ∃∃n,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 & (T1 ≅ T2 → ⊥). +#h #G #L #T1 elim T1 -T1 * +[ #s /3 width=5 by cnuw_sort, or_introl/ +| #i elim (drops_F_uni L i) + [ /3 width=7 by cnuw_atom_drops, or_introl/ + | * * [ #I | * #V ] #K #HLK + [ /3 width=8 by cnuw_unit_drops, or_introl/ + | elim (lifts_total V 𝐔❴↑i❵) #W #HVW + @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpms_delta_drops/ ] #H + lapply (tweq_inv_lref_sn … H) -H #H destruct + /2 width=5 by lifts_inv_lref2_uni_lt/ + | elim (lifts_total V 𝐔❴↑i❵) #W #HVW + @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpms_ell_drops/ ] #H + lapply (tweq_inv_lref_sn … H) -H #H destruct + /2 width=5 by lifts_inv_lref2_uni_lt/ + ] + ] +| #l /3 width=5 by cnuw_gref, or_introl/ +| #p * [ cases p ] #V1 #T1 #_ #_ + [ elim (cprs_abbr_pos_twneq h G L V1 T1) #T2 #HT12 #HnT12 + /4 width=4 by ex2_2_intro, or_intror/ + | /3 width=5 by cnuw_abbr_neg, or_introl/ + | /3 width=5 by cnuw_abst, or_introl/ + ] +| * #V1 #T1 #_ #IH + [ elim (simple_dec_ex T1) [ #HT1 | * #p * #W1 #U1 #H destruct ] + [ elim IH -IH + [ /3 width=6 by cnuw_appl_simple, or_introl/ + | * #n #T2 #HT12 #HnT12 -HT1 + @or_intror @(ex2_2_intro … n (ⓐV1.T2)) [ /2 width=1 by cpms_appl_dx/ ] #H + lapply (tweq_inv_appl_bi … H) -H /2 width=1 by/ + ] + | elim (lifts_total V1 𝐔❴1❵) #X1 #HVX1 + @or_intror @(ex2_2_intro … (ⓓ{p}W1.ⓐX1.U1)) [1,2: /2 width=3 by cpms_theta/ ] #H + elim (tweq_inv_appl_sn … H) -H #X1 #X2 #_ #H destruct + | @or_intror @(ex2_2_intro … (ⓓ{p}ⓝW1.V1.U1)) [1,2: /2 width=2 by cpms_beta/ ] #H + elim (tweq_inv_appl_sn … H) -H #X1 #X2 #_ #H destruct + ] + | @or_intror @(ex2_2_intro … T1) [1,2: /2 width=2 by cpms_eps/ ] #H + /2 width=4 by tweq_inv_cast_xy_y/ + ] +] +qed-. + +lemma cnuw_dec (h) (G) (L): ∀T. Decidable (⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T). +#h #G #L #T1 +elim (cnuw_dec_ex h G L T1) +[ /2 width=1 by or_introl/ +| * #n #T2 #HT12 #nT12 /4 width=2 by or_intror/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_drops.ma new file mode 100644 index 000000000..374aa1284 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_drops.ma @@ -0,0 +1,64 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/relocation/lifts_tweq.ma". +include "basic_2/rt_computation/cpms_drops.ma". +include "basic_2/rt_computation/cnuw.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND WHD RT-TRANSITION ***************************) + +(* Properties with generic relocation ***************************************) + +lemma cnuw_lifts (h) (G): d_liftable1 … (cnuw h G). +#h #G #K #T #HT #b #f #L #HLK #U #HTU #n #U0 #H +elim (cpms_inv_lifts_sn … H … HLK … HTU) -b -L #T0 #HTU0 #HT0 +lapply (HT … HT0) -G -K /2 width=6 by tweq_lifts_bi/ +qed-. + +(* Inversion lemmas with generic relocation *********************************) + +lemma cnuw_inv_lifts (h) (G): d_deliftable1 … (cnuw h G). +#h #G #L #U #HU #b #f #K #HLK #T #HTU #n #T0 #H +elim (cpms_lifts_sn … H … HLK … HTU) -b -K #U0 #HTU0 #HU0 +lapply (HU … HU0) -G -L /2 width=6 by tweq_inv_lifts_bi/ +qed-. + +(* Advanced properties ******************************************************) + +lemma cnuw_lref (h) (I) (G) (L): + ∀i. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] #i → ⦃G,L.ⓘ{I}⦄ ⊢ ➡𝐍𝐖*[h] #↑i. +#h #I #G #L #i #Hi #n #X2 #H +elim (cpms_inv_lref_sn … H) -H * +[ #H #_ destruct // +| #T2 #HT2 #HTX2 + lapply (Hi … HT2) -Hi -HT2 #H + lapply (tweq_inv_lref_sn … H) -H #H destruct + lapply (lifts_inv_lref1_uni … HTX2) -HTX2 #H destruct // +] +qed. + +lemma cnuw_atom_drops (h) (b) (G) (L): + ∀i. ⬇*[b,𝐔❴i❵] L ≘ ⋆ → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] #i. +#h #b #G #L #i #Hi #n #X #H +elim (cpms_inv_lref1_drops … H) -H * [ // || #m ] #K #V1 #V2 #HLK +lapply (drops_gen b … HLK) -HLK #HLK +lapply (drops_mono … Hi … HLK) -L #H destruct +qed. + +lemma cnuw_unit_drops (h) (I) (G) (L): + ∀K,i. ⬇*[i] L ≘ K.ⓤ{I} → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] #i. +#h #I #G #L #K #i #HLK #n #X #H +elim (cpms_inv_lref1_drops … H) -H * [ // || #m ] #Y #V1 #V2 #HLY +lapply (drops_mono … HLK … HLY) -L #H destruct +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_simple.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_simple.ma new file mode 100644 index 000000000..d32e1b1d6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw_simple.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 "static_2/syntax/tweq_simple.ma". +include "basic_2/rt_computation/cpms_cpms.ma". +include "basic_2/rt_computation/cnuw.ma". + +(* NORMAL TERMS FOR T-UNUNBOUND WHD RT-TRANSITION ***************************) + +(* Advanced forward lemma with with simple terms ****************************) +(* +lemma cnuw_fwd_appl_simple (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓐV.T → 𝐒⦃T⦄. +#h #G #L #V #T #HT +elim (simple_dec_ex T) [ // ] * #p #I #W #U #H destruct +*) +(* Advanced properties with simple terms ************************************) + +lemma cnuw_appl_simple (h) (G) (L): + ∀V,T. 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓐV.T. +#h #G #L #V1 #T1 #H1T1 #H2T1 #n #X #H +elim (cpms_inv_appl_sn … H) -H * +[ #V2 #T2 #_ #HT12 #H destruct -H1T1 + /3 width=2 by tweq_appl/ +| #n1 #n2 #p #V2 #T2 #HT12 #_ #_ -n -n2 + lapply (H2T1 … HT12) -H2T1 -n1 #H + lapply (tweq_simple_trans … H H1T1) -H -H1T1 #H + elim (simple_inv_bind … H) +| #n1 #n2 #p #V2 #W2 #W #T2 #_ #_ #HT12 #_ #_ -n -n2 -V2 -W2 + lapply (H2T1 … HT12) -H2T1 -n1 #H + lapply (tweq_simple_trans … H H1T1) -H -H1T1 #H + elim (simple_inv_bind … H) +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpme.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpme.ma new file mode 100644 index 000000000..dcee3eb9f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpme.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 "basic_2/notation/relations/predeval_6.ma". +include "basic_2/rt_transition/cnr.ma". +include "basic_2/rt_computation/cpms.ma". + +(* EVALUATION FOR T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION ON TERMS *) + +(* Basic_2A1: uses: cpre *) +definition cpme (h) (n) (G) (L): relation2 term term ≝ + λT1,T2. ∧∧ ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 & ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃T2⦄. + +interpretation "evaluation for t-bound context-sensitive parallel rt-transition (term)" + 'PRedEval h n G L T1 T2 = (cpme h n G L T1 T2). + +(* Basic properties *********************************************************) + +lemma cpme_intro (h) (n) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃T2⦄ → ⦃G,L⦄⊢T1➡*[h,n]𝐍⦃T2⦄. +/2 width=1 by conj/ qed. + +(* Basic forward lemmas *****************************************************) + +lemma cpme_fwd_cpms (h) (n) (G) (L): + ∀T1,T2. ⦃G,L⦄⊢T1➡*[h,n]𝐍⦃T2⦄ → ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2. +#h #n #G #L #T1 #T2 * // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpme_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpme_aaa.ma new file mode 100644 index 000000000..6d6182540 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpme_aaa.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 "basic_2/rt_computation/csx_aaa.ma". +include "basic_2/rt_computation/cpms_aaa.ma". +include "basic_2/rt_computation/cpre_csx.ma". +include "basic_2/rt_computation/cpre_cpms.ma". + +(* EVALUATION FOR T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION ON TERMS *) + +(* Properties with atomic atomic arity assignment on terms ******************) + +lemma cpme_total_aaa (h) (n) (A) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ T1 ⁝ A → ∃T2. ⦃G,L⦄ ⊢ T1 ➡*[h,n] 𝐍⦃T2⦄. +#h #n #A #G #L #T1 #HT1 +elim (cpms_total_aaa h … n … HT1) #T0 #HT10 +elim (cpre_total_csx h G L T0) +[ #T2 /3 width=4 by cpms_cpre_trans, ex_intro/ +| /4 width=4 by cpms_fwd_cpxs, aaa_csx, csx_cpxs_trans/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms.ma index 454ee8312..2f7d1f449 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms.ma @@ -35,15 +35,15 @@ interpretation lemma cpms_ind_sn (h) (G) (L) (T2) (Q:relation2 …): Q 0 T2 → - (∀n1,n2,T1,T. ⦃G, L⦄ ⊢ T1 ➡[n1, h] T → ⦃G, L⦄ ⊢ T ➡*[n2, h] T2 → Q n2 T → Q (n1+n2) T1) → - ∀n,T1. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → Q n T1. + (∀n1,n2,T1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → ⦃G,L⦄ ⊢ T ➡*[n2,h] T2 → Q n2 T → Q (n1+n2) T1) → + ∀n,T1. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → Q n T1. #h #G #L #T2 #Q @ltc_ind_sn_refl // qed-. lemma cpms_ind_dx (h) (G) (L) (T1) (Q:relation2 …): Q 0 T1 → - (∀n1,n2,T,T2. ⦃G, L⦄ ⊢ T1 ➡*[n1, h] T → Q n1 T → ⦃G, L⦄ ⊢ T ➡[n2, h] T2 → Q (n1+n2) T2) → - ∀n,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → Q n T2. + (∀n1,n2,T,T2. ⦃G,L⦄ ⊢ T1 ➡*[n1,h] T → Q n1 T → ⦃G,L⦄ ⊢ T ➡[n2,h] T2 → Q (n1+n2) T2) → + ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → Q n T2. #h #G #L #T1 #Q @ltc_ind_dx_refl // qed-. @@ -52,36 +52,36 @@ qed-. (* Basic_1: includes: pr1_pr0 *) (* Basic_1: uses: pr3_pr2 *) (* Basic_2A1: includes: cpr_cprs *) -lemma cpm_cpms (h) (G) (L): ∀n,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2. +lemma cpm_cpms (h) (G) (L): ∀n,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2. /2 width=1 by ltc_rc/ qed. -lemma cpms_step_sn (h) (G) (L): ∀n1,T1,T. ⦃G, L⦄ ⊢ T1 ➡[n1, h] T → - ∀n2,T2. ⦃G, L⦄ ⊢ T ➡*[n2, h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n1+n2, h] T2. +lemma cpms_step_sn (h) (G) (L): ∀n1,T1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → + ∀n2,T2. ⦃G,L⦄ ⊢ T ➡*[n2,h] T2 → ⦃G,L⦄ ⊢ T1 ➡*[n1+n2,h] T2. /2 width=3 by ltc_sn/ qed-. -lemma cpms_step_dx (h) (G) (L): ∀n1,T1,T. ⦃G, L⦄ ⊢ T1 ➡*[n1, h] T → - ∀n2,T2. ⦃G, L⦄ ⊢ T ➡[n2, h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n1+n2, h] T2. +lemma cpms_step_dx (h) (G) (L): ∀n1,T1,T. ⦃G,L⦄ ⊢ T1 ➡*[n1,h] T → + ∀n2,T2. ⦃G,L⦄ ⊢ T ➡[n2,h] T2 → ⦃G,L⦄ ⊢ T1 ➡*[n1+n2,h] T2. /2 width=3 by ltc_dx/ qed-. (* Basic_2A1: uses: cprs_bind_dx *) lemma cpms_bind_dx (n) (h) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n, h] ⓑ{p,I}V2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n,h] ⓑ{p,I}V2.T2. #n #h #G #L #V1 #V2 #HV12 #I #T1 #T2 #H #a @(cpms_ind_sn … H) -T1 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_bind/ qed. lemma cpms_appl_dx (n) (h) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → - ⦃G, L⦄ ⊢ ⓐV1.T1 ➡*[n, h] ⓐV2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → + ⦃G,L⦄ ⊢ ⓐV1.T1 ➡*[n,h] ⓐV2.T2. #n #h #G #L #V1 #V2 #HV12 #T1 #T2 #H @(cpms_ind_sn … H) -T1 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_appl/ qed. lemma cpms_zeta (n) (h) (G) (L): ∀T1,T. ⬆*[1] T ≘ T1 → - ∀V,T2. ⦃G, L⦄ ⊢ T ➡*[n, h] T2 → ⦃G, L⦄ ⊢ +ⓓV.T1 ➡*[n, h] T2. + ∀V,T2. ⦃G,L⦄ ⊢ T ➡*[n,h] T2 → ⦃G,L⦄ ⊢ +ⓓV.T1 ➡*[n,h] T2. #n #h #G #L #T1 #T #HT1 #V #T2 #H @(cpms_ind_dx … H) -T2 /3 width=3 by cpms_step_dx, cpm_cpms, cpm_zeta/ qed. @@ -89,22 +89,22 @@ qed. (* Basic_2A1: uses: cprs_zeta *) lemma cpms_zeta_dx (n) (h) (G) (L): ∀T2,T. ⬆*[1] T2 ≘ T → - ∀V,T1. ⦃G, L.ⓓV⦄ ⊢ T1 ➡*[n, h] T → ⦃G, L⦄ ⊢ +ⓓV.T1 ➡*[n, h] T2. + ∀V,T1. ⦃G,L.ⓓV⦄ ⊢ T1 ➡*[n,h] T → ⦃G,L⦄ ⊢ +ⓓV.T1 ➡*[n,h] T2. #n #h #G #L #T2 #T #HT2 #V #T1 #H @(cpms_ind_sn … H) -T1 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_bind, cpm_zeta/ qed. (* Basic_2A1: uses: cprs_eps *) lemma cpms_eps (n) (h) (G) (L): - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → - ∀V. ⦃G, L⦄ ⊢ ⓝV.T1 ➡*[n, h] T2. + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → + ∀V. ⦃G,L⦄ ⊢ ⓝV.T1 ➡*[n,h] T2. #n #h #G #L #T1 #T2 #H @(cpms_ind_sn … H) -T1 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_eps/ qed. lemma cpms_ee (n) (h) (G) (L): - ∀U1,U2. ⦃G, L⦄ ⊢ U1 ➡*[n, h] U2 → - ∀T. ⦃G, L⦄ ⊢ ⓝU1.T ➡*[↑n, h] U2. + ∀U1,U2. ⦃G,L⦄ ⊢ U1 ➡*[n,h] U2 → + ∀T. ⦃G,L⦄ ⊢ ⓝU1.T ➡*[↑n,h] U2. #n #h #G #L #U1 #U2 #H @(cpms_ind_sn … H) -U1 -n [ /3 width=1 by cpm_cpms, cpm_ee/ | #n1 #n2 #U1 #U #HU1 #HU2 #_ #T >plus_S1 @@ -114,21 +114,21 @@ qed. (* Basic_2A1: uses: cprs_beta_dx *) lemma cpms_beta_dx (n) (h) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → - ∀W1,W2. ⦃G, L⦄ ⊢ W1 ➡[h] W2 → - ∀T1,T2. ⦃G, L.ⓛW1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡*[n, h] ⓓ{p}ⓝW2.V2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → + ∀W1,W2. ⦃G,L⦄ ⊢ W1 ➡[h] W2 → + ∀T1,T2. ⦃G,L.ⓛW1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡*[n,h] ⓓ{p}ⓝW2.V2.T2. #n #h #G #L #V1 #V2 #HV12 #W1 #W2 #HW12 #T1 #T2 #H @(cpms_ind_dx … H) -T2 /4 width=7 by cpms_step_dx, cpm_cpms, cpms_bind_dx, cpms_appl_dx, cpm_beta/ qed. (* Basic_2A1: uses: cprs_theta_dx *) lemma cpms_theta_dx (n) (h) (G) (L): - ∀V1,V. ⦃G, L⦄ ⊢ V1 ➡[h] V → + ∀V1,V. ⦃G,L⦄ ⊢ V1 ➡[h] V → ∀V2. ⬆*[1] V ≘ V2 → - ∀W1,W2. ⦃G, L⦄ ⊢ W1 ➡[h] W2 → - ∀T1,T2. ⦃G, L.ⓓW1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡*[n, h] ⓓ{p}W2.ⓐV2.T2. + ∀W1,W2. ⦃G,L⦄ ⊢ W1 ➡[h] W2 → + ∀T1,T2. ⦃G,L.ⓓW1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡*[n,h] ⓓ{p}W2.ⓐV2.T2. #n #h #G #L #V1 #V #HV1 #V2 #HV2 #W1 #W2 #HW12 #T1 #T2 #H @(cpms_ind_dx … H) -T2 /4 width=9 by cpms_step_dx, cpm_cpms, cpms_bind_dx, cpms_appl_dx, cpm_theta/ qed. @@ -150,17 +150,47 @@ qed. (* Basic inversion lemmas ***************************************************) -lemma cpms_inv_sort1 (n) (h) (G) (L): ∀X2,s. ⦃G, L⦄ ⊢ ⋆s ➡*[n, h] X2 → X2 = ⋆(((next h)^n) s). +lemma cpms_inv_sort1 (n) (h) (G) (L): ∀X2,s. ⦃G,L⦄ ⊢ ⋆s ➡*[n,h] X2 → X2 = ⋆(((next h)^n) s). #n #h #G #L #X2 #s #H @(cpms_ind_dx … H) -X2 // #n1 #n2 #X #X2 #_ #IH #HX2 destruct elim (cpm_inv_sort1 … HX2) -HX2 #H #_ destruct // qed-. +lemma cpms_inv_lref1_ctop (n) (h) (G): + ∀X2,i. ⦃G,⋆⦄ ⊢ #i ➡*[n,h] X2 → ∧∧ X2 = #i & n = 0. +#n #h #G #X2 #i #H @(cpms_ind_dx … H) -X2 +[ /2 width=1 by conj/ +| #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct + elim (cpm_inv_lref1_ctop … HX2) -HX2 #H1 #H2 destruct + /2 width=1 by conj/ +] +qed-. + +lemma cpms_inv_zero1_unit (n) (h) (I) (K) (G): + ∀X2. ⦃G,K.ⓤ{I}⦄ ⊢ #0 ➡*[n,h] X2 → ∧∧ X2 = #0 & n = 0. +#n #h #I #G #K #X2 #H @(cpms_ind_dx … H) -X2 +[ /2 width=1 by conj/ +| #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct + elim (cpm_inv_zero1_unit … HX2) -HX2 #H1 #H2 destruct + /2 width=1 by conj/ +] +qed-. + +lemma cpms_inv_gref1 (n) (h) (G) (L): + ∀X2,l. ⦃G,L⦄ ⊢ §l ➡*[n,h] X2 → ∧∧ X2 = §l & n = 0. +#n #h #G #L #X2 #l #H @(cpms_ind_dx … H) -X2 +[ /2 width=1 by conj/ +| #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct + elim (cpm_inv_gref1 … HX2) -HX2 #H1 #H2 destruct + /2 width=1 by conj/ +] +qed-. + lemma cpms_inv_cast1 (h) (n) (G) (L): - ∀W1,T1,X2. ⦃G, L⦄ ⊢ ⓝW1.T1 ➡*[n,h] X2 → - ∨∨ ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ➡*[n,h] W2 & ⦃G, L⦄ ⊢ T1 ➡*[n,h] T2 & X2 = ⓝW2.T2 - | ⦃G, L⦄ ⊢ T1 ➡*[n,h] X2 - | ∃∃m. ⦃G, L⦄ ⊢ W1 ➡*[m,h] X2 & n = ↑m. + ∀W1,T1,X2. ⦃G,L⦄ ⊢ ⓝW1.T1 ➡*[n,h] X2 → + ∨∨ ∃∃W2,T2. ⦃G,L⦄ ⊢ W1 ➡*[n,h] W2 & ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 & X2 = ⓝW2.T2 + | ⦃G,L⦄ ⊢ T1 ➡*[n,h] X2 + | ∃∃m. ⦃G,L⦄ ⊢ W1 ➡*[m,h] X2 & n = ↑m. #h #n #G #L #W1 #T1 #X2 #H @(cpms_ind_dx … H) -n -X2 [ /3 width=5 by or3_intro0, ex3_2_intro/ | #n1 #n2 #X #X2 #_ * [ * || * ] diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_aaa.ma index 08f2039c8..db4eefb22 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_aaa.ma @@ -15,6 +15,7 @@ include "basic_2/rt_transition/cpm_aaa.ma". include "basic_2/rt_computation/cpxs_aaa.ma". include "basic_2/rt_computation/cpms_cpxs.ma". +include "basic_2/rt_computation/lprs_cpms.ma". (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) @@ -22,11 +23,11 @@ include "basic_2/rt_computation/cpms_cpxs.ma". (* Basic_2A1: uses: scpds_aaa_conf *) (* Basic_2A1: includes: cprs_aaa_conf *) -lemma cpms_aaa_conf (n) (h): ∀G,L. Conf3 … (aaa G L) (cpms h G L n). +lemma cpms_aaa_conf (h) (G) (L) (n): Conf3 … (aaa G L) (cpms h G L n). /3 width=5 by cpms_fwd_cpxs, cpxs_aaa_conf/ qed-. -lemma aaa_cpms_total (h) (G) (L) (n) (A): - ∀T. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G,L⦄ ⊢ T ➡*[n,h] U. +lemma cpms_total_aaa (h) (G) (L) (n) (A): + ∀T. ⦃G,L⦄ ⊢ T ⁝ A → ∃U. ⦃G,L⦄ ⊢ T ➡*[n,h] U. #h #G #L #n elim n -n [ /2 width=3 by ex_intro/ | #n #IH #A #T1 #HT1 (plus_minus_m_m_commutative … Hn12) in ⊢ (??%?); -Hn12 +/4 width=5 by cpms_trans, cpms_bind_dx, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_cpms.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_cpms.ma index fcd97f3b9..0e09b27f0 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_cpms.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_cpms.ma @@ -23,9 +23,9 @@ include "basic_2/rt_computation/cprs.ma". (* Basic_2A1: includes: cprs_bind *) theorem cpms_bind (n) (h) (G) (L): - ∀I,V1,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n, h] ⓑ{p,I}V2.T2. + ∀I,V1,T1,T2. ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀V2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n,h] ⓑ{p,I}V2.T2. #n #h #G #L #I #V1 #T1 #T2 #HT12 #V2 #H @(cprs_ind_dx … H) -V2 [ /2 width=1 by cpms_bind_dx/ | #V #V2 #_ #HV2 #IH #p >(plus_n_O … n) -HT12 @@ -34,9 +34,9 @@ theorem cpms_bind (n) (h) (G) (L): qed. theorem cpms_appl (n) (h) (G) (L): - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 → - ⦃G, L⦄ ⊢ ⓐV1.T1 ➡*[n, h] ⓐV2.T2. + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 → + ⦃G,L⦄ ⊢ ⓐV1.T1 ➡*[n,h] ⓐV2.T2. #n #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cprs_ind_dx … H) -V2 [ /2 width=1 by cpms_appl_dx/ | #V #V2 #_ #HV2 #IH >(plus_n_O … n) -HT12 @@ -46,10 +46,10 @@ qed. (* Basic_2A1: includes: cprs_beta_rc *) theorem cpms_beta_rc (n) (h) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → - ∀W1,T1,T2. ⦃G, L.ⓛW1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀W2. ⦃G, L⦄ ⊢ W1 ➡*[h] W2 → - ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡*[n, h] ⓓ{p}ⓝW2.V2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → + ∀W1,T1,T2. ⦃G,L.ⓛW1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀W2. ⦃G,L⦄ ⊢ W1 ➡*[h] W2 → + ∀p. ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡*[n,h] ⓓ{p}ⓝW2.V2.T2. #n #h #G #L #V1 #V2 #HV12 #W1 #T1 #T2 #HT12 #W2 #H @(cprs_ind_dx … H) -W2 [ /2 width=1 by cpms_beta_dx/ | #W #W2 #_ #HW2 #IH #p >(plus_n_O … n) -HT12 @@ -59,10 +59,10 @@ qed. (* Basic_2A1: includes: cprs_beta *) theorem cpms_beta (n) (h) (G) (L): - ∀W1,T1,T2. ⦃G, L.ⓛW1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀W2. ⦃G, L⦄ ⊢ W1 ➡*[h] W2 → - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 → - ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡*[n, h] ⓓ{p}ⓝW2.V2.T2. + ∀W1,T1,T2. ⦃G,L.ⓛW1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀W2. ⦃G,L⦄ ⊢ W1 ➡*[h] W2 → + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 → + ∀p. ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡*[n,h] ⓓ{p}ⓝW2.V2.T2. #n #h #G #L #W1 #T1 #T2 #HT12 #W2 #HW12 #V1 #V2 #H @(cprs_ind_dx … H) -V2 [ /2 width=1 by cpms_beta_rc/ | #V #V2 #_ #HV2 #IH #p >(plus_n_O … n) -HT12 @@ -72,10 +72,10 @@ qed. (* Basic_2A1: includes: cprs_theta_rc *) theorem cpms_theta_rc (n) (h) (G) (L): - ∀V1,V. ⦃G, L⦄ ⊢ V1 ➡[h] V → ∀V2. ⬆*[1] V ≘ V2 → - ∀W1,T1,T2. ⦃G, L.ⓓW1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀W2. ⦃G, L⦄ ⊢ W1 ➡*[h] W2 → - ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡*[n, h] ⓓ{p}W2.ⓐV2.T2. + ∀V1,V. ⦃G,L⦄ ⊢ V1 ➡[h] V → ∀V2. ⬆*[1] V ≘ V2 → + ∀W1,T1,T2. ⦃G,L.ⓓW1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀W2. ⦃G,L⦄ ⊢ W1 ➡*[h] W2 → + ∀p. ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡*[n,h] ⓓ{p}W2.ⓐV2.T2. #n #h #G #L #V1 #V #HV1 #V2 #HV2 #W1 #T1 #T2 #HT12 #W2 #H @(cprs_ind_dx … H) -W2 [ /2 width=3 by cpms_theta_dx/ | #W #W2 #_ #HW2 #IH #p >(plus_n_O … n) -HT12 @@ -85,10 +85,10 @@ qed. (* Basic_2A1: includes: cprs_theta *) theorem cpms_theta (n) (h) (G) (L): - ∀V,V2. ⬆*[1] V ≘ V2 → ∀W1,W2. ⦃G, L⦄ ⊢ W1 ➡*[h] W2 → - ∀T1,T2. ⦃G, L.ⓓW1⦄ ⊢ T1 ➡*[n, h] T2 → - ∀V1. ⦃G, L⦄ ⊢ V1 ➡*[h] V → - ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡*[n, h] ⓓ{p}W2.ⓐV2.T2. + ∀V,V2. ⬆*[1] V ≘ V2 → ∀W1,W2. ⦃G,L⦄ ⊢ W1 ➡*[h] W2 → + ∀T1,T2. ⦃G,L.ⓓW1⦄ ⊢ T1 ➡*[n,h] T2 → + ∀V1. ⦃G,L⦄ ⊢ V1 ➡*[h] V → + ∀p. ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡*[n,h] ⓓ{p}W2.ⓐV2.T2. #n #h #G #L #V #V2 #HV2 #W1 #W2 #HW12 #T1 #T2 #HT12 #V1 #H @(cprs_ind_sn … H) -V1 [ /2 width=3 by cpms_theta_rc/ | #V1 #V0 #HV10 #_ #IH #p >(plus_O_n … n) -HT12 @@ -98,30 +98,30 @@ qed. (* Basic_2A1: uses: lstas_scpds_trans scpds_strap2 *) theorem cpms_trans (h) (G) (L): - ∀n1,T1,T. ⦃G, L⦄ ⊢ T1 ➡*[n1, h] T → - ∀n2,T2. ⦃G, L⦄ ⊢ T ➡*[n2, h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n1+n2, h] T2. + ∀n1,T1,T. ⦃G,L⦄ ⊢ T1 ➡*[n1,h] T → + ∀n2,T2. ⦃G,L⦄ ⊢ T ➡*[n2,h] T2 → ⦃G,L⦄ ⊢ T1 ➡*[n1+n2,h] T2. /2 width=3 by ltc_trans/ qed-. (* Basic_2A1: uses: scpds_cprs_trans *) theorem cpms_cprs_trans (n) (h) (G) (L): - ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T → - ∀T2. ⦃G, L⦄ ⊢ T ➡*[h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2. + ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T → + ∀T2. ⦃G,L⦄ ⊢ T ➡*[h] T2 → ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2. #n #h #G #L #T1 #T #HT1 #T2 #HT2 >(plus_n_O … n) /2 width=3 by cpms_trans/ qed-. (* Advanced inversion lemmas ************************************************) lemma cpms_inv_appl_sn (n) (h) (G) (L): - ∀V1,T1,X2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡*[n, h] X2 → + ∀V1,T1,X2. ⦃G,L⦄ ⊢ ⓐV1.T1 ➡*[n,h] X2 → ∨∨ ∃∃V2,T2. - ⦃G, L⦄ ⊢ V1 ➡*[h] V2 & ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 & + ⦃G,L⦄ ⊢ V1 ➡*[h] V2 & ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 & X2 = ⓐV2.T2 | ∃∃n1,n2,p,W,T. - ⦃G, L⦄ ⊢ T1 ➡*[n1, h] ⓛ{p}W.T & ⦃G, L⦄ ⊢ ⓓ{p}ⓝW.V1.T ➡*[n2, h] X2 & + ⦃G,L⦄ ⊢ T1 ➡*[n1,h] ⓛ{p}W.T & ⦃G,L⦄ ⊢ ⓓ{p}ⓝW.V1.T ➡*[n2,h] X2 & n1 + n2 = n | ∃∃n1,n2,p,V0,V2,V,T. - ⦃G, L⦄ ⊢ V1 ➡*[h] V0 & ⬆*[1] V0 ≘ V2 & - ⦃G, L⦄ ⊢ T1 ➡*[n1, h] ⓓ{p}V.T & ⦃G, L⦄ ⊢ ⓓ{p}V.ⓐV2.T ➡*[n2, h] X2 & + ⦃G,L⦄ ⊢ V1 ➡*[h] V0 & ⬆*[1] V0 ≘ V2 & + ⦃G,L⦄ ⊢ T1 ➡*[n1,h] ⓓ{p}V.T & ⦃G,L⦄ ⊢ ⓓ{p}V.ⓐV2.T ➡*[n2,h] X2 & n1 + n2 = n. #n #h #G #L #V1 #T1 #U2 #H @(cpms_ind_dx … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/ @@ -145,8 +145,8 @@ lemma cpms_inv_appl_sn (n) (h) (G) (L): ] qed-. -lemma cpms_inv_plus (h) (G) (L): ∀n1,n2,T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n1+n2, h] T2 → - ∃∃T. ⦃G, L⦄ ⊢ T1 ➡*[n1, h] T & ⦃G, L⦄ ⊢ T ➡*[n2, h] T2. +lemma cpms_inv_plus (h) (G) (L): ∀n1,n2,T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n1+n2,h] T2 → + ∃∃T. ⦃G,L⦄ ⊢ T1 ➡*[n1,h] T & ⦃G,L⦄ ⊢ T ➡*[n2,h] T2. #h #G #L #n1 elim n1 -n1 /2 width=3 by ex2_intro/ #n1 #IH #n2 #T1 #T2 [h,o] ⦃G2, L2, T⦄ → - ∀T2. ⦃G2, L2⦄ ⊢ T ➡*[n,h] T2 → ⦃G1, L1, T1⦄ >[h,o] ⦃G2, L2, T2⦄. +lemma cpms_tdneq_fwd_fpbg (h) (n): + ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → + (T1 ≛ T2 → ⊥) → ⦃G,L,T1⦄ >[h] ⦃G,L,T2⦄. +/3 width=2 by cpms_fwd_cpxs, cpxs_tdneq_fpbg/ qed-. + +lemma fpbg_cpms_trans (h) (n): + ∀G1,G2,L1,L2,T1,T. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T⦄ → + ∀T2. ⦃G2,L2⦄ ⊢ T ➡*[n,h] T2 → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbg_fpbs_trans, cpms_fwd_fpbs/ qed-. -lemma cpms_fpbg_trans (h) (o) (n): ∀G1,L1,T1,T. ⦃G1, L1⦄ ⊢ T1 ➡*[n,h] T → - ∀G2,L2,T2. ⦃G1, L1, T⦄ >[h,o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >[h,o] ⦃G2, L2, T2⦄. +lemma cpms_fpbg_trans (h) (n): + ∀G1,L1,T1,T. ⦃G1,L1⦄ ⊢ T1 ➡*[n,h] T → + ∀G2,L2,T2. ⦃G1,L1,T⦄ >[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_fpbg_trans, cpms_fwd_fpbs/ qed-. -lemma fqup_cpms_fwd_fpbg (h) (o): ∀G1,G2,L1,L2,T1,T. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T⦄ → - ∀n,T2. ⦃G2, L2⦄ ⊢ T ➡*[n,h] T2 → ⦃G1, L1, T1⦄ >[h,o] ⦃G2, L2, T2⦄. -/3 width=5 by cpms_fwd_fpbs, fqup_fpbg,fpbg_fpbs_trans/ qed-. +lemma fqup_cpms_fwd_fpbg (h): + ∀G1,G2,L1,L2,T1,T. ⦃G1,L1,T1⦄ ⬂+ ⦃G2,L2,T⦄ → + ∀n,T2. ⦃G2,L2⦄ ⊢ T ➡*[n,h] T2 → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +/3 width=5 by cpms_fwd_fpbs, fqup_fpbg, fpbg_fpbs_trans/ qed-. -lemma cpm_tdneq_cpm_cpms_tdeq_sym_fwd_fpbg (h) (o) (G) (L) (T1): - ∀n1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → (T1 ≛[h,o] T → ⊥) → - ∀n2,T2. ⦃G,L⦄⊢ T ➡*[n2,h] T2 → T1 ≛[h,o] T2 → ⦃G,L,T1⦄ >[h,o] ⦃G,L,T1⦄. -#h #o #G #L #T1 #n1 #T #H1T1 #H2T1 #n2 #T2 #H1T2 #H2T12 +lemma cpm_tdneq_cpm_cpms_tdeq_sym_fwd_fpbg (h) (G) (L) (T1): + ∀n1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → (T1 ≛ T → ⊥) → + ∀n2,T2. ⦃G,L⦄⊢ T ➡*[n2,h] T2 → T1 ≛ T2 → ⦃G,L,T1⦄ >[h] ⦃G,L,T1⦄. +#h #G #L #T1 #n1 #T #H1T1 #H2T1 #n2 #T2 #H1T2 #H2T12 /4 width=7 by cpms_fwd_fpbs, cpm_fpb, fpbs_tdeq_trans, tdeq_sym, ex2_3_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_fpbs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_fpbs.ma index 4a65edb8b..0fb54e8a6 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_fpbs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_fpbs.ma @@ -20,5 +20,6 @@ include "basic_2/rt_computation/cpms_cpxs.ma". (* Forward lemmas with parallel rst-computation for closures ****************) (* Basic_2A1: uses: cprs_fpbs *) -lemma cpms_fwd_fpbs (n) (h) (o): ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G, L, T1⦄ ≥[h,o] ⦃G, L, T2⦄. +lemma cpms_fwd_fpbs (n) (h): + ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L,T1⦄ ≥[h] ⦃G,L,T2⦄. /3 width=2 by cpms_fwd_cpxs, cpxs_fpbs/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_lpr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_lpr.ma index a636655eb..dc6c0f065 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_lpr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_lpr.ma @@ -20,8 +20,8 @@ include "basic_2/rt_computation/cpms_cpms.ma". (* Properties with parallel rt-transition for full local environments *******) lemma lpr_cpm_trans (n) (h) (G): - ∀L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ➡[n, h] T2 → - ∀L1. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L1⦄ ⊢ T1 ➡*[n, h] T2. + ∀L2,T1,T2. ⦃G,L2⦄ ⊢ T1 ➡[n,h] T2 → + ∀L1. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L1⦄ ⊢ T1 ➡*[n,h] T2. #n #h #G #L2 #T1 #T2 #H @(cpm_ind … H) -n -G -L2 -T1 -T2 [ /2 width=3 by/ | /3 width=2 by cpm_cpms/ @@ -46,8 +46,8 @@ lemma lpr_cpm_trans (n) (h) (G): qed-. lemma lpr_cpms_trans (n) (h) (G): - ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → - ∀T1,T2. ⦃G, L2⦄ ⊢ T1 ➡*[n, h] T2 → ⦃G, L1⦄ ⊢ T1 ➡*[n, h] T2. + ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → + ∀T1,T2. ⦃G,L2⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L1⦄ ⊢ T1 ➡*[n,h] T2. #n #h #G #L1 #L2 #HL12 #T1 #T2 #H @(cpms_ind_sn … H) -n -T1 /3 width=3 by lpr_cpm_trans, cpms_trans/ qed-. @@ -56,14 +56,14 @@ qed-. (* Basic_2A1: includes cpr_bind2 *) lemma cpm_bind2 (n) (h) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡[n, h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n, h] ⓑ{p,I}V2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V2⦄ ⊢ T1 ➡[n,h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n,h] ⓑ{p,I}V2.T2. /4 width=5 by lpr_cpm_trans, cpms_bind_dx, lpr_pair/ qed. (* Basic_2A1: includes cprs_bind2_dx *) lemma cpms_bind2_dx (n) (h) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[n, h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n, h] ⓑ{p,I}V2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V2⦄ ⊢ T1 ➡*[n,h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n,h] ⓑ{p,I}V2.T2. /4 width=5 by lpr_cpms_trans, cpms_bind_dx, lpr_pair/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_rdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_rdeq.ma index b335ae603..f6c8198ac 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_rdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms_rdeq.ma @@ -17,14 +17,14 @@ include "basic_2/rt_computation/cpms_cpxs.ma". (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) -(* Properties with degree-based equivalence for local environments **********) +(* Properties with sort-irrelevant equivalence for local environments *******) -lemma cpms_rdeq_conf_sn (h) (n) (o) (G) (L1) (L2): - ∀T1,T2. ⦃G, L1⦄ ⊢ T1 ➡*[n,h] T2 → - L1 ≛[h,o,T1] L2 → L1 ≛[h,o,T2] L2. -/3 width=4 by cpms_fwd_cpxs, cpxs_rdeq_conf_sn/ qed-. +lemma cpms_rdeq_conf_sn (h) (n) (G) (L1) (L2): + ∀T1,T2. ⦃G,L1⦄ ⊢ T1 ➡*[n,h] T2 → + L1 ≛[T1] L2 → L1 ≛[T2] L2. +/3 width=5 by cpms_fwd_cpxs, cpxs_rdeq_conf_sn/ qed-. -lemma cpms_rdeq_conf_dx (h) (n) (o) (G) (L1) (L2): - ∀T1,T2. ⦃G, L2⦄ ⊢ T1 ➡*[n,h] T2 → - L1 ≛[h,o,T1] L2 → L1 ≛[h,o,T2] L2. -/3 width=4 by cpms_fwd_cpxs, cpxs_rdeq_conf_dx/ qed-. +lemma cpms_rdeq_conf_dx (h) (n) (G) (L1) (L2): + ∀T1,T2. ⦃G,L2⦄ ⊢ T1 ➡*[n,h] T2 → + L1 ≛[T1] L2 → L1 ≛[T2] L2. +/3 width=5 by cpms_fwd_cpxs, cpxs_rdeq_conf_dx/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe.ma new file mode 100644 index 000000000..44d91e8da --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe.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 "basic_2/notation/relations/predevalwstar_6.ma". +include "basic_2/rt_computation/cnuw.ma". + +(* T-UNBOUND WHD EVALUATION FOR T-BOUND RT-TRANSITION ON TERMS **************) + +definition cpmuwe (h) (n) (G) (L): relation2 term term ≝ + λT1,T2. ∧∧ ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 & ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T2. + +interpretation "t-unbound whd evaluation for t-bound context-sensitive parallel rt-transition (term)" + 'PRedEvalWStar h n G L T1 T2 = (cpmuwe h n G L T1 T2). + +definition R_cpmuwe (h) (G) (L) (T): predicate nat ≝ + λn. ∃U. ⦃G,L⦄ ⊢ T ➡*𝐍𝐖*[h,n] U. + +(* Basic properties *********************************************************) + +lemma cpmuwe_intro (h) (n) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T2 → ⦃G,L⦄ ⊢ T1 ➡*𝐍𝐖*[h,n] T2. +/2 width=1 by conj/ qed. + +(* Advanced properties ******************************************************) + +lemma cpmuwe_sort (h) (n) (G) (L) (T): + ∀s. ⦃G,L⦄ ⊢ T ➡*[n,h] ⋆s → ⦃G,L⦄ ⊢ T ➡*𝐍𝐖*[h,n] ⋆s. +/3 width=5 by cnuw_sort, cpmuwe_intro/ qed. + +lemma cpmuwe_ctop (h) (n) (G) (T): + ∀i. ⦃G,⋆⦄ ⊢ T ➡*[n,h] #i → ⦃G,⋆⦄ ⊢ T ➡*𝐍𝐖*[h,n] #i. +/3 width=5 by cnuw_ctop, cpmuwe_intro/ qed. + +lemma cpmuwe_zero_unit (h) (n) (G) (L) (T): + ∀I. ⦃G,L.ⓤ{I}⦄ ⊢ T ➡*[n,h] #0 → ⦃G,L.ⓤ{I}⦄ ⊢ T ➡*𝐍𝐖*[h,n] #0. +/3 width=6 by cnuw_zero_unit, cpmuwe_intro/ qed. + +lemma cpmuwe_gref (h) (n) (G) (L) (T): + ∀l. ⦃G,L⦄ ⊢ T ➡*[n,h] §l → ⦃G,L⦄ ⊢ T ➡*𝐍𝐖*[h,n] §l. +/3 width=5 by cnuw_gref, cpmuwe_intro/ qed. + +(* Basic forward lemmas *****************************************************) + +lemma cpmuwe_fwd_cpms (h) (n) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*𝐍𝐖*[h,n] T2 → ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2. +#h #n #G #L #T1 #T2 * #HT12 #_ // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe_cpmuwe.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe_cpmuwe.ma new file mode 100644 index 000000000..deea7cdd4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe_cpmuwe.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 "basic_2/rt_computation/cnuw_cnuw.ma". +include "basic_2/rt_computation/cpmuwe.ma". + +(* T-UNBOUND WHD EVALUATION FOR T-BOUND RT-TRANSITION ON TERMS **************) + +(* Advanced properties ******************************************************) + +lemma cpmuwe_abbr_neg (h) (n) (G) (L) (T): + ∀V,U. ⦃G,L⦄ ⊢ T ➡*[n,h] -ⓓV.U → ⦃G,L⦄ ⊢ T ➡*𝐍𝐖*[h,n] -ⓓV.U. +/3 width=5 by cnuw_abbr_neg, cpmuwe_intro/ qed. + +lemma cpmuwe_abst (h) (n) (p) (G) (L) (T): + ∀W,U. ⦃G,L⦄ ⊢ T ➡*[n,h] ⓛ{p}W.U → ⦃G,L⦄ ⊢ T ➡*𝐍𝐖*[h,n] ⓛ{p}W.U. +/3 width=5 by cnuw_abst, cpmuwe_intro/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe_csx.ma new file mode 100644 index 000000000..1939101a3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpmuwe_csx.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 "static_2/syntax/tweq_tdeq.ma". +include "basic_2/rt_computation/csx_cpxs.ma". +include "basic_2/rt_computation/cpms_cpxs.ma". +include "basic_2/rt_computation/cnuw_cnuw.ma". +include "basic_2/rt_computation/cpmuwe.ma". + +(* T-UNBOUND WHD EVALUATION FOR T-BOUND RT-TRANSITION ON TERMS **************) + +(* Properties with strong normalization for unbound rt-transition for terms *) + +lemma cpmuwe_total_csx (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ∃∃T2,n. ⦃G,L⦄ ⊢ T1 ➡*𝐍𝐖*[h,n] T2. +#h #G #L #T1 #H +@(csx_ind_cpxs … H) -T1 #T1 #_ #IHT1 +elim (cnuw_dec_ex h G L T1) +[ -IHT1 #HT1 /3 width=4 by cpmuwe_intro, ex1_2_intro/ +| * #n1 #T0 #HT10 #HnT10 + elim (IHT1 … T0) -IHT1 + [ #T2 #n2 * #HT02 #HT2 /4 width=5 by cpms_trans, cpmuwe_intro, ex1_2_intro/ + | /3 width=1 by tdeq_tweq/ + | /2 width=2 by cpms_fwd_cpxs/ + ] +] +qed-. + +lemma R_cpmuwe_total_csx (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ∃n. R_cpmuwe h G L T1 n. +#h #G #L #T1 #H +elim (cpmuwe_total_csx … H) -H #T2 #n #HT12 +/3 width=3 by ex_intro (* 2x *)/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre.ma new file mode 100644 index 000000000..605915021 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre.ma @@ -0,0 +1,22 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/notation/relations/predeval_5.ma". +include "basic_2/rt_computation/cpme.ma". +include "basic_2/rt_computation/cprs.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE PARALLEL R-TRANSITION ON TERMS ***********) + +interpretation "evaluation for context-sensitive parallel r-transition (term)" + 'PRedEval h G L T1 T2 = (cpme h O G L T1 T2). diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_cpms.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_cpms.ma new file mode 100644 index 000000000..2dd997c45 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_cpms.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 "basic_2/rt_computation/cpms_cpms.ma". +include "basic_2/rt_computation/cpre.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE PARALLEL R-TRANSITION ON TERMS **********) + +(* Properties with t-bound rt-computarion on terms **************************) + +lemma cpms_cpre_trans (h) (n) (G) (L): + ∀T1,T0. ⦃G,L⦄ ⊢T1 ➡*[n,h] T0 → + ∀T2. ⦃G,L⦄ ⊢ T0 ➡*[h] 𝐍⦃T2⦄ → ⦃G,L⦄ ⊢ T1 ➡*[h,n] 𝐍⦃T2⦄. +#h #n #G #L #T1 #T0 #HT10 #T2 * #HT02 #HT2 +/3 width=3 by cpms_cprs_trans, cpme_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_cpre.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_cpre.ma new file mode 100644 index 000000000..a855b327f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_cpre.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 "basic_2/rt_computation/cprs_cnr.ma". +include "basic_2/rt_computation/cprs_cprs.ma". +include "basic_2/rt_computation/cpre.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE PARALLEL R-TRANSITION ON TERMS *********) + +(* Properties with context-sensitive parallel r-computation for terms ******) + +lemma cpre_cprs_conf (h) (G) (L) (T): + ∀T1. ⦃G,L⦄ ⊢ T ➡*[h] T1 → ∀T2. ⦃G,L⦄ ⊢ T ➡*[h] 𝐍⦃T2⦄ → ⦃G,L⦄ ⊢ T1 ➡*[h] 𝐍⦃T2⦄. +#h #G #L #T0 #T1 #HT01 #T2 * #HT02 #HT2 +elim (cprs_conf … HT01 … HT02) -T0 #T0 #HT10 #HT20 +lapply (cprs_inv_cnr_sn … HT20 HT2) -HT20 #H destruct +/2 width=1 by cpme_intro/ +qed-. + +(* Main properties *********************************************************) + +(* Basic_1: was: nf2_pr3_confluence *) +theorem cpre_mono (h) (G) (L) (T): + ∀T1. ⦃G,L⦄ ⊢ T ➡*[h] 𝐍⦃T1⦄ → ∀T2. ⦃G,L⦄ ⊢ T ➡*[h] 𝐍⦃T2⦄ → T1 = T2. +#h #G #L #T0 #T1 * #HT01 #HT1 #T2 * #HT02 #HT2 +elim (cprs_conf … HT01 … HT02) -T0 #T0 #HT10 #HT20 +>(cprs_inv_cnr_sn … HT10 HT1) -T1 +>(cprs_inv_cnr_sn … HT20 HT2) -T2 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_csx.ma new file mode 100644 index 000000000..555ff0cb7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpre_csx.ma @@ -0,0 +1,33 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_transition/cpm_cpx.ma". +include "basic_2/rt_transition/cnr_tdeq.ma". +include "basic_2/rt_computation/csx.ma". +include "basic_2/rt_computation/cpre.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE PARALLEL R-TRANSITION ON TERMS **********) + +(* Properties with strong normalization for unbound rt-transition for terms *) + +(* Basic_1: was just: nf2_sn3 *) +lemma cpre_total_csx (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ∃T2. ⦃G,L⦄ ⊢ T1 ➡*[h] 𝐍⦃T2⦄. +#h #G #L #T1 #H +@(csx_ind … H) -T1 #T1 #_ #IHT1 +elim (cnr_dec_tdeq h G L T1) [ /3 width=3 by ex_intro, cpme_intro/ ] * +#T0 #HT10 #HnT10 +elim (IHT1 … HnT10) -IHT1 -HnT10 [| /2 width=2 by cpm_fwd_cpx/ ] +#T2 * /4 width=3 by cprs_step_sn, ex_intro, cpme_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs.ma index ff8271ebd..7a9df49a5 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs.ma @@ -22,8 +22,8 @@ include "basic_2/rt_computation/cpms.ma". (* Basic_2A1: was: cprs_ind_dx *) lemma cprs_ind_sn (h) (G) (L) (T2) (Q:predicate …): Q T2 → - (∀T1,T. ⦃G, L⦄ ⊢ T1 ➡[h] T → ⦃G, L⦄ ⊢ T ➡*[h] T2 → Q T → Q T1) → - ∀T1. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 → Q T1. + (∀T1,T. ⦃G,L⦄ ⊢ T1 ➡[h] T → ⦃G,L⦄ ⊢ T ➡*[h] T2 → Q T → Q T1) → + ∀T1. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → Q T1. #h #G #L #T2 #Q #IH1 #IH2 #T1 @(insert_eq_0 … 0) #n #H @(cpms_ind_sn … H) -n -T1 // @@ -35,8 +35,8 @@ qed-. (* Basic_2A1: was: cprs_ind *) lemma cprs_ind_dx (h) (G) (L) (T1) (Q:predicate …): Q T1 → - (∀T,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T → ⦃G, L⦄ ⊢ T ➡[h] T2 → Q T → Q T2) → - ∀T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 → Q T2. + (∀T,T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T → ⦃G,L⦄ ⊢ T ➡[h] T2 → Q T → Q T2) → + ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → Q T2. #h #G #L #T1 #Q #IH1 #IH2 #T2 @(insert_eq_0 … 0) #n #H @(cpms_ind_dx … H) -n -T2 // @@ -50,28 +50,28 @@ qed-. (* Basic_1: was: pr3_step *) (* Basic_2A1: was: cprs_strap2 *) lemma cprs_step_sn (h) (G) (L): - ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ➡*[h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[h] T2. + ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ➡*[h] T2 → ⦃G,L⦄ ⊢ T1 ➡*[h] T2. /2 width=3 by cpms_step_sn/ qed-. (* Basic_2A1: was: cprs_strap1 *) lemma cprs_step_dx (h) (G) (L): - ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[h] T2. + ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ➡[h] T2 → ⦃G,L⦄ ⊢ T1 ➡*[h] T2. /2 width=3 by cpms_step_dx/ qed-. (* Basic_1: was only: pr3_thin_dx *) lemma cprs_flat_dx (h) (I) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 → - ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → + ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2. #h #I #G #L #V1 #V2 #HV12 #T1 #T2 #H @(cprs_ind_sn … H) -T1 /3 width=3 by cprs_step_sn, cpm_cpms, cpr_flat/ qed. lemma cprs_flat_sn (h) (I) (G) (L): - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 → ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 → - ⦃G, L⦄ ⊢ ⓕ{I} V1. T1 ➡*[h] ⓕ{I} V2. T2. + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 → + ⦃G,L⦄ ⊢ ⓕ{I} V1. T1 ➡*[h] ⓕ{I} V2. T2. #h #I #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cprs_ind_sn … H) -V1 /3 width=3 by cprs_step_sn, cpm_cpms, cpr_flat/ qed. @@ -79,13 +79,13 @@ qed. (* Basic inversion lemmas ***************************************************) (* Basic_1: was: pr3_gen_sort *) -lemma cprs_inv_sort1 (h) (G) (L): ∀X2,s. ⦃G, L⦄ ⊢ ⋆s ➡*[h] X2 → X2 = ⋆s. +lemma cprs_inv_sort1 (h) (G) (L): ∀X2,s. ⦃G,L⦄ ⊢ ⋆s ➡*[h] X2 → X2 = ⋆s. /2 width=4 by cpms_inv_sort1/ qed-. (* Basic_1: was: pr3_gen_cast *) -lemma cprs_inv_cast1 (h) (G) (L): ∀W1,T1,X2. ⦃G, L⦄ ⊢ ⓝW1.T1 ➡*[h] X2 → - ∨∨ ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ➡*[h] W2 & ⦃G, L⦄ ⊢ T1 ➡*[h] T2 & X2 = ⓝW2.T2 - | ⦃G, L⦄ ⊢ T1 ➡*[h] X2. +lemma cprs_inv_cast1 (h) (G) (L): ∀W1,T1,X2. ⦃G,L⦄ ⊢ ⓝW1.T1 ➡*[h] X2 → + ∨∨ ∃∃W2,T2. ⦃G,L⦄ ⊢ W1 ➡*[h] W2 & ⦃G,L⦄ ⊢ T1 ➡*[h] T2 & X2 = ⓝW2.T2 + | ⦃G,L⦄ ⊢ T1 ➡*[h] X2. #h #G #L #W1 #T1 #X2 #H elim (cpms_inv_cast1 … H) -H [ /2 width=1 by or_introl/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cnr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cnr.ma new file mode 100644 index 000000000..8cbb2ee6f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cnr.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 "basic_2/rt_transition/cnr.ma". +include "basic_2/rt_computation/cprs.ma". + +(* CONTEXT-SENSITIVE PARALLEL R-COMPUTATION FOR TERMS ***********************) + +(* Inversion lemmas with normal terms for r-transition **********************) + +(* Basic_1: was: nf2_pr3_unfold *) +(* Basic_2A1: was: cprs_inv_cnr1 *) +lemma cprs_inv_cnr_sn (h) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃T1⦄ → T1 = T2. +#h #G #L #T1 #T2 #H @(cprs_ind_sn … H) -T1 // +#T1 #T0 #HT10 #_ #IH #HT1 +lapply (HT1 … HT10) -HT10 #H destruct /2 width=1 by/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma index 990051c3a..069323fb4 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma @@ -38,9 +38,9 @@ qed-. (* Basic_1: was: pr3_flat *) theorem cprs_flat (h) (G) (L): - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 → - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2. + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 → + ∀I. ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2. #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cprs_ind_dx … H) -V2 [ /2 width=3 by cprs_flat_dx/ | /3 width=3 by cpr_pair_sn, cprs_step_dx/ @@ -52,15 +52,15 @@ qed. (* Basic_1: was pr3_gen_appl *) (* Basic_2A1: was: cprs_inv_appl1 *) lemma cprs_inv_appl_sn (h) (G) (L): - ∀V1,T1,X2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡*[h] X2 → - ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 & - ⦃G, L⦄ ⊢ T1 ➡*[h] T2 & + ∀V1,T1,X2. ⦃G,L⦄ ⊢ ⓐV1.T1 ➡*[h] X2 → + ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 & + ⦃G,L⦄ ⊢ T1 ➡*[h] T2 & X2 = ⓐV2. T2 - | ∃∃p,W,T. ⦃G, L⦄ ⊢ T1 ➡*[h] ⓛ{p}W.T & - ⦃G, L⦄ ⊢ ⓓ{p}ⓝW.V1.T ➡*[h] X2 - | ∃∃p,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ➡*[h] V0 & ⬆*[1] V0 ≘ V2 & - ⦃G, L⦄ ⊢ T1 ➡*[h] ⓓ{p}V.T & - ⦃G, L⦄ ⊢ ⓓ{p}V.ⓐV2.T ➡*[h] X2. + | ∃∃p,W,T. ⦃G,L⦄ ⊢ T1 ➡*[h] ⓛ{p}W.T & + ⦃G,L⦄ ⊢ ⓓ{p}ⓝW.V1.T ➡*[h] X2 + | ∃∃p,V0,V2,V,T. ⦃G,L⦄ ⊢ V1 ➡*[h] V0 & ⬆*[1] V0 ≘ V2 & + ⦃G,L⦄ ⊢ T1 ➡*[h] ⓓ{p}V.T & + ⦃G,L⦄ ⊢ ⓓ{p}V.ⓐV2.T ➡*[h] X2. #h #G #L #V1 #T1 #X2 #H elim (cpms_inv_appl_sn … H) -H * [ /3 width=5 by or3_intro0, ex3_2_intro/ | #n1 #n2 #p #V2 #T2 #HT12 #HTX2 #H diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_drops.ma index 19829738f..bd1afeec3 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_drops.ma @@ -20,9 +20,9 @@ include "basic_2/rt_computation/cpms_drops.ma". (* Basic_1: was: pr3_gen_lref *) (* Basic_2A1: was: cprs_inv_lref1 *) -lemma cprs_inv_lref1_drops (h) (G): ∀L,T2,i. ⦃G, L⦄ ⊢ #i ➡*[h] T2 → +lemma cprs_inv_lref1_drops (h) (G): ∀L,T2,i. ⦃G,L⦄ ⊢ #i ➡*[h] T2 → ∨∨ T2 = #i - | ∃∃K,V1,T1. ⬇*[i] L ≘ K.ⓓV1 & ⦃G, K⦄ ⊢ V1 ➡*[h] T1 & + | ∃∃K,V1,T1. ⬇*[i] L ≘ K.ⓓV1 & ⦃G,K⦄ ⊢ V1 ➡*[h] T1 & ⬆*[↑i] T1 ≘ T2. #h #G #L #T2 #i #H elim (cpms_inv_lref1_drops … H) -H * [ /2 width=1 by or_introl/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma index 1ea7cc963..8a578cf5b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma @@ -31,8 +31,8 @@ lemma lpr_cprs_trans (h) (G): s_rs_transitive … (λL. cpm h G L 0) (λ_. lpr h qed-. lemma cprs_lpr_conf_dx (h) (G): - ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡*[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. + ∀L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ➡*[h] T1 → ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 → + ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[h] T & ⦃G,L1⦄ ⊢ T0 ➡*[h] T. #h #G #L0 #T0 #T1 #H @(cprs_ind_dx … H) -T1 /2 width=3 by ex2_intro/ #T #T1 #_ #HT1 #IHT0 #L1 #HL01 @@ -43,9 +43,9 @@ elim (cprs_strip … HT2 … HT3) -T qed-. lemma cprs_lpr_conf_sn (h) (G): - ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡*[h] T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → - ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. + ∀L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ➡*[h] T1 → + ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 → + ∃∃T. ⦃G,L0⦄ ⊢ T1 ➡*[h] T & ⦃G,L1⦄ ⊢ T0 ➡*[h] T. #h #G #L0 #T0 #T1 #HT01 #L1 #HL01 elim (cprs_lpr_conf_dx … HT01 … HL01) -HT01 #T #HT1 #HT0 /3 width=3 by lpr_cpms_trans, ex2_intro/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_tweq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_tweq.ma new file mode 100644 index 000000000..7c8102af2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_tweq.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 "static_2/syntax/tweq_tweq.ma". +include "static_2/relocation/lifts_tweq.ma". +include "basic_2/rt_transition/cpr_drops_basic.ma". +include "basic_2/rt_computation/cpms.ma". + +(* CONTEXT-SENSITIVE PARALLEL R-COMPUTATION FOR TERMS ***********************) + +(* Properties with sort-irrelevant whd equivalence on terms *****************) + +lemma cprs_abbr_pos_twneq (h) (G) (L) (V) (T1): + ∃∃T2. ⦃G,L⦄ ⊢ +ⓓV.T1 ➡*[h] T2 & (+ⓓV.T1 ≅ T2 → ⊥). +#h #G #L #V #U1 +elim (cpr_subst h G (L.ⓓV) U1 … 0) [|*: /2 width=4 by drops_refl/ ] #U2 #T2 #HU12 #HTU2 +elim (tweq_dec U1 U2) [ #HpU12 | -HTU2 #HnU12 ] +[ @(ex2_intro … T2) (**) (* full auto not tried *) + [ /3 width=6 by cpms_zeta, cpms_step_sn, cpm_bind/ + | /4 width=6 by tweq_inv_abbr_pos_x_lifts_y_y, tweq_canc_sn, tweq_abbr_pos/ + ] +| /4 width=3 by cpm_cpms, cpm_bind, tweq_inv_abbr_pos_bi, ex2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs.ma index ce01889c1..e0048f7d7 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs.ma @@ -27,71 +27,71 @@ interpretation "unbound context-sensitive parallel rt-computation (term)" (* Basic eliminators ********************************************************) lemma cpxs_ind: ∀h,G,L,T1. ∀Q:predicate term. Q T1 → - (∀T,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T → ⦃G, L⦄ ⊢ T ⬈[h] T2 → Q T → Q T2) → - ∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → Q T2. + (∀T,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T → ⦃G,L⦄ ⊢ T ⬈[h] T2 → Q T → Q T2) → + ∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → Q T2. #h #L #G #T1 #Q #HT1 #IHT1 #T2 #HT12 @(TC_star_ind … HT1 IHT1 … HT12) // qed-. lemma cpxs_ind_dx: ∀h,G,L,T2. ∀Q:predicate term. Q T2 → - (∀T1,T. ⦃G, L⦄ ⊢ T1 ⬈[h] T → ⦃G, L⦄ ⊢ T ⬈*[h] T2 → Q T → Q T1) → - ∀T1. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → Q T1. + (∀T1,T. ⦃G,L⦄ ⊢ T1 ⬈[h] T → ⦃G,L⦄ ⊢ T ⬈*[h] T2 → Q T → Q T1) → + ∀T1. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → Q T1. #h #G #L #T2 #Q #HT2 #IHT2 #T1 #HT12 @(TC_star_ind_dx … HT2 IHT2 … HT12) // qed-. (* Basic properties *********************************************************) -lemma cpxs_refl: ∀h,G,L,T. ⦃G, L⦄ ⊢ T ⬈*[h] T. +lemma cpxs_refl: ∀h,G,L,T. ⦃G,L⦄ ⊢ T ⬈*[h] T. /2 width=1 by inj/ qed. -lemma cpx_cpxs: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2. +lemma cpx_cpxs: ∀h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → ⦃G,L⦄ ⊢ T1 ⬈*[h] T2. /2 width=1 by inj/ qed. -lemma cpxs_strap1: ∀h,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬈*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ⬈[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2. +lemma cpxs_strap1: ∀h,G,L,T1,T. ⦃G,L⦄ ⊢ T1 ⬈*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ⬈[h] T2 → ⦃G,L⦄ ⊢ T1 ⬈*[h] T2. normalize /2 width=3 by step/ qed-. -lemma cpxs_strap2: ∀h,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬈[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ⬈*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2. +lemma cpxs_strap2: ∀h,G,L,T1,T. ⦃G,L⦄ ⊢ T1 ⬈[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ⬈*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬈*[h] T2. normalize /2 width=3 by TC_strap/ qed-. (* Basic_2A1: was just: cpxs_sort *) -lemma cpxs_sort: ∀h,G,L,s,n. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] ⋆((next h)^n s). +lemma cpxs_sort: ∀h,G,L,s,n. ⦃G,L⦄ ⊢ ⋆s ⬈*[h] ⋆((next h)^n s). #h #G #L #s #n elim n -n /2 width=1 by cpx_cpxs/ #n >iter_S /2 width=3 by cpxs_strap1/ qed. -lemma cpxs_bind_dx: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → - ∀I,T1,T2. ⦃G, L. ⓑ{I}V1⦄ ⊢ T1 ⬈*[h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. +lemma cpxs_bind_dx: ∀h,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → + ∀I,T1,T2. ⦃G,L. ⓑ{I}V1⦄ ⊢ T1 ⬈*[h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. #h #G #L #V1 #V2 #HV12 #I #T1 #T2 #HT12 #a @(cpxs_ind_dx … HT12) -T1 /3 width=3 by cpxs_strap2, cpx_cpxs, cpx_pair_sn, cpx_bind/ qed. -lemma cpxs_flat_dx: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2. +lemma cpxs_flat_dx: ∀h,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → + ∀I. ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2. #h #G #L #V1 #V2 #HV12 #T1 #T2 #HT12 @(cpxs_ind … HT12) -T2 /3 width=5 by cpxs_strap1, cpx_cpxs, cpx_pair_sn, cpx_flat/ qed. -lemma cpxs_flat_sn: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2. +lemma cpxs_flat_sn: ∀h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 → + ∀I. ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2. #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cpxs_ind … H) -V2 /3 width=5 by cpxs_strap1, cpx_cpxs, cpx_pair_sn, cpx_flat/ qed. -lemma cpxs_pair_sn: ∀h,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 → - ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ⬈*[h] ②{I}V2.T. +lemma cpxs_pair_sn: ∀h,I,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 → + ∀T. ⦃G,L⦄ ⊢ ②{I}V1.T ⬈*[h] ②{I}V2.T. #h #I #G #L #V1 #V2 #H @(cpxs_ind … H) -V2 /3 width=3 by cpxs_strap1, cpx_pair_sn/ qed. lemma cpxs_zeta (h) (G) (L) (V): ∀T1,T. ⬆*[1] T ≘ T1 → - ∀T2. ⦃G, L⦄ ⊢ T ⬈*[h] T2 → ⦃G, L⦄ ⊢ +ⓓV.T1 ⬈*[h] T2. + ∀T2. ⦃G,L⦄ ⊢ T ⬈*[h] T2 → ⦃G,L⦄ ⊢ +ⓓV.T1 ⬈*[h] T2. #h #G #L #V #T1 #T #HT1 #T2 #H @(cpxs_ind … H) -T2 /3 width=3 by cpxs_strap1, cpx_cpxs, cpx_zeta/ qed. @@ -99,34 +99,34 @@ qed. (* Basic_2A1: was: cpxs_zeta *) lemma cpxs_zeta_dx (h) (G) (L) (V): ∀T2,T. ⬆*[1] T2 ≘ T → - ∀T1. ⦃G, L.ⓓV⦄ ⊢ T1 ⬈*[h] T → ⦃G, L⦄ ⊢ +ⓓV.T1 ⬈*[h] T2. + ∀T1. ⦃G,L.ⓓV⦄ ⊢ T1 ⬈*[h] T → ⦃G,L⦄ ⊢ +ⓓV.T1 ⬈*[h] T2. #h #G #L #V #T2 #T #HT2 #T1 #H @(cpxs_ind_dx … H) -T1 /3 width=3 by cpxs_strap2, cpx_cpxs, cpx_bind, cpx_zeta/ qed. -lemma cpxs_eps: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → - ∀V. ⦃G, L⦄ ⊢ ⓝV.T1 ⬈*[h] T2. +lemma cpxs_eps: ∀h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → + ∀V. ⦃G,L⦄ ⊢ ⓝV.T1 ⬈*[h] T2. #h #G #L #T1 #T2 #H @(cpxs_ind … H) -T2 /3 width=3 by cpxs_strap1, cpx_cpxs, cpx_eps/ qed. (* Basic_2A1: was: cpxs_ct *) -lemma cpxs_ee: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 → - ∀T. ⦃G, L⦄ ⊢ ⓝV1.T ⬈*[h] V2. +lemma cpxs_ee: ∀h,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 → + ∀T. ⦃G,L⦄ ⊢ ⓝV1.T ⬈*[h] V2. #h #G #L #V1 #V2 #H @(cpxs_ind … H) -V2 /3 width=3 by cpxs_strap1, cpx_cpxs, cpx_ee/ qed. lemma cpxs_beta_dx: ∀h,p,G,L,V1,V2,W1,W2,T1,T2. - ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈[h] W2 → - ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2. + ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L⦄ ⊢ W1 ⬈[h] W2 → + ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2. #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 * -T2 /4 width=7 by cpx_cpxs, cpxs_strap1, cpxs_bind_dx, cpxs_flat_dx, cpx_beta/ qed. lemma cpxs_theta_dx: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2. - ⦃G, L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≘ V2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → - ⦃G, L⦄ ⊢ W1 ⬈[h] W2 → ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2. + ⦃G,L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≘ V2 → ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → + ⦃G,L⦄ ⊢ W1 ⬈[h] W2 → ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2. #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 * -T2 /4 width=9 by cpx_cpxs, cpxs_strap1, cpxs_bind_dx, cpxs_flat_dx, cpx_theta/ qed. @@ -134,7 +134,7 @@ qed. (* Basic inversion lemmas ***************************************************) (* Basic_2A1: wa just: cpxs_inv_sort1 *) -lemma cpxs_inv_sort1: ∀h,G,L,X2,s. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] X2 → +lemma cpxs_inv_sort1: ∀h,G,L,X2,s. ⦃G,L⦄ ⊢ ⋆s ⬈*[h] X2 → ∃n. X2 = ⋆((next h)^n s). #h #G #L #X2 #s #H @(cpxs_ind … H) -X2 /2 width=2 by ex_intro/ #X #X2 #_ #HX2 * #n #H destruct @@ -142,10 +142,10 @@ elim (cpx_inv_sort1 … HX2) -HX2 #H destruct /2 width=2 by ex_intro/ @(ex_intro … (↑n)) >iter_S // qed-. -lemma cpxs_inv_cast1: ∀h,G,L,W1,T1,U2. ⦃G, L⦄ ⊢ ⓝW1.T1 ⬈*[h] U2 → - ∨∨ ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 & ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 & U2 = ⓝW2.T2 - | ⦃G, L⦄ ⊢ T1 ⬈*[h] U2 - | ⦃G, L⦄ ⊢ W1 ⬈*[h] U2. +lemma cpxs_inv_cast1: ∀h,G,L,W1,T1,U2. ⦃G,L⦄ ⊢ ⓝW1.T1 ⬈*[h] U2 → + ∨∨ ∃∃W2,T2. ⦃G,L⦄ ⊢ W1 ⬈*[h] W2 & ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 & U2 = ⓝW2.T2 + | ⦃G,L⦄ ⊢ T1 ⬈*[h] U2 + | ⦃G,L⦄ ⊢ W1 ⬈*[h] U2. #h #G #L #W1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/ #U2 #U #_ #HU2 * /3 width=3 by cpxs_strap1, or3_intro1, or3_intro2/ * #W #T #HW1 #HT1 #H destruct diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cnx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cnx.ma index 49f74a202..453c91e45 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cnx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cnx.ma @@ -17,10 +17,16 @@ include "basic_2/rt_computation/cpxs.ma". (* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) +(* Properties with normal forms *********************************************) + +lemma cpxs_cnx (h) (G) (L) (T1): + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → T1 ≛ T2) → ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T1⦄. +/3 width=1 by cpx_cpxs/ qed. + (* Inversion lemmas with normal terms ***************************************) -lemma cpxs_inv_cnx1: ∀h,o,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T1⦄ → - T1 ≛[h, o] T2. -#h #o #G #L #T1 #T2 #H @(cpxs_ind_dx … H) -T1 -/5 width=8 by cnx_tdeq_trans, tdeq_trans/ +lemma cpxs_inv_cnx1 (h) (G) (L): + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T1⦄ → T1 ≛ T2. +#h #G #L #T1 #T2 #H @(cpxs_ind_dx … H) -T1 +/5 width=9 by cnx_tdeq_trans, tdeq_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cpxs.ma index 4740fc092..60ddf6394 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_cpxs.ma @@ -22,58 +22,58 @@ include "basic_2/rt_computation/cpxs.ma". theorem cpxs_trans: ∀h,G,L. Transitive … (cpxs h G L). normalize /2 width=3 by trans_TC/ qed-. -theorem cpxs_bind: ∀h,p,I,G,L,V1,V2,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬈*[h] T2 → - ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 → - ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. +theorem cpxs_bind: ∀h,p,I,G,L,V1,V2,T1,T2. ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ⬈*[h] T2 → + ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 → + ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. #h #p #I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cpxs_ind … H) -V2 /3 width=5 by cpxs_trans, cpxs_bind_dx/ qed. -theorem cpxs_flat: ∀h,I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → - ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 → - ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2. +theorem cpxs_flat: ∀h,I,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → + ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 → + ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2. #h #I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cpxs_ind … H) -V2 /3 width=5 by cpxs_trans, cpxs_flat_dx/ qed. theorem cpxs_beta_rc: ∀h,p,G,L,V1,V2,W1,W2,T1,T2. - ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 → - ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2. + ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L⦄ ⊢ W1 ⬈*[h] W2 → + ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2. #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HT12 #H @(cpxs_ind … H) -W2 /4 width=5 by cpxs_trans, cpxs_beta_dx, cpxs_bind_dx, cpx_pair_sn/ qed. theorem cpxs_beta: ∀h,p,G,L,V1,V2,W1,W2,T1,T2. - ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 → ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 → - ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2. + ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L⦄ ⊢ W1 ⬈*[h] W2 → ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 → + ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2. #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HT12 #HW12 #H @(cpxs_ind … H) -V2 /4 width=5 by cpxs_trans, cpxs_beta_rc, cpxs_bind_dx, cpx_flat/ qed. theorem cpxs_theta_rc: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2. - ⦃G, L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≘ V2 → - ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 → - ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2. + ⦃G,L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≘ V2 → + ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L⦄ ⊢ W1 ⬈*[h] W2 → + ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2. #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HT12 #H @(cpxs_ind … H) -W2 /3 width=5 by cpxs_trans, cpxs_theta_dx, cpxs_bind_dx/ qed. theorem cpxs_theta: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2. - ⬆*[1] V ≘ V2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 → - ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ V1 ⬈*[h] V → - ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2. + ⬆*[1] V ≘ V2 → ⦃G,L⦄ ⊢ W1 ⬈*[h] W2 → + ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L⦄ ⊢ V1 ⬈*[h] V → + ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2. #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV2 #HW12 #HT12 #H @(TC_ind_dx … V1 H) -V1 /3 width=5 by cpxs_trans, cpxs_theta_rc, cpxs_flat_dx/ qed. (* Advanced inversion lemmas ************************************************) -lemma cpxs_inv_appl1: ∀h,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓐV1.T1 ⬈*[h] U2 → - ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 & ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 & +lemma cpxs_inv_appl1: ∀h,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓐV1.T1 ⬈*[h] U2 → + ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 & ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 & U2 = ⓐV2.T2 - | ∃∃p,W,T. ⦃G, L⦄ ⊢ T1 ⬈*[h] ⓛ{p}W.T & ⦃G, L⦄ ⊢ ⓓ{p}ⓝW.V1.T ⬈*[h] U2 - | ∃∃p,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ⬈*[h] V0 & ⬆*[1] V0 ≘ V2 & - ⦃G, L⦄ ⊢ T1 ⬈*[h] ⓓ{p}V.T & ⦃G, L⦄ ⊢ ⓓ{p}V.ⓐV2.T ⬈*[h] U2. + | ∃∃p,W,T. ⦃G,L⦄ ⊢ T1 ⬈*[h] ⓛ{p}W.T & ⦃G,L⦄ ⊢ ⓓ{p}ⓝW.V1.T ⬈*[h] U2 + | ∃∃p,V0,V2,V,T. ⦃G,L⦄ ⊢ V1 ⬈*[h] V0 & ⬆*[1] V0 ≘ V2 & + ⦃G,L⦄ ⊢ T1 ⬈*[h] ⓓ{p}V.T & ⦃G,L⦄ ⊢ ⓓ{p}V.ⓐV2.T ⬈*[h] U2. #h #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 [ /3 width=5 by or3_intro0, ex3_2_intro/ ] #U #U2 #_ #HU2 * * [ #V0 #T0 #HV10 #HT10 #H destruct diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_drops.ma index c42f94f83..09ba0f251 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_drops.ma @@ -20,8 +20,8 @@ include "basic_2/rt_computation/cpxs.ma". (* Advanced properties ******************************************************) -lemma cpxs_delta: ∀h,I,G,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈*[h] V2 → - ∀W2. ⬆*[1] V2 ≘ W2 → ⦃G, K.ⓑ{I}V1⦄ ⊢ #0 ⬈*[h] W2. +lemma cpxs_delta: ∀h,I,G,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈*[h] V2 → + ∀W2. ⬆*[1] V2 ≘ W2 → ⦃G,K.ⓑ{I}V1⦄ ⊢ #0 ⬈*[h] W2. #h #I #G #K #V1 #V2 #H @(cpxs_ind … H) -V2 [ /3 width=3 by cpx_cpxs, cpx_delta/ | #V #V2 #_ #HV2 #IH #W2 #HVW2 @@ -30,8 +30,8 @@ lemma cpxs_delta: ∀h,I,G,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈*[h] V2 → ] qed. -lemma cpxs_lref: ∀h,I,G,K,T,i. ⦃G, K⦄ ⊢ #i ⬈*[h] T → - ∀U. ⬆*[1] T ≘ U → ⦃G, K.ⓘ{I}⦄ ⊢ #↑i ⬈*[h] U. +lemma cpxs_lref: ∀h,I,G,K,T,i. ⦃G,K⦄ ⊢ #i ⬈*[h] T → + ∀U. ⬆*[1] T ≘ U → ⦃G,K.ⓘ{I}⦄ ⊢ #↑i ⬈*[h] U. #h #I #G #K #T #i #H @(cpxs_ind … H) -T [ /3 width=3 by cpx_cpxs, cpx_lref/ | #T0 #T #_ #HT2 #IH #U #HTU @@ -42,8 +42,8 @@ qed. (* Basic_2A1: was: cpxs_delta *) lemma cpxs_delta_drops: ∀h,I,G,L,K,V1,V2,i. - ⬇*[i] L ≘ K.ⓑ{I}V1 → ⦃G, K⦄ ⊢ V1 ⬈*[h] V2 → - ∀W2. ⬆*[↑i] V2 ≘ W2 → ⦃G, L⦄ ⊢ #i ⬈*[h] W2. + ⬇*[i] L ≘ K.ⓑ{I}V1 → ⦃G,K⦄ ⊢ V1 ⬈*[h] V2 → + ∀W2. ⬆*[↑i] V2 ≘ W2 → ⦃G,L⦄ ⊢ #i ⬈*[h] W2. #h #I #G #L #K #V1 #V2 #i #HLK #H @(cpxs_ind … H) -V2 [ /3 width=7 by cpx_cpxs, cpx_delta_drops/ | #V #V2 #_ #HV2 #IH #W2 #HVW2 @@ -54,9 +54,9 @@ qed. (* Advanced inversion lemmas ************************************************) -lemma cpxs_inv_zero1: ∀h,G,L,T2. ⦃G, L⦄ ⊢ #0 ⬈*[h] T2 → +lemma cpxs_inv_zero1: ∀h,G,L,T2. ⦃G,L⦄ ⊢ #0 ⬈*[h] T2 → T2 = #0 ∨ - ∃∃I,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈*[h] V2 & ⬆*[1] V2 ≘ T2 & + ∃∃I,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈*[h] V2 & ⬆*[1] V2 ≘ T2 & L = K.ⓑ{I}V1. #h #G #L #T2 #H @(cpxs_ind … H) -T2 /2 width=1 by or_introl/ #T #T2 #_ #HT2 * @@ -69,9 +69,9 @@ lemma cpxs_inv_zero1: ∀h,G,L,T2. ⦃G, L⦄ ⊢ #0 ⬈*[h] T2 → ] qed-. -lemma cpxs_inv_lref1: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #↑i ⬈*[h] T2 → +lemma cpxs_inv_lref1: ∀h,G,L,T2,i. ⦃G,L⦄ ⊢ #↑i ⬈*[h] T2 → T2 = #(↑i) ∨ - ∃∃I,K,T. ⦃G, K⦄ ⊢ #i ⬈*[h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}. + ∃∃I,K,T. ⦃G,K⦄ ⊢ #i ⬈*[h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}. #h #G #L #T2 #i #H @(cpxs_ind … H) -T2 /2 width=1 by or_introl/ #T #T2 #_ #HT2 * [ #H destruct @@ -84,9 +84,9 @@ lemma cpxs_inv_lref1: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #↑i ⬈*[h] T2 → qed-. (* Basic_2A1: was: cpxs_inv_lref1 *) -lemma cpxs_inv_lref1_drops: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #i ⬈*[h] T2 → +lemma cpxs_inv_lref1_drops: ∀h,G,L,T2,i. ⦃G,L⦄ ⊢ #i ⬈*[h] T2 → T2 = #i ∨ - ∃∃I,K,V1,T1. ⬇*[i] L ≘ K.ⓑ{I}V1 & ⦃G, K⦄ ⊢ V1 ⬈*[h] T1 & + ∃∃I,K,V1,T1. ⬇*[i] L ≘ K.ⓑ{I}V1 & ⦃G,K⦄ ⊢ V1 ⬈*[h] T1 & ⬆*[↑i] T1 ≘ T2. #h #G #L #T2 #i #H @(cpxs_ind … H) -T2 /2 width=1 by or_introl/ #T #T2 #_ #HT2 * diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fdeq.ma index 1db09aeb5..1b12ae605 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fdeq.ma @@ -17,12 +17,12 @@ include "basic_2/rt_computation/cpxs_rdeq.ma". (* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) -(* Properties with degree-based equivalence for closures ********************) +(* Properties with sort-irrelevant equivalence for closures *****************) -lemma fdeq_cpxs_trans: ∀h,o,G1,G2,L1,L2,T1,T. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T⦄ → - ∀T2. ⦃G2, L2⦄ ⊢ T ⬈*[h] T2 → - ∃∃T0. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T0 & ⦃G1, L1, T0⦄ ≛[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T #H #T2 #HT2 +lemma fdeq_cpxs_trans: ∀h,G1,G2,L1,L2,T1,T. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T⦄ → + ∀T2. ⦃G2,L2⦄ ⊢ T ⬈*[h] T2 → + ∃∃T0. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T0 & ⦃G1,L1,T0⦄ ≛ ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T #H #T2 #HT2 elim (fdeq_inv_gen_dx … H) -H #H #HL12 #HT1 destruct elim (rdeq_cpxs_trans … HT2 … HL12) #T0 #HT0 #HT02 lapply (cpxs_rdeq_conf_dx … HT2 … HL12) -HL12 #HL12 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fqus.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fqus.ma index c6206f82f..eb8e6748a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fqus.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fqus.ma @@ -21,33 +21,33 @@ include "basic_2/rt_computation/cpxs_cpxs.ma". (* Properties on supclosure *************************************************) -lemma fqu_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → - ∀T1. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, L2, U2⦄. +lemma fqu_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → + ∀T1. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1,L1,U1⦄ ⬂[b] ⦃G2,L2,U2⦄. #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/ #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqu_cpx_trans … HT1 … HT2) -T #T #HT1 #HT2 elim (IHTU2 … HT2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/ qed-. -lemma fquq_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → - ∀T1. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐⸮[b] ⦃G2, L2, U2⦄. +lemma fquq_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → + ∀T1. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1,L1,U1⦄ ⬂⸮[b] ⦃G2,L2,U2⦄. #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/ #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fquq_cpx_trans … HT1 … HT2) -T #T #HT1 #HT2 elim (IHTU2 … HT2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/ qed-. -lemma fqup_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → - ∀T1. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐+[b] ⦃G2, L2, U2⦄. +lemma fqup_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → + ∀T1. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1,L1,U1⦄ ⬂+[b] ⦃G2,L2,U2⦄. #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/ #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqup_cpx_trans … HT1 … HT2) -T #U1 #HTU1 #H2 elim (IHTU2 … H2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/ qed-. -lemma fqus_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → - ∀T1. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐*[b] ⦃G2, L2, U2⦄. +lemma fqus_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → + ∀T1. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1,L1,U1⦄ ⬂*[b] ⦃G2,L2,U2⦄. #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/ #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqus_cpx_trans … HT1 … HT2) -T #U1 #HTU1 #H2 elim (IHTU2 … H2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/ @@ -55,10 +55,10 @@ qed-. (* Note: a proof based on fqu_cpx_trans_tdneq might exist *) (* Basic_2A1: uses: fqu_cpxs_trans_neq *) -lemma fqu_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛[h, o] U2 → ⊥) → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛[h, o] U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, L2, U2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 +lemma fqu_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → + ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1,L1,U1⦄ ⬂[b] ⦃G2,L2,U2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G #L #V1 #V2 #HV12 #_ elim (lifts_total V2 𝐔❴1❵) #U2 #HVU2 @(ex3_intro … U2) [1,3: /3 width=7 by cpxs_delta, fqu_drop/ @@ -69,7 +69,7 @@ lemma fqu_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] [1,3: /2 width=4 by fqu_pair_sn, cpxs_pair_sn/ | #H elim (tdeq_inv_pair … H) -H /2 width=1 by/ ] -| #p #I #G #L #V #T1 #T2 #HT12 #H0 @(ex3_intro … (ⓑ{p,I}V.T2)) +| #p #I #G #L #V #T1 #Hb #T2 #HT12 #H0 @(ex3_intro … (ⓑ{p,I}V.T2)) [1,3: /2 width=4 by fqu_bind_dx, cpxs_bind/ | #H elim (tdeq_inv_pair … H) -H /2 width=1 by/ ] @@ -88,10 +88,10 @@ lemma fqu_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] qed-. (* Basic_2A1: uses: fquq_cpxs_trans_neq *) -lemma fquq_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛[h, o] U2 → ⊥) → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛[h, o] U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐⸮[b] ⦃G2, L2, U2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 elim H12 -H12 +lemma fquq_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → + ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1,L1,U1⦄ ⬂⸮[b] ⦃G2,L2,U2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 elim H12 -H12 [ #H12 #U2 #HTU2 #H elim (fqu_cpxs_trans_tdneq … H12 … HTU2 H) -T2 /3 width=4 by fqu_fquq, ex3_intro/ | * #HG #HL #HT destruct /3 width=4 by ex3_intro/ @@ -99,10 +99,10 @@ lemma fquq_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ qed-. (* Basic_2A1: uses: fqup_cpxs_trans_neq *) -lemma fqup_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛[h, o] U2 → ⊥) → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛[h, o] U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐+[b] ⦃G2, L2, U2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind_dx … H) -G1 -L1 -T1 +lemma fqup_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1,L1,U1⦄ ⬂+[b] ⦃G2,L2,U2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind_dx … H) -G1 -L1 -T1 [ #G1 #L1 #T1 #H12 #U2 #HTU2 #H elim (fqu_cpxs_trans_tdneq … H12 … HTU2 H) -T2 /3 width=4 by fqu_fqup, ex3_intro/ | #G #G1 #L #L1 #T #T1 #H1 #_ #IH12 #U2 #HTU2 #H elim (IH12 … HTU2 H) -T2 @@ -112,10 +112,10 @@ lemma fqup_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b qed-. (* Basic_2A1: uses: fqus_cpxs_trans_neq *) -lemma fqus_cpxs_trans_tdneq: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛[h, o] U2 → ⊥) → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛[h, o] U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐*[b] ⦃G2, L2, U2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 #U2 #HTU2 #H elim (fqus_inv_fqup … H12) -H12 +lemma fqus_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1,L1,U1⦄ ⬂*[b] ⦃G2,L2,U2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 #U2 #HTU2 #H elim (fqus_inv_fqup … H12) -H12 [ #H12 elim (fqup_cpxs_trans_tdneq … H12 … HTU2 H) -T2 /3 width=4 by fqup_fqus, ex3_intro/ | * #HG #HL #HT destruct /3 width=4 by ex3_intro/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_lpx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_lpx.ma index f5cefda3a..599e41a20 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_lpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_lpx.ma @@ -44,22 +44,22 @@ qed-. (* Advanced properties ******************************************************) -lemma cpx_bind2: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ⬈[h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. +lemma cpx_bind2: ∀h,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V2⦄ ⊢ T1 ⬈[h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. /4 width=5 by lpx_cpx_trans, cpxs_bind_dx, lpx_pair/ qed. -lemma cpxs_bind2_dx: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ⬈*[h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. +lemma cpxs_bind2_dx: ∀h,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V2⦄ ⊢ T1 ⬈*[h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. /4 width=5 by lpx_cpxs_trans, cpxs_bind_dx, lpx_pair/ qed. (* Properties with plus-iterated structural successor for closures **********) (* Basic_2A1: uses: lpx_fqup_trans *) -lemma lpx_fqup_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ⬈[h] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ⬈*[h] T & ⦃G1, K1, T⦄ ⊐+[b] ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ⬈[h] L2. +lemma lpx_fqup_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ∀K1. ⦃G1,K1⦄ ⊢ ⬈[h] L1 → + ∃∃K2,T. ⦃G1,K1⦄ ⊢ T1 ⬈*[h] T & ⦃G1,K1,T⦄ ⬂+[b] ⦃G2,K2,T2⦄ & ⦃G2,K2⦄ ⊢ ⬈[h] L2. #h #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 [ #G2 #L2 #T2 #H12 #K1 #HKL1 elim (lpx_fqu_trans … H12 … HKL1) -L1 /3 width=5 by cpx_cpxs, fqu_fqup, ex3_2_intro/ @@ -73,9 +73,9 @@ qed-. (* Properties with star-iterated structural successor for closures **********) (* Basic_2A1: uses: lpx_fqus_trans *) -lemma lpx_fqus_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ⬈[h] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ⬈*[h] T & ⦃G1, K1, T⦄ ⊐*[b] ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ⬈[h] L2. +lemma lpx_fqus_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ∀K1. ⦃G1,K1⦄ ⊢ ⬈[h] L1 → + ∃∃K2,T. ⦃G1,K1⦄ ⊢ T1 ⬈*[h] T & ⦃G1,K1,T⦄ ⬂*[b] ⦃G2,K2,T2⦄ & ⦃G2,K2⦄ ⊢ ⬈[h] L2. #h #b #G1 #G2 #L1 #L2 #T1 #T2 #H #K1 #HKL1 elim (fqus_inv_fqup … H) -H [ #H12 elim (lpx_fqup_trans … H12 … HKL1) -L1 /3 width=5 by fqup_fqus, ex3_2_intro/ | * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_rdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_rdeq.ma index 292dc54e1..1d3dfa50d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_rdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_rdeq.ma @@ -17,33 +17,33 @@ include "basic_2/rt_computation/cpxs_tdeq.ma". (* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) -(* Properties with degree-based equivalence for local environments **********) +(* Properties with sort-irrelevant equivalence for local environments *******) (* Basic_2A1: was just: lleq_cpxs_trans *) -lemma rdeq_cpxs_trans: ∀h,o,G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ⬈*[h] T1 → - ∀L2. L2 ≛[h, o, T0] L0 → - ∃∃T. ⦃G, L2⦄ ⊢ T0 ⬈*[h] T & T ≛[h, o] T1. -#h #o #G #L0 #T0 #T1 #H @(cpxs_ind_dx … H) -T0 /2 width=3 by ex2_intro/ +lemma rdeq_cpxs_trans: ∀h,G,L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ⬈*[h] T1 → + ∀L2. L2 ≛[T0] L0 → + ∃∃T. ⦃G,L2⦄ ⊢ T0 ⬈*[h] T & T ≛ T1. +#h #G #L0 #T0 #T1 #H @(cpxs_ind_dx … H) -T0 /2 width=3 by ex2_intro/ #T0 #T #HT0 #_ #IH #L2 #HL2 elim (rdeq_cpx_trans … HL2 … HT0) #U1 #H1 #H2 -elim (IH L2) -IH /2 width=4 by cpx_rdeq_conf_dx/ -L0 #U2 #H3 #H4 +elim (IH L2) -IH /2 width=5 by cpx_rdeq_conf_dx/ -L0 #U2 #H3 #H4 elim (tdeq_cpxs_trans … H2 … H3) -T #U0 #H2 #H3 /3 width=5 by cpxs_strap2, tdeq_trans, ex2_intro/ qed-. (* Basic_2A1: was just: cpxs_lleq_conf *) -lemma cpxs_rdeq_conf: ∀h,o,G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ⬈*[h] T1 → - ∀L2. L0 ≛[h, o, T0] L2 → - ∃∃T. ⦃G, L2⦄ ⊢ T0 ⬈*[h] T & T ≛[h, o] T1. +lemma cpxs_rdeq_conf: ∀h,G,L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ⬈*[h] T1 → + ∀L2. L0 ≛[T0] L2 → + ∃∃T. ⦃G,L2⦄ ⊢ T0 ⬈*[h] T & T ≛ T1. /3 width=3 by rdeq_cpxs_trans, rdeq_sym/ qed-. (* Basic_2A1: was just: cpxs_lleq_conf_dx *) -lemma cpxs_rdeq_conf_dx: ∀h,o,G,L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ⬈*[h] T2 → - ∀L1. L1 ≛[h, o, T1] L2 → L1 ≛[h, o, T2] L2. -#h #o #G #L2 #T1 #T2 #H @(cpxs_ind … H) -T2 /3 width=6 by cpx_rdeq_conf_dx/ +lemma cpxs_rdeq_conf_dx: ∀h,G,L2,T1,T2. ⦃G,L2⦄ ⊢ T1 ⬈*[h] T2 → + ∀L1. L1 ≛[T1] L2 → L1 ≛[T2] L2. +#h #G #L2 #T1 #T2 #H @(cpxs_ind … H) -T2 /3 width=6 by cpx_rdeq_conf_dx/ qed-. (* Basic_2A1: was just: lleq_conf_sn *) -lemma cpxs_rdeq_conf_sn: ∀h,o,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ⬈*[h] T2 → - ∀L2. L1 ≛[h, o, T1] L2 → L1 ≛[h, o, T2] L2. +lemma cpxs_rdeq_conf_sn: ∀h,G,L1,T1,T2. ⦃G,L1⦄ ⊢ T1 ⬈*[h] T2 → + ∀L2. L1 ≛[T1] L2 → L1 ≛[T2] L2. /4 width=6 by cpxs_rdeq_conf_dx, rdeq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tdeq.ma index 279ee212e..b1d2c9464 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tdeq.ma @@ -17,23 +17,23 @@ include "basic_2/rt_computation/cpxs.ma". (* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) -(* Properties with degree-based equivalence for terms ***********************) +(* Properties with sort-irrelevant equivalence for terms ********************) -lemma tdeq_cpxs_trans: ∀h,o,U1,T1. U1 ≛[h, o] T1 → ∀G,L,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → - ∃∃U2. ⦃G, L⦄ ⊢ U1 ⬈*[h] U2 & U2 ≛[h, o] T2. -#h #o #U1 #T1 #HUT1 #G #L #T2 #HT12 @(cpxs_ind … HT12) -T2 /2 width=3 by ex2_intro/ +lemma tdeq_cpxs_trans: ∀h,U1,T1. U1 ≛ T1 → ∀G,L,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → + ∃∃U2. ⦃G,L⦄ ⊢ U1 ⬈*[h] U2 & U2 ≛ T2. +#h #U1 #T1 #HUT1 #G #L #T2 #HT12 @(cpxs_ind … HT12) -T2 /2 width=3 by ex2_intro/ #T #T2 #_ #HT2 * #U #HU1 #HUT elim (tdeq_cpx_trans … HUT … HT2) -T -T1 /3 width=3 by ex2_intro, cpxs_strap1/ qed-. (* Note: this requires tdeq to be symmetric *) (* Nasic_2A1: uses: cpxs_neq_inv_step_sn *) -lemma cpxs_tdneq_fwd_step_sn: ∀h,o,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛[h, o] T2 → ⊥) → - ∃∃T,T0. ⦃G, L⦄ ⊢ T1 ⬈[h] T & T1 ≛[h, o] T → ⊥ & ⦃G, L⦄ ⊢ T ⬈*[h] T0 & T0 ≛[h, o] T2. -#h #o #G #L #T1 #T2 #H @(cpxs_ind_dx … H) -T1 +lemma cpxs_tdneq_fwd_step_sn: ∀h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛ T2 → ⊥) → + ∃∃T,T0. ⦃G,L⦄ ⊢ T1 ⬈[h] T & T1 ≛ T → ⊥ & ⦃G,L⦄ ⊢ T ⬈*[h] T0 & T0 ≛ T2. +#h #G #L #T1 #T2 #H @(cpxs_ind_dx … H) -T1 [ #H elim H -H // | #T1 #T0 #HT10 #HT02 #IH #Hn12 - elim (tdeq_dec h o T1 T0) [ -HT10 -HT02 #H10 | -IH #Hn10 ] + elim (tdeq_dec T1 T0) [ -HT10 -HT02 #H10 | -IH #Hn10 ] [ elim IH -IH /3 width=3 by tdeq_trans/ -Hn12 #T3 #T4 #HT03 #Hn03 #HT34 #H42 elim (tdeq_cpx_trans … H10 … HT03) -HT03 #T5 #HT15 #H53 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_theq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_theq.ma deleted file mode 100644 index 4bd1dd0c1..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_theq.ma +++ /dev/null @@ -1,100 +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 "static_2/syntax/theq_tdeq.ma". -include "basic_2/rt_computation/cpxs_lsubr.ma". -include "basic_2/rt_computation/cpxs_cnx.ma". -include "basic_2/rt_computation/lpxs_cpxs.ma". - -(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) - -(* Forward lemmas with head equivalence for terms ***************************) - -lemma cpxs_fwd_sort: ∀h,o,G,L,U,s. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] U → - ⋆s ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⋆(next h s) ⬈*[h] U. -#h #o #G #L #U #s #H elim (cpxs_inv_sort1 … H) -H * -[ #H destruct /2 width=1 by or_introl/ -| #n #H destruct - @or_intror >iter_S <(iter_n_Sm … (next h)) // (**) -] -qed-. - -(* Note: probably this is an inversion lemma *) -(* Basic_2A1: was: cpxs_fwd_delta *) -lemma cpxs_fwd_delta_drops: ∀h,o,I,G,L,K,V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 → - ∀V2. ⬆*[↑i] V1 ≘ V2 → - ∀U. ⦃G, L⦄ ⊢ #i ⬈*[h] U → - #i ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ V2 ⬈*[h] U. -#h #o #I #G #L #K #V1 #i #HLK #V2 #HV12 #U #H -elim (cpxs_inv_lref1_drops … H) -H /2 width=1 by or_introl/ -* #I0 #K0 #V0 #U0 #HLK0 #HVU0 #HU0 -lapply (drops_mono … HLK0 … HLK) -HLK0 #H destruct -/4 width=9 by cpxs_lifts_bi, drops_isuni_fwd_drop2, or_intror/ -qed-. - -(* Basic_1: was just: pr3_iso_beta *) -lemma cpxs_fwd_beta: ∀h,o,p,G,L,V,W,T,U. ⦃G, L⦄ ⊢ ⓐV.ⓛ{p}W.T ⬈*[h] U → - ⓐV.ⓛ{p}W.T ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⓓ{p}ⓝW.V.T ⬈*[h] U. -#h #o #p #G #L #V #W #T #U #H elim (cpxs_inv_appl1 … H) -H * -[ #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/ -| #b #W0 #T0 #HT0 #HU - elim (cpxs_inv_abst1 … HT0) -HT0 #W1 #T1 #HW1 #HT1 #H destruct - lapply (lsubr_cpxs_trans … HT1 (L.ⓓⓝW.V) ?) -HT1 - /5 width=3 by cpxs_trans, cpxs_bind, cpxs_pair_sn, lsubr_beta, or_intror/ -| #b #V1 #V2 #V0 #T1 #_ #_ #HT1 #_ - elim (cpxs_inv_abst1 … HT1) -HT1 #W2 #T2 #_ #_ #H destruct -] -qed-. - -lemma cpxs_fwd_theta: ∀h,o,p,G,L,V1,V,T,U. ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}V.T ⬈*[h] U → - ∀V2. ⬆*[1] V1 ≘ V2 → ⓐV1.ⓓ{p}V.T ⩳[h, o] U ∨ - ⦃G, L⦄ ⊢ ⓓ{p}V.ⓐV2.T ⬈*[h] U. -#h #o #p #G #L #V1 #V #T #U #H #V2 #HV12 -elim (cpxs_inv_appl1 … H) -H * -[ -HV12 #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/ -| #q #W #T0 #HT0 #HU - elim (cpxs_inv_abbr1_dx … HT0) -HT0 * - [ #V3 #T3 #_ #_ #H destruct - | #X #HT2 #H #H0 destruct - elim (lifts_inv_bind1 … H) -H #W2 #T2 #HW2 #HT02 #H destruct - @or_intror @(cpxs_trans … HU) -U (**) (* explicit constructor *) - @(cpxs_trans … (+ⓓV.ⓐV2.ⓛ{q}W2.T2)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T - @(cpxs_strap2 … (ⓐV1.ⓛ{q}W.T0)) [2: /2 width=1 by cpxs_beta_dx/ ] - /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ - ] -| #q #V3 #V4 #V0 #T0 #HV13 #HV34 #HT0 #HU - @or_intror @(cpxs_trans … HU) -U (**) (* explicit constructor *) - elim (cpxs_inv_abbr1_dx … HT0) -HT0 * - [ #V5 #T5 #HV5 #HT5 #H destruct - /6 width=9 by cpxs_lifts_bi, drops_refl, drops_drop, cpxs_flat, cpxs_bind/ - | #X #HT1 #H #H0 destruct - elim (lifts_inv_bind1 … H) -H #V5 #T5 #HV05 #HT05 #H destruct - lapply (cpxs_lifts_bi … HV13 (Ⓣ) … (L.ⓓV0) … HV12 … HV34) -V3 /3 width=1 by drops_refl, drops_drop/ #HV24 - @(cpxs_trans … (+ⓓV.ⓐV2.ⓓ{q}V5.T5)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T - @(cpxs_strap2 … (ⓐV1.ⓓ{q}V0.T0)) [ /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ ] -V -V5 -T5 - @(cpxs_strap2 … (ⓓ{q}V0.ⓐV2.T0)) /3 width=3 by cpxs_pair_sn, cpxs_bind_dx, cpx_theta/ - ] -] -qed-. - -lemma cpxs_fwd_cast: ∀h,o,G,L,W,T,U. ⦃G, L⦄ ⊢ ⓝW.T ⬈*[h] U → - ∨∨ ⓝW. T ⩳[h, o] U | ⦃G, L⦄ ⊢ T ⬈*[h] U | ⦃G, L⦄ ⊢ W ⬈*[h] U. -#h #o #G #L #W #T #U #H -elim (cpxs_inv_cast1 … H) -H /2 width=1 by or3_intro1, or3_intro2/ * -#W0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or3_intro0/ -qed-. - -lemma cpxs_fwd_cnx: ∀h,o,G,L,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ → - ∀U. ⦃G, L⦄ ⊢ T ⬈*[h] U → T ⩳[h, o] U. -/3 width=4 by cpxs_inv_cnx1, tdeq_theq/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_theq_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_theq_vector.ma deleted file mode 100644 index 8c0326206..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_theq_vector.ma +++ /dev/null @@ -1,190 +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 "static_2/syntax/theq_simple_vector.ma". -include "static_2/relocation/lifts_vector.ma". -include "basic_2/rt_computation/cpxs_theq.ma". - -(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) - -(* Vector form of forward lemmas with head equivalence for terms ************) - -lemma cpxs_fwd_sort_vector: ∀h,o,G,L,s,Vs,U. ⦃G, L⦄ ⊢ ⒶVs.⋆s ⬈*[h] U → - ⒶVs.⋆s ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⒶVs.⋆(next h s) ⬈*[h] U. -#h #o #G #L #s #Vs elim Vs -Vs /2 width=1 by cpxs_fwd_sort/ -#V #Vs #IHVs #U #H -elim (cpxs_inv_appl1 … H) -H * -[ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/ -| #p #W1 #T1 #HT1 #HU - elim (IHVs … HT1) -IHVs -HT1 #HT1 - [ elim (theq_inv_applv_bind_simple … HT1) // - | @or_intror (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV.ⓛ{p}W1.T1)) /3 width=1 by cpxs_flat_dx, cpx_beta/ - ] -| #p #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU - elim (IHVs … HT1) -IHVs -HT1 #HT1 - [ elim (theq_inv_applv_bind_simple … HT1) // - | @or_intror (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV1.ⓓ{p}V3.T1)) /3 width=3 by cpxs_flat, cpx_theta/ - ] -] -qed-. - -(* Basic_2A1: was: cpxs_fwd_delta_vector *) -lemma cpxs_fwd_delta_drops_vector: ∀h,o,I,G,L,K,V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 → - ∀V2. ⬆*[↑i] V1 ≘ V2 → - ∀Vs,U. ⦃G, L⦄ ⊢ ⒶVs.#i ⬈*[h] U → - ⒶVs.#i ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⒶVs.V2 ⬈*[h] U. -#h #o #I #G #L #K #V1 #i #HLK #V2 #HV12 #Vs elim Vs -Vs /2 width=5 by cpxs_fwd_delta_drops/ -#V #Vs #IHVs #U #H -K -V1 -elim (cpxs_inv_appl1 … H) -H * -[ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/ -| #q #W0 #T0 #HT0 #HU - elim (IHVs … HT0) -IHVs -HT0 #HT0 - [ elim (theq_inv_applv_bind_simple … HT0) // - | @or_intror -i (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /3 width=1 by cpxs_flat_dx, cpx_beta/ - ] -| #q #V0 #V1 #V3 #T0 #HV0 #HV01 #HT0 #HU - elim (IHVs … HT0) -IHVs -HT0 #HT0 - [ elim (theq_inv_applv_bind_simple … HT0) // - | @or_intror -i (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV0.ⓓ{q}V3.T0)) /3 width=3 by cpxs_flat, cpx_theta/ - ] -] -qed-. - -(* Basic_1: was just: pr3_iso_appls_beta *) -lemma cpxs_fwd_beta_vector: ∀h,o,p,G,L,Vs,V,W,T,U. ⦃G, L⦄ ⊢ ⒶVs.ⓐV.ⓛ{p}W.T ⬈*[h] U → - ⒶVs.ⓐV.ⓛ{p}W. T ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⒶVs.ⓓ{p}ⓝW.V.T ⬈*[h] U. -#h #o #p #G #L #Vs elim Vs -Vs /2 width=1 by cpxs_fwd_beta/ -#V0 #Vs #IHVs #V #W #T #U #H -elim (cpxs_inv_appl1 … H) -H * -[ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/ -| #q #W1 #T1 #HT1 #HU - elim (IHVs … HT1) -IHVs -HT1 #HT1 - [ elim (theq_inv_applv_bind_simple … HT1) // - | @or_intror (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV0.ⓛ{q}W1.T1)) /3 width=1 by cpxs_flat_dx, cpx_beta/ - ] -| #q #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU - elim (IHVs … HT1) -IHVs -HT1 #HT1 - [ elim (theq_inv_applv_bind_simple … HT1) // - | @or_intror (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV1.ⓓ{q}V3.T1)) /3 width=3 by cpxs_flat, cpx_theta/ - ] -] -qed-. - -(* Basic_1: was just: pr3_iso_appls_abbr *) -lemma cpxs_fwd_theta_vector: ∀h,o,G,L,V1b,V2b. ⬆*[1] V1b ≘ V2b → - ∀p,V,T,U. ⦃G, L⦄ ⊢ ⒶV1b.ⓓ{p}V.T ⬈*[h] U → - ⒶV1b.ⓓ{p}V.T ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⓓ{p}V.ⒶV2b.T ⬈*[h] U. -#h #o #G #L #V1b #V2b * -V1b -V2b /3 width=1 by or_intror/ -#V1b #V2b #V1a #V2a #HV12a #HV12b #p -generalize in match HV12a; -HV12a -generalize in match V2a; -V2a -generalize in match V1a; -V1a -elim HV12b -V1b -V2b /2 width=1 by cpxs_fwd_theta/ -#V1b #V2b #V1b #V2b #HV12b #_ #IHV12b #V1a #V2a #HV12a #V #T #U #H -elim (cpxs_inv_appl1 … H) -H * -[ -IHV12b -HV12a -HV12b #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/ -| #q #W0 #T0 #HT0 #HU - elim (IHV12b … HV12b … HT0) -IHV12b -HT0 #HT0 - [ -HV12a -HV12b -HU - elim (theq_inv_pair1 … HT0) #V1 #T1 #H destruct - | @or_intror -V1b (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - elim (cpxs_inv_abbr1_dx … HT0) -HT0 * - [ -HV12a #V1 #T1 #_ #_ #H destruct - | -V1b #X #HT1 #H #H0 destruct - elim (lifts_inv_bind1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct - @(cpxs_trans … (+ⓓV.ⓐV2a.ⓛ{q}W1.T1)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T -V2b -V2b - @(cpxs_strap2 … (ⓐV1a.ⓛ{q}W0.T0)) - /4 width=7 by cpxs_beta_dx, cpx_zeta, lifts_bind, lifts_flat/ - ] - ] -| #q #V0a #Va #V0 #T0 #HV10a #HV0a #HT0 #HU - elim (IHV12b … HV12b … HT0) -HV12b -IHV12b -HT0 #HT0 - [ -HV12a -HV10a -HV0a -HU - elim (theq_inv_pair1 … HT0) #V1 #T1 #H destruct - | @or_intror -V1b -V1b (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - elim (cpxs_inv_abbr1_dx … HT0) -HT0 * - [ #V1 #T1 #HV1 #HT1 #H destruct - lapply (cpxs_lifts_bi … HV10a (Ⓣ) … (L.ⓓV) … HV12a … HV0a) -V1a -V0a /3 width=1 by drops_refl, drops_drop/ #HV2a - @(cpxs_trans … (ⓓ{p}V.ⓐV2a.T1)) /3 width=1 by cpxs_bind, cpxs_pair_sn, cpxs_flat_dx, cpxs_bind_dx/ - | #X #HT1 #H #H0 destruct - elim (lifts_inv_bind1 … H) -H #V1 #T1 #HW01 #HT01 #H destruct - lapply (cpxs_lifts_bi … HV10a (Ⓣ) … (L.ⓓV0) … HV12a … HV0a) -V0a /3 width=1 by drops_refl, drops_drop/ #HV2a - @(cpxs_trans … (+ⓓV.ⓐV2a.ⓓ{q}V1.T1)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T -V2b -V2b - @(cpxs_strap2 … (ⓐV1a.ⓓ{q}V0.T0)) [ /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ ] -V -V1 -T1 - @(cpxs_strap2 … (ⓓ{q}V0.ⓐV2a.T0)) /3 width=3 by cpxs_pair_sn, cpxs_bind_dx, cpx_theta/ - ] - ] -] -qed-. - -(* Basic_1: was just: pr3_iso_appls_cast *) -lemma cpxs_fwd_cast_vector: ∀h,o,G,L,Vs,W,T,U. ⦃G, L⦄ ⊢ ⒶVs.ⓝW.T ⬈*[h] U → - ∨∨ ⒶVs. ⓝW. T ⩳[h, o] U - | ⦃G, L⦄ ⊢ ⒶVs.T ⬈*[h] U - | ⦃G, L⦄ ⊢ ⒶVs.W ⬈*[h] U. -#h #o #G #L #Vs elim Vs -Vs /2 width=1 by cpxs_fwd_cast/ -#V #Vs #IHVs #W #T #U #H -elim (cpxs_inv_appl1 … H) -H * -[ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or3_intro0/ -| #q #W0 #T0 #HT0 #HU elim (IHVs … HT0) -IHVs -HT0 #HT0 - [ elim (theq_inv_applv_bind_simple … HT0) // - | @or3_intro1 -W (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /2 width=1 by cpxs_flat_dx, cpx_beta/ - | @or3_intro2 -T (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /2 width=1 by cpxs_flat_dx, cpx_beta/ - ] -| #q #V0 #V1 #V2 #T0 #HV0 #HV01 #HT0 #HU - elim (IHVs … HT0) -IHVs -HT0 #HT0 - [ elim (theq_inv_applv_bind_simple … HT0) // - | @or3_intro1 -W (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV0.ⓓ{q}V2.T0)) /2 width=3 by cpxs_flat, cpx_theta/ - | @or3_intro2 -T (**) (* explicit constructor *) - @(cpxs_trans … HU) -U - @(cpxs_strap1 … (ⓐV0.ⓓ{q}V2.T0)) /2 width=3 by cpxs_flat, cpx_theta/ - ] -] -qed-. - -(* Basic_1: was just: nf2_iso_appls_lref *) -lemma cpxs_fwd_cnx_vector: ∀h,o,G,L,T. 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ → - ∀Vs,U. ⦃G, L⦄ ⊢ ⒶVs.T ⬈*[h] U → ⒶVs.T ⩳[h, o] U. -#h #o #G #L #T #H1T #H2T #Vs elim Vs -Vs [ @(cpxs_fwd_cnx … H2T) ] (**) (* /2 width=3 by cpxs_fwd_cnx/ does not work *) -#V #Vs #IHVs #U #H -elim (cpxs_inv_appl1 … H) -H * -[ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair/ -| #p #W0 #T0 #HT0 #HU - lapply (IHVs … HT0) -IHVs -HT0 #HT0 - elim (theq_inv_applv_bind_simple … HT0) // -| #p #V1 #V2 #V0 #T0 #HV1 #HV12 #HT0 #HU - lapply (IHVs … HT0) -IHVs -HT0 #HT0 - elim (theq_inv_applv_bind_simple … HT0) // -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_toeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_toeq.ma new file mode 100644 index 000000000..f0782e12c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_toeq.ma @@ -0,0 +1,102 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/syntax/toeq_tdeq.ma". +include "basic_2/rt_computation/cpxs_lsubr.ma". +include "basic_2/rt_computation/cpxs_cnx.ma". +include "basic_2/rt_computation/lpxs_cpxs.ma". + +(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) + +(* Forward lemmas with sort-irrelevant outer equivalence for terms **********) + +lemma cpxs_fwd_sort (h) (G) (L): + ∀X2,s1. ⦃G,L⦄ ⊢ ⋆s1 ⬈*[h] X2 → ⋆s1 ⩳ X2. +#h #G #L #X2 #s1 #H +elim (cpxs_inv_sort1 … H) -H #s2 #H destruct // +qed-. + +(* Note: probably this is an inversion lemma *) +(* Basic_2A1: was: cpxs_fwd_delta *) +lemma cpxs_fwd_delta_drops (h) (I) (G) (L) (K): + ∀V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 → + ∀V2. ⬆*[↑i] V1 ≘ V2 → + ∀X2. ⦃G,L⦄ ⊢ #i ⬈*[h] X2 → + ∨∨ #i ⩳ X2 | ⦃G,L⦄ ⊢ V2 ⬈*[h] X2. +#h #I #G #L #K #V1 #i #HLK #V2 #HV12 #X2 #H +elim (cpxs_inv_lref1_drops … H) -H /2 width=1 by or_introl/ +* #I0 #K0 #V0 #U0 #HLK0 #HVU0 #HU0 +lapply (drops_mono … HLK0 … HLK) -HLK0 #H destruct +/4 width=9 by cpxs_lifts_bi, drops_isuni_fwd_drop2, or_intror/ +qed-. + +(* Basic_1: was just: pr3_iso_beta *) +lemma cpxs_fwd_beta (h) (p) (G) (L): + ∀V,W,T,X2. ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.T ⬈*[h] X2 → + ∨∨ ⓐV.ⓛ{p}W.T ⩳ X2 | ⦃G,L⦄ ⊢ ⓓ{p}ⓝW.V.T ⬈*[h] X2. +#h #p #G #L #V #W #T #X2 #H elim (cpxs_inv_appl1 … H) -H * +[ #V0 #T0 #_ #_ #H destruct /2 width=1 by toeq_pair, or_introl/ +| #b #W0 #T0 #HT0 #HU + elim (cpxs_inv_abst1 … HT0) -HT0 #W1 #T1 #HW1 #HT1 #H destruct + lapply (lsubr_cpxs_trans … HT1 (L.ⓓⓝW.V) ?) -HT1 + /5 width=3 by cpxs_trans, cpxs_bind, cpxs_pair_sn, lsubr_beta, or_intror/ +| #b #V1 #V2 #V0 #T1 #_ #_ #HT1 #_ + elim (cpxs_inv_abst1 … HT1) -HT1 #W2 #T2 #_ #_ #H destruct +] +qed-. + +lemma cpxs_fwd_theta (h) (p) (G) (L): + ∀V1,V,T,X2. ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}V.T ⬈*[h] X2 → + ∀V2. ⬆*[1] V1 ≘ V2 → + ∨∨ ⓐV1.ⓓ{p}V.T ⩳ X2 | ⦃G,L⦄ ⊢ ⓓ{p}V.ⓐV2.T ⬈*[h] X2. +#h #p #G #L #V1 #V #T #X2 #H #V2 #HV12 +elim (cpxs_inv_appl1 … H) -H * +[ -HV12 #V0 #T0 #_ #_ #H destruct /2 width=1 by toeq_pair, or_introl/ +| #q #W #T0 #HT0 #HU + elim (cpxs_inv_abbr1_dx … HT0) -HT0 * + [ #V3 #T3 #_ #_ #H destruct + | #X #HT2 #H #H0 destruct + elim (lifts_inv_bind1 … H) -H #W2 #T2 #HW2 #HT02 #H destruct + @or_intror @(cpxs_trans … HU) -X2 (**) (* explicit constructor *) + @(cpxs_trans … (+ⓓV.ⓐV2.ⓛ{q}W2.T2)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T + @(cpxs_strap2 … (ⓐV1.ⓛ{q}W.T0)) [2: /2 width=1 by cpxs_beta_dx/ ] + /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ + ] +| #q #V3 #V4 #V0 #T0 #HV13 #HV34 #HT0 #HU + @or_intror @(cpxs_trans … HU) -X2 (**) (* explicit constructor *) + elim (cpxs_inv_abbr1_dx … HT0) -HT0 * + [ #V5 #T5 #HV5 #HT5 #H destruct + /6 width=9 by cpxs_lifts_bi, drops_refl, drops_drop, cpxs_flat, cpxs_bind/ + | #X #HT1 #H #H0 destruct + elim (lifts_inv_bind1 … H) -H #V5 #T5 #HV05 #HT05 #H destruct + lapply (cpxs_lifts_bi … HV13 (Ⓣ) … (L.ⓓV0) … HV12 … HV34) -V3 /3 width=1 by drops_refl, drops_drop/ #HV24 + @(cpxs_trans … (+ⓓV.ⓐV2.ⓓ{q}V5.T5)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T + @(cpxs_strap2 … (ⓐV1.ⓓ{q}V0.T0)) [ /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ ] -V -V5 -T5 + @(cpxs_strap2 … (ⓓ{q}V0.ⓐV2.T0)) /3 width=3 by cpxs_pair_sn, cpxs_bind_dx, cpx_theta/ + ] +] +qed-. + +lemma cpxs_fwd_cast (h) (G) (L): + ∀W,T,X2. ⦃G,L⦄ ⊢ ⓝW.T ⬈*[h] X2 → + ∨∨ ⓝW. T ⩳ X2 | ⦃G,L⦄ ⊢ T ⬈*[h] X2 | ⦃G,L⦄ ⊢ W ⬈*[h] X2. +#h #G #L #W #T #X2 #H +elim (cpxs_inv_cast1 … H) -H /2 width=1 by or3_intro1, or3_intro2/ * +#W0 #T0 #_ #_ #H destruct /2 width=1 by toeq_pair, or3_intro0/ +qed-. + +lemma cpxs_fwd_cnx (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T1⦄ → + ∀X2. ⦃G,L⦄ ⊢ T1 ⬈*[h] X2 → T1 ⩳ X2. +/3 width=5 by cpxs_inv_cnx1, tdeq_toeq/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_toeq_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_toeq_vector.ma new file mode 100644 index 000000000..bbd7c5c9d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_toeq_vector.ma @@ -0,0 +1,188 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/syntax/toeq_simple_vector.ma". +include "static_2/relocation/lifts_vector.ma". +include "basic_2/rt_computation/cpxs_toeq.ma". + +(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************) + +(* Vector form of forward lemmas with outer equivalence for terms ***********) + +lemma cpxs_fwd_sort_vector (h) (G) (L): + ∀s,Vs,X2. ⦃G,L⦄ ⊢ ⒶVs.⋆s ⬈*[h] X2 → ⒶVs.⋆s ⩳ X2. +#h #G #L #s #Vs elim Vs -Vs /2 width=4 by cpxs_fwd_sort/ +#V #Vs #IHVs #X2 #H +elim (cpxs_inv_appl1 … H) -H * +[ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1 by toeq_pair/ +| #p #W1 #T1 #HT1 #HU + lapply (IHVs … HT1) -IHVs -HT1 #HT1 + elim (toeq_inv_applv_bind_simple … HT1) // +| #p #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU + lapply (IHVs … HT1) -IHVs -HT1 #HT1 + elim (toeq_inv_applv_bind_simple … HT1) // +] +qed-. + +(* Basic_2A1: was: cpxs_fwd_delta_vector *) +lemma cpxs_fwd_delta_drops_vector (h) (I) (G) (L) (K): + ∀V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 → + ∀V2. ⬆*[↑i] V1 ≘ V2 → + ∀Vs,X2. ⦃G,L⦄ ⊢ ⒶVs.#i ⬈*[h] X2 → + ∨∨ ⒶVs.#i ⩳ X2 | ⦃G,L⦄ ⊢ ⒶVs.V2 ⬈*[h] X2. +#h #I #G #L #K #V1 #i #HLK #V2 #HV12 #Vs +elim Vs -Vs /2 width=5 by cpxs_fwd_delta_drops/ +#V #Vs #IHVs #X2 #H -K -V1 +elim (cpxs_inv_appl1 … H) -H * +[ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by toeq_pair, or_introl/ +| #q #W0 #T0 #HT0 #HU + elim (IHVs … HT0) -IHVs -HT0 #HT0 + [ elim (toeq_inv_applv_bind_simple … HT0) // + | @or_intror -i (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /3 width=1 by cpxs_flat_dx, cpx_beta/ + ] +| #q #V0 #V1 #V3 #T0 #HV0 #HV01 #HT0 #HU + elim (IHVs … HT0) -IHVs -HT0 #HT0 + [ elim (toeq_inv_applv_bind_simple … HT0) // + | @or_intror -i (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV0.ⓓ{q}V3.T0)) /3 width=3 by cpxs_flat, cpx_theta/ + ] +] +qed-. + +(* Basic_1: was just: pr3_iso_appls_beta *) +lemma cpxs_fwd_beta_vector (h) (p) (G) (L): + ∀Vs,V,W,T,X2. ⦃G,L⦄ ⊢ ⒶVs.ⓐV.ⓛ{p}W.T ⬈*[h] X2 → + ∨∨ ⒶVs.ⓐV.ⓛ{p}W. T ⩳ X2 | ⦃G,L⦄ ⊢ ⒶVs.ⓓ{p}ⓝW.V.T ⬈*[h] X2. +#h #p #G #L #Vs elim Vs -Vs /2 width=1 by cpxs_fwd_beta/ +#V0 #Vs #IHVs #V #W #T #X2 #H +elim (cpxs_inv_appl1 … H) -H * +[ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1 by toeq_pair, or_introl/ +| #q #W1 #T1 #HT1 #HU + elim (IHVs … HT1) -IHVs -HT1 #HT1 + [ elim (toeq_inv_applv_bind_simple … HT1) // + | @or_intror (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV0.ⓛ{q}W1.T1)) /3 width=1 by cpxs_flat_dx, cpx_beta/ + ] +| #q #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU + elim (IHVs … HT1) -IHVs -HT1 #HT1 + [ elim (toeq_inv_applv_bind_simple … HT1) // + | @or_intror (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV1.ⓓ{q}V3.T1)) /3 width=3 by cpxs_flat, cpx_theta/ + ] +] +qed-. + +(* Basic_1: was just: pr3_iso_appls_abbr *) +lemma cpxs_fwd_theta_vector (h) (G) (L): + ∀V1b,V2b. ⬆*[1] V1b ≘ V2b → + ∀p,V,T,X2. ⦃G,L⦄ ⊢ ⒶV1b.ⓓ{p}V.T ⬈*[h] X2 → + ∨∨ ⒶV1b.ⓓ{p}V.T ⩳ X2 | ⦃G,L⦄ ⊢ ⓓ{p}V.ⒶV2b.T ⬈*[h] X2. +#h #G #L #V1b #V2b * -V1b -V2b /3 width=1 by or_intror/ +#V1b #V2b #V1a #V2a #HV12a #HV12b #p +generalize in match HV12a; -HV12a +generalize in match V2a; -V2a +generalize in match V1a; -V1a +elim HV12b -V1b -V2b /2 width=1 by cpxs_fwd_theta/ +#V1b #V2b #V1b #V2b #HV12b #_ #IHV12b #V1a #V2a #HV12a #V #T #X2 #H +elim (cpxs_inv_appl1 … H) -H * +[ -IHV12b -HV12a -HV12b #V0 #T0 #_ #_ #H destruct /2 width=1 by toeq_pair, or_introl/ +| #q #W0 #T0 #HT0 #HU + elim (IHV12b … HV12b … HT0) -IHV12b -HT0 #HT0 + [ -HV12a -HV12b -HU + elim (toeq_inv_pair1 … HT0) #V1 #T1 #H destruct + | @or_intror -V1b (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + elim (cpxs_inv_abbr1_dx … HT0) -HT0 * + [ -HV12a #V1 #T1 #_ #_ #H destruct + | -V1b #X #HT1 #H #H0 destruct + elim (lifts_inv_bind1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct + @(cpxs_trans … (+ⓓV.ⓐV2a.ⓛ{q}W1.T1)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T -V2b -V2b + @(cpxs_strap2 … (ⓐV1a.ⓛ{q}W0.T0)) + /4 width=7 by cpxs_beta_dx, cpx_zeta, lifts_bind, lifts_flat/ + ] + ] +| #q #V0a #Va #V0 #T0 #HV10a #HV0a #HT0 #HU + elim (IHV12b … HV12b … HT0) -HV12b -IHV12b -HT0 #HT0 + [ -HV12a -HV10a -HV0a -HU + elim (toeq_inv_pair1 … HT0) #V1 #T1 #H destruct + | @or_intror -V1b -V1b (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + elim (cpxs_inv_abbr1_dx … HT0) -HT0 * + [ #V1 #T1 #HV1 #HT1 #H destruct + lapply (cpxs_lifts_bi … HV10a (Ⓣ) … (L.ⓓV) … HV12a … HV0a) -V1a -V0a /3 width=1 by drops_refl, drops_drop/ #HV2a + @(cpxs_trans … (ⓓ{p}V.ⓐV2a.T1)) /3 width=1 by cpxs_bind, cpxs_pair_sn, cpxs_flat_dx, cpxs_bind_dx/ + | #X #HT1 #H #H0 destruct + elim (lifts_inv_bind1 … H) -H #V1 #T1 #HW01 #HT01 #H destruct + lapply (cpxs_lifts_bi … HV10a (Ⓣ) … (L.ⓓV0) … HV12a … HV0a) -V0a /3 width=1 by drops_refl, drops_drop/ #HV2a + @(cpxs_trans … (+ⓓV.ⓐV2a.ⓓ{q}V1.T1)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T -V2b -V2b + @(cpxs_strap2 … (ⓐV1a.ⓓ{q}V0.T0)) [ /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ ] -V -V1 -T1 + @(cpxs_strap2 … (ⓓ{q}V0.ⓐV2a.T0)) /3 width=3 by cpxs_pair_sn, cpxs_bind_dx, cpx_theta/ + ] + ] +] +qed-. + +(* Basic_1: was just: pr3_iso_appls_cast *) +lemma cpxs_fwd_cast_vector (h) (G) (L): + ∀Vs,W,T,X2. ⦃G,L⦄ ⊢ ⒶVs.ⓝW.T ⬈*[h] X2 → + ∨∨ ⒶVs. ⓝW. T ⩳ X2 + | ⦃G,L⦄ ⊢ ⒶVs.T ⬈*[h] X2 + | ⦃G,L⦄ ⊢ ⒶVs.W ⬈*[h] X2. +#h #G #L #Vs elim Vs -Vs /2 width=1 by cpxs_fwd_cast/ +#V #Vs #IHVs #W #T #X2 #H +elim (cpxs_inv_appl1 … H) -H * +[ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by toeq_pair, or3_intro0/ +| #q #W0 #T0 #HT0 #HU elim (IHVs … HT0) -IHVs -HT0 #HT0 + [ elim (toeq_inv_applv_bind_simple … HT0) // + | @or3_intro1 -W (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /2 width=1 by cpxs_flat_dx, cpx_beta/ + | @or3_intro2 -T (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /2 width=1 by cpxs_flat_dx, cpx_beta/ + ] +| #q #V0 #V1 #V2 #T0 #HV0 #HV01 #HT0 #HU + elim (IHVs … HT0) -IHVs -HT0 #HT0 + [ elim (toeq_inv_applv_bind_simple … HT0) // + | @or3_intro1 -W (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV0.ⓓ{q}V2.T0)) /2 width=3 by cpxs_flat, cpx_theta/ + | @or3_intro2 -T (**) (* explicit constructor *) + @(cpxs_trans … HU) -X2 + @(cpxs_strap1 … (ⓐV0.ⓓ{q}V2.T0)) /2 width=3 by cpxs_flat, cpx_theta/ + ] +] +qed-. + +(* Basic_1: was just: nf2_iso_appls_lref *) +lemma cpxs_fwd_cnx_vector (h) (G) (L): + ∀T. 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T⦄ → + ∀Vs,X2. ⦃G,L⦄ ⊢ ⒶVs.T ⬈*[h] X2 → ⒶVs.T ⩳ X2. +#h #G #L #T #H1T #H2T #Vs elim Vs -Vs [ @(cpxs_fwd_cnx … H2T) ] (**) (* /2 width=3 by cpxs_fwd_cnx/ does not work *) +#V #Vs #IHVs #X2 #H +elim (cpxs_inv_appl1 … H) -H * +[ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by toeq_pair/ +| #p #W0 #T0 #HT0 #HU + lapply (IHVs … HT0) -IHVs -HT0 #HT0 + elim (toeq_inv_applv_bind_simple … HT0) // +| #p #V1 #V2 #V0 #T0 #HV1 #HV12 #HT0 #HU + lapply (IHVs … HT0) -IHVs -HT0 #HT0 + elim (toeq_inv_applv_bind_simple … HT0) // +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx.ma index 4c8371a0b..7fe343b8a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx.ma @@ -12,83 +12,83 @@ (* *) (**************************************************************************) -include "basic_2/notation/relations/predtystrong_5.ma". +include "basic_2/notation/relations/predtystrong_4.ma". include "static_2/syntax/tdeq.ma". include "basic_2/rt_transition/cpx.ma". (* STRONGLY NORMALIZING TERMS FOR UNBOUND PARALLEL RT-TRANSITION ************) -definition csx: ∀h. sd h → relation3 genv lenv term ≝ - λh,o,G,L. SN … (cpx h G L) (tdeq h o …). +definition csx: ∀h. relation3 genv lenv term ≝ + λh,G,L. SN … (cpx h G L) tdeq. interpretation "strong normalization for unbound context-sensitive parallel rt-transition (term)" - 'PRedTyStrong h o G L T = (csx h o G L T). + 'PRedTyStrong h G L T = (csx h G L T). (* Basic eliminators ********************************************************) -lemma csx_ind: ∀h,o,G,L. ∀Q:predicate term. - (∀T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛[h, o] T2 → ⊥) → Q T2) → +lemma csx_ind: ∀h,G,L. ∀Q:predicate term. + (∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → - ∀T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → Q T. -#h #o #G #L #Q #H0 #T1 #H elim H -T1 + ∀T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → Q T. +#h #G #L #Q #H0 #T1 #H elim H -T1 /5 width=1 by SN_intro/ qed-. (* Basic properties *********************************************************) (* Basic_1: was just: sn3_pr2_intro *) -lemma csx_intro: ∀h,o,G,L,T1. - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛[h, o] T2 → ⊥) → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄) → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄. +lemma csx_intro: ∀h,G,L,T1. + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛ T2 → ⊥) → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄) → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄. /4 width=1 by SN_intro/ qed. (* Basic forward lemmas *****************************************************) -fact csx_fwd_pair_sn_aux: ∀h,o,G,L,U. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃U⦄ → - ∀I,V,T. U = ②{I}V.T → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄. -#h #o #G #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct +fact csx_fwd_pair_sn_aux: ∀h,G,L,U. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃U⦄ → + ∀I,V,T. U = ②{I}V.T → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄. +#h #G #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct @csx_intro #V2 #HLV2 #HV2 @(IH (②{I}V2.T)) -IH /2 width=3 by cpx_pair_sn/ -HLV2 #H elim (tdeq_inv_pair … H) -H /2 width=1 by/ qed-. (* Basic_1: was just: sn3_gen_head *) -lemma csx_fwd_pair_sn: ∀h,o,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃②{I}V.T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄. +lemma csx_fwd_pair_sn: ∀h,I,G,L,V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃②{I}V.T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄. /2 width=5 by csx_fwd_pair_sn_aux/ qed-. -fact csx_fwd_bind_dx_aux: ∀h,o,G,L,U. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃U⦄ → - ∀p,I,V,T. U = ⓑ{p,I}V.T → ⦃G, L.ⓑ{I}V⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L #U #H elim H -H #U0 #_ #IH #p #I #V #T #H destruct +fact csx_fwd_bind_dx_aux: ∀h,G,L,U. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃U⦄ → + ∀p,I,V,T. U = ⓑ{p,I}V.T → ⦃G,L.ⓑ{I}V⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L #U #H elim H -H #U0 #_ #IH #p #I #V #T #H destruct @csx_intro #T2 #HLT2 #HT2 -@(IH (ⓑ{p,I}V.T2)) -IH /2 width=3 by cpx_bind/ -HLT2 +@(IH (ⓑ{p, I}V.T2)) -IH /2 width=3 by cpx_bind/ -HLT2 #H elim (tdeq_inv_pair … H) -H /2 width=1 by/ qed-. (* Basic_1: was just: sn3_gen_bind *) -lemma csx_fwd_bind_dx: ∀h,o,p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓑ{p,I}V.T⦄ → ⦃G, L.ⓑ{I}V⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma csx_fwd_bind_dx: ∀h,p,I,G,L,V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓑ{p,I}V.T⦄ → ⦃G,L.ⓑ{I}V⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /2 width=4 by csx_fwd_bind_dx_aux/ qed-. -fact csx_fwd_flat_dx_aux: ∀h,o,G,L,U. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃U⦄ → - ∀I,V,T. U = ⓕ{I}V.T → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct +fact csx_fwd_flat_dx_aux: ∀h,G,L,U. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃U⦄ → + ∀I,V,T. U = ⓕ{I}V.T → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct @csx_intro #T2 #HLT2 #HT2 @(IH (ⓕ{I}V.T2)) -IH /2 width=3 by cpx_flat/ -HLT2 #H elim (tdeq_inv_pair … H) -H /2 width=1 by/ qed-. (* Basic_1: was just: sn3_gen_flat *) -lemma csx_fwd_flat_dx: ∀h,o,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓕ{I}V.T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma csx_fwd_flat_dx: ∀h,I,G,L,V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓕ{I}V.T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /2 width=5 by csx_fwd_flat_dx_aux/ qed-. -lemma csx_fwd_bind: ∀h,o,p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓑ{p,I}V.T⦄ → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma csx_fwd_bind: ∀h,p,I,G,L,V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓑ{p,I}V.T⦄ → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ ∧ ⦃G,L.ⓑ{I}V⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /3 width=3 by csx_fwd_pair_sn, csx_fwd_bind_dx, conj/ qed-. -lemma csx_fwd_flat: ∀h,o,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓕ{I}V.T⦄ → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ ∧ ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma csx_fwd_flat: ∀h,I,G,L,V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓕ{I}V.T⦄ → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ ∧ ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /3 width=3 by csx_fwd_pair_sn, csx_fwd_flat_dx, conj/ qed-. (* Basic_1: removed theorems 14: diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_aaa.ma index 6cc0664aa..dfbcf7e48 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_aaa.ma @@ -21,40 +21,40 @@ include "basic_2/rt_computation/csx_gcr.ma". (* Main properties with atomic arity assignment *****************************) -theorem aaa_csx: ∀h,o,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L #T #A #H -@(gcr_aaa … (csx_gcp h o) (csx_gcr h o) … H) +theorem aaa_csx: ∀h,G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L #T #A #H +@(gcr_aaa … (csx_gcp h) (csx_gcr h) … H) qed. (* Advanced eliminators *****************************************************) -fact aaa_ind_csx_aux: ∀h,o,G,L,A. ∀Q:predicate term. - (∀T1. ⦃G, L⦄ ⊢ T1 ⁝ A → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛[h, o] T2 → ⊥) → Q T2) → Q T1 +fact aaa_ind_csx_aux: ∀h,G,L,A. ∀Q:predicate term. + (∀T1. ⦃G,L⦄ ⊢ T1 ⁝ A → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → - ∀T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ T ⁝ A → Q T. -#h #o #G #L #A #Q #IH #T #H @(csx_ind … H) -T /4 width=5 by cpx_aaa_conf/ + ∀T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ T ⁝ A → Q T. +#h #G #L #A #Q #IH #T #H @(csx_ind … H) -T /4 width=5 by cpx_aaa_conf/ qed-. -lemma aaa_ind_csx: ∀h,o,G,L,A. ∀Q:predicate term. - (∀T1. ⦃G, L⦄ ⊢ T1 ⁝ A → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛[h, o] T2 → ⊥) → Q T2) → Q T1 +lemma aaa_ind_csx: ∀h,G,L,A. ∀Q:predicate term. + (∀T1. ⦃G,L⦄ ⊢ T1 ⁝ A → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → - ∀T. ⦃G, L⦄ ⊢ T ⁝ A → Q T. + ∀T. ⦃G,L⦄ ⊢ T ⁝ A → Q T. /5 width=9 by aaa_ind_csx_aux, aaa_csx/ qed-. -fact aaa_ind_csx_cpxs_aux: ∀h,o,G,L,A. ∀Q:predicate term. - (∀T1. ⦃G, L⦄ ⊢ T1 ⁝ A → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛[h, o] T2 → ⊥) → Q T2) → Q T1 +fact aaa_ind_csx_cpxs_aux: ∀h,G,L,A. ∀Q:predicate term. + (∀T1. ⦃G,L⦄ ⊢ T1 ⁝ A → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → - ∀T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ T ⁝ A → Q T. -#h #o #G #L #A #Q #IH #T #H @(csx_ind_cpxs … H) -T /4 width=5 by cpxs_aaa_conf/ + ∀T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ T ⁝ A → Q T. +#h #G #L #A #Q #IH #T #H @(csx_ind_cpxs … H) -T /4 width=5 by cpxs_aaa_conf/ qed-. (* Basic_2A1: was: aaa_ind_csx_alt *) -lemma aaa_ind_csx_cpxs: ∀h,o,G,L,A. ∀Q:predicate term. - (∀T1. ⦃G, L⦄ ⊢ T1 ⁝ A → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛[h, o] T2 → ⊥) → Q T2) → Q T1 +lemma aaa_ind_csx_cpxs: ∀h,G,L,A. ∀Q:predicate term. + (∀T1. ⦃G,L⦄ ⊢ T1 ⁝ A → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → - ∀T. ⦃G, L⦄ ⊢ T ⁝ A → Q T. + ∀T. ⦃G,L⦄ ⊢ T ⁝ A → Q T. /5 width=9 by aaa_ind_csx_cpxs_aux, aaa_csx/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx.ma index 24320b69f..3cd1edff9 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx.ma @@ -20,18 +20,10 @@ include "basic_2/rt_computation/csx.ma". (* Properties with normal terms for unbound parallel rt-transition **********) (* Basic_1: was just: sn3_nf2 *) -lemma cnx_csx: ∀h,o,G,L,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma cnx_csx: ∀h,G,L,T. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /2 width=1 by NF_to_SN/ qed. (* Advanced properties ******************************************************) -lemma csx_sort: ∀h,o,G,L,s. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃⋆s⦄. -#h #o #G #L #s elim (deg_total h o s) -#d generalize in match s; -s elim d -d -[ /3 width=3 by cnx_csx, cnx_sort/ -| #d #IH #s #Hsd lapply (deg_next_SO … Hsd) -Hsd - #Hsd @csx_intro #X #H #HX - elim (cpx_inv_sort1 … H) -H #H destruct /2 width=1 by/ - elim HX -HX // -] -qed. +lemma csx_sort: ∀h,G,L,s. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃⋆s⦄. +/3 width=4 by cnx_csx, cnx_sort/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx_vector.ma index 4a93b473e..6d75480ff 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx_vector.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cnx_vector.ma @@ -14,8 +14,8 @@ (* STRONGLY NORMALIZING TERM VECTORS FOR UNBOUND PARALLEL RT-TRANSITION *****) -include "basic_2/rt_computation/cpxs_theq_vector.ma". -include "basic_2/rt_computation/csx_simple_theq.ma". +include "basic_2/rt_computation/cpxs_toeq_vector.ma". +include "basic_2/rt_computation/csx_simple_toeq.ma". include "basic_2/rt_computation/csx_cnx.ma". include "basic_2/rt_computation/csx_cpxs.ma". include "basic_2/rt_computation/csx_vector.ma". @@ -23,34 +23,23 @@ include "basic_2/rt_computation/csx_vector.ma". (* Properties with normal terms for unbound parallel rt-transition **********) (* Basic_1: was just: sn3_appls_lref *) -lemma csx_applv_cnx: ∀h,o,G,L,T. 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ → - ∀Vs. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃Vs⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.T⦄. -#h #o #G #L #T #H1T #H2T #Vs elim Vs -Vs -[ #_ normalize in ⊢ (?????%); /2 width=1/ +lemma csx_applv_cnx (h) (G) (L): + ∀T. 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T⦄ → + ∀Vs. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃Vs⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.T⦄. +#h #G #L #T #H1T #H2T #Vs elim Vs -Vs +[ #_ normalize in ⊢ (????%); /2 width=1 by cnx_csx/ | #V #Vs #IHV #H elim (csxv_inv_cons … H) -H #HV #HVs - @csx_appl_simple_theq /2 width=1 by applv_simple/ -IHV -HV -HVs + @csx_appl_simple_toeq /2 width=1 by applv_simple/ -IHV -HV -HVs #X #H #H0 - lapply (cpxs_fwd_cnx_vector … o … H) -H // -H1T -H2T #H + lapply (cpxs_fwd_cnx_vector … H) -H // -H1T -H2T #H elim (H0) -H0 // ] qed. (* Advanced properties ******************************************************) -lemma csx_applv_sort: ∀h,o,G,L,s,Vs. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃Vs⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.⋆s⦄. -#h #o #G #L #s elim (deg_total h o s) -#d generalize in match s; -s elim d -d -[ /3 width=6 by csx_applv_cnx, cnx_sort, simple_atom/ -| #d #IHd #s #Hd #Vs elim Vs -Vs /2 width=1 by/ - #V #Vs #IHVs #HVVs - elim (csxv_inv_cons … HVVs) #HV #HVs - @csx_appl_simple_theq /2 width=1 by applv_simple, simple_atom/ - #X #H #H0 - elim (cpxs_fwd_sort_vector … o … H) -H #H - [ elim H0 -H0 // - | -H0 @(csx_cpxs_trans … (Ⓐ(V⨮Vs).⋆(next h s))) - /3 width=1 by cpxs_flat_dx, deg_next_SO/ - ] -] -qed. +(* Note: strong normalization does not depend on this any more *) +lemma csx_applv_sort (h) (G) (L): + ∀s,Vs. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃Vs⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.⋆s⦄. +/3 width=6 by csx_applv_cnx, cnx_sort, simple_atom/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma index 3a8a70ef9..aa206225c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma @@ -21,33 +21,33 @@ include "basic_2/rt_computation/csx_csx.ma". (* Properties with unbound context-sensitive rt-computation for terms *******) (* Basic_1: was just: sn3_intro *) -lemma csx_intro_cpxs: ∀h,o,G,L,T1. - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛[h, o] T2 → ⊥) → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄) → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄. +lemma csx_intro_cpxs: ∀h,G,L,T1. + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛ T2 → ⊥) → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄) → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄. /4 width=1 by cpx_cpxs, csx_intro/ qed-. (* Basic_1: was just: sn3_pr3_trans *) -lemma csx_cpxs_trans: ∀h,o,G,L,T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #G #L #T1 #HT1 #T2 #H @(cpxs_ind … H) -T2 +lemma csx_cpxs_trans: ∀h,G,L,T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #G #L #T1 #HT1 #T2 #H @(cpxs_ind … H) -T2 /2 width=3 by csx_cpx_trans/ qed-. (* Eliminators with unbound context-sensitive rt-computation for terms ******) -lemma csx_ind_cpxs_tdeq: ∀h,o,G,L. ∀Q:predicate term. - (∀T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛[h, o] T2 → ⊥) → Q T2) → Q T1 +lemma csx_ind_cpxs_tdeq: ∀h,G,L. ∀Q:predicate term. + (∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → - ∀T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀T0. ⦃G, L⦄ ⊢ T1 ⬈*[h] T0 → ∀T2. T0 ≛[h, o] T2 → Q T2. -#h #o #G #L #Q #IH #T1 #H @(csx_ind … H) -T1 + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀T0. ⦃G,L⦄ ⊢ T1 ⬈*[h] T0 → ∀T2. T0 ≛ T2 → Q T2. +#h #G #L #Q #IH #T1 #H @(csx_ind … H) -T1 #T1 #HT1 #IH1 #T0 #HT10 #T2 #HT02 @IH -IH /3 width=3 by csx_cpxs_trans, csx_tdeq_trans/ -HT1 #V2 #HTV2 #HnTV2 lapply (tdeq_tdneq_trans … HT02 … HnTV2) -HnTV2 #H elim (tdeq_cpxs_trans … HT02 … HTV2) -T2 #V0 #HTV0 #HV02 lapply (tdneq_tdeq_canc_dx … H … HV02) -H #HnTV0 -elim (tdeq_dec h o T1 T0) #H +elim (tdeq_dec T1 T0) #H [ lapply (tdeq_tdneq_trans … H … HnTV0) -H -HnTV0 #Hn10 lapply (cpxs_trans … HT10 … HTV0) -T0 #H10 elim (cpxs_tdneq_fwd_step_sn … H10 … Hn10) -H10 -Hn10 @@ -59,11 +59,11 @@ elim (tdeq_dec h o T1 T0) #H qed-. (* Basic_2A1: was: csx_ind_alt *) -lemma csx_ind_cpxs: ∀h,o,G,L. ∀Q:predicate term. - (∀T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛[h, o] T2 → ⊥) → Q T2) → Q T1 +lemma csx_ind_cpxs: ∀h,G,L. ∀Q:predicate term. + (∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → - ∀T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → Q T. -#h #o #G #L #Q #IH #T #HT + ∀T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → Q T. +#h #G #L #Q #IH #T #HT @(csx_ind_cpxs_tdeq … IH … HT) -IH -HT // (**) (* full auto fails *) qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma index 5efee8db4..b0921440d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma @@ -19,23 +19,26 @@ include "basic_2/rt_computation/csx_drops.ma". (* Advanced properties ******************************************************) -lemma csx_tdeq_trans: ∀h,o,G,L,T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀T2. T1 ≛[h, o] T2 → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #G #L #T1 #H @(csx_ind … H) -T1 #T #_ #IH #T2 #HT2 +lemma csx_tdeq_trans (h) (G): + ∀L,T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀T2. T1 ≛ T2 → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #G #L #T1 #H @(csx_ind … H) -T1 #T #_ #IH #T2 #HT2 @csx_intro #T1 #HT21 #HnT21 elim (tdeq_cpx_trans … HT2 … HT21) -HT21 /4 width=5 by tdeq_repl/ qed-. -lemma csx_cpx_trans: ∀h,o,G,L,T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #G #L #T1 #H @(csx_ind … H) -T1 #T1 #HT1 #IHT1 #T2 #HLT12 -elim (tdeq_dec h o T1 T2) /3 width=4 by csx_tdeq_trans/ +lemma csx_cpx_trans (h) (G): + ∀L,T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #G #L #T1 #H @(csx_ind … H) -T1 #T1 #HT1 #IHT1 #T2 #HLT12 +elim (tdeq_dec T1 T2) /3 width=4 by csx_tdeq_trans/ qed-. (* Basic_1: was just: sn3_cast *) -lemma csx_cast: ∀h,o,G,L,W. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃W⦄ → - ∀T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓝW.T⦄. -#h #o #G #L #W #HW @(csx_ind … HW) -W +lemma csx_cast (h) (G): + ∀L,W. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃W⦄ → + ∀T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓝW.T⦄. +#h #G #L #W #HW @(csx_ind … HW) -W #W #HW #IHW #T #HT @(csx_ind … HT) -T #T #HT #IHT @csx_intro #X #H1 #H2 elim (cpx_inv_cast1 … H1) -H1 @@ -51,9 +54,10 @@ qed. (* Basic_1: was just: sn3_abbr *) (* Basic_2A1: was: csx_lref_bind *) -lemma csx_lref_pair: ∀h,o,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → - ⦃G, K⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃#i⦄. -#h #o #I #G #L #K #V #i #HLK #HV +lemma csx_lref_pair_drops (h) (G): + ∀I,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → + ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃#i⦄. +#h #G #I #L #K #V #i #HLK #HV @csx_intro #X #H #Hi elim (cpx_inv_lref1_drops … H) -H [ #H destruct elim Hi // | -Hi * #I0 #K0 #V0 #V1 #HLK0 #HV01 #HV1 @@ -66,17 +70,19 @@ qed. (* Basic_1: was: sn3_gen_def *) (* Basic_2A1: was: csx_inv_lref_bind *) -lemma csx_inv_lref_pair: ∀h,o,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃#i⦄ → ⦃G, K⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄. -#h #o #I #G #L #K #V #i #HLK #Hi +lemma csx_inv_lref_pair_drops (h) (G): + ∀I,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃#i⦄ → ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄. +#h #G #I #L #K #V #i #HLK #Hi elim (lifts_total V (𝐔❴↑i❵)) /4 width=9 by csx_inv_lifts, csx_cpx_trans, cpx_delta_drops, drops_isuni_fwd_drop2/ qed-. -lemma csx_inv_lref: ∀h,o,G,L,i. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃#i⦄ → - ∨∨ ⬇*[Ⓕ, 𝐔❴i❵] L ≘ ⋆ - | ∃∃I,K. ⬇*[i] L ≘ K.ⓤ{I} - | ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G, K⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄. -#h #o #G #L #i #H elim (drops_F_uni L i) /2 width=1 by or3_intro0/ -* * /4 width=9 by csx_inv_lref_pair, ex2_3_intro, ex1_2_intro, or3_intro2, or3_intro1/ +lemma csx_inv_lref_drops (h) (G): + ∀L,i. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃#i⦄ → + ∨∨ ⬇*[Ⓕ,𝐔❴i❵] L ≘ ⋆ + | ∃∃I,K. ⬇*[i] L ≘ K.ⓤ{I} + | ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄. +#h #G #L #i #H elim (drops_F_uni L i) /2 width=1 by or3_intro0/ +* * /4 width=9 by csx_inv_lref_pair_drops, ex2_3_intro, ex1_2_intro, or3_intro2, or3_intro1/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx_vector.ma index 30f35f70f..571a81546 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx_vector.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx_vector.ma @@ -12,8 +12,8 @@ (* *) (**************************************************************************) -include "basic_2/rt_computation/cpxs_theq_vector.ma". -include "basic_2/rt_computation/csx_simple_theq.ma". +include "basic_2/rt_computation/cpxs_toeq_vector.ma". +include "basic_2/rt_computation/csx_simple_toeq.ma". include "basic_2/rt_computation/csx_lsubr.ma". include "basic_2/rt_computation/csx_lpx.ma". include "basic_2/rt_computation/csx_vector.ma". @@ -23,31 +23,33 @@ include "basic_2/rt_computation/csx_vector.ma". (* Advanced properties ************************************* ****************) (* Basic_1: was just: sn3_appls_beta *) -lemma csx_applv_beta: ∀h,o,p,G,L,Vs,V,W,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.ⓓ{p}ⓝW.V.T⦄ → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.ⓐV.ⓛ{p}W.T⦄. -#h #o #p #G #L #Vs elim Vs -Vs /2 width=1 by csx_appl_beta/ +lemma csx_applv_beta (h) (G): + ∀p,L,Vs,V,W,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.ⓓ{p}ⓝW.V.T⦄ → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.ⓐV.ⓛ{p}W.T⦄. +#h #G #p #L #Vs elim Vs -Vs /2 width=1 by csx_appl_beta/ #V0 #Vs #IHV #V #W #T #H1T lapply (csx_fwd_pair_sn … H1T) #HV0 lapply (csx_fwd_flat_dx … H1T) #H2T -@csx_appl_simple_theq /2 width=1 by applv_simple, simple_flat/ -IHV -HV0 -H2T +@csx_appl_simple_toeq /2 width=1 by applv_simple, simple_flat/ -IHV -HV0 -H2T #X #H #H0 -elim (cpxs_fwd_beta_vector … o … H) -H #H +elim (cpxs_fwd_beta_vector … H) -H #H [ -H1T elim H0 -H0 // | -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/ ] qed. -lemma csx_applv_delta: ∀h,o,I,G,L,K,V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 → - ∀V2. ⬆*[↑i] V1 ≘ V2 → - ∀Vs. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.V2⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.#i⦄. -#h #o #I #G #L #K #V1 #i #HLK #V2 #HV12 #Vs elim Vs -Vs -[ /4 width=11 by csx_inv_lifts, csx_lref_pair, drops_isuni_fwd_drop2/ +lemma csx_applv_delta_drops (h) (G): + ∀I,L,K,V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 → + ∀V2. ⬆*[↑i] V1 ≘ V2 → + ∀Vs. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.V2⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.#i⦄. +#h #G #I #L #K #V1 #i #HLK #V2 #HV12 #Vs elim Vs -Vs +[ /4 width=11 by csx_inv_lifts, csx_lref_pair_drops, drops_isuni_fwd_drop2/ | #V #Vs #IHV #H1T lapply (csx_fwd_pair_sn … H1T) #HV lapply (csx_fwd_flat_dx … H1T) #H2T - @csx_appl_simple_theq /2 width=1 by applv_simple, simple_atom/ -IHV -HV -H2T + @csx_appl_simple_toeq /2 width=1 by applv_simple, simple_atom/ -IHV -HV -H2T #X #H #H0 - elim (cpxs_fwd_delta_drops_vector … o … HLK … HV12 … H) -HLK -HV12 -H #H + elim (cpxs_fwd_delta_drops_vector … HLK … HV12 … H) -HLK -HV12 -H #H [ -H1T elim H0 -H0 // | -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/ ] @@ -55,10 +57,10 @@ lemma csx_applv_delta: ∀h,o,I,G,L,K,V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 → qed. (* Basic_1: was just: sn3_appls_abbr *) -lemma csx_applv_theta: ∀h,o,p,G,L,V1b,V2b. ⬆*[1] V1b ≘ V2b → - ∀V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓓ{p}V.ⒶV2b.T⦄ → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶV1b.ⓓ{p}V.T⦄. -#h #o #p #G #L #V1b #V2b * -V1b -V2b /2 width=1 by/ +lemma csx_applv_theta (h) (G): + ∀p,L,V1b,V2b. ⬆*[1] V1b ≘ V2b → + ∀V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓓ{p}V.ⒶV2b.T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶV1b.ⓓ{p}V.T⦄. +#h #G #p #L #V1b #V2b * -V1b -V2b /2 width=1 by/ #V1b #V2b #V1 #V2 #HV12 #H generalize in match HV12; -HV12 generalize in match V2; -V2 generalize in match V1; -V1 elim H -V1b -V2b /2 width=3 by csx_appl_theta/ @@ -66,24 +68,25 @@ elim H -V1b -V2b /2 width=3 by csx_appl_theta/ lapply (csx_appl_theta … H … HW12) -H -HW12 #H lapply (csx_fwd_pair_sn … H) #HW1 lapply (csx_fwd_flat_dx … H) #H1 -@csx_appl_simple_theq /2 width=3 by simple_flat/ -IHV12b -HW1 -H1 #X #H1 #H2 -elim (cpxs_fwd_theta_vector … o … (V2⨮V2b) … H1) -H1 /2 width=1 by liftsv_cons/ -HV12b -HV12 +@csx_appl_simple_toeq /2 width=3 by simple_flat/ -IHV12b -HW1 -H1 #X #H1 #H2 +elim (cpxs_fwd_theta_vector … (V2⨮V2b) … H1) -H1 /2 width=1 by liftsv_cons/ -HV12b -HV12 [ -H #H elim H2 -H2 // | -H2 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/ ] qed. (* Basic_1: was just: sn3_appls_cast *) -lemma csx_applv_cast: ∀h,o,G,L,Vs,U. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.U⦄ → - ∀T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.ⓝU.T⦄. -#h #o #G #L #Vs elim Vs -Vs /2 width=1 by csx_cast/ +lemma csx_applv_cast (h) (G): + ∀L,Vs,U. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.U⦄ → + ∀T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.ⓝU.T⦄. +#h #G #L #Vs elim Vs -Vs /2 width=1 by csx_cast/ #V #Vs #IHV #U #H1U #T #H1T lapply (csx_fwd_pair_sn … H1U) #HV lapply (csx_fwd_flat_dx … H1U) #H2U lapply (csx_fwd_flat_dx … H1T) #H2T -@csx_appl_simple_theq /2 width=1 by applv_simple, simple_flat/ -IHV -HV -H2U -H2T +@csx_appl_simple_toeq /2 width=1 by applv_simple, simple_flat/ -IHV -HV -H2U -H2T #X #H #H0 -elim (cpxs_fwd_cast_vector … o … H) -H #H +elim (cpxs_fwd_cast_vector … H) -H #H [ -H1U -H1T elim H0 -H0 // | -H1U -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/ | -H1T -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_drops.ma index c0ecbf084..ad0c072fb 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_drops.ma @@ -22,8 +22,8 @@ include "basic_2/rt_computation/csx.ma". (* Basic_1: was just: sn3_lift *) (* Basic_2A1: was just: csx_lift *) -lemma csx_lifts: ∀h,o,G. d_liftable1 … (csx h o G). -#h #o #G #K #T #H @(csx_ind … H) -T +lemma csx_lifts: ∀h,G. d_liftable1 … (csx h G). +#h #G #K #T #H @(csx_ind … H) -T #T1 #_ #IH #b #f #L #HLK #U1 #HTU1 @csx_intro #U2 #HU12 #HnU12 elim (cpx_inv_lifts_sn … HU12 … HLK … HTU1) -HU12 @@ -34,8 +34,8 @@ qed-. (* Basic_1: was just: sn3_gen_lift *) (* Basic_2A1: was just: csx_inv_lift *) -lemma csx_inv_lifts: ∀h,o,G. d_deliftable1 … (csx h o G). -#h #o #G #L #U #H @(csx_ind … H) -U +lemma csx_inv_lifts: ∀h,G. d_deliftable1 … (csx h G). +#h #G #L #U #H @(csx_ind … H) -U #U1 #_ #IH #b #f #K #HLK #T1 #HTU1 @csx_intro #T2 #HT12 #HnT12 elim (cpx_lifts_sn … HT12 … HLK … HTU1) -HT12 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fdeq.ma index 7c58163b3..fcb2f9af8 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fdeq.ma @@ -17,10 +17,10 @@ include "basic_2/rt_computation/csx_rdeq.ma". (* STRONGLY NORMALIZING TERMS FOR UNBOUND PARALLEL RT-TRANSITION ************) -(* Properties with degree-based equivalence for closures ********************) +(* Properties with sort-irrelevant equivalence for closures *****************) -lemma csx_fdeq_conf: ∀h,o,G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G2, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #G1 #L1 #T1 #HT1 #G2 #L2 #T2 * -G2 -L2 -T2 +lemma csx_fdeq_conf: ∀h,G1,L1,T1. ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G2,L2⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #G1 #L1 #T1 #HT1 #G2 #L2 #T2 * -G2 -L2 -T2 /3 width=3 by csx_rdeq_conf, csx_tdeq_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fpbq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fpbq.ma index fbc312d03..6027a70f5 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fpbq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fpbq.ma @@ -22,8 +22,8 @@ include "basic_2/rt_computation/csx_lpx.ma". (* Properties with parallel rst-transition for closures *********************) (* Basic_2A1: was: csx_fpb_conf *) -lemma csx_fpbq_conf: ∀h,o,G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≽[h, o] ⦃G2, L2, T2⦄ → ⦃G2, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #G1 #L1 #T1 #HT1 #G2 #L2 #T2 * +lemma csx_fpbq_conf: ∀h,G1,L1,T1. ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≽[h] ⦃G2,L2,T2⦄ → ⦃G2,L2⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #G1 #L1 #T1 #HT1 #G2 #L2 #T2 * /2 width=6 by csx_cpx_trans, csx_fquq_conf, csx_lpx_conf, csx_fdeq_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fqus.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fqus.ma index 0943a9add..c35a584bb 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fqus.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_fqus.ma @@ -19,10 +19,11 @@ include "basic_2/rt_computation/csx_lsubr.ma". (* Properties with extended supclosure **************************************) -lemma csx_fqu_conf: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → ⦃G2, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 -[ /3 width=5 by csx_inv_lref_pair, drops_refl/ +lemma csx_fqu_conf (h) (b): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ⦃G2,L2⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 +[ /3 width=5 by csx_inv_lref_pair_drops, drops_refl/ | /2 width=3 by csx_fwd_pair_sn/ | /2 width=2 by csx_fwd_bind_dx/ | /2 width=4 by csx_fwd_bind_dx_unit/ @@ -31,20 +32,23 @@ lemma csx_fqu_conf: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L ] qed-. -lemma csx_fquq_conf: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → ⦃G2, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 * /2 width=6 by csx_fqu_conf/ +lemma csx_fquq_conf (h) (b): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ⦃G2,L2⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 * /2 width=6 by csx_fqu_conf/ * #HG #HL #HT destruct // qed-. -lemma csx_fqup_conf: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → ⦃G2, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 +lemma csx_fqup_conf (h) (b): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ⦃G2,L2⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 /3 width=6 by csx_fqu_conf/ qed-. -lemma csx_fqus_conf: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → ⦃G2, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -H +lemma csx_fqus_conf (h) (b): + ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ⦃G2,L2⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -H /3 width=6 by csx_fquq_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcp.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcp.ma index f5b170930..716032c85 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcp.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcp.ma @@ -20,10 +20,10 @@ include "basic_2/rt_computation/csx_drops.ma". (* Main properties with generic computation properties **********************) -theorem csx_gcp: ∀h,o. gcp (cpx h) (tdeq h o) (csx h o). -#h #o @mk_gcp +theorem csx_gcp: ∀h. gcp (cpx h) tdeq (csx h). +#h @mk_gcp [ normalize /3 width=13 by cnx_lifts/ -| #G #L elim (deg_total h o 0) /3 width=8 by cnx_sort_iter, ex_intro/ +| /2 width=4 by cnx_sort/ | /2 width=8 by csx_lifts/ | /2 width=3 by csx_fwd_flat_dx/ ] diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcr.ma index 03970d35b..d0644bbf5 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_gcr.ma @@ -20,13 +20,14 @@ include "basic_2/rt_computation/csx_csx_vector.ma". (* Main properties with generic candidates of reducibility ******************) -theorem csx_gcr: ∀h,o. gcr (cpx h) (tdeq h o) (csx h o) (csx h o). -#h #o @mk_gcr // -[ /3 width=1 by csx_applv_cnx/ -|2,3,6: /2 width=1 by csx_applv_beta, csx_applv_sort, csx_applv_cast/ -| /2 width=7 by csx_applv_delta/ -| #G #L #V1b #V2b #HV12b #a #V #T #H #HV - @(csx_applv_theta … HV12b) -HV12b - @csx_abbr // +theorem csx_gcr (h): gcr (cpx h) tdeq (csx h) (csx h). +#h @mk_gcr +[ // +| #G #L #Vs #Hvs #T #HT #H + @(csx_applv_cnx … H) -H // (**) (* auto fails *) +| /2 width=1 by csx_applv_beta/ +| /2 width=7 by csx_applv_delta_drops/ +| /3 width=3 by csx_applv_theta, csx_abbr/ +| /2 width=1 by csx_applv_cast/ ] qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma index 980c1f12d..8c4f35b6c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma @@ -19,32 +19,35 @@ include "basic_2/rt_computation/csx_cpxs.ma". (* Properties with unbound parallel rt-transition on all entries ************) -lemma csx_lpx_conf: ∀h,o,G,L1,T. ⦃G, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → - ∀L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → ⦃G, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L1 #T #H @(csx_ind_cpxs … H) -T +lemma csx_lpx_conf (h) (G): + ∀L1,T. ⦃G,L1⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → + ∀L2. ⦃G,L1⦄ ⊢ ⬈[h] L2 → ⦃G,L2⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L1 #T #H @(csx_ind_cpxs … H) -T /4 width=3 by csx_intro, lpx_cpx_trans/ qed-. (* Advanced properties ******************************************************) -lemma csx_abst: ∀h,o,p,G,L,W. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃W⦄ → - ∀T. ⦃G, L.ⓛW⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓛ{p}W.T⦄. -#h #o #p #G #L #W #HW +lemma csx_abst (h) (G): + ∀p,L,W. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃W⦄ → + ∀T. ⦃G,L.ⓛW⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓛ{p}W.T⦄. +#h #G #p #L #W #HW @(csx_ind … HW) -W #W #_ #IHW #T #HT @(csx_ind … HT) -T #T #HT #IHT @csx_intro #X #H1 #H2 elim (cpx_inv_abst1 … H1) -H1 #W0 #T0 #HLW0 #HLT0 #H destruct elim (tdneq_inv_pair … H2) -H2 [ #H elim H -H // -| -IHT #H lapply (csx_cpx_trans … o … HLT0) // -HT #HT0 +| -IHT #H lapply (csx_cpx_trans … HLT0) // -HT #HT0 /4 width=5 by csx_lpx_conf, lpx_pair/ | -IHW -HT /4 width=3 by csx_cpx_trans, cpx_pair_sn/ ] qed. -lemma csx_abbr: ∀h,o,p,G,L,V. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ → - ∀T. ⦃G, L.ⓓV⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓓ{p}V.T⦄. -#h #o #p #G #L #V #HV +lemma csx_abbr (h) (G): + ∀p,L,V. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → + ∀T. ⦃G,L.ⓓV⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓓ{p}V.T⦄. +#h #G #p #L #V #HV @(csx_ind … HV) -V #V #_ #IHV #T #HT @(csx_ind_cpxs … HT) -T #T #HT #IHT @csx_intro #X #H1 #H2 @@ -60,9 +63,17 @@ elim (cpx_inv_abbr1 … H1) -H1 * ] qed. -fact csx_appl_theta_aux: ∀h,o,p,G,L,U. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃U⦄ → ∀V1,V2. ⬆*[1] V1 ≘ V2 → - ∀V,T. U = ⓓ{p}V.ⓐV2.T → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV1.ⓓ{p}V.T⦄. -#h #o #p #G #L #X #H +lemma csx_bind (h) (G): + ∀p,I,L,V. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → + ∀T. ⦃G,L.ⓑ{I}V⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓑ{p,I}V.T⦄. +#h #G #p * #L #V #HV #T #HT +/2 width=1 by csx_abbr, csx_abst/ +qed. + +fact csx_appl_theta_aux (h) (G): + ∀p,L,U. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃U⦄ → ∀V1,V2. ⬆*[1] V1 ≘ V2 → + ∀V,T. U = ⓓ{p}V.ⓐV2.T → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV1.ⓓ{p}V.T⦄. +#h #G #p #L #X #H @(csx_ind_cpxs … H) -X #X #HVT #IHVT #V1 #V2 #HV12 #V #T #H destruct lapply (csx_fwd_pair_sn … HVT) #HV lapply (csx_fwd_bind_dx … HVT) -HVT #HVT @@ -72,13 +83,13 @@ elim (cpx_inv_appl1 … HL) -HL * elim (cpx_inv_abbr1 … HL) -HL * [ #V3 #T3 #HV3 #HLT3 #H0 destruct elim (cpx_lifts_sn … HLV10 (Ⓣ) … (L.ⓓV) … HV12) -HLV10 /3 width=1 by drops_refl, drops_drop/ #V4 #HV04 #HV24 - elim (tdeq_dec h o (ⓓ{p}V.ⓐV2.T) (ⓓ{p}V3.ⓐV4.T3)) #H0 + elim (tdeq_dec (ⓓ{p}V.ⓐV2.T) (ⓓ{p}V3.ⓐV4.T3)) #H0 [ -IHVT -HV3 -HV24 -HLT3 elim (tdeq_inv_pair … H0) -H0 #_ #HV3 #H0 elim (tdeq_inv_pair … H0) -H0 #_ #HV24 #HT3 elim (tdneq_inv_pair … H) -H #H elim H -H -G -L /3 width=6 by tdeq_inv_lifts_bi, tdeq_pair/ - | -V1 @(IHVT … H0 … HV04) -o -V0 /4 width=1 by cpx_cpxs, cpx_flat, cpx_bind/ + | -V1 @(IHVT … H0 … HV04) -V0 /4 width=1 by cpx_cpxs, cpx_flat, cpx_bind/ ] | #T0 #HT0 #HLT0 #H0 destruct -H -IHVT lapply (csx_inv_lifts … HVT (Ⓣ) … L ???) -HVT @@ -94,6 +105,7 @@ elim (cpx_inv_appl1 … HL) -HL * ] qed-. -lemma csx_appl_theta: ∀h,o,p,G,L,V,V2,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓓ{p}V.ⓐV2.T⦄ → - ∀V1. ⬆*[1] V1 ≘ V2 → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV1.ⓓ{p}V.T⦄. +lemma csx_appl_theta (h) (G): + ∀p,L,V,V2,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓓ{p}V.ⓐV2.T⦄ → + ∀V1. ⬆*[1] V1 ≘ V2 → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV1.ⓓ{p}V.T⦄. /2 width=5 by csx_appl_theta_aux/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpxs.ma index cc9ae833d..84086bcb6 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpxs.ma @@ -19,8 +19,8 @@ include "basic_2/rt_computation/lpxs_lpx.ma". (* Properties with unbound parallel rt-computation on all entries ***********) -lemma csx_lpxs_conf: ∀h,o,G,L1,L2,T. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - ⦃G, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L1 #L2 #T #H @(lpxs_ind_dx … H) -L2 +lemma csx_lpxs_conf: ∀h,G,L1,L2,T. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + ⦃G,L1⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L2⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L1 #L2 #T #H @(lpxs_ind_dx … H) -L2 /3 by lpxs_step_dx, csx_lpx_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lsubr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lsubr.ma index 169970ed1..5e32b0e6d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lsubr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lsubr.ma @@ -19,9 +19,10 @@ include "basic_2/rt_computation/csx_csx.ma". (* Advanced properties ******************************************************) -fact csx_appl_beta_aux: ∀h,o,p,G,L,U1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃U1⦄ → - ∀V,W,T1. U1 = ⓓ{p}ⓝW.V.T1 → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV.ⓛ{p}W.T1⦄. -#h #o #p #G #L #X #H @(csx_ind … H) -X +fact csx_appl_beta_aux (h) (G): + ∀p,L,U1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃U1⦄ → + ∀V,W,T1. U1 = ⓓ{p}ⓝW.V.T1 → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV.ⓛ{p}W.T1⦄. +#h #G #p #L #X #H @(csx_ind … H) -X #X #HT1 #IHT1 #V #W #T1 #H1 destruct @csx_intro #X #H1 #H2 elim (cpx_inv_appl1 … H1) -H1 * @@ -42,23 +43,37 @@ elim (cpx_inv_appl1 … H1) -H1 * qed-. (* Basic_1: was just: sn3_beta *) -lemma csx_appl_beta: ∀h,o,p,G,L,V,W,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓓ{p}ⓝW.V.T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV.ⓛ{p}W.T⦄. +lemma csx_appl_beta (h) (G): + ∀p,L,V,W,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓓ{p}ⓝW.V.T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV.ⓛ{p}W.T⦄. /2 width=3 by csx_appl_beta_aux/ qed. (* Advanced forward lemmas **************************************************) -fact csx_fwd_bind_dx_unit_aux: ∀h,o,G,L,U. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃U⦄ → - ∀p,I,J,V,T. U = ⓑ{p,I}V.T → ⦃G, L.ⓤ{J}⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L #U #H elim H -H #U0 #_ #IH #p #I #J #V #T #H destruct +fact csx_fwd_bind_dx_unit_aux (h) (G): + ∀L,U. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃U⦄ → + ∀p,I,J,V,T. U = ⓑ{p,I}V.T → ⦃G,L.ⓤ{J}⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L #U #H elim H -H #U0 #_ #IH #p #I #J #V #T #H destruct @csx_intro #T2 #HLT2 #HT2 -@(IH (ⓑ{p,I}V.T2)) -IH /2 width=4 by cpx_bind_unit/ -HLT2 +@(IH (ⓑ{p, I}V.T2)) -IH /2 width=4 by cpx_bind_unit/ -HLT2 #H elim (tdeq_inv_pair … H) -H /2 width=1 by/ qed-. -lemma csx_fwd_bind_dx_unit: ∀h,o,p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓑ{p,I}V.T⦄ → - ∀J. ⦃G, L.ⓤ{J}⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma csx_fwd_bind_dx_unit (h) (G): + ∀p,I,L,V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓑ{p,I}V.T⦄ → + ∀J. ⦃G,L.ⓤ{J}⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /2 width=6 by csx_fwd_bind_dx_unit_aux/ qed-. -lemma csx_fwd_bind_unit: ∀h,o,p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓑ{p,I}V.T⦄ → - ∀J. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ ∧ ⦃G, L.ⓤ{J}⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma csx_fwd_bind_unit (h) (G): + ∀p,I,L,V,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓑ{p,I}V.T⦄ → + ∀J. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ ∧ ⦃G,L.ⓤ{J}⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /3 width=4 by csx_fwd_pair_sn, csx_fwd_bind_dx_unit, conj/ qed-. + +(* Properties with restricted refinement for local environments *************) + +lemma csx_lsubr_conf (h) (G): + ∀L1,T. ⦃G,L1⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ∀L2. L1 ⫃ L2 → ⦃G,L2⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L1 #T #H +@(csx_ind … H) -T #T1 #_ #IH #L2 #HL12 +@csx_intro #T2 #HT12 #HnT12 +/3 width=3 by lsubr_cpx_trans/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_rdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_rdeq.ma index de6114d2f..dcd0462e1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_rdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_rdeq.ma @@ -17,19 +17,19 @@ include "basic_2/rt_computation/csx_csx.ma". (* STRONGLY NORMALIZING TERMS FOR UNBOUND PARALLEL RT-TRANSITION ************) -(* Properties with degree-based equivalence for local environments **********) +(* Properties with sort-irrelevant equivalence for local environments *******) (* Basic_2A1: uses: csx_lleq_conf *) -lemma csx_rdeq_conf: ∀h,o,G,L1,T. ⦃G, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → - ∀L2. L1 ≛[h, o, T] L2 → ⦃G, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L1 #T #H +lemma csx_rdeq_conf: ∀h,G,L1,T. ⦃G,L1⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → + ∀L2. L1 ≛[T] L2 → ⦃G,L2⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L1 #T #H @(csx_ind … H) -T #T1 #_ #IH #L2 #HL12 @csx_intro #T2 #HT12 #HnT12 elim (rdeq_cpx_trans … HL12 … HT12) -HT12 -/5 width=4 by cpx_rdeq_conf_sn, csx_tdeq_trans, tdeq_trans/ +/5 width=5 by cpx_rdeq_conf_sn, csx_tdeq_trans, tdeq_trans/ qed-. (* Basic_2A1: uses: csx_lleq_conf *) -lemma csx_rdeq_trans: ∀h,o,L1,L2,T. L1 ≛[h, o, T] L2 → - ∀G. ⦃G, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. +lemma csx_rdeq_trans: ∀h,L1,L2,T. L1 ≛[T] L2 → + ∀G. ⦃G,L2⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L1⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. /3 width=3 by csx_rdeq_conf, rdeq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple.ma index efa69cff7..50a460732 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple.ma @@ -19,10 +19,10 @@ include "basic_2/rt_computation/csx_csx.ma". (* Properties with simple terms *********************************************) -lemma csx_appl_simple: ∀h,o,G,L,V. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ → ∀T1. - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛[h, o] T2 → ⊥) → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV.T2⦄) → - 𝐒⦃T1⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV.T1⦄. -#h #o #G #L #V #H @(csx_ind … H) -V +lemma csx_appl_simple: ∀h,G,L,V. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → ∀T1. + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛ T2 → ⊥) → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV.T2⦄) → + 𝐒⦃T1⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV.T1⦄. +#h #G #L #V #H @(csx_ind … H) -V #V #_ #IHV #T1 #IHT1 #HT1 @csx_intro #X #H1 #H2 elim (cpx_inv_appl1_simple … H1) // -H1 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple_theq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple_theq.ma deleted file mode 100644 index cc286ae6a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple_theq.ma +++ /dev/null @@ -1,48 +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 "static_2/syntax/theq_simple.ma". -include "static_2/syntax/theq_theq.ma". -include "basic_2/rt_transition/cpx_simple.ma". -include "basic_2/rt_computation/cpxs.ma". -include "basic_2/rt_computation/csx_csx.ma". - -(* STRONGLY NORMALIZING TERMS FOR UNBOUND PARALLEL RT-TRANSITION ************) - -(* Properties with head equivalence for terms *******************************) - -(* Basic_1: was just: sn3_appl_appl *) -(* Basic_2A1: was: csx_appl_simple_tsts *) -lemma csx_appl_simple_theq: ∀h,o,G,L,V. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ → ∀T1. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - (∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ⩳[h, o] T2 → ⊥) → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV.T2⦄) → - 𝐒⦃T1⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV.T1⦄. -#h #o #G #L #V #H @(csx_ind … H) -V -#V #_ #IHV #T1 #H @(csx_ind … H) -T1 -#T1 #H1T1 #IHT1 #H2T1 #H3T1 -@csx_intro #X #HL #H -elim (cpx_inv_appl1_simple … HL) -HL // -#V0 #T0 #HLV0 #HLT10 #H0 destruct -elim (tdneq_inv_pair … H) -H -[ #H elim H -H // -| -IHT1 #HV0 - @(csx_cpx_trans … (ⓐV0.T1)) /2 width=1 by cpx_flat/ -HLT10 - @IHV -IHV /4 width=3 by csx_cpx_trans, cpx_pair_sn/ -| -IHV -H1T1 #H1T10 - @(csx_cpx_trans … (ⓐV.T0)) /2 width=1 by cpx_flat/ -HLV0 - elim (theq_dec h o T1 T0) #H2T10 - [ @IHT1 -IHT1 /4 width=5 by cpxs_strap2, cpxs_strap1, theq_canc_sn, simple_theq_repl_dx/ - | -IHT1 -H3T1 -H1T10 /3 width=1 by cpx_cpxs/ - ] -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple_toeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple_toeq.ma new file mode 100644 index 000000000..8fb338684 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_simple_toeq.ma @@ -0,0 +1,49 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/syntax/toeq_simple.ma". +include "static_2/syntax/toeq_toeq.ma". +include "basic_2/rt_transition/cpx_simple.ma". +include "basic_2/rt_computation/cpxs.ma". +include "basic_2/rt_computation/csx_csx.ma". + +(* STRONGLY NORMALIZING TERMS FOR UNBOUND PARALLEL RT-TRANSITION ************) + +(* Properties with outer equivalence for terms ******************************) + +(* Basic_1: was just: sn3_appl_appl *) +(* Basic_2A1: was: csx_appl_simple_tsts *) +lemma csx_appl_simple_toeq (h) (G) (L): + ∀V. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + (∀T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → (T1 ⩳ T2 → ⊥) → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV.T2⦄) → + 𝐒⦃T1⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⓐV.T1⦄. +#h #G #L #V #H @(csx_ind … H) -V +#V #_ #IHV #T1 #H @(csx_ind … H) -T1 +#T1 #H1T1 #IHT1 #H2T1 #H3T1 +@csx_intro #X #HL #H +elim (cpx_inv_appl1_simple … HL) -HL // +#V0 #T0 #HLV0 #HLT10 #H0 destruct +elim (tdneq_inv_pair … H) -H +[ #H elim H -H // +| -IHT1 #HV0 + @(csx_cpx_trans … (ⓐV0.T1)) /2 width=1 by cpx_flat/ -HLT10 + @IHV -IHV /4 width=3 by csx_cpx_trans, cpx_pair_sn/ +| -IHV -H1T1 #H1T10 + @(csx_cpx_trans … (ⓐV.T0)) /2 width=1 by cpx_flat/ -HLV0 + elim (toeq_dec T1 T0) #H2T10 + [ @IHT1 -IHT1 /4 width=5 by cpxs_strap2, cpxs_strap1, toeq_canc_sn, simple_toeq_repl_dx/ + | -IHT1 -H3T1 -H1T10 /3 width=1 by cpx_cpxs/ + ] +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma index 32afe79a4..f4b85eb9d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma @@ -17,24 +17,24 @@ include "basic_2/rt_computation/csx.ma". (* STRONGLY NORMALIZING TERMS VECTORS FOR UNBOUND PARALLEL RT-TRANSITION ****) -definition csxv: ∀h. sd h → relation3 genv lenv (list term) ≝ - λh,o,G,L. all … (csx h o G L). +definition csxv: ∀h. relation3 genv lenv (list term) ≝ + λh,G,L. all … (csx h G L). interpretation "strong normalization for unbound context-sensitive parallel rt-transition (term vector)" - 'PRedTyStrong h o G L Ts = (csxv h o G L Ts). + 'PRedTyStrong h G L Ts = (csxv h G L Ts). (* Basic inversion lemmas ***************************************************) -lemma csxv_inv_cons: ∀h,o,G,L,T,Ts. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⨮Ts⦄ → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ ∧ ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃Ts⦄. +lemma csxv_inv_cons: ∀h,G,L,T,Ts. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⨮Ts⦄ → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ ∧ ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃Ts⦄. normalize // qed-. (* Basic forward lemmas *****************************************************) -lemma csx_fwd_applv: ∀h,o,G,L,T,Vs. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⒶVs.T⦄ → - ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃Vs⦄ ∧ ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L #T #Vs elim Vs -Vs /2 width=1 by conj/ +lemma csx_fwd_applv: ∀h,G,L,T,Vs. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃ⒶVs.T⦄ → + ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃Vs⦄ ∧ ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L #T #Vs elim Vs -Vs /2 width=1 by conj/ #V #Vs #IHVs #HVs lapply (csx_fwd_pair_sn … HVs) #HV lapply (csx_fwd_flat_dx … HVs) -HVs #HVs diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg.ma index bda560f42..b14847da0 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg.ma @@ -12,47 +12,53 @@ (* *) (**************************************************************************) -include "basic_2/notation/relations/predsubtystarproper_8.ma". +include "basic_2/notation/relations/predsubtystarproper_7.ma". include "basic_2/rt_transition/fpb.ma". include "basic_2/rt_computation/fpbs.ma". (* PROPER PARALLEL RST-COMPUTATION FOR CLOSURES *****************************) -definition fpbg: ∀h. sd h → tri_relation genv lenv term ≝ - λh,o,G1,L1,T1,G2,L2,T2. - ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≥[h, o] ⦃G2, L2, T2⦄. +definition fpbg: ∀h. tri_relation genv lenv term ≝ + λh,G1,L1,T1,G2,L2,T2. + ∃∃G,L,T. ⦃G1,L1,T1⦄ ≻[h] ⦃G,L,T⦄ & ⦃G,L,T⦄ ≥[h] ⦃G2,L2,T2⦄. interpretation "proper parallel rst-computation (closure)" - 'PRedSubTyStarProper h o G1 L1 T1 G2 L2 T2 = (fpbg h o G1 L1 T1 G2 L2 T2). + 'PRedSubTyStarProper h G1 L1 T1 G2 L2 T2 = (fpbg h G1 L1 T1 G2 L2 T2). (* Basic properties *********************************************************) -lemma fpb_fpbg: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. +lemma fpb_fpbg: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /2 width=5 by ex2_3_intro/ qed. -lemma fpbg_fpbq_trans: ∀h,o,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ >[h, o] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≽[h, o] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * +lemma fpbg_fpbq_trans: ∀h,G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1,L1,T1⦄ >[h] ⦃G,L,T⦄ → ⦃G,L,T⦄ ≽[h] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * /3 width=9 by fpbs_strap1, ex2_3_intro/ qed-. +lemma fpbg_fqu_trans (h): ∀G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1,L1,T1⦄ >[h] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂ ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 +/4 width=5 by fpbg_fpbq_trans, fpbq_fquq, fqu_fquq/ +qed-. + (* Note: this is used in the closure proof *) -lemma fpbg_fpbs_trans: ∀h,o,G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ >[h, o] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. -#h #o #G #G2 #L #L2 #T #T2 #H @(fpbs_ind_dx … H) -G -L -T /3 width=5 by fpbg_fpbq_trans/ +lemma fpbg_fpbs_trans: ∀h,G,G2,L,L2,T,T2. ⦃G,L,T⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ >[h] ⦃G,L,T⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G #G2 #L #L2 #T #T2 #H @(fpbs_ind_dx … H) -G -L -T /3 width=5 by fpbg_fpbq_trans/ qed-. (* Basic_2A1: uses: fpbg_fleq_trans *) -lemma fpbg_fdeq_trans: ∀h,o,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ >[h, o] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. +lemma fpbg_fdeq_trans: ∀h,G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ >[h] ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G,L,T⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbg_fpbq_trans, fpbq_fdeq/ qed-. (* Properties with t-bound rt-transition for terms **************************) -lemma cpm_tdneq_cpm_fpbg (h) (o) (G) (L): - ∀n1,T1,T. ⦃G, L⦄ ⊢ T1 ➡[n1,h] T → (T1 ≛[h,o] T → ⊥) → - ∀n2,T2. ⦃G, L⦄ ⊢ T ➡[n2,h] T2 → - ⦃G, L, T1⦄ >[h,o] ⦃G, L, T2⦄. +lemma cpm_tdneq_cpm_fpbg (h) (G) (L): + ∀n1,T1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → (T1 ≛ T → ⊥) → + ∀n2,T2. ⦃G,L⦄ ⊢ T ➡[n2,h] T2 → ⦃G,L,T1⦄ >[h] ⦃G,L,T2⦄. /4 width=5 by fpbq_fpbs, cpm_fpbq, cpm_fpb, ex2_3_intro/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_cpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_cpxs.ma index e70619a8d..6fef34261 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_cpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_cpxs.ma @@ -21,13 +21,13 @@ include "basic_2/rt_computation/fpbg_fpbs.ma". (* Properties with unbound context-sensitive parallel rt-computation ********) (* Basic_2A1: was: cpxs_fpbg *) -lemma cpxs_tdneq_fpbg (h) (o): ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → - (T1 ≛[h, o] T2 → ⊥) → ⦃G, L, T1⦄ >[h, o] ⦃G, L, T2⦄. -#h #o #G #L #T1 #T2 #H #H0 +lemma cpxs_tdneq_fpbg (h): ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → + (T1 ≛ T2 → ⊥) → ⦃G,L,T1⦄ >[h] ⦃G,L,T2⦄. +#h #G #L #T1 #T2 #H #H0 elim (cpxs_tdneq_fwd_step_sn … H … H0) -H -H0 /4 width=5 by cpxs_tdeq_fpbs, fpb_cpx, ex2_3_intro/ qed. -lemma cpxs_fpbg_trans (h) (o): ∀G1,L1,T1,T. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T → - ∀G2,L2,T2. ⦃G1, L1, T⦄ >[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. +lemma cpxs_fpbg_trans (h): ∀G1,L1,T1,T. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T → + ∀G2,L2,T2. ⦃G1,L1,T⦄ >[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_fpbg_trans, cpxs_fpbs/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbg.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbg.ma index 636f20955..6d511b7f4 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbg.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbg.ma @@ -18,5 +18,5 @@ include "basic_2/rt_computation/fpbg_fpbs.ma". (* Main properties **********************************************************) -theorem fpbg_trans: ∀h,o. tri_transitive … (fpbg h o). +theorem fpbg_trans: ∀h. tri_transitive … (fpbg h). /3 width=5 by fpbg_fpbs_trans, fpbg_fwd_fpbs/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbs.ma index d7a1ccae0..e80960d04 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fpbs.ma @@ -21,60 +21,60 @@ include "basic_2/rt_computation/fpbg.ma". (* Advanced forward lemmas **************************************************) -lemma fpbg_fwd_fpbs: ∀h,o,G1,G2,L1,L2,T1,T2. - ⦃G1, L1, T1⦄ >[h,o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 * +lemma fpbg_fwd_fpbs: ∀h,G1,G2,L1,L2,T1,T2. + ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T2 * /3 width=5 by fpbs_strap2, fpb_fpbq/ qed-. -(* Advanced properties with degree-based equivalence on closures ************) +(* Advanced properties with sort-irrelevant equivalence on closures *********) (* Basic_2A1: uses: fleq_fpbg_trans *) -lemma fdeq_fpbg_trans: ∀h,o,G,G2,L,L2,T,T2. ⦃G, L, T⦄ >[h, o] ⦃G2, L2, T2⦄ → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. -#h #o #G #G2 #L #L2 #T #T2 * #G0 #L0 #T0 #H0 #H02 #G1 #L1 #T1 #H1 +lemma fdeq_fpbg_trans: ∀h,G,G2,L,L2,T,T2. ⦃G,L,T⦄ >[h] ⦃G2,L2,T2⦄ → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ ≛ ⦃G,L,T⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G #G2 #L #L2 #T #T2 * #G0 #L0 #T0 #H0 #H02 #G1 #L1 #T1 #H1 elim (fdeq_fpb_trans … H1 … H0) -G -L -T /4 width=9 by fpbs_strap2, fpbq_fdeq, ex2_3_intro/ qed-. (* Properties with parallel proper rst-reduction on closures ****************) -lemma fpb_fpbg_trans: ∀h,o,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ ≻[h, o] ⦃G, L, T⦄ → ⦃G, L, T⦄ >[h, o] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. +lemma fpb_fpbg_trans: ∀h,G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1,L1,T1⦄ ≻[h] ⦃G,L,T⦄ → ⦃G,L,T⦄ >[h] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbg_fwd_fpbs, ex2_3_intro/ qed-. (* Properties with parallel rst-reduction on closures ***********************) -lemma fpbq_fpbg_trans: ∀h,o,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ ≽[h, o] ⦃G, L, T⦄ → ⦃G, L, T⦄ >[h, o] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 +lemma fpbq_fpbg_trans: ∀h,G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1,L1,T1⦄ ≽[h] ⦃G,L,T⦄ → ⦃G,L,T⦄ >[h] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 elim (fpbq_inv_fpb … H1) -H1 /2 width=5 by fdeq_fpbg_trans, fpb_fpbg_trans/ qed-. (* Properties with parallel rst-compuutation on closures ********************) -lemma fpbs_fpbg_trans: ∀h,o,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ >[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G #L1 #L #T1 #T #H @(fpbs_ind … H) -G -L -T /3 width=5 by fpbq_fpbg_trans/ +lemma fpbs_fpbg_trans: ∀h,G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G,L,T⦄ >[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G1 #G #L1 #L #T1 #T #H @(fpbs_ind … H) -G -L -T /3 width=5 by fpbq_fpbg_trans/ qed-. (* Advanced properties with plus-iterated structural successor for closures *) -lemma fqup_fpbg_trans (h) (o): - ∀G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ⊐+ ⦃G,L,T⦄ → - ∀G2,L2,T2. ⦃G,L,T⦄ >[h,o] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ >[h,o] ⦃G2,L2,T2⦄. +lemma fqup_fpbg_trans (h): + ∀G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ⬂+ ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G,L,T⦄ >[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_fpbg_trans, fqup_fpbs/ qed-. (* Advanced inversion lemmas of parallel rst-computation on closures ********) (* Basic_2A1: was: fpbs_fpbg *) -lemma fpbs_inv_fpbg: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∨∨ ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ - | ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 +lemma fpbs_inv_fpbg: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∨∨ ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ + | ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 [ /2 width=1 by or_introl/ | #G #G2 #L #L2 #T #T2 #_ #H2 * #H1 elim (fpbq_inv_fpb … H2) -H2 #H2 @@ -89,10 +89,10 @@ qed-. (* Advanced properties of parallel rst-computation on closures **************) -lemma fpbs_fpb_trans: ∀h,o,F1,F2,K1,K2,T1,T2. ⦃F1, K1, T1⦄ ≥[h, o] ⦃F2, K2, T2⦄ → - ∀G2,L2,U2. ⦃F2, K2, T2⦄ ≻[h, o] ⦃G2, L2, U2⦄ → - ∃∃G1,L1,U1. ⦃F1, K1, T1⦄ ≻[h, o] ⦃G1, L1, U1⦄ & ⦃G1, L1, U1⦄ ≥[h, o] ⦃G2, L2, U2⦄. -#h #o #F1 #F2 #K1 #K2 #T1 #T2 #H elim (fpbs_inv_fpbg … H) -H +lemma fpbs_fpb_trans: ∀h,F1,F2,K1,K2,T1,T2. ⦃F1,K1,T1⦄ ≥[h] ⦃F2,K2,T2⦄ → + ∀G2,L2,U2. ⦃F2,K2,T2⦄ ≻[h] ⦃G2,L2,U2⦄ → + ∃∃G1,L1,U1. ⦃F1,K1,T1⦄ ≻[h] ⦃G1,L1,U1⦄ & ⦃G1,L1,U1⦄ ≥[h] ⦃G2,L2,U2⦄. +#h #F1 #F2 #K1 #K2 #T1 #T2 #H elim (fpbs_inv_fpbg … H) -H [ #H12 #G2 #L2 #U2 #H2 elim (fdeq_fpb_trans … H12 … H2) -F2 -K2 -T2 /3 width=5 by fdeq_fpbs, ex2_3_intro/ | * #H1 #H2 #H3 #H4 #H5 #H6 #H7 #H8 #H9 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fqup.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fqup.ma index ce02c890a..746aa6953 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fqup.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_fqup.ma @@ -17,16 +17,16 @@ include "basic_2/rt_computation/fpbg.ma". (* PROPER PARALLEL RST-COMPUTATION FOR CLOSURES *****************************) -(* Advanced properties with degree-based equivalence for terms **************) +(* Advanced properties with sort-irrelevant equivalence for terms ***********) -lemma fpbg_tdeq_div: ∀h,o,G1,G2,L1,L2,T1,T. ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T⦄ → - ∀T2. T2 ≛[h, o] T → ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. +lemma fpbg_tdeq_div: ∀h,G1,G2,L1,L2,T1,T. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T⦄ → + ∀T2. T2 ≛ T → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. /4 width=5 by fpbg_fdeq_trans, tdeq_fdeq, tdeq_sym/ qed-. (* Properties with plus-iterated structural successor for closures **********) (* Note: this is used in the closure proof *) -lemma fqup_fpbg: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqup_inv_step_sn … H) -H +lemma fqup_fpbg: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqup_inv_step_sn … H) -H /3 width=5 by fqus_fpbs, fpb_fqu, ex2_3_intro/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_lpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_lpxs.ma index 71dcdc50a..0921a5e12 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_lpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbg_lpxs.ma @@ -20,9 +20,9 @@ include "basic_2/rt_computation/fpbg.ma". (* Properties with unbound rt-computation on full local environments ********) (* Basic_2A1: uses: lpxs_fpbg *) -lemma lpxs_rdneq_fpbg: ∀h,o,G,L1,L2,T. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - (L1 ≛[h, o, T] L2 → ⊥) → ⦃G, L1, T⦄ >[h, o] ⦃G, L2, T⦄. -#h #o #G #L1 #L2 #T #H #H0 +lemma lpxs_rdneq_fpbg: ∀h,G,L1,L2,T. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + (L1 ≛[T] L2 → ⊥) → ⦃G,L1,T⦄ >[h] ⦃G,L2,T⦄. +#h #G #L1 #L2 #T #H #H0 elim (lpxs_rdneq_inv_step_sn … H … H0) -H -H0 /4 width=7 by fpb_lpx, lpxs_fdeq_fpbs, fdeq_intro_sn, ex2_3_intro/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs.ma index f5c9176b0..9d6f5c280 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs.ma @@ -13,62 +13,62 @@ (**************************************************************************) include "ground_2/lib/star.ma". -include "basic_2/notation/relations/predsubtystar_8.ma". +include "basic_2/notation/relations/predsubtystar_7.ma". include "basic_2/rt_transition/fpbq.ma". (* PARALLEL RST-COMPUTATION FOR CLOSURES ************************************) -definition fpbs: ∀h. sd h → tri_relation genv lenv term ≝ - λh,o. tri_TC … (fpbq h o). +definition fpbs: ∀h. tri_relation genv lenv term ≝ + λh. tri_TC … (fpbq h). interpretation "parallel rst-computation (closure)" - 'PRedSubTyStar h o G1 L1 T1 G2 L2 T2 = (fpbs h o G1 L1 T1 G2 L2 T2). + 'PRedSubTyStar h G1 L1 T1 G2 L2 T2 = (fpbs h G1 L1 T1 G2 L2 T2). (* Basic eliminators ********************************************************) -lemma fpbs_ind: ∀h,o,G1,L1,T1. ∀Q:relation3 genv lenv term. Q G1 L1 T1 → - (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≽[h, o] ⦃G2, L2, T2⦄ → Q G L T → Q G2 L2 T2) → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2. +lemma fpbs_ind: ∀h,G1,L1,T1. ∀Q:relation3 genv lenv term. Q G1 L1 T1 → + (∀G,G2,L,L2,T,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T⦄ → ⦃G,L,T⦄ ≽[h] ⦃G2,L2,T2⦄ → Q G L T → Q G2 L2 T2) → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2. /3 width=8 by tri_TC_star_ind/ qed-. -lemma fpbs_ind_dx: ∀h,o,G2,L2,T2. ∀Q:relation3 genv lenv term. Q G2 L2 T2 → - (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≽[h, o] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → Q G L T → Q G1 L1 T1) → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → Q G1 L1 T1. +lemma fpbs_ind_dx: ∀h,G2,L2,T2. ∀Q:relation3 genv lenv term. Q G2 L2 T2 → + (∀G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≽[h] ⦃G,L,T⦄ → ⦃G,L,T⦄ ≥[h] ⦃G2,L2,T2⦄ → Q G L T → Q G1 L1 T1) → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → Q G1 L1 T1. /3 width=8 by tri_TC_star_ind_dx/ qed-. (* Basic properties *********************************************************) -lemma fpbs_refl: ∀h,o. tri_reflexive … (fpbs h o). +lemma fpbs_refl: ∀h. tri_reflexive … (fpbs h). /2 width=1 by tri_inj/ qed. -lemma fpbq_fpbs: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, o] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpbq_fpbs: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≽[h] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /2 width=1 by tri_inj/ qed. -lemma fpbs_strap1: ∀h,o,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ≽[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpbs_strap1: ∀h,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T⦄ → + ⦃G,L,T⦄ ≽[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /2 width=5 by tri_step/ qed-. -lemma fpbs_strap2: ∀h,o,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ≽[h, o] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpbs_strap2: ∀h,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ≽[h] ⦃G,L,T⦄ → + ⦃G,L,T⦄ ≥[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /2 width=5 by tri_TC_strap/ qed-. (* Basic_2A1: uses: lleq_fpbs fleq_fpbs *) -lemma fdeq_fpbs: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fdeq_fpbs: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=1 by fpbq_fpbs, fpbq_fdeq/ qed. (* Basic_2A1: uses: fpbs_lleq_trans *) -lemma fpbs_fdeq_trans: ∀h,o,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpbs_fdeq_trans: ∀h,G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G,L,T⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=9 by fpbs_strap1, fpbq_fdeq/ qed-. (* Basic_2A1: uses: lleq_fpbs_trans *) -lemma fdeq_fpbs_trans: ∀h,o,G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fdeq_fpbs_trans: ∀h,G,G2,L,L2,T,T2. ⦃G,L,T⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ ≛ ⦃G,L,T⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_strap2, fpbq_fdeq/ qed-. -lemma tdeq_rdeq_lpx_fpbs: ∀h,o,T1,T2. T1 ≛[h, o] T2 → ∀L1,L0. L1 ≛[h, o, T2] L0 → - ∀G,L2. ⦃G, L0⦄ ⊢ ⬈[h] L2 → ⦃G, L1, T1⦄ ≥[h, o] ⦃G, L2, T2⦄. +lemma tdeq_rdeq_lpx_fpbs: ∀h,T1,T2. T1 ≛ T2 → ∀L1,L0. L1 ≛[T2] L0 → + ∀G,L2. ⦃G,L0⦄ ⊢ ⬈[h] L2 → ⦃G,L1,T1⦄ ≥[h] ⦃G,L2,T2⦄. /4 width=5 by fdeq_fpbs, fpbs_strap1, fpbq_lpx, fdeq_intro_dx/ qed. (* Basic_2A1: removed theorems 3: diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_aaa.ma index 601758e03..9d27bacb8 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_aaa.ma @@ -19,9 +19,9 @@ include "basic_2/rt_computation/fpbs.ma". (* Properties with atomic arity assignment for terms ************************) -lemma fpbs_aaa_conf: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀A1. ⦃G1, L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2, L2⦄ ⊢ T2 ⁝ A2. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 /2 width=2 by ex_intro/ +lemma fpbs_aaa_conf: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀A1. ⦃G1,L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2,L2⦄ ⊢ T2 ⁝ A2. +#h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 /2 width=2 by ex_intro/ #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #A #HA elim (IH1 … HA) -IH1 -A /2 width=8 by fpbq_aaa_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpx.ma index c3cdaf038..5dd4e5378 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpx.ma @@ -21,18 +21,18 @@ include "basic_2/rt_computation/fpbs_lpxs.ma". (* Properties with unbound context-sensitive parallel rt-transition *********) (* Basic_2A1: uses: fpbs_cpx_trans_neq *) -lemma fpbs_cpx_tdneq_trans: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 → (T2 ≛[h, o] U2 → ⊥) → - ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & T1 ≛[h, o] U1 → ⊥ & ⦃G1, L1, U1⦄ ≥[h, o] ⦃G2, L2, U2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 #HnTU2 +lemma fpbs_cpx_tdneq_trans: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈[h] U2 → (T2 ≛ U2 → ⊥) → + ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1,L1,U1⦄ ≥[h] ⦃G2,L2,U2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 #HnTU2 elim (fpbs_inv_star … H) -H #G0 #L0 #L3 #T0 #T3 #HT10 #H10 #HL03 #H32 elim (fdeq_cpx_trans … H32 … HTU2) -HTU2 #T4 #HT34 #H42 lapply (fdeq_tdneq_repl_dx … H32 … H42 … HnTU2) -T2 #HnT34 lapply (lpxs_cpx_trans … HT34 … HL03) -HT34 #HT34 elim (fqus_cpxs_trans_tdneq … H10 … HT34 HnT34) -T3 #T2 #HT02 #HnT02 #H24 -elim (tdeq_dec h o T1 T0) [ #H10 | -HnT02 #HnT10 ] +elim (tdeq_dec T1 T0) [ #H10 | -HnT02 #HnT10 ] [ lapply (cpxs_trans … HT10 … HT02) -HT10 -HT02 #HT12 - elim (cpxs_tdneq_fwd_step_sn … o … HT12) [2: /3 width=3 by tdeq_canc_sn/ ] -T0 -HT12 + elim (cpxs_tdneq_fwd_step_sn … HT12) [2: /3 width=3 by tdeq_canc_sn/ ] -T0 -HT12 | elim (cpxs_tdneq_fwd_step_sn … HT10 … HnT10) -HT10 -HnT10 ] /4 width=16 by fpbs_intro_star, cpxs_tdeq_fpbs_trans, ex3_intro/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpxs.ma index 4f23c0d00..ec1d680a8 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_cpxs.ma @@ -19,40 +19,40 @@ include "basic_2/rt_computation/fpbs_fqup.ma". (* Properties with unbound context-sensitive parallel rt-computation ********) -lemma cpxs_fpbs: ∀h,o,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L, T1⦄ ≥[h, o] ⦃G, L, T2⦄. -#h #o #G #L #T1 #T2 #H @(cpxs_ind … H) -T2 +lemma cpxs_fpbs: ∀h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → ⦃G,L,T1⦄ ≥[h] ⦃G,L,T2⦄. +#h #G #L #T1 #T2 #H @(cpxs_ind … H) -T2 /3 width=5 by fpbq_cpx, fpbs_strap1/ qed. -lemma fpbs_cpxs_trans: ∀h,o,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T⦄ → - ∀T2. ⦃G, L⦄ ⊢ T ⬈*[h] T2 → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T2⦄. -#h #o #G1 #G #L1 #L #T1 #T #H1 #T2 #H @(cpxs_ind … H) -T2 +lemma fpbs_cpxs_trans: ∀h,G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T⦄ → + ∀T2. ⦃G,L⦄ ⊢ T ⬈*[h] T2 → ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T2⦄. +#h #G1 #G #L1 #L #T1 #T #H1 #T2 #H @(cpxs_ind … H) -T2 /3 width=5 by fpbs_strap1, fpbq_cpx/ qed-. -lemma cpxs_fpbs_trans: ∀h,o,G1,G2,L1,L2,T,T2. ⦃G1, L1, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀T1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T #T2 #H1 #T1 #H @(cpxs_ind_dx … H) -T1 +lemma cpxs_fpbs_trans: ∀h,G1,G2,L1,L2,T,T2. ⦃G1,L1,T⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀T1. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T #T2 #H1 #T1 #H @(cpxs_ind_dx … H) -T1 /3 width=5 by fpbs_strap2, fpbq_cpx/ qed-. -lemma cpxs_tdeq_fpbs_trans: ∀h,o,G1,L1,T1,T. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T → - ∀T0. T ≛[h, o] T0 → - ∀G2,L2,T2. ⦃G1, L1, T0⦄ ≥[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma cpxs_tdeq_fpbs_trans: ∀h,G1,L1,T1,T. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T → + ∀T0. T ≛ T0 → + ∀G2,L2,T2. ⦃G1,L1,T0⦄ ≥[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=3 by cpxs_fpbs_trans, tdeq_fpbs_trans/ qed-. -lemma cpxs_tdeq_fpbs: ∀h,o,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬈*[h] T → - ∀T2. T ≛[h, o] T2 → ⦃G, L, T1⦄ ≥[h, o] ⦃G, L, T2⦄. +lemma cpxs_tdeq_fpbs: ∀h,G,L,T1,T. ⦃G,L⦄ ⊢ T1 ⬈*[h] T → + ∀T2. T ≛ T2 → ⦃G,L,T1⦄ ≥[h] ⦃G,L,T2⦄. /4 width=3 by cpxs_fpbs_trans, fdeq_fpbs, tdeq_fdeq/ qed. (* Properties with star-iterated structural successor for closures **********) -lemma cpxs_fqus_fpbs: ∀h,o,G1,L1,T1,T. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T → - ∀G2,L2,T2. ⦃G1, L1, T⦄ ⊐* ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma cpxs_fqus_fpbs: ∀h,G1,L1,T1,T. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T → + ∀G2,L2,T2. ⦃G1,L1,T⦄ ⬂* ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_fqus_trans, cpxs_fpbs/ qed. (* Properties with plus-iterated structural successor for closures **********) -lemma cpxs_fqup_fpbs: ∀h,o,G1,L1,T1,T. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T → - ∀G2,L2,T2. ⦃G1, L1, T⦄ ⊐+ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma cpxs_fqup_fpbs: ∀h,G1,L1,T1,T. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T → + ∀G2,L2,T2. ⦃G1,L1,T⦄ ⬂+ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_fqup_trans, cpxs_fpbs/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_csx.ma index ce44e7e7b..583f5e31f 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_csx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_csx.ma @@ -20,8 +20,8 @@ include "basic_2/rt_computation/fpbs.ma". (* Properties with sn for unbound parallel rt-transition for terms **********) (* Basic_2A1: was: csx_fpbs_conf *) -lemma fpbs_csx_conf: ∀h,o,G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → ⦃G2, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T2⦄. -#h #o #G1 #L1 #T1 #HT1 #G2 #L2 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 +lemma fpbs_csx_conf: ∀h,G1,L1,T1. ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → ⦃G2,L2⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄. +#h #G1 #L1 #T1 #HT1 #G2 #L2 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 /2 width=5 by csx_fpbq_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpb.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpb.ma index 632fe7dc6..428644da8 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpb.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpb.ma @@ -19,6 +19,6 @@ include "basic_2/rt_computation/fpbs.ma". (* Properties with proper parallel rst-reduction on closures ****************) -lemma fpb_fpbs: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpb_fpbs: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=1 by fpbq_fpbs, fpb_fpbq/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpbs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpbs.ma index 12d5d8de6..6e75949fc 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpbs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fpbs.ma @@ -18,5 +18,5 @@ include "basic_2/rt_computation/fpbs.ma". (* Main properties **********************************************************) -theorem fpbs_trans: ∀h,o. tri_transitive … (fpbs h o). +theorem fpbs_trans: ∀h. tri_transitive … (fpbs h). /2 width=5 by tri_TC_transitive/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqup.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqup.ma index b625f889b..4a970e58b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqup.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqup.ma @@ -20,26 +20,26 @@ include "basic_2/rt_computation/fpbs_fqus.ma". (* Advanced properties ******************************************************) -lemma tdeq_fpbs_trans: ∀h,o,T1,T. T1 ≛[h, o] T → - ∀G1,G2,L1,L2,T2. ⦃G1, L1, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma tdeq_fpbs_trans: ∀h,T1,T. T1 ≛ T → + ∀G1,G2,L1,L2,T2. ⦃G1,L1,T⦄ ≥[h] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by fdeq_fpbs_trans, tdeq_fdeq/ qed-. -lemma fpbs_tdeq_trans: ∀h,o,G1,G2,L1,L2,T1,T. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T⦄ → - ∀T2. T ≛[h, o] T2 → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpbs_tdeq_trans: ∀h,G1,G2,L1,L2,T1,T. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T⦄ → + ∀T2. T ≛ T2 → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_fdeq_trans, tdeq_fdeq/ qed-. (* Properties with plus-iterated structural successor for closures **********) -lemma fqup_fpbs: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 +lemma fqup_fpbs: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+ ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 /4 width=5 by fqu_fquq, fpbq_fquq, tri_step/ qed. -lemma fpbs_fqup_trans: ∀h,o,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ ⊐+ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpbs_fqup_trans: ∀h,G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G,L,T⦄ ⬂+ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by fpbs_fqus_trans, fqup_fqus/ qed-. -lemma fqup_fpbs_trans: ∀h,o,G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊐+ ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fqup_fpbs_trans: ∀h,G,G2,L,L2,T,T2. ⦃G,L,T⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ ⬂+ ⦃G,L,T⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by fqus_fpbs_trans, fqup_fqus/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqus.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqus.ma index db3925f71..3f1e06fab 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqus.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_fqus.ma @@ -19,20 +19,20 @@ include "basic_2/rt_computation/fpbs.ma". (* Properties with star-iterated structural successor for closures **********) -lemma fqus_fpbs: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 +lemma fqus_fpbs: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂* ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 /3 width=5 by fpbq_fquq, tri_step/ qed. -lemma fpbs_fqus_trans: ∀h,o,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ ⊐* ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G #L1 #L #T1 #T #H1 #G2 #L2 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 +lemma fpbs_fqus_trans: ∀h,G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≥[h] ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G,L,T⦄ ⬂* ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G1 #G #L1 #L #T1 #T #H1 #G2 #L2 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 /3 width=5 by fpbs_strap1, fpbq_fquq/ qed-. -lemma fqus_fpbs_trans: ∀h,o,G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊐* ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G #G2 #L #L2 #T #T2 #H1 #G1 #L1 #T1 #H @(fqus_ind_dx … H) -G1 -L1 -T1 +lemma fqus_fpbs_trans: ∀h,G,G2,L,L2,T,T2. ⦃G,L,T⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ ⬂* ⦃G,L,T⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G #G2 #L #L2 #T #T2 #H1 #G1 #L1 #T1 #H @(fqus_ind_dx … H) -G1 -L1 -T1 /3 width=5 by fpbs_strap2, fpbq_fquq/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_lpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_lpxs.ma index 2760e2a33..d3b96eb96 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_lpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fpbs_lpxs.ma @@ -23,50 +23,50 @@ include "basic_2/rt_computation/fpbs_cpxs.ma". (* Properties with unbound rt-computation on full local environments *******) -lemma lpxs_fpbs: ∀h,o,G,L1,L2,T. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → ⦃G, L1, T⦄ ≥[h, o] ⦃G, L2, T⦄. -#h #o #G #L1 #L2 #T #H @(lpxs_ind_dx … H) -L2 +lemma lpxs_fpbs: ∀h,G,L1,L2,T. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → ⦃G,L1,T⦄ ≥[h] ⦃G,L2,T⦄. +#h #G #L1 #L2 #T #H @(lpxs_ind_dx … H) -L2 /3 width=5 by fpbq_lpx, fpbs_strap1/ qed. -lemma fpbs_lpxs_trans: ∀h,o,G1,G2,L1,L,T1,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L, T2⦄ → - ∀L2. ⦃G2, L⦄ ⊢ ⬈*[h] L2 → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L #T1 #T2 #H1 #L2 #H @(lpxs_ind_dx … H) -L2 +lemma fpbs_lpxs_trans: ∀h,G1,G2,L1,L,T1,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L,T2⦄ → + ∀L2. ⦃G2,L⦄ ⊢ ⬈*[h] L2 → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L #T1 #T2 #H1 #L2 #H @(lpxs_ind_dx … H) -L2 /3 width=5 by fpbs_strap1, fpbq_lpx/ qed-. -lemma lpxs_fpbs_trans: ∀h,o,G1,G2,L,L2,T1,T2. ⦃G1, L, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∀L1. ⦃G1, L1⦄ ⊢ ⬈*[h] L → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L #L2 #T1 #T2 #H1 #L1 #H @(lpxs_ind_sn … H) -L1 +lemma lpxs_fpbs_trans: ∀h,G1,G2,L,L2,T1,T2. ⦃G1,L,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∀L1. ⦃G1,L1⦄ ⊢ ⬈*[h] L → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. +#h #G1 #G2 #L #L2 #T1 #T2 #H1 #L1 #H @(lpxs_ind_sn … H) -L1 /3 width=5 by fpbs_strap2, fpbq_lpx/ qed-. (* Basic_2A1: uses: lpxs_lleq_fpbs *) -lemma lpxs_fdeq_fpbs: ∀h,o,G1,L1,L,T1. ⦃G1, L1⦄ ⊢ ⬈*[h] L → - ∀G2,L2,T2. ⦃G1, L, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma lpxs_fdeq_fpbs: ∀h,G1,L1,L,T1. ⦃G1,L1⦄ ⊢ ⬈*[h] L → + ∀G2,L2,T2. ⦃G1,L,T1⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=3 by lpxs_fpbs_trans, fdeq_fpbs/ qed. -lemma fpbs_lpx_trans: ∀h,o,G1,G2,L1,L,T1,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L, T2⦄ → - ∀L2. ⦃G2, L⦄ ⊢ ⬈[h] L2 → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fpbs_lpx_trans: ∀h,G1,G2,L1,L,T1,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L,T2⦄ → + ∀L2. ⦃G2,L⦄ ⊢ ⬈[h] L2 → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=3 by fpbs_lpxs_trans, lpx_lpxs/ qed-. (* Properties with star-iterated structural successor for closures **********) -lemma fqus_lpxs_fpbs: ∀h,o,G1,G2,L1,L,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L, T2⦄ → - ∀L2. ⦃G2, L⦄ ⊢ ⬈*[h] L2 → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma fqus_lpxs_fpbs: ∀h,G1,G2,L1,L,T1,T2. ⦃G1,L1,T1⦄ ⬂* ⦃G2,L,T2⦄ → + ∀L2. ⦃G2,L⦄ ⊢ ⬈*[h] L2 → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=3 by fpbs_lpxs_trans, fqus_fpbs/ qed. (* Properties with unbound context-sensitive parallel rt-computation ********) -lemma cpxs_fqus_lpxs_fpbs: ∀h,o,G1,L1,T1,T. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T → - ∀G2,L,T2. ⦃G1, L1, T⦄ ⊐* ⦃G2, L, T2⦄ → - ∀L2.⦃G2, L⦄ ⊢ ⬈*[h] L2 → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄. +lemma cpxs_fqus_lpxs_fpbs: ∀h,G1,L1,T1,T. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T → + ∀G2,L,T2. ⦃G1,L1,T⦄ ⬂* ⦃G2,L,T2⦄ → + ∀L2.⦃G2,L⦄ ⊢ ⬈*[h] L2 → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄. /3 width=5 by cpxs_fqus_fpbs, fpbs_lpxs_trans/ qed. -lemma fpbs_cpxs_tdeq_fqup_lpx_trans: ∀h,o,G1,G3,L1,L3,T1,T3. ⦃G1, L1, T1⦄ ≥ [h, o] ⦃G3, L3, T3⦄ → - ∀T4. ⦃G3, L3⦄ ⊢ T3 ⬈*[h] T4 → ∀T5. T4 ≛[h, o] T5 → - ∀G2,L4,T2. ⦃G3, L3, T5⦄ ⊐+ ⦃G2, L4, T2⦄ → - ∀L2. ⦃G2, L4⦄ ⊢ ⬈[h] L2 → ⦃G1, L1, T1⦄ ≥ [h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G3 #L1 #L3 #T1 #T3 #H13 #T4 #HT34 #T5 #HT45 #G2 #L4 #T2 #H34 #L2 #HL42 +lemma fpbs_cpxs_tdeq_fqup_lpx_trans: ∀h,G1,G3,L1,L3,T1,T3. ⦃G1,L1,T1⦄ ≥ [h] ⦃G3,L3,T3⦄ → + ∀T4. ⦃G3,L3⦄ ⊢ T3 ⬈*[h] T4 → ∀T5. T4 ≛ T5 → + ∀G2,L4,T2. ⦃G3,L3,T5⦄ ⬂+ ⦃G2,L4,T2⦄ → + ∀L2. ⦃G2,L4⦄ ⊢ ⬈[h] L2 → ⦃G1,L1,T1⦄ ≥ [h] ⦃G2,L2,T2⦄. +#h #G1 #G3 #L1 #L3 #T1 #T3 #H13 #T4 #HT34 #T5 #HT45 #G2 #L4 #T2 #H34 #L2 #HL42 @(fpbs_lpx_trans … HL42) -L2 (**) (* full auto too slow *) @(fpbs_fqup_trans … H34) -G2 -L4 -T2 /3 width=3 by fpbs_cpxs_trans, fpbs_tdeq_trans/ @@ -75,19 +75,19 @@ qed-. (* Advanced properties ******************************************************) (* Basic_2A1: uses: fpbs_intro_alt *) -lemma fpbs_intro_star: ∀h,o,G1,L1,T1,T. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T → - ∀G,L,T0. ⦃G1, L1, T⦄ ⊐* ⦃G, L, T0⦄ → - ∀L0. ⦃G, L⦄ ⊢ ⬈*[h] L0 → - ∀G2,L2,T2. ⦃G, L0, T0⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ . +lemma fpbs_intro_star: ∀h,G1,L1,T1,T. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T → + ∀G,L,T0. ⦃G1,L1,T⦄ ⬂* ⦃G,L,T0⦄ → + ∀L0. ⦃G,L⦄ ⊢ ⬈*[h] L0 → + ∀G2,L2,T2. ⦃G,L0,T0⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ . /3 width=5 by cpxs_fqus_lpxs_fpbs, fpbs_strap1, fpbq_fdeq/ qed. (* Advanced inversion lemmas *************************************************) (* Basic_2A1: uses: fpbs_inv_alt *) -lemma fpbs_inv_star: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → - ∃∃G,L,L0,T,T0. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] T & ⦃G1, L1, T⦄ ⊐* ⦃G, L, T0⦄ - & ⦃G, L⦄ ⊢ ⬈*[h] L0 & ⦃G, L0, T0⦄ ≛[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind_dx … H) -G1 -L1 -T1 +lemma fpbs_inv_star: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → + ∃∃G,L,L0,T,T0. ⦃G1,L1⦄ ⊢ T1 ⬈*[h] T & ⦃G1,L1,T⦄ ⬂* ⦃G,L,T0⦄ + & ⦃G,L⦄ ⊢ ⬈*[h] L0 & ⦃G,L0,T0⦄ ≛ ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind_dx … H) -G1 -L1 -T1 [ /2 width=9 by ex4_5_intro/ | #G1 #G0 #L1 #L0 #T1 #T0 * -G0 -L0 -T0 [ #G0 #L0 #T0 #H10 #_ * #G3 #L3 #L4 #T3 #T4 #HT03 #H34 #HL34 #H42 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb.ma index 8ae6b26e8..e5a0108c3 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb.ma @@ -12,32 +12,32 @@ (* *) (**************************************************************************) -include "basic_2/notation/relations/predsubtystrong_5.ma". +include "basic_2/notation/relations/predsubtystrong_4.ma". include "basic_2/rt_transition/fpb.ma". (* STRONGLY NORMALIZING CLOSURES FOR PARALLEL RST-TRANSITION ****************) -inductive fsb (h) (o): relation3 genv lenv term ≝ +inductive fsb (h): relation3 genv lenv term ≝ | fsb_intro: ∀G1,L1,T1. ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G2, L2, T2⦄ → fsb h o G2 L2 T2 - ) → fsb h o G1 L1 T1 + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ → fsb h G2 L2 T2 + ) → fsb h G1 L1 T1 . interpretation "strong normalization for parallel rst-transition (closure)" - 'PRedSubTyStrong h o G L T = (fsb h o G L T). + 'PRedSubTyStrong h G L T = (fsb h G L T). (* Basic eliminators ********************************************************) (* Note: eliminator with shorter ground hypothesis *) (* Note: to be named fsb_ind when fsb becomes a definition like csx, lfsx ***) -lemma fsb_ind_alt: ∀h,o. ∀Q: relation3 …. ( - ∀G1,L1,T1. ≥[h,o] 𝐒⦃G1, L1, T1⦄ → ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2 +lemma fsb_ind_alt: ∀h. ∀Q: relation3 …. ( + ∀G1,L1,T1. ≥[h] 𝐒⦃G1,L1,T1⦄ → ( + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2 ) → Q G1 L1 T1 ) → - ∀G,L,T. ≥[h, o] 𝐒⦃G, L, T⦄ → Q G L T. -#h #o #Q #IH #G #L #T #H elim H -G -L -T + ∀G,L,T. ≥[h] 𝐒⦃G,L,T⦄ → Q G L T. +#h #Q #IH #G #L #T #H elim H -G -L -T /4 width=1 by fsb_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_aaa.ma index 43eb814dc..b95c6ced6 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_aaa.ma @@ -21,48 +21,47 @@ include "basic_2/rt_computation/fsb_csx.ma". (* Main properties with atomic arity assignment for terms *******************) -(* Note: this is the "big tree" theorem *) -theorem aaa_fsb: ∀h,o,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ≥[h, o] 𝐒⦃G, L, T⦄. +theorem aaa_fsb: ∀h,G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ≥[h] 𝐒⦃G,L,T⦄. /3 width=2 by aaa_csx, csx_fsb/ qed. (* Advanced eliminators with atomic arity assignment for terms **************) -fact aaa_ind_fpb_aux: ∀h,o. ∀Q:relation3 …. - (∀G1,L1,T1,A. ⦃G1, L1⦄ ⊢ T1 ⁝ A → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +fact aaa_ind_fpb_aux: ∀h. ∀Q:relation3 …. + (∀G1,L1,T1,A. ⦃G1,L1⦄ ⊢ T1 ⁝ A → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G,L,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ∀A. ⦃G, L⦄ ⊢ T ⁝ A → Q G L T. -#h #o #R #IH #G #L #T #H @(csx_ind_fpb … H) -G -L -T + ∀G,L,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ∀A. ⦃G,L⦄ ⊢ T ⁝ A → Q G L T. +#h #R #IH #G #L #T #H @(csx_ind_fpb … H) -G -L -T #G1 #L1 #T1 #H1 #IH1 #A1 #HTA1 @IH -IH // -#G2 #L2 #T2 #H12 elim (fpbs_aaa_conf h o … G2 … L2 … T2 … HTA1) -A1 +#G2 #L2 #T2 #H12 elim (fpbs_aaa_conf … G2 … L2 … T2 … HTA1) -A1 /2 width=2 by fpb_fpbs/ qed-. -lemma aaa_ind_fpb: ∀h,o. ∀Q:relation3 …. - (∀G1,L1,T1,A. ⦃G1, L1⦄ ⊢ T1 ⁝ A → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +lemma aaa_ind_fpb: ∀h. ∀Q:relation3 …. + (∀G1,L1,T1,A. ⦃G1,L1⦄ ⊢ T1 ⁝ A → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → Q G L T. + ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → Q G L T. /4 width=4 by aaa_ind_fpb_aux, aaa_csx/ qed-. -fact aaa_ind_fpbg_aux: ∀h,o. ∀Q:relation3 …. - (∀G1,L1,T1,A. ⦃G1, L1⦄ ⊢ T1 ⁝ A → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +fact aaa_ind_fpbg_aux: ∀h. ∀Q:relation3 …. + (∀G1,L1,T1,A. ⦃G1,L1⦄ ⊢ T1 ⁝ A → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G,L,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ∀A. ⦃G, L⦄ ⊢ T ⁝ A → Q G L T. -#h #o #Q #IH #G #L #T #H @(csx_ind_fpbg … H) -G -L -T + ∀G,L,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ∀A. ⦃G,L⦄ ⊢ T ⁝ A → Q G L T. +#h #Q #IH #G #L #T #H @(csx_ind_fpbg … H) -G -L -T #G1 #L1 #T1 #H1 #IH1 #A1 #HTA1 @IH -IH // -#G2 #L2 #T2 #H12 elim (fpbs_aaa_conf h o … G2 … L2 … T2 … HTA1) -A1 +#G2 #L2 #T2 #H12 elim (fpbs_aaa_conf … G2 … L2 … T2 … HTA1) -A1 /2 width=2 by fpbg_fwd_fpbs/ qed-. -lemma aaa_ind_fpbg: ∀h,o. ∀Q:relation3 …. - (∀G1,L1,T1,A. ⦃G1, L1⦄ ⊢ T1 ⁝ A → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +lemma aaa_ind_fpbg: ∀h. ∀Q:relation3 …. + (∀G1,L1,T1,A. ⦃G1,L1⦄ ⊢ T1 ⁝ A → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → Q G L T. + ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → Q G L T. /4 width=4 by aaa_ind_fpbg_aux, aaa_csx/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma index 2746e5457..de36632c3 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/rt_computation/rdsx_csx.ma". +include "basic_2/rt_computation/rsx_csx.ma". include "basic_2/rt_computation/fpbs_cpx.ma". include "basic_2/rt_computation/fpbs_csx.ma". include "basic_2/rt_computation/fsb_fpbg.ma". @@ -21,20 +21,20 @@ include "basic_2/rt_computation/fsb_fpbg.ma". (* Inversion lemmas with context-sensitive stringly rt-normalizing terms ****) -lemma fsb_inv_csx: ∀h,o,G,L,T. ≥[h, o] 𝐒⦃G, L, T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄. -#h #o #G #L #T #H @(fsb_ind_alt … H) -G -L -T /5 width=1 by csx_intro, fpb_cpx/ +lemma fsb_inv_csx: ∀h,G,L,T. ≥[h] 𝐒⦃G,L,T⦄ → ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +#h #G #L #T #H @(fsb_ind_alt … H) -G -L -T /5 width=1 by csx_intro, fpb_cpx/ qed-. (* Propreties with context-sensitive stringly rt-normalizing terms **********) -lemma csx_fsb_fpbs: ∀h,o,G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → ≥[h, o] 𝐒⦃G2, L2, T2⦄. -#h #o #G1 #L1 #T1 #H @(csx_ind … H) -T1 +lemma csx_fsb_fpbs: ∀h,G1,L1,T1. ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → ≥[h] 𝐒⦃G2,L2,T2⦄. +#h #G1 #L1 #T1 #H @(csx_ind … H) -T1 #T1 #HT1 #IHc #G2 #L2 #T2 @(fqup_wf_ind (Ⓣ) … G2 L2 T2) -G2 -L2 -T2 #G0 #L0 #T0 #IHu #H10 lapply (fpbs_csx_conf … H10) // -HT1 #HT0 generalize in match IHu; -IHu generalize in match H10; -H10 -@(rdsx_ind … (csx_rdsx … HT0)) -L0 +@(rsx_ind … (csx_rsx … HT0)) -L0 #L0 #_ #IHd #H10 #IHu @fsb_intro #G2 #L2 #T2 * -G2 -L2 -T2 [ -IHd -IHc | -IHu -IHd | ] [ /4 width=5 by fpbs_fqup_trans, fqu_fqup/ @@ -45,7 +45,7 @@ generalize in match IHu; -IHu generalize in match H10; -H10 [ /3 width=3 by fpbs_lpxs_trans, lpx_lpxs/ | #G3 #L3 #T3 #H03 #_ elim (lpx_fqup_trans … H03 … HL02) -L2 #L4 #T4 #HT04 #H43 #HL43 - elim (tdeq_dec h o T0 T4) [ -IHc -HT04 #HT04 | -IHu #HnT04 ] + elim (tdeq_dec T0 T4) [ -IHc -HT04 #HT04 | -IHu #HnT04 ] [ elim (tdeq_fqup_trans … H43 … HT04) -T4 #L2 #T4 #H04 #HT43 #HL24 /4 width=7 by fsb_fpbs_trans, tdeq_rdeq_lpx_fpbs, fpbs_fqup_trans/ | elim (cpxs_tdneq_fwd_step_sn … HT04 HnT04) -HT04 -HnT04 #T2 #T5 #HT02 #HnT02 #HT25 #HT54 @@ -56,23 +56,23 @@ generalize in match IHu; -IHu generalize in match H10; -H10 ] qed. -lemma csx_fsb: ∀h,o,G,L,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ≥[h, o] 𝐒⦃G, L, T⦄. +lemma csx_fsb: ∀h,G,L,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ≥[h] 𝐒⦃G,L,T⦄. /2 width=5 by csx_fsb_fpbs/ qed. (* Advanced eliminators *****************************************************) -lemma csx_ind_fpb: ∀h,o. ∀Q:relation3 genv lenv term. - (∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +lemma csx_ind_fpb: ∀h. ∀Q:relation3 genv lenv term. + (∀G1,L1,T1. ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G,L,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → Q G L T. + ∀G,L,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → Q G L T. /4 width=4 by fsb_inv_csx, csx_fsb, fsb_ind_alt/ qed-. -lemma csx_ind_fpbg: ∀h,o. ∀Q:relation3 genv lenv term. - (∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T1⦄ → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +lemma csx_ind_fpbg: ∀h. ∀Q:relation3 genv lenv term. + (∀G1,L1,T1. ⦃G1,L1⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G,L,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → Q G L T. + ∀G,L,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → Q G L T. /4 width=4 by fsb_inv_csx, csx_fsb, fsb_ind_fpbg/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fdeq.ma index 271a0e476..a24b46ffe 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fdeq.ma @@ -17,11 +17,11 @@ include "basic_2/rt_computation/fsb.ma". (* STRONGLY NORMALIZING CLOSURES FOR PARALLEL RST-TRANSITION ****************) -(* Properties with degree-based equivalence for closures ********************) +(* Properties with sort-irrelevant equivalence for closures *****************) -lemma fsb_fdeq_trans: ∀h,o,G1,L1,T1. ≥[h, o] 𝐒⦃G1, L1, T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ≥[h, o] 𝐒⦃G2, L2, T2⦄. -#h #o #G1 #L1 #T1 #H @(fsb_ind_alt … H) -G1 -L1 -T1 +lemma fsb_fdeq_trans: ∀h,G1,L1,T1. ≥[h] 𝐒⦃G1,L1,T1⦄ → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → ≥[h] 𝐒⦃G2,L2,T2⦄. +#h #G1 #L1 #T1 #H @(fsb_ind_alt … H) -G1 -L1 -T1 #G1 #L1 #T1 #_ #IH #G2 #L2 #T2 #H12 @fsb_intro #G #L #T #H2 elim (fdeq_fpb_trans … H12 … H2) -G2 -L2 -T2 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fpbg.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fpbg.ma index cd2c41248..0ebebad3a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fpbg.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_fpbg.ma @@ -19,9 +19,9 @@ include "basic_2/rt_computation/fsb_fdeq.ma". (* Properties with parallel rst-computation for closures ********************) -lemma fsb_fpbs_trans: ∀h,o,G1,L1,T1. ≥[h, o] 𝐒⦃G1, L1, T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → ≥[h, o] 𝐒⦃G2, L2, T2⦄. -#h #o #G1 #L1 #T1 #H @(fsb_ind_alt … H) -G1 -L1 -T1 +lemma fsb_fpbs_trans: ∀h,G1,L1,T1. ≥[h] 𝐒⦃G1,L1,T1⦄ → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → ≥[h] 𝐒⦃G2,L2,T2⦄. +#h #G1 #L1 #T1 #H @(fsb_ind_alt … H) -G1 -L1 -T1 #G1 #L1 #T1 #H1 #IH #G2 #L2 #T2 #H12 elim (fpbs_inv_fpbg … H12) -H12 [ -IH /2 width=5 by fsb_fdeq_trans/ @@ -31,21 +31,21 @@ qed-. (* Properties with proper parallel rst-computation for closures *************) -lemma fsb_intro_fpbg: ∀h,o,G1,L1,T1. ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄ → ≥[h, o] 𝐒⦃G2, L2, T2⦄ - ) → ≥[h, o] 𝐒⦃G1, L1, T1⦄. +lemma fsb_intro_fpbg: ∀h,G1,L1,T1. ( + ∀G2,L2,T2. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄ → ≥[h] 𝐒⦃G2,L2,T2⦄ + ) → ≥[h] 𝐒⦃G1,L1,T1⦄. /4 width=1 by fsb_intro, fpb_fpbg/ qed. (* Eliminators with proper parallel rst-computation for closures ************) -lemma fsb_ind_fpbg_fpbs: ∀h,o. ∀Q:relation3 genv lenv term. - (∀G1,L1,T1. ≥[h, o] 𝐒⦃G1, L1, T1⦄ → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +lemma fsb_ind_fpbg_fpbs: ∀h. ∀Q:relation3 genv lenv term. + (∀G1,L1,T1. ≥[h] 𝐒⦃G1,L1,T1⦄ → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G1,L1,T1. ≥[h, o] 𝐒⦃G1, L1, T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2. -#h #o #Q #IH1 #G1 #L1 #T1 #H @(fsb_ind_alt … H) -G1 -L1 -T1 + ∀G1,L1,T1. ≥[h] 𝐒⦃G1,L1,T1⦄ → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≥[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2. +#h #Q #IH1 #G1 #L1 #T1 #H @(fsb_ind_alt … H) -G1 -L1 -T1 #G1 #L1 #T1 #H1 #IH #G2 #L2 #T2 #H12 @IH1 -IH1 [ -IH /2 width=5 by fsb_fpbs_trans/ @@ -55,21 +55,21 @@ lemma fsb_ind_fpbg_fpbs: ∀h,o. ∀Q:relation3 genv lenv term. ] qed-. -lemma fsb_ind_fpbg: ∀h,o. ∀Q:relation3 genv lenv term. - (∀G1,L1,T1. ≥[h, o] 𝐒⦃G1, L1, T1⦄ → - (∀G2,L2,T2. ⦃G1, L1, T1⦄ >[h, o] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → +lemma fsb_ind_fpbg: ∀h. ∀Q:relation3 genv lenv term. + (∀G1,L1,T1. ≥[h] 𝐒⦃G1,L1,T1⦄ → + (∀G2,L2,T2. ⦃G1,L1,T1⦄ >[h] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → - ∀G1,L1,T1. ≥[h, o] 𝐒⦃G1, L1, T1⦄ → Q G1 L1 T1. -#h #o #Q #IH #G1 #L1 #T1 #H @(fsb_ind_fpbg_fpbs … H) -H + ∀G1,L1,T1. ≥[h] 𝐒⦃G1,L1,T1⦄ → Q G1 L1 T1. +#h #Q #IH #G1 #L1 #T1 #H @(fsb_ind_fpbg_fpbs … H) -H /3 width=1 by/ qed-. (* Inversion lemmas with proper parallel rst-computation for closures *******) -lemma fsb_fpbg_refl_false (h) (o) (G) (L) (T): - ≥[h,o] 𝐒⦃G, L, T⦄ → ⦃G, L, T⦄ >[h,o] ⦃G, L, T⦄ → ⊥. -#h #o #G #L #T #H +lemma fsb_fpbg_refl_false (h) (G) (L) (T): + ≥[h] 𝐒⦃G,L,T⦄ → ⦃G,L,T⦄ >[h] ⦃G,L,T⦄ → ⊥. +#h #G #L #T #H @(fsb_ind_fpbg … H) -G -L -T #G1 #L1 #T1 #_ #IH #H /2 width=5 by/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx.ma new file mode 100644 index 000000000..9521a9b27 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx.ma @@ -0,0 +1,104 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/notation/relations/topredtysnstrong_4.ma". +include "basic_2/rt_computation/rsx.ma". + +(* COMPATIBILITY OF STRONG NORMALIZATION FOR UNBOUND RT-TRANSITION **********) + +(* Note: this should be an instance of a more general sex *) +(* Basic_2A1: uses: lcosx *) +inductive jsx (h) (G): relation lenv ≝ +| jsx_atom: jsx h G (⋆) (⋆) +| jsx_bind: ∀I,K1,K2. jsx h G K1 K2 → + jsx h G (K1.ⓘ{I}) (K2.ⓘ{I}) +| jsx_pair: ∀I,K1,K2,V. jsx h G K1 K2 → + G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ → jsx h G (K1.ⓑ{I}V) (K2.ⓧ) +. + +interpretation + "strong normalization for unbound parallel rt-transition (compatibility)" + 'ToPRedTySNStrong h G L1 L2 = (jsx h G L1 L2). + +(* Basic inversion lemmas ***************************************************) + +fact jsx_inv_atom_sn_aux (h) (G): + ∀L1,L2. G ⊢ L1 ⊒[h] L2 → L1 = ⋆ → L2 = ⋆. +#h #G #L1 #L2 * -L1 -L2 +[ // +| #I #K1 #K2 #_ #H destruct +| #I #K1 #K2 #V #_ #_ #H destruct +] +qed-. + +lemma jsx_inv_atom_sn (h) (G): ∀L2. G ⊢ ⋆ ⊒[h] L2 → L2 = ⋆. +/2 width=5 by jsx_inv_atom_sn_aux/ qed-. + +fact jsx_inv_bind_sn_aux (h) (G): + ∀L1,L2. G ⊢ L1 ⊒[h] L2 → + ∀I,K1. L1 = K1.ⓘ{I} → + ∨∨ ∃∃K2. G ⊢ K1 ⊒[h] K2 & L2 = K2.ⓘ{I} + | ∃∃J,K2,V. G ⊢ K1 ⊒[h] K2 & G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ & I = BPair J V & L2 = K2.ⓧ. +#h #G #L1 #L2 * -L1 -L2 +[ #J #L1 #H destruct +| #I #K1 #K2 #HK12 #J #L1 #H destruct /3 width=3 by ex2_intro, or_introl/ +| #I #K1 #K2 #V #HK12 #HV #J #L1 #H destruct /3 width=7 by ex4_3_intro, or_intror/ +] +qed-. + +lemma jsx_inv_bind_sn (h) (G): + ∀I,K1,L2. G ⊢ K1.ⓘ{I} ⊒[h] L2 → + ∨∨ ∃∃K2. G ⊢ K1 ⊒[h] K2 & L2 = K2.ⓘ{I} + | ∃∃J,K2,V. G ⊢ K1 ⊒[h] K2 & G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ & I = BPair J V & L2 = K2.ⓧ. +/2 width=3 by jsx_inv_bind_sn_aux/ qed-. + +(* Advanced inversion lemmas ************************************************) + +(* Basic_2A1: uses: lcosx_inv_pair *) +lemma jsx_inv_pair_sn (h) (G): + ∀I,K1,L2,V. G ⊢ K1.ⓑ{I}V ⊒[h] L2 → + ∨∨ ∃∃K2. G ⊢ K1 ⊒[h] K2 & L2 = K2.ⓑ{I}V + | ∃∃K2. G ⊢ K1 ⊒[h] K2 & G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ & L2 = K2.ⓧ. +#h #G #I #K1 #L2 #V #H elim (jsx_inv_bind_sn … H) -H * +[ /3 width=3 by ex2_intro, or_introl/ +| #J #K2 #X #HK12 #HX #H1 #H2 destruct /3 width=4 by ex3_intro, or_intror/ +] +qed-. + +lemma jsx_inv_void_sn (h) (G): + ∀K1,L2. G ⊢ K1.ⓧ ⊒[h] L2 → + ∃∃K2. G ⊢ K1 ⊒[h] K2 & L2 = K2.ⓧ. +#h #G #K1 #L2 #H elim (jsx_inv_bind_sn … H) -H * +/2 width=3 by ex2_intro/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma jsx_fwd_bind_sn (h) (G): + ∀I1,K1,L2. G ⊢ K1.ⓘ{I1} ⊒[h] L2 → + ∃∃I2,K2. G ⊢ K1 ⊒[h] K2 & L2 = K2.ⓘ{I2}. +#h #G #I1 #K1 #L2 #H elim (jsx_inv_bind_sn … H) -H * +/2 width=4 by ex2_2_intro/ +qed-. + +(* Advanced properties ******************************************************) + +(* Basic_2A1: uses: lcosx_O *) +lemma jsx_refl (h) (G): reflexive … (jsx h G). +#h #G #L elim L -L /2 width=1 by jsx_atom, jsx_bind/ +qed. + +(* Basic_2A1: removed theorems 2: + lcosx_drop_trans_lt lcosx_inv_succ +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_csx.ma new file mode 100644 index 000000000..b8e919b73 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_csx.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 "basic_2/rt_computation/rsx_csx.ma". +include "basic_2/rt_computation/jsx_drops.ma". +include "basic_2/rt_computation/jsx_lsubr.ma". + +(* COMPATIBILITY OF STRONG NORMALIZATION FOR UNBOUND RT-TRANSITION **********) + +(* Properties with strongly rt-normalizing terms ****************************) + +lemma jsx_csx_conf (h) (G): + ∀L1,L2. G ⊢ L1 ⊒[h] L2 → + ∀T. ⦃G,L1⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G,L2⦄ ⊢ ⬈*[h] 𝐒⦃T⦄. +/3 width=5 by jsx_fwd_lsubr, csx_lsubr_conf/ qed-. + +(* Properties with strongly rt-normalizing referred local environments ******) + +(* Note: Try by induction on the 2nd premise by generalizing V with f *) +lemma rsx_jsx_trans (h) (G): + ∀L1,V. G ⊢ ⬈*[h,V] 𝐒⦃L1⦄ → + ∀L2. G ⊢ L1 ⊒[h] L2 → G ⊢ ⬈*[h,V] 𝐒⦃L2⦄. +#h #G #L1 #V @(fqup_wf_ind_eq (Ⓕ) … G L1 V) -G -L1 -V +#G0 #L0 #V0 #IH #G #L1 * * +[ // +| #i #HG #HL #HV #H #L2 #HL12 destruct + elim (rsx_inv_lref_drops … H) -H [|*: * ] + [ #HL1 -IH + lapply (jsx_fwd_drops_atom_sn … HL12 … HL1) -L1 + /2 width=1 by rsx_lref_atom_drops/ + | #I #K1 #HLK1 -IH + elim (jsx_fwd_drops_unit_sn … HL12 … HLK1) -L1 [| // ] #K2 #HK12 #HLK2 + /2 width=3 by rsx_lref_unit_drops/ + | #I #K1 #V1 #HLK1 #HV1 #HK1 + elim (jsx_fwd_drops_pair_sn … HL12 … HLK1) -HL12 [3: // |*: * ] + [ #K2 #HK12 #HLK2 + /4 width=6 by rsx_lref_pair_drops, jsx_csx_conf, fqup_lref/ + | #K2 #_ #HLK2 #_ + /2 width=3 by rsx_lref_unit_drops/ + ] + ] +| // +| #p #I #V #T #HG #HL #HV #H #L2 #HL12 destruct + elim (rsx_inv_bind_void … H) -H #HV #HT + /4 width=4 by jsx_bind, rsx_bind_void/ +| #I #V #T #HG #HL #HV #H #L2 #HL12 destruct + elim (rsx_inv_flat … H) -H #HV #HT + /3 width=4 by rsx_flat/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_drops.ma new file mode 100644 index 000000000..93368d554 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_drops.ma @@ -0,0 +1,75 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/relocation/drops.ma". +include "basic_2/rt_computation/jsx.ma". + +(* COMPATIBILITY OF STRONG NORMALIZATION FOR UNBOUND RT-TRANSITION **********) + +(* Forward lemmas with uniform slicing for local environments ***************) + +lemma jsx_fwd_drops_atom_sn (h) (b) (G): + ∀L1,L2. G ⊢ L1 ⊒[h] L2 → + ∀f. 𝐔⦃f⦄ → ⬇*[b,f]L1 ≘ ⋆ → ⬇*[b,f]L2 ≘ ⋆. +#h #b #G #L1 #L2 #H elim H -L1 -L2 +[ #f #_ #H // +| #I #K1 #K2 #_ #IH #f #Hf #H +| #I #K1 #K2 #V #_ #HV #IH #f #Hf #H +] +elim (drops_inv_bind1_isuni … H) -H [3,6: // |*: * -Hf ] +[1,3: #_ #H destruct +|2,4: #g #Hg #HK1 #H destruct /3 width=1 by drops_drop/ +] +qed-. + +lemma jsx_fwd_drops_unit_sn (h) (b) (G): + ∀L1,L2. G ⊢ L1 ⊒[h] L2 → + ∀f. 𝐔⦃f⦄ → ∀I,K1. ⬇*[b,f]L1 ≘ K1.ⓤ{I} → + ∃∃K2. G ⊢ K1 ⊒[h] K2 & ⬇*[b,f]L2 ≘ K2.ⓤ{I}. +#h #b #G #L1 #L2 #H elim H -L1 -L2 +[ #f #_ #J #Y1 #H + lapply (drops_inv_atom1 … H) -H * #H #_ destruct +| #I #K1 #K2 #HK12 #IH #f #Hf #J #Y1 #H +| #I #K1 #K2 #V #HK12 #HV #IH #f #Hf #J #Y1 #H +] +elim (drops_inv_bind1_isuni … H) -H [3,6: // |*: * -Hf ] +[1,3: #Hf #H destruct -IH /3 width=3 by drops_refl, ex2_intro/ +|2,4: + #g #Hg #HK1 #H destruct + elim (IH … Hg … HK1) -K1 -Hg #Y2 #HY12 #HKY2 + /3 width=3 by drops_drop, ex2_intro/ +] +qed-. + +lemma jsx_fwd_drops_pair_sn (h) (b) (G): + ∀L1,L2. G ⊢ L1 ⊒[h] L2 → + ∀f. 𝐔⦃f⦄ → ∀I,K1,V. ⬇*[b,f]L1 ≘ K1.ⓑ{I}V → + ∨∨ ∃∃K2. G ⊢ K1 ⊒[h] K2 & ⬇*[b,f]L2 ≘ K2.ⓑ{I}V + | ∃∃K2. G ⊢ K1 ⊒[h] K2 & ⬇*[b,f]L2 ≘ K2.ⓧ & G ⊢ ⬈*[h,V] 𝐒⦃K2⦄. +#h #b #G #L1 #L2 #H elim H -L1 -L2 +[ #f #_ #J #Y1 #X1 #H + lapply (drops_inv_atom1 … H) -H * #H #_ destruct +| #I #K1 #K2 #HK12 #IH #f #Hf #J #Y1 #X1 #H +| #I #K1 #K2 #V #HK12 #HV #IH #f #Hf #J #Y1 #X1 #H +] +elim (drops_inv_bind1_isuni … H) -H [3,6: // |*: * -Hf ] +[1,3: + #Hf #H destruct -IH + /4 width=4 by drops_refl, ex3_intro, ex2_intro, or_introl, or_intror/ +|2,4: + #g #Hg #HK1 #H destruct + elim (IH … Hg … HK1) -K1 -Hg * #Y2 #HY12 #HKY2 [2,4: #HX1 ] + /4 width=4 by drops_drop, ex3_intro, ex2_intro, or_introl, or_intror/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_jsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_jsx.ma new file mode 100644 index 000000000..b53d0d6f7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_jsx.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 "basic_2/rt_computation/jsx_csx.ma". + +(* COMPATIBILITY OF STRONG NORMALIZATION FOR UNBOUND RT-TRANSITION **********) + +(* Main properties **********************************************************) + +theorem jsx_trans (h) (G): Transitive … (jsx h G). +#h #G #L1 #L #H elim H -L1 -L +[ #L2 #H + >(jsx_inv_atom_sn … H) -L2 // +| #I #K1 #K #_ #IH #L2 #H + elim (jsx_inv_bind_sn … H) -H * + [ #K2 #HK2 #H destruct /3 width=1 by jsx_bind/ + | #J #K2 #V #HK2 #HV #H1 #H2 destruct /3 width=1 by jsx_pair/ + ] +| #I #K1 #K #V #_ #HV #IH #L2 #H + elim (jsx_inv_void_sn … H) -H #K2 #HK2 #H destruct + /3 width=3 by rsx_jsx_trans, jsx_pair/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_lsubr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_lsubr.ma new file mode 100644 index 000000000..6fc723294 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_lsubr.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 "static_2/static/lsubr.ma". +include "basic_2/rt_computation/jsx.ma". + +(* COMPATIBILITY OF STRONG NORMALIZATION FOR UNBOUND RT-TRANSITION **********) + +(* Forward lemmas with restricted refinement for local environments *********) + +lemma jsx_fwd_lsubr (h) (G): ∀L1,L2. G ⊢ L1 ⊒[h] L2 → L1 ⫃ L2. +#h #G #L1 #L2 #H elim H -L1 -L2 +/2 width=1 by lsubr_bind, lsubr_unit/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_rsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_rsx.ma new file mode 100644 index 000000000..4d294b2e2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/jsx_rsx.ma @@ -0,0 +1,77 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/rsx_drops.ma". +include "basic_2/rt_computation/rsx_lpxs.ma". +include "basic_2/rt_computation/jsx.ma". + +(* COMPATIBILITY OF STRONG NORMALIZATION FOR UNBOUND RT-TRANSITION **********) + +(* Properties with strongly normalizing referred local environments *********) + +(* Basic_2A1: uses: lsx_cpx_trans_lcosx *) +lemma rsx_cpx_trans_jsx (h) (G): + ∀L0,T1,T2. ⦃G,L0⦄ ⊢ T1 ⬈[h] T2 → + ∀L. G ⊢ L0 ⊒[h] L → G ⊢ ⬈*[h,T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h,T2] 𝐒⦃L⦄. +#h #G #L0 #T1 #T2 #H @(cpx_ind … H) -G -L0 -T1 -T2 +[ // +| // +| #I0 #G #K0 #V1 #V2 #W2 #_ #IH #HVW2 #L #HK0 #HL + elim (jsx_inv_pair_sn … HK0) -HK0 * + [ #K #HK0 #H destruct + /4 width=8 by rsx_lifts, rsx_fwd_pair, drops_refl, drops_drop/ + | #K #HK0 #HV1 #H destruct + /4 width=8 by rsx_lifts, drops_refl, drops_drop/ + ] +| #I0 #G #K0 #T #U #i #_ #IH #HTU #L #HK0 #HL + elim (jsx_fwd_bind_sn … HK0) -HK0 #I #K #HK0 #H destruct + /6 width=8 by rsx_inv_lifts, rsx_lifts, drops_refl, drops_drop/ +| #p #I0 #G #L0 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #HL0 #HL + elim (rsx_inv_bind_void … HL) -HL + /4 width=2 by jsx_pair, rsx_bind_void/ +| #I0 #G #L0 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #HL0 #HL + elim (rsx_inv_flat … HL) -HL /3 width=2 by rsx_flat/ +| #G #L0 #V #U1 #T1 #T2 #HTU1 #_ #IHT12 #L #HL0 #HL + elim (rsx_inv_bind_void … HL) -HL #HV #HU1 + /5 width=8 by rsx_inv_lifts, drops_refl, drops_drop/ +| #G #L0 #V #T1 #T2 #_ #IHT12 #L #HL0 #HL + elim (rsx_inv_flat … HL) -HL /2 width=2 by/ +| #G #L0 #V1 #V2 #T #_ #IHV12 #L #HL0 #HL + elim (rsx_inv_flat … HL) -HL /2 width=2 by/ +| #p #G #L0 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L #HL0 #HL + elim (rsx_inv_flat … HL) -HL #HV1 #HL + elim (rsx_inv_bind_void … HL) -HL #HW1 #HT1 + /4 width=2 by jsx_pair, rsx_bind_void, rsx_flat/ +| #p #G #L0 #V1 #V2 #U2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #HVU2 #L #HL0 #HL + elim (rsx_inv_flat … HL) -HL #HV1 #HL + elim (rsx_inv_bind_void … HL) -HL #HW1 #HT1 + /6 width=8 by jsx_pair, rsx_lifts, rsx_bind_void, rsx_flat, drops_refl, drops_drop/ +] +qed-. + +(* Advanced properties of strongly normalizing referred local environments **) + +(* Basic_2A1: uses: lsx_cpx_trans_O *) +lemma rsx_cpx_trans (h) (G): + ∀L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → + G ⊢ ⬈*[h,T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h,T2] 𝐒⦃L⦄. +/3 width=6 by rsx_cpx_trans_jsx, jsx_refl/ qed-. + +lemma rsx_cpxs_trans (h) (G): + ∀L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈*[h] T2 → + G ⊢ ⬈*[h,T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h,T2] 𝐒⦃L⦄. +#h #G #L #T1 #T2 #H +@(cpxs_ind_dx ???????? H) -T1 // +/3 width=3 by rsx_cpx_trans/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs.ma index 880278d22..7a3de7dca 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs.ma @@ -28,38 +28,38 @@ interpretation (* Basic properties *********************************************************) (* Basic_2A1: uses: lprs_pair_refl *) -lemma lprs_bind_refl_dx (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → - ∀I. ⦃G, L1.ⓘ{I}⦄ ⊢ ➡*[h] L2.ⓘ{I}. +lemma lprs_bind_refl_dx (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → + ∀I. ⦃G,L1.ⓘ{I}⦄ ⊢ ➡*[h] L2.ⓘ{I}. /2 width=1 by lex_bind_refl_dx/ qed. -lemma lprs_pair (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → - ∀V1,V2. ⦃G, L1⦄ ⊢ V1 ➡*[h] V2 → - ∀I. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2.ⓑ{I}V2. +lemma lprs_pair (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → + ∀V1,V2. ⦃G,L1⦄ ⊢ V1 ➡*[h] V2 → + ∀I. ⦃G,L1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2.ⓑ{I}V2. /2 width=1 by lex_pair/ qed. -lemma lprs_refl (h) (G): ∀L. ⦃G, L⦄ ⊢ ➡*[h] L. +lemma lprs_refl (h) (G): ∀L. ⦃G,L⦄ ⊢ ➡*[h] L. /2 width=1 by lex_refl/ qed. (* Basic inversion lemmas ***************************************************) (* Basic_2A1: uses: lprs_inv_atom1 *) -lemma lprs_inv_atom_sn (h) (G): ∀L2. ⦃G, ⋆⦄ ⊢ ➡*[h] L2 → L2 = ⋆. +lemma lprs_inv_atom_sn (h) (G): ∀L2. ⦃G,⋆⦄ ⊢ ➡*[h] L2 → L2 = ⋆. /2 width=2 by lex_inv_atom_sn/ qed-. (* Basic_2A1: was: lprs_inv_pair1 *) lemma lprs_inv_pair_sn (h) (G): - ∀I,K1,L2,V1. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2 → - ∃∃K2,V2. ⦃G, K1⦄ ⊢ ➡*[h] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h] V2 & L2 = K2.ⓑ{I}V2. + ∀I,K1,L2,V1. ⦃G,K1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2 → + ∃∃K2,V2. ⦃G,K1⦄ ⊢ ➡*[h] K2 & ⦃G,K1⦄ ⊢ V1 ➡*[h] V2 & L2 = K2.ⓑ{I}V2. /2 width=1 by lex_inv_pair_sn/ qed-. (* Basic_2A1: uses: lprs_inv_atom2 *) -lemma lprs_inv_atom_dx (h) (G): ∀L1. ⦃G, L1⦄ ⊢ ➡*[h] ⋆ → L1 = ⋆. +lemma lprs_inv_atom_dx (h) (G): ∀L1. ⦃G,L1⦄ ⊢ ➡*[h] ⋆ → L1 = ⋆. /2 width=2 by lex_inv_atom_dx/ qed-. (* Basic_2A1: was: lprs_inv_pair2 *) lemma lprs_inv_pair_dx (h) (G): - ∀I,L1,K2,V2. ⦃G, L1⦄ ⊢ ➡*[h] K2.ⓑ{I}V2 → - ∃∃K1,V1. ⦃G, K1⦄ ⊢ ➡*[h] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h] V2 & L1 = K1.ⓑ{I}V1. + ∀I,L1,K2,V2. ⦃G,L1⦄ ⊢ ➡*[h] K2.ⓑ{I}V2 → + ∃∃K1,V1. ⦃G,K1⦄ ⊢ ➡*[h] K2 & ⦃G,K1⦄ ⊢ V1 ➡*[h] V2 & L1 = K1.ⓑ{I}V1. /2 width=1 by lex_inv_pair_dx/ qed-. (* Basic eliminators ********************************************************) @@ -68,12 +68,12 @@ lemma lprs_inv_pair_dx (h) (G): lemma lprs_ind (h) (G): ∀Q:relation lenv. Q (⋆) (⋆) → ( ∀I,K1,K2. - ⦃G, K1⦄ ⊢ ➡*[h] K2 → + ⦃G,K1⦄ ⊢ ➡*[h] K2 → Q K1 K2 → Q (K1.ⓘ{I}) (K2.ⓘ{I}) ) → ( ∀I,K1,K2,V1,V2. - ⦃G, K1⦄ ⊢ ➡*[h] K2 → ⦃G, K1⦄ ⊢ V1 ➡*[h] V2 → + ⦃G,K1⦄ ⊢ ➡*[h] K2 → ⦃G,K1⦄ ⊢ V1 ➡*[h] V2 → Q K1 K2 → Q (K1.ⓑ{I}V1) (K2.ⓑ{I}V2) ) → - ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → Q L1 L2. + ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → Q L1 L2. /3 width=4 by lex_ind/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cpms.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cpms.ma index 0c625a2da..591dbd1c1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cpms.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cpms.ma @@ -19,22 +19,22 @@ include "basic_2/rt_computation/lprs_lpr.ma". (* Properties with t-bound context-sensitive rt-computarion for terms *******) lemma lprs_cpms_trans (n) (h) (G): - ∀L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ➡*[n, h] T2 → - ∀L1. ⦃G, L1⦄ ⊢ ➡*[h] L2 → ⦃G, L1⦄ ⊢ T1 ➡*[n, h] T2. + ∀L2,T1,T2. ⦃G,L2⦄ ⊢ T1 ➡*[n,h] T2 → + ∀L1. ⦃G,L1⦄ ⊢ ➡*[h] L2 → ⦃G,L1⦄ ⊢ T1 ➡*[n,h] T2. #n #h #G #L2 #T1 #T2 #HT12 #L1 #H @(lprs_ind_sn … H) -L1 /2 width=3 by lpr_cpms_trans/ qed-. lemma lprs_cpm_trans (n) (h) (G): - ∀L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ➡[n, h] T2 → - ∀L1. ⦃G, L1⦄ ⊢ ➡*[h] L2 → ⦃G, L1⦄ ⊢ T1 ➡*[n, h] T2. + ∀L2,T1,T2. ⦃G,L2⦄ ⊢ T1 ➡[n,h] T2 → + ∀L1. ⦃G,L1⦄ ⊢ ➡*[h] L2 → ⦃G,L1⦄ ⊢ T1 ➡*[n,h] T2. /3 width=3 by lprs_cpms_trans, cpm_cpms/ qed-. (* Basic_2A1: includes cprs_bind2 *) lemma cpms_bind_dx (n) (h) (G) (L): - ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[n, h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n, h] ⓑ{p,I}V2.T2. + ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V2⦄ ⊢ T1 ➡*[n,h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n,h] ⓑ{p,I}V2.T2. /4 width=5 by lprs_cpms_trans, lprs_pair, cpms_bind/ qed. (* Inversion lemmas with t-bound context-sensitive rt-computarion for terms *) @@ -43,8 +43,8 @@ lemma cpms_bind_dx (n) (h) (G) (L): (* Basic_2A1: includes: cprs_inv_abst1 *) (* Basic_2A1: uses: scpds_inv_abst1 *) lemma cpms_inv_abst_sn (n) (h) (G) (L): - ∀p,V1,T1,X2. ⦃G, L⦄ ⊢ ⓛ{p}V1.T1 ➡*[n, h] X2 → - ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ➡*[n, h] T2 & + ∀p,V1,T1,X2. ⦃G,L⦄ ⊢ ⓛ{p}V1.T1 ➡*[n,h] X2 → + ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 & ⦃G,L.ⓛV1⦄ ⊢ T1 ➡*[n,h] T2 & X2 = ⓛ{p}V2.T2. #n #h #G #L #p #V1 #T1 #X2 #H @(cpms_ind_dx … H) -X2 /2 width=5 by ex3_2_intro/ @@ -62,20 +62,20 @@ elim (cpms_inv_abst_sn … H) -H #W0 #U #HW0 #HTU #H destruct qed-. (* Basic_2A1: includes: cprs_inv_abst *) -lemma cpms_inv_abst_bi (n) (h) (G) (L): - ∀p,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{p}W1.T1 ➡*[n, h] ⓛ{p}W2.T2 → - ∧∧ ⦃G, L⦄ ⊢ W1 ➡*[h] W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ➡*[n, h] T2. -#n #h #G #L #p #W1 #W2 #T1 #T2 #H +lemma cpms_inv_abst_bi (n) (h) (p1) (p2) (G) (L): + ∀W1,W2,T1,T2. ⦃G,L⦄ ⊢ ⓛ{p1}W1.T1 ➡*[n,h] ⓛ{p2}W2.T2 → + ∧∧ p1 = p2 & ⦃G,L⦄ ⊢ W1 ➡*[h] W2 & ⦃G,L.ⓛW1⦄ ⊢ T1 ➡*[n,h] T2. +#n #h #p1 #p2 #G #L #W1 #W2 #T1 #T2 #H elim (cpms_inv_abst_sn … H) -H #W #T #HW1 #HT1 #H destruct -/2 width=1 by conj/ +/2 width=1 by and3_intro/ qed-. (* Basic_1: was pr3_gen_abbr *) (* Basic_2A1: includes: cprs_inv_abbr1 *) lemma cpms_inv_abbr_sn_dx (n) (h) (G) (L): - ∀p,V1,T1,X2. ⦃G, L⦄ ⊢ ⓓ{p}V1.T1 ➡*[n, h] X2 → - ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[n, h] T2 & X2 = ⓓ{p}V2.T2 - | ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[n ,h] T2 & ⬆*[1] X2 ≘ T2 & p = Ⓣ. + ∀p,V1,T1,X2. ⦃G,L⦄ ⊢ ⓓ{p}V1.T1 ➡*[n,h] X2 → + ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 & ⦃G,L.ⓓV1⦄ ⊢ T1 ➡*[n,h] T2 & X2 = ⓓ{p}V2.T2 + | ∃∃T2. ⦃G,L.ⓓV1⦄ ⊢ T1 ➡*[n ,h] T2 & ⬆*[1] X2 ≘ T2 & p = Ⓣ. #n #h #G #L #p #V1 #T1 #X2 #H @(cpms_ind_dx … H) -X2 -n /3 width=5 by ex3_2_intro, or_introl/ #n1 #n2 #X #X2 #_ * * @@ -95,8 +95,8 @@ qed-. (* Basic_2A1: uses: scpds_inv_abbr_abst *) lemma cpms_inv_abbr_abst (n) (h) (G) (L): - ∀p1,p2,V1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓓ{p1}V1.T1 ➡*[n, h] ⓛ{p2}W2.T2 → - ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[n, h] T & ⬆*[1] ⓛ{p2}W2.T2 ≘ T & p1 = Ⓣ. + ∀p1,p2,V1,W2,T1,T2. ⦃G,L⦄ ⊢ ⓓ{p1}V1.T1 ➡*[n,h] ⓛ{p2}W2.T2 → + ∃∃T. ⦃G,L.ⓓV1⦄ ⊢ T1 ➡*[n,h] T & ⬆*[1] ⓛ{p2}W2.T2 ≘ T & p1 = Ⓣ. #n #h #G #L #p1 #p2 #V1 #W2 #T1 #T2 #H elim (cpms_inv_abbr_sn_dx … H) -H * [ #V #T #_ #_ #H destruct diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cprs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cprs.ma index 958fcab3b..1706ae98e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cprs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cprs.ma @@ -20,16 +20,16 @@ include "basic_2/rt_computation/lprs_cpms.ma". (* Advanced properties ******************************************************) (* Basic_2A1: was: lprs_pair2 *) -lemma lprs_pair_dx (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → - ∀V1,V2. ⦃G, L2⦄ ⊢ V1 ➡*[h] V2 → - ∀I. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2.ⓑ{I}V2. +lemma lprs_pair_dx (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → + ∀V1,V2. ⦃G,L2⦄ ⊢ V1 ➡*[h] V2 → + ∀I. ⦃G,L1.ⓑ{I}V1⦄ ⊢ ➡*[h] L2.ⓑ{I}V2. /3 width=3 by lprs_pair, lprs_cpms_trans/ qed. (* Properties on context-sensitive parallel r-computation for terms *********) -lemma lprs_cprs_conf_dx (h) (G): ∀L0.∀T0,T1:term. ⦃G, L0⦄ ⊢ T0 ➡*[h] T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡*[h] L1 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. +lemma lprs_cprs_conf_dx (h) (G): ∀L0.∀T0,T1:term. ⦃G,L0⦄ ⊢ T0 ➡*[h] T1 → + ∀L1. ⦃G,L0⦄ ⊢ ➡*[h] L1 → + ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[h] T & ⦃G,L1⦄ ⊢ T0 ➡*[h] T. #h #G #L0 #T0 #T1 #HT01 #L1 #H @(lprs_ind_dx … H) -L1 /2 width=3 by ex2_intro/ #L #L1 #_ #HL1 * #T #HT1 #HT0 -L0 @@ -39,21 +39,21 @@ elim (cprs_conf … HT2 … HT3) -T /3 width=5 by cprs_trans, ex2_intro/ qed-. -lemma lprs_cpr_conf_dx (h) (G): ∀L0. ∀T0,T1:term. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡*[h] L1 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. +lemma lprs_cpr_conf_dx (h) (G): ∀L0. ∀T0,T1:term. ⦃G,L0⦄ ⊢ T0 ➡[h] T1 → + ∀L1. ⦃G,L0⦄ ⊢ ➡*[h] L1 → + ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[h] T & ⦃G,L1⦄ ⊢ T0 ➡*[h] T. /3 width=3 by lprs_cprs_conf_dx, cpm_cpms/ qed-. (* Note: this can be proved on its own using lprs_ind_sn *) -lemma lprs_cprs_conf_sn (h) (G): ∀L0. ∀T0,T1:term. ⦃G, L0⦄ ⊢ T0 ➡*[h] T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡*[h] L1 → - ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. +lemma lprs_cprs_conf_sn (h) (G): ∀L0. ∀T0,T1:term. ⦃G,L0⦄ ⊢ T0 ➡*[h] T1 → + ∀L1. ⦃G,L0⦄ ⊢ ➡*[h] L1 → + ∃∃T. ⦃G,L0⦄ ⊢ T1 ➡*[h] T & ⦃G,L1⦄ ⊢ T0 ➡*[h] T. #h #G #L0 #T0 #T1 #HT01 #L1 #HL01 elim (lprs_cprs_conf_dx … HT01 … HL01) -HT01 /3 width=3 by lprs_cpms_trans, ex2_intro/ qed-. -lemma lprs_cpr_conf_sn (h) (G): ∀L0. ∀T0,T1:term. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡*[h] L1 → - ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. +lemma lprs_cpr_conf_sn (h) (G): ∀L0. ∀T0,T1:term. ⦃G,L0⦄ ⊢ T0 ➡[h] T1 → + ∀L1. ⦃G,L0⦄ ⊢ ➡*[h] L1 → + ∃∃T. ⦃G,L0⦄ ⊢ T1 ➡*[h] T & ⦃G,L1⦄ ⊢ T0 ➡*[h] T. /3 width=3 by lprs_cprs_conf_sn, cpm_cpms/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_ctc.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_ctc.ma index ecef51fe5..742a0038a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_ctc.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_ctc.ma @@ -20,11 +20,11 @@ include "basic_2/rt_computation/lprs.ma". (* Properties with contextual transitive closure ****************************) lemma lprs_CTC (h) (G): - ∀L1,L2. L1⪤[CTC … (λL. cpm h G L 0)] L2 → ⦃G, L1⦄⊢ ➡*[h] L2. + ∀L1,L2. L1⪤[CTC … (λL. cpm h G L 0)] L2 → ⦃G,L1⦄⊢ ➡*[h] L2. /3 width=3 by cprs_CTC, lex_co/ qed. (* Inversion lemmas with contextual transitive closure **********************) lemma lprs_inv_CTC (h) (G): - ∀L1,L2. ⦃G, L1⦄⊢ ➡*[h] L2 → L1⪤[CTC … (λL. cpm h G L 0)] L2. + ∀L1,L2. ⦃G,L1⦄⊢ ➡*[h] L2 → L1⪤[CTC … (λL. cpm h G L 0)] L2. /3 width=3 by cprs_inv_CTC, lex_co/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_length.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_length.ma index ae38e76a4..4327dcb7b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_length.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_length.ma @@ -19,5 +19,5 @@ include "basic_2/rt_computation/lprs.ma". (* Forward lemmas with length for local environments ************************) -lemma lprs_fwd_length (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → |L1| = |L2|. +lemma lprs_fwd_length (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → |L1| = |L2|. /2 width=2 by lex_fwd_length/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpr.ma index 120177208..ea0456434 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpr.ma @@ -20,29 +20,29 @@ include "basic_2/rt_computation/lprs_tc.ma". (* Basic_2A1: was: lprs_ind_dx *) lemma lprs_ind_sn (h) (G) (L2): ∀Q:predicate lenv. Q L2 → - (∀L1,L. ⦃G, L1⦄ ⊢ ➡[h] L → ⦃G, L⦄ ⊢ ➡*[h] L2 → Q L → Q L1) → - ∀L1. ⦃G, L1⦄ ⊢ ➡*[h] L2 → Q L1. + (∀L1,L. ⦃G,L1⦄ ⊢ ➡[h] L → ⦃G,L⦄ ⊢ ➡*[h] L2 → Q L → Q L1) → + ∀L1. ⦃G,L1⦄ ⊢ ➡*[h] L2 → Q L1. /4 width=8 by lprs_inv_CTC, lprs_CTC, lpr_cprs_trans, cpr_refl, lex_CTC_ind_sn/ qed-. (* Basic_2A1: was: lprs_ind *) lemma lprs_ind_dx (h) (G) (L1): ∀Q:predicate lenv. Q L1 → - (∀L,L2. ⦃G, L1⦄ ⊢ ➡*[h] L → ⦃G, L⦄ ⊢ ➡[h] L2 → Q L → Q L2) → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → Q L2. + (∀L,L2. ⦃G,L1⦄ ⊢ ➡*[h] L → ⦃G,L⦄ ⊢ ➡[h] L2 → Q L → Q L2) → + ∀L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → Q L2. /4 width=8 by lprs_inv_CTC, lprs_CTC, lpr_cprs_trans, cpr_refl, lex_CTC_ind_dx/ qed-. (* Properties with unbound rt-transition for full local environments ********) -lemma lpr_lprs (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L1⦄ ⊢ ➡*[h] L2. +lemma lpr_lprs (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L1⦄ ⊢ ➡*[h] L2. /4 width=3 by lprs_CTC, lpr_cprs_trans, lex_CTC_inj/ qed. (* Basic_2A1: was: lprs_strap2 *) -lemma lprs_step_sn (h) (G): ∀L1,L. ⦃G, L1⦄ ⊢ ➡[h] L → - ∀L2.⦃G, L⦄ ⊢ ➡*[h] L2 → ⦃G, L1⦄ ⊢ ➡*[h] L2. +lemma lprs_step_sn (h) (G): ∀L1,L. ⦃G,L1⦄ ⊢ ➡[h] L → + ∀L2.⦃G,L⦄ ⊢ ➡*[h] L2 → ⦃G,L1⦄ ⊢ ➡*[h] L2. /4 width=3 by lprs_inv_CTC, lprs_CTC, lpr_cprs_trans, lex_CTC_step_sn/ qed-. (* Basic_2A1: was: lpxs_strap1 *) -lemma lprs_step_dx (h) (G): ∀L1,L. ⦃G, L1⦄ ⊢ ➡*[h] L → - ∀L2. ⦃G, L⦄ ⊢ ➡[h] L2 → ⦃G, L1⦄ ⊢ ➡*[h] L2. +lemma lprs_step_dx (h) (G): ∀L1,L. ⦃G,L1⦄ ⊢ ➡*[h] L → + ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 → ⦃G,L1⦄ ⊢ ➡*[h] L2. /4 width=3 by lprs_inv_CTC, lprs_CTC, lpr_cprs_trans, lex_CTC_step_dx/ qed-. lemma lprs_strip (h) (G): confluent2 … (lprs h G) (lpr h G). diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpxs.ma index fe2d59ee7..5709df1f3 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_lpxs.ma @@ -22,5 +22,5 @@ include "basic_2/rt_computation/lprs.ma". (* Basic_2A1: was: lprs_lpxs *) (* Note: original proof uses lpr_fwd_lpx and monotonic_TC *) -lemma lprs_fwd_lpxs (h) (G) : ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → ⦃G, L1⦄ ⊢ ⬈*[h] L2. +lemma lprs_fwd_lpxs (h) (G) : ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → ⦃G,L1⦄ ⊢ ⬈*[h] L2. /3 width=3 by cpms_fwd_cpxs, lex_co/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_tc.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_tc.ma index 122051b4d..3b031c6d5 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_tc.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_tc.ma @@ -21,11 +21,11 @@ include "basic_2/rt_computation/cprs_lpr.ma". (* Properties with transitive closure ***************************************) lemma lprs_TC (h) (G): - ∀L1,L2. TC … (lex (λL.cpm h G L 0)) L1 L2 → ⦃G, L1⦄⊢ ➡*[h] L2. + ∀L1,L2. TC … (lex (λL.cpm h G L 0)) L1 L2 → ⦃G,L1⦄⊢ ➡*[h] L2. /4 width=3 by lprs_CTC, lex_CTC, lpr_cprs_trans/ qed. (* Inversion lemmas with transitive closure *********************************) lemma lprs_inv_TC (h) (G): - ∀L1,L2. ⦃G, L1⦄⊢ ➡*[h] L2 → TC … (lex (λL.cpm h G L 0)) L1 L2. + ∀L1,L2. ⦃G,L1⦄⊢ ➡*[h] L2 → TC … (lex (λL.cpm h G L 0)) L1 L2. /3 width=3 by lprs_inv_CTC, lex_inv_CTC/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs.ma index 322f43712..d532c62bf 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs.ma @@ -28,13 +28,13 @@ interpretation (* Basic properties *********************************************************) (* Basic_2A1: uses: lpxs_pair_refl *) -lemma lpxs_bind_refl_dx (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - ∀I. ⦃G, L1.ⓘ{I}⦄ ⊢ ⬈*[h] L2.ⓘ{I}. +lemma lpxs_bind_refl_dx (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + ∀I. ⦃G,L1.ⓘ{I}⦄ ⊢ ⬈*[h] L2.ⓘ{I}. /2 width=1 by lex_bind_refl_dx/ qed. -lemma lpxs_pair (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - ∀V1,V2. ⦃G, L1⦄ ⊢ V1 ⬈*[h] V2 → - ∀I. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ⬈*[h] L2.ⓑ{I}V2. +lemma lpxs_pair (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + ∀V1,V2. ⦃G,L1⦄ ⊢ V1 ⬈*[h] V2 → + ∀I. ⦃G,L1.ⓑ{I}V1⦄ ⊢ ⬈*[h] L2.ⓑ{I}V2. /2 width=1 by lex_pair/ qed. lemma lpxs_refl (h) (G): reflexive … (lpxs h G). @@ -43,25 +43,25 @@ lemma lpxs_refl (h) (G): reflexive … (lpxs h G). (* Basic inversion lemmas ***************************************************) (* Basic_2A1: was: lpxs_inv_atom1 *) -lemma lpxs_inv_atom_sn (h) (G): ∀L2. ⦃G, ⋆⦄ ⊢ ⬈*[h] L2 → L2 = ⋆. +lemma lpxs_inv_atom_sn (h) (G): ∀L2. ⦃G,⋆⦄ ⊢ ⬈*[h] L2 → L2 = ⋆. /2 width=2 by lex_inv_atom_sn/ qed-. -lemma lpxs_inv_bind_sn (h) (G): ∀I1,L2,K1. ⦃G, K1.ⓘ{I1}⦄ ⊢ ⬈*[h] L2 → - ∃∃I2,K2. ⦃G, K1⦄ ⊢ ⬈*[h] K2 & ⦃G, K1⦄ ⊢ I1 ⬈*[h] I2 & L2 = K2.ⓘ{I2}. +lemma lpxs_inv_bind_sn (h) (G): ∀I1,L2,K1. ⦃G,K1.ⓘ{I1}⦄ ⊢ ⬈*[h] L2 → + ∃∃I2,K2. ⦃G,K1⦄ ⊢ ⬈*[h] K2 & ⦃G,K1⦄ ⊢ I1 ⬈*[h] I2 & L2 = K2.ⓘ{I2}. /2 width=1 by lex_inv_bind_sn/ qed-. (* Basic_2A1: was: lpxs_inv_pair1 *) -lemma lpxs_inv_pair_sn (h) (G): ∀I,L2,K1,V1. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ⬈*[h] L2 → - ∃∃K2,V2. ⦃G, K1⦄ ⊢ ⬈*[h] K2 & ⦃G, K1⦄ ⊢ V1 ⬈*[h] V2 & L2 = K2.ⓑ{I}V2. +lemma lpxs_inv_pair_sn (h) (G): ∀I,L2,K1,V1. ⦃G,K1.ⓑ{I}V1⦄ ⊢ ⬈*[h] L2 → + ∃∃K2,V2. ⦃G,K1⦄ ⊢ ⬈*[h] K2 & ⦃G,K1⦄ ⊢ V1 ⬈*[h] V2 & L2 = K2.ⓑ{I}V2. /2 width=1 by lex_inv_pair_sn/ qed-. (* Basic_2A1: was: lpxs_inv_atom2 *) -lemma lpxs_inv_atom_dx (h) (G): ∀L1. ⦃G, L1⦄ ⊢ ⬈*[h] ⋆ → L1 = ⋆. +lemma lpxs_inv_atom_dx (h) (G): ∀L1. ⦃G,L1⦄ ⊢ ⬈*[h] ⋆ → L1 = ⋆. /2 width=2 by lex_inv_atom_dx/ qed-. (* Basic_2A1: was: lpxs_inv_pair2 *) -lemma lpxs_inv_pair_dx (h) (G): ∀I,L1,K2,V2. ⦃G, L1⦄ ⊢ ⬈*[h] K2.ⓑ{I}V2 → - ∃∃K1,V1. ⦃G, K1⦄ ⊢ ⬈*[h] K2 & ⦃G, K1⦄ ⊢ V1 ⬈*[h] V2 & L1 = K1.ⓑ{I}V1. +lemma lpxs_inv_pair_dx (h) (G): ∀I,L1,K2,V2. ⦃G,L1⦄ ⊢ ⬈*[h] K2.ⓑ{I}V2 → + ∃∃K1,V1. ⦃G,K1⦄ ⊢ ⬈*[h] K2 & ⦃G,K1⦄ ⊢ V1 ⬈*[h] V2 & L1 = K1.ⓑ{I}V1. /2 width=1 by lex_inv_pair_dx/ qed-. (* Basic eliminators ********************************************************) @@ -70,12 +70,12 @@ lemma lpxs_inv_pair_dx (h) (G): ∀I,L1,K2,V2. ⦃G, L1⦄ ⊢ ⬈*[h] K2.ⓑ{I} lemma lpxs_ind (h) (G): ∀Q:relation lenv. Q (⋆) (⋆) → ( ∀I,K1,K2. - ⦃G, K1⦄ ⊢ ⬈*[h] K2 → + ⦃G,K1⦄ ⊢ ⬈*[h] K2 → Q K1 K2 → Q (K1.ⓘ{I}) (K2.ⓘ{I}) ) → ( ∀I,K1,K2,V1,V2. - ⦃G, K1⦄ ⊢ ⬈*[h] K2 → ⦃G, K1⦄ ⊢ V1 ⬈*[h] V2 → + ⦃G,K1⦄ ⊢ ⬈*[h] K2 → ⦃G,K1⦄ ⊢ V1 ⬈*[h] V2 → Q K1 K2 → Q (K1.ⓑ{I}V1) (K2.ⓑ{I}V2) ) → - ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → Q L1 L2. + ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → Q L1 L2. /3 width=4 by lex_ind/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_cpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_cpxs.ma index 71742516c..611aab47b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_cpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_cpxs.ma @@ -19,15 +19,15 @@ include "basic_2/rt_computation/lpxs_lpx.ma". (* Properties with context-sensitive extended rt-computation for terms ******) (* Basic_2A1: was: cpxs_bind2 *) -lemma cpxs_bind_dx (h) (G): ∀L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ⬈*[h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. +lemma cpxs_bind_dx (h) (G): ∀L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V2⦄ ⊢ T1 ⬈*[h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2. /4 width=5 by lpxs_cpxs_trans, lpxs_pair, cpxs_bind/ qed. (* Inversion lemmas with context-sensitive ext rt-computation for terms *****) -lemma cpxs_inv_abst1 (h) (G): ∀p,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{p}V1.T1 ⬈*[h] U2 → - ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ⬈*[h] T2 & +lemma cpxs_inv_abst1 (h) (G): ∀p,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓛ{p}V1.T1 ⬈*[h] U2 → + ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 & ⦃G,L.ⓛV1⦄ ⊢ T1 ⬈*[h] T2 & U2 = ⓛ{p}V2.T2. #h #G #p #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /2 width=5 by ex3_2_intro/ #U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct @@ -38,10 +38,10 @@ qed-. (* Basic_2A1: was: cpxs_inv_abbr1 *) lemma cpxs_inv_abbr1_dx (h) (p) (G) (L): - ∀V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{p}V1.T1 ⬈*[h] U2 → - ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ⬈*[h] T2 & + ∀V1,T1,U2. ⦃G,L⦄ ⊢ ⓓ{p}V1.T1 ⬈*[h] U2 → + ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈*[h] V2 & ⦃G,L.ⓓV1⦄ ⊢ T1 ⬈*[h] T2 & U2 = ⓓ{p}V2.T2 - | ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ⬈*[h] T2 & ⬆*[1] U2 ≘ T2 & p = Ⓣ. + | ∃∃T2. ⦃G,L.ⓓV1⦄ ⊢ T1 ⬈*[h] T2 & ⬆*[1] U2 ≘ T2 & p = Ⓣ. #h #p #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5 by ex3_2_intro, or_introl/ #U0 #U2 #_ #HU02 * * diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_fdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_fdeq.ma index 8a5676cc0..e21438d63 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_fdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_fdeq.ma @@ -17,12 +17,12 @@ include "basic_2/rt_computation/lpxs_rdeq.ma". (* UNBOUND PARALLEL RT-COMPUTATION FOR FULL LOCAL ENVIRONMENTS **************) -(* Properties with degree-based equivalence on closures *********************) +(* Properties with sort-irrelevant equivalence on closures ******************) -lemma fdeq_lpxs_trans (h) (o): ∀G1,G2,L1,L0,T1,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L0, T2⦄ → - ∀L2. ⦃G2, L0⦄ ⊢⬈*[h] L2 → - ∃∃L. ⦃G1, L1⦄ ⊢⬈*[h] L & ⦃G1, L, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄. -#h #o #G1 #G2 #L1 #L0 #T1 #T2 #H1 #L2 #HL02 +lemma fdeq_lpxs_trans (h): ∀G1,G2,L1,L0,T1,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L0,T2⦄ → + ∀L2. ⦃G2,L0⦄ ⊢⬈*[h] L2 → + ∃∃L. ⦃G1,L1⦄ ⊢⬈*[h] L & ⦃G1,L,T1⦄ ≛ ⦃G2,L2,T2⦄. +#h #G1 #G2 #L1 #L0 #T1 #T2 #H1 #L2 #HL02 elim (fdeq_inv_gen_dx … H1) -H1 #HG #HL10 #HT12 destruct elim (rdeq_lpxs_trans … HL02 … HL10) -L0 #L0 #HL10 #HL02 /3 width=3 by fdeq_intro_dx, ex2_intro/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_length.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_length.ma index fd664b95c..8ab26578e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_length.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_length.ma @@ -19,5 +19,5 @@ include "basic_2/rt_computation/lpxs.ma". (* Forward lemmas with length for local environments ************************) -lemma lpxs_fwd_length (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → |L1| = |L2|. +lemma lpxs_fwd_length (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → |L1| = |L2|. /2 width=2 by lex_fwd_length/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_lpx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_lpx.ma index 52a418617..c27507776 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_lpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_lpx.ma @@ -20,31 +20,31 @@ include "basic_2/rt_computation/lpxs.ma". (* Properties with unbound rt-transition for full local environments ********) -lemma lpx_lpxs (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → ⦃G, L1⦄ ⊢ ⬈*[h] L2. +lemma lpx_lpxs (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈[h] L2 → ⦃G,L1⦄ ⊢ ⬈*[h] L2. /3 width=3 by lpx_cpxs_trans, lex_CTC_inj/ qed. (* Basic_2A1: was: lpxs_strap2 *) -lemma lpxs_step_sn (h) (G): ∀L1,L. ⦃G, L1⦄ ⊢ ⬈[h] L → - ∀L2. ⦃G, L⦄ ⊢ ⬈*[h] L2 → ⦃G, L1⦄ ⊢ ⬈*[h] L2. +lemma lpxs_step_sn (h) (G): ∀L1,L. ⦃G,L1⦄ ⊢ ⬈[h] L → + ∀L2. ⦃G,L⦄ ⊢ ⬈*[h] L2 → ⦃G,L1⦄ ⊢ ⬈*[h] L2. /3 width=3 by lpx_cpxs_trans, lex_CTC_step_sn/ qed-. (* Basic_2A1: was: lpxs_strap1 *) -lemma lpxs_step_dx (h) (G): ∀L1,L. ⦃G, L1⦄ ⊢ ⬈*[h] L → - ∀L2. ⦃G, L⦄ ⊢ ⬈[h] L2 → ⦃G, L1⦄ ⊢ ⬈*[h] L2. +lemma lpxs_step_dx (h) (G): ∀L1,L. ⦃G,L1⦄ ⊢ ⬈*[h] L → + ∀L2. ⦃G,L⦄ ⊢ ⬈[h] L2 → ⦃G,L1⦄ ⊢ ⬈*[h] L2. /3 width=3 by lpx_cpxs_trans, lex_CTC_step_dx/ qed-. (* Eliminators with unbound rt-transition for full local environments *******) (* Basic_2A1: was: lpxs_ind_dx *) lemma lpxs_ind_sn (h) (G) (L2): ∀Q:predicate lenv. Q L2 → - (∀L1,L. ⦃G, L1⦄ ⊢ ⬈[h] L → ⦃G, L⦄ ⊢ ⬈*[h] L2 → Q L → Q L1) → - ∀L1. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → Q L1. + (∀L1,L. ⦃G,L1⦄ ⊢ ⬈[h] L → ⦃G,L⦄ ⊢ ⬈*[h] L2 → Q L → Q L1) → + ∀L1. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → Q L1. /3 width=7 by lpx_cpxs_trans, cpx_refl, lex_CTC_ind_sn/ qed-. (* Basic_2A1: was: lpxs_ind *) lemma lpxs_ind_dx (h) (G) (L1): ∀Q:predicate lenv. Q L1 → - (∀L,L2. ⦃G, L1⦄ ⊢ ⬈*[h] L → ⦃G, L⦄ ⊢ ⬈[h] L2 → Q L → Q L2) → - ∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → Q L2. + (∀L,L2. ⦃G,L1⦄ ⊢ ⬈*[h] L → ⦃G,L⦄ ⊢ ⬈[h] L2 → Q L → Q L2) → + ∀L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → Q L2. /3 width=7 by lpx_cpxs_trans, cpx_refl, lex_CTC_ind_dx/ qed-. (* Properties with context-sensitive extended rt-transition for terms *******) @@ -65,7 +65,7 @@ qed-. (* Advanced properties ******************************************************) (* Basic_2A1: was: lpxs_pair2 *) -lemma lpxs_pair_dx (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - ∀V1,V2. ⦃G, L2⦄ ⊢ V1 ⬈*[h] V2 → - ∀I. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ⬈*[h] L2.ⓑ{I}V2. +lemma lpxs_pair_dx (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + ∀V1,V2. ⦃G,L2⦄ ⊢ V1 ⬈*[h] V2 → + ∀I. ⦃G,L1.ⓑ{I}V1⦄ ⊢ ⬈*[h] L2.ⓑ{I}V2. /3 width=3 by lpxs_pair, lpxs_cpxs_trans/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_rdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_rdeq.ma index 3526c22c2..dd0a02ce2 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_rdeq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lpxs_rdeq.ma @@ -17,13 +17,14 @@ include "basic_2/rt_computation/lpxs_lpx.ma". (* UNBOUND PARALLEL RT-COMPUTATION FOR FULL LOCAL ENVIRONMENTS **************) -(* Properties with degree-based equivalence on referred entries *************) +(* Properties with sort-irrelevant equivalence on referred entries **********) (* Basic_2A1: uses: lleq_lpxs_trans *) -lemma rdeq_lpxs_trans (h) (o) (G) (T:term): ∀L2,K2. ⦃G, L2⦄ ⊢ ⬈*[h] K2 → - ∀L1. L1 ≛[h, o, T] L2 → - ∃∃K1. ⦃G, L1⦄ ⊢ ⬈*[h] K1 & K1 ≛[h, o, T] K2. -#h #o #G #T #L2 #K2 #H @(lpxs_ind_sn … H) -L2 /2 width=3 by ex2_intro/ +lemma rdeq_lpxs_trans (h) (G) (T:term): + ∀L2,K2. ⦃G,L2⦄ ⊢ ⬈*[h] K2 → + ∀L1. L1 ≛[T] L2 → + ∃∃K1. ⦃G,L1⦄ ⊢ ⬈*[h] K1 & K1 ≛[T] K2. +#h #G #T #L2 #K2 #H @(lpxs_ind_sn … H) -L2 /2 width=3 by ex2_intro/ #L #L2 #HL2 #_ #IH #L1 #HT elim (rdeq_lpx_trans … HL2 … HT) -L #L #HL1 #HT elim (IH … HT) -L2 #K #HLK #HT @@ -31,13 +32,13 @@ elim (IH … HT) -L2 #K #HLK #HT qed-. (* Basic_2A1: uses: lpxs_nlleq_inv_step_sn *) -lemma lpxs_rdneq_inv_step_sn (h) (o) (G) (T:term): - ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → - ∃∃L,L0. ⦃G, L1⦄ ⊢ ⬈[h] L & L1 ≛[h, o, T] L → ⊥ & - ⦃G, L⦄ ⊢ ⬈*[h] L0 & L0 ≛[h, o, T] L2. -#h #o #G #T #L1 #L2 #H @(lpxs_ind_sn … H) -L1 +lemma lpxs_rdneq_inv_step_sn (h) (G) (T:term): + ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[T] L2 → ⊥) → + ∃∃L,L0. ⦃G,L1⦄ ⊢ ⬈[h] L & L1 ≛[T] L → ⊥ & + ⦃G,L⦄ ⊢ ⬈*[h] L0 & L0 ≛[T] L2. +#h #G #T #L1 #L2 #H @(lpxs_ind_sn … H) -L1 [ #H elim H -H // -| #L1 #L #H1 #H2 #IH2 #H12 elim (rdeq_dec h o L1 L T) #H +| #L1 #L #H1 #H2 #IH2 #H12 elim (rdeq_dec L1 L T) #H [ -H1 -H2 elim IH2 -IH2 /3 width=3 by rdeq_trans/ -H12 #L0 #L3 #H1 #H2 #H3 #H4 lapply (rdeq_rdneq_trans … H … H2) -H2 #H2 elim (rdeq_lpx_trans … H1 … H) -L diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx.ma deleted file mode 100644 index 0f4601234..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx.ma +++ /dev/null @@ -1,160 +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 "basic_2/notation/relations/lsubeqx_6.ma". -include "basic_2/rt_computation/rdsx.ma". - -(* CLEAR OF STRONGLY NORMALIZING ENTRIES FOR UNBOUND RT-TRANSITION **********) - -(* Note: this should be an instance of a more general sex *) -(* Basic_2A1: uses: lcosx *) -inductive lsubsx (h) (o) (G): rtmap → relation lenv ≝ -| lsubsx_atom: ∀f. lsubsx h o G f (⋆) (⋆) -| lsubsx_push: ∀f,I,K1,K2. lsubsx h o G f K1 K2 → - lsubsx h o G (⫯f) (K1.ⓘ{I}) (K2.ⓘ{I}) -| lsubsx_unit: ∀f,I,K1,K2. lsubsx h o G f K1 K2 → - lsubsx h o G (↑f) (K1.ⓤ{I}) (K2.ⓧ) -| lsubsx_pair: ∀f,I,K1,K2,V. G ⊢ ⬈*[h, o, V] 𝐒⦃K2⦄ → - lsubsx h o G f K1 K2 → lsubsx h o G (↑f) (K1.ⓑ{I}V) (K2.ⓧ) -. - -interpretation - "local environment refinement (clear)" - 'LSubEqX h o f G L1 L2 = (lsubsx h o G f L1 L2). - -(* Basic inversion lemmas ***************************************************) - -fact lsubsx_inv_atom_sn_aux: ∀h,o,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, o, g] L2 → - L1 = ⋆ → L2 = ⋆. -#h #o #g #G #L1 #L2 * -g -L1 -L2 // -[ #f #I #K1 #K2 #_ #H destruct -| #f #I #K1 #K2 #_ #H destruct -| #f #I #K1 #K2 #V #_ #_ #H destruct -] -qed-. - -lemma lsubsx_inv_atom_sn: ∀h,o,g,G,L2. G ⊢ ⋆ ⊆ⓧ[h, o, g] L2 → L2 = ⋆. -/2 width=7 by lsubsx_inv_atom_sn_aux/ qed-. - -fact lsubsx_inv_push_sn_aux: ∀h,o,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, o, g] L2 → - ∀f,I,K1. g = ⫯f → L1 = K1.ⓘ{I} → - ∃∃K2. G ⊢ K1 ⊆ⓧ[h, o, f] K2 & L2 = K2.ⓘ{I}. -#h #o #g #G #L1 #L2 * -g -L1 -L2 -[ #f #g #J #L1 #_ #H destruct -| #f #I #K1 #K2 #HK12 #g #J #L1 #H1 #H2 destruct - <(injective_push … H1) -g /2 width=3 by ex2_intro/ -| #f #I #K1 #K2 #_ #g #J #L1 #H - elim (discr_next_push … H) -| #f #I #K1 #K2 #V #_ #_ #g #J #L1 #H - elim (discr_next_push … H) -] -qed-. - -lemma lsubsx_inv_push_sn: ∀h,o,f,I,G,K1,L2. G ⊢ K1.ⓘ{I} ⊆ⓧ[h, o, ⫯f] L2 → - ∃∃K2. G ⊢ K1 ⊆ⓧ[h, o, f] K2 & L2 = K2.ⓘ{I}. -/2 width=5 by lsubsx_inv_push_sn_aux/ qed-. - -fact lsubsx_inv_unit_sn_aux: ∀h,o,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, o, g] L2 → - ∀f,I,K1. g = ↑f → L1 = K1.ⓤ{I} → - ∃∃K2. G ⊢ K1 ⊆ⓧ[h, o, f] K2 & L2 = K2.ⓧ. -#h #o #g #G #L1 #L2 * -g -L1 -L2 -[ #f #g #J #L1 #_ #H destruct -| #f #I #K1 #K2 #_ #g #J #L1 #H - elim (discr_push_next … H) -| #f #I #K1 #K2 #HK12 #g #J #L1 #H1 #H2 destruct - <(injective_next … H1) -g /2 width=3 by ex2_intro/ -| #f #I #K1 #K2 #V #_ #_ #g #J #L1 #_ #H destruct -] -qed-. - -lemma lsubsx_inv_unit_sn: ∀h,o,f,I,G,K1,L2. G ⊢ K1.ⓤ{I} ⊆ⓧ[h, o, ↑f] L2 → - ∃∃K2. G ⊢ K1 ⊆ⓧ[h, o, f] K2 & L2 = K2.ⓧ. -/2 width=6 by lsubsx_inv_unit_sn_aux/ qed-. - -fact lsubsx_inv_pair_sn_aux: ∀h,o,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, o, g] L2 → - ∀f,I,K1,V. g = ↑f → L1 = K1.ⓑ{I}V → - ∃∃K2. G ⊢ ⬈*[h, o, V] 𝐒⦃K2⦄ & - G ⊢ K1 ⊆ⓧ[h, o, f] K2 & L2 = K2.ⓧ. -#h #o #g #G #L1 #L2 * -g -L1 -L2 -[ #f #g #J #L1 #W #_ #H destruct -| #f #I #K1 #K2 #_ #g #J #L1 #W #H - elim (discr_push_next … H) -| #f #I #K1 #K2 #_ #g #J #L1 #W #_ #H destruct -| #f #I #K1 #K2 #V #HV #HK12 #g #J #L1 #W #H1 #H2 destruct - <(injective_next … H1) -g /2 width=4 by ex3_intro/ -] -qed-. - -(* Basic_2A1: uses: lcosx_inv_pair *) -lemma lsubsx_inv_pair_sn: ∀h,o,f,I,G,K1,L2,V. G ⊢ K1.ⓑ{I}V ⊆ⓧ[h, o, ↑f] L2 → - ∃∃K2. G ⊢ ⬈*[h, o, V] 𝐒⦃K2⦄ & - G ⊢ K1 ⊆ⓧ[h, o, f] K2 & L2 = K2.ⓧ. -/2 width=6 by lsubsx_inv_pair_sn_aux/ qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma lsubsx_inv_pair_sn_gen: ∀h,o,g,I,G,K1,L2,V. G ⊢ K1.ⓑ{I}V ⊆ⓧ[h, o, g] L2 → - ∨∨ ∃∃f,K2. G ⊢ K1 ⊆ⓧ[h, o, f] K2 & g = ⫯f & L2 = K2.ⓑ{I}V - | ∃∃f,K2. G ⊢ ⬈*[h, o, V] 𝐒⦃K2⦄ & - G ⊢ K1 ⊆ⓧ[h, o, f] K2 & g = ↑f & L2 = K2.ⓧ. -#h #o #g #I #G #K1 #L2 #V #H -elim (pn_split g) * #f #Hf destruct -[ elim (lsubsx_inv_push_sn … H) -H /3 width=5 by ex3_2_intro, or_introl/ -| elim (lsubsx_inv_pair_sn … H) -H /3 width=6 by ex4_2_intro, or_intror/ -] -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma lsubsx_fwd_bind_sn: ∀h,o,g,I1,G,K1,L2. G ⊢ K1.ⓘ{I1} ⊆ⓧ[h, o, g] L2 → - ∃∃I2,K2. G ⊢ K1 ⊆ⓧ[h, o, ⫱g] K2 & L2 = K2.ⓘ{I2}. -#h #o #g #I1 #G #K1 #L2 -elim (pn_split g) * #f #Hf destruct -[ #H elim (lsubsx_inv_push_sn … H) -H -| cases I1 -I1 #I1 - [ #H elim (lsubsx_inv_unit_sn … H) -H - | #V #H elim (lsubsx_inv_pair_sn … H) -H - ] -] -/2 width=4 by ex2_2_intro/ -qed-. - -(* Basic properties *********************************************************) - -lemma lsubsx_eq_repl_back: ∀h,o,G,L1,L2. eq_repl_back … (λf. G ⊢ L1 ⊆ⓧ[h, o, f] L2). -#h #o #G #L1 #L2 #f1 #H elim H -L1 -L2 -f1 // -[ #f #I #L1 #L2 #_ #IH #x #H - elim (eq_inv_px … H) -H /3 width=3 by lsubsx_push/ -| #f #I #L1 #L2 #_ #IH #x #H - elim (eq_inv_nx … H) -H /3 width=3 by lsubsx_unit/ -| #f #I #L1 #L2 #V #HV #_ #IH #x #H - elim (eq_inv_nx … H) -H /3 width=3 by lsubsx_pair/ -] -qed-. - -lemma lsubsx_eq_repl_fwd: ∀h,o,G,L1,L2. eq_repl_fwd … (λf. G ⊢ L1 ⊆ⓧ[h, o, f] L2). -#h #o #G #L1 #L2 @eq_repl_sym /2 width=3 by lsubsx_eq_repl_back/ -qed-. - -(* Advanced properties ******************************************************) - -(* Basic_2A1: uses: lcosx_O *) -lemma lsubsx_refl: ∀h,o,f,G. 𝐈⦃f⦄ → reflexive … (lsubsx h o G f). -#h #o #f #G #Hf #L elim L -L -/3 width=3 by lsubsx_eq_repl_back, lsubsx_push, eq_push_inv_isid/ -qed. - -(* Basic_2A1: removed theorems 2: - lcosx_drop_trans_lt lcosx_inv_succ -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx_lsubsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx_lsubsx.ma deleted file mode 100644 index 018e5c262..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx_lsubsx.ma +++ /dev/null @@ -1,38 +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 "basic_2/rt_computation/lsubsx.ma". - -(* CLEAR OF STRONGLY NORMALIZING ENTRIES FOR UNBOUND RT-TRANSITION **********) - -(* Main properties **********************************************************) - -theorem lsubsx_fix: ∀h,o,f,G,L1,L. G ⊢ L1 ⊆ⓧ[h, o, f] L → - ∀L2. G ⊢ L ⊆ⓧ[h, o, f] L2 → L = L2. -#h #o #f #G #L1 #L #H elim H -f -L1 -L -[ #f #L2 #H - >(lsubsx_inv_atom_sn … H) -L2 // -| #f #I #K1 #K2 #_ #IH #L2 #H - elim (lsubsx_inv_push_sn … H) -H /3 width=1 by eq_f2/ -| #f #I #K1 #K2 #_ #IH #L2 #H - elim (lsubsx_inv_unit_sn … H) -H /3 width=1 by eq_f2/ -| #f #I #K1 #K2 #V #_ #_ #IH #L2 #H - elim (lsubsx_inv_unit_sn … H) -H /3 width=1 by eq_f2/ -] -qed-. - -theorem lsubsx_trans: ∀h,o,f,G. Transitive … (lsubsx h o G f). -#h #o #f #G #L1 #L #H1 #L2 #H2 -<(lsubsx_fix … H1 … H2) -L2 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx_rdsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx_rdsx.ma deleted file mode 100644 index 52454a2ac..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx_rdsx.ma +++ /dev/null @@ -1,73 +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 "basic_2/rt_computation/rdsx_drops.ma". -include "basic_2/rt_computation/rdsx_lpxs.ma". -include "basic_2/rt_computation/lsubsx.ma". - -(* CLEAR OF STRONGLY NORMALIZING ENTRIES FOR UNBOUND RT-TRANSITION **********) - -(* Properties with strongly normalizing referred local environments *********) - -(* Basic_2A1: uses: lsx_cpx_trans_lcosx *) -lemma rdsx_cpx_trans_lsubsx (h) (o): ∀G,L0,T1,T2. ⦃G, L0⦄ ⊢ T1 ⬈[h] T2 → - ∀f,L. G ⊢ L0 ⊆ⓧ[h, o, f] L → - G ⊢ ⬈*[h, o, T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h, o, T2] 𝐒⦃L⦄. -#h #o #G #L0 #T1 #T2 #H @(cpx_ind … H) -G -L0 -T1 -T2 // -[ #I0 #G #K0 #V1 #V2 #W2 #_ #IH #HVW2 #g #L #HK0 #HL - elim (lsubsx_inv_pair_sn_gen … HK0) -HK0 * - [ #f #K #HK0 #H1 #H2 destruct - /4 width=8 by rdsx_lifts, rdsx_fwd_pair, drops_refl, drops_drop/ - | #f #K #HV1 #HK0 #H1 #H2 destruct - /4 width=8 by rdsx_lifts, drops_refl, drops_drop/ - ] -| #I0 #G #K0 #T #U #i #_ #IH #HTU #g #L #HK0 #HL - elim (lsubsx_fwd_bind_sn … HK0) -HK0 #I #K #HK0 #H destruct - /6 width=8 by rdsx_inv_lifts, rdsx_lifts, drops_refl, drops_drop/ -| #p #I0 #G #L0 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #f #L #HL0 #HL - elim (rdsx_inv_bind … HL) -HL - /4 width=2 by lsubsx_pair, rdsx_bind_void/ -| #I0 #G #L0 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #f #L #HL0 #HL - elim (rdsx_inv_flat … HL) -HL /3 width=2 by rdsx_flat/ -| #G #L0 #V #U1 #T1 #T2 #HTU1 #_ #IHT12 #f #L #HL0 #HL - elim (rdsx_inv_bind … HL) -HL #HV #HU1 - /5 width=8 by rdsx_inv_lifts, drops_refl, drops_drop/ -| #G #L0 #V #T1 #T2 #_ #IHT12 #f #L #HL0 #HL - elim (rdsx_inv_flat … HL) -HL /2 width=2 by/ -| #G #L0 #V1 #V2 #T #_ #IHV12 #f #L #HL0 #HL - elim (rdsx_inv_flat … HL) -HL /2 width=2 by/ -| #p #G #L0 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #f #L #HL0 #HL - elim (rdsx_inv_flat … HL) -HL #HV1 #HL - elim (rdsx_inv_bind … HL) -HL #HW1 #HT1 - /4 width=2 by lsubsx_pair, rdsx_bind_void, rdsx_flat/ -| #p #G #L0 #V1 #V2 #U2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #HVU2 #f #L #HL0 #HL - elim (rdsx_inv_flat … HL) -HL #HV1 #HL - elim (rdsx_inv_bind … HL) -HL #HW1 #HT1 - /6 width=8 by lsubsx_pair, rdsx_lifts, rdsx_bind_void, rdsx_flat, drops_refl, drops_drop/ -] -qed-. - -(* Advanced properties of strongly normalizing referred local environments **) - -(* Basic_2A1: uses: lsx_cpx_trans_O *) -lemma rdsx_cpx_trans (h) (o): ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → - G ⊢ ⬈*[h, o, T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h, o, T2] 𝐒⦃L⦄. -/3 width=6 by rdsx_cpx_trans_lsubsx, lsubsx_refl/ qed-. - -lemma rdsx_cpxs_trans (h) (o): ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → - G ⊢ ⬈*[h, o, T1] 𝐒⦃L⦄ → G ⊢ ⬈*[h, o, T2] 𝐒⦃L⦄. -#h #o #G #L #T1 #T2 #H -@(cpxs_ind_dx ???????? H) -T1 // -/3 width=3 by rdsx_cpx_trans/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx.ma deleted file mode 100644 index 5b62dbae1..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx.ma +++ /dev/null @@ -1,94 +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 "basic_2/notation/relations/predtysnstrong_5.ma". -include "static_2/static/rdeq.ma". -include "basic_2/rt_transition/lpx.ma". - -(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) - -definition rdsx (h) (o) (G) (T): predicate lenv ≝ - SN … (lpx h G) (rdeq h o T). - -interpretation - "strong normalization for unbound context-sensitive parallel rt-transition on referred entries (local environment)" - 'PRedTySNStrong h o T G L = (rdsx h o G T L). - -(* Basic eliminators ********************************************************) - -(* Basic_2A1: uses: lsx_ind *) -lemma rdsx_ind (h) (o) (G) (T): - ∀Q:predicate lenv. - (∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ → - (∀L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → Q L2) → - Q L1 - ) → - ∀L. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄ → Q L. -#h #o #G #T #Q #H0 #L1 #H elim H -L1 -/5 width=1 by SN_intro/ -qed-. - -(* Basic properties *********************************************************) - -(* Basic_2A1: uses: lsx_intro *) -lemma rdsx_intro (h) (o) (G) (T): - ∀L1. - (∀L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄) → - G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄. -/5 width=1 by SN_intro/ qed. - -(* Basic forward lemmas *****************************************************) - -(* Basic_2A1: uses: lsx_fwd_pair_sn lsx_fwd_bind_sn lsx_fwd_flat_sn *) -lemma rdsx_fwd_pair_sn (h) (o) (G): - ∀I,L,V,T. G ⊢ ⬈*[h, o, ②{I}V.T] 𝐒⦃L⦄ → - G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄. -#h #o #G #I #L #V #T #H -@(rdsx_ind … H) -L #L1 #_ #IHL1 -@rdsx_intro #L2 #HL12 #HnL12 -/4 width=3 by rdeq_fwd_pair_sn/ -qed-. - -(* Basic_2A1: uses: lsx_fwd_flat_dx *) -lemma rdsx_fwd_flat_dx (h) (o) (G): - ∀I,L,V,T. G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L⦄ → - G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄. -#h #o #G #I #L #V #T #H -@(rdsx_ind … H) -L #L1 #_ #IHL1 -@rdsx_intro #L2 #HL12 #HnL12 -/4 width=3 by rdeq_fwd_flat_dx/ -qed-. - -fact rdsx_fwd_pair_aux (h) (o) (G): ∀L. G ⊢ ⬈*[h, o, #0] 𝐒⦃L⦄ → - ∀I,K,V. L = K.ⓑ{I}V → G ⊢ ⬈*[h, o, V] 𝐒⦃K⦄. -#h #o #G #L #H -@(rdsx_ind … H) -L #L1 #_ #IH #I #K1 #V #H destruct -/5 width=5 by lpx_pair, rdsx_intro, rdeq_fwd_zero_pair/ -qed-. - -lemma rdsx_fwd_pair (h) (o) (G): - ∀I,K,V. G ⊢ ⬈*[h, o, #0] 𝐒⦃K.ⓑ{I}V⦄ → G ⊢ ⬈*[h, o, V] 𝐒⦃K⦄. -/2 width=4 by rdsx_fwd_pair_aux/ qed-. - -(* Basic inversion lemmas ***************************************************) - -(* Basic_2A1: uses: lsx_inv_flat *) -lemma rdsx_inv_flat (h) (o) (G): ∀I,L,V,T. G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L⦄ → - ∧∧ G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ & G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄. -/3 width=3 by rdsx_fwd_pair_sn, rdsx_fwd_flat_dx, conj/ qed-. - -(* Basic_2A1: removed theorems 9: - lsx_ge_up lsx_ge - lsxa_ind lsxa_intro lsxa_lleq_trans lsxa_lpxs_trans lsxa_intro_lpx lsx_lsxa lsxa_inv_lsx -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_csx.ma deleted file mode 100644 index 355ecb004..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_csx.ma +++ /dev/null @@ -1,72 +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 "basic_2/rt_computation/csx_lsubr.ma". -include "basic_2/rt_computation/csx_cpxs.ma". -include "basic_2/rt_computation/lsubsx_rdsx.ma". - -(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) - -(* Advanced properties ******************************************************) - -(* Basic_2A1: uses: lsx_lref_be_lpxs *) -lemma rdsx_pair_lpxs (h) (o) (G): - ∀K1,V. ⦃G, K1⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ → - ∀K2. G ⊢ ⬈*[h, o, V] 𝐒⦃K2⦄ → ⦃G, K1⦄ ⊢ ⬈*[h] K2 → - ∀I. G ⊢ ⬈*[h, o, #0] 𝐒⦃K2.ⓑ{I}V⦄. -#h #o #G #K1 #V #H -@(csx_ind_cpxs … H) -V #V0 #_ #IHV0 #K2 #H -@(rdsx_ind … H) -K2 #K0 #HK0 #IHK0 #HK10 #I -@rdsx_intro #Y #HY #HnY -elim (lpx_inv_pair_sn … HY) -HY #K2 #V2 #HK02 #HV02 #H destruct -elim (tdeq_dec h o V0 V2) #HnV02 destruct [ -IHV0 -HV02 -HK0 | -IHK0 -HnY ] -[ /5 width=5 by rdsx_rdeq_trans, lpxs_step_dx, rdeq_pair/ -| @(IHV0 … HnV02) -IHV0 -HnV02 - [ /2 width=3 by lpxs_cpx_trans/ - | /3 width=3 by rdsx_lpx_trans, rdsx_cpx_trans/ - | /2 width=3 by lpxs_step_dx/ - ] -] -qed. - -(* Basic_2A1: uses: lsx_lref_be *) -lemma rdsx_lref_pair_drops (h) (o) (G): - ∀K,V. ⦃G, K⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ → G ⊢ ⬈*[h, o, V] 𝐒⦃K⦄ → - ∀I,i,L. ⬇*[i] L ≘ K.ⓑ{I}V → G ⊢ ⬈*[h, o, #i] 𝐒⦃L⦄. -#h #o #G #K #V #HV #HK #I #i elim i -i -[ #L #H >(drops_fwd_isid … H) -H /2 width=3 by rdsx_pair_lpxs/ -| #i #IH #L #H - elim (drops_inv_bind2_isuni_next … H) -H // #J #Y #HY #H destruct - @(rdsx_lifts … (𝐔❴1❵)) /3 width=6 by drops_refl, drops_drop/ (**) (* full auto fails *) -] -qed. - -(* Main properties **********************************************************) - -(* Basic_2A1: uses: csx_lsx *) -theorem csx_rdsx (h) (o): ∀G,L,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄. -#h #o #G #L #T @(fqup_wf_ind_eq (Ⓕ) … G L T) -G -L -T -#Z #Y #X #IH #G #L * * // -[ #i #HG #HL #HT #H destruct - elim (csx_inv_lref … H) -H [ |*: * ] - [ /2 width=1 by rdsx_lref_atom/ - | /2 width=3 by rdsx_lref_unit/ - | /4 width=6 by rdsx_lref_pair_drops, fqup_lref/ - ] -| #p #I #V #T #HG #HL #HT #H destruct - elim (csx_fwd_bind_unit … H Void) -H /3 width=1 by rdsx_bind_void/ -| #I #V #T #HG #HL #HT #H destruct - elim (csx_fwd_flat … H) -H /3 width=1 by rdsx_flat/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_drops.ma deleted file mode 100644 index ed5e99053..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_drops.ma +++ /dev/null @@ -1,66 +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 "static_2/static/rdeq_drops.ma". -include "basic_2/rt_transition/lpx_drops.ma". -include "basic_2/rt_computation/rdsx_length.ma". -include "basic_2/rt_computation/rdsx_fqup.ma". - -(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) - -(* Properties with generic relocation ***************************************) - -(* Note: this uses length *) -(* Basic_2A1: uses: lsx_lift_le lsx_lift_ge *) -lemma rdsx_lifts (h) (o) (G): d_liftable1_isuni … (λL,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄). -#h #o #G #K #T #H @(rdsx_ind … H) -K -#K1 #_ #IH #b #f #L1 #HLK1 #Hf #U #HTU @rdsx_intro -#L2 #HL12 #HnL12 elim (lpx_drops_conf … HLK1 … HL12) -/5 width=9 by rdeq_lifts_bi, lpx_fwd_length/ -qed-. - -(* Inversion lemmas on relocation *******************************************) - -(* Basic_2A1: uses: lsx_inv_lift_le lsx_inv_lift_be lsx_inv_lift_ge *) -lemma rdsx_inv_lifts (h) (o) (G): d_deliftable1_isuni … (λL,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄). -#h #o #G #L #U #H @(rdsx_ind … H) -L -#L1 #_ #IH #b #f #K1 #HLK1 #Hf #T #HTU @rdsx_intro -#K2 #HK12 #HnK12 elim (drops_lpx_trans … HLK1 … HK12) -HK12 -/4 width=10 by rdeq_inv_lifts_bi/ -qed-. - -(* Advanced properties ******************************************************) - -(* Basic_2A1: uses: lsx_lref_free *) -lemma rdsx_lref_atom (h) (o) (G): ∀L,i. ⬇*[Ⓕ, 𝐔❴i❵] L ≘ ⋆ → G ⊢ ⬈*[h, o, #i] 𝐒⦃L⦄. -#h #o #G #L1 #i #HL1 -@(rdsx_lifts … (#0) … HL1) -HL1 // -qed. - -(* Basic_2A1: uses: lsx_lref_skip *) -lemma rdsx_lref_unit (h) (o) (G): ∀I,L,K,i. ⬇*[i] L ≘ K.ⓤ{I} → G ⊢ ⬈*[h, o, #i] 𝐒⦃L⦄. -#h #o #G #I #L1 #K1 #i #HL1 -@(rdsx_lifts … (#0) … HL1) -HL1 // -qed. - -(* Advanced forward lemmas **************************************************) - -(* Basic_2A1: uses: lsx_fwd_lref_be *) -lemma rdsx_fwd_lref_pair (h) (o) (G): - ∀L,i. G ⊢ ⬈*[h, o, #i] 𝐒⦃L⦄ → - ∀I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V → G ⊢ ⬈*[h, o, V] 𝐒⦃K⦄. -#h #o #G #L #i #HL #I #K #V #HLK -lapply (rdsx_inv_lifts … HL … HLK … (#0) ?) -L -/2 width=2 by rdsx_fwd_pair/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_fqup.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_fqup.ma deleted file mode 100644 index 2913cb998..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_fqup.ma +++ /dev/null @@ -1,50 +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 "static_2/static/rdeq_fqup.ma". -include "basic_2/rt_computation/rdsx.ma". - -(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) - -(* Advanced properties ******************************************************) - -(* Basic_2A1: uses: lsx_atom *) -lemma lfsx_atom (h) (o) (G) (T): G ⊢ ⬈*[h, o, T] 𝐒⦃⋆⦄. -#h #o #G #T -@rdsx_intro #Y #H #HnT -lapply (lpx_inv_atom_sn … H) -H #H destruct -elim HnT -HnT // -qed. - -(* Advanced forward lemmas **************************************************) - -(* Basic_2A1: uses: lsx_fwd_bind_dx *) -(* Note: the exclusion binder (ⓧ) makes this more elegant and much simpler *) -(* Note: the old proof without the exclusion binder requires lreq *) -lemma rdsx_fwd_bind_dx (h) (o) (G): - ∀p,I,L,V,T. G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄ → - G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓧ⦄. -#h #o #G #p #I #L #V #T #H -@(rdsx_ind … H) -L #L1 #_ #IH -@rdsx_intro #Y #H #HT -elim (lpx_inv_unit_sn … H) -H #L2 #HL12 #H destruct -/4 width=4 by rdeq_fwd_bind_dx_void/ -qed-. - -(* Advanced inversion lemmas ************************************************) - -(* Basic_2A1: uses: lsx_inv_bind *) -lemma rdsx_inv_bind (h) (o) (G): ∀p,I,L,V,T. G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄ → - ∧∧ G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ & G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓧ⦄. -/3 width=4 by rdsx_fwd_pair_sn, rdsx_fwd_bind_dx, conj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_length.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_length.ma deleted file mode 100644 index 22451994b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_length.ma +++ /dev/null @@ -1,40 +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 "static_2/static/rdeq_length.ma". -include "basic_2/rt_transition/lpx_length.ma". -include "basic_2/rt_computation/rdsx.ma". - -(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) - -(* Advanced properties ******************************************************) - -(* Basic_2A1: uses: lsx_sort *) -lemma rdsx_sort (h) (o) (G): ∀L,s. G ⊢ ⬈*[h, o, ⋆s] 𝐒⦃L⦄. -#h #o #G #L1 #s @rdsx_intro #L2 #H #Hs -elim Hs -Hs /3 width=3 by lpx_fwd_length, rdeq_sort_length/ -qed. - -(* Basic_2A1: uses: lsx_gref *) -lemma rdsx_gref (h) (o) (G): ∀L,l. G ⊢ ⬈*[h, o, §l] 𝐒⦃L⦄. -#h #o #G #L1 #s @rdsx_intro #L2 #H #Hs -elim Hs -Hs /3 width=3 by lpx_fwd_length, rdeq_gref_length/ -qed. - -lemma rdsx_unit (h) (o) (G): ∀I,L. G ⊢ ⬈*[h, o, #0] 𝐒⦃L.ⓤ{I}⦄. -#h #o #G #I #L1 @rdsx_intro -#Y #HY #HnY elim HnY -HnY -elim (lpx_inv_unit_sn … HY) -HY #L2 #HL12 #H destruct -/3 width=3 by lpx_fwd_length, rdeq_unit_length/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_lpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_lpxs.ma deleted file mode 100644 index 06649215c..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_lpxs.ma +++ /dev/null @@ -1,153 +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 "basic_2/rt_computation/lpxs_rdeq.ma". -include "basic_2/rt_computation/lpxs_lpxs.ma". -include "basic_2/rt_computation/rdsx_rdsx.ma". - -(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) - -(* Properties with unbound rt-computation for full local environments *******) - -(* Basic_2A1: uses: lsx_intro_alt *) -lemma rdsx_intro_lpxs (h) (o) (G): - ∀L1,T. (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄) → - G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄. -/4 width=1 by lpx_lpxs, rdsx_intro/ qed-. - -(* Basic_2A1: uses: lsx_lpxs_trans *) -lemma rdsx_lpxs_trans (h) (o) (G): ∀L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ → - ∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄. -#h #o #G #L1 #T #HL1 #L2 #H @(lpxs_ind_dx … H) -L2 -/2 width=3 by rdsx_lpx_trans/ -qed-. - -(* Eliminators with unbound rt-computation for full local environments ******) - -lemma rdsx_ind_lpxs_rdeq (h) (o) (G): - ∀T. ∀Q:predicate lenv. - (∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ → - (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → Q L2) → - Q L1 - ) → - ∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ → - ∀L0. ⦃G, L1⦄ ⊢ ⬈*[h] L0 → ∀L2. L0 ≛[h, o, T] L2 → Q L2. -#h #o #G #T #Q #IH #L1 #H @(rdsx_ind … H) -L1 -#L1 #HL1 #IH1 #L0 #HL10 #L2 #HL02 -@IH -IH /3 width=3 by rdsx_lpxs_trans, rdsx_rdeq_trans/ -HL1 #K2 #HLK2 #HnLK2 -lapply (rdeq_rdneq_trans … HL02 … HnLK2) -HnLK2 #H -elim (rdeq_lpxs_trans … HLK2 … HL02) -L2 #K0 #HLK0 #HK02 -lapply (rdneq_rdeq_canc_dx … H … HK02) -H #HnLK0 -elim (rdeq_dec h o L1 L0 T) #H -[ lapply (rdeq_rdneq_trans … H … HnLK0) -H -HnLK0 #Hn10 - lapply (lpxs_trans … HL10 … HLK0) -L0 #H10 - elim (lpxs_rdneq_inv_step_sn … H10 … Hn10) -H10 -Hn10 - /3 width=8 by rdeq_trans/ -| elim (lpxs_rdneq_inv_step_sn … HL10 … H) -HL10 -H #L #K #HL1 #HnL1 #HLK #HKL0 - elim (rdeq_lpxs_trans … HLK0 … HKL0) -L0 - /3 width=8 by lpxs_trans, rdeq_trans/ -] -qed-. - -(* Basic_2A1: uses: lsx_ind_alt *) -lemma rdsx_ind_lpxs (h) (o) (G): - ∀T. ∀Q:predicate lenv. - (∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ → - (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → Q L2) → - Q L1 - ) → - ∀L. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄ → Q L. -#h #o #G #T #Q #IH #L #HL -@(rdsx_ind_lpxs_rdeq … IH … HL) -IH -HL // (**) (* full auto fails *) -qed-. - -(* Advanced properties ******************************************************) - -fact rdsx_bind_lpxs_aux (h) (o) (G): - ∀p,I,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ → - ∀Y,T. G ⊢ ⬈*[h, o, T] 𝐒⦃Y⦄ → - ∀L2. Y = L2.ⓑ{I}V → ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L2⦄. -#h #o #G #p #I #L1 #V #H @(rdsx_ind_lpxs … H) -L1 -#L1 #_ #IHL1 #Y #T #H @(rdsx_ind_lpxs … H) -Y -#Y #HY #IHY #L2 #H #HL12 destruct -@rdsx_intro_lpxs #L0 #HL20 -lapply (lpxs_trans … HL12 … HL20) #HL10 #H -elim (rdneq_inv_bind … H) -H [ -IHY | -HY -IHL1 -HL12 ] -[ #HnV elim (rdeq_dec h o L1 L2 V) - [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10 - /3 width=4 by rdsx_lpxs_trans, lpxs_bind_refl_dx, rdeq_canc_sn/ (**) (* full auto too slow *) - | -HnV -HL10 /4 width=4 by rdsx_lpxs_trans, lpxs_bind_refl_dx/ - ] -| /3 width=4 by lpxs_bind_refl_dx/ -] -qed-. - -(* Basic_2A1: uses: lsx_bind *) -lemma rdsx_bind (h) (o) (G): - ∀p,I,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ → - ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓑ{I}V⦄ → - G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄. -/2 width=3 by rdsx_bind_lpxs_aux/ qed. - -(* Basic_2A1: uses: lsx_flat_lpxs *) -lemma rdsx_flat_lpxs (h) (o) (G): - ∀I,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ → - ∀L2,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄ → ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L2⦄. -#h #o #G #I #L1 #V #H @(rdsx_ind_lpxs … H) -L1 -#L1 #HL1 #IHL1 #L2 #T #H @(rdsx_ind_lpxs … H) -L2 -#L2 #HL2 #IHL2 #HL12 @rdsx_intro_lpxs -#L0 #HL20 lapply (lpxs_trans … HL12 … HL20) -#HL10 #H elim (rdneq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ] -[ #HnV elim (rdeq_dec h o L1 L2 V) - [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10 - /3 width=5 by rdsx_lpxs_trans, rdeq_canc_sn/ (**) (* full auto too slow: 47s *) - | -HnV -HL10 /3 width=4 by rdsx_lpxs_trans/ - ] -| /3 width=3 by/ -] -qed-. - -(* Basic_2A1: uses: lsx_flat *) -lemma rdsx_flat (h) (o) (G): - ∀I,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ → - ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄ → G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L⦄. -/2 width=3 by rdsx_flat_lpxs/ qed. - -fact rdsx_bind_lpxs_void_aux (h) (o) (G): - ∀p,I,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ → - ∀Y,T. G ⊢ ⬈*[h, o, T] 𝐒⦃Y⦄ → - ∀L2. Y = L2.ⓧ → ⦃G, L1⦄ ⊢ ⬈*[h] L2 → - G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L2⦄. -#h #o #G #p #I #L1 #V #H @(rdsx_ind_lpxs … H) -L1 -#L1 #_ #IHL1 #Y #T #H @(rdsx_ind_lpxs … H) -Y -#Y #HY #IHY #L2 #H #HL12 destruct -@rdsx_intro_lpxs #L0 #HL20 -lapply (lpxs_trans … HL12 … HL20) #HL10 #H -elim (rdneq_inv_bind_void … H) -H [ -IHY | -HY -IHL1 -HL12 ] -[ #HnV elim (rdeq_dec h o L1 L2 V) - [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10 - /3 width=6 by rdsx_lpxs_trans, lpxs_bind_refl_dx, rdeq_canc_sn/ (**) (* full auto too slow *) - | -HnV -HL10 /4 width=4 by rdsx_lpxs_trans, lpxs_bind_refl_dx/ - ] -| /3 width=4 by lpxs_bind_refl_dx/ -] -qed-. - -lemma rdsx_bind_void (h) (o) (G): - ∀p,I,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ → - ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓧ⦄ → - G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄. -/2 width=3 by rdsx_bind_lpxs_void_aux/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_rdsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_rdsx.ma deleted file mode 100644 index 2305aac19..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rdsx_rdsx.ma +++ /dev/null @@ -1,38 +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 "basic_2/rt_transition/lpx_rdeq.ma". -include "basic_2/rt_computation/rdsx.ma". - -(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) - -(* Advanced properties ******************************************************) - -(* Basic_2A1: uses: lsx_lleq_trans *) -lemma rdsx_rdeq_trans (h) (o) (G): - ∀L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ → - ∀L2. L1 ≛[h, o, T] L2 → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄. -#h #o #G #L1 #T #H @(rdsx_ind … H) -L1 -#L1 #_ #IHL1 #L2 #HL12 @rdsx_intro -#L #HL2 #HnL2 elim (rdeq_lpx_trans … HL2 … HL12) -HL2 -/4 width=5 by rdeq_repl/ -qed-. - -(* Basic_2A1: uses: lsx_lpx_trans *) -lemma rdsx_lpx_trans (h) (o) (G): - ∀L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ → - ∀L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄. -#h #o #G #L1 #T #H @(rdsx_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12 -elim (rdeq_dec h o L1 L2 T) /3 width=4 by rdsx_rdeq_trans/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx.ma new file mode 100644 index 000000000..43e4b0461 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx.ma @@ -0,0 +1,95 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/notation/relations/predtysnstrong_4.ma". +include "static_2/static/rdeq.ma". +include "basic_2/rt_transition/lpx.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +definition rsx (h) (G) (T): predicate lenv ≝ + SN … (lpx h G) (rdeq T). + +interpretation + "strong normalization for unbound context-sensitive parallel rt-transition on referred entries (local environment)" + 'PRedTySNStrong h T G L = (rsx h G T L). + +(* Basic eliminators ********************************************************) + +(* Basic_2A1: uses: lsx_ind *) +lemma rsx_ind (h) (G) (T) (Q:predicate lenv): + (∀L1. G ⊢ ⬈*[h,T] 𝐒⦃L1⦄ → + (∀L2. ⦃G,L1⦄ ⊢ ⬈[h] L2 → (L1 ≛[T] L2 → ⊥) → Q L2) → + Q L1 + ) → + ∀L. G ⊢ ⬈*[h,T] 𝐒⦃L⦄ → Q L. +#h #G #T #Q #H0 #L1 #H elim H -L1 +/5 width=1 by SN_intro/ +qed-. + +(* Basic properties *********************************************************) + +(* Basic_2A1: uses: lsx_intro *) +lemma rsx_intro (h) (G) (T): + ∀L1. + (∀L2. ⦃G,L1⦄ ⊢ ⬈[h] L2 → (L1 ≛[T] L2 → ⊥) → G ⊢ ⬈*[h,T] 𝐒⦃L2⦄) → + G ⊢ ⬈*[h,T] 𝐒⦃L1⦄. +/5 width=1 by SN_intro/ qed. + +(* Basic forward lemmas *****************************************************) + +(* Basic_2A1: uses: lsx_fwd_pair_sn lsx_fwd_bind_sn lsx_fwd_flat_sn *) +lemma rsx_fwd_pair_sn (h) (G): + ∀I,L,V,T. G ⊢ ⬈*[h,②{I}V.T] 𝐒⦃L⦄ → + G ⊢ ⬈*[h,V] 𝐒⦃L⦄. +#h #G #I #L #V #T #H +@(rsx_ind … H) -L #L1 #_ #IHL1 +@rsx_intro #L2 #HL12 #HnL12 +/4 width=3 by rdeq_fwd_pair_sn/ +qed-. + +(* Basic_2A1: uses: lsx_fwd_flat_dx *) +lemma rsx_fwd_flat_dx (h) (G): + ∀I,L,V,T. G ⊢ ⬈*[h,ⓕ{I}V.T] 𝐒⦃L⦄ → + G ⊢ ⬈*[h,T] 𝐒⦃L⦄. +#h #G #I #L #V #T #H +@(rsx_ind … H) -L #L1 #_ #IHL1 +@rsx_intro #L2 #HL12 #HnL12 +/4 width=3 by rdeq_fwd_flat_dx/ +qed-. + +fact rsx_fwd_pair_aux (h) (G): + ∀L. G ⊢ ⬈*[h,#0] 𝐒⦃L⦄ → + ∀I,K,V. L = K.ⓑ{I}V → G ⊢ ⬈*[h,V] 𝐒⦃K⦄. +#h #G #L #H +@(rsx_ind … H) -L #L1 #_ #IH #I #K1 #V #H destruct +/5 width=5 by lpx_pair, rsx_intro, rdeq_fwd_zero_pair/ +qed-. + +lemma rsx_fwd_pair (h) (G): + ∀I,K,V. G ⊢ ⬈*[h,#0] 𝐒⦃K.ⓑ{I}V⦄ → G ⊢ ⬈*[h,V] 𝐒⦃K⦄. +/2 width=4 by rsx_fwd_pair_aux/ qed-. + +(* Basic inversion lemmas ***************************************************) + +(* Basic_2A1: uses: lsx_inv_flat *) +lemma rsx_inv_flat (h) (G): + ∀I,L,V,T. G ⊢ ⬈*[h,ⓕ{I}V.T] 𝐒⦃L⦄ → + ∧∧ G ⊢ ⬈*[h,V] 𝐒⦃L⦄ & G ⊢ ⬈*[h,T] 𝐒⦃L⦄. +/3 width=3 by rsx_fwd_pair_sn, rsx_fwd_flat_dx, conj/ qed-. + +(* Basic_2A1: removed theorems 9: + lsx_ge_up lsx_ge + lsxa_ind lsxa_intro lsxa_lleq_trans lsxa_lpxs_trans lsxa_intro_lpx lsx_lsxa lsxa_inv_lsx +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_csx.ma new file mode 100644 index 000000000..2e129485d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_csx.ma @@ -0,0 +1,133 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/csx_lsubr.ma". +include "basic_2/rt_computation/csx_cpxs.ma". +include "basic_2/rt_computation/jsx_rsx.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Forward lemmas with strongly rt-normalizing terms ************************) + +fact rsx_fwd_lref_pair_csx_aux (h) (G): + ∀L. G ⊢ ⬈*[h,#0] 𝐒⦃L⦄ → + ∀I,K,V. L = K.ⓑ{I}V → ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄. +#h #G #L #H +@(rsx_ind … H) -L #L #_ #IH #I #K #V1 #H destruct +@csx_intro #V2 #HV12 #HnV12 +@(IH … I) -IH [1,4: // | -HnV12 | -G #H ] +[ /2 width=1 by lpx_pair/ +| elim (rdeq_inv_zero_pair_sn … H) -H #Y #X #_ #H1 #H2 destruct -I + /2 width=1 by/ +] +qed-. + +lemma rsx_fwd_lref_pair_csx (h) (G): + ∀I,K,V. G ⊢ ⬈*[h,#0] 𝐒⦃K.ⓑ{I}V⦄ → ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄. +/2 width=4 by rsx_fwd_lref_pair_csx_aux/ qed-. + +lemma rsx_fwd_lref_pair_csx_drops (h) (G): + ∀I,K,V,i,L. ⬇*[i] L ≘ K.ⓑ{I}V → G ⊢ ⬈*[h,#i] 𝐒⦃L⦄ → ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄. +#h #G #I #K #V #i elim i -i +[ #L #H >(drops_fwd_isid … H) -H + /2 width=2 by rsx_fwd_lref_pair_csx/ +| #i #IH #L #H1 #H2 + elim (drops_inv_bind2_isuni_next … H1) -H1 // #J #Y #HY #H destruct + lapply (rsx_inv_lifts … H2 … (𝐔❴1❵) ?????) -H2 + /3 width=6 by drops_refl, drops_drop/ +] +qed-. + +(* Inversion lemmas with strongly rt-normalizing terms **********************) + +lemma rsx_inv_lref_pair (h) (G): + ∀I,K,V. G ⊢ ⬈*[h,#0] 𝐒⦃K.ⓑ{I}V⦄ → + ∧∧ ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ & G ⊢ ⬈*[h,V] 𝐒⦃K⦄. +/3 width=2 by rsx_fwd_lref_pair_csx, rsx_fwd_pair, conj/ qed-. + +lemma rsx_inv_lref_pair_drops (h) (G): + ∀I,K,V,i,L. ⬇*[i] L ≘ K.ⓑ{I}V → G ⊢ ⬈*[h,#i] 𝐒⦃L⦄ → + ∧∧ ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ & G ⊢ ⬈*[h,V] 𝐒⦃K⦄. +/3 width=5 by rsx_fwd_lref_pair_csx_drops, rsx_fwd_lref_pair_drops, conj/ qed-. + +lemma rsx_inv_lref_drops (h) (G): + ∀L,i. G ⊢ ⬈*[h,#i] 𝐒⦃L⦄ → + ∨∨ ⬇*[Ⓕ,𝐔❴i❵] L ≘ ⋆ + | ∃∃I,K. ⬇*[i] L ≘ K.ⓤ{I} + | ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ & G ⊢ ⬈*[h,V] 𝐒⦃K⦄. +#h #G #L #i #H elim (drops_F_uni L i) +[ /2 width=1 by or3_intro0/ +| * * /4 width=10 by rsx_fwd_lref_pair_csx_drops, rsx_fwd_lref_pair_drops, ex3_3_intro, ex1_2_intro, or3_intro2, or3_intro1/ +] +qed-. + +(* Properties with strongly rt-normalizing terms ****************************) + +(* Note: swapping the eliminations to avoid rsx_cpx_trans: no solution found *) +(* Basic_2A1: uses: lsx_lref_be_lpxs *) +lemma rsx_lref_pair_lpxs (h) (G): + ∀K1,V. ⦃G,K1⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → + ∀K2. G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ → ⦃G,K1⦄ ⊢ ⬈*[h] K2 → + ∀I. G ⊢ ⬈*[h,#0] 𝐒⦃K2.ⓑ{I}V⦄. +#h #G #K1 #V #H +@(csx_ind_cpxs … H) -V #V0 #_ #IHV0 #K2 #H +@(rsx_ind … H) -K2 #K0 #HK0 #IHK0 #HK10 #I +@rsx_intro #Y #HY #HnY +elim (lpx_inv_pair_sn … HY) -HY #K2 #V2 #HK02 #HV02 #H destruct +elim (tdeq_dec V0 V2) #HnV02 destruct [ -IHV0 -HV02 -HK0 | -IHK0 -HnY ] +[ /5 width=5 by rsx_rdeq_trans, lpxs_step_dx, rdeq_pair/ +| @(IHV0 … HnV02) -IHV0 -HnV02 + [ /2 width=3 by lpxs_cpx_trans/ + | /3 width=3 by rsx_lpx_trans, rsx_cpx_trans/ + | /2 width=3 by lpxs_step_dx/ + ] +] +qed. + +lemma rsx_lref_pair (h) (G): + ∀K,V. ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → G ⊢ ⬈*[h,V] 𝐒⦃K⦄ → ∀I. G ⊢ ⬈*[h,#0] 𝐒⦃K.ⓑ{I}V⦄. +/2 width=3 by rsx_lref_pair_lpxs/ qed. + +(* Basic_2A1: uses: lsx_lref_be *) +lemma rsx_lref_pair_drops (h) (G): + ∀K,V. ⦃G,K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → G ⊢ ⬈*[h,V] 𝐒⦃K⦄ → + ∀I,i,L. ⬇*[i] L ≘ K.ⓑ{I}V → G ⊢ ⬈*[h,#i] 𝐒⦃L⦄. +#h #G #K #V #HV #HK #I #i elim i -i +[ #L #H >(drops_fwd_isid … H) -H /2 width=1 by rsx_lref_pair/ +| #i #IH #L #H + elim (drops_inv_bind2_isuni_next … H) -H // #J #Y #HY #H destruct + @(rsx_lifts … (𝐔❴1❵)) /3 width=6 by drops_refl, drops_drop/ (**) (* full auto fails *) +] +qed. + +(* Main properties with strongly rt-normalizing terms ***********************) + +(* Basic_2A1: uses: csx_lsx *) +theorem csx_rsx (h) (G): ∀L,T. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → G ⊢ ⬈*[h,T] 𝐒⦃L⦄. +#h #G #L #T @(fqup_wf_ind_eq (Ⓣ) … G L T) -G -L -T +#Z #Y #X #IH #G #L * * +[ // +| #i #HG #HL #HT #H destruct + elim (csx_inv_lref_drops … H) -H [ |*: * ] + [ /2 width=1 by rsx_lref_atom_drops/ + | /2 width=3 by rsx_lref_unit_drops/ + | /4 width=6 by rsx_lref_pair_drops, fqup_lref/ + ] +| // +| #p #I #V #T #HG #HL #HT #H destruct + elim (csx_fwd_bind … H) -H /3 width=1 by rsx_bind/ +| #I #V #T #HG #HL #HT #H destruct + elim (csx_fwd_flat … H) -H /3 width=1 by rsx_flat/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_drops.ma new file mode 100644 index 000000000..64ebcd666 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_drops.ma @@ -0,0 +1,66 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/static/rdeq_drops.ma". +include "basic_2/rt_transition/lpx_drops.ma". +include "basic_2/rt_computation/rsx_length.ma". +include "basic_2/rt_computation/rsx_fqup.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Properties with generic relocation ***************************************) + +(* Note: this uses length *) +(* Basic_2A1: uses: lsx_lift_le lsx_lift_ge *) +lemma rsx_lifts (h) (G): d_liftable1_isuni … (λL,T. G ⊢ ⬈*[h,T] 𝐒⦃L⦄). +#h #G #K #T #H @(rsx_ind … H) -K +#K1 #_ #IH #b #f #L1 #HLK1 #Hf #U #HTU @rsx_intro +#L2 #HL12 #HnL12 elim (lpx_drops_conf … HLK1 … HL12) +/5 width=9 by rdeq_lifts_bi, lpx_fwd_length/ +qed-. + +(* Inversion lemmas on relocation *******************************************) + +(* Basic_2A1: uses: lsx_inv_lift_le lsx_inv_lift_be lsx_inv_lift_ge *) +lemma rsx_inv_lifts (h) (G): d_deliftable1_isuni … (λL,T. G ⊢ ⬈*[h,T] 𝐒⦃L⦄). +#h #G #L #U #H @(rsx_ind … H) -L +#L1 #_ #IH #b #f #K1 #HLK1 #Hf #T #HTU @rsx_intro +#K2 #HK12 #HnK12 elim (drops_lpx_trans … HLK1 … HK12) -HK12 +/4 width=10 by rdeq_inv_lifts_bi/ +qed-. + +(* Advanced properties ******************************************************) + +(* Basic_2A1: uses: lsx_lref_free *) +lemma rsx_lref_atom_drops (h) (G): ∀L,i. ⬇*[Ⓕ,𝐔❴i❵] L ≘ ⋆ → G ⊢ ⬈*[h,#i] 𝐒⦃L⦄. +#h #G #L1 #i #HL1 +@(rsx_lifts … (#0) … HL1) -HL1 // +qed. + +(* Basic_2A1: uses: lsx_lref_skip *) +lemma rsx_lref_unit_drops (h) (G): ∀I,L,K,i. ⬇*[i] L ≘ K.ⓤ{I} → G ⊢ ⬈*[h,#i] 𝐒⦃L⦄. +#h #G #I #L1 #K1 #i #HL1 +@(rsx_lifts … (#0) … HL1) -HL1 // +qed. + +(* Advanced forward lemmas **************************************************) + +(* Basic_2A1: uses: lsx_fwd_lref_be *) +lemma rsx_fwd_lref_pair_drops (h) (G): + ∀L,i. G ⊢ ⬈*[h,#i] 𝐒⦃L⦄ → + ∀I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V → G ⊢ ⬈*[h,V] 𝐒⦃K⦄. +#h #G #L #i #HL #I #K #V #HLK +lapply (rsx_inv_lifts … HL … HLK … (#0) ?) -L +/2 width=2 by rsx_fwd_pair/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_fqup.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_fqup.ma new file mode 100644 index 000000000..b41e150fe --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_fqup.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 "static_2/static/rdeq_fqup.ma". +include "basic_2/rt_computation/rsx.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Advanced properties ******************************************************) + +(* Basic_2A1: uses: lsx_atom *) +lemma lfsx_atom (h) (G) (T): G ⊢ ⬈*[h,T] 𝐒⦃⋆⦄. +#h #G #T +@rsx_intro #Y #H #HnT +lapply (lpx_inv_atom_sn … H) -H #H destruct +elim HnT -HnT // +qed. + +(* Advanced forward lemmas **************************************************) + +(* Basic_2A1: uses: lsx_fwd_bind_dx *) +(* Note: the exclusion binder (ⓧ) makes this more elegant and much simpler *) +(* Note: the old proof without the exclusion binder requires lreq *) +lemma rsx_fwd_bind_dx_void (h) (G): + ∀p,I,L,V,T. G ⊢ ⬈*[h,ⓑ{p,I}V.T] 𝐒⦃L⦄ → G ⊢ ⬈*[h,T] 𝐒⦃L.ⓧ⦄. +#h #G #p #I #L #V #T #H +@(rsx_ind … H) -L #L1 #_ #IH +@rsx_intro #Y #H #HT +elim (lpx_inv_unit_sn … H) -H #L2 #HL12 #H destruct +/4 width=4 by rdeq_fwd_bind_dx_void/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +(* Basic_2A1: uses: lsx_inv_bind *) +lemma rsx_inv_bind_void (h) (G): + ∀p,I,L,V,T. G ⊢ ⬈*[h,ⓑ{p,I}V.T] 𝐒⦃L⦄ → + ∧∧ G ⊢ ⬈*[h,V] 𝐒⦃L⦄ & G ⊢ ⬈*[h,T] 𝐒⦃L.ⓧ⦄. +/3 width=4 by rsx_fwd_pair_sn, rsx_fwd_bind_dx_void, conj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_length.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_length.ma new file mode 100644 index 000000000..ae3d76915 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_length.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 "static_2/static/rdeq_length.ma". +include "basic_2/rt_transition/lpx_length.ma". +include "basic_2/rt_computation/rsx.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Advanced properties ******************************************************) + +(* Basic_2A1: uses: lsx_sort *) +lemma rsx_sort (h) (G): ∀L,s. G ⊢ ⬈*[h,⋆s] 𝐒⦃L⦄. +#h #G #L1 #s @rsx_intro #L2 #H #Hs +elim Hs -Hs /3 width=3 by lpx_fwd_length, rdeq_sort_length/ +qed. + +(* Basic_2A1: uses: lsx_gref *) +lemma rsx_gref (h) (G): ∀L,l. G ⊢ ⬈*[h,§l] 𝐒⦃L⦄. +#h #G #L1 #s @rsx_intro #L2 #H #Hs +elim Hs -Hs /3 width=3 by lpx_fwd_length, rdeq_gref_length/ +qed. + +lemma rsx_unit (h) (G): ∀I,L. G ⊢ ⬈*[h,#0] 𝐒⦃L.ⓤ{I}⦄. +#h #G #I #L1 @rsx_intro +#Y #HY #HnY elim HnY -HnY +elim (lpx_inv_unit_sn … HY) -HY #L2 #HL12 #H destruct +/3 width=3 by lpx_fwd_length, rdeq_unit_length/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_lpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_lpxs.ma new file mode 100644 index 000000000..9598d49d0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_lpxs.ma @@ -0,0 +1,152 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_computation/lpxs_rdeq.ma". +include "basic_2/rt_computation/lpxs_lpxs.ma". +include "basic_2/rt_computation/rsx_rsx.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Properties with unbound rt-computation for full local environments *******) + +(* Basic_2A1: uses: lsx_intro_alt *) +lemma rsx_intro_lpxs (h) (G): + ∀L1,T. (∀L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[T] L2 → ⊥) → G ⊢ ⬈*[h,T] 𝐒⦃L2⦄) → + G ⊢ ⬈*[h,T] 𝐒⦃L1⦄. +/4 width=1 by lpx_lpxs, rsx_intro/ qed-. + +(* Basic_2A1: uses: lsx_lpxs_trans *) +lemma rsx_lpxs_trans (h) (G): + ∀L1,T. G ⊢ ⬈*[h,T] 𝐒⦃L1⦄ → + ∀L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → G ⊢ ⬈*[h,T] 𝐒⦃L2⦄. +#h #G #L1 #T #HL1 #L2 #H @(lpxs_ind_dx … H) -L2 +/2 width=3 by rsx_lpx_trans/ +qed-. + +(* Eliminators with unbound rt-computation for full local environments ******) + +lemma rsx_ind_lpxs_rdeq (h) (G) (T) (Q:predicate lenv): + (∀L1. G ⊢ ⬈*[h,T] 𝐒⦃L1⦄ → + (∀L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[T] L2 → ⊥) → Q L2) → + Q L1 + ) → + ∀L1. G ⊢ ⬈*[h,T] 𝐒⦃L1⦄ → + ∀L0. ⦃G,L1⦄ ⊢ ⬈*[h] L0 → ∀L2. L0 ≛[T] L2 → Q L2. +#h #G #T #Q #IH #L1 #H @(rsx_ind … H) -L1 +#L1 #HL1 #IH1 #L0 #HL10 #L2 #HL02 +@IH -IH /3 width=3 by rsx_lpxs_trans, rsx_rdeq_trans/ -HL1 #K2 #HLK2 #HnLK2 +lapply (rdeq_rdneq_trans … HL02 … HnLK2) -HnLK2 #H +elim (rdeq_lpxs_trans … HLK2 … HL02) -L2 #K0 #HLK0 #HK02 +lapply (rdneq_rdeq_canc_dx … H … HK02) -H #HnLK0 +elim (rdeq_dec L1 L0 T) #H +[ lapply (rdeq_rdneq_trans … H … HnLK0) -H -HnLK0 #Hn10 + lapply (lpxs_trans … HL10 … HLK0) -L0 #H10 + elim (lpxs_rdneq_inv_step_sn … H10 … Hn10) -H10 -Hn10 + /3 width=8 by rdeq_trans/ +| elim (lpxs_rdneq_inv_step_sn … HL10 … H) -HL10 -H #L #K #HL1 #HnL1 #HLK #HKL0 + elim (rdeq_lpxs_trans … HLK0 … HKL0) -L0 + /3 width=8 by lpxs_trans, rdeq_trans/ +] +qed-. + +(* Basic_2A1: uses: lsx_ind_alt *) +lemma rsx_ind_lpxs (h) (G) (T) (Q:predicate lenv): + (∀L1. G ⊢ ⬈*[h,T] 𝐒⦃L1⦄ → + (∀L2. ⦃G,L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[T] L2 → ⊥) → Q L2) → + Q L1 + ) → + ∀L. G ⊢ ⬈*[h,T] 𝐒⦃L⦄ → Q L. +#h #G #T #Q #IH #L #HL +@(rsx_ind_lpxs_rdeq … IH … HL) -IH -HL // (**) (* full auto fails *) +qed-. + +(* Advanced properties ******************************************************) + +fact rsx_bind_lpxs_aux (h) (G): + ∀p,I,L1,V. G ⊢ ⬈*[h,V] 𝐒⦃L1⦄ → + ∀Y,T. G ⊢ ⬈*[h,T] 𝐒⦃Y⦄ → + ∀L2. Y = L2.ⓑ{I}V → ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + G ⊢ ⬈*[h,ⓑ{p,I}V.T] 𝐒⦃L2⦄. +#h #G #p #I #L1 #V #H @(rsx_ind_lpxs … H) -L1 +#L1 #_ #IHL1 #Y #T #H @(rsx_ind_lpxs … H) -Y +#Y #HY #IHY #L2 #H #HL12 destruct +@rsx_intro_lpxs #L0 #HL20 +lapply (lpxs_trans … HL12 … HL20) #HL10 #H +elim (rdneq_inv_bind … H) -H [ -IHY | -HY -IHL1 -HL12 ] +[ #HnV elim (rdeq_dec L1 L2 V) + [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10 + /3 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx, rdeq_canc_sn/ (**) (* full auto too slow *) + | -HnV -HL10 /4 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx/ + ] +| /3 width=4 by lpxs_bind_refl_dx/ +] +qed-. + +(* Basic_2A1: uses: lsx_bind *) +lemma rsx_bind (h) (G): + ∀p,I,L,V. G ⊢ ⬈*[h,V] 𝐒⦃L⦄ → + ∀T. G ⊢ ⬈*[h,T] 𝐒⦃L.ⓑ{I}V⦄ → + G ⊢ ⬈*[h,ⓑ{p,I}V.T] 𝐒⦃L⦄. +/2 width=3 by rsx_bind_lpxs_aux/ qed. + +(* Basic_2A1: uses: lsx_flat_lpxs *) +lemma rsx_flat_lpxs (h) (G): + ∀I,L1,V. G ⊢ ⬈*[h,V] 𝐒⦃L1⦄ → + ∀L2,T. G ⊢ ⬈*[h,T] 𝐒⦃L2⦄ → ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + G ⊢ ⬈*[h,ⓕ{I}V.T] 𝐒⦃L2⦄. +#h #G #I #L1 #V #H @(rsx_ind_lpxs … H) -L1 +#L1 #HL1 #IHL1 #L2 #T #H @(rsx_ind_lpxs … H) -L2 +#L2 #HL2 #IHL2 #HL12 @rsx_intro_lpxs +#L0 #HL20 lapply (lpxs_trans … HL12 … HL20) +#HL10 #H elim (rdneq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ] +[ #HnV elim (rdeq_dec L1 L2 V) + [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10 + /3 width=5 by rsx_lpxs_trans, rdeq_canc_sn/ (**) (* full auto too slow: 47s *) + | -HnV -HL10 /3 width=4 by rsx_lpxs_trans/ + ] +| /3 width=3 by/ +] +qed-. + +(* Basic_2A1: uses: lsx_flat *) +lemma rsx_flat (h) (G): + ∀I,L,V. G ⊢ ⬈*[h,V] 𝐒⦃L⦄ → + ∀T. G ⊢ ⬈*[h,T] 𝐒⦃L⦄ → G ⊢ ⬈*[h,ⓕ{I}V.T] 𝐒⦃L⦄. +/2 width=3 by rsx_flat_lpxs/ qed. + +fact rsx_bind_lpxs_void_aux (h) (G): + ∀p,I,L1,V. G ⊢ ⬈*[h,V] 𝐒⦃L1⦄ → + ∀Y,T. G ⊢ ⬈*[h,T] 𝐒⦃Y⦄ → + ∀L2. Y = L2.ⓧ → ⦃G,L1⦄ ⊢ ⬈*[h] L2 → + G ⊢ ⬈*[h,ⓑ{p,I}V.T] 𝐒⦃L2⦄. +#h #G #p #I #L1 #V #H @(rsx_ind_lpxs … H) -L1 +#L1 #_ #IHL1 #Y #T #H @(rsx_ind_lpxs … H) -Y +#Y #HY #IHY #L2 #H #HL12 destruct +@rsx_intro_lpxs #L0 #HL20 +lapply (lpxs_trans … HL12 … HL20) #HL10 #H +elim (rdneq_inv_bind_void … H) -H [ -IHY | -HY -IHL1 -HL12 ] +[ #HnV elim (rdeq_dec L1 L2 V) + [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10 + /3 width=6 by rsx_lpxs_trans, lpxs_bind_refl_dx, rdeq_canc_sn/ (**) (* full auto too slow *) + | -HnV -HL10 /4 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx/ + ] +| /3 width=4 by lpxs_bind_refl_dx/ +] +qed-. + +lemma rsx_bind_void (h) (G): + ∀p,I,L,V. G ⊢ ⬈*[h,V] 𝐒⦃L⦄ → + ∀T. G ⊢ ⬈*[h,T] 𝐒⦃L.ⓧ⦄ → + G ⊢ ⬈*[h,ⓑ{p,I}V.T] 𝐒⦃L⦄. +/2 width=3 by rsx_bind_lpxs_void_aux/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_rsx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_rsx.ma new file mode 100644 index 000000000..f801c96b7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/rsx_rsx.ma @@ -0,0 +1,38 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_transition/lpx_rdeq.ma". +include "basic_2/rt_computation/rsx.ma". + +(* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******) + +(* Advanced properties ******************************************************) + +(* Basic_2A1: uses: lsx_lleq_trans *) +lemma rsx_rdeq_trans (h) (G): + ∀L1,T. G ⊢ ⬈*[h,T] 𝐒⦃L1⦄ → + ∀L2. L1 ≛[T] L2 → G ⊢ ⬈*[h,T] 𝐒⦃L2⦄. +#h #G #L1 #T #H @(rsx_ind … H) -L1 +#L1 #_ #IHL1 #L2 #HL12 @rsx_intro +#L #HL2 #HnL2 elim (rdeq_lpx_trans … HL2 … HL12) -HL2 +/4 width=5 by rdeq_repl/ +qed-. + +(* Basic_2A1: uses: lsx_lpx_trans *) +lemma rsx_lpx_trans (h) (G): + ∀L1,T. G ⊢ ⬈*[h,T] 𝐒⦃L1⦄ → + ∀L2. ⦃G,L1⦄ ⊢ ⬈[h] L2 → G ⊢ ⬈*[h,T] 𝐒⦃L2⦄. +#h #G #L1 #T #H @(rsx_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12 +elim (rdeq_dec L1 L2 T) /3 width=4 by rsx_rdeq_trans/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc.ma index 156374e3f..df250a17b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc.ma @@ -18,7 +18,7 @@ include "basic_2/rt_transition/cpm.ma". (* CONTEXT-SENSITIVE PARALLEL R-CONVERSION FOR TERMS ************************) definition cpc: sh → relation4 genv lenv term term ≝ - λh,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 ∨ ⦃G, L⦄ ⊢ T2 ➡[h] T1. + λh,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 ∨ ⦃G,L⦄ ⊢ T2 ➡[h] T1. interpretation "context-sensitive parallel r-conversion (term)" @@ -35,7 +35,7 @@ qed-. (* Basic forward lemmas *****************************************************) -lemma cpc_fwd_cpr: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬌[h] T2 → - ∃∃T. ⦃G, L⦄ ⊢ T1 ➡[h] T & ⦃G, L⦄ ⊢ T2 ➡[h] T. +lemma cpc_fwd_cpr: ∀h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬌[h] T2 → + ∃∃T. ⦃G,L⦄ ⊢ T1 ➡[h] T & ⦃G,L⦄ ⊢ T2 ➡[h] T. #h #G #L #T1 #T2 * /2 width=3 by ex2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc_cpc.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc_cpc.ma index b5b9ac86c..d3151122a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc_cpc.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpc_cpc.ma @@ -18,6 +18,6 @@ include "basic_2/rt_conversion/cpc.ma". (* Main properties **********************************************************) -theorem cpc_conf: ∀h,G,L,T0,T1,T2. ⦃G, L⦄ ⊢ T0 ⬌[h] T1 → ⦃G, L⦄ ⊢ T0 ⬌[h] T2 → - ∃∃T. ⦃G, L⦄ ⊢ T1 ⬌[h] T & ⦃G, L⦄ ⊢ T2 ⬌[h] T. +theorem cpc_conf: ∀h,G,L,T0,T1,T2. ⦃G,L⦄ ⊢ T0 ⬌[h] T1 → ⦃G,L⦄ ⊢ T0 ⬌[h] T2 → + ∃∃T. ⦃G,L⦄ ⊢ T1 ⬌[h] T & ⦃G,L⦄ ⊢ T2 ⬌[h] T. /3 width=3 by cpc_sym, ex2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce.ma index 259fc7b07..3da6a1598 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce.ma @@ -12,6 +12,7 @@ (* *) (**************************************************************************) +include "ground_2/xoa/ex_5_7.ma". include "basic_2/notation/relations/pconveta_5.ma". include "basic_2/rt_computation/cpms.ma". @@ -20,13 +21,14 @@ include "basic_2/rt_computation/cpms.ma". (* avtivate genv *) inductive cpce (h): relation4 genv lenv term term ≝ | cpce_sort: ∀G,L,s. cpce h G L (⋆s) (⋆s) -| cpce_ldef: ∀G,K,V. cpce h G (K.ⓓV) (#0) (#0) -| cpce_ldec: ∀n,G,K,V,s. ⦃G,K⦄ ⊢ V ➡*[n,h] ⋆s → - cpce h G (K.ⓛV) (#0) (#0) -| cpce_eta : ∀n,p,G,K,V,W1,W2,T. ⦃G,K⦄ ⊢ V ➡*[n,h] ⓛ{p}W1.T → - cpce h G K W1 W2 → cpce h G (K.ⓛV) (#0) (+ⓛW2.ⓐ#0.#1) +| cpce_atom: ∀G,i. cpce h G (⋆) (#i) (#i) +| cpce_zero: ∀G,K,I. (∀n,p,W,V,U. I = BPair Abst W → ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V.U → ⊥) → + cpce h G (K.ⓘ{I}) (#0) (#0) +| cpce_eta : ∀n,p,G,K,W,V1,V2,W2,U. ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V1.U → + cpce h G K V1 V2 → ⬆*[1] V2 ≘ W2 → cpce h G (K.ⓛW) (#0) (+ⓛW2.ⓐ#0.#1) | cpce_lref: ∀I,G,K,T,U,i. cpce h G K (#i) T → ⬆*[1] T ≘ U → cpce h G (K.ⓘ{I}) (#↑i) U +| cpce_gref: ∀G,L,l. cpce h G L (§l) (§l) | cpce_bind: ∀p,I,G,K,V1,V2,T1,T2. cpce h G K V1 V2 → cpce h G (K.ⓑ{I}V1) T1 T2 → cpce h G K (ⓑ{p,I}V1.T1) (ⓑ{p,I}V2.T2) @@ -46,44 +48,48 @@ lemma cpce_inv_sort_sn (h) (G) (L) (X2): #h #G #Y #X2 #s0 @(insert_eq_0 … (⋆s0)) #X1 * -G -Y -X1 -X2 [ #G #L #s #_ // -| #G #K #V #_ // -| #n #G #K #V #s #_ #_ // -| #n #p #G #K #V #W1 #W2 #T #_ #_ #H destruct +| #G #i #_ // +| #G #K #I #_ #_ // +| #n #p #G #K #W #V1 #V2 #W2 #U #_ #_ #_ #H destruct | #I #G #K #T #U #i #_ #_ #H destruct +| #G #L #l #_ // | #p #I #G #K #V1 #V2 #T1 #T2 #_ #_ #H destruct | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #H destruct ] qed-. -lemma cpce_inv_ldef_sn (h) (G) (K) (X2): - ∀V. ⦃G,K.ⓓV⦄ ⊢ #0 ⬌η[h] X2 → #0 = X2. -#h #G #Y #X2 #X -@(insert_eq_0 … (Y.ⓓX)) #Y1 -@(insert_eq_0 … (#0)) #X1 -* -G -Y1 -X1 -X2 +lemma cpce_inv_atom_sn (h) (G) (X2): + ∀i. ⦃G,⋆⦄ ⊢ #i ⬌η[h] X2 → #i = X2. +#h #G #X2 #j +@(insert_eq_0 … LAtom) #Y +@(insert_eq_0 … (#j)) #X1 +* -G -Y -X1 -X2 [ #G #L #s #_ #_ // -| #G #K #V #_ #_ // -| #n #G #K #V #s #_ #_ #_ // -| #n #p #G #K #V #W1 #W2 #T #_ #_ #_ #H destruct -| #I #G #K #T #U #i #_ #_ #H #_ destruct +| #G #i #_ #_ // +| #G #K #I #_ #_ #_ // +| #n #p #G #K #W #V1 #V2 #W2 #U #_ #_ #_ #_ #H destruct +| #I #G #K #T #U #i #_ #_ #_ #H destruct +| #G #L #l #_ #_ // | #p #I #G #K #V1 #V2 #T1 #T2 #_ #_ #H #_ destruct | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #H #_ destruct ] qed-. -lemma cpce_inv_ldec_sn (h) (G) (K) (X2): - ∀V. ⦃G,K.ⓛV⦄ ⊢ #0 ⬌η[h] X2 → - ∨∨ ∃∃n,s. ⦃G,K⦄ ⊢ V ➡*[n,h] ⋆s & #0 = X2 - | ∃∃n,p,W1,W2,T. ⦃G,K⦄ ⊢ V ➡*[n,h] ⓛ{p}W1.T & ⦃G,K⦄ ⊢ W1 ⬌η[h] W2 & +ⓛW2.ⓐ#0.#1 = X2. -#h #G #Y #X2 #X -@(insert_eq_0 … (Y.ⓛX)) #Y1 +lemma cpce_inv_zero_sn (h) (G) (K) (X2): + ∀I. ⦃G,K.ⓘ{I}⦄ ⊢ #0 ⬌η[h] X2 → + ∨∨ ∧∧ ∀n,p,W,V,U. I = BPair Abst W → ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V.U → ⊥ & #0 = X2 + | ∃∃n,p,W,V1,V2,W2,U. ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V1.U & ⦃G,K⦄ ⊢ V1 ⬌η[h] V2 + & ⬆*[1] V2 ≘ W2 & I = BPair Abst W & +ⓛW2.ⓐ#0.#1 = X2. +#h #G #Y0 #X2 #Z +@(insert_eq_0 … (Y0.ⓘ{Z})) #Y @(insert_eq_0 … (#0)) #X1 -* -G -Y1 -X1 -X2 +* -G -Y -X1 -X2 [ #G #L #s #H #_ destruct -| #G #K #V #_ #H destruct -| #n #G #K #V #s #HV #_ #H destruct /3 width=3 by ex2_2_intro, or_introl/ -| #n #p #G #K #V #W1 #W2 #T #HV #HW #_ #H destruct /3 width=8 by ex3_5_intro, or_intror/ +| #G #i #_ #H destruct +| #G #K #I #HI #_ #H destruct /4 width=7 by or_introl, conj/ +| #n #p #G #K #W #V1 #V2 #W2 #U #HWU #HV12 #HVW2 #_ #H destruct /3 width=12 by or_intror, ex5_7_intro/ | #I #G #K #T #U #i #_ #_ #H #_ destruct +| #G #L #l #H #_ destruct | #p #I #G #K #V1 #V2 #T1 #T2 #_ #_ #H #_ destruct | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #H #_ destruct ] @@ -92,30 +98,47 @@ qed-. lemma cpce_inv_lref_sn (h) (G) (K) (X2): ∀I,i. ⦃G,K.ⓘ{I}⦄ ⊢ #↑i ⬌η[h] X2 → ∃∃T2. ⦃G,K⦄ ⊢ #i ⬌η[h] T2 & ⬆*[1] T2 ≘ X2. -#h #G #Y #X2 #Z #j -@(insert_eq_0 … (Y.ⓘ{Z})) #Y1 +#h #G #Y0 #X2 #Z #j +@(insert_eq_0 … (Y0.ⓘ{Z})) #Y @(insert_eq_0 … (#↑j)) #X1 -* -G -Y1 -X1 -X2 +* -G -Y -X1 -X2 [ #G #L #s #H #_ destruct -| #G #K #V #H #_ destruct -| #n #G #K #V #s #_ #H #_ destruct -| #n #p #G #K #V #W1 #W2 #T #_ #_ #H #_ destruct +| #G #i #_ #H destruct +| #G #K #I #_ #H #_ destruct +| #n #p #G #K #W #V1 #V2 #W2 #U #_ #_ #_ #H #_ destruct | #I #G #K #T #U #i #Hi #HTU #H1 #H2 destruct /2 width=3 by ex2_intro/ +| #G #L #l #H #_ destruct | #p #I #G #K #V1 #V2 #T1 #T2 #_ #_ #H #_ destruct | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #H #_ destruct ] qed-. +lemma cpce_inv_gref_sn (h) (G) (L) (X2): + ∀l. ⦃G,L⦄ ⊢ §l ⬌η[h] X2 → §l = X2. +#h #G #Y #X2 #k +@(insert_eq_0 … (§k)) #X1 * -G -Y -X1 -X2 +[ #G #L #s #_ // +| #G #i #_ // +| #G #K #I #_ #_ // +| #n #p #G #K #W #V1 #V2 #W2 #U #_ #_ #_ #H destruct +| #I #G #K #T #U #i #_ #_ #H destruct +| #G #L #l #_ // +| #p #I #G #K #V1 #V2 #T1 #T2 #_ #_ #H destruct +| #I #G #L #V1 #V2 #T1 #T2 #_ #_ #H destruct +] +qed-. + lemma cpce_inv_bind_sn (h) (G) (K) (X2): ∀p,I,V1,T1. ⦃G,K⦄ ⊢ ⓑ{p,I}V1.T1 ⬌η[h] X2 → ∃∃V2,T2. ⦃G,K⦄ ⊢ V1 ⬌η[h] V2 & ⦃G,K.ⓑ{I}V1⦄ ⊢ T1 ⬌η[h] T2 & ⓑ{p,I}V2.T2 = X2. #h #G #Y #X2 #q #Z #U #X @(insert_eq_0 … (ⓑ{q,Z}U.X)) #X1 * -G -Y -X1 -X2 [ #G #L #s #H destruct -| #G #K #V #H destruct -| #n #G #K #V #s #_ #H destruct -| #n #p #G #K #V #W1 #W2 #T #_ #_ #H destruct +| #G #i #H destruct +| #G #K #I #_ #H destruct +| #n #p #G #K #W #V1 #V2 #W2 #U #_ #_ #_ #H destruct | #I #G #K #T #U #i #_ #_ #H destruct +| #G #L #l #H destruct | #p #I #G #K #V1 #V2 #T1 #T2 #HV #HT #H destruct /2 width=5 by ex3_2_intro/ | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #H destruct ] @@ -127,10 +150,11 @@ lemma cpce_inv_flat_sn (h) (G) (L) (X2): #h #G #Y #X2 #Z #U #X @(insert_eq_0 … (ⓕ{Z}U.X)) #X1 * -G -Y -X1 -X2 [ #G #L #s #H destruct -| #G #K #V #H destruct -| #n #G #K #V #s #_ #H destruct -| #n #p #G #K #V #W1 #W2 #T #_ #_ #H destruct +| #G #i #H destruct +| #G #K #I #_ #H destruct +| #n #p #G #K #W #V1 #V2 #W2 #U #_ #_ #_ #H destruct | #I #G #K #T #U #i #_ #_ #H destruct +| #G #L #l #H destruct | #p #I #G #L #V1 #V2 #T1 #T2 #_ #_ #H destruct | #I #G #K #V1 #V2 #T1 #T2 #HV #HT #H destruct /2 width=5 by ex3_2_intro/ ] diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce_drops.ma new file mode 100644 index 000000000..49bf1e885 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/cpce_drops.ma @@ -0,0 +1,46 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/relocation/drops.ma". +include "basic_2/rt_conversion/cpce.ma". + +(* CONTEXT-SENSITIVE PARALLEL ETA-CONVERSION FOR TERMS **********************) + +(* Properties with uniform slicing for local environments *******************) + +lemma cpce_eta_drops (h) (n) (G) (K): + ∀p,W,V1,U. ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V1.U → + ∀V2. ⦃G,K⦄ ⊢ V1 ⬌η[h] V2 → + ∀i,L. ⬇*[i] L ≘ K.ⓛW → + ∀W2. ⬆*[↑i] V2 ≘ W2 → ⦃G,L⦄ ⊢ #i ⬌η[h] +ⓛW2.ⓐ#0.#↑i. +#h #n #G #K #p #W #V1 #U #HWU #V2 #HV12 #i elim i -i +[ #L #HLK #W2 #HVW2 + >(drops_fwd_isid … HLK) -L [| // ] /2 width=8 by cpce_eta/ +| #i #IH #L #HLK #W2 #HVW2 + elim (drops_inv_succ … HLK) -HLK #I #Y #HYK #H destruct + elim (lifts_split_trans … HVW2 (𝐔❴↑i❵) (𝐔❴1❵)) [| // ] #X2 #HVX2 #HXW2 + /5 width=7 by cpce_lref, lifts_push_lref, lifts_bind, lifts_flat/ +] +qed. + +lemma cpce_zero_drops (h) (G): + ∀i,L. (∀n,p,K,W,V,U. ⬇*[i] L ≘ K.ⓛW → ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V.U → ⊥) → + ⦃G,L⦄ ⊢ #i ⬌η[h] #i. +#h #G #i elim i -i +[ * [ #_ // ] #L #I #Hi + /4 width=8 by cpce_zero, drops_refl/ +| #i #IH * [ -IH #_ // ] #L #I #Hi + /5 width=8 by cpce_lref, drops_drop/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/lpce.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/lpce.ma index b74313dae..8da6c1af4 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/lpce.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_conversion/lpce.ma @@ -62,7 +62,7 @@ lemma lpce_inv_bind_dx (h) (G): lemma lpce_inv_unit_sn (h) (G): ∀I,L2,K1. ⦃G,K1.ⓤ{I}⦄ ⊢ ⬌η[h] L2 → - ∃∃K2. ⦃G, K1⦄ ⊢ ⬌η[h] K2 & L2 = K2.ⓤ{I}. + ∃∃K2. ⦃G,K1⦄ ⊢ ⬌η[h] K2 & L2 = K2.ⓤ{I}. /2 width=1 by lex_inv_unit_sn/ qed-. lemma lpce_inv_pair_sn (h) (G): diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs.ma index 59848b068..4daecd3eb 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs.ma @@ -29,16 +29,16 @@ interpretation "context-sensitive parallel r-equivalence (term)" (* Basic_2A1: was: cpcs_ind_dx *) lemma cpcs_ind_sn (h) (G) (L) (T2): ∀Q:predicate term. Q T2 → - (∀T1,T. ⦃G, L⦄ ⊢ T1 ⬌[h] T → ⦃G, L⦄ ⊢ T ⬌*[h] T2 → Q T → Q T1) → - ∀T1. ⦃G, L⦄ ⊢ T1 ⬌*[h] T2 → Q T1. + (∀T1,T. ⦃G,L⦄ ⊢ T1 ⬌[h] T → ⦃G,L⦄ ⊢ T ⬌*[h] T2 → Q T → Q T1) → + ∀T1. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → Q T1. normalize /3 width=6 by TC_star_ind_dx/ qed-. (* Basic_2A1: was: cpcs_ind *) lemma cpcs_ind_dx (h) (G) (L) (T1): ∀Q:predicate term. Q T1 → - (∀T,T2. ⦃G, L⦄ ⊢ T1 ⬌*[h] T → ⦃G, L⦄ ⊢ T ⬌[h] T2 → Q T → Q T2) → - ∀T2. ⦃G, L⦄ ⊢ T1 ⬌*[h] T2 → Q T2. + (∀T,T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T → ⦃G,L⦄ ⊢ T ⬌[h] T2 → Q T → Q T2) → + ∀T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → Q T2. normalize /3 width=6 by TC_star_ind/ qed-. @@ -54,50 +54,50 @@ lemma cpcs_sym (h) (G) (L): symmetric … (cpcs h G L). /2 width=1 by cpc_sym/ qed-. -lemma cpc_cpcs (h) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpc_cpcs (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T1 ⬌[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /2 width=1 by inj/ qed. (* Basic_2A1: was: cpcs_strap2 *) -lemma cpcs_step_sn (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ⬌[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ⬌*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_step_sn (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ⬌[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ⬌*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. normalize /2 width=3 by TC_strap/ qed-. (* Basic_2A1: was: cpcs_strap1 *) -lemma cpcs_step_dx (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ⬌*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ⬌[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_step_dx (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ⬌*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ⬌[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. normalize /2 width=3 by step/ qed-. (* Basic_1: was: pc3_pr2_r *) -lemma cpr_cpcs_dx (h) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpr_cpcs_dx (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=1 by cpc_cpcs, or_introl/ qed. (* Basic_1: was: pc3_pr2_x *) -lemma cpr_cpcs_sn (h) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T2 ➡[h] T1 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpr_cpcs_sn (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T2 ➡[h] T1 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=1 by cpc_cpcs, or_intror/ qed. (* Basic_1: was: pc3_pr2_u *) (* Basic_2A1: was: cpcs_cpr_strap2 *) -lemma cpcs_cpr_step_sn (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡[h] T → ∀T2. ⦃G, L⦄ ⊢ T ⬌*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cpr_step_sn (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡[h] T → ∀T2. ⦃G,L⦄ ⊢ T ⬌*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=3 by cpcs_step_sn, or_introl/ qed-. (* Basic_2A1: was: cpcs_cpr_strap1 *) -lemma cpcs_cpr_step_dx (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ⬌*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cpr_step_dx (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ⬌*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ➡[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=3 by cpcs_step_dx, or_introl/ qed-. -lemma cpcs_cpr_div (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ⬌*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T2 ➡[h] T → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cpr_div (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ⬌*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡[h] T → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=3 by cpcs_step_dx, or_intror/ qed-. -lemma cpr_div (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡[h] T → - ∀T2. ⦃G, L⦄ ⊢ T2 ➡[h] T → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpr_div (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡[h] T → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡[h] T → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=3 by cpr_cpcs_dx, cpcs_step_dx, or_intror/ qed-. (* Basic_1: was: pc3_pr2_u2 *) -lemma cpcs_cpr_conf (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T ➡[h] T1 → - ∀T2. ⦃G, L⦄ ⊢ T ⬌*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cpr_conf (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T ➡[h] T1 → + ∀T2. ⦃G,L⦄ ⊢ T ⬌*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=3 by cpcs_step_sn, or_intror/ qed-. (* Basic_1: removed theorems 9: diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_aaa.ma index 13d12e5ad..2c1be91f4 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_aaa.ma @@ -20,8 +20,8 @@ include "basic_2/rt_equivalence/cpcs_cprs.ma". (* Main inversion lemmas with atomic arity assignment on terms **************) (* Note: lemma 1500 *) -theorem cpcs_aaa_mono (h) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌*[h] T2 → - ∀A1. ⦃G, L⦄ ⊢ T1 ⁝ A1 → ∀A2. ⦃G, L⦄ ⊢ T2 ⁝ A2 → +theorem cpcs_aaa_mono (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → + ∀A1. ⦃G,L⦄ ⊢ T1 ⁝ A1 → ∀A2. ⦃G,L⦄ ⊢ T2 ⁝ A2 → A1 = A2. #h #G #L #T1 #T2 #HT12 #A1 #HA1 #A2 #HA2 elim (cpcs_inv_cprs … HT12) -HT12 #T #HT1 #HT2 diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cpcs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cpcs.ma index a29055eee..85cd8c732 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cpcs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cpcs.ma @@ -31,21 +31,21 @@ theorem cpcs_canc_dx (h) (G) (L): right_cancellable … (cpcs h G L). (* Advanced properties ******************************************************) -lemma cpcs_bind1 (h) (G) (L): ∀V1,V2. ⦃G, L⦄ ⊢ V1 ⬌*[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬌*[h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬌*[h] ⓑ{p,I}V2.T2. +lemma cpcs_bind1 (h) (G) (L): ∀V1,V2. ⦃G,L⦄ ⊢ V1 ⬌*[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ⬌*[h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬌*[h] ⓑ{p,I}V2.T2. /3 width=3 by cpcs_trans, cpcs_bind_sn, cpcs_bind_dx/ qed. -lemma cpcs_bind2 (h) (G) (L): ∀V1,V2. ⦃G, L⦄ ⊢ V1 ⬌*[h] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ⬌*[h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬌*[h] ⓑ{p,I}V2.T2. +lemma cpcs_bind2 (h) (G) (L): ∀V1,V2. ⦃G,L⦄ ⊢ V1 ⬌*[h] V2 → + ∀I,T1,T2. ⦃G,L.ⓑ{I}V2⦄ ⊢ T1 ⬌*[h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬌*[h] ⓑ{p,I}V2.T2. /3 width=3 by cpcs_trans, cpcs_bind_sn, cpcs_bind_dx/ qed. (* Advanced properties with r-transition for full local environments ********) (* Basic_1: was: pc3_wcpr0 *) -lemma lpr_cpcs_conf (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → - ∀T1,T2. ⦃G, L1⦄ ⊢ T1 ⬌*[h] T2 → ⦃G, L2⦄ ⊢ T1 ⬌*[h] T2. +lemma lpr_cpcs_conf (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → + ∀T1,T2. ⦃G,L1⦄ ⊢ T1 ⬌*[h] T2 → ⦃G,L2⦄ ⊢ T1 ⬌*[h] T2. #h #G #L1 #L2 #HL12 #T1 #T2 #H elim (cpcs_inv_cprs … H) -H /3 width=5 by cpcs_canc_dx, lpr_cprs_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cprs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cprs.ma index 5292a2665..bd40f01c3 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cprs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_cprs.ma @@ -20,8 +20,8 @@ include "basic_2/rt_equivalence/cpcs.ma". (* Inversion lemmas with context sensitive r-computation on terms ***********) -lemma cpcs_inv_cprs (h) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌*[h] T2 → - ∃∃T. ⦃G, L⦄ ⊢ T1 ➡*[h] T & ⦃G, L⦄ ⊢ T2 ➡*[h] T. +lemma cpcs_inv_cprs (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → + ∃∃T. ⦃G,L⦄ ⊢ T1 ➡*[h] T & ⦃G,L⦄ ⊢ T2 ➡*[h] T. #h #G #L #T1 #T2 #H @(cpcs_ind_dx … H) -T2 [ /3 width=3 by ex2_intro/ | #T #T2 #_ #HT2 * #T0 #HT10 elim HT2 -HT2 #HT2 #HT0 @@ -35,7 +35,7 @@ qed-. (* Basic_1: was: pc3_gen_sort *) (* Basic_2A1: was: cpcs_inv_sort *) -lemma cpcs_inv_sort_bi (h) (G) (L): ∀s1,s2. ⦃G, L⦄ ⊢ ⋆s1 ⬌*[h] ⋆s2 → s1 = s2. +lemma cpcs_inv_sort_bi (h) (G) (L): ∀s1,s2. ⦃G,L⦄ ⊢ ⋆s1 ⬌*[h] ⋆s2 → s1 = s2. #h #G #L #s1 #s2 #H elim (cpcs_inv_cprs … H) -H #T #H1 >(cprs_inv_sort1 … H1) -T #H2 lapply (cprs_inv_sort1 … H2) -L #H destruct // @@ -43,8 +43,8 @@ qed-. (* Basic_2A1: was: cpcs_inv_abst1 *) lemma cpcs_inv_abst_sn (h) (G) (L): - ∀p,W1,T1,X. ⦃G, L⦄ ⊢ ⓛ{p}W1.T1 ⬌*[h] X → - ∃∃W2,T2. ⦃G, L⦄ ⊢ X ➡*[h] ⓛ{p}W2.T2 & ⦃G, L⦄ ⊢ ⓛ{p}W1.T1 ➡*[h] ⓛ{p}W2.T2. + ∀p,W1,T1,X. ⦃G,L⦄ ⊢ ⓛ{p}W1.T1 ⬌*[h] X → + ∃∃W2,T2. ⦃G,L⦄ ⊢ X ➡*[h] ⓛ{p}W2.T2 & ⦃G,L⦄ ⊢ ⓛ{p}W1.T1 ➡*[h] ⓛ{p}W2.T2. #h #G #L #p #W1 #T1 #T #H elim (cpcs_inv_cprs … H) -H #X #H1 #H2 elim (cpms_inv_abst_sn … H1) -H1 #W2 #T2 #HW12 #HT12 #H destruct @@ -53,13 +53,13 @@ qed-. (* Basic_2A1: was: cpcs_inv_abst2 *) lemma cpcs_inv_abst_dx (h) (G) (L): - ∀p,W1,T1,X. ⦃G, L⦄ ⊢ X ⬌*[h] ⓛ{p}W1.T1 → - ∃∃W2,T2. ⦃G, L⦄ ⊢ X ➡*[h] ⓛ{p}W2.T2 & ⦃G, L⦄ ⊢ ⓛ{p}W1.T1 ➡*[h] ⓛ{p}W2.T2. + ∀p,W1,T1,X. ⦃G,L⦄ ⊢ X ⬌*[h] ⓛ{p}W1.T1 → + ∃∃W2,T2. ⦃G,L⦄ ⊢ X ➡*[h] ⓛ{p}W2.T2 & ⦃G,L⦄ ⊢ ⓛ{p}W1.T1 ➡*[h] ⓛ{p}W2.T2. /3 width=1 by cpcs_inv_abst_sn, cpcs_sym/ qed-. (* Basic_1: was: pc3_gen_sort_abst *) lemma cpcs_inv_sort_abst (h) (G) (L): - ∀p,W,T,s. ⦃G, L⦄ ⊢ ⋆s ⬌*[h] ⓛ{p}W.T → ⊥. + ∀p,W,T,s. ⦃G,L⦄ ⊢ ⋆s ⬌*[h] ⓛ{p}W.T → ⊥. #h #G #L #p #W #T #s #H elim (cpcs_inv_cprs … H) -H #X #H1 >(cprs_inv_sort1 … H1) -X #H2 @@ -69,97 +69,97 @@ qed-. (* Properties with context sensitive r-computation on terms *****************) (* Basic_1: was: pc3_pr3_r *) -lemma cpcs_cprs_dx (h) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cprs_dx (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T1 #T2 #H @(cprs_ind_dx … H) -T2 /3 width=3 by cpcs_cpr_step_dx, cpcs_step_dx, cpc_cpcs/ qed. (* Basic_1: was: pc3_pr3_x *) -lemma cpcs_cprs_sn (h) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T2 ➡*[h] T1 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cprs_sn (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T2 ➡*[h] T1 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T1 #T2 #H @(cprs_ind_sn … H) -T2 /3 width=3 by cpcs_cpr_div, cpcs_step_sn, cpcs_cprs_dx/ qed. (* Basic_2A1: was: cpcs_cprs_strap1 *) -lemma cpcs_cprs_step_dx (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ⬌*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ➡*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cprs_step_dx (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ⬌*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ➡*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T1 #T #HT1 #T2 #H @(cprs_ind_dx … H) -T2 /2 width=3 by cpcs_cpr_step_dx/ qed-. (* Basic_2A1: was: cpcs_cprs_strap2 *) -lemma cpcs_cprs_step_sn (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T ⬌*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cprs_step_sn (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T ⬌*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T1 #T #H #T2 #HT2 @(cprs_ind_sn … H) -T1 /2 width=3 by cpcs_cpr_step_sn/ qed-. -lemma cpcs_cprs_div (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ⬌*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T2 ➡*[h] T → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cprs_div (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ⬌*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡*[h] T → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T1 #T #HT1 #T2 #H @(cprs_ind_sn … H) -T2 /2 width=3 by cpcs_cpr_div/ qed-. (* Basic_1: was: pc3_pr3_conf *) -lemma cpcs_cprs_conf (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T ➡*[h] T1 → - ∀T2. ⦃G, L⦄ ⊢ T ⬌*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpcs_cprs_conf (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T ➡*[h] T1 → + ∀T2. ⦃G,L⦄ ⊢ T ⬌*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T1 #T #H #T2 #HT2 @(cprs_ind_dx … H) -T1 /2 width=3 by cpcs_cpr_conf/ qed-. (* Basic_1: was: pc3_pr3_t *) (* Basic_1: note: pc3_pr3_t should be renamed *) -lemma cprs_div (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T2 ➡*[h] T → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cprs_div (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡*[h] T → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T1 #T #HT1 #T2 #H @(cprs_ind_sn … H) -T2 /2 width=3 by cpcs_cpr_div, cpcs_cprs_dx/ qed. -lemma cprs_cpr_div (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡*[h] T → - ∀T2. ⦃G, L⦄ ⊢ T2 ➡[h] T → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cprs_cpr_div (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡*[h] T → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡[h] T → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=5 by cpm_cpms, cprs_div/ qed-. -lemma cpr_cprs_div (h) (G) (L): ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡[h] T → - ∀T2. ⦃G, L⦄ ⊢ T2 ➡*[h] T → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpr_cprs_div (h) (G) (L): ∀T1,T. ⦃G,L⦄ ⊢ T1 ➡[h] T → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡*[h] T → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. /3 width=3 by cpm_cpms, cprs_div/ qed-. -lemma cpr_cprs_conf_cpcs (h) (G) (L): ∀T,T1. ⦃G, L⦄ ⊢ T ➡*[h] T1 → - ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cpr_cprs_conf_cpcs (h) (G) (L): ∀T,T1. ⦃G,L⦄ ⊢ T ➡*[h] T1 → + ∀T2. ⦃G,L⦄ ⊢ T ➡[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T #T1 #HT1 #T2 #HT2 elim (cprs_strip … HT1 … HT2) -HT1 -HT2 /2 width=3 by cpr_cprs_div/ qed-. -lemma cprs_cpr_conf_cpcs (h) (G) (L): ∀T,T1. ⦃G, L⦄ ⊢ T ➡*[h] T1 → - ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 → ⦃G, L⦄ ⊢ T2 ⬌*[h] T1. +lemma cprs_cpr_conf_cpcs (h) (G) (L): ∀T,T1. ⦃G,L⦄ ⊢ T ➡*[h] T1 → + ∀T2. ⦃G,L⦄ ⊢ T ➡[h] T2 → ⦃G,L⦄ ⊢ T2 ⬌*[h] T1. #h #G #L #T #T1 #HT1 #T2 #HT2 elim (cprs_strip … HT1 … HT2) -HT1 -HT2 /2 width=3 by cprs_cpr_div/ qed-. -lemma cprs_conf_cpcs (h) (G) (L): ∀T,T1. ⦃G, L⦄ ⊢ T ➡*[h] T1 → - ∀T2. ⦃G, L⦄ ⊢ T ➡*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬌*[h] T2. +lemma cprs_conf_cpcs (h) (G) (L): ∀T,T1. ⦃G,L⦄ ⊢ T ➡*[h] T1 → + ∀T2. ⦃G,L⦄ ⊢ T ➡*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h] T2. #h #G #L #T #T1 #HT1 #T2 #HT2 elim (cprs_conf … HT1 … HT2) -HT1 -HT2 /2 width=3 by cprs_div/ qed-. (* Basic_1: was only: pc3_thin_dx *) -lemma cpcs_flat (h) (G) (L): ∀V1,V2. ⦃G, L⦄ ⊢ V1 ⬌*[h] V2 → - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌*[h] T2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬌*[h] ⓕ{I}V2.T2. +lemma cpcs_flat (h) (G) (L): ∀V1,V2. ⦃G,L⦄ ⊢ V1 ⬌*[h] V2 → + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → + ∀I. ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ⬌*[h] ⓕ{I}V2.T2. #h #G #L #V1 #V2 #HV12 #T1 #T2 #HT12 elim (cpcs_inv_cprs … HV12) -HV12 elim (cpcs_inv_cprs … HT12) -HT12 /3 width=5 by cprs_flat, cprs_div/ qed. -lemma cpcs_flat_dx_cpr_rev (h) (G) (L): ∀V1,V2. ⦃G, L⦄ ⊢ V2 ➡[h] V1 → - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌*[h] T2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬌*[h] ⓕ{I}V2.T2. +lemma cpcs_flat_dx_cpr_rev (h) (G) (L): ∀V1,V2. ⦃G,L⦄ ⊢ V2 ➡[h] V1 → + ∀T1,T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → + ∀I. ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ⬌*[h] ⓕ{I}V2.T2. /3 width=1 by cpr_cpcs_sn, cpcs_flat/ qed. -lemma cpcs_bind_dx (h) (G) (L): ∀I,V,T1,T2. ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ⬌*[h] T2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T1 ⬌*[h] ⓑ{p,I}V.T2. +lemma cpcs_bind_dx (h) (G) (L): ∀I,V,T1,T2. ⦃G,L.ⓑ{I}V⦄ ⊢ T1 ⬌*[h] T2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V.T1 ⬌*[h] ⓑ{p,I}V.T2. #h #G #L #I #V #T1 #T2 #HT12 elim (cpcs_inv_cprs … HT12) -HT12 /3 width=5 by cprs_div, cpms_bind/ qed. -lemma cpcs_bind_sn (h) (G) (L): ∀I,V1,V2,T. ⦃G, L⦄ ⊢ V1 ⬌*[h] V2 → - ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T ⬌*[h] ⓑ{p,I}V2.T. +lemma cpcs_bind_sn (h) (G) (L): ∀I,V1,V2,T. ⦃G,L⦄ ⊢ V1 ⬌*[h] V2 → + ∀p. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T ⬌*[h] ⓑ{p,I}V2.T. #h #G #L #I #V1 #V2 #T #HV12 elim (cpcs_inv_cprs … HV12) -HV12 /3 width=5 by cprs_div, cpms_bind/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_csx.ma new file mode 100644 index 000000000..f37dc4184 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_csx.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 "basic_2/rt_computation/cpre_csx.ma". +include "basic_2/rt_computation/cpre_cpre.ma". +include "basic_2/rt_equivalence/cpcs_cprs.ma". + +(* CONTEXT-SENSITIVE PARALLEL R-EQUIVALENCE FOR TERMS ***********************) + +(* Properties with strongly normalizing terms for unbound rt-transition *****) + +(* Basic_1: was: cpcs_dec *) +lemma csx_cpcs_dec (h) (G) (L): + ∀T1. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ → ∀T2. ⦃G,L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄ → + Decidable … (⦃G,L⦄ ⊢ T1 ⬌*[h] T2). +#h #G #L #T1 #HT1 #T2 #HT2 +elim (cpre_total_csx … HT1) -HT1 #U1 #HTU1 +elim (cpre_total_csx … HT2) -HT2 #U2 #HTU2 +elim (eq_term_dec U1 U2) [ #H destruct | #HnU12 ] +[ cases HTU1 -HTU1 #HTU1 #_ + cases HTU2 -HTU2 #HTU2 #_ + /3 width=3 by cprs_div, or_introl/ +| @or_intror #H + elim (cpcs_inv_cprs … H) -H #T0 #HT10 #HT20 + lapply (cpre_cprs_conf … HT10 … HTU1) -T1 #H1 + lapply (cpre_cprs_conf … HT20 … HTU2) -T2 #H2 + /3 width=6 by cpre_mono/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_lprs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_lprs.ma index 3564a480a..6da444ce1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_lprs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpcs_lprs.ma @@ -19,20 +19,20 @@ include "basic_2/rt_equivalence/cpcs_cprs.ma". (* Properties with parallel r-computation for full local environments *******) -lemma lpr_cpcs_trans (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → - ∀T1,T2. ⦃G, L2⦄ ⊢ T1 ⬌*[h] T2 → ⦃G, L1⦄ ⊢ T1 ⬌*[h] T2. +lemma lpr_cpcs_trans (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → + ∀T1,T2. ⦃G,L2⦄ ⊢ T1 ⬌*[h] T2 → ⦃G,L1⦄ ⊢ T1 ⬌*[h] T2. #h #G #L1 #L2 #HL12 #T1 #T2 #H elim (cpcs_inv_cprs … H) -H /4 width=5 by cprs_div, lpr_cpms_trans/ qed-. -lemma lprs_cpcs_trans (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → - ∀T1,T2. ⦃G, L2⦄ ⊢ T1 ⬌*[h] T2 → ⦃G, L1⦄ ⊢ T1 ⬌*[h] T2. +lemma lprs_cpcs_trans (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → + ∀T1,T2. ⦃G,L2⦄ ⊢ T1 ⬌*[h] T2 → ⦃G,L1⦄ ⊢ T1 ⬌*[h] T2. #h #G #L1 #L2 #HL12 #T1 #T2 #H elim (cpcs_inv_cprs … H) -H /4 width=5 by cprs_div, lprs_cpms_trans/ qed-. -lemma lprs_cprs_conf (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h] L2 → - ∀T1,T2. ⦃G, L1⦄ ⊢ T1 ➡*[h] T2 → ⦃G, L2⦄ ⊢ T1 ⬌*[h] T2. +lemma lprs_cprs_conf (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → + ∀T1,T2. ⦃G,L1⦄ ⊢ T1 ➡*[h] T2 → ⦃G,L2⦄ ⊢ T1 ⬌*[h] T2. #h #G #L1 #L2 #HL12 #T1 #T2 #HT12 elim (lprs_cprs_conf_dx … HT12 … HL12) -L1 /2 width=3 by cprs_div/ qed-. @@ -40,23 +40,23 @@ qed-. (* Basic_1: was: pc3_wcpr0_t *) (* Basic_1: note: pc3_wcpr0_t should be renamed *) (* Note: alternative proof /3 width=5 by lprs_cprs_conf, lpr_lprs/ *) -lemma lpr_cprs_conf (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → - ∀T1,T2. ⦃G, L1⦄ ⊢ T1 ➡*[h] T2 → ⦃G, L2⦄ ⊢ T1 ⬌*[h] T2. +lemma lpr_cprs_conf (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → + ∀T1,T2. ⦃G,L1⦄ ⊢ T1 ➡*[h] T2 → ⦃G,L2⦄ ⊢ T1 ⬌*[h] T2. #h #G #L1 #L2 #HL12 #T1 #T2 #HT12 elim (cprs_lpr_conf_dx … HT12 … HL12) -L1 /2 width=3 by cprs_div/ qed-. (* Basic_1: was only: pc3_pr0_pr2_t *) (* Basic_1: note: pc3_pr0_pr2_t should be renamed *) -lemma lpr_cpr_conf (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → - ∀T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h] T2 → ⦃G, L2⦄ ⊢ T1 ⬌*[h] T2. +lemma lpr_cpr_conf (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → + ∀T1,T2. ⦃G,L1⦄ ⊢ T1 ➡[h] T2 → ⦃G,L2⦄ ⊢ T1 ⬌*[h] T2. /3 width=5 by lpr_cprs_conf, cpm_cpms/ qed-. (* Advanced inversion lemmas ************************************************) (* Note: there must be a proof suitable for lfpr *) -lemma cpcs_inv_abst_sn (h) (G) (L): ∀p1,p2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{p1}W1.T1 ⬌*[h] ⓛ{p2}W2.T2 → - ∧∧ ⦃G, L⦄ ⊢ W1 ⬌*[h] W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬌*[h] T2 & p1 = p2. +lemma cpcs_inv_abst_sn (h) (G) (L): ∀p1,p2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ ⓛ{p1}W1.T1 ⬌*[h] ⓛ{p2}W2.T2 → + ∧∧ ⦃G,L⦄ ⊢ W1 ⬌*[h] W2 & ⦃G,L.ⓛW1⦄ ⊢ T1 ⬌*[h] T2 & p1 = p2. #h #G #L #p1 #p2 #W1 #W2 #T1 #T2 #H elim (cpcs_inv_cprs … H) -H #T #H1 #H2 elim (cpms_inv_abst_sn … H1) -H1 #W0 #T0 #HW10 #HT10 #H destruct @@ -66,8 +66,8 @@ lapply (lprs_cpcs_trans … (L.ⓛW1) … HT2) /2 width=1 by lprs_pair/ -HT2 #HT /4 width=3 by and3_intro, cprs_div, cpcs_cprs_div, cpcs_sym/ qed-. -lemma cpcs_inv_abst_dx (h) (G) (L): ∀p1,p2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{p1}W1.T1 ⬌*[h] ⓛ{p2}W2.T2 → - ∧∧ ⦃G, L⦄ ⊢ W1 ⬌*[h] W2 & ⦃G, L.ⓛW2⦄ ⊢ T1 ⬌*[h] T2 & p1 = p2. +lemma cpcs_inv_abst_dx (h) (G) (L): ∀p1,p2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ ⓛ{p1}W1.T1 ⬌*[h] ⓛ{p2}W2.T2 → + ∧∧ ⦃G,L⦄ ⊢ W1 ⬌*[h] W2 & ⦃G,L.ⓛW2⦄ ⊢ T1 ⬌*[h] T2 & p1 = p2. #h #G #L #p1 #p2 #W1 #W2 #T1 #T2 #HT12 lapply (cpcs_sym … HT12) -HT12 #HT12 elim (cpcs_inv_abst_sn … HT12) -HT12 /3 width=1 by cpcs_sym, and3_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes.ma new file mode 100644 index 000000000..de444a0d7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes.ma @@ -0,0 +1,43 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/notation/relations/pconvstar_7.ma". +include "basic_2/rt_computation/cpms.ma". + +(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-EQUIVALENCE FOR TERMS **************) + +(* Basic_2A1: uses: scpes *) +definition cpes (h) (n1) (n2): relation4 genv lenv term term ≝ + λG,L,T1,T2. + ∃∃T. ⦃G,L⦄ ⊢ T1 ➡*[n1,h] T & ⦃G,L⦄ ⊢ T2 ➡*[n2,h] T. + +interpretation "t-bound context-sensitive parallel rt-equivalence (term)" + 'PConvStar h n1 n2 G L T1 T2 = (cpes h n1 n2 G L T1 T2). + +(* Basic properties *********************************************************) + +(* Basic_2A1: uses: scpds_div *) +lemma cpms_div (h) (n1) (n2): + ∀G,L,T1,T. ⦃G,L⦄ ⊢ T1 ➡*[n1,h] T → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡*[n2,h] T → ⦃G,L⦄ ⊢ T1 ⬌*[h,n1,n2] T2. +/2 width=3 by ex2_intro/ qed. + +lemma cpes_refl (h): ∀G,L. reflexive … (cpes h 0 0 G L). +/2 width=3 by cpms_div/ qed. + +(* Basic_2A1: uses: scpes_sym *) +lemma cpes_sym (h) (n1) (n2): + ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬌*[h,n1,n2] T2 → ⦃G,L⦄ ⊢ T2 ⬌*[h,n2,n1] T1. +#h #n1 #n2 #G #L #T1 #T2 * /2 width=3 by cpms_div/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_aaa.ma new file mode 100644 index 000000000..06eacc674 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_aaa.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 "basic_2/rt_computation/cpms_aaa.ma". +include "basic_2/rt_equivalence/cpes.ma". + +(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-EQUIVALENCE FOR TERMS **************) + +(* Properties with atomic arity assignment on terms *************************) + +(* Basic_2A1: uses: scpes_refl *) +lemma cpes_refl_aaa (h) (n): + ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ⦃G,L⦄ ⊢ T ⬌*[h,n,n] T. +#h #n #G #L #T #A #HA +elim (cpms_total_aaa h … n … HA) #U #HTU +/2 width=3 by cpms_div/ +qed. + +(* Main inversion lemmas with atomic arity assignment on terms **************) + +(* Basic_2A1: uses: scpes_aaa_mono *) +theorem cpes_aaa_mono (h) (n1) (n2): + ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬌*[h,n1,n2] T2 → + ∀A1. ⦃G,L⦄ ⊢ T1 ⁝ A1 → ∀A2. ⦃G,L⦄ ⊢ T2 ⁝ A2 → A1 = A2. +#h #n1 #n2 #G #L #T1 #T2 * #T #HT1 #HT2 #A1 #HA1 #A2 #HA2 +lapply (cpms_aaa_conf … HA1 … HT1) -T1 #HA1 +lapply (cpms_aaa_conf … HA2 … HT2) -T2 #HA2 +lapply (aaa_mono … HA1 … HA2) -L -T // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_cpes.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_cpes.ma new file mode 100644 index 000000000..73dca9727 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_cpes.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 "basic_2/rt_computation/lprs_cpms.ma". +include "basic_2/rt_equivalence/cpes_cpms.ma". + +(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-EQUIVALENCE FOR TERMS **************) + +(* Advanced forward lemmas **************************************************) + +lemma cpes_fwd_abst_bi (h) (n1) (n2) (p1) (p2) (G) (L): + ∀W1,W2,T1,T2. ⦃G,L⦄ ⊢ ⓛ{p1}W1.T1 ⬌*[h,n1,n2] ⓛ{p2}W2.T2 → + ∧∧ p1 = p2 & ⦃G,L⦄ ⊢ W1 ⬌*[h,0,O] W2. +#h #n1 #n2 #p1 #p2 #G #L #W1 #W2 #T1 #T2 * #X #H1 #H2 +elim (cpms_inv_abst_sn … H1) #W0 #X0 #HW10 #_ #H destruct +elim (cpms_inv_abst_bi … H2) #H #HW20 #_ destruct +/3 width=3 by cpms_div, conj/ +qed-. + +(* Main properties **********************************************************) + +theorem cpes_cpes_trans (h) (n1) (n2) (G) (L) (T): + ∀T1. ⦃G,L⦄ ⊢ T ⬌*[h,n1,0] T1 → + ∀T2. ⦃G,L⦄ ⊢ T1 ⬌*[h,0,n2] T2 → ⦃G,L⦄ ⊢ T ⬌*[h,n1,n2] T2. +#h #n1 #n2 #G #L #T #T1 #HT1 #T2 * #X #HX1 #HX2 +lapply (cpes_cprs_trans … HT1 … HX1) -T1 #HTX +lapply (cpes_cpms_div … HTX … HX2) -X // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_cpms.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_cpms.ma new file mode 100644 index 000000000..48b0ceb1c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_equivalence/cpes_cpms.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 "basic_2/rt_computation/cprs_cprs.ma". +include "basic_2/rt_equivalence/cpes.ma". + +(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-EQUIVALENCE FOR TERMS **************) + +(* Properties with t-bound rt-computation on terms **************************) + +lemma cpes_cprs_trans (h) (n) (G) (L) (T0): + ∀T1. ⦃G,L⦄ ⊢ T1 ⬌*[h,n,0] T0 → + ∀T2. ⦃G,L⦄ ⊢ T0 ➡*[h] T2 → ⦃G,L⦄ ⊢ T1 ⬌*[h,n,0] T2. +#h #n #G #L #T0 #T1 * #T #HT1 #HT0 #T2 #HT02 +elim (cprs_conf … HT0 … HT02) -T0 #T0 #HT0 #HT20 +/3 width=3 by cpms_div, cpms_cprs_trans/ +qed-. + +lemma cpes_cpms_div (h) (n) (n1) (n2) (G) (L) (T0): + ∀T1. ⦃G,L⦄ ⊢ T1 ⬌*[h,n,n1] T0 → + ∀T2. ⦃G,L⦄ ⊢ T2 ➡*[n2,h] T0 → ⦃G,L⦄ ⊢ T1 ⬌*[h,n,n2+n1] T2. +#h #n #n1 #n2 #G #L #T0 #T1 * #T #HT1 #HT0 #T2 #HT20 +lapply (cpms_trans … HT20 … HT0) -T0 #HT2 +/2 width=3 by cpms_div/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr.ma new file mode 100644 index 000000000..aa739d678 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr.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 "basic_2/notation/relations/prednormal_4.ma". +include "basic_2/rt_transition/cpr.ma". + +(* NORMAL TERMS FOR CONTEXT-SENSITIVE R-TRANSITION **************************) + +definition cnr (h) (G) (L): predicate term ≝ NF … (cpm h G L 0) (eq …). + +interpretation + "normality for context-sensitive r-transition (term)" + 'PRedNormal h G L T = (cnr h G L T). + +(* Basic inversion lemmas ***************************************************) + +lemma cnr_inv_abst (h) (p) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓛ{p}V.T⦄ → ∧∧ ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ & ⦃G,L.ⓛV⦄ ⊢ ➡[h] 𝐍⦃T⦄. +#h #p #G #L #V1 #T1 #HVT1 @conj +[ #V2 #HV2 lapply (HVT1 (ⓛ{p}V2.T1) ?) -HVT1 /2 width=2 by cpr_pair_sn/ -HV2 #H destruct // +| #T2 #HT2 lapply (HVT1 (ⓛ{p}V1.T2) ?) -HVT1 /2 width=2 by cpm_bind/ -HT2 #H destruct // +] +qed-. + +(* Basic_2A1: was: cnr_inv_abbr *) +lemma cnr_inv_abbr_neg (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃-ⓓV.T⦄ → ∧∧ ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ & ⦃G,L.ⓓV⦄ ⊢ ➡[h] 𝐍⦃T⦄. +#h #G #L #V1 #T1 #HVT1 @conj +[ #V2 #HV2 lapply (HVT1 (-ⓓV2.T1) ?) -HVT1 /2 width=2 by cpr_pair_sn/ -HV2 #H destruct // +| #T2 #HT2 lapply (HVT1 (-ⓓV1.T2) ?) -HVT1 /2 width=2 by cpm_bind/ -HT2 #H destruct // +] +qed-. + +(* Basic_2A1: was: cnr_inv_eps *) +lemma cnr_inv_cast (h) (G) (L): ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓝV.T⦄ → ⊥. +#h #G #L #V #T #H lapply (H T ?) -H +/2 width=4 by cpm_eps, discr_tpair_xy_y/ +qed-. + +(* Basic properties *********************************************************) + +(* Basic_1: was: nf2_sort *) +lemma cnr_sort (h) (G) (L): ∀s. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃⋆s⦄. +#h #G #L #s #X #H +>(cpr_inv_sort1 … H) // +qed. + +lemma cnr_gref (h) (G) (L): ∀l. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃§l⦄. +#h #G #L #l #X #H +>(cpr_inv_gref1 … H) // +qed. + +(* Basic_1: was: nf2_abst *) +lemma cnr_abst (h) (p) (G) (L): + ∀W,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃W⦄ → ⦃G,L.ⓛW⦄ ⊢ ➡[h] 𝐍⦃T⦄ → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓛ{p}W.T⦄. +#h #p #G #L #W #T #HW #HT #X #H +elim (cpm_inv_abst1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct +<(HW … HW0) -W0 <(HT … HT0) -T0 // +qed. + +lemma cnr_abbr_neg (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ → ⦃G,L.ⓓV⦄ ⊢ ➡[h] 𝐍⦃T⦄ → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃-ⓓV.T⦄. +#h #G #L #V #T #HV #HT #X #H +elim (cpm_inv_abbr1 … H) -H * +[ #V0 #T0 #HV0 #HT0 #H destruct + <(HV … HV0) -V0 <(HT … HT0) -T0 // +| #T0 #_ #_ #H destruct +] +qed. + + +(* Basic_1: removed theorems 1: nf2_abst_shift *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_drops.ma new file mode 100644 index 000000000..8d9a8ce0e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_drops.ma @@ -0,0 +1,77 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_transition/cpr_drops.ma". +include "basic_2/rt_transition/cnr.ma". + +(* NORMAL TERMS FOR CONTEXT-SENSITIVE R-TRANSITION **************************) + +(* Advanced properties ******************************************************) + +(* Basic_1: was only: nf2_csort_lref *) +lemma cnr_lref_atom (h) (b) (G) (L): + ∀i. ⬇*[b,𝐔❴i❵] L ≘ ⋆ → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃#i⦄. +#h #b #G #L #i #Hi #X #H +elim (cpr_inv_lref1_drops … H) -H // * #K #V1 #V2 #HLK +lapply (drops_gen b … HLK) -HLK #HLK +lapply (drops_mono … Hi … HLK) -L #H destruct +qed. + +(* Basic_1: was: nf2_lref_abst *) +lemma cnr_lref_abst (h) (G) (L): + ∀K,V,i. ⬇*[i] L ≘ K.ⓛV → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃#i⦄. +#h #G #L #K #V #i #HLK #X #H +elim (cpr_inv_lref1_drops … H) -H // * +#K0 #V1 #V2 #HLK0 #_ #_ +lapply (drops_mono … HLK … HLK0) -L #H destruct +qed. + +lemma cnr_lref_unit (h) (I) (G) (L): + ∀K,i. ⬇*[i] L ≘ K.ⓤ{I} → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃#i⦄. +#h #I #G #L #K #i #HLK #X #H +elim (cpr_inv_lref1_drops … H) -H // * +#K0 #V1 #V2 #HLK0 #_ #_ +lapply (drops_mono … HLK … HLK0) -L #H destruct +qed. + +(* Properties with generic relocation ***************************************) + +(* Basic_1: was: nf2_lift *) +(* Basic_2A1: uses: cnr_lift *) +lemma cnr_lifts (h) (G): d_liftable1 … (cnr h G). +#h #G #K #T #HT #b #f #L #HLK #U #HTU #U0 #H +elim (cpm_inv_lifts_sn … H … HLK … HTU) -b -L #T0 #HTU0 #HT0 +lapply (HT … HT0) -G -K #H destruct /2 width=4 by lifts_mono/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +(* Basic_2A1: was: cnr_inv_delta *) +lemma cnr_inv_lref_abbr (h) (G) (L): + ∀K,V,i. ⬇*[i] L ≘ K.ⓓV → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃#i⦄ → ⊥. +#h #G #L #K #V #i #HLK #H +elim (lifts_total V 𝐔❴↑i❵) #W #HVW +lapply (H W ?) -H [ /3 width=6 by cpm_delta_drops/ ] -HLK #H destruct +elim (lifts_inv_lref2_uni_lt … HVW) -HVW // +qed-. + +(* Inversion lemmas with generic relocation *********************************) + +(* Note: this was missing in Basic_1 *) +(* Basic_2A1: uses: cnr_inv_lift *) +lemma cnr_inv_lifts (h) (G): d_deliftable1 … (cnr h G). +#h #G #L #U #HU #b #f #K #HLK #T #HTU #T0 #H +elim (cpm_lifts_sn … H … HLK … HTU) -b -K #U0 #HTU0 #HU0 +lapply (HU … HU0) -G -L #H destruct /2 width=4 by lifts_inj/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_simple.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_simple.ma new file mode 100644 index 000000000..20039dafe --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_simple.ma @@ -0,0 +1,43 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "basic_2/rt_transition/cpm_simple.ma". +include "basic_2/rt_transition/cnr.ma". + +(* NORMAL TERMS FOR CONTEXT-SENSITIVE R-TRANSITION **************************) + +(* Inversion lemmas with simple terms ***************************************) + +lemma cnr_inv_appl (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓐV.T⦄ → ∧∧ ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ & ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃T⦄ & 𝐒⦃T⦄. +#h #G #L #V1 #T1 #HVT1 @and3_intro +[ #V2 #HV2 lapply (HVT1 (ⓐV2.T1) ?) -HVT1 /2 width=1 by cpr_pair_sn/ -HV2 #H destruct // +| #T2 #HT2 lapply (HVT1 (ⓐV1.T2) ?) -HVT1 /2 width=1 by cpr_flat/ -HT2 #H destruct // +| generalize in match HVT1; -HVT1 elim T1 -T1 * // #a * #W1 #U1 #_ #_ #H + [ elim (lifts_total V1 𝐔❴1❵) #V2 #HV12 + lapply (H (ⓓ{a}W1.ⓐV2.U1) ?) -H /2 width=3 by cpm_theta/ -HV12 #H destruct + | lapply (H (ⓓ{a}ⓝW1.V1.U1) ?) -H /2 width=1 by cpm_beta/ #H destruct + ] +] +qed-. + +(* Properties with simple terms *********************************************) + +(* Basic_1: was only: nf2_appl_lref *) +lemma cnr_appl_simple (h) (G) (L): + ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃T⦄ → 𝐒⦃T⦄ → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓐV.T⦄. +#h #G #L #V #T #HV #HT #HS #X #H +elim (cpm_inv_appl1_simple … H) -H // #V0 #T0 #HV0 #HT0 #H destruct +<(HV … HV0) -V0 <(HT … HT0) -T0 // +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_tdeq.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_tdeq.ma new file mode 100644 index 000000000..00d42e11d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnr_tdeq.ma @@ -0,0 +1,97 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/relocation/lifts_tdeq.ma". +include "basic_2/rt_transition/cpr_drops_basic.ma". +include "basic_2/rt_transition/cnr_simple.ma". +include "basic_2/rt_transition/cnr_drops.ma". + +(* NORMAL TERMS FOR CONTEXT-SENSITIVE R-TRANSITION **************************) + +(* Properties with context-free sort-irrelevant equivalence for terms *******) + +(* Basic_1: was: nf2_dec *) +(* Basic_2A1: uses: cnr_dec *) +lemma cnr_dec_tdeq (h) (G) (L): + ∀T1. ∨∨ ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃T1⦄ + | ∃∃T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 & (T1 ≛ T2 → ⊥). +#h #G #L #T1 +@(fqup_wf_ind_eq (Ⓣ) … G L T1) -G -L -T1 #G0 #L0 #T0 #IH #G #L * * +[ #s #HG #HL #HT destruct -IH + /3 width=4 by cnr_sort, or_introl/ +| #i #HG #HL #HT destruct -IH + elim (drops_F_uni L i) + [ /3 width=6 by cnr_lref_atom, or_introl/ + | * * [ #I | * #V ] #K #HLK + [ /3 width=7 by cnr_lref_unit, or_introl/ + | elim (lifts_total V 𝐔❴↑i❵) #W #HVW + @or_intror @(ex2_intro … W) [ /2 width=6 by cpm_delta_drops/ ] #H + lapply (tdeq_inv_lref1 … H) -H #H destruct + /2 width=5 by lifts_inv_lref2_uni_lt/ + | /3 width=7 by cnr_lref_abst, or_introl/ + ] + ] +| #l #HG #HL #HT destruct -IH + /3 width=4 by cnr_gref, or_introl/ +| #p * [ cases p ] #V1 #T1 #HG #HL #HT destruct + [ elim (cpr_subst h G (L.ⓓV1) T1 0 L V1) [| /2 width=1 by drops_refl/ ] #T2 #X2 #HT12 #HXT2 -IH + elim (tdeq_dec T1 T2) [ -HT12 #HT12 | #HnT12 ] + [ elim (tdeq_inv_lifts_dx … HT12 … HXT2) -T2 #X1 #HXT1 #_ -X2 + @or_intror @(ex2_intro … X1) [ /2 width=3 by cpm_zeta/ ] #H + /2 width=7 by tdeq_lifts_inv_pair_sn/ + | @or_intror @(ex2_intro … (+ⓓV1.T2)) [ /2 width=1 by cpm_bind/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + | elim (IH G L V1) [ elim (IH G (L.ⓓV1) T1) [| * | // ] | * | // ] -IH + [ #HT1 #HV1 /3 width=6 by cnr_abbr_neg, or_introl/ + | #T2 #HT12 #HnT12 #_ + @or_intror @(ex2_intro … (-ⓓV1.T2)) [ /2 width=1 by cpm_bind/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + | #V2 #HV12 #HnV12 + @or_intror @(ex2_intro … (-ⓓV2.T1)) [ /2 width=1 by cpr_pair_sn/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + | elim (IH G L V1) [ elim (IH G (L.ⓛV1) T1) [| * | // ] | * | // ] -IH + [ #HT1 #HV1 /3 width=6 by cnr_abst, or_introl/ + | #T2 #HT12 #HnT12 #_ + @or_intror @(ex2_intro … (ⓛ{p}V1.T2)) [ /2 width=1 by cpm_bind/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + | #V2 #HV12 #HnV12 + @or_intror @(ex2_intro … (ⓛ{p}V2.T1)) [ /2 width=1 by cpr_pair_sn/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + ] +| * #V1 #T1 #HG #HL #HT destruct [| -IH ] + [ elim (IH G L V1) [ elim (IH G L T1) [| * | // ] | * | // ] -IH + [ #HT1 #HV1 + elim (simple_dec_ex T1) [| * #p * #W1 #U1 #H destruct ] + [ /3 width=6 by cnr_appl_simple, or_introl/ + | elim (lifts_total V1 𝐔❴1❵) #X1 #HVX1 + @or_intror @(ex2_intro … (ⓓ{p}W1.ⓐX1.U1)) [ /2 width=3 by cpm_theta/ ] #H + elim (tdeq_inv_pair … H) -H #H destruct + | @or_intror @(ex2_intro … (ⓓ{p}ⓝW1.V1.U1)) [ /2 width=1 by cpm_beta/ ] #H + elim (tdeq_inv_pair … H) -H #H destruct + ] + | #T2 #HT12 #HnT12 #_ + @or_intror @(ex2_intro … (ⓐV1.T2)) [ /2 width=1 by cpm_appl/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + | #V2 #HV12 #HnV12 + @or_intror @(ex2_intro … (ⓐV2.T1)) [ /2 width=1 by cpr_pair_sn/ ] #H + elim (tdeq_inv_pair … H) -H /2 width=1 by/ + ] + | @or_intror @(ex2_intro … T1) [ /2 width=1 by cpm_eps/ ] #H + /2 width=4 by tdeq_inv_pair_xy_y/ + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx.ma index cc2397d0f..a79e8d74e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx.ma @@ -12,33 +12,24 @@ (* *) (**************************************************************************) -include "basic_2/notation/relations/predtynormal_5.ma". +include "basic_2/notation/relations/predtynormal_4.ma". include "static_2/syntax/tdeq.ma". include "basic_2/rt_transition/cpx.ma". (* NORMAL TERMS FOR UNBOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION ********) -definition cnx: ∀h. sd h → relation3 genv lenv term ≝ - λh,o,G,L. NF … (cpx h G L) (tdeq h o …). +definition cnx: ∀h. relation3 genv lenv term ≝ + λh,G,L. NF … (cpx h G L) tdeq. interpretation "normality for unbound context-sensitive parallel rt-transition (term)" - 'PRedTyNormal h o G L T = (cnx h o G L T). + 'PRedTyNormal h G L T = (cnx h G L T). (* Basic inversion lemmas ***************************************************) -lemma cnx_inv_sort: ∀h,o,G,L,s. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃⋆s⦄ → deg h o s 0. -#h #o #G #L #s #H -lapply (H (⋆(next h s)) ?) -H /2 width=2 by cpx_ess/ -G -L #H -elim (tdeq_inv_sort1 … H) -H #s0 #d #H1 #H2 #H destruct -lapply (deg_next … H1) #H0 -lapply (deg_mono … H0 … H2) -H0 -H2 #H ->(pred_inv_fix_sn … H) -H // -qed-. - -lemma cnx_inv_abst: ∀h,o,p,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃ⓛ{p}V.T⦄ → - ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃V⦄ ∧ ⦃G, L.ⓛV⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄. -#h #o #p #G #L #V1 #T1 #HVT1 @conj +lemma cnx_inv_abst: ∀h,p,G,L,V,T. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃ⓛ{p}V.T⦄ → + ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃V⦄ ∧ ⦃G,L.ⓛV⦄ ⊢ ⬈[h] 𝐍⦃T⦄. +#h #p #G #L #V1 #T1 #HVT1 @conj [ #V2 #HV2 lapply (HVT1 (ⓛ{p}V2.T1) ?) -HVT1 /2 width=2 by cpx_pair_sn/ -HV2 | #T2 #HT2 lapply (HVT1 (ⓛ{p}V1.T2) ?) -HVT1 /2 width=2 by cpx_bind/ -HT2 ] @@ -46,9 +37,9 @@ lemma cnx_inv_abst: ∀h,o,p,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃ⓛ{p}V.T qed-. (* Basic_2A1: was: cnx_inv_abbr *) -lemma cnx_inv_abbr_neg: ∀h,o,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃-ⓓV.T⦄ → - ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃V⦄ ∧ ⦃G, L.ⓓV⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄. -#h #o #G #L #V1 #T1 #HVT1 @conj +lemma cnx_inv_abbr_neg: ∀h,G,L,V,T. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃-ⓓV.T⦄ → + ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃V⦄ ∧ ⦃G,L.ⓓV⦄ ⊢ ⬈[h] 𝐍⦃T⦄. +#h #G #L #V1 #T1 #HVT1 @conj [ #V2 #HV2 lapply (HVT1 (-ⓓV2.T1) ?) -HVT1 /2 width=2 by cpx_pair_sn/ -HV2 | #T2 #HT2 lapply (HVT1 (-ⓓV1.T2) ?) -HVT1 /2 width=2 by cpx_bind/ -HT2 ] @@ -56,26 +47,21 @@ lemma cnx_inv_abbr_neg: ∀h,o,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃-ⓓV.T qed-. (* Basic_2A1: was: cnx_inv_eps *) -lemma cnx_inv_cast: ∀h,o,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃ⓝV.T⦄ → ⊥. -#h #o #G #L #V #T #H lapply (H T ?) -H +lemma cnx_inv_cast: ∀h,G,L,V,T. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃ⓝV.T⦄ → ⊥. +#h #G #L #V #T #H lapply (H T ?) -H /2 width=6 by cpx_eps, tdeq_inv_pair_xy_y/ qed-. (* Basic properties *********************************************************) -lemma cnx_sort: ∀h,o,G,L,s. deg h o s 0 → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃⋆s⦄. -#h #o #G #L #s #Hs #X #H elim (cpx_inv_sort1 … H) -H -/3 width=3 by tdeq_sort, deg_next/ -qed. - -lemma cnx_sort_iter: ∀h,o,G,L,s,d. deg h o s d → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃⋆((next h)^d s)⦄. -#h #o #G #L #s #d #Hs lapply (deg_iter … d Hs) -Hs -(tdeq_inv_lref1 … H0) -H0 elim (rpx_inv_zero_pair_sn … H1) -H1 #K1 #X1 #HK01 #HX1 #H destruct @@ -125,46 +125,46 @@ lemma cpx_tdeq_conf_sex: ∀h,o,G. R_confluent2_rex … (cpx h G) (cdeq h o) (cp ] qed-. -lemma cpx_tdeq_conf: ∀h,o,G,L. ∀T0:term. ∀T1. ⦃G, L⦄ ⊢ T0 ⬈[h] T1 → - ∀T2. T0 ≛[h, o] T2 → - ∃∃T. T1 ≛[h, o] T & ⦃G, L⦄ ⊢ T2 ⬈[h] T. -#h #o #G #L #T0 #T1 #HT01 #T2 #HT02 -elim (cpx_tdeq_conf_sex … HT01 … HT02 L … L) -HT01 -HT02 +lemma cpx_tdeq_conf: ∀h,G,L. ∀T0:term. ∀T1. ⦃G,L⦄ ⊢ T0 ⬈[h] T1 → + ∀T2. T0 ≛ T2 → + ∃∃T. T1 ≛ T & ⦃G,L⦄ ⊢ T2 ⬈[h] T. +#h #G #L #T0 #T1 #HT01 #T2 #HT02 +elim (cpx_tdeq_conf_rex … HT01 … HT02 L … L) -HT01 -HT02 /2 width=3 by rex_refl, ex2_intro/ qed-. -lemma tdeq_cpx_trans: ∀h,o,G,L,T2. ∀T0:term. T2 ≛[h, o] T0 → - ∀T1. ⦃G, L⦄ ⊢ T0 ⬈[h] T1 → - ∃∃T. ⦃G, L⦄ ⊢ T2 ⬈[h] T & T ≛[h, o] T1. -#h #o #G #L #T2 #T0 #HT20 #T1 #HT01 +lemma tdeq_cpx_trans: ∀h,G,L,T2. ∀T0:term. T2 ≛ T0 → + ∀T1. ⦃G,L⦄ ⊢ T0 ⬈[h] T1 → + ∃∃T. ⦃G,L⦄ ⊢ T2 ⬈[h] T & T ≛ T1. +#h #G #L #T2 #T0 #HT20 #T1 #HT01 elim (cpx_tdeq_conf … HT01 T2) -HT01 /3 width=3 by tdeq_sym, ex2_intro/ qed-. (* Basic_2A1: uses: cpx_lleq_conf *) -lemma cpx_rdeq_conf: ∀h,o,G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ⬈[h] T1 → - ∀L2. L0 ≛[h, o, T0] L2 → - ∃∃T. ⦃G, L2⦄ ⊢ T0 ⬈[h] T & T1 ≛[h, o] T. -#h #o #G #L0 #T0 #T1 #HT01 #L2 #HL02 -elim (cpx_tdeq_conf_sex … HT01 T0 … L0 … HL02) -HT01 -HL02 +lemma cpx_rdeq_conf: ∀h,G,L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ⬈[h] T1 → + ∀L2. L0 ≛[T0] L2 → + ∃∃T. ⦃G,L2⦄ ⊢ T0 ⬈[h] T & T1 ≛ T. +#h #G #L0 #T0 #T1 #HT01 #L2 #HL02 +elim (cpx_tdeq_conf_rex … HT01 T0 … L0 … HL02) -HT01 -HL02 /2 width=3 by rex_refl, ex2_intro/ qed-. (* Basic_2A1: uses: lleq_cpx_trans *) -lemma rdeq_cpx_trans: ∀h,o,G,L2,L0,T0. L2 ≛[h, o, T0] L0 → - ∀T1. ⦃G, L0⦄ ⊢ T0 ⬈[h] T1 → - ∃∃T. ⦃G, L2⦄ ⊢ T0 ⬈[h] T & T ≛[h, o] T1. -#h #o #G #L2 #L0 #T0 #HL20 #T1 #HT01 -elim (cpx_rdeq_conf … o … HT01 L2) -HT01 +lemma rdeq_cpx_trans: ∀h,G,L2,L0,T0. L2 ≛[T0] L0 → + ∀T1. ⦃G,L0⦄ ⊢ T0 ⬈[h] T1 → + ∃∃T. ⦃G,L2⦄ ⊢ T0 ⬈[h] T & T ≛ T1. +#h #G #L2 #L0 #T0 #HL20 #T1 #HT01 +elim (cpx_rdeq_conf … HT01 L2) -HT01 /3 width=3 by rdeq_sym, tdeq_sym, ex2_intro/ qed-. -lemma rpx_rdeq_conf: ∀h,o,G,T. confluent2 … (rpx h G T) (rdeq h o T). -/3 width=6 by rpx_fsge_comp, rdeq_fsge_comp, cpx_tdeq_conf_sex, rex_conf/ qed-. +lemma rpx_rdeq_conf: ∀h,G,T. confluent2 … (rpx h G T) (rdeq T). +/3 width=6 by rpx_fsge_comp, rdeq_fsge_comp, cpx_tdeq_conf_rex, rex_conf/ qed-. -lemma rdeq_rpx_trans: ∀h,o,G,T,L2,K2. ⦃G, L2⦄ ⊢ ⬈[h, T] K2 → - ∀L1. L1 ≛[h, o, T] L2 → - ∃∃K1. ⦃G, L1⦄ ⊢ ⬈[h, T] K1 & K1 ≛[h, o, T] K2. -#h #o #G #T #L2 #K2 #HLK2 #L1 #HL12 -elim (rpx_rdeq_conf … o … HLK2 L1) +lemma rdeq_rpx_trans: ∀h,G,T,L2,K2. ⦃G,L2⦄ ⊢ ⬈[h,T] K2 → + ∀L1. L1 ≛[T] L2 → + ∃∃K1. ⦃G,L1⦄ ⊢ ⬈[h,T] K1 & K1 ≛[T] K2. +#h #G #T #L2 #K2 #HLK2 #L1 #HL12 +elim (rpx_rdeq_conf … HLK2 L1) /3 width=3 by rdeq_sym, ex2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_rpx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_rpx.ma index 56899e45d..8b6716c10 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_rpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_rpx.ma @@ -19,16 +19,16 @@ include "basic_2/rt_transition/rpx.ma". (* Main properties **********************************************************) -theorem rpx_bind: ∀h,G,L1,L2,V1. ⦃G, L1⦄ ⊢ ⬈[h, V1] L2 → - ∀I,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ⬈[h, T] L2.ⓑ{I}V2 → - ∀p. ⦃G, L1⦄ ⊢ ⬈[h, ⓑ{p,I}V1.T] L2. +theorem rpx_bind: ∀h,G,L1,L2,V1. ⦃G,L1⦄ ⊢ ⬈[h,V1] L2 → + ∀I,V2,T. ⦃G,L1.ⓑ{I}V1⦄ ⊢ ⬈[h,T] L2.ⓑ{I}V2 → + ∀p. ⦃G,L1⦄ ⊢ ⬈[h,ⓑ{p,I}V1.T] L2. /2 width=2 by rex_bind/ qed. -theorem rpx_flat: ∀h,G,L1,L2,V. ⦃G, L1⦄ ⊢ ⬈[h, V] L2 → - ∀I,T. ⦃G, L1⦄ ⊢ ⬈[h, T] L2 → ⦃G, L1⦄ ⊢ ⬈[h, ⓕ{I}V.T] L2. +theorem rpx_flat: ∀h,G,L1,L2,V. ⦃G,L1⦄ ⊢ ⬈[h,V] L2 → + ∀I,T. ⦃G,L1⦄ ⊢ ⬈[h,T] L2 → ⦃G,L1⦄ ⊢ ⬈[h,ⓕ{I}V.T] L2. /2 width=1 by rex_flat/ qed. -theorem rpx_bind_void: ∀h,G,L1,L2,V. ⦃G, L1⦄ ⊢ ⬈[h, V] L2 → - ∀T. ⦃G, L1.ⓧ⦄ ⊢ ⬈[h, T] L2.ⓧ → - ∀p,I. ⦃G, L1⦄ ⊢ ⬈[h, ⓑ{p,I}V.T] L2. +theorem rpx_bind_void: ∀h,G,L1,L2,V. ⦃G,L1⦄ ⊢ ⬈[h,V] L2 → + ∀T. ⦃G,L1.ⓧ⦄ ⊢ ⬈[h,T] L2.ⓧ → + ∀p,I. ⦃G,L1⦄ ⊢ ⬈[h,ⓑ{p,I}V.T] L2. /2 width=1 by rex_bind_void/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2.ldw.xml b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2.ldw.xml index 66fb5e30c..1be3304c9 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2.ldw.xml +++ b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2.ldw.xml @@ -27,8 +27,26 @@

Stage "B" + + Applicability condition is now parametrized + with a generic subset of numbers. + + + Applicability condition parametrized + with an initial interval of numbers + allows λδ-2B to generalize both λδ-2A and λδ-1B. + + + Extended (λδ-2A) and restricted (λδ-1B) validity is decidable + (anniversary milestone). + + + Preservation of validity for rt-computation + does not need the sort degree parameter + (i.e. no induction on the degree). + - Extended (λδ-2) and restricted (λδ-1) type rules justified. + Extended (λδ-2A) and restricted (λδ-1A) type rules justified. λδ-2A completed with diff --git a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl index 850588ce1..4176396a0 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl +++ b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl @@ -12,7 +12,7 @@ table { class "wine" [ { "iterated dynamic typing" * } { [ { "context-sensitive iterated native type assignment" * } { - [ [ "for terms" ] "ntas" + "( ⦃?,?⦄ ⊢ ? :[?,?,?] ? )" + "( ⦃?,?⦄ ⊢ ? :[?,?] ? )" + "( ⦃?,?⦄ ⊢ ? :*[?,?] ? )" * ] + [ [ "for terms" ] "ntas" + "( ⦃?,?⦄ ⊢ ? :*[?,?,?] ? )" "ntas_nta" + "ntas_preserve" * ] } ] } @@ -20,12 +20,12 @@ table { class "magenta" [ { "dynamic typing" * } { [ { "context-sensitive native type assignment" * } { - [ [ "for terms" ] "nta" + "( ⦃?,?⦄ ⊢ ? :[?,?] ? )" + "( ⦃?,?⦄ ⊢ ? :[?] ? )" + "( ⦃?,?⦄ ⊢ ? :*[?] ? )" "nta_drops" + "nta_aaa" + "nta_fsb" + "nta_cpms" + "nta_cpcs" + "nta_preserve" + "nta_preserve_cpcs" + "nta_ind" * ] + [ [ "for terms" ] "nta" + "( ⦃?,?⦄ ⊢ ? :[?,?] ? )" "nta_drops" + "nta_aaa" + "nta_fsb" + "nta_cpms" + "nta_cpcs" + "nta_preserve" + "nta_preserve_cpcs" + "nta_ind" + "nta_eval" * ] } ] [ { "context-sensitive native validity" * } { [ [ "restricted refinement for lenvs" ] "lsubv ( ? ⊢ ? ⫃![?,?] ? )" "lsubv_drops" + "lsubv_lsubr" + "lsubv_lsuba" + "lsubv_cpms" + "lsubv_cpcs" + "lsubv_cnv" + "lsubv_lsubv" * ] - [ [ "for terms" ] "cnv" + "( ⦃?,?⦄ ⊢ ? ![?,?] )" + "( ⦃?,?⦄ ⊢ ? ![?] )" + "( ⦃?,?⦄ ⊢ ? !*[?] )" "cnv_drops" + "cnv_fqus" + "cnv_aaa" + "cnv_fsb" + "cnv_cpm_trans" + "cnv_cpm_conf" + "cnv_cpm_tdeq" + "cnv_cpm_tdeq_trans" + "cnv_cpm_tdeq_conf" + "cnv_cpms_tdeq" + "cnv_cpms_conf" + "cnv_cpms_tdeq_conf" + "cnv_cpcs" + "cnv_preserve_sub" + "cnv_preserve" * ] + [ [ "for terms" ] "cnv" + "( ⦃?,?⦄ ⊢ ? ![?,?] )" "cnv_acle" + "cnv_drops" + "cnv_fqus" + "cnv_aaa" + "cnv_fsb" + "cnv_cpm_trans" + "cnv_cpm_conf" + "cnv_cpm_tdeq" + "cnv_cpm_tdeq_trans" + "cnv_cpm_tdeq_conf" + "cnv_cpms_tdeq" + "cnv_cpms_conf" + "cnv_cpms_tdeq_conf" + "cnv_cpme" + "cnv_cpmuwe" + "cnv_cpmuwe_cpme" + "cnv_eval" + "cnv_cpce" + "cnv_cpes" + "cnv_cpcs" + "cnv_preserve_sub" + "cnv_preserve" + "cnv_preserve_cpes" + "cnv_preserve_cpcs" * ] } ] } @@ -33,7 +33,11 @@ table { class "prune" [ { "rt-equivalence" * } { [ { "context-sensitive parallel r-equivalence" * } { - [ [ "for terms" ] "cpcs ( ⦃?,?⦄ ⊢ ? ⬌*[?] ? )" "cpcs_drops" + "cpcs_lsubr" + "cpcs_aaa" + "cpcs_cprs" + "cpcs_lprs" + "cpcs_cpc" + "cpcs_cpcs" * ] + [ [ "for terms" ] "cpcs ( ⦃?,?⦄ ⊢ ? ⬌*[?] ? )" "cpcs_drops" + "cpcs_lsubr" + "cpcs_aaa" + "cpcs_csx" + "cpcs_cprs" + "cpcs_lprs" + "cpcs_cpc" + "cpcs_cpcs" * ] + } + ] + [ { "t-bound context-sensitive parallel rt-equivalence" * } { + [ [ "for terms" ] "cpes ( ⦃?,?⦄ ⊢ ? ⬌*[?,?,?] ? )" "cpes_aaa" + "cpes_cpms" + "cpes_cpes" * ] } ] } @@ -43,7 +47,7 @@ table { [ { "context-sensitive parallel eta-conversion" * } { [ [ "for lenvs on all entries" ] "lpce ( ⦃?,?⦄ ⊢ ⬌η[?] ? )" * ] [ [ "for binders" ] "cpce_ext" + "( ⦃?,?⦄ ⊢ ? ⬌η[?] ? )" * ] - [ [ "for terms" ] "cpce" + "( ⦃?,?⦄ ⊢ ? ⬌η[?] ? )" * ] + [ [ "for terms" ] "cpce" + "( ⦃?,?⦄ ⊢ ? ⬌η[?] ? )" "cpce_drops" * ] } ] [ { "context-sensitive parallel r-conversion" * } { @@ -55,56 +59,61 @@ table { class "sky" [ { "rt-computation" * } { [ { "context-sensitive parallel r-computation" * } { + [ [ "evaluation for terms" ] "cpre ( ⦃?,?⦄ ⊢ ? ➡*[?] 𝐍⦃?⦄ )" "cpre_csx" + "cpre_cpms" + "cpre_cpre" * ] [ [ "for lenvs on all entries" ] "lprs ( ⦃?,?⦄ ⊢ ➡*[?] ? )" "lprs_tc" + "lprs_ctc" + "lprs_length" + "lprs_drops" + "lprs_aaa" + "lprs_lpr" + "lprs_lpxs" + "lprs_cpms" + "lprs_cprs" + "lprs_lprs" * ] [ [ "for binders" ] "cprs_ext" + "( ⦃?,?⦄ ⊢ ? ➡*[?] ?)" * ] - [ [ "for terms" ] "cprs" + "( ⦃?,?⦄ ⊢ ? ➡*[?] ?)" "cprs_ctc" + "cprs_drops" + "cprs_cpr" + "cprs_lpr" + "cprs_cprs" * ] + [ [ "for terms" ] "cprs" + "( ⦃?,?⦄ ⊢ ? ➡*[?] ?)" "cprs_ctc" + "cprs_tweq" + "cprs_drops" + "cprs_cpr" + "cprs_lpr" + "cprs_cnr" + "cprs_cprs" * ] } ] [ { "t-bound context-sensitive parallel rt-computation" * } { + [ [ "t-unbound whd evaluation for terms" ] "cpmuwe ( ⦃?,?⦄ ⊢ ? ⬌*𝐍𝐖*[?,?] ? )" "cpmuwe_csx" + "cpmuwe_cpmuwe" * ] + [ [ "t-unbound whd normal form for terms" ] "cnuw ( ⦃?,?⦄ ⊢ ⬌𝐍𝐖*[?] ? )" "cnuw_drops" + "cnuw_simple" + "cnuw_cnuw" * ] + [ [ "t-bpund evaluation for terms" ] "cpme ( ⦃?,?⦄ ⊢ ? ➡*[?,?] 𝐍⦃?⦄ )" "cpme_aaa" * ] [ [ "for terms" ] "cpms" + "( ⦃?,?⦄ ⊢ ? ➡*[?,?] ? )" "cpms_drops" + "cpms_lsubr" + "cpms_rdeq" + "cpms_aaa" + "cpms_lpr" + "cpms_cpxs" + "cpms_fpbs" + "cpms_fpbg" + "cpms_cpms" * ] } ] [ { "unbound context-sensitive parallel rst-computation" * } { - [ [ "strongly normalizing for closures" ] "fsb" + "( ≥[?,?] 𝐒⦃?,?,?⦄ )" "fsb_fdeq" + "fsb_aaa" + "fsb_csx" + "fsb_fpbg" * ] - [ [ "proper for closures" ] "fpbg" + "( ⦃?,?,?⦄ >[?,?] ⦃?,?,?⦄ )" "fpbg_fqup" + "fpbg_cpxs" + "fpbg_lpxs" + "fpbg_fpbs" + "fpbg_fpbg" * ] - [ [ "for closures" ] "fpbs" + "( ⦃?,?,?⦄ ≥[?,?] ⦃?,?,?⦄ )" "fpbs_fqup" + "fpbs_fqus" + "fpbs_aaa" + "fpbs_cpx" + "fpbs_fpb" + "fpbs_cpxs" + "fpbs_lpxs" + "fpbs_csx" + "fpbs_fpbs" * ] + [ [ "strongly normalizing for closures" ] "fsb" + "( ≥[?] 𝐒⦃?,?,?⦄ )" "fsb_fdeq" + "fsb_aaa" + "fsb_csx" + "fsb_fpbg" * ] + [ [ "proper for closures" ] "fpbg" + "( ⦃?,?,?⦄ >[?] ⦃?,?,?⦄ )" "fpbg_fqup" + "fpbg_cpxs" + "fpbg_lpxs" + "fpbg_fpbs" + "fpbg_fpbg" * ] + [ [ "for closures" ] "fpbs" + "( ⦃?,?,?⦄ ≥[?] ⦃?,?,?⦄ )" "fpbs_fqup" + "fpbs_fqus" + "fpbs_aaa" + "fpbs_cpx" + "fpbs_fpb" + "fpbs_cpxs" + "fpbs_lpxs" + "fpbs_csx" + "fpbs_fpbs" * ] } ] [ { "unbound context-sensitive parallel rt-computation" * } { - [ [ "refinement for lenvs on selected entries" ] "lsubsx" + "( ? ⊢ ? ⊆ⓧ[?,?,?] ? )" "lsubsx_lfsx" + "lsubsx_lsubsx" * ] - [ [ "strongly normalizing for lenvs on referred entries" ] "rdsx" + "( ? ⊢ ⬈*[?,?,?] 𝐒⦃?⦄ )" "rdsx_length" + "rdsx_drops" + "rdsx_fqup" + "rdsx_cpxs" + "rdsx_csx" + "rdsx_rdsx" * ] - [ [ "strongly normalizing for term vectors" ] "csx_vector" + "( ⦃?,?⦄ ⊢ ⬈*[?,?] 𝐒⦃?⦄ )" "csx_cnx_vector" + "csx_csx_vector" * ] - [ [ "strongly normalizing for terms" ] "csx" + "( ⦃?,?⦄ ⊢ ⬈*[?,?] 𝐒⦃?⦄ )" "csx_simple" + "csx_simple_theq" + "csx_drops" + "csx_fqus" + "csx_lsubr" + "csx_rdeq" + "csx_fdeq" + "csx_aaa" + "csx_gcp" + "csx_gcr" + "csx_lpx" + "csx_cnx" + "csx_fpbq" + "csx_cpxs" + "csx_lpxs" + "csx_csx" * ] + [ [ "compatibility for lenvs" ] "jsx" + "( ? ⊢ ? ⊒[?] ? )" "jsx_drops" + "jsx_lsubr" + "jsx_csx" + "jsx_rsx" + "jsx_jsx" * ] + [ [ "strongly normalizing for lenvs on referred entries" ] "rsx" + "( ? ⊢ ⬈*[?,?] 𝐒⦃?⦄ )" "rsx_length" + "rsx_drops" + "rsx_fqup" + "rsx_cpxs" + "rsx_csx" + "rsx_rsx" * ] + [ [ "strongly normalizing for term vectors" ] "csx_vector" + "( ⦃?,?⦄ ⊢ ⬈*[?] 𝐒⦃?⦄ )" "csx_cnx_vector" + "csx_csx_vector" * ] + [ [ "strongly normalizing for terms" ] "csx" + "( ⦃?,?⦄ ⊢ ⬈*[?] 𝐒⦃?⦄ )" "csx_simple" + "csx_simple_toeq" + "csx_drops" + "csx_fqus" + "csx_lsubr" + "csx_rdeq" + "csx_fdeq" + "csx_aaa" + "csx_gcp" + "csx_gcr" + "csx_lpx" + "csx_cnx" + "csx_fpbq" + "csx_cpxs" + "csx_lpxs" + "csx_csx" * ] [ [ "for lenvs on all entries" ] "lpxs" + "( ⦃?,?⦄ ⊢ ⬈*[?] ? )" "lpxs_length" + "lpxs_drops" + "lpxs_rdeq" + "lpxs_fdeq" + "lpxs_aaa" + "lpxs_lpx" + "lpxs_cpxs" + "lpxs_lpxs" * ] [ [ "for binders" ] "cpxs_ext" + "( ⦃?,?⦄ ⊢ ? ⬈*[?] ? )" * ] - [ [ "for terms" ] "cpxs" + "( ⦃?,?⦄ ⊢ ? ⬈*[?] ? )" "cpxs_tdeq" + "cpxs_theq" + "cpxs_theq_vector" + "cpxs_drops" + "cpxs_fqus" + "cpxs_lsubr" + "cpxs_rdeq" + "cpxs_fdeq" + "cpxs_aaa" + "cpxs_lpx" + "cpxs_cnx" + "cpxs_cpxs" * ] + [ [ "for terms" ] "cpxs" + "( ⦃?,?⦄ ⊢ ? ⬈*[?] ? )" "cpxs_tdeq" + "cpxs_toeq" + "cpxs_toeq_vector" + "cpxs_drops" + "cpxs_fqus" + "cpxs_lsubr" + "cpxs_rdeq" + "cpxs_fdeq" + "cpxs_aaa" + "cpxs_lpx" + "cpxs_cnx" + "cpxs_cpxs" * ] } ] } ] class "cyan" [ { "rt-transition" * } { - [ { "unbound parallel rst-transition" * } { - [ [ "for closures" ] "fpbq" + "( ⦃?,?,?⦄ ≽[?,?] ⦃?,?,?⦄ )" "fpbq_aaa" + "fpbq_fpb" * ] - [ [ "proper for closures" ] "fpb" + "( ⦃?,?,?⦄ ≻[?,?] ⦃?,?,?⦄ )" "fpb_rdeq" + "fpb_fdeq" * ] - } - ] [ { "context-sensitive parallel r-transition" * } { + [ [ "normal form for terms" ] "cnr ( ⦃?,?⦄ ⊢ ➡[?] 𝐍⦃?⦄ )" "cnr_simple" + "cnr_tdeq" + "cnr_drops" * ] [ [ "for lenvs on all entries" ] "lpr" + "( ⦃?,?⦄ ⊢ ➡[?] ? )" "lpr_length" + "lpr_drops" + "lpr_fquq" + "lpr_aaa" + "lpr_lpx" + "lpr_lpr" * ] [ [ "for binders" ] "cpr_ext" + "( ⦃?,?⦄ ⊢ ? ➡[?] ? )" * ] - [ [ "for terms" ] "cpr" + "( ⦃?,?⦄ ⊢ ? ➡[?] ? )" "cpr_drops" + "cpr_cpr" * ] + [ [ "for terms" ] "cpr" + "( ⦃?,?⦄ ⊢ ? ➡[?] ? )" "cpr_drops" + "cpr_drops_basic" + "cpr_tdeq" + "cpr_cpr" * ] } ] [ { "t-bound context-sensitive parallel rt-transition" * } { [ [ "for terms" ] "cpm" + "( ⦃?,?⦄ ⊢ ? ➡[?,?] ? )" "cpm_simple" + "cpm_tdeq" + "cpm_drops" + "cpm_lsubr" + "cpm_fsle" + "cpm_aaa" + "cpm_cpx" * ] } ] + [ { "unbound parallel rst-transition" * } { + [ [ "for closures" ] "fpbq" + "( ⦃?,?,?⦄ ≽[?] ⦃?,?,?⦄ )" "fpbq_aaa" + "fpbq_fpb" * ] + [ [ "proper for closures" ] "fpb" + "( ⦃?,?,?⦄ ≻[?] ⦃?,?,?⦄ )" "fpb_rdeq" + "fpb_fdeq" * ] + } + ] [ { "unbound context-sensitive parallel rt-transition" * } { - [ [ "normal form for terms" ] "cnx" + "( ⦃?,?⦄ ⊢ ⬈[?,?] 𝐍⦃?⦄ )" "cnx_simple" + "cnx_drops" + "cnx_cnx" * ] + [ [ "normal form for terms" ] "cnx" + "( ⦃?,?⦄ ⊢ ⬈[?] 𝐍⦃?⦄ )" "cnx_simple" + "cnx_drops" + "cnx_basic" + "cnx_cnx" * ] [ [ "for lenvs on referred entries" ] "rpx" + "( ⦃?,?⦄ ⊢ ⬈[?,?] ? )" "rpx_length" + "rpx_drops" + "rpx_fqup" + "rpx_fsle" + "rpx_rdeq" + "rpx_lpx" + "rpx_rpx" * ] [ [ "for lenvs on all entries" ] "lpx" + "( ⦃?,?⦄ ⊢ ⬈[?] ? )" "lpx_length" + "lpx_drops" + "lpx_fquq" + "lpx_fsle" + "lpx_rdeq" + "lpx_aaa" * ] [ [ "for binders" ] "cpx_ext" + "( ⦃?,?⦄ ⊢ ? ⬈[?] ? )" * ] - [ [ "for terms" ] "cpx" + "( ⦃?,?⦄ ⊢ ? ⬈[?] ? )" "cpx_simple" + "cpx_drops" + "cpx_fqus" + "cpx_lsubr" + "cpx_req" + "cpx_rdeq" + "cpx_fdeq" * ] + [ [ "for terms" ] "cpx" + "( ⦃?,?⦄ ⊢ ? ⬈[?] ? )" "cpx_simple" + "cpx_drops" + "cpx_drops_basic" + "cpx_fqus" + "cpx_lsubr" + "cpx_req" + "cpx_rdeq" + "cpx_fdeq" * ] } ] [ { "bound context-sensitive parallel rt-transition" * } { @@ -128,7 +137,7 @@ class "italic" { 2 } ] [ [ "" ] "shnv ( ⦃?,?⦄ ⊢ ? ¡[?,?,?] )" * ] [ { "decomposed rt-equivalence" * } { - [ [ "" ] "scpes ( ⦃?,?⦄ ⊢ ? •*⬌*[?,?,?,?] ? )" "scpes_aaa" + "scpes_cpcs" + "scpes_scpes" * ] + "scpes_cpcs" + "scpes_scpes" } ] [ [ "for lenvs on referred entries" ] "rpxs" + "( ⦃?,?⦄ ⊢ ⬈*[?,?] ? )" "rpxs_length" + "rpxs_drops" + "rpxs_fqup" + "rpxs_rdeq" + "rpxs_fdeq" + "rpxs_aaa" + "rpxs_cpxs" + "rpxs_lpxs" + "rpxs_rpxs" * ] @@ -138,10 +147,6 @@ class "italic" { 2 } [ [ "" ] "cpxe ( ⦃?,?⦄ ⊢ ➡*[?,?] 𝐍⦃?⦄ )" * ] } ] - [ { "evaluation for context-sensitive reduction" * } { - [ [ "" ] "cpre ( ⦃?,?⦄ ⊢ ➡* 𝐍⦃?⦄ )" "cpre_cpre" * ] - } - ] [ { "normal forms for context-sensitive rt-reduction" * } { [ [ "" ] "cnx_crx" + "cnx_cix" * ] } @@ -155,7 +160,7 @@ class "italic" { 2 } } ] [ { "normal forms for context-sensitive reduction" * } { - [ [ "" ] "cnr ( ⦃?,?⦄ ⊢ ➡ 𝐍⦃?⦄ )" "cnr_lift" + "cnr_crr" + "cnr_cir" * ] + "cnr_crr" + "cnr_cir" } ] [ { "irreducible forms for context-sensitive reduction" * } { diff --git a/matita/matita/contribs/lambdadelta/compile_partial.sh b/matita/matita/contribs/lambdadelta/compile_partial.sh index 817d68bc0..13afbaf04 100644 --- a/matita/matita/contribs/lambdadelta/compile_partial.sh +++ b/matita/matita/contribs/lambdadelta/compile_partial.sh @@ -1 +1,4 @@ -../../matitac.opt `cat partial.txt` +../../matitac.opt ground_2 +../../matitac.opt static_2 +../../matitac.opt basic_2 +../../matitac.opt apps_2 diff --git a/matita/matita/contribs/lambdadelta/ground_2/etc/lib/arith.etc b/matita/matita/contribs/lambdadelta/ground_2/etc/lib/arith.etc index 1af2859d7..11ef739da 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/etc/lib/arith.etc +++ b/matita/matita/contribs/lambdadelta/ground_2/etc/lib/arith.etc @@ -30,3 +30,7 @@ lemma false_lt_to_le: ∀x,y. (x < y → ⊥) → y ≤ x. #x #y #H elim (decidable_lt x y) /2 width=1 by not_lt_to_le/ #Hxy elim (H Hxy) qed-. + +lemma arith_m2 (x) (y): x < y → x+(y-↑x) = ↓y. +#x #y #Hxy >minus_minus [|*: // ] (S_pred … Hm) @@ -158,6 +169,15 @@ qed-. lemma lt_le_false: ∀x,y. x < y → y ≤ x → ⊥. /3 width=4 by lt_refl_false, lt_to_le_to_lt/ qed-. +lemma le_dec (n) (m): Decidable (n≤m). +#n elim n -n [ /2 width=1 by or_introl/ ] +#n #IH * [ /3 width=2 by lt_zero_false, or_intror/ ] +#m elim (IH m) -IH +[ /3 width=1 by or_introl, le_S_S/ +| /4 width=1 by or_intror, le_S_S_to_le/ +] +qed-. + lemma succ_inv_refl_sn: ∀x. ↑x = x → ⊥. #x #H @(lt_le_false x (↑x)) // qed-. @@ -322,3 +342,34 @@ lemma tri_gt: ∀A,a1,a2,a3,n1,n2. n2 < n1 → tri A n1 n2 a1 a2 a3 = a3. | #n1 #IH #n2 elim n2 -n2 /3 width=1 by monotonic_lt_pred/ ] qed. + +(* Decidability of predicates ***********************************************) + +lemma dec_lt (R:predicate nat): + (∀n. Decidable … (R n)) → + ∀n. Decidable … (∃∃m. m < n & R m). +#R #HR #n elim n -n [| #n * ] +[ @or_intror * /2 width=2 by lt_zero_false/ +| * /4 width=3 by lt_S, or_introl, ex2_intro/ +| #H0 elim (HR n) -HR + [ /3 width=3 by or_introl, ex2_intro/ + | #Hn @or_intror * #m #Hmn #Hm + elim (le_to_or_lt_eq … Hmn) -Hmn #H destruct [ -Hn | -H0 ] + /4 width=3 by lt_S_S_to_lt, ex2_intro/ + ] +] +qed-. + +lemma dec_min (R:predicate nat): + (∀n. Decidable … (R n)) → ∀n. R n → + ∃∃m. m ≤ n & R m & (∀p. p < m → R p → ⊥). +#R #HR #n +@(nat_elim1 n) -n #n #IH #Hn +elim (dec_lt … HR n) -HR [ -Hn | -IH ] +[ * #p #Hpn #Hp + elim (IH … Hpn Hp) -IH -Hp #m #Hmp #Hm #HNm + @(ex3_intro … Hm HNm) -HNm + /3 width=3 by lt_to_le, le_to_lt_to_lt/ +| /4 width=4 by ex3_intro, ex2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/list_eq.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/list_eq.ma new file mode 100644 index 000000000..d1b2be454 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/list_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_2/notation/relations/ringeq_3.ma". +include "ground_2/lib/list.ma". + +(* EXTENSIONAL EQUIVALENCE OF LISTS *****************************************) + +rec definition eq_list A (l1,l2:list A) on l1 ≝ +match l1 with +[ nil ⇒ + match l2 with + [ nil ⇒ ⊤ + | cons _ _ ⇒ ⊥ + ] +| cons a1 l1 ⇒ + match l2 with + [ nil ⇒ ⊥ + | cons a2 l2 ⇒ a1 = a2 ∧ eq_list A l1 l2 + ] +]. + +interpretation "extensional equivalence (list)" + 'RingEq A l1 l2 = (eq_list A l1 l2). + +(* Basic properties *********************************************************) + +lemma eq_list_refl (A): reflexive … (eq_list A). +#A #l elim l -l /2 width=1 by conj/ +qed. + +(* Main properties **********************************************************) + +theorem eq_eq_list (A,l1,l2): l1 = l2 → l1 ≗{A} l2. +// qed. + +(* Main inversion propertiess ***********************************************) + +theorem eq_list_inv_eq (A,l1,l2): l1 ≗{A} l2 → l1 = l2. +#A #l1 elim l1 -l1 [| #a1 #l1 #IH ] * +[ // +| #a2 #l2 #H elim H +| #H elim H +| #a2 #l2 * #Ha #Hl /3 width=1 by eq_f2/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma index fa8bae343..d272c0dbe 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma @@ -18,7 +18,7 @@ include "ground_2/lib/logic.ma". (* GENERIC RELATIONS ********************************************************) definition replace_2 (A) (B): relation3 (relation2 A B) (relation A) (relation B) ≝ - λR,Sa,Sb. ∀a1,b1. R a1 b1 → ∀a2. Sa a1 a2 → ∀b2. Sb b1 b2 → R a2 b2. + λR,Sa,Sb. ∀a1,b1. R a1 b1 → ∀a2. Sa a1 a2 → ∀b2. Sb b1 b2 → R a2 b2. (* Inclusion ****************************************************************) @@ -36,81 +36,93 @@ interpretation "3-relation inclusion" (* Properties of relations **************************************************) -definition relation5: Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] -≝ λA,B,C,D,E.A→B→C→D→E→Prop. +definition relation5: Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] ≝ + λA,B,C,D,E.A→B→C→D→E→Prop. -definition relation6: Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] -≝ λA,B,C,D,E,F.A→B→C→D→E→F→Prop. +definition relation6: Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] ≝ + λA,B,C,D,E,F.A→B→C→D→E→F→Prop. -(**) (* we dont use "∀a. reflexive … (R a)" since auto seems to dislike repeatd δ-expansion *) +(**) (* we don't use "∀a. reflexive … (R a)" since auto seems to dislike repeatd δ-expansion *) definition c_reflexive (A) (B): predicate (relation3 A B B) ≝ - λR. ∀a,b. R a b b. + λR. ∀a,b. R a b b. definition Decidable: Prop → Prop ≝ λR. R ∨ (R → ⊥). -definition Transitive: ∀A. ∀R: relation A. Prop ≝ λA,R. - ∀a1,a0. R a1 a0 → ∀a2. R a0 a2 → R a1 a2. +definition Transitive (A) (R:relation A): Prop ≝ + ∀a1,a0. R a1 a0 → ∀a2. R a0 a2 → R a1 a2. -definition left_cancellable: ∀A. ∀R: relation A. Prop ≝ λA,R. - ∀a0,a1. R a0 a1 → ∀a2. R a0 a2 → R a1 a2. +definition left_cancellable (A) (R:relation A): Prop ≝ + ∀a0,a1. R a0 a1 → ∀a2. R a0 a2 → R a1 a2. -definition right_cancellable: ∀A. ∀R: relation A. Prop ≝ λA,R. - ∀a1,a0. R a1 a0 → ∀a2. R a2 a0 → R a1 a2. +definition right_cancellable (A) (R:relation A): Prop ≝ + ∀a1,a0. R a1 a0 → ∀a2. R a2 a0 → R a1 a2. -definition pw_confluent2: ∀A. relation A → relation A → predicate A ≝ λA,R1,R2,a0. - ∀a1. R1 a0 a1 → ∀a2. R2 a0 a2 → - ∃∃a. R2 a1 a & R1 a2 a. +definition pw_confluent2 (A) (R1,R2:relation A): predicate A ≝ + λa0. + ∀a1. R1 a0 a1 → ∀a2. R2 a0 a2 → + ∃∃a. R2 a1 a & R1 a2 a. -definition confluent2: ∀A. relation (relation A) ≝ λA,R1,R2. - ∀a0. pw_confluent2 A R1 R2 a0. +definition confluent2 (A): relation (relation A) ≝ + λR1,R2. + ∀a0. pw_confluent2 A R1 R2 a0. -definition transitive2: ∀A. ∀R1,R2: relation A. Prop ≝ λA,R1,R2. - ∀a1,a0. R1 a1 a0 → ∀a2. R2 a0 a2 → - ∃∃a. R2 a1 a & R1 a a2. +definition transitive2 (A) (R1,R2:relation A): Prop ≝ + ∀a1,a0. R1 a1 a0 → ∀a2. R2 a0 a2 → + ∃∃a. R2 a1 a & R1 a a2. -definition bi_confluent: ∀A,B. ∀R: bi_relation A B. Prop ≝ λA,B,R. - ∀a0,a1,b0,b1. R a0 b0 a1 b1 → ∀a2,b2. R a0 b0 a2 b2 → - ∃∃a,b. R a1 b1 a b & R a2 b2 a b. +definition bi_confluent (A) (B) (R: bi_relation A B): Prop ≝ + ∀a0,a1,b0,b1. R a0 b0 a1 b1 → ∀a2,b2. R a0 b0 a2 b2 → + ∃∃a,b. R a1 b1 a b & R a2 b2 a b. -definition lsub_trans: ∀A,B. relation2 (A→relation B) (relation A) ≝ λA,B,R1,R2. - ∀L2,T1,T2. R1 L2 T1 T2 → ∀L1. R2 L1 L2 → R1 L1 T1 T2. +definition lsub_trans (A) (B): relation2 (A→relation B) (relation A) ≝ + λR1,R2. + ∀L2,T1,T2. R1 L2 T1 T2 → ∀L1. R2 L1 L2 → R1 L1 T1 T2. -definition s_r_confluent1: ∀A,B. relation2 (A→relation B) (B→relation A) ≝ λA,B,R1,R2. - ∀L1,T1,T2. R1 L1 T1 T2 → ∀L2. R2 T1 L1 L2 → R2 T2 L1 L2. +definition s_r_confluent1 (A) (B): relation2 (A→relation B) (B→relation A) ≝ + λR1,R2. + ∀L1,T1,T2. R1 L1 T1 T2 → ∀L2. R2 T1 L1 L2 → R2 T2 L1 L2. -definition is_mono: ∀B:Type[0]. predicate (predicate B) ≝ - λB,R. ∀b1. R b1 → ∀b2. R b2 → b1 = b2. +definition is_mono (B:Type[0]): predicate (predicate B) ≝ + λR. ∀b1. R b1 → ∀b2. R b2 → b1 = b2. -definition is_inj2: ∀A,B:Type[0]. predicate (relation2 A B) ≝ - λA,B,R. ∀a1,b. R a1 b → ∀a2. R a2 b → a1 = a2. +definition is_inj2 (A,B:Type[0]): predicate (relation2 A B) ≝ + λR. ∀a1,b. R a1 b → ∀a2. R a2 b → a1 = a2. + +(* Main properties of equality **********************************************) + +theorem canc_sn_eq (A): left_cancellable A (eq …). +// qed-. + +theorem canc_dx_eq (A): right_cancellable A (eq …). +// qed-. (* Normal form and strong normalization *************************************) -definition NF: ∀A. relation A → relation A → predicate A ≝ - λA,R,S,a1. ∀a2. R a1 a2 → S a1 a2. +definition NF (A): relation A → relation A → predicate A ≝ + λR,S,a1. ∀a2. R a1 a2 → S a1 a2. -definition NF_dec: ∀A. relation A → relation A → Prop ≝ - λA,R,S. ∀a1. NF A R S a1 ∨ - ∃∃a2. R … a1 a2 & (S a1 a2 → ⊥). +definition NF_dec (A): relation A → relation A → Prop ≝ + λR,S. ∀a1. NF A R S a1 ∨ + ∃∃a2. R … a1 a2 & (S a1 a2 → ⊥). inductive SN (A) (R,S:relation A): predicate A ≝ | SN_intro: ∀a1. (∀a2. R a1 a2 → (S a1 a2 → ⊥) → SN A R S a2) → SN A R S a1 . -lemma NF_to_SN: ∀A,R,S,a. NF A R S a → SN A R S a. +lemma NF_to_SN (A) (R) (S): ∀a. NF A R S a → SN A R S a. #A #R #S #a1 #Ha1 @SN_intro #a2 #HRa12 #HSa12 elim HSa12 -HSa12 /2 width=1 by/ qed. -definition NF_sn: ∀A. relation A → relation A → predicate A ≝ - λA,R,S,a2. ∀a1. R a1 a2 → S a1 a2. +definition NF_sn (A): relation A → relation A → predicate A ≝ + λR,S,a2. ∀a1. R a1 a2 → S a1 a2. inductive SN_sn (A) (R,S:relation A): predicate A ≝ | SN_sn_intro: ∀a2. (∀a1. R a1 a2 → (S a1 a2 → ⊥) → SN_sn A R S a1) → SN_sn A R S a2 . -lemma NF_to_SN_sn: ∀A,R,S,a. NF_sn A R S a → SN_sn A R S a. +lemma NF_to_SN_sn (A) (R) (S): ∀a. NF_sn A R S a → SN_sn A R S a. #A #R #S #a2 #Ha2 @SN_sn_intro #a1 #HRa12 #HSa12 elim HSa12 -HSa12 /2 width=1 by/ @@ -118,9 +130,10 @@ qed. (* Relations on unboxed triples *********************************************) -definition tri_RC: ∀A,B,C. tri_relation A B C → tri_relation A B C ≝ - λA,B,C,R,a1,b1,c1,a2,b2,c2. R … a1 b1 c1 a2 b2 c2 ∨ - ∧∧ a1 = a2 & b1 = b2 & c1 = c2. +definition tri_RC (A,B,C): tri_relation A B C → tri_relation A B C ≝ + λR,a1,b1,c1,a2,b2,c2. + ∨∨ R … a1 b1 c1 a2 b2 c2 + | ∧∧ a1 = a2 & b1 = b2 & c1 = c2. -lemma tri_RC_reflexive: ∀A,B,C,R. tri_reflexive A B C (tri_RC … R). +lemma tri_RC_reflexive (A) (B) (C): ∀R. tri_reflexive A B C (tri_RC … R). /3 width=1 by and3_intro, or_intror/ qed. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/stream.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/stream.ma new file mode 100644 index 000000000..757bfe724 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/stream.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_2/notation/functions/oplusright_3.ma". +include "ground_2/lib/relations.ma". + +(* STREAMS ******************************************************************) + +coinductive stream (A:Type[0]): Type[0] ≝ +| seq: A → stream A → stream A +. + +interpretation "cons (stream)" 'OPlusRight A a u = (seq A a u). + +(* Basic properties *********************************************************) + +lemma stream_rew (A) (t:stream A): match t with [ seq a u ⇒ a ⨮ u ] = t. +#A * // +qed. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/stream_eq.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/stream_eq.ma new file mode 100644 index 000000000..cee2483f3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/stream_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_2/notation/relations/ringeq_3.ma". +include "ground_2/lib/stream.ma". + +(* STREAMS ******************************************************************) + +coinductive eq_stream (A): relation (stream A) ≝ +| eq_seq: ∀t1,t2,b1,b2. b1 = b2 → eq_stream A t1 t2 → eq_stream A (b1⨮t1) (b2⨮t2) +. + +interpretation "extensional equivalence (stream)" + 'RingEq A t1 t2 = (eq_stream A t1 t2). + +definition eq_stream_repl (A) (R:relation …) ≝ + ∀t1,t2. t1 ≗{A} t2 → R t1 t2. + +definition eq_stream_repl_back (A) (R:predicate …) ≝ + ∀t1. R t1 → ∀t2. t1 ≗{A} t2 → R t2. + +definition eq_stream_repl_fwd (A) (R:predicate …) ≝ + ∀t1. R t1 → ∀t2. t2 ≗{A} t1 → R t2. + +(* Basic inversion lemmas ***************************************************) + +lemma eq_stream_inv_seq: ∀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 properties *********************************************************) + +corec lemma eq_stream_refl: ∀A. reflexive … (eq_stream A). +#A * #b #t @eq_seq // +qed. + +corec lemma eq_stream_sym: ∀A. symmetric … (eq_stream A). +#A #t1 #t2 * -t1 -t2 +#t1 #t2 #b1 #b2 #Hb #Ht @eq_seq /2 width=1 by/ +qed-. + +lemma eq_stream_repl_sym: ∀A,R. eq_stream_repl_back A R → eq_stream_repl_fwd A R. +/3 width=3 by eq_stream_sym/ qed-. + +(* Main properties **********************************************************) + +corec theorem eq_stream_trans: ∀A. Transitive … (eq_stream A). +#A #t1 #t * -t1 -t +#t1 #t #b1 #b * #Ht1 * #b2 #t2 #H cases (eq_stream_inv_seq A … H) -H -b +/3 width=7 by eq_seq/ +qed-. + +theorem eq_stream_canc_sn: ∀A,t,t1,t2. t ≗ t1 → t ≗ t2 → t1 ≗{A} t2. +/3 width=3 by eq_stream_trans, eq_stream_sym/ qed-. + +theorem eq_stream_canc_dx: ∀A,t,t1,t2. t1 ≗ t → t2 ≗ t → t1 ≗{A} t2. +/3 width=3 by eq_stream_trans, eq_stream_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/stream_hdtl.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/stream_hdtl.ma new file mode 100644 index 000000000..ff518a243 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/stream_hdtl.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_2/notation/functions/downspoon_2.ma". +include "ground_2/lib/stream_eq.ma". +include "ground_2/lib/arith.ma". + +(* STREAMS ******************************************************************) + +definition hd (A:Type[0]): stream A → A ≝ + λt. match t with [ seq a _ ⇒ a ]. + +definition tl (A:Type[0]): stream A → stream A ≝ + λt. match t with [ seq _ t ⇒ t ]. + +interpretation "tail (stream)" 'DownSpoon A t = (tl A t). + +(* basic properties *********************************************************) + +lemma hd_rew (A) (a) (t): a = hd A (a⨮t). +// qed. + +lemma tl_rew (A) (a) (t): t = tl A (a⨮t). +// qed. + +lemma eq_stream_split (A) (t): (hd … t) ⨮ ⫰t ≗{A} t. +#A * // +qed. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/stream_tls.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/stream_tls.ma new file mode 100644 index 000000000..36492559a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/stream_tls.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_2/notation/functions/downspoonstar_3.ma". +include "ground_2/lib/stream_hdtl.ma". + +(* STREAMS ******************************************************************) + +rec definition tls (A:Type[0]) (n:nat) on n: stream A → stream A ≝ ?. +cases n -n [ #t @t | #n #t @tl @(tls … n t) ] +defined. + +interpretation "iterated tail (stram)" 'DownSpoonStar A n f = (tls A n f). + +(* basic properties *********************************************************) + +lemma tls_rew_O (A) (t): t = tls A 0 t. +// qed. + +lemma tls_rew_S (A) (n) (t): ⫰⫰*[n]t = tls A (↑n) t. +// qed. + +lemma tls_S1 (A) (n) (t): ⫰*[n]⫰t = tls A (↑n) t. +#A #n elim n -n // +qed. + +lemma tls_eq_repl (A) (n): eq_stream_repl A (λt1,t2. ⫰*[n] t1 ≗ ⫰*[n] t2). +#A #n elim n -n // +#n #IH * #n1 #t1 * #n2 #t2 #H elim (eq_stream_inv_seq … H) /2 width=7 by/ +qed. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/streams.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/streams.ma deleted file mode 100644 index e1b3a6812..000000000 --- a/matita/matita/contribs/lambdadelta/ground_2/lib/streams.ma +++ /dev/null @@ -1,30 +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_2/notation/functions/oplusright_3.ma". -include "ground_2/lib/relations.ma". - -(* STREAMS ******************************************************************) - -coinductive stream (A:Type[0]): Type[0] ≝ -| seq: A → stream A → stream A -. - -interpretation "cons (nstream)" 'OPlusRight A a u = (seq A a u). - -(* Basic properties *********************************************************) - -lemma stream_rew (A) (t:stream A): match t with [ seq a u ⇒ a ⨮ u ] = t. -#A * // -qed. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/streams_eq.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/streams_eq.ma deleted file mode 100644 index 878185ca1..000000000 --- a/matita/matita/contribs/lambdadelta/ground_2/lib/streams_eq.ma +++ /dev/null @@ -1,71 +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_2/notation/relations/ringeq_3.ma". -include "ground_2/lib/streams.ma". - -(* STREAMS ******************************************************************) - -coinductive eq_stream (A): relation (stream A) ≝ -| eq_seq: ∀t1,t2,b1,b2. b1 = b2 → eq_stream A t1 t2 → eq_stream A (b1⨮t1) (b2⨮t2) -. - -interpretation "extensional equivalence (nstream)" - 'RingEq A t1 t2 = (eq_stream A t1 t2). - -definition eq_stream_repl (A) (R:relation …) ≝ - ∀t1,t2. t1 ≗{A} t2 → R t1 t2. - -definition eq_stream_repl_back (A) (R:predicate …) ≝ - ∀t1. R t1 → ∀t2. t1 ≗{A} t2 → R t2. - -definition eq_stream_repl_fwd (A) (R:predicate …) ≝ - ∀t1. R t1 → ∀t2. t2 ≗{A} t1 → R t2. - -(* Basic inversion lemmas ***************************************************) - -lemma eq_stream_inv_seq: ∀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 properties *********************************************************) - -corec lemma eq_stream_refl: ∀A. reflexive … (eq_stream A). -#A * #b #t @eq_seq // -qed. - -corec lemma eq_stream_sym: ∀A. symmetric … (eq_stream A). -#A #t1 #t2 * -t1 -t2 -#t1 #t2 #b1 #b2 #Hb #Ht @eq_seq /2 width=1 by/ -qed-. - -lemma eq_stream_repl_sym: ∀A,R. eq_stream_repl_back A R → eq_stream_repl_fwd A R. -/3 width=3 by eq_stream_sym/ qed-. - -(* Main properties **********************************************************) - -corec theorem eq_stream_trans: ∀A. Transitive … (eq_stream A). -#A #t1 #t * -t1 -t -#t1 #t #b1 #b * #Ht1 * #b2 #t2 #H cases (eq_stream_inv_seq A … H) -H -b -/3 width=7 by eq_seq/ -qed-. - -theorem eq_stream_canc_sn: ∀A,t,t1,t2. t ≗ t1 → t ≗ t2 → t1 ≗{A} t2. -/3 width=3 by eq_stream_trans, eq_stream_sym/ qed-. - -theorem eq_stream_canc_dx: ∀A,t,t1,t2. t1 ≗ t → t2 ≗ t → t1 ≗{A} t2. -/3 width=3 by eq_stream_trans, eq_stream_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/streams_hdtl.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/streams_hdtl.ma deleted file mode 100644 index f128e5f73..000000000 --- a/matita/matita/contribs/lambdadelta/ground_2/lib/streams_hdtl.ma +++ /dev/null @@ -1,39 +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_2/notation/functions/downspoon_2.ma". -include "ground_2/lib/streams_eq.ma". -include "ground_2/lib/arith.ma". - -(* STREAMS ******************************************************************) - -definition hd (A:Type[0]): stream A → A ≝ - λt. match t with [ seq a _ ⇒ a ]. - -definition tl (A:Type[0]): stream A → stream A ≝ - λt. match t with [ seq _ t ⇒ t ]. - -interpretation "tail (streams)" 'DownSpoon A t = (tl A t). - -(* basic properties *********************************************************) - -lemma hd_rew (A) (a) (t): a = hd A (a⨮t). -// qed. - -lemma tl_rew (A) (a) (t): t = tl A (a⨮t). -// qed. - -lemma eq_stream_split (A) (t): (hd … t) ⨮ ⫰t ≗{A} t. -#A * // -qed. diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/streams_tls.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/streams_tls.ma deleted file mode 100644 index f2a910aa0..000000000 --- a/matita/matita/contribs/lambdadelta/ground_2/lib/streams_tls.ma +++ /dev/null @@ -1,41 +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_2/notation/functions/downspoonstar_3.ma". -include "ground_2/lib/streams_hdtl.ma". - -(* STREAMS ******************************************************************) - -rec definition tls (A:Type[0]) (n:nat) on n: stream A → stream A ≝ ?. -cases n -n [ #t @t | #n #t @tl @(tls … n t) ] -defined. - -interpretation "iterated tail (strams)" 'DownSpoonStar A n f = (tls A n f). - -(* basic properties *********************************************************) - -lemma tls_rew_O (A) (t): t = tls A 0 t. -// qed. - -lemma tls_rew_S (A) (n) (t): ⫰⫰*[n]t = tls A (↑n) t. -// qed. - -lemma tls_S1 (A) (n) (t): ⫰*[n]⫰t = tls A (↑n) t. -#A #n elim n -n // -qed. - -lemma tls_eq_repl (A) (n): eq_stream_repl A (λt1,t2. ⫰*[n] t1 ≗ ⫰*[n] t2). -#A #n elim n -n // -#n #IH * #n1 #t1 * #n2 #t2 #H elim (eq_stream_inv_seq … H) /2 width=7 by/ -qed. diff --git a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/basic_2.ma b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/basic_2.ma index f18cd54f3..5a122b8ec 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/basic_2.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/basic_2.ma @@ -14,6 +14,6 @@ (* GENERAL NOTATION USED BY THE FORMAL SYSTEM λδ ****************************) -notation "hvbox( 𝐁❴ break term 46 l, break term 46 h ❵ )" +notation "hvbox( 𝐁❴ term 46 l, break term 46 h ❵ )" non associative with precedence 90 for @{ 'Basic $l $h }. diff --git a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/cocompose_2.ma b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/cocompose_2.ma index 32741b07b..992179f98 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/cocompose_2.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/cocompose_2.ma @@ -14,6 +14,6 @@ (* GENERAL NOTATION USED BY THE FORMAL SYSTEM λδ ****************************) -notation "hvbox(f2 ~ \circ break f1)" +notation "hvbox(f2 ~ \circ break f1)" (**) right associative with precedence 60 for @{ 'CoCompose $f2 $f1 }. diff --git a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/droppreds_2.ma b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/droppreds_2.ma index 1b10938b7..d74010073 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/droppreds_2.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/droppreds_2.ma @@ -14,6 +14,6 @@ (* GENERAL NOTATION USED BY THE FORMAL SYSTEM λδ ****************************) -notation "hvbox( ⫱ * [ term 46 n ] term 46 T )" +notation "hvbox( ⫱ * [ term 46 n ] break term 46 T )" non associative with precedence 46 for @{ 'DropPreds $n $T }. diff --git a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/uparrowstar_2.ma b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/uparrowstar_2.ma index 553c4e494..a0ab933d8 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/uparrowstar_2.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/uparrowstar_2.ma @@ -14,6 +14,6 @@ (* GENERAL NOTATION USED BY THE FORMAL SYSTEM λδ ****************************) -notation "hvbox( ↑ * [ term 46 n ] term 70 T )" +notation "hvbox( ↑ * [ term 46 n ] break term 70 T )" non associative with precedence 70 for @{ 'UpArrowStar $n $T }. diff --git a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/upspoonstar_2.ma b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/upspoonstar_2.ma index 12beff4ec..de75ff051 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/notation/functions/upspoonstar_2.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/notation/functions/upspoonstar_2.ma @@ -14,6 +14,6 @@ (* GENERAL NOTATION USED BY THE FORMAL SYSTEM λδ ****************************) -notation "hvbox( ⫯ * [ term 46 n ] term 46 T )" +notation "hvbox( ⫯ * [ term 46 n ] break term 46 T )" non associative with precedence 46 for @{ 'UpSpoonStar $n $T }. diff --git a/matita/matita/contribs/lambdadelta/ground_2/notation/xoa/ex_1_4.ma b/matita/matita/contribs/lambdadelta/ground_2/notation/xoa/ex_1_4.ma new file mode 100644 index 000000000..0fbf2a458 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/ground_2/notation/xoa/ex_1_4.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 *) +(* *) +(**************************************************************************) + +(* This file was generated by xoa.native: do not edit *********************) + +(* multiple existental quantifier (1, 4) *) + +notation > "hvbox(∃∃ ident x0 , ident x1 , ident x2 , ident x3 break . term 19 P0)" + non associative with precedence 20 + for @{ 'Ex4 (λ${ident x0}.λ${ident x1}.λ${ident x2}.λ${ident x3}.$P0) }. + +notation < "hvbox(∃∃ ident x0 , ident x1 , ident x2 , ident x3 break . term 19 P0)" + non associative with precedence 20 + for @{ 'Ex4 (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.$P0) }. + diff --git a/matita/matita/contribs/lambdadelta/ground_2/relocation/mr2_plus.ma b/matita/matita/contribs/lambdadelta/ground_2/relocation/mr2_plus.ma index e1ef5d287..94c561032 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/relocation/mr2_plus.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/relocation/mr2_plus.ma @@ -18,7 +18,7 @@ include "ground_2/relocation/mr2.ma". rec definition pluss (cs:mr2) (i:nat) on cs ≝ match cs with [ nil2 ⇒ ◊ -| cons2 l m cs ⇒ {l + i, m};pluss cs i +| cons2 l m cs ⇒ {l + i,m};pluss cs i ]. interpretation "plus (multiple relocation with pairs)" @@ -26,7 +26,7 @@ interpretation "plus (multiple relocation with pairs)" (* Basic properties *********************************************************) -lemma pluss_SO2: ∀l,m,cs. ({l, m};cs) + 1 = {↑l, m};cs + 1. +lemma pluss_SO2: ∀l,m,cs. ({l,m};cs) + 1 = {↑l,m};cs + 1. normalize // qed. (* Basic inversion lemmas ***************************************************) @@ -36,8 +36,8 @@ lemma pluss_inv_nil2: ∀i,cs. cs + i = ◊ → cs = ◊. #l #m #cs #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. +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 * [ normalize #H destruct | #l1 #m1 #cs1 whd in ⊢ (??%?→?); #H destruct diff --git a/matita/matita/contribs/lambdadelta/ground_2/relocation/nstream.ma b/matita/matita/contribs/lambdadelta/ground_2/relocation/nstream.ma index 3803c254b..c5ccb7373 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/relocation/nstream.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/relocation/nstream.ma @@ -13,7 +13,7 @@ (**************************************************************************) include "ground_2/notation/functions/upspoon_1.ma". -include "ground_2/lib/streams_tls.ma". +include "ground_2/lib/stream_tls.ma". (* RELOCATION N-STREAM ******************************************************) diff --git a/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_at.ma b/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_at.ma index 4a03364b8..93980c881 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_at.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_at.ma @@ -27,20 +27,20 @@ interpretation "relational application (rtmap)" 'RAt i1 f i2 = (at f i1 i2). definition H_at_div: relation4 rtmap rtmap rtmap rtmap ≝ λf2,g2,f1,g1. - ∀jf,jg,j. @⦃jf, f2⦄ ≘ j → @⦃jg, g2⦄ ≘ j → - ∃∃j0. @⦃j0, f1⦄ ≘ jf & @⦃j0, g1⦄ ≘ jg. + ∀jf,jg,j. @⦃jf,f2⦄ ≘ j → @⦃jg,g2⦄ ≘ j → + ∃∃j0. @⦃j0,f1⦄ ≘ jf & @⦃j0,g1⦄ ≘ jg. (* Basic inversion lemmas ***************************************************) -lemma at_inv_ppx: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → ∀g. 0 = i1 → ⫯g = f → 0 = i2. +lemma at_inv_ppx: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀g. 0 = i1 → ⫯g = f → 0 = i2. #f #i1 #i2 * -f -i1 -i2 // [ #f #i1 #i2 #_ #g #j1 #j2 #_ * #_ #x #H destruct | #f #i1 #i2 #_ #g #j2 * #_ #x #_ #H elim (discr_push_next … H) ] qed-. -lemma at_inv_npx: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → ∀g,j1. ↑j1 = i1 → ⫯g = f → - ∃∃j2. @⦃j1, g⦄ ≘ j2 & ↑j2 = i2. +lemma at_inv_npx: ∀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 >(injective_push … Hf) -g destruct /2 width=3 by ex2_intro/ @@ -48,8 +48,8 @@ lemma at_inv_npx: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → ∀g,j1. ↑j1 = i1 → ] qed-. -lemma at_inv_xnx: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → ∀g. ↑g = f → - ∃∃j2. @⦃i1, g⦄ ≘ j2 & ↑j2 = i2. +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) @@ -59,43 +59,43 @@ qed-. (* Advanced inversion lemmas ************************************************) -lemma at_inv_ppn: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → +lemma at_inv_ppn: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀g,j2. 0 = 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-. -lemma at_inv_npp: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → +lemma at_inv_npp: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀g,j1. ↑j1 = i1 → ⫯g = f → 0 = 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. +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 → +lemma at_inv_xnp: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀g. ↑g = f → 0 = 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. +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 → 0 = i1 → 0 = i2 → ∃g. ⫯g = f. +lemma at_inv_pxp: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → 0 = i1 → 0 = 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. 0 = i1 → ↑j2 = i2 → - ∃∃g. @⦃i1, g⦄ ≘ j2 & ↑g = f. +lemma at_inv_pxn: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀j2. 0 = 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) @@ -103,7 +103,7 @@ lemma at_inv_pxn: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → ∀j2. 0 = i1 → ↑j2 = ] qed-. -lemma at_inv_nxp: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → +lemma at_inv_nxp: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀j1. ↑j1 = i1 → 0 = i2 → ⊥. #f elim (pn_split f) * #g #H #i1 #i2 #Hf #j1 #H1 #H2 @@ -112,37 +112,37 @@ lemma at_inv_nxp: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → ] 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. +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 → +lemma at_inv_xpx: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀g. ⫯g = f → (0 = i1 ∧ 0 = i2) ∨ - ∃∃j1,j2. @⦃j1, g⦄ ≘ j2 & ↑j1 = i1 & ↑j2 = 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 → 0 = i2 → 0 = i1. +lemma at_inv_xpp: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ∀g. ⫯g = f → 0 = i2 → 0 = 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. +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 → 0 = i2 → +lemma at_inv_xxp: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → 0 = i2 → ∃∃g. 0 = i1 & ⫯g = f. #f elim (pn_split f) * #g #H #i1 #i2 #Hf #H2 @@ -151,9 +151,9 @@ lemma at_inv_xxp: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → 0 = i2 → ] 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. +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/ @@ -163,7 +163,7 @@ qed-. (* Basic forward lemmas *****************************************************) -lemma at_increasing: ∀i2,i1,f. @⦃i1, f⦄ ≘ i2 → i1 ≤ i2. +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 * // @@ -172,13 +172,13 @@ lemma at_increasing: ∀i2,i1,f. @⦃i1, f⦄ ≘ i2 → i1 ≤ i2. ] qed-. -lemma at_increasing_strict: ∀g,i1,i2. @⦃i1, g⦄ ≘ i2 → ∀f. ↑f = g → - i1 < i2 ∧ @⦃i1, f⦄ ≘ ↓i2. +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, le_S_S/ qed-. -lemma at_fwd_id_ex: ∀f,i. @⦃i, f⦄ ≘ i → ∃g. ⫯g = f. +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 @@ -187,7 +187,7 @@ qed-. (* Basic properties *********************************************************) -corec lemma at_eq_repl_back: ∀i1,i2. eq_repl_back (λf. @⦃i1, f⦄ ≘ i2). +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/ @@ -195,12 +195,12 @@ corec lemma at_eq_repl_back: ∀i1,i2. eq_repl_back (λf. @⦃i1, f⦄ ≘ i2). ] qed-. -lemma at_eq_repl_fwd: ∀i1,i2. eq_repl_fwd (λf. @⦃i1, f⦄ ≘ i2). +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. +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 @@ -217,14 +217,14 @@ lemma at_le_ex: ∀j2,i2,f. @⦃i2, f⦄ ≘ j2 → ∀i1. i1 ≤ i2 → ] qed-. -lemma at_id_le: ∀i1,i2. i1 ≤ i2 → ∀f. @⦃i2, f⦄ ≘ i2 → @⦃i1, f⦄ ≘ i1. +lemma at_id_le: ∀i1,i2. i1 ≤ i2 → ∀f. @⦃i2,f⦄ ≘ i2 → @⦃i1,f⦄ ≘ i1. #i1 #i2 #H @(le_elim … 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 → +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 // @@ -240,7 +240,7 @@ theorem at_monotonic: ∀j2,i2,f. @⦃i2, f⦄ ≘ j2 → ∀j1,i1. @⦃i1, f⦄ ] qed-. -theorem at_inv_monotonic: ∀j1,i1,f. @⦃i1, f⦄ ≘ j1 → ∀j2,i2. @⦃i2, f⦄ ≘ j2 → +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 // @@ -261,12 +261,12 @@ theorem at_inv_monotonic: ∀j1,i1,f. @⦃i1, f⦄ ≘ j1 → ∀j2,i2. @⦃i2, ] qed-. -theorem at_mono: ∀f,i,i1. @⦃i, f⦄ ≘ i1 → ∀i2. @⦃i, f⦄ ≘ i2 → i2 = i1. +theorem at_mono: ∀f,i,i1. @⦃i,f⦄ ≘ i1 → ∀i2. @⦃i,f⦄ ≘ i2 → i2 = i1. #f #i #i1 #H1 #i2 #H2 elim (lt_or_eq_or_gt i2 i1) // #Hi elim (lt_le_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. +theorem at_inj: ∀f,i1,i. @⦃i1,f⦄ ≘ i → ∀i2. @⦃i2,f⦄ ≘ i → i1 = i2. #f #i1 #i #H1 #i2 #H2 elim (lt_or_eq_or_gt i2 i1) // #Hi elim (lt_le_false i i) /3 width=6 by at_monotonic, eq_sym/ qed-. @@ -312,14 +312,14 @@ theorem at_div_pn: ∀f2,g2,f1,g1. (* Properties on tls ********************************************************) -lemma at_pxx_tls: ∀n,f. @⦃0, f⦄ ≘ n → @⦃0, ⫱*[n]f⦄ ≘ 0. +lemma at_pxx_tls: ∀n,f. @⦃0,f⦄ ≘ n → @⦃0,⫱*[n]f⦄ ≘ 0. #n elim n -n // #n #IH #f #Hf cases (at_inv_pxn … Hf) -Hf [ |*: // ] #g #Hg #H0 destruct (H2f … Hf) in ⊢ (???%); -H2f // diff --git a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc.ma b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc.ma index 1e08d2474..482a6da39 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc.ma @@ -43,7 +43,7 @@ definition eq_f: relation rtc ≝ λc1,c2. ⊤. inductive eq_t: relation rtc ≝ | eq_t_intro: ∀ri1,ri2,rs1,rs2,ti,ts. - eq_t (〈ri1, rs1, ti, ts〉) (〈ri2, rs2, ti, ts〉) + eq_t (〈ri1,rs1,ti,ts〉) (〈ri2,rs2,ti,ts〉) . (* Basic properties *********************************************************) diff --git a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_isrt.ma b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_isrt.ma index 9c988abea..45be4c4ad 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_isrt.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_isrt.ma @@ -18,47 +18,47 @@ include "ground_2/steps/rtc.ma". (* RT-TRANSITION COUNTER ****************************************************) definition isrt: relation2 nat rtc ≝ λts,c. - ∃∃ri,rs. 〈ri, rs, 0, ts〉 = c. + ∃∃ri,rs. 〈ri,rs,0,ts〉 = c. interpretation "test for costrained rt-transition counter (rtc)" 'IsRedType ts c = (isrt ts c). (* Basic properties *********************************************************) -lemma isr_00: 𝐑𝐓⦃0, 𝟘𝟘⦄. +lemma isr_00: 𝐑𝐓⦃0,𝟘𝟘⦄. /2 width=3 by ex1_2_intro/ qed. -lemma isr_10: 𝐑𝐓⦃0, 𝟙𝟘⦄. +lemma isr_10: 𝐑𝐓⦃0,𝟙𝟘⦄. /2 width=3 by ex1_2_intro/ qed. -lemma isrt_01: 𝐑𝐓⦃1, 𝟘𝟙⦄. +lemma isrt_01: 𝐑𝐓⦃1,𝟘𝟙⦄. /2 width=3 by ex1_2_intro/ qed. -lemma isrt_eq_t_trans: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → eq_t c1 c2 → 𝐑𝐓⦃n, c2⦄. +lemma isrt_eq_t_trans: ∀n,c1,c2. 𝐑𝐓⦃n,c1⦄ → eq_t c1 c2 → 𝐑𝐓⦃n,c2⦄. #n #c1 #c2 * #ri1 #rs1 #H destruct #H elim (eq_t_inv_dx … H) -H /2 width=3 by ex1_2_intro/ qed-. (* Basic inversion properties ***********************************************) -lemma isrt_inv_00: ∀n. 𝐑𝐓⦃n, 𝟘𝟘⦄ → 0 = n. +lemma isrt_inv_00: ∀n. 𝐑𝐓⦃n,𝟘𝟘⦄ → 0 = n. #n * #ri #rs #H destruct // qed-. -lemma isrt_inv_10: ∀n. 𝐑𝐓⦃n, 𝟙𝟘⦄ → 0 = n. +lemma isrt_inv_10: ∀n. 𝐑𝐓⦃n,𝟙𝟘⦄ → 0 = n. #n * #ri #rs #H destruct // qed-. -lemma isrt_inv_01: ∀n. 𝐑𝐓⦃n, 𝟘𝟙⦄ → 1 = n. +lemma isrt_inv_01: ∀n. 𝐑𝐓⦃n,𝟘𝟙⦄ → 1 = n. #n * #ri #rs #H destruct // qed-. (* Main inversion properties ************************************************) -theorem isrt_inj: ∀n1,n2,c. 𝐑𝐓⦃n1, c⦄ → 𝐑𝐓⦃n2, c⦄ → n1 = n2. +theorem isrt_inj: ∀n1,n2,c. 𝐑𝐓⦃n1,c⦄ → 𝐑𝐓⦃n2,c⦄ → n1 = n2. #n1 #n2 #c * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct // qed-. -theorem isrt_mono: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → 𝐑𝐓⦃n, c2⦄ → eq_t c1 c2. +theorem isrt_mono: ∀n,c1,c2. 𝐑𝐓⦃n,c1⦄ → 𝐑𝐓⦃n,c2⦄ → eq_t c1 c2. #n #c1 #c2 * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct // qed-. diff --git a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_max.ma b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_max.ma index bfa170972..bf31a291f 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_max.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_max.ma @@ -18,7 +18,7 @@ include "ground_2/steps/rtc_shift.ma". definition max (c1:rtc) (c2:rtc): rtc ≝ match c1 with [ mk_rtc ri1 rs1 ti1 ts1 ⇒ match c2 with [ - mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1∨ri2, rs1∨rs2, ti1∨ti2, ts1∨ts2〉 + mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1∨ri2,rs1∨rs2,ti1∨ti2,ts1∨ts2〉 ] ]. @@ -28,7 +28,7 @@ interpretation "maximum (rtc)" (* Basic properties *********************************************************) lemma max_rew: ∀ri1,ri2,rs1,rs2,ti1,ti2,ts1,ts2. - 〈ri1∨ri2, rs1∨rs2, ti1∨ti2, ts1∨ts2〉 = + 〈ri1∨ri2,rs1∨rs2,ti1∨ti2,ts1∨ts2〉 = (〈ri1,rs1,ti1,ts1〉 ∨ 〈ri2,rs2,ti2,ts2〉). // qed. @@ -59,46 +59,46 @@ qed. (* Properties with test for constrained rt-transition counter ***************) -lemma isrt_max: ∀n1,n2,c1,c2. 𝐑𝐓⦃n1, c1⦄ → 𝐑𝐓⦃n2, c2⦄ → 𝐑𝐓⦃n1∨n2, c1∨c2⦄. +lemma isrt_max: ∀n1,n2,c1,c2. 𝐑𝐓⦃n1,c1⦄ → 𝐑𝐓⦃n2,c2⦄ → 𝐑𝐓⦃n1∨n2,c1∨c2⦄. #n1 #n2 #c1 #c2 * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct /2 width=3 by ex1_2_intro/ qed. -lemma isrt_max_O1: ∀n,c1,c2. 𝐑𝐓⦃0, c1⦄ → 𝐑𝐓⦃n, c2⦄ → 𝐑𝐓⦃n, c1∨c2⦄. +lemma isrt_max_O1: ∀n,c1,c2. 𝐑𝐓⦃0,c1⦄ → 𝐑𝐓⦃n,c2⦄ → 𝐑𝐓⦃n,c1∨c2⦄. /2 width=1 by isrt_max/ qed. -lemma isrt_max_O2: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1∨c2⦄. +lemma isrt_max_O2: ∀n,c1,c2. 𝐑𝐓⦃n,c1⦄ → 𝐑𝐓⦃0,c2⦄ → 𝐑𝐓⦃n,c1∨c2⦄. #n #c1 #c2 #H1 #H2 >(max_O2 n) /2 width=1 by isrt_max/ qed. -lemma isrt_max_idem1: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → 𝐑𝐓⦃n, c2⦄ → 𝐑𝐓⦃n, c1∨c2⦄. +lemma isrt_max_idem1: ∀n,c1,c2. 𝐑𝐓⦃n,c1⦄ → 𝐑𝐓⦃n,c2⦄ → 𝐑𝐓⦃n,c1∨c2⦄. #n #c1 #c2 #H1 #H2 >(idempotent_max n) /2 width=1 by isrt_max/ qed. (* Inversion properties with test for constrained rt-transition counter *****) -lemma isrt_inv_max: ∀n,c1,c2. 𝐑𝐓⦃n, c1 ∨ c2⦄ → - ∃∃n1,n2. 𝐑𝐓⦃n1, c1⦄ & 𝐑𝐓⦃n2, c2⦄ & (n1 ∨ n2) = n. +lemma isrt_inv_max: ∀n,c1,c2. 𝐑𝐓⦃n,c1 ∨ c2⦄ → + ∃∃n1,n2. 𝐑𝐓⦃n1,c1⦄ & 𝐑𝐓⦃n2,c2⦄ & (n1 ∨ n2) = n. #n #c1 #c2 * #ri #rs #H elim (max_inv_dx … H) -H #ri1 #rs1 #ti1 #ts1 #ri2 #rs2 #ti2 #ts2 #_ #_ #H1 #H2 #H3 #H4 elim (max_inv_O3 … H1) -H1 /3 width=5 by ex3_2_intro, ex1_2_intro/ qed-. -lemma isrt_O_inv_max: ∀c1,c2. 𝐑𝐓⦃0, c1 ∨ c2⦄ → ∧∧ 𝐑𝐓⦃0, c1⦄ & 𝐑𝐓⦃0, c2⦄. +lemma isrt_O_inv_max: ∀c1,c2. 𝐑𝐓⦃0,c1 ∨ c2⦄ → ∧∧ 𝐑𝐓⦃0,c1⦄ & 𝐑𝐓⦃0,c2⦄. #c1 #c2 #H elim (isrt_inv_max … H) -H #n1 #n2 #Hn1 #Hn2 #H elim (max_inv_O3 … H) -H #H1 #H2 destruct /2 width=1 by conj/ qed-. -lemma isrt_inv_max_O_dx: ∀n,c1,c2. 𝐑𝐓⦃n, c1 ∨ c2⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1⦄. +lemma isrt_inv_max_O_dx: ∀n,c1,c2. 𝐑𝐓⦃n,c1 ∨ c2⦄ → 𝐑𝐓⦃0,c2⦄ → 𝐑𝐓⦃n,c1⦄. #n #c1 #c2 #H #H2 elim (isrt_inv_max … H) -H #n1 #n2 #Hn1 #Hn2 #H destruct lapply (isrt_inj … Hn2 H2) -c2 #H destruct // qed-. -lemma isrt_inv_max_eq_t: ∀n,c1,c2. 𝐑𝐓⦃n, c1 ∨ c2⦄ → eq_t c1 c2 → - ∧∧ 𝐑𝐓⦃n, c1⦄ & 𝐑𝐓⦃n, c2⦄. +lemma isrt_inv_max_eq_t: ∀n,c1,c2. 𝐑𝐓⦃n,c1 ∨ c2⦄ → eq_t c1 c2 → + ∧∧ 𝐑𝐓⦃n,c1⦄ & 𝐑𝐓⦃n,c2⦄. #n #c1 #c2 #H #Hc12 elim (isrt_inv_max … H) -H #n1 #n2 #Hc1 #Hc2 #H destruct lapply (isrt_eq_t_trans … Hc1 … Hc12) -Hc12 #H @@ -115,8 +115,8 @@ qed. (* Inversion lemmaswith shift ***********************************************) -lemma isrt_inv_max_shift_sn: ∀n,c1,c2. 𝐑𝐓⦃n, ↕*c1 ∨ c2⦄ → - ∧∧ 𝐑𝐓⦃0, c1⦄ & 𝐑𝐓⦃n, c2⦄. +lemma isrt_inv_max_shift_sn: ∀n,c1,c2. 𝐑𝐓⦃n,↕*c1 ∨ c2⦄ → + ∧∧ 𝐑𝐓⦃0,c1⦄ & 𝐑𝐓⦃n,c2⦄. #n #c1 #c2 #H elim (isrt_inv_max … H) -H #n1 #n2 #Hc1 #Hc2 #H destruct elim (isrt_inv_shift … Hc1) -Hc1 #Hc1 * -n1 diff --git a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_plus.ma b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_plus.ma index 49ce55082..a5237af26 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_plus.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_plus.ma @@ -18,7 +18,7 @@ include "ground_2/steps/rtc_isrt.ma". definition plus (c1:rtc) (c2:rtc): rtc ≝ match c1 with [ mk_rtc ri1 rs1 ti1 ts1 ⇒ match c2 with [ - mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1+ri2, rs1+rs2, ti1+ti2, ts1+ts2〉 + mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1+ri2,rs1+rs2,ti1+ti2,ts1+ts2〉 ] ]. @@ -29,7 +29,7 @@ interpretation "plus (rtc)" (**) (* plus is not disambiguated parentheses *) lemma plus_rew: ∀ri1,ri2,rs1,rs2,ti1,ti2,ts1,ts2. - 〈ri1+ri2, rs1+rs2, ti1+ti2, ts1+ts2〉 = + 〈ri1+ri2,rs1+rs2,ti1+ti2,ts1+ts2〉 = (〈ri1,rs1,ti1,ts1〉) + (〈ri2,rs2,ti2,ts2〉). // qed. @@ -56,38 +56,38 @@ qed. (* Properties with test for constrained rt-transition counter ***************) -lemma isrt_plus: ∀n1,n2,c1,c2. 𝐑𝐓⦃n1, c1⦄ → 𝐑𝐓⦃n2, c2⦄ → 𝐑𝐓⦃n1+n2, c1+c2⦄. +lemma isrt_plus: ∀n1,n2,c1,c2. 𝐑𝐓⦃n1,c1⦄ → 𝐑𝐓⦃n2,c2⦄ → 𝐑𝐓⦃n1+n2,c1+c2⦄. #n1 #n2 #c1 #c2 * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct /2 width=3 by ex1_2_intro/ qed. -lemma isrt_plus_O1: ∀n,c1,c2. 𝐑𝐓⦃0, c1⦄ → 𝐑𝐓⦃n, c2⦄ → 𝐑𝐓⦃n, c1+c2⦄. +lemma isrt_plus_O1: ∀n,c1,c2. 𝐑𝐓⦃0,c1⦄ → 𝐑𝐓⦃n,c2⦄ → 𝐑𝐓⦃n,c1+c2⦄. /2 width=1 by isrt_plus/ qed. -lemma isrt_plus_O2: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1+c2⦄. +lemma isrt_plus_O2: ∀n,c1,c2. 𝐑𝐓⦃n,c1⦄ → 𝐑𝐓⦃0,c2⦄ → 𝐑𝐓⦃n,c1+c2⦄. #n #c1 #c2 #H1 #H2 >(plus_n_O n) /2 width=1 by isrt_plus/ qed. -lemma isrt_succ: ∀n,c. 𝐑𝐓⦃n, c⦄ → 𝐑𝐓⦃↑n, c+𝟘𝟙⦄. +lemma isrt_succ: ∀n,c. 𝐑𝐓⦃n,c⦄ → 𝐑𝐓⦃↑n,c+𝟘𝟙⦄. /2 width=1 by isrt_plus/ qed. (* Inversion properties with test for constrained rt-transition counter *****) -lemma isrt_inv_plus: ∀n,c1,c2. 𝐑𝐓⦃n, c1 + c2⦄ → - ∃∃n1,n2. 𝐑𝐓⦃n1, c1⦄ & 𝐑𝐓⦃n2, c2⦄ & n1 + n2 = n. +lemma isrt_inv_plus: ∀n,c1,c2. 𝐑𝐓⦃n,c1 + c2⦄ → + ∃∃n1,n2. 𝐑𝐓⦃n1,c1⦄ & 𝐑𝐓⦃n2,c2⦄ & n1 + n2 = n. #n #c1 #c2 * #ri #rs #H elim (plus_inv_dx … H) -H #ri1 #rs1 #ti1 #ts1 #ri2 #rs2 #ti2 #ts2 #_ #_ #H1 #H2 #H3 #H4 elim (plus_inv_O3 … H1) -H1 /3 width=5 by ex3_2_intro, ex1_2_intro/ qed-. -lemma isrt_inv_plus_O_dx: ∀n,c1,c2. 𝐑𝐓⦃n, c1 + c2⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1⦄. +lemma isrt_inv_plus_O_dx: ∀n,c1,c2. 𝐑𝐓⦃n,c1 + c2⦄ → 𝐑𝐓⦃0,c2⦄ → 𝐑𝐓⦃n,c1⦄. #n #c1 #c2 #H #H2 elim (isrt_inv_plus … H) -H #n1 #n2 #Hn1 #Hn2 #H destruct lapply (isrt_inj … Hn2 H2) -c2 #H destruct // qed-. -lemma isrt_inv_plus_SO_dx: ∀n,c1,c2. 𝐑𝐓⦃n, c1 + c2⦄ → 𝐑𝐓⦃1, c2⦄ → - ∃∃m. 𝐑𝐓⦃m, c1⦄ & n = ↑m. +lemma isrt_inv_plus_SO_dx: ∀n,c1,c2. 𝐑𝐓⦃n,c1 + c2⦄ → 𝐑𝐓⦃1,c2⦄ → + ∃∃m. 𝐑𝐓⦃m,c1⦄ & n = ↑m. #n #c1 #c2 #H #H2 elim (isrt_inv_plus … H) -H #n1 #n2 #Hn1 #Hn2 #H destruct lapply (isrt_inj … Hn2 H2) -c2 #H destruct diff --git a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_shift.ma b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_shift.ma index e2f739d69..165e1eeda 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_shift.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_shift.ma @@ -18,14 +18,14 @@ include "ground_2/steps/rtc_isrt.ma". (* RT-TRANSITION COUNTER ****************************************************) definition shift (c:rtc): rtc ≝ match c with -[ mk_rtc ri rs ti ts ⇒ 〈ri∨rs, 0, ti∨ts, 0〉 ]. +[ mk_rtc ri rs ti ts ⇒ 〈ri∨rs,0,ti∨ts,0〉 ]. interpretation "shift (rtc)" 'UpDownArrowStar c = (shift c). (* Basic properties *********************************************************) -lemma shift_rew: ∀ri,rs,ti,ts. 〈ri∨rs, 0, ti∨ts, 0〉 = ↕*〈ri, rs, ti, ts〉. +lemma shift_rew: ∀ri,rs,ti,ts. 〈ri∨rs,0,ti∨ts,0〉 = ↕*〈ri,rs,ti,ts〉. normalize // qed. @@ -34,27 +34,27 @@ lemma shift_O: 𝟘𝟘 = ↕*𝟘𝟘. (* Basic inversion properties ***********************************************) -lemma shift_inv_dx: ∀ri,rs,ti,ts,c. 〈ri, rs, ti, ts〉 = ↕*c → +lemma shift_inv_dx: ∀ri,rs,ti,ts,c. 〈ri,rs,ti,ts〉 = ↕*c → ∃∃ri0,rs0,ti0,ts0. (ri0∨rs0) = ri & 0 = rs & (ti0∨ts0) = ti & 0 = ts & - 〈ri0, rs0, ti0, ts0〉 = c. + 〈ri0,rs0,ti0,ts0〉 = c. #ri #rs #ti #ts * #ri0 #rs0 #ti0 #ts0 ground_2/xoa ground_2/notation/xoa basics/pts.ma + 1 4 5 1 5 7 9 3 diff --git a/matita/matita/contribs/lambdadelta/ground_2/ynat/ynat_lt.ma b/matita/matita/contribs/lambdadelta/ground_2/ynat/ynat_lt.ma index ab87ca278..ab9cf4565 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/ynat/ynat_lt.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/ynat/ynat_lt.ma @@ -199,6 +199,10 @@ lemma yle_ylt_trans: ∀x:ynat. ∀y:ynat. ∀z:ynat. y < z → x ≤ y → x < ] qed-. +lemma le_ylt_trans (x) (y) (z): x ≤ y → yinj y < z → yinj x < z. +/3 width=3 by yle_ylt_trans, yle_inj/ +qed-. + lemma yle_inv_succ1_lt: ∀x,y:ynat. ↑x ≤ y → 0 < y ∧ x ≤ ↓y. #x #y #H elim (yle_inv_succ1 … H) -H /3 width=1 by ylt_O1, conj/ qed-. @@ -219,6 +223,10 @@ theorem ylt_trans: Transitive … ylt. ] qed-. +lemma lt_ylt_trans (x) (y) (z): x < y → yinj y < z → yinj x < z. +/3 width=3 by ylt_trans, ylt_inj/ +qed-. + (* Elimination principles ***************************************************) fact ynat_ind_lt_le_aux: ∀R:predicate ynat. diff --git a/matita/matita/contribs/lambdadelta/partial.txt b/matita/matita/contribs/lambdadelta/partial.txt deleted file mode 100644 index 11b4d4573..000000000 --- a/matita/matita/contribs/lambdadelta/partial.txt +++ /dev/null @@ -1,4 +0,0 @@ -ground_2 -static_2 -basic_2 -apps_2 diff --git a/matita/matita/contribs/lambdadelta/replace.sh b/matita/matita/contribs/lambdadelta/replace.sh index fcc328a85..d077dcb59 100644 --- a/matita/matita/contribs/lambdadelta/replace.sh +++ b/matita/matita/contribs/lambdadelta/replace.sh @@ -1,6 +1,6 @@ #!/bin/sh -for SRC in `find grond_2 static_2 basic_2 apps_2 -name "*.ma" -or -name "*.tbl"`; do - sed "s!$1!$2!g" ${SRC} > ${SRC}.new +for SRC in `find ground_2 static_2 basic_2 apps_2 -name "*.ma" -or -name "*.tbl"`; do + sed "/$1/s!$2!$3!g" ${SRC} > ${SRC}.new if [ ! -s ${SRC}.new ] || diff ${SRC} ${SRC}.new > /dev/null; then rm -f ${SRC}.new; else echo ${SRC}; mv -f ${SRC} ${SRC}.old; mv -f ${SRC}.new ${SRC}; diff --git a/matita/matita/contribs/lambdadelta/static_2/etc/scl/clearsn_3.etc b/matita/matita/contribs/lambdadelta/static_2/etc/scl/clearsn_3.etc new file mode 100644 index 000000000..d430b8d14 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/etc/scl/clearsn_3.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L1 ⊐ⓧ [ break term 46 f ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'ClearSn $f $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/etc/scl/scl.etc b/matita/matita/contribs/lambdadelta/static_2/etc/scl/scl.etc new file mode 100644 index 000000000..9d7e924f0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/etc/scl/scl.etc @@ -0,0 +1,110 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/notation/relations/clearsn_3.ma". +include "static_2/syntax/cext2.ma". +include "static_2/relocation/sex.ma". + +(* CLEAR FOR LOCAL ENVIRONMENTS ON SELECTED ENTRIES *************************) + +definition ccl: relation3 lenv bind bind ≝ λL,I1,I2. BUnit Void = I2. + +definition scl: rtmap → relation lenv ≝ sex ccl (cext2 ceq). + +interpretation + "clear (local environment)" + 'ClearSn f L1 L2 = (scl f L1 L2). + +(* Basic eliminators ********************************************************) + +lemma scl_ind (Q:rtmap→relation lenv): + (∀f. Q f (⋆) (⋆)) → + (∀f,I,K1,K2. K1 ⊐ⓧ[f] K2 → Q f K1 K2 → Q (⫯f) (K1.ⓘ{I}) (K2.ⓘ{I})) → + (∀f,I,K1,K2. K1 ⊐ⓧ[f] K2 → Q f K1 K2 → Q (↑f) (K1.ⓘ{I}) (K2.ⓧ)) → + ∀f,L1,L2. L1 ⊐ⓧ[f] L2 → Q f L1 L2. +#Q #IH1 #IH2 #IH3 #f #L1 #L2 #H elim H -f -L1 -L2 +[ // +| #f #I1 #I2 #K1 #K2 #HK #H #IH destruct /2 by/ +| #f #I1 #I2 #K1 #K2 #HK * #I [| #V1 #V2 #H ] #IH destruct /2 by/ +] +qed-. + +(* Basic inversion lemmas ***************************************************) + +lemma scl_inv_atom_sn: ∀g,L2. ⋆ ⊐ⓧ[g] L2 → L2 = ⋆. +/2 width=4 by sex_inv_atom1/ qed-. + +lemma scl_inv_push_sn: ∀f,I,K1,L2. K1.ⓘ{I} ⊐ⓧ[⫯f] L2 → + ∃∃K2. K1 ⊐ⓧ[f] K2 & L2 = K2.ⓘ{I}. +#f #I #K1 #L2 #H +elim (sex_inv_push1 … H) -H #J #K2 #HK12 * +/2 width=3 by ex2_intro/ +qed-. + +lemma scl_inv_next_sn: ∀f,I,K1,L2. K1.ⓘ{I} ⊐ⓧ[↑f] L2 → + ∃∃K2. K1 ⊐ⓧ[f] K2 & L2 = K2.ⓧ. +#f #I #K1 #L2 #H +elim (sex_inv_next1 … H) -H +/2 width=3 by ex2_intro/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma scl_inv_bind_sn_gen: ∀g,I,K1,L2. K1.ⓘ{I} ⊐ⓧ[g] L2 → + ∨∨ ∃∃f,K2. K1 ⊐ⓧ[f] K2 & g = ⫯f & L2 = K2.ⓘ{I} + | ∃∃f,K2. K1 ⊐ⓧ[f] K2 & g = ↑f & L2 = K2.ⓧ. +#g #I #K1 #L2 #H +elim (pn_split g) * #f #Hf destruct +[ elim (scl_inv_push_sn … H) -H +| elim (scl_inv_next_sn … H) -H +] +/3 width=5 by ex3_2_intro, or_intror, or_introl/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma scl_fwd_bind_sn: ∀g,I1,K1,L2. K1.ⓘ{I1} ⊐ⓧ[g] L2 → + ∃∃I2,K2. K1 ⊐ⓧ[⫱g] K2 & L2 = K2.ⓘ{I2}. +#g #I1 #K1 #L2 +elim (pn_split g) * #f #Hf destruct #H +[ elim (scl_inv_push_sn … H) -H +| elim (scl_inv_next_sn … H) -H +] +/2 width=4 by ex2_2_intro/ +qed-. + +(* Basic properties *********************************************************) + +lemma scl_atom: ∀f. ⋆ ⊐ⓧ[f] ⋆. +/by sex_atom/ qed. + +lemma scl_push: ∀f,K1,K2. K1 ⊐ⓧ[f] K2 → ∀I. K1.ⓘ{I} ⊐ⓧ[⫯f] K2.ⓘ{I}. +#f #K1 #K2 #H * /3 width=1 by sex_push, ext2_unit, ext2_pair/ +qed. + +lemma scl_next: ∀f,K1,K2. K1 ⊐ⓧ[f] K2 → ∀I. K1.ⓘ{I} ⊐ⓧ[↑f] K2.ⓧ. +/2 width=1 by sex_next/ qed. + +lemma scl_eq_repl_back: ∀L1,L2. eq_repl_back … (λf. L1 ⊐ⓧ[f] L2). +/2 width=3 by sex_eq_repl_back/ qed-. + +lemma scl_eq_repl_fwd: ∀L1,L2. eq_repl_fwd … (λf. L1 ⊐ⓧ[f] L2). +/2 width=3 by sex_eq_repl_fwd/ qed-. + +(* Advanced properties ******************************************************) + +lemma scl_refl: ∀f. 𝐈⦃f⦄ → reflexive … (scl f). +#f #Hf #L elim L -L +/3 width=3 by scl_eq_repl_back, scl_push, eq_push_inv_isid/ +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/etc/scl/scl_scl.etc b/matita/matita/contribs/lambdadelta/static_2/etc/scl/scl_scl.etc new file mode 100644 index 000000000..6ca737bf2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/etc/scl/scl_scl.etc @@ -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 "static_2/relocation/scl.ma". + +(* CLEAR FOR LOCAL ENVIRONMENTS ON SELECTED ENTRIES *************************) + +(* Main properties **********************************************************) + +theorem scl_fix: ∀f,L1,L. L1 ⊐ⓧ[f] L → + ∀L2. L ⊐ⓧ[f] L2 → L = L2. +#f #L1 #L #H @(scl_ind … H) -f -L1 -L +[ #f #L2 #H + >(scl_inv_atom_sn … H) -L2 // +| #f #I #K1 #K2 #_ #IH #L2 #H + elim (scl_inv_push_sn … H) -H /3 width=1 by eq_f2/ +| #f #I #K1 #K2 #_ #IH #L2 #H + elim (scl_inv_next_sn … H) -H /3 width=1 by eq_f2/ +] +qed-. + +theorem scl_trans: ∀f. Transitive … (scl f). +#f #L1 #L #H1 #L2 #H2 +<(scl_fix … H1 … H2) -L2 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/etc/sh_lt.etc b/matita/matita/contribs/lambdadelta/static_2/etc/sh_lt.etc new file mode 100644 index 000000000..c623e79a6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/etc/sh_lt.etc @@ -0,0 +1,2 @@ +definition sh_N: sh ≝ mk_sh S …. +// defined. diff --git a/matita/matita/contribs/lambdadelta/static_2/etc/tueq/lifts_tueq.etc b/matita/matita/contribs/lambdadelta/static_2/etc/tueq/lifts_tueq.etc new file mode 100644 index 000000000..a9805a9e3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/etc/tueq/lifts_tueq.etc @@ -0,0 +1,80 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/syntax/tueq.ma". +include "static_2/relocation/lifts_lifts.ma". + +(* GENERIC RELOCATION FOR TERMS *********************************************) + +(* Properties with tail sort-irrelevant equivalence for terms ***************) + +lemma tueq_lifts_sn: liftable2_sn tueq. +#T1 #T2 #H elim H -T1 -T2 +[ #s1 #s2 #f #X #H >(lifts_inv_sort1 … H) -H + /3 width=3 by lifts_sort, tueq_sort, ex2_intro/ +| #i #f #X #H elim (lifts_inv_lref1 … H) -H + /3 width=3 by lifts_lref, tueq_lref, ex2_intro/ +| #l #f #X #H >(lifts_inv_gref1 … H) -H + /2 width=3 by lifts_gref, tueq_gref, ex2_intro/ +| #p #I #V #T1 #T2 #_ #IHT #f #X #H elim (lifts_inv_bind1 … H) -H + #W1 #U1 #HVW1 #HTU1 #H destruct + elim (IHT … HTU1) -T1 + /3 width=3 by lifts_bind, tueq_bind, ex2_intro/ +| #V #T1 #T2 #_ #IHT #f #X #H elim (lifts_inv_flat1 … H) -H + #W1 #U1 #HVW1 #HTU1 #H destruct + elim (IHT … HTU1) -T1 + /3 width=3 by lifts_flat, tueq_appl, ex2_intro/ +| #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f #X #H elim (lifts_inv_flat1 … H) -H + #W1 #U1 #HVW1 #HTU1 #H destruct + elim (IHV … HVW1) -V1 elim (IHT … HTU1) -T1 + /3 width=5 by lifts_flat, tueq_cast, ex2_intro/ +] +qed-. + +lemma tueq_lifts_dx: liftable2_dx tueq. +/3 width=3 by tueq_lifts_sn, liftable2_sn_dx, tueq_sym/ qed-. + +lemma tueq_lifts_bi: liftable2_bi tueq. +/3 width=6 by tueq_lifts_sn, liftable2_sn_bi/ qed-. + +(* Inversion lemmas with tail sort-irrelevant equivalence for terms *********) + +lemma tueq_inv_lifts_sn: deliftable2_sn tueq. +#U1 #U2 #H elim H -U1 -U2 +[ #s1 #s2 #f #X #H >(lifts_inv_sort2 … H) -H + /3 width=3 by lifts_sort, tueq_sort, ex2_intro/ +| #i #f #X #H elim (lifts_inv_lref2 … H) -H + /3 width=3 by lifts_lref, tueq_lref, ex2_intro/ +| #l #f #X #H >(lifts_inv_gref2 … H) -H + /2 width=3 by lifts_gref, tueq_gref, ex2_intro/ +| #p #I #W #U1 #U2 #_ #IHU #f #X #H elim (lifts_inv_bind2 … H) -H + #V1 #T1 #HVW1 #HTU1 #H destruct + elim (IHU … HTU1) -U1 + /3 width=3 by lifts_bind, tueq_bind, ex2_intro/ +| #W #U1 #U2 #_ #IHU #f #X #H elim (lifts_inv_flat2 … H) -H + #V1 #T1 #HVW1 #HTU1 #H destruct + elim (IHU … HTU1) -U1 + /3 width=3 by lifts_flat, tueq_appl, ex2_intro/ +| #W1 #W2 #U1 #U2 #_ #_ #IHW #IHU #f #X #H elim (lifts_inv_flat2 … H) -H + #V1 #T1 #HVW1 #HTU1 #H destruct + elim (IHW … HVW1) -W1 elim (IHU … HTU1) -U1 + /3 width=5 by lifts_flat, tueq_cast, ex2_intro/ +] +qed-. + +lemma tueq_inv_lifts_dx: deliftable2_dx tueq. +/3 width=3 by tueq_inv_lifts_sn, deliftable2_sn_dx, tueq_sym/ qed-. + +lemma tueq_inv_lifts_bi: deliftable2_bi tueq. +/3 width=6 by tueq_inv_lifts_sn, deliftable2_sn_bi/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/etc/tueq/tueq.etc b/matita/matita/contribs/lambdadelta/static_2/etc/tueq/tueq.etc new file mode 100644 index 000000000..49a6b2fdf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/etc/tueq/tueq.etc @@ -0,0 +1,143 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/notation/relations/approxeq_2.ma". +include "static_2/syntax/term.ma". + +(* TAIL SORT-IRRELEVANT EQUIVALENCE ON TERMS ********************************) + +inductive tueq: relation term ≝ +| tueq_sort: ∀s1,s2. tueq (⋆s1) (⋆s2) +| tueq_lref: ∀i. tueq (#i) (#i) +| tueq_gref: ∀l. tueq (§l) (§l) +| tueq_bind: ∀p,I,V,T1,T2. tueq T1 T2 → tueq (ⓑ{p,I}V.T1) (ⓑ{p,I}V.T2) +| tueq_appl: ∀V,T1,T2. tueq T1 T2 → tueq (ⓐV.T1) (ⓐV.T2) +| tueq_cast: ∀V1,V2,T1,T2. tueq V1 V2 → tueq T1 T2 → tueq (ⓝV1.T1) (ⓝV2.T2) +. + +interpretation + "context-free tail sort-irrelevant equivalence (term)" + 'ApproxEq T1 T2 = (tueq T1 T2). + +(* Basic properties *********************************************************) + +lemma tueq_refl: reflexive … tueq. +#T elim T -T * [|||| * ] +/2 width=1 by tueq_sort, tueq_lref, tueq_gref, tueq_bind, tueq_appl, tueq_cast/ +qed. + +lemma tueq_sym: symmetric … tueq. +#T1 #T2 #H elim H -T1 -T2 +/2 width=3 by tueq_sort, tueq_bind, tueq_appl, tueq_cast/ +qed-. + +(* Left basic inversion lemmas **********************************************) + +fact tueq_inv_sort1_aux: ∀X,Y. X ≅ Y → ∀s1. X = ⋆s1 → + ∃s2. Y = ⋆s2. +#X #Y * -X -Y +[ #s1 #s2 #s #H destruct /2 width=2 by ex_intro/ +| #i #s #H destruct +| #l #s #H destruct +| #p #I #V #T1 #T2 #_ #s #H destruct +| #V #T1 #T2 #_ #s #H destruct +| #V1 #V2 #T1 #T2 #_ #_ #s #H destruct +] +qed-. + +lemma tueq_inv_sort1: ∀Y,s1. ⋆s1 ≅ Y → + ∃s2. Y = ⋆s2. +/2 width=4 by tueq_inv_sort1_aux/ qed-. + +fact tueq_inv_lref1_aux: ∀X,Y. X ≅ Y → ∀i. X = #i → Y = #i. +#X #Y * -X -Y // +[ #s1 #s2 #j #H destruct +| #p #I #V #T1 #T2 #_ #j #H destruct +| #V #T1 #T2 #_ #j #H destruct +| #V1 #V2 #T1 #T2 #_ #_ #j #H destruct +] +qed-. + +lemma tueq_inv_lref1: ∀Y,i. #i ≅ Y → Y = #i. +/2 width=5 by tueq_inv_lref1_aux/ qed-. + +fact tueq_inv_gref1_aux: ∀X,Y. X ≅ Y → ∀l. X = §l → Y = §l. +#X #Y * -X -Y // +[ #s1 #s2 #k #H destruct +| #p #I #V #T1 #T2 #_ #k #H destruct +| #V #T1 #T2 #_ #k #H destruct +| #V1 #V2 #T1 #T2 #_ #_ #k #H destruct +] +qed-. + +lemma tueq_inv_gref1: ∀Y,l. §l ≅ Y → Y = §l. +/2 width=5 by tueq_inv_gref1_aux/ qed-. + +fact tueq_inv_bind1_aux: ∀X,Y. X ≅ Y → ∀p,I,V,T1. X = ⓑ{p,I}V.T1 → + ∃∃T2. T1 ≅ T2 & Y = ⓑ{p,I}V.T2. +#X #Y * -X -Y +[ #s1 #s2 #q #J #W #U1 #H destruct +| #i #q #J #W #U1 #H destruct +| #l #q #J #W #U1 #H destruct +| #p #I #V #T1 #T2 #HT #q #J #W #U1 #H destruct /2 width=3 by ex2_intro/ +| #V #T1 #T2 #_ #q #J #W #U1 #H destruct +| #V1 #V2 #T1 #T2 #_ #_ #q #J #W #U1 #H destruct +] +qed-. + +lemma tueq_inv_bind1: ∀p,I,V,T1,Y. ⓑ{p,I}V.T1 ≅ Y → + ∃∃T2. T1 ≅ T2 & Y = ⓑ{p,I}V.T2. +/2 width=3 by tueq_inv_bind1_aux/ qed-. + +fact tueq_inv_appl1_aux: ∀X,Y. X ≅ Y → ∀V,T1. X = ⓐV.T1 → + ∃∃T2. T1 ≅ T2 & Y = ⓐV.T2. +#X #Y * -X -Y +[ #s1 #s2 #W #U1 #H destruct +| #i #W #U1 #H destruct +| #l #W #U1 #H destruct +| #p #I #V #T1 #T2 #_ #W #U1 #H destruct +| #V #T1 #T2 #HT #W #U1 #H destruct /2 width=3 by ex2_intro/ +| #V1 #V2 #T1 #T2 #_ #_ #W #U1 #H destruct +] +qed-. + +lemma tueq_inv_appl1: ∀V,T1,Y. ⓐV.T1 ≅ Y → + ∃∃T2. T1 ≅ T2 & Y = ⓐV.T2. +/2 width=3 by tueq_inv_appl1_aux/ qed-. + +fact tueq_inv_cast1_aux: ∀X,Y. X ≅ Y → ∀V1,T1. X = ⓝV1.T1 → + ∃∃V2,T2. V1 ≅ V2 & T1 ≅ T2 & Y = ⓝV2.T2. +#X #Y * -X -Y +[ #s1 #s2 #W1 #U1 #H destruct +| #i #W1 #U1 #H destruct +| #l #W1 #U1 #H destruct +| #p #I #V #T1 #T2 #_ #W1 #U1 #H destruct +| #V #T1 #T2 #_ #W1 #U1 #H destruct +| #V1 #V2 #T1 #T2 #HV #HT #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/ +] +qed-. + +lemma tueq_inv_cast1: ∀V1,T1,Y. ⓝV1.T1 ≅ Y → + ∃∃V2,T2. V1 ≅ V2 & T1 ≅ T2 & Y = ⓝV2.T2. +/2 width=3 by tueq_inv_cast1_aux/ qed-. + +(* Right basic inversion lemmas *********************************************) + +lemma tueq_inv_bind2: ∀p,I,V,T2,X1. X1 ≅ ⓑ{p,I}V.T2 → + ∃∃T1. T1 ≅ T2 & X1 = ⓑ{p,I}V.T1. +#p #I #V #T2 #X1 #H +elim (tueq_inv_bind1 p I V T2 X1) +[ #T1 #HT #H destruct ] +/3 width=3 by tueq_sym, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/etc/tueq/tueq_tueq.etc b/matita/matita/contribs/lambdadelta/static_2/etc/tueq/tueq_tueq.etc new file mode 100644 index 000000000..4d8d21f6c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/etc/tueq/tueq_tueq.etc @@ -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 "static_2/syntax/tueq.ma". + +(* TAIL SORT-IRRELEVANT EQUIVALENCE ON TERMS ********************************) + +(* Main properties **********************************************************) + +theorem tueq_trans: Transitive … tueq. +#T1 #T #H elim H -T1 -T +[ #s1 #s #X #H + elim (tueq_inv_sort1 … H) -s /2 width=1 by tueq_sort/ +| #i1 #i #H // +| #l1 #l #H // +| #p #I #V #T1 #T #_ #IHT #X #H + elim (tueq_inv_bind1 … H) -H /3 width=1 by tueq_bind/ +| #V #T1 #T #_ #IHT #X #H + elim (tueq_inv_appl1 … H) -H /3 width=1 by tueq_appl/ +| #V1 #V #T1 #T #_ #_ #IHV #IHT #X #H + elim (tueq_inv_cast1 … H) -H /3 width=1 by tueq_cast/ +] +qed-. + +theorem tueq_canc_sn: left_cancellable … tueq. +/3 width=3 by tueq_trans, tueq_sym/ qed-. + +theorem tueq_canc_dx: right_cancellable … tueq. +/3 width=3 by tueq_trans, tueq_sym/ qed-. + +theorem tueq_repl: ∀T1,T2. T1 ≅ T2 → + ∀U1. T1 ≅ U1 → ∀U2. T2 ≅ U2 → U1 ≅ U2. +/3 width=3 by tueq_canc_sn, tueq_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs.ma b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs.ma index 8beb5bc3f..a53ee2c82 100644 --- a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs.ma +++ b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs.ma @@ -25,50 +25,50 @@ interpretation "iterated extension on referred entries (local environment)" (* Basic properties *********************************************************) -lemma rexs_step_dx: ∀R,L1,L,T. L1 ⪤*[R, T] L → - ∀L2. L ⪤[R, T] L2 → L1 ⪤*[R, T] L2. +lemma rexs_step_dx: ∀R,L1,L,T. L1 ⪤*[R,T] L → + ∀L2. L ⪤[R,T] L2 → L1 ⪤*[R,T] L2. #R #L1 #L2 #T #HL1 #L2 @step @HL1 (**) (* auto fails *) qed-. -lemma rexs_step_sn: ∀R,L1,L,T. L1 ⪤[R, T] L → - ∀L2. L ⪤*[R, T] L2 → L1 ⪤*[R, T] L2. +lemma rexs_step_sn: ∀R,L1,L,T. L1 ⪤[R,T] L → + ∀L2. L ⪤*[R,T] L2 → L1 ⪤*[R,T] L2. #R #L1 #L2 #T #HL1 #L2 @TC_strap @HL1 (**) (* auto fails *) qed-. -lemma rexs_atom: ∀R,I. ⋆ ⪤*[R, ⓪{I}] ⋆. +lemma rexs_atom: ∀R,I. ⋆ ⪤*[R,⓪{I}] ⋆. /2 width=1 by inj/ qed. lemma rexs_sort: ∀R,I,L1,L2,V1,V2,s. - L1 ⪤*[R, ⋆s] L2 → L1.ⓑ{I}V1 ⪤*[R, ⋆s] L2.ⓑ{I}V2. + L1 ⪤*[R,⋆s] L2 → L1.ⓑ{I}V1 ⪤*[R,⋆s] L2.ⓑ{I}V2. #R #I #L1 #L2 #V1 #V2 #s #H elim H -L2 /3 width=4 by rex_sort, rexs_step_dx, inj/ qed. lemma rexs_pair: ∀R. (∀L. reflexive … (R L)) → - ∀I,L1,L2,V. L1 ⪤*[R, V] L2 → - L1.ⓑ{I}V ⪤*[R, #0] L2.ⓑ{I}V. + ∀I,L1,L2,V. L1 ⪤*[R,V] L2 → + L1.ⓑ{I}V ⪤*[R,#0] L2.ⓑ{I}V. #R #HR #I #L1 #L2 #V #H elim H -L2 /3 width=5 by rex_pair, rexs_step_dx, inj/ qed. -lemma rexs_unit: ∀R,f,I,L1,L2. 𝐈⦃f⦄ → L1 ⪤[cext2 R, cfull, f] L2 → - L1.ⓤ{I} ⪤*[R, #0] L2.ⓤ{I}. +lemma rexs_unit: ∀R,f,I,L1,L2. 𝐈⦃f⦄ → L1 ⪤[cext2 R,cfull,f] L2 → + L1.ⓤ{I} ⪤*[R,#0] L2.ⓤ{I}. /3 width=3 by rex_unit, inj/ qed. lemma rexs_lref: ∀R,I,L1,L2,V1,V2,i. - L1 ⪤*[R, #i] L2 → L1.ⓑ{I}V1 ⪤*[R, #↑i] L2.ⓑ{I}V2. + L1 ⪤*[R,#i] L2 → L1.ⓑ{I}V1 ⪤*[R,#↑i] L2.ⓑ{I}V2. #R #I #L1 #L2 #V1 #V2 #i #H elim H -L2 /3 width=4 by rex_lref, rexs_step_dx, inj/ qed. lemma rexs_gref: ∀R,I,L1,L2,V1,V2,l. - L1 ⪤*[R, §l] L2 → L1.ⓑ{I}V1 ⪤*[R, §l] L2.ⓑ{I}V2. + L1 ⪤*[R,§l] L2 → L1.ⓑ{I}V1 ⪤*[R,§l] L2.ⓑ{I}V2. #R #I #L1 #L2 #V1 #V2 #l #H elim H -L2 /3 width=4 by rex_gref, rexs_step_dx, inj/ qed. lemma rexs_co: ∀R1,R2. (∀L,T1,T2. R1 L T1 T2 → R2 L T1 T2) → - ∀L1,L2,T. L1 ⪤*[R1, T] L2 → L1 ⪤*[R2, T] L2. + ∀L1,L2,T. L1 ⪤*[R1,T] L2 → L1 ⪤*[R2,T] L2. #R1 #R2 #HR #L1 #L2 #T #H elim H -L2 /4 width=5 by rex_co, rexs_step_dx, inj/ qed-. @@ -76,19 +76,19 @@ qed-. (* Basic inversion lemmas ***************************************************) (* Basic_2A1: uses: TC_lpx_sn_inv_atom1 *) -lemma rexs_inv_atom_sn: ∀R,I,Y2. ⋆ ⪤*[R, ⓪{I}] Y2 → Y2 = ⋆. +lemma rexs_inv_atom_sn: ∀R,I,Y2. ⋆ ⪤*[R,⓪{I}] Y2 → Y2 = ⋆. #R #I #Y2 #H elim H -Y2 /3 width=3 by inj, rex_inv_atom_sn/ qed-. (* Basic_2A1: uses: TC_lpx_sn_inv_atom2 *) -lemma rexs_inv_atom_dx: ∀R,I,Y1. Y1 ⪤*[R, ⓪{I}] ⋆ → Y1 = ⋆. +lemma rexs_inv_atom_dx: ∀R,I,Y1. Y1 ⪤*[R,⓪{I}] ⋆ → Y1 = ⋆. #R #I #Y1 #H @(TC_ind_dx ??????? H) -Y1 /3 width=3 by inj, rex_inv_atom_dx/ qed-. -lemma rexs_inv_sort: ∀R,Y1,Y2,s. Y1 ⪤*[R, ⋆s] Y2 → +lemma rexs_inv_sort: ∀R,Y1,Y2,s. Y1 ⪤*[R,⋆s] Y2 → ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ - | ∃∃I1,I2,L1,L2. L1 ⪤*[R, ⋆s] L2 & + | ∃∃I1,I2,L1,L2. L1 ⪤*[R,⋆s] L2 & Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. #R #Y1 #Y2 #s #H elim H -Y2 [ #Y2 #H elim (rex_inv_sort … H) -H * @@ -104,9 +104,9 @@ lemma rexs_inv_sort: ∀R,Y1,Y2,s. Y1 ⪤*[R, ⋆s] Y2 → ] qed-. -lemma rexs_inv_gref: ∀R,Y1,Y2,l. Y1 ⪤*[R, §l] Y2 → +lemma rexs_inv_gref: ∀R,Y1,Y2,l. Y1 ⪤*[R,§l] Y2 → ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ - | ∃∃I1,I2,L1,L2. L1 ⪤*[R, §l] L2 & + | ∃∃I1,I2,L1,L2. L1 ⪤*[R,§l] L2 & Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. #R #Y1 #Y2 #l #H elim H -Y2 [ #Y2 #H elim (rex_inv_gref … H) -H * @@ -123,16 +123,16 @@ lemma rexs_inv_gref: ∀R,Y1,Y2,l. Y1 ⪤*[R, §l] Y2 → qed-. lemma rexs_inv_bind: ∀R. (∀L. reflexive … (R L)) → - ∀p,I,L1,L2,V,T. L1 ⪤*[R, ⓑ{p,I}V.T] L2 → - ∧∧ L1 ⪤*[R, V] L2 & L1.ⓑ{I}V ⪤*[R, T] L2.ⓑ{I}V. + ∀p,I,L1,L2,V,T. L1 ⪤*[R,ⓑ{p,I}V.T] L2 → + ∧∧ L1 ⪤*[R,V] L2 & L1.ⓑ{I}V ⪤*[R,T] L2.ⓑ{I}V. #R #HR #p #I #L1 #L2 #V #T #H elim H -L2 [ #L2 #H elim (rex_inv_bind … V ? H) -H /3 width=1 by inj, conj/ | #L #L2 #_ #H * elim (rex_inv_bind … V ? H) -H /3 width=3 by rexs_step_dx, conj/ ] qed-. -lemma rexs_inv_flat: ∀R,I,L1,L2,V,T. L1 ⪤*[R, ⓕ{I}V.T] L2 → - ∧∧ L1 ⪤*[R, V] L2 & L1 ⪤*[R, T] L2. +lemma rexs_inv_flat: ∀R,I,L1,L2,V,T. L1 ⪤*[R,ⓕ{I}V.T] L2 → + ∧∧ L1 ⪤*[R,V] L2 & L1 ⪤*[R,T] L2. #R #I #L1 #L2 #V #T #H elim H -L2 [ #L2 #H elim (rex_inv_flat … H) -H /3 width=1 by inj, conj/ | #L #L2 #_ #H * elim (rex_inv_flat … H) -H /3 width=3 by rexs_step_dx, conj/ @@ -141,32 +141,32 @@ qed-. (* Advanced inversion lemmas ************************************************) -lemma rexs_inv_sort_bind_sn: ∀R,I1,Y2,L1,s. L1.ⓘ{I1} ⪤*[R, ⋆s] Y2 → - ∃∃I2,L2. L1 ⪤*[R, ⋆s] L2 & Y2 = L2.ⓘ{I2}. +lemma rexs_inv_sort_bind_sn: ∀R,I1,Y2,L1,s. L1.ⓘ{I1} ⪤*[R,⋆s] Y2 → + ∃∃I2,L2. L1 ⪤*[R,⋆s] L2 & Y2 = L2.ⓘ{I2}. #R #I1 #Y2 #L1 #s #H elim (rexs_inv_sort … H) -H * [ #H destruct | #Z #I2 #Y1 #L2 #Hs #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rexs_inv_sort_bind_dx: ∀R,I2,Y1,L2,s. Y1 ⪤*[R, ⋆s] L2.ⓘ{I2} → - ∃∃I1,L1. L1 ⪤*[R, ⋆s] L2 & Y1 = L1.ⓘ{I1}. +lemma rexs_inv_sort_bind_dx: ∀R,I2,Y1,L2,s. Y1 ⪤*[R,⋆s] L2.ⓘ{I2} → + ∃∃I1,L1. L1 ⪤*[R,⋆s] L2 & Y1 = L1.ⓘ{I1}. #R #I2 #Y1 #L2 #s #H elim (rexs_inv_sort … H) -H * [ #_ #H destruct | #I1 #Z #L1 #Y2 #Hs #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rexs_inv_gref_bind_sn: ∀R,I1,Y2,L1,l. L1.ⓘ{I1} ⪤*[R, §l] Y2 → - ∃∃I2,L2. L1 ⪤*[R, §l] L2 & Y2 = L2.ⓘ{I2}. +lemma rexs_inv_gref_bind_sn: ∀R,I1,Y2,L1,l. L1.ⓘ{I1} ⪤*[R,§l] Y2 → + ∃∃I2,L2. L1 ⪤*[R,§l] L2 & Y2 = L2.ⓘ{I2}. #R #I1 #Y2 #L1 #l #H elim (rexs_inv_gref … H) -H * [ #H destruct | #Z #I2 #Y1 #L2 #Hl #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rexs_inv_gref_bind_dx: ∀R,I2,Y1,L2,l. Y1 ⪤*[R, §l] L2.ⓘ{I2} → - ∃∃I1,L1. L1 ⪤*[R, §l] L2 & Y1 = L1.ⓘ{I1}. +lemma rexs_inv_gref_bind_dx: ∀R,I2,Y1,L2,l. Y1 ⪤*[R,§l] L2.ⓘ{I2} → + ∃∃I1,L1. L1 ⪤*[R,§l] L2 & Y1 = L1.ⓘ{I1}. #R #I2 #Y1 #L2 #l #H elim (rexs_inv_gref … H) -H * [ #_ #H destruct | #I1 #Z #L1 #Y2 #Hl #H1 #H2 destruct /2 width=4 by ex2_2_intro/ @@ -175,18 +175,18 @@ qed-. (* Basic forward lemmas *****************************************************) -lemma rexs_fwd_pair_sn: ∀R,I,L1,L2,V,T. L1 ⪤*[R, ②{I}V.T] L2 → L1 ⪤*[R, V] L2. +lemma rexs_fwd_pair_sn: ∀R,I,L1,L2,V,T. L1 ⪤*[R,②{I}V.T] L2 → L1 ⪤*[R,V] L2. #R #I #L1 #L2 #V #T #H elim H -L2 /3 width=5 by rex_fwd_pair_sn, rexs_step_dx, inj/ qed-. lemma rexs_fwd_bind_dx: ∀R. (∀L. reflexive … (R L)) → - ∀p,I,L1,L2,V,T. L1 ⪤*[R, ⓑ{p,I}V.T] L2 → - L1.ⓑ{I}V ⪤*[R, T] L2.ⓑ{I}V. + ∀p,I,L1,L2,V,T. L1 ⪤*[R,ⓑ{p,I}V.T] L2 → + L1.ⓑ{I}V ⪤*[R,T] L2.ⓑ{I}V. #R #HR #p #I #L1 #L2 #V #T #H elim (rexs_inv_bind … H) -H // qed-. -lemma rexs_fwd_flat_dx: ∀R,I,L1,L2,V,T. L1 ⪤*[R, ⓕ{I}V.T] L2 → L1 ⪤*[R, T] L2. +lemma rexs_fwd_flat_dx: ∀R,I,L1,L2,V,T. L1 ⪤*[R,ⓕ{I}V.T] L2 → L1 ⪤*[R,T] L2. #R #I #L1 #L2 #V #T #H elim (rexs_inv_flat … H) -H // qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_drops.ma b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_drops.ma index 0b83c6431..11025a4a1 100644 --- a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_drops.ma @@ -19,19 +19,19 @@ include "static_2/i_static/rexs.ma". (* ITERATED EXTENSION ON REFERRED ENTRIES OF A CONTEXT-SENSITIVE REALTION ***) definition tc_f_dedropable_sn: predicate (relation3 lenv term term) ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → - ∀K2,T. K1 ⪤*[R, T] K2 → ∀U. ⬆*[f] T ≘ U → - ∃∃L2. L1 ⪤*[R, U] L2 & ⬇*[b, f] L2 ≘ K2 & L1 ≡[f] L2. + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → + ∀K2,T. K1 ⪤*[R,T] K2 → ∀U. ⬆*[f] T ≘ U → + ∃∃L2. L1 ⪤*[R,U] L2 & ⬇*[b,f] L2 ≘ K2 & L1 ≡[f] L2. definition tc_f_dropable_sn: predicate (relation3 lenv term term) ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → 𝐔⦃f⦄ → - ∀L2,U. L1 ⪤*[R, U] L2 → ∀T. ⬆*[f] T ≘ U → - ∃∃K2. K1 ⪤*[R, T] K2 & ⬇*[b, f] L2 ≘ K2. + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → 𝐔⦃f⦄ → + ∀L2,U. L1 ⪤*[R,U] L2 → ∀T. ⬆*[f] T ≘ U → + ∃∃K2. K1 ⪤*[R,T] K2 & ⬇*[b,f] L2 ≘ K2. definition tc_f_dropable_dx: predicate (relation3 lenv term term) ≝ - λR. ∀L1,L2,U. L1 ⪤*[R, U] L2 → - ∀b,f,K2. ⬇*[b, f] L2 ≘ K2 → 𝐔⦃f⦄ → ∀T. ⬆*[f] T ≘ U → - ∃∃K1. ⬇*[b, f] L1 ≘ K1 & K1 ⪤*[R, T] K2. + λR. ∀L1,L2,U. L1 ⪤*[R,U] L2 → + ∀b,f,K2. ⬇*[b,f] L2 ≘ K2 → 𝐔⦃f⦄ → ∀T. ⬆*[f] T ≘ U → + ∃∃K1. ⬇*[b,f] L1 ≘ K1 & K1 ⪤*[R,T] K2. (* Properties with generic slicing for local environments *******************) diff --git a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_fqup.ma b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_fqup.ma index c21d82017..fbb41879c 100644 --- a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_fqup.ma +++ b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_fqup.ma @@ -25,13 +25,13 @@ lemma rexs_refl: ∀R. c_reflexive … R → (* Basic_2A1: uses: TC_lpx_sn_pair TC_lpx_sn_pair_refl *) lemma rexs_pair_refl: ∀R. c_reflexive … R → - ∀L,V1,V2. CTC … R L V1 V2 → ∀I,T. L.ⓑ{I}V1 ⪤*[R, T] L.ⓑ{I}V2. + ∀L,V1,V2. CTC … R L V1 V2 → ∀I,T. L.ⓑ{I}V1 ⪤*[R,T] L.ⓑ{I}V2. #R #HR #L #V1 #V2 #H elim H -V2 /3 width=3 by rexs_step_dx, rex_pair_refl, inj/ qed. lemma rexs_tc: ∀R,L1,L2,T,f. 𝐈⦃f⦄ → TC … (sex cfull (cext2 R) f) L1 L2 → - L1 ⪤*[R, T] L2. + L1 ⪤*[R,T] L2. #R #L1 #L2 #T #f #Hf #H elim H -L2 [ elim (frees_total L1 T) | #L elim (frees_total L T) ] /5 width=7 by sex_sdj, rexs_step_dx, sdj_isid_sn, inj, ex2_intro/ @@ -41,16 +41,16 @@ qed. lemma rexs_ind_sn: ∀R. c_reflexive … R → ∀L1,T. ∀Q:predicate …. Q L1 → - (∀L,L2. L1 ⪤*[R, T] L → L ⪤[R, T] L2 → Q L → Q L2) → - ∀L2. L1 ⪤*[R, T] L2 → Q L2. + (∀L,L2. L1 ⪤*[R,T] L → L ⪤[R,T] L2 → Q L → Q L2) → + ∀L2. L1 ⪤*[R,T] L2 → Q L2. #R #HR #L1 #T #Q #HL1 #IHL1 #L2 #HL12 @(TC_star_ind … HL1 IHL1 … HL12) /2 width=1 by rex_refl/ qed-. lemma rexs_ind_dx: ∀R. c_reflexive … R → ∀L2,T. ∀Q:predicate …. Q L2 → - (∀L1,L. L1 ⪤[R, T] L → L ⪤*[R, T] L2 → Q L → Q L1) → - ∀L1. L1 ⪤*[R, T] L2 → Q L1. + (∀L1,L. L1 ⪤[R,T] L → L ⪤*[R,T] L2 → Q L → Q L1) → + ∀L1. L1 ⪤*[R,T] L2 → Q L1. #R #HR #L2 #Q #HL2 #IHL2 #L1 #HL12 @(TC_star_ind_dx … HL2 IHL2 … HL12) /2 width=4 by rex_refl/ qed-. @@ -58,8 +58,8 @@ qed-. (* Advanced inversion lemmas ************************************************) lemma rexs_inv_bind_void: ∀R. c_reflexive … R → - ∀p,I,L1,L2,V,T. L1 ⪤*[R, ⓑ{p,I}V.T] L2 → - ∧∧ L1 ⪤*[R, V] L2 & L1.ⓧ ⪤*[R, T] L2.ⓧ. + ∀p,I,L1,L2,V,T. L1 ⪤*[R,ⓑ{p,I}V.T] L2 → + ∧∧ L1 ⪤*[R,V] L2 & L1.ⓧ ⪤*[R,T] L2.ⓧ. #R #HR #p #I #L1 #L2 #V #T #H @(rexs_ind_sn … HR … H) -L2 [ /3 width=1 by rexs_refl, conj/ | #L #L2 #_ #H * elim (rex_inv_bind_void … H) -H /3 width=3 by rexs_step_dx, conj/ @@ -69,7 +69,7 @@ qed-. (* Advanced forward lemmas **************************************************) lemma rexs_fwd_bind_dx_void: ∀R. c_reflexive … R → - ∀p,I,L1,L2,V,T. L1 ⪤*[R, ⓑ{p,I}V.T] L2 → - L1.ⓧ ⪤*[R, T] L2.ⓧ. + ∀p,I,L1,L2,V,T. L1 ⪤*[R,ⓑ{p,I}V.T] L2 → + L1.ⓧ ⪤*[R,T] L2.ⓧ. #R #HR #p #I #L1 #L2 #V #T #H elim (rexs_inv_bind_void … H) -H // qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_length.ma b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_length.ma index a5c82f9f5..7e0bc2e01 100644 --- a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_length.ma @@ -20,7 +20,7 @@ include "static_2/i_static/rexs.ma". (* Forward lemmas with length for local environments ************************) (* Basic_2A1: uses: TC_lpx_sn_fwd_length *) -lemma rexs_fwd_length: ∀R,L1,L2,T. L1 ⪤*[R, T] L2 → |L1| = |L2|. +lemma rexs_fwd_length: ∀R,L1,L2,T. L1 ⪤*[R,T] L2 → |L1| = |L2|. #R #L1 #L2 #T #H elim H -L2 [ #L2 #HL12 >(rex_fwd_length … HL12) -HL12 // | #L #L2 #_ #HL2 #IHL1 diff --git a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_lex.ma b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_lex.ma index 4ac00b7a1..46d28f330 100644 --- a/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_lex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/i_static/rexs_lex.ma @@ -22,14 +22,14 @@ include "static_2/i_static/rexs_fqup.ma". (* Properties with generic extension of a context sensitive relation ********) lemma rexs_lex: ∀R. c_reflexive … R → - ∀L1,L2,T. L1 ⪤[CTC … R] L2 → L1 ⪤*[R, T] L2. + ∀L1,L2,T. L1 ⪤[CTC … R] L2 → L1 ⪤*[R,T] L2. #R #HR #L1 #L2 #T * /5 width=7 by rexs_tc, sex_inv_tc_dx, sex_co, ext2_inv_tc, ext2_refl/ qed. lemma rexs_lex_req: ∀R. c_reflexive … R → ∀L1,L. L1 ⪤[CTC … R] L → ∀L2,T. L ≡[T] L2 → - L1 ⪤*[R, T] L2. + L1 ⪤*[R,T] L2. /3 width=3 by rexs_lex, rexs_step_dx, req_fwd_rex/ qed. (* Inversion lemmas with generic extension of a context sensitive relation **) @@ -39,7 +39,7 @@ lemma rexs_inv_lex_req: ∀R. c_reflexive … R → rex_fsge_compatible R → s_rs_transitive … R (λ_.lex R) → req_transitive R → - ∀L1,L2,T. L1 ⪤*[R, T] L2 → + ∀L1,L2,T. L1 ⪤*[R,T] L2 → ∃∃L. L1 ⪤[CTC … R] L & L ≡[T] L2. #R #H1R #H2R #H3R #H4R #L1 #L2 #T #H lapply (s_rs_transitive_lex_inv_isid … H3R) -H3R #H3R diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabbr_2.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabbr_2.ma index 1eea5226e..1c31b90fc 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabbr_2.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabbr_2.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( L. break ⓓ T1 )" +notation "hvbox( L. ⓓ break T1 )" left associative with precedence 50 for @{ 'DxAbbr $L $T1 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabst_2.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabst_2.ma index 3bb334e86..6c385b47b 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabst_2.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxabst_2.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( L. break ⓛ T1 )" +notation "hvbox( L. ⓛ break T1 )" left associative with precedence 51 for @{ 'DxAbst $L $T1 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind1_2.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind1_2.ma index 5e78eeb18..a427352dd 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind1_2.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind1_2.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( L. break ⓤ { term 46 I } )" +notation "hvbox( L. ⓤ { break term 46 I } )" non associative with precedence 47 for @{ 'DxBind1 $L $I }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind2_3.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind2_3.ma index 6800d8e5c..3b9e43699 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind2_3.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/dxbind2_3.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( L. break ⓑ { term 46 I } break term 49 T1 )" +notation "hvbox( L. ⓑ { break term 46 I } break term 49 T1 )" non associative with precedence 48 for @{ 'DxBind2 $L $I $T1 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/omega_0.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/omega_0.ma new file mode 100644 index 000000000..7894ebc68 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/omega_0.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "𝛚" + non associative with precedence 46 + for @{ 'Omega }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/one_0.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/one_0.ma new file mode 100644 index 000000000..e36371a83 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/one_0.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "𝟏" + non associative with precedence 46 + for @{ 'One }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/two_0.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/two_0.ma new file mode 100644 index 000000000..60e31d6b7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/two_0.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "𝟐" + non associative with precedence 46 + for @{ 'Two }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/functions/upspoon_2.ma b/matita/matita/contribs/lambdadelta/static_2/notation/functions/upspoon_2.ma new file mode 100644 index 000000000..c04bf2278 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/functions/upspoon_2.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⫯[ term 46 h ] break term 46 s )" + non associative with precedence 46 + for @{ 'UpSpoon $h $s }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/approxeq_2.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/approxeq_2.ma new file mode 100644 index 000000000..4cb121630 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/approxeq_2.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( T1 ≅ break term 46 T2 )" + non associative with precedence 45 + for @{ 'ApproxEq $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/freeplus_3.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/freeplus_3.ma new file mode 100644 index 000000000..19dc43e01 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/freeplus_3.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L ⊢ 𝐅 + ⦃ break term 46 T ⦄ ≘ break term 46 f )" + non associative with precedence 45 + for @{ 'FreePlus $L $T $f }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/freestar_3.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/freestar_3.ma deleted file mode 100644 index 02c33853c..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/freestar_3.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( L ⊢ 𝐅 * ⦃ break term 46 T ⦄ ≘ break term 46 f )" - non associative with precedence 45 - for @{ 'FreeStar $L $T $f }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/lrsubeqf_4.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/lrsubeqf_4.ma index 413553ccd..9847c8531 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/lrsubeqf_4.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/lrsubeqf_4.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 L1, break term 46 f1 ⦄ ⫃ 𝐅* ⦃ break term 46 L2, break term 46 f2 ⦄ )" +notation "hvbox( ⦃ term 46 L1, break term 46 f1 ⦄ ⫃ 𝐅+ ⦃ break term 46 L2, break term 46 f2 ⦄ )" non associative with precedence 45 for @{ 'LRSubEqF $L1 $f1 $L2 $f2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/rlift_4.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/rlift_4.ma new file mode 100644 index 000000000..fb0fc24a7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/rlift_4.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⬆[ term 46 m, break term 46 n ] break term 46 T1 ≘ break term 46 T2 )" + non associative with precedence 45 + for @{ 'RLift $m $n $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_2.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_2.ma new file mode 100644 index 000000000..04a438adc --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_2.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( T1 ≛ break term 46 T2 )" + non associative with precedence 45 + for @{ 'StarEq $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_3.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_3.ma new file mode 100644 index 000000000..fbb650ac6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_3.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L ⊢ break term 46 T1 ≛ break term 46 T2 )" + non associative with precedence 45 + for @{ 'StarEq $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_4.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_4.ma deleted file mode 100644 index 0f67a8382..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_4.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( T1 ≛ [ break term 46 h, break term 46 o ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'StarEq $h $o $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_5.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_5.ma deleted file mode 100644 index 553205960..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareq_5.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( L ⊢ break term 46 T1 ≛ [ break term 46 h, break term 46 o ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'StarEq $h $o $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_3.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_3.ma new file mode 100644 index 000000000..5d7cb99f1 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_3.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L1 ≛ [ break term 46 T ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'StarEqSn $T $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_5.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_5.ma deleted file mode 100644 index af611f765..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_5.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( L1 ≛ [ break term 46 h, break term 46 o, break term 46 T ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'StarEqSn $h $o $T $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_6.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_6.ma new file mode 100644 index 000000000..71174825e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_6.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≛ ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'StarEqSn $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_8.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_8.ma deleted file mode 100644 index 6e4ed5d11..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/stareqsn_8.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≛ [ break term 46 h, break term 46 o ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'StarEqSn $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_6.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_6.ma index 72533dc3c..a8dfc7e72 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_6.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⊐ ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂ ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTerm $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_7.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_7.ma index 2e12296b4..011caa06b 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_7.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/supterm_7.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⊐ [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂ [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTerm $b $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_6.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_6.ma index 62a8cbb0b..f52c205c3 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_6.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⊐⸮ ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂⸮ ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTermOpt $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_7.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_7.ma index dd6db78c2..60b22c90d 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_7.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermopt_7.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⊐⸮ [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂⸮ [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTermOpt $b $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_6.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_6.ma index 57bdc3d94..5b60a957d 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_6.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, term 46 L1, break term 46 T1 ⦄ ⊐ + ⦃ break term 46 G2, term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂ + ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTermPlus $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_7.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_7.ma index 3bbe31a83..d4b9a8669 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_7.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermplus_7.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, term 46 L1, break term 46 T1 ⦄ ⊐ + [ break term 46 b ] ⦃ break term 46 G2, term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂ + [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTermPlus $b $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_6.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_6.ma index a0bf55faa..1a9c2442b 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_6.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, term 46 L1, break term 46 T1 ⦄ ⊐ * ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂ * ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTermStar $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_7.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_7.ma index 865019860..3d137035c 100644 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_7.ma +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/suptermstar_7.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, term 46 L1, break term 46 T1 ⦄ ⊐ * [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⬂ * [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'SupTermStar $b $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/topiso_2.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/topiso_2.ma new file mode 100644 index 000000000..35dd47569 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/notation/relations/topiso_2.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( T1 ⩳ break term 46 T2 )" + non associative with precedence 45 + for @{ 'TopIso $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/notation/relations/topiso_4.ma b/matita/matita/contribs/lambdadelta/static_2/notation/relations/topiso_4.ma deleted file mode 100644 index e8c080f6a..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/notation/relations/topiso_4.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( T1 ⩳ [ break term 46 h, break term 46 o ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'TopIso $h $o $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma index 939aeb534..dc4d6d75c 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops.ma @@ -39,68 +39,68 @@ interpretation "generic slicing (local environment)" 'RDropStar b f L1 L2 = (drops b f L1 L2). definition d_liftable1: predicate (relation2 lenv term) ≝ - λR. ∀K,T. R K T → ∀b,f,L. ⬇*[b, f] L ≘ K → + λR. ∀K,T. R K T → ∀b,f,L. ⬇*[b,f] L ≘ K → ∀U. ⬆*[f] T ≘ U → R L U. definition d_liftable1_isuni: predicate (relation2 lenv term) ≝ - λR. ∀K,T. R K T → ∀b,f,L. ⬇*[b, f] L ≘ K → 𝐔⦃f⦄ → + λR. ∀K,T. R K T → ∀b,f,L. ⬇*[b,f] L ≘ K → 𝐔⦃f⦄ → ∀U. ⬆*[f] T ≘ U → R L U. definition d_deliftable1: predicate (relation2 lenv term) ≝ - λR. ∀L,U. R L U → ∀b,f,K. ⬇*[b, f] L ≘ K → + λR. ∀L,U. R L U → ∀b,f,K. ⬇*[b,f] L ≘ K → ∀T. ⬆*[f] T ≘ U → R K T. definition d_deliftable1_isuni: predicate (relation2 lenv term) ≝ - λR. ∀L,U. R L U → ∀b,f,K. ⬇*[b, f] L ≘ K → 𝐔⦃f⦄ → + λR. ∀L,U. R L U → ∀b,f,K. ⬇*[b,f] L ≘ K → 𝐔⦃f⦄ → ∀T. ⬆*[f] T ≘ U → R K T. definition d_liftable2_sn: ∀C:Type[0]. ∀S:rtmap → relation C. predicate (lenv → relation C) ≝ - λC,S,R. ∀K,T1,T2. R K T1 T2 → ∀b,f,L. ⬇*[b, f] L ≘ K → + λC,S,R. ∀K,T1,T2. R K T1 T2 → ∀b,f,L. ⬇*[b,f] L ≘ K → ∀U1. S f T1 U1 → ∃∃U2. S f T2 U2 & R L U1 U2. definition d_deliftable2_sn: ∀C:Type[0]. ∀S:rtmap → relation C. predicate (lenv → relation C) ≝ - λC,S,R. ∀L,U1,U2. R L U1 U2 → ∀b,f,K. ⬇*[b, f] L ≘ K → + λC,S,R. ∀L,U1,U2. R L U1 U2 → ∀b,f,K. ⬇*[b,f] L ≘ K → ∀T1. S f T1 U1 → ∃∃T2. S f T2 U2 & R K T1 T2. definition d_liftable2_bi: ∀C:Type[0]. ∀S:rtmap → relation C. predicate (lenv → relation C) ≝ - λC,S,R. ∀K,T1,T2. R K T1 T2 → ∀b,f,L. ⬇*[b, f] L ≘ K → + λC,S,R. ∀K,T1,T2. R K T1 T2 → ∀b,f,L. ⬇*[b,f] L ≘ K → ∀U1. S f T1 U1 → ∀U2. S f T2 U2 → R L U1 U2. definition d_deliftable2_bi: ∀C:Type[0]. ∀S:rtmap → relation C. predicate (lenv → relation C) ≝ - λC,S,R. ∀L,U1,U2. R L U1 U2 → ∀b,f,K. ⬇*[b, f] L ≘ K → + λC,S,R. ∀L,U1,U2. R L U1 U2 → ∀b,f,K. ⬇*[b,f] L ≘ K → ∀T1. S f T1 U1 → ∀T2. S f T2 U2 → R K T1 T2. definition co_dropable_sn: predicate (rtmap → relation lenv) ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → 𝐔⦃f⦄ → + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → 𝐔⦃f⦄ → ∀f2,L2. R f2 L1 L2 → ∀f1. f ~⊚ f1 ≘ f2 → - ∃∃K2. R f1 K1 K2 & ⬇*[b, f] L2 ≘ K2. + ∃∃K2. R f1 K1 K2 & ⬇*[b,f] L2 ≘ K2. definition co_dropable_dx: predicate (rtmap → relation lenv) ≝ λR. ∀f2,L1,L2. R f2 L1 L2 → - ∀b,f,K2. ⬇*[b, f] L2 ≘ K2 → 𝐔⦃f⦄ → + ∀b,f,K2. ⬇*[b,f] L2 ≘ K2 → 𝐔⦃f⦄ → ∀f1. f ~⊚ f1 ≘ f2 → - ∃∃K1. ⬇*[b, f] L1 ≘ K1 & R f1 K1 K2. + ∃∃K1. ⬇*[b,f] L1 ≘ K1 & R f1 K1 K2. definition co_dedropable_sn: predicate (rtmap → relation lenv) ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → ∀f1,K2. R f1 K1 K2 → + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → ∀f1,K2. R f1 K1 K2 → ∀f2. f ~⊚ f1 ≘ f2 → - ∃∃L2. R f2 L1 L2 & ⬇*[b, f] L2 ≘ K2 & L1 ≡[f] L2. + ∃∃L2. R f2 L1 L2 & ⬇*[b,f] L2 ≘ K2 & L1 ≡[f] L2. (* Basic properties *********************************************************) -lemma drops_atom_F: ∀f. ⬇*[Ⓕ, f] ⋆ ≘ ⋆. +lemma drops_atom_F: ∀f. ⬇*[Ⓕ,f] ⋆ ≘ ⋆. #f @drops_atom #H destruct qed. -lemma drops_eq_repl_back: ∀b,L1,L2. eq_repl_back … (λf. ⬇*[b, f] L1 ≘ L2). +lemma drops_eq_repl_back: ∀b,L1,L2. eq_repl_back … (λf. ⬇*[b,f] L1 ≘ L2). #b #L1 #L2 #f1 #H elim H -f1 -L1 -L2 [ /4 width=3 by drops_atom, isid_eq_repl_back/ | #f1 #I #L1 #L2 #_ #IH #f2 #H elim (eq_inv_nx … H) -H @@ -110,23 +110,23 @@ lemma drops_eq_repl_back: ∀b,L1,L2. eq_repl_back … (λf. ⬇*[b, f] L1 ≘ L ] qed-. -lemma drops_eq_repl_fwd: ∀b,L1,L2. eq_repl_fwd … (λf. ⬇*[b, f] L1 ≘ L2). +lemma drops_eq_repl_fwd: ∀b,L1,L2. eq_repl_fwd … (λf. ⬇*[b,f] L1 ≘ L2). #b #L1 #L2 @eq_repl_sym /2 width=3 by drops_eq_repl_back/ (**) (* full auto fails *) qed-. (* Basic_2A1: includes: drop_FT *) -lemma drops_TF: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → ⬇*[Ⓕ, f] L1 ≘ L2. +lemma drops_TF: ∀f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → ⬇*[Ⓕ,f] L1 ≘ L2. #f #L1 #L2 #H elim H -f -L1 -L2 /3 width=1 by drops_atom, drops_drop, drops_skip/ qed. (* Basic_2A1: includes: drop_gen *) -lemma drops_gen: ∀b,f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → ⬇*[b, f] L1 ≘ L2. +lemma drops_gen: ∀b,f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → ⬇*[b,f] L1 ≘ L2. * /2 width=1 by drops_TF/ qed-. (* Basic_2A1: includes: drop_T *) -lemma drops_F: ∀b,f,L1,L2. ⬇*[b, f] L1 ≘ L2 → ⬇*[Ⓕ, f] L1 ≘ L2. +lemma drops_F: ∀b,f,L1,L2. ⬇*[b,f] L1 ≘ L2 → ⬇*[Ⓕ,f] L1 ≘ L2. * /2 width=1 by drops_TF/ qed-. @@ -146,7 +146,7 @@ qed-. (* Basic inversion lemmas ***************************************************) -fact drops_inv_atom1_aux: ∀b,f,X,Y. ⬇*[b, f] X ≘ Y → X = ⋆ → +fact drops_inv_atom1_aux: ∀b,f,X,Y. ⬇*[b,f] X ≘ Y → X = ⋆ → Y = ⋆ ∧ (b = Ⓣ → 𝐈⦃f⦄). #b #f #X #Y * -f -X -Y [ /3 width=1 by conj/ @@ -157,11 +157,11 @@ qed-. (* Basic_1: includes: drop_gen_sort *) (* Basic_2A1: includes: drop_inv_atom1 *) -lemma drops_inv_atom1: ∀b,f,Y. ⬇*[b, f] ⋆ ≘ Y → Y = ⋆ ∧ (b = Ⓣ → 𝐈⦃f⦄). +lemma drops_inv_atom1: ∀b,f,Y. ⬇*[b,f] ⋆ ≘ Y → Y = ⋆ ∧ (b = Ⓣ → 𝐈⦃f⦄). /2 width=3 by drops_inv_atom1_aux/ qed-. -fact drops_inv_drop1_aux: ∀b,f,X,Y. ⬇*[b, f] X ≘ Y → ∀g,I,K. X = K.ⓘ{I} → f = ↑g → - ⬇*[b, g] K ≘ Y. +fact drops_inv_drop1_aux: ∀b,f,X,Y. ⬇*[b,f] X ≘ Y → ∀g,I,K. X = K.ⓘ{I} → f = ↑g → + ⬇*[b,g] K ≘ Y. #b #f #X #Y * -f -X -Y [ #f #Hf #g #J #K #H destruct | #f #I #L1 #L2 #HL #g #J #K #H1 #H2 <(injective_next … H2) -g destruct // @@ -171,11 +171,11 @@ qed-. (* Basic_1: includes: drop_gen_drop *) (* Basic_2A1: includes: drop_inv_drop1_lt drop_inv_drop1 *) -lemma drops_inv_drop1: ∀b,f,I,K,Y. ⬇*[b, ↑f] K.ⓘ{I} ≘ Y → ⬇*[b, f] K ≘ Y. +lemma drops_inv_drop1: ∀b,f,I,K,Y. ⬇*[b,↑f] K.ⓘ{I} ≘ Y → ⬇*[b,f] K ≘ Y. /2 width=6 by drops_inv_drop1_aux/ qed-. -fact drops_inv_skip1_aux: ∀b,f,X,Y. ⬇*[b, f] X ≘ Y → ∀g,I1,K1. X = K1.ⓘ{I1} → f = ⫯g → - ∃∃I2,K2. ⬇*[b, g] K1 ≘ K2 & ⬆*[g] I2 ≘ I1 & Y = K2.ⓘ{I2}. +fact drops_inv_skip1_aux: ∀b,f,X,Y. ⬇*[b,f] X ≘ Y → ∀g,I1,K1. X = K1.ⓘ{I1} → f = ⫯g → + ∃∃I2,K2. ⬇*[b,g] K1 ≘ K2 & ⬆*[g] I2 ≘ I1 & Y = K2.ⓘ{I2}. #b #f #X #Y * -f -X -Y [ #f #Hf #g #J1 #K1 #H destruct | #f #I #L1 #L2 #_ #g #J1 #K1 #_ #H2 elim (discr_next_push … H2) @@ -186,12 +186,12 @@ qed-. (* Basic_1: includes: drop_gen_skip_l *) (* Basic_2A1: includes: drop_inv_skip1 *) -lemma drops_inv_skip1: ∀b,f,I1,K1,Y. ⬇*[b, ⫯f] K1.ⓘ{I1} ≘ Y → - ∃∃I2,K2. ⬇*[b, f] K1 ≘ K2 & ⬆*[f] I2 ≘ I1 & Y = K2.ⓘ{I2}. +lemma drops_inv_skip1: ∀b,f,I1,K1,Y. ⬇*[b,⫯f] K1.ⓘ{I1} ≘ Y → + ∃∃I2,K2. ⬇*[b,f] K1 ≘ K2 & ⬆*[f] I2 ≘ I1 & Y = K2.ⓘ{I2}. /2 width=5 by drops_inv_skip1_aux/ qed-. -fact drops_inv_skip2_aux: ∀b,f,X,Y. ⬇*[b, f] X ≘ Y → ∀g,I2,K2. Y = K2.ⓘ{I2} → f = ⫯g → - ∃∃I1,K1. ⬇*[b, g] K1 ≘ K2 & ⬆*[g] I2 ≘ I1 & X = K1.ⓘ{I1}. +fact drops_inv_skip2_aux: ∀b,f,X,Y. ⬇*[b,f] X ≘ Y → ∀g,I2,K2. Y = K2.ⓘ{I2} → f = ⫯g → + ∃∃I1,K1. ⬇*[b,g] K1 ≘ K2 & ⬆*[g] I2 ≘ I1 & X = K1.ⓘ{I1}. #b #f #X #Y * -f -X -Y [ #f #Hf #g #J2 #K2 #H destruct | #f #I #L1 #L2 #_ #g #J2 #K2 #_ #H2 elim (discr_next_push … H2) @@ -202,14 +202,14 @@ qed-. (* Basic_1: includes: drop_gen_skip_r *) (* Basic_2A1: includes: drop_inv_skip2 *) -lemma drops_inv_skip2: ∀b,f,I2,X,K2. ⬇*[b, ⫯f] X ≘ K2.ⓘ{I2} → - ∃∃I1,K1. ⬇*[b, f] K1 ≘ K2 & ⬆*[f] I2 ≘ I1 & X = K1.ⓘ{I1}. +lemma drops_inv_skip2: ∀b,f,I2,X,K2. ⬇*[b,⫯f] X ≘ K2.ⓘ{I2} → + ∃∃I1,K1. ⬇*[b,f] K1 ≘ K2 & ⬆*[f] I2 ≘ I1 & X = K1.ⓘ{I1}. /2 width=5 by drops_inv_skip2_aux/ qed-. (* Basic forward lemmas *****************************************************) -fact drops_fwd_drop2_aux: ∀b,f2,X,Y. ⬇*[b, f2] X ≘ Y → ∀I,K. Y = K.ⓘ{I} → - ∃∃f1,f. 𝐈⦃f1⦄ & f2 ⊚ ↑f1 ≘ f & ⬇*[b, f] X ≘ K. +fact drops_fwd_drop2_aux: ∀b,f2,X,Y. ⬇*[b,f2] X ≘ Y → ∀I,K. Y = K.ⓘ{I} → + ∃∃f1,f. 𝐈⦃f1⦄ & f2 ⊚ ↑f1 ≘ f & ⬇*[b,f] X ≘ K. #b #f2 #X #Y #H elim H -f2 -X -Y [ #f2 #Hf2 #J #K #H destruct | #f2 #I #L1 #L2 #_ #IHL #J #K #H elim (IHL … H) -IHL @@ -219,14 +219,14 @@ fact drops_fwd_drop2_aux: ∀b,f2,X,Y. ⬇*[b, f2] X ≘ Y → ∀I,K. Y = K.ⓘ ] qed-. -lemma drops_fwd_drop2: ∀b,f2,I,X,K. ⬇*[b, f2] X ≘ K.ⓘ{I} → - ∃∃f1,f. 𝐈⦃f1⦄ & f2 ⊚ ↑f1 ≘ f & ⬇*[b, f] X ≘ K. +lemma drops_fwd_drop2: ∀b,f2,I,X,K. ⬇*[b,f2] X ≘ K.ⓘ{I} → + ∃∃f1,f. 𝐈⦃f1⦄ & f2 ⊚ ↑f1 ≘ f & ⬇*[b,f] X ≘ K. /2 width=4 by drops_fwd_drop2_aux/ qed-. (* Properties with test for identity ****************************************) (* Basic_2A1: includes: drop_refl *) -lemma drops_refl: ∀b,L,f. 𝐈⦃f⦄ → ⬇*[b, f] L ≘ L. +lemma drops_refl: ∀b,L,f. 𝐈⦃f⦄ → ⬇*[b,f] L ≘ L. #b #L elim L -L /2 width=1 by drops_atom/ #L #I #IHL #f #Hf elim (isid_inv_gen … Hf) -Hf /3 width=1 by drops_skip, liftsb_refl/ @@ -236,15 +236,15 @@ qed. (* Basic_1: includes: drop_gen_refl *) (* Basic_2A1: includes: drop_inv_O2 *) -lemma drops_fwd_isid: ∀b,f,L1,L2. ⬇*[b, f] L1 ≘ L2 → 𝐈⦃f⦄ → L1 = L2. +lemma drops_fwd_isid: ∀b,f,L1,L2. ⬇*[b,f] L1 ≘ L2 → 𝐈⦃f⦄ → L1 = L2. #b #f #L1 #L2 #H elim H -f -L1 -L2 // [ #f #I #L1 #L2 #_ #_ #H elim (isid_inv_next … H) // | /5 width=5 by isid_inv_push, liftsb_fwd_isid, eq_f2, sym_eq/ ] qed-. -lemma drops_after_fwd_drop2: ∀b,f2,I,X,K. ⬇*[b, f2] X ≘ K.ⓘ{I} → - ∀f1,f. 𝐈⦃f1⦄ → f2 ⊚ ↑f1 ≘ f → ⬇*[b, f] X ≘ K. +lemma drops_after_fwd_drop2: ∀b,f2,I,X,K. ⬇*[b,f2] X ≘ K.ⓘ{I} → + ∀f1,f. 𝐈⦃f1⦄ → f2 ⊚ ↑f1 ≘ f → ⬇*[b,f] X ≘ K. #b #f2 #I #X #K #H #f1 #f #Hf1 #Hf elim (drops_fwd_drop2 … H) -H #g1 #g #Hg1 #Hg #HK lapply (after_mono_eq … Hg … Hf ??) -Hg -Hf /3 width=5 by drops_eq_repl_back, isid_inv_eq_repl, eq_next/ @@ -252,14 +252,14 @@ qed-. (* Forward lemmas with test for finite colength *****************************) -lemma drops_fwd_isfin: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → 𝐅⦃f⦄. +lemma drops_fwd_isfin: ∀f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → 𝐅⦃f⦄. #f #L1 #L2 #H elim H -f -L1 -L2 /3 width=1 by isfin_next, isfin_push, isfin_isid/ qed-. (* Properties with test for uniformity **************************************) -lemma drops_isuni_ex: ∀f. 𝐔⦃f⦄ → ∀L. ∃K. ⬇*[Ⓕ, f] L ≘ K. +lemma drops_isuni_ex: ∀f. 𝐔⦃f⦄ → ∀L. ∃K. ⬇*[Ⓕ,f] L ≘ K. #f #H elim H -f /4 width=2 by drops_refl, drops_TF, ex_intro/ #f #_ #g #H #IH destruct * /2 width=2 by ex_intro/ #L #I elim (IH L) -IH /3 width=2 by drops_drop, ex_intro/ @@ -267,9 +267,9 @@ qed-. (* Inversion lemmas with test for uniformity ********************************) -lemma drops_inv_isuni: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → 𝐔⦃f⦄ → +lemma drops_inv_isuni: ∀f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → 𝐔⦃f⦄ → (𝐈⦃f⦄ ∧ L1 = L2) ∨ - ∃∃g,I,K. ⬇*[Ⓣ, g] K ≘ L2 & 𝐔⦃g⦄ & L1 = K.ⓘ{I} & f = ↑g. + ∃∃g,I,K. ⬇*[Ⓣ,g] K ≘ L2 & 𝐔⦃g⦄ & L1 = K.ⓘ{I} & f = ↑g. #f #L1 #L2 * -f -L1 -L2 [ /4 width=1 by or_introl, conj/ | /4 width=7 by isuni_inv_next, ex4_3_intro, or_intror/ @@ -278,9 +278,9 @@ lemma drops_inv_isuni: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → 𝐔⦃f⦄ → qed-. (* Basic_2A1: was: drop_inv_O1_pair1 *) -lemma drops_inv_bind1_isuni: ∀b,f,I,K,L2. 𝐔⦃f⦄ → ⬇*[b, f] K.ⓘ{I} ≘ L2 → +lemma drops_inv_bind1_isuni: ∀b,f,I,K,L2. 𝐔⦃f⦄ → ⬇*[b,f] K.ⓘ{I} ≘ L2 → (𝐈⦃f⦄ ∧ L2 = K.ⓘ{I}) ∨ - ∃∃g. 𝐔⦃g⦄ & ⬇*[b, g] K ≘ L2 & f = ↑g. + ∃∃g. 𝐔⦃g⦄ & ⬇*[b,g] K ≘ L2 & f = ↑g. #b #f #I #K #L2 #Hf #H elim (isuni_split … Hf) -Hf * #g #Hg #H0 destruct [ lapply (drops_inv_skip1 … H) -H * #Z #Y #HY #HZ #H destruct <(drops_fwd_isid … HY Hg) -Y >(liftsb_fwd_isid … HZ Hg) -Z @@ -290,9 +290,9 @@ lemma drops_inv_bind1_isuni: ∀b,f,I,K,L2. 𝐔⦃f⦄ → ⬇*[b, f] K.ⓘ{I} qed-. (* Basic_2A1: was: drop_inv_O1_pair2 *) -lemma drops_inv_bind2_isuni: ∀b,f,I,K,L1. 𝐔⦃f⦄ → ⬇*[b, f] L1 ≘ K.ⓘ{I} → +lemma drops_inv_bind2_isuni: ∀b,f,I,K,L1. 𝐔⦃f⦄ → ⬇*[b,f] L1 ≘ K.ⓘ{I} → (𝐈⦃f⦄ ∧ L1 = K.ⓘ{I}) ∨ - ∃∃g,I1,K1. 𝐔⦃g⦄ & ⬇*[b, g] K1 ≘ K.ⓘ{I} & L1 = K1.ⓘ{I1} & f = ↑g. + ∃∃g,I1,K1. 𝐔⦃g⦄ & ⬇*[b,g] K1 ≘ K.ⓘ{I} & L1 = K1.ⓘ{I1} & f = ↑g. #b #f #I #K * [ #Hf #H elim (drops_inv_atom1 … H) -H #H destruct | #L1 #I1 #Hf #H elim (drops_inv_bind1_isuni … Hf H) -Hf -H * @@ -302,16 +302,16 @@ lemma drops_inv_bind2_isuni: ∀b,f,I,K,L1. 𝐔⦃f⦄ → ⬇*[b, f] L1 ≘ K. ] qed-. -lemma drops_inv_bind2_isuni_next: ∀b,f,I,K,L1. 𝐔⦃f⦄ → ⬇*[b, ↑f] L1 ≘ K.ⓘ{I} → - ∃∃I1,K1. ⬇*[b, f] K1 ≘ K.ⓘ{I} & L1 = K1.ⓘ{I1}. +lemma drops_inv_bind2_isuni_next: ∀b,f,I,K,L1. 𝐔⦃f⦄ → ⬇*[b,↑f] L1 ≘ K.ⓘ{I} → + ∃∃I1,K1. ⬇*[b,f] K1 ≘ K.ⓘ{I} & L1 = K1.ⓘ{I1}. #b #f #I #K #L1 #Hf #H elim (drops_inv_bind2_isuni … H) -H /2 width=3 by isuni_next/ -Hf * [ #H elim (isid_inv_next … H) -H // | /2 width=4 by ex2_2_intro/ ] qed-. -fact drops_inv_TF_aux: ∀f,L1,L2. ⬇*[Ⓕ, f] L1 ≘ L2 → 𝐔⦃f⦄ → - ∀I,K. L2 = K.ⓘ{I} → ⬇*[Ⓣ, f] L1 ≘ K.ⓘ{I}. +fact drops_inv_TF_aux: ∀f,L1,L2. ⬇*[Ⓕ,f] L1 ≘ L2 → 𝐔⦃f⦄ → + ∀I,K. L2 = K.ⓘ{I} → ⬇*[Ⓣ,f] L1 ≘ K.ⓘ{I}. #f #L1 #L2 #H elim H -f -L1 -L2 [ #f #_ #_ #J #K #H destruct | #f #I #L1 #L2 #_ #IH #Hf #J #K #H destruct @@ -324,16 +324,16 @@ fact drops_inv_TF_aux: ∀f,L1,L2. ⬇*[Ⓕ, f] L1 ≘ L2 → 𝐔⦃f⦄ → qed-. (* Basic_2A1: includes: drop_inv_FT *) -lemma drops_inv_TF: ∀f,I,L,K. ⬇*[Ⓕ, f] L ≘ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[Ⓣ, f] L ≘ K.ⓘ{I}. +lemma drops_inv_TF: ∀f,I,L,K. ⬇*[Ⓕ,f] L ≘ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[Ⓣ,f] L ≘ K.ⓘ{I}. /2 width=3 by drops_inv_TF_aux/ qed-. (* Basic_2A1: includes: drop_inv_gen *) -lemma drops_inv_gen: ∀b,f,I,L,K. ⬇*[b, f] L ≘ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[Ⓣ, f] L ≘ K.ⓘ{I}. +lemma drops_inv_gen: ∀b,f,I,L,K. ⬇*[b,f] L ≘ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[Ⓣ,f] L ≘ K.ⓘ{I}. * /2 width=1 by drops_inv_TF/ qed-. (* Basic_2A1: includes: drop_inv_T *) -lemma drops_inv_F: ∀b,f,I,L,K. ⬇*[Ⓕ, f] L ≘ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[b, f] L ≘ K.ⓘ{I}. +lemma drops_inv_F: ∀b,f,I,L,K. ⬇*[Ⓕ,f] L ≘ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[b,f] L ≘ K.ⓘ{I}. * /2 width=1 by drops_inv_TF/ qed-. @@ -341,13 +341,13 @@ qed-. (* Basic_1: was: drop_S *) (* Basic_2A1: was: drop_fwd_drop2 *) -lemma drops_isuni_fwd_drop2: ∀b,f,I,X,K. 𝐔⦃f⦄ → ⬇*[b, f] X ≘ K.ⓘ{I} → ⬇*[b, ↑f] X ≘ K. +lemma drops_isuni_fwd_drop2: ∀b,f,I,X,K. 𝐔⦃f⦄ → ⬇*[b,f] X ≘ K.ⓘ{I} → ⬇*[b,↑f] X ≘ K. /3 width=7 by drops_after_fwd_drop2, after_isid_isuni/ qed-. (* Inversion lemmas with uniform relocations ********************************) -lemma drops_inv_atom2: ∀b,L,f. ⬇*[b, f] L ≘ ⋆ → - ∃∃n,f1. ⬇*[b, 𝐔❴n❵] L ≘ ⋆ & 𝐔❴n❵ ⊚ f1 ≘ f. +lemma drops_inv_atom2: ∀b,L,f. ⬇*[b,f] L ≘ ⋆ → + ∃∃n,f1. ⬇*[b,𝐔❴n❵] L ≘ ⋆ & 𝐔❴n❵ ⊚ f1 ≘ f. #b #L elim L -L [ /3 width=4 by drops_atom, after_isid_sn, ex2_2_intro/ | #L #I #IH #f #H elim (pn_split f) * #g #H0 destruct @@ -368,7 +368,7 @@ qed-. (* Properties with uniform relocations **************************************) -lemma drops_F_uni: ∀L,i. ⬇*[Ⓕ, 𝐔❴i❵] L ≘ ⋆ ∨ ∃∃I,K. ⬇*[i] L ≘ K.ⓘ{I}. +lemma drops_F_uni: ∀L,i. ⬇*[Ⓕ,𝐔❴i❵] L ≘ ⋆ ∨ ∃∃I,K. ⬇*[i] L ≘ K.ⓘ{I}. #L elim L -L /2 width=1 by or_introl/ #L #I #IH * /4 width=3 by drops_refl, ex1_2_intro, or_intror/ #i elim (IH i) -IH /3 width=1 by drops_drop, or_introl/ @@ -376,8 +376,8 @@ lemma drops_F_uni: ∀L,i. ⬇*[Ⓕ, 𝐔❴i❵] L ≘ ⋆ ∨ ∃∃I,K. ⬇*[ qed-. (* Basic_2A1: includes: drop_split *) -lemma drops_split_trans: ∀b,f,L1,L2. ⬇*[b, f] L1 ≘ L2 → ∀f1,f2. f1 ⊚ f2 ≘ f → 𝐔⦃f1⦄ → - ∃∃L. ⬇*[b, f1] L1 ≘ L & ⬇*[b, f2] L ≘ L2. +lemma drops_split_trans: ∀b,f,L1,L2. ⬇*[b,f] L1 ≘ L2 → ∀f1,f2. f1 ⊚ f2 ≘ f → 𝐔⦃f1⦄ → + ∃∃L. ⬇*[b,f1] L1 ≘ L & ⬇*[b,f2] L ≘ L2. #b #f #L1 #L2 #H elim H -f -L1 -L2 [ #f #H0f #f1 #f2 #Hf #Hf1 @(ex2_intro … (⋆)) @drops_atom #H lapply (H0f H) -b @@ -396,8 +396,8 @@ lemma drops_split_trans: ∀b,f,L1,L2. ⬇*[b, f] L1 ≘ L2 → ∀f1,f2. f1 ⊚ ] qed-. -lemma drops_split_div: ∀b,f1,L1,L. ⬇*[b, f1] L1 ≘ L → ∀f2,f. f1 ⊚ f2 ≘ f → 𝐔⦃f2⦄ → - ∃∃L2. ⬇*[Ⓕ, f2] L ≘ L2 & ⬇*[Ⓕ, f] L1 ≘ L2. +lemma drops_split_div: ∀b,f1,L1,L. ⬇*[b,f1] L1 ≘ L → ∀f2,f. f1 ⊚ f2 ≘ f → 𝐔⦃f2⦄ → + ∃∃L2. ⬇*[Ⓕ,f2] L ≘ L2 & ⬇*[Ⓕ,f] L1 ≘ L2. #b #f1 #L1 #L #H elim H -f1 -L1 -L [ #f1 #Hf1 #f2 #f #Hf #Hf2 @(ex2_intro … (⋆)) @drops_atom #H destruct | #f1 #I #L1 #L #HL1 #IH #f2 #f #Hf #Hf2 elim (after_inv_nxx … Hf) -Hf [2,3: // ] @@ -421,8 +421,8 @@ lemma drops_tls_at: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → ⬇*[b,⫯⫱*[↑i2]f] L1 ≘ L2. /3 width=3 by drops_eq_repl_fwd, at_inv_tls/ qed-. -lemma drops_split_trans_bind2: ∀b,f,I,L,K0. ⬇*[b, f] L ≘ K0.ⓘ{I} → ∀i. @⦃O, f⦄ ≘ i → - ∃∃J,K. ⬇*[i]L ≘ K.ⓘ{J} & ⬇*[b, ⫱*[↑i]f] K ≘ K0 & ⬆*[⫱*[↑i]f] I ≘ J. +lemma drops_split_trans_bind2: ∀b,f,I,L,K0. ⬇*[b,f] L ≘ K0.ⓘ{I} → ∀i. @⦃O,f⦄ ≘ i → + ∃∃J,K. ⬇*[i]L ≘ K.ⓘ{J} & ⬇*[b,⫱*[↑i]f] K ≘ K0 & ⬆*[⫱*[↑i]f] I ≘ J. #b #f #I #L #K0 #H #i #Hf elim (drops_split_trans … H) -H [ |5: @(after_uni_dx … Hf) |2,3: skip ] /2 width=1 by after_isid_dx/ #Y #HLY #H lapply (drops_tls_at … Hf … H) -H #H 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 1c44ed555..4e241edfd 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_drops.ma @@ -20,9 +20,9 @@ include "static_2/relocation/drops_weight.ma". (* Main properties **********************************************************) (* Basic_2A1: includes: drop_conf_ge drop_conf_be drop_conf_le *) -theorem drops_conf: ∀b1,f1,L1,L. ⬇*[b1, f1] L1 ≘ L → - ∀b2,f,L2. ⬇*[b2, f] L1 ≘ L2 → - ∀f2. f1 ⊚ f2 ≘ f → ⬇*[b2, f2] L ≘ L2. +theorem drops_conf: ∀b1,f1,L1,L. ⬇*[b1,f1] L1 ≘ L → + ∀b2,f,L2. ⬇*[b2,f] L1 ≘ L2 → + ∀f2. f1 ⊚ f2 ≘ f → ⬇*[b2,f2] L ≘ L2. #b1 #f1 #L1 #L #H elim H -f1 -L1 -L [ #f1 #_ #b2 #f #L2 #HL2 #f2 #Hf12 elim (drops_inv_atom1 … HL2) -b1 -HL2 #H #Hf destruct @drops_atom @@ -41,9 +41,9 @@ qed-. (* Basic_2A1: includes: drop_trans_ge drop_trans_le drop_trans_ge_comm drops_drop_trans *) -theorem drops_trans: ∀b1,f1,L1,L. ⬇*[b1, f1] L1 ≘ L → - ∀b2,f2,L2. ⬇*[b2, f2] L ≘ L2 → - ∀f. f1 ⊚ f2 ≘ f → ⬇*[b1∧b2, f] L1 ≘ L2. +theorem drops_trans: ∀b1,f1,L1,L. ⬇*[b1,f1] L1 ≘ L → + ∀b2,f2,L2. ⬇*[b2,f2] L ≘ L2 → + ∀f. f1 ⊚ f2 ≘ f → ⬇*[b1∧b2,f] L1 ≘ L2. #b1 #f1 #L1 #L #H elim H -f1 -L1 -L [ #f1 #Hf1 #b2 #f2 #L2 #HL2 #f #Hf elim (drops_inv_atom1 … HL2) -HL2 #H #Hf2 destruct @drops_atom #H elim (andb_inv_true_dx … H) -H @@ -85,28 +85,42 @@ qed-. (* Advanced properties ******************************************************) (* Basic_2A1: includes: drop_mono *) -lemma drops_mono: ∀b1,f,L,L1. ⬇*[b1, f] L ≘ L1 → - ∀b2,L2. ⬇*[b2, f] L ≘ L2 → L1 = L2. +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) /3 width=8 by drops_conf, drops_fwd_isid/ qed-. +lemma drops_inv_uni: ∀L,i. ⬇*[Ⓕ,𝐔❴i❵] L ≘ ⋆ → ∀I,K. ⬇*[i] L ≘ K.ⓘ{I} → ⊥. +#L #i #H1 #I #K #H2 +lapply (drops_F … H2) -H2 #H2 +lapply (drops_mono … H2 … H1) -L -i #H destruct +qed-. + +lemma drops_ldec_dec: ∀L,i. Decidable (∃∃K,W. ⬇*[i] L ≘ K.ⓛW). +#L #i elim (drops_F_uni L i) [| * * [ #I #K1 | * #W1 #K1 ] ] +[4: /3 width=3 by ex1_2_intro, or_introl/ +|*: #H1L @or_intror * #K2 #W2 #H2L + lapply (drops_mono … H2L … H1L) -L #H destruct +] +qed-. + (* Basic_2A1: includes: drop_conf_lt *) -lemma drops_conf_skip1: ∀b2,f,L,L2. ⬇*[b2, f] L ≘ L2 → - ∀b1,f1,I1,K1. ⬇*[b1, f1] L ≘ K1.ⓘ{I1} → +lemma drops_conf_skip1: ∀b2,f,L,L2. ⬇*[b2,f] L ≘ L2 → + ∀b1,f1,I1,K1. ⬇*[b1,f1] L ≘ K1.ⓘ{I1} → ∀f2. f1 ⊚ ⫯f2 ≘ f → ∃∃I2,K2. L2 = K2.ⓘ{I2} & - ⬇*[b2, f2] K1 ≘ K2 & ⬆*[f2] I2 ≘ I1. + ⬇*[b2,f2] K1 ≘ K2 & ⬆*[f2] I2 ≘ I1. #b2 #f #L #L2 #H2 #b1 #f1 #I1 #K1 #H1 #f2 #Hf lapply (drops_conf … H1 … H2 … Hf) -L -Hf #H elim (drops_inv_skip1 … H) -H /2 width=5 by ex3_2_intro/ qed-. (* Basic_2A1: includes: drop_trans_lt *) -lemma drops_trans_skip2: ∀b1,f1,L1,L. ⬇*[b1, f1] L1 ≘ L → - ∀b2,f2,I2,K2. ⬇*[b2, f2] L ≘ K2.ⓘ{I2} → +lemma drops_trans_skip2: ∀b1,f1,L1,L. ⬇*[b1,f1] L1 ≘ L → + ∀b2,f2,I2,K2. ⬇*[b2,f2] L ≘ K2.ⓘ{I2} → ∀f. f1 ⊚ f2 ≘ ⫯f → ∃∃I1,K1. L1 = K1.ⓘ{I1} & - ⬇*[b1∧b2, f] K1 ≘ K2 & ⬆*[f] I2 ≘ I1. + ⬇*[b1∧b2,f] K1 ≘ K2 & ⬆*[f] I2 ≘ I1. #b1 #f1 #L1 #L #H1 #b2 #f2 #I2 #K2 #H2 #f #Hf lapply (drops_trans … H1 … H2 … Hf) -L -Hf #H elim (drops_inv_skip2 … H) -H /2 width=5 by ex3_2_intro/ @@ -114,7 +128,7 @@ qed-. (* Basic_2A1: includes: drops_conf_div *) lemma drops_conf_div_bind: ∀f1,f2,I1,I2,L,K. - ⬇*[Ⓣ, f1] L ≘ K.ⓘ{I1} → ⬇*[Ⓣ, f2] L ≘ K.ⓘ{I2} → + ⬇*[Ⓣ,f1] L ≘ K.ⓘ{I1} → ⬇*[Ⓣ,f2] L ≘ K.ⓘ{I2} → 𝐔⦃f1⦄ → 𝐔⦃f2⦄ → f1 ≡ f2 ∧ I1 = I2. #f1 #f2 #I1 #I2 #L #K #Hf1 #Hf2 #HU1 #HU2 lapply (drops_isuni_fwd_drop2 … Hf1) // #H1 @@ -125,9 +139,3 @@ lapply (drops_eq_repl_back … Hf1 … H12) -Hf1 #H0 lapply (drops_mono … H0 … Hf2) -L #H destruct /2 width=1 by conj/ qed-. - -lemma drops_inv_uni: ∀L,i. ⬇*[Ⓕ, 𝐔❴i❵] L ≘ ⋆ → ∀I,K. ⬇*[i] L ≘ K.ⓘ{I} → ⊥. -#L #i #H1 #I #K #H2 -lapply (drops_F … H2) -H2 #H2 -lapply (drops_mono … H2 … H1) -L -i #H destruct -qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_length.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_length.ma index 94085a331..1a20d722f 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_length.ma @@ -20,13 +20,13 @@ include "static_2/relocation/drops.ma". (* Forward lemmas with length for local environments ************************) (* Basic_2A1: includes: drop_fwd_length_le4 *) -lemma drops_fwd_length_le4: ∀b,f,L1,L2. ⬇*[b, f] L1 ≘ L2 → |L2| ≤ |L1|. +lemma drops_fwd_length_le4: ∀b,f,L1,L2. ⬇*[b,f] L1 ≘ L2 → |L2| ≤ |L1|. #b #f #L1 #L2 #H elim H -f -L1 -L2 /2 width=1 by le_S, le_S_S/ qed-. (* Basic_2A1: includes: drop_fwd_length_eq1 *) -theorem drops_fwd_length_eq1: ∀b1,b2,f,L1,K1. ⬇*[b1, f] L1 ≘ K1 → - ∀L2,K2. ⬇*[b2, f] L2 ≘ K2 → +theorem drops_fwd_length_eq1: ∀b1,b2,f,L1,K1. ⬇*[b1,f] L1 ≘ K1 → + ∀L2,K2. ⬇*[b2,f] L2 ≘ K2 → |L1| = |L2| → |K1| = |K2|. #b1 #b2 #f #L1 #K1 #HLK1 elim HLK1 -f -L1 -K1 [ #f #_ #L2 #K2 #HLK2 #H lapply (length_inv_zero_sn … H) -H @@ -43,7 +43,7 @@ qed-. (* forward lemmas with finite colength assignment ***************************) -lemma drops_fwd_fcla: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → +lemma drops_fwd_fcla: ∀f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → ∃∃n. 𝐂⦃f⦄ ≘ n & |L1| = |L2| + n. #f #L1 #L2 #H elim H -f -L1 -L2 [ /4 width=3 by fcla_isid, ex2_intro/ @@ -53,25 +53,25 @@ lemma drops_fwd_fcla: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → qed-. (* Basic_2A1: includes: drop_fwd_length *) -lemma drops_fcla_fwd: ∀f,L1,L2,n. ⬇*[Ⓣ, f] L1 ≘ L2 → 𝐂⦃f⦄ ≘ n → +lemma drops_fcla_fwd: ∀f,L1,L2,n. ⬇*[Ⓣ,f] L1 ≘ L2 → 𝐂⦃f⦄ ≘ n → |L1| = |L2| + n. #f #l1 #l2 #n #Hf #Hn elim (drops_fwd_fcla … Hf) -Hf #k #Hm #H <(fcla_mono … Hm … Hn) -f // qed-. -lemma drops_fwd_fcla_le2: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → +lemma drops_fwd_fcla_le2: ∀f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → ∃∃n. 𝐂⦃f⦄ ≘ n & n ≤ |L1|. #f #L1 #L2 #H elim (drops_fwd_fcla … H) -H /2 width=3 by ex2_intro/ qed-. (* Basic_2A1: includes: drop_fwd_length_le2 *) -lemma drops_fcla_fwd_le2: ∀f,L1,L2,n. ⬇*[Ⓣ, f] L1 ≘ L2 → 𝐂⦃f⦄ ≘ n → +lemma drops_fcla_fwd_le2: ∀f,L1,L2,n. ⬇*[Ⓣ,f] L1 ≘ L2 → 𝐂⦃f⦄ ≘ n → n ≤ |L1|. #f #L1 #L2 #n #H #Hn elim (drops_fwd_fcla_le2 … H) -H #k #Hm #H <(fcla_mono … Hm … Hn) -f // qed-. -lemma drops_fwd_fcla_lt2: ∀f,L1,I2,K2. ⬇*[Ⓣ, f] L1 ≘ K2.ⓘ{I2} → +lemma drops_fwd_fcla_lt2: ∀f,L1,I2,K2. ⬇*[Ⓣ,f] L1 ≘ K2.ⓘ{I2} → ∃∃n. 𝐂⦃f⦄ ≘ n & n < |L1|. #f #L1 #I2 #K2 #H elim (drops_fwd_fcla … H) -H #n #Hf #H >H -L1 /3 width=3 by le_S_S, ex2_intro/ @@ -79,27 +79,27 @@ qed-. (* Basic_2A1: includes: drop_fwd_length_lt2 *) lemma drops_fcla_fwd_lt2: ∀f,L1,I2,K2,n. - ⬇*[Ⓣ, f] L1 ≘ K2.ⓘ{I2} → 𝐂⦃f⦄ ≘ n → + ⬇*[Ⓣ,f] L1 ≘ K2.ⓘ{I2} → 𝐂⦃f⦄ ≘ n → n < |L1|. #f #L1 #I2 #K2 #n #H #Hn elim (drops_fwd_fcla_lt2 … H) -H #k #Hm #H <(fcla_mono … Hm … Hn) -f // qed-. (* Basic_2A1: includes: drop_fwd_length_lt4 *) -lemma drops_fcla_fwd_lt4: ∀f,L1,L2,n. ⬇*[Ⓣ, f] L1 ≘ L2 → 𝐂⦃f⦄ ≘ n → 0 < n → +lemma drops_fcla_fwd_lt4: ∀f,L1,L2,n. ⬇*[Ⓣ,f] L1 ≘ L2 → 𝐂⦃f⦄ ≘ n → 0 < n → |L2| < |L1|. #f #L1 #L2 #n #H #Hf #Hn lapply (drops_fcla_fwd … H Hf) -f /2 width=1 by lt_minus_to_plus_r/ qed-. (* Basic_2A1: includes: drop_inv_length_eq *) -lemma drops_inv_length_eq: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → |L1| = |L2| → 𝐈⦃f⦄. +lemma drops_inv_length_eq: ∀f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → |L1| = |L2| → 𝐈⦃f⦄. #f #L1 #L2 #H #HL12 elim (drops_fwd_fcla … H) -H #n #Hn H1 -L1 @@ -107,7 +107,7 @@ elim (drops_fwd_fcla … HLK2) -HLK2 #n2 #Hn2 #H2 >H2 -L2 <(fcla_mono … Hn2 … Hn1) -f // qed-. -theorem drops_conf_div: ∀f1,f2,L1,L2. ⬇*[Ⓣ, f1] L1 ≘ L2 → ⬇*[Ⓣ, f2] L1 ≘ L2 → +theorem drops_conf_div: ∀f1,f2,L1,L2. ⬇*[Ⓣ,f1] L1 ≘ L2 → ⬇*[Ⓣ,f2] L1 ≘ L2 → ∃∃n. 𝐂⦃f1⦄ ≘ n & 𝐂⦃f2⦄ ≘ n. #f1 #f2 #L1 #L2 #H1 #H2 elim (drops_fwd_fcla … H1) -H1 #n1 #Hf1 #H1 @@ -116,7 +116,7 @@ lapply (injective_plus_r … H) -L2 #H destruct /2 width=3 by ex2_intro/ qed-. theorem drops_conf_div_fcla: ∀f1,f2,L1,L2,n1,n2. - ⬇*[Ⓣ, f1] L1 ≘ L2 → ⬇*[Ⓣ, f2] L1 ≘ L2 → 𝐂⦃f1⦄ ≘ n1 → 𝐂⦃f2⦄ ≘ n2 → + ⬇*[Ⓣ,f1] L1 ≘ L2 → ⬇*[Ⓣ,f2] L1 ≘ L2 → 𝐂⦃f1⦄ ≘ n1 → 𝐂⦃f2⦄ ≘ n2 → n1 = n2. #f1 #f2 #L1 #L2 #n1 #n2 #Hf1 #Hf2 #Hn1 #Hn2 lapply (drops_fcla_fwd … Hf1 Hn1) -f1 #H1 diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_lex.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_lex.ma index 1e33fc3d8..8db2c8830 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_lex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_lex.ma @@ -19,16 +19,16 @@ include "static_2/relocation/drops_sex.ma". (* GENERIC SLICING FOR LOCAL ENVIRONMENTS ***********************************) definition dedropable_sn: predicate … ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → ∀K2. K1 ⪤[R] K2 → - ∃∃L2. L1 ⪤[R] L2 & ⬇*[b, f] L2 ≘ K2 & L1 ≡[f] L2. + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → ∀K2. K1 ⪤[R] K2 → + ∃∃L2. L1 ⪤[R] L2 & ⬇*[b,f] L2 ≘ K2 & L1 ≡[f] L2. definition dropable_sn: predicate … ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → 𝐔⦃f⦄ → ∀L2. L1 ⪤[R] L2 → - ∃∃K2. K1 ⪤[R] K2 & ⬇*[b, f] L2 ≘ K2. + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → 𝐔⦃f⦄ → ∀L2. L1 ⪤[R] L2 → + ∃∃K2. K1 ⪤[R] K2 & ⬇*[b,f] L2 ≘ K2. definition dropable_dx: predicate … ≝ - λR. ∀L1,L2. L1 ⪤[R] L2 → ∀b,f,K2. ⬇*[b, f] L2 ≘ K2 → 𝐔⦃f⦄ → - ∃∃K1. ⬇*[b, f] L1 ≘ K1 & K1 ⪤[R] K2. + λR. ∀L1,L2. L1 ⪤[R] L2 → ∀b,f,K2. ⬇*[b,f] L2 ≘ K2 → 𝐔⦃f⦄ → + ∃∃K1. ⬇*[b,f] L1 ≘ K1 & K1 ⪤[R] K2. (* Properties with generic extension ****************************************) @@ -58,8 +58,8 @@ qed-. (* Basic_2A1: includes: lpx_sn_drop_conf *) lemma lex_drops_conf_pair (R): ∀L1,L2. L1 ⪤[R] L2 → - ∀b,f,I,K1,V1. ⬇*[b, f] L1 ≘ K1.ⓑ{I}V1 → 𝐔⦃f⦄ → - ∃∃K2,V2. ⬇*[b, f] L2 ≘ K2.ⓑ{I}V2 & K1 ⪤[R] K2 & R K1 V1 V2. + ∀b,f,I,K1,V1. ⬇*[b,f] L1 ≘ K1.ⓑ{I}V1 → 𝐔⦃f⦄ → + ∃∃K2,V2. ⬇*[b,f] L2 ≘ K2.ⓑ{I}V2 & K1 ⪤[R] K2 & R K1 V1 V2. #R #L1 #L2 * #f2 #Hf2 #HL12 #b #f #I #K1 #V1 #HLK1 #Hf elim (sex_drops_conf_push … HL12 … HLK1 Hf f2) -L1 -Hf [ #Z2 #K2 #HLK2 #HK12 #H @@ -71,8 +71,8 @@ qed-. (* Basic_2A1: includes: lpx_sn_drop_trans *) lemma lex_drops_trans_pair (R): ∀L1,L2. L1 ⪤[R] L2 → - ∀b,f,I,K2,V2. ⬇*[b, f] L2 ≘ K2.ⓑ{I}V2 → 𝐔⦃f⦄ → - ∃∃K1,V1. ⬇*[b, f] L1 ≘ K1.ⓑ{I}V1 & K1 ⪤[R] K2 & R K1 V1 V2. + ∀b,f,I,K2,V2. ⬇*[b,f] L2 ≘ K2.ⓑ{I}V2 → 𝐔⦃f⦄ → + ∃∃K1,V1. ⬇*[b,f] L1 ≘ K1.ⓑ{I}V1 & K1 ⪤[R] K2 & R K1 V1 V2. #R #L1 #L2 * #f2 #Hf2 #HL12 #b #f #I #K2 #V2 #HLK2 #Hf elim (sex_drops_trans_push … HL12 … HLK2 Hf f2) -L2 -Hf [ #Z1 #K1 #HLK1 #HK12 #H diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_seq.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_seq.ma index 94beb0a71..e214e9480 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_seq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_seq.ma @@ -30,9 +30,9 @@ lemma seq_co_dropable_dx: co_dropable_dx seq. (* Basic_2A1: includes: lreq_drop_trans_be *) lemma seq_drops_trans_next: ∀f2,L1,L2. L1 ≡[f2] L2 → - ∀b,f,I,K2. ⬇*[b, f] L2 ≘ K2.ⓘ{I} → 𝐔⦃f⦄ → + ∀b,f,I,K2. ⬇*[b,f] L2 ≘ K2.ⓘ{I} → 𝐔⦃f⦄ → ∀f1. f ~⊚ ↑f1 ≘ f2 → - ∃∃K1. ⬇*[b, f] L1 ≘ K1.ⓘ{I} & K1 ≡[f1] K2. + ∃∃K1. ⬇*[b,f] L1 ≘ K1.ⓘ{I} & K1 ≡[f1] K2. #f2 #L1 #L2 #HL12 #b #f #I2 #K2 #HLK2 #Hf #f1 #Hf2 elim (sex_drops_trans_next … HL12 … HLK2 Hf … Hf2) -f2 -L2 -Hf #I1 #K1 #HLK1 #HK12 #H <(ceq_ext_inv_eq … H) -I2 @@ -41,18 +41,18 @@ qed-. (* Basic_2A1: includes: lreq_drop_conf_be *) lemma seq_drops_conf_next: ∀f2,L1,L2. L1 ≡[f2] L2 → - ∀b,f,I,K1. ⬇*[b, f] L1 ≘ K1.ⓘ{I} → 𝐔⦃f⦄ → + ∀b,f,I,K1. ⬇*[b,f] L1 ≘ K1.ⓘ{I} → 𝐔⦃f⦄ → ∀f1. f ~⊚ ↑f1 ≘ f2 → - ∃∃K2. ⬇*[b, f] L2 ≘ K2.ⓘ{I} & K1 ≡[f1] K2. + ∃∃K2. ⬇*[b,f] L2 ≘ K2.ⓘ{I} & K1 ≡[f1] K2. #f2 #L1 #L2 #HL12 #b #f #I1 #K1 #HLK1 #Hf #f1 #Hf2 elim (seq_drops_trans_next … (seq_sym … HL12) … HLK1 … Hf2) // -f2 -L1 -Hf /3 width=3 by seq_sym, ex2_intro/ qed-. lemma drops_seq_trans_next: ∀f1,K1,K2. K1 ≡[f1] K2 → - ∀b,f,I,L1. ⬇*[b, f] L1.ⓘ{I} ≘ K1 → + ∀b,f,I,L1. ⬇*[b,f] L1.ⓘ{I} ≘ K1 → ∀f2. f ~⊚ f1 ≘ ↑f2 → - ∃∃L2. ⬇*[b, f] L2.ⓘ{I} ≘ K2 & L1 ≡[f2] L2 & L1.ⓘ{I} ≡[f] L2.ⓘ{I}. + ∃∃L2. ⬇*[b,f] L2.ⓘ{I} ≘ K2 & L1 ≡[f2] L2 & L1.ⓘ{I} ≡[f] L2.ⓘ{I}. #f1 #K1 #K2 #HK12 #b #f #I1 #L1 #HLK1 #f2 #Hf2 elim (drops_sex_trans_next … HK12 … HLK1 … Hf2) -f1 -K1 /2 width=6 by cfull_lift_sn, ceq_lift_sn/ diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_sex.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_sex.ma index e1263a2fd..8f3058cb9 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_sex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_sex.ma @@ -42,9 +42,9 @@ lemma sex_co_dropable_sn: ∀RN,RP. co_dropable_sn (sex RN RP). qed-. lemma sex_liftable_co_dedropable_bi: ∀RN,RP. d_liftable2_sn … liftsb RN → d_liftable2_sn … liftsb RP → - ∀f2,L1,L2. L1 ⪤[cfull, RP, f2] L2 → ∀f1,K1,K2. K1 ⪤[RN, RP, f1] K2 → - ∀b,f. ⬇*[b, f] L1 ≘ K1 → ⬇*[b, f] L2 ≘ K2 → - f ~⊚ f1 ≘ f2 → L1 ⪤[RN, RP, f2] L2. + ∀f2,L1,L2. L1 ⪤[cfull,RP,f2] L2 → ∀f1,K1,K2. K1 ⪤[RN,RP,f1] K2 → + ∀b,f. ⬇*[b,f] L1 ≘ K1 → ⬇*[b,f] L2 ≘ K2 → + f ~⊚ f1 ≘ f2 → L1 ⪤[RN,RP,f2] L2. #RN #RP #HRN #HRP #f2 #L1 #L2 #H elim H -f2 -L1 -L2 // #g2 #I1 #I2 #L1 #L2 #HL12 #HI12 #IH #f1 #Y1 #Y2 #HK12 #b #f #HY1 #HY2 #H [ elim (coafter_inv_xxn … H) [ |*: // ] -H #g #g1 #Hg2 #H1 #H2 destruct @@ -87,9 +87,9 @@ lemma sex_liftable_co_dedropable_sn: ∀RN,RP. (∀L. reflexive … (RN L)) → ] qed-. -fact sex_dropable_dx_aux: ∀RN,RP,b,f,L2,K2. ⬇*[b, f] L2 ≘ K2 → 𝐔⦃f⦄ → - ∀f2,L1. L1 ⪤[RN, RP, f2] L2 → ∀f1. f ~⊚ f1 ≘ f2 → - ∃∃K1. ⬇*[b, f] L1 ≘ K1 & K1 ⪤[RN, RP, f1] K2. +fact sex_dropable_dx_aux: ∀RN,RP,b,f,L2,K2. ⬇*[b,f] L2 ≘ K2 → 𝐔⦃f⦄ → + ∀f2,L1. L1 ⪤[RN,RP,f2] L2 → ∀f1. f ~⊚ f1 ≘ f2 → + ∃∃K1. ⬇*[b,f] L1 ≘ K1 & K1 ⪤[RN,RP,f1] K2. #RN #RP #b #f #L2 #K2 #H elim H -f -L2 -K2 [ #f #Hf #_ #f2 #X #H #f1 #Hf2 lapply (sex_inv_atom2 … H) -H #H destruct /4 width=3 by sex_atom, drops_atom, ex2_intro/ @@ -113,10 +113,10 @@ lemma sex_co_dropable_dx: ∀RN,RP. co_dropable_dx (sex RN RP). /2 width=5 by sex_dropable_dx_aux/ qed-. lemma sex_drops_conf_next: ∀RN,RP. - ∀f2,L1,L2. L1 ⪤[RN, RP, f2] L2 → - ∀b,f,I1,K1. ⬇*[b, f] L1 ≘ K1.ⓘ{I1} → 𝐔⦃f⦄ → + ∀f2,L1,L2. L1 ⪤[RN,RP,f2] L2 → + ∀b,f,I1,K1. ⬇*[b,f] L1 ≘ K1.ⓘ{I1} → 𝐔⦃f⦄ → ∀f1. f ~⊚ ↑f1 ≘ f2 → - ∃∃I2,K2. ⬇*[b, f] L2 ≘ K2.ⓘ{I2} & K1 ⪤[RN, RP, f1] K2 & RN K1 I1 I2. + ∃∃I2,K2. ⬇*[b,f] L2 ≘ K2.ⓘ{I2} & K1 ⪤[RN,RP,f1] K2 & RN K1 I1 I2. #RN #RP #f2 #L1 #L2 #HL12 #b #f #I1 #K1 #HLK1 #Hf #f1 #Hf2 elim (sex_co_dropable_sn … HLK1 … Hf … HL12 … Hf2) -L1 -f2 -Hf #X #HX #HLK2 elim (sex_inv_next1 … HX) -HX @@ -124,30 +124,30 @@ elim (sex_co_dropable_sn … HLK1 … Hf … HL12 … Hf2) -L1 -f2 -Hf qed-. lemma sex_drops_conf_push: ∀RN,RP. - ∀f2,L1,L2. L1 ⪤[RN, RP, f2] L2 → - ∀b,f,I1,K1. ⬇*[b, f] L1 ≘ K1.ⓘ{I1} → 𝐔⦃f⦄ → + ∀f2,L1,L2. L1 ⪤[RN,RP,f2] L2 → + ∀b,f,I1,K1. ⬇*[b,f] L1 ≘ K1.ⓘ{I1} → 𝐔⦃f⦄ → ∀f1. f ~⊚ ⫯f1 ≘ f2 → - ∃∃I2,K2. ⬇*[b, f] L2 ≘ K2.ⓘ{I2} & K1 ⪤[RN, RP, f1] K2 & RP K1 I1 I2. + ∃∃I2,K2. ⬇*[b,f] L2 ≘ K2.ⓘ{I2} & K1 ⪤[RN,RP,f1] K2 & RP K1 I1 I2. #RN #RP #f2 #L1 #L2 #HL12 #b #f #I1 #K1 #HLK1 #Hf #f1 #Hf2 elim (sex_co_dropable_sn … HLK1 … Hf … HL12 … Hf2) -L1 -f2 -Hf #X #HX #HLK2 elim (sex_inv_push1 … HX) -HX #I2 #K2 #HK12 #HI12 #H destruct /2 width=5 by ex3_2_intro/ qed-. -lemma sex_drops_trans_next: ∀RN,RP,f2,L1,L2. L1 ⪤[RN, RP, f2] L2 → - ∀b,f,I2,K2. ⬇*[b, f] L2 ≘ K2.ⓘ{I2} → 𝐔⦃f⦄ → +lemma sex_drops_trans_next: ∀RN,RP,f2,L1,L2. L1 ⪤[RN,RP,f2] L2 → + ∀b,f,I2,K2. ⬇*[b,f] L2 ≘ K2.ⓘ{I2} → 𝐔⦃f⦄ → ∀f1. f ~⊚ ↑f1 ≘ f2 → - ∃∃I1,K1. ⬇*[b, f] L1 ≘ K1.ⓘ{I1} & K1 ⪤[RN, RP, f1] K2 & RN K1 I1 I2. + ∃∃I1,K1. ⬇*[b,f] L1 ≘ K1.ⓘ{I1} & K1 ⪤[RN,RP,f1] K2 & RN K1 I1 I2. #RN #RP #f2 #L1 #L2 #HL12 #b #f #I2 #K2 #HLK2 #Hf #f1 #Hf2 elim (sex_co_dropable_dx … HL12 … HLK2 … Hf … Hf2) -L2 -f2 -Hf #X #HLK1 #HX elim (sex_inv_next2 … HX) -HX #I1 #K1 #HK12 #HI12 #H destruct /2 width=5 by ex3_2_intro/ qed-. -lemma sex_drops_trans_push: ∀RN,RP,f2,L1,L2. L1 ⪤[RN, RP, f2] L2 → - ∀b,f,I2,K2. ⬇*[b, f] L2 ≘ K2.ⓘ{I2} → 𝐔⦃f⦄ → +lemma sex_drops_trans_push: ∀RN,RP,f2,L1,L2. L1 ⪤[RN,RP,f2] L2 → + ∀b,f,I2,K2. ⬇*[b,f] L2 ≘ K2.ⓘ{I2} → 𝐔⦃f⦄ → ∀f1. f ~⊚ ⫯f1 ≘ f2 → - ∃∃I1,K1. ⬇*[b, f] L1 ≘ K1.ⓘ{I1} & K1 ⪤[RN, RP, f1] K2 & RP K1 I1 I2. + ∃∃I1,K1. ⬇*[b,f] L1 ≘ K1.ⓘ{I1} & K1 ⪤[RN,RP,f1] K2 & RP K1 I1 I2. #RN #RP #f2 #L1 #L2 #HL12 #b #f #I2 #K2 #HLK2 #Hf #f1 #Hf2 elim (sex_co_dropable_dx … HL12 … HLK2 … Hf … Hf2) -L2 -f2 -Hf #X #HLK1 #HX elim (sex_inv_push2 … HX) -HX @@ -156,10 +156,10 @@ qed-. lemma drops_sex_trans_next: ∀RN,RP. (∀L. reflexive ? (RN L)) → (∀L. reflexive ? (RP L)) → d_liftable2_sn … liftsb RN → d_liftable2_sn … liftsb RP → - ∀f1,K1,K2. K1 ⪤[RN, RP, f1] K2 → - ∀b,f,I1,L1. ⬇*[b, f] L1.ⓘ{I1} ≘ K1 → + ∀f1,K1,K2. K1 ⪤[RN,RP,f1] K2 → + ∀b,f,I1,L1. ⬇*[b,f] L1.ⓘ{I1} ≘ K1 → ∀f2. f ~⊚ f1 ≘ ↑f2 → - ∃∃I2,L2. ⬇*[b, f] L2.ⓘ{I2} ≘ K2 & L1 ⪤[RN, RP, f2] L2 & RN L1 I1 I2 & L1.ⓘ{I1} ≡[f] L2.ⓘ{I2}. + ∃∃I2,L2. ⬇*[b,f] L2.ⓘ{I2} ≘ K2 & L1 ⪤[RN,RP,f2] L2 & RN L1 I1 I2 & L1.ⓘ{I1} ≡[f] L2.ⓘ{I2}. #RN #RP #H1RN #H1RP #H2RN #H2RP #f1 #K1 #K2 #HK12 #b #f #I1 #L1 #HLK1 #f2 #Hf2 elim (sex_liftable_co_dedropable_sn … H1RN H1RP H2RN H2RP … HLK1 … HK12 … Hf2) -K1 -f1 -H1RN -H1RP -H2RN -H2RP #X #HX #HLK2 #H1L12 elim (sex_inv_next1 … HX) -HX @@ -168,19 +168,19 @@ qed-. lemma drops_sex_trans_push: ∀RN,RP. (∀L. reflexive ? (RN L)) → (∀L. reflexive ? (RP L)) → d_liftable2_sn … liftsb RN → d_liftable2_sn … liftsb RP → - ∀f1,K1,K2. K1 ⪤[RN, RP, f1] K2 → - ∀b,f,I1,L1. ⬇*[b, f] L1.ⓘ{I1} ≘ K1 → + ∀f1,K1,K2. K1 ⪤[RN,RP,f1] K2 → + ∀b,f,I1,L1. ⬇*[b,f] L1.ⓘ{I1} ≘ K1 → ∀f2. f ~⊚ f1 ≘ ⫯f2 → - ∃∃I2,L2. ⬇*[b, f] L2.ⓘ{I2} ≘ K2 & L1 ⪤[RN, RP, f2] L2 & RP L1 I1 I2 & L1.ⓘ{I1} ≡[f] L2.ⓘ{I2}. + ∃∃I2,L2. ⬇*[b,f] L2.ⓘ{I2} ≘ K2 & L1 ⪤[RN,RP,f2] L2 & RP L1 I1 I2 & L1.ⓘ{I1} ≡[f] L2.ⓘ{I2}. #RN #RP #H1RN #H1RP #H2RN #H2RP #f1 #K1 #K2 #HK12 #b #f #I1 #L1 #HLK1 #f2 #Hf2 elim (sex_liftable_co_dedropable_sn … H1RN H1RP H2RN H2RP … HLK1 … HK12 … Hf2) -K1 -f1 -H1RN -H1RP -H2RN -H2RP #X #HX #HLK2 #H1L12 elim (sex_inv_push1 … HX) -HX #I2 #L2 #H2L12 #HI12 #H destruct /2 width=6 by ex4_2_intro/ qed-. -lemma drops_atom2_sex_conf: ∀RN,RP,b,f1,L1. ⬇*[b, f1] L1 ≘ ⋆ → 𝐔⦃f1⦄ → - ∀f,L2. L1 ⪤[RN, RP, f] L2 → - ∀f2. f1 ~⊚ f2 ≘f → ⬇*[b, f1] L2 ≘ ⋆. +lemma drops_atom2_sex_conf: ∀RN,RP,b,f1,L1. ⬇*[b,f1] L1 ≘ ⋆ → 𝐔⦃f1⦄ → + ∀f,L2. L1 ⪤[RN,RP,f] L2 → + ∀f2. f1 ~⊚ f2 ≘f → ⬇*[b,f1] L2 ≘ ⋆. #RN #RP #b #f1 #L1 #H1 #Hf1 #f #L2 #H2 #f2 #H3 elim (sex_co_dropable_sn … H1 … H2 … H3) // -H1 -H2 -H3 -Hf1 #L #H #HL2 lapply (sex_inv_atom1 … H) -H // diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_vector.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_vector.ma index 8c43b6404..4f5eef017 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_vector.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_vector.ma @@ -19,7 +19,7 @@ include "static_2/relocation/drops.ma". definition d_liftable1_all: predicate (relation2 lenv term) ≝ λR. ∀K,Ts. all … (R K) Ts → - ∀b,f,L. ⬇*[b, f] L ≘ K → + ∀b,f,L. ⬇*[b,f] L ≘ K → ∀Us. ⬆*[f] Ts ≘ Us → all … (R L) Us. (* Properties with generic relocation for term vectors **********************) diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_weight.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_weight.ma index dfcb44500..8c94cce14 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/drops_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/drops_weight.ma @@ -21,7 +21,7 @@ include "static_2/relocation/drops.ma". (* Forward lemmas with weight for local environments ************************) (* Basic_2A1: includes: drop_fwd_lw *) -lemma drops_fwd_lw: ∀b,f,L1,L2. ⬇*[b, f] L1 ≘ L2 → ♯{L2} ≤ ♯{L1}. +lemma drops_fwd_lw: ∀b,f,L1,L2. ⬇*[b,f] L1 ≘ L2 → ♯{L2} ≤ ♯{L1}. #b #f #L1 #L2 #H elim H -f -L1 -L2 // [ /2 width=3 by transitive_le/ | #f #I1 #I2 #L1 #L2 #_ #HI21 #IHL12 normalize @@ -30,7 +30,7 @@ lemma drops_fwd_lw: ∀b,f,L1,L2. ⬇*[b, f] L1 ≘ L2 → ♯{L2} ≤ ♯{L1}. qed-. (* Basic_2A1: includes: drop_fwd_lw_lt *) -lemma drops_fwd_lw_lt: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≘ L2 → +lemma drops_fwd_lw_lt: ∀f,L1,L2. ⬇*[Ⓣ,f] L1 ≘ L2 → (𝐈⦃f⦄ → ⊥) → ♯{L2} < ♯{L1}. #f #L1 #L2 #H elim H -f -L1 -L2 [ #f #Hf #Hnf elim Hnf -Hnf /2 width=1 by/ @@ -43,14 +43,14 @@ qed-. (* Forward lemmas with restricted weight for closures ***********************) (* Basic_2A1: includes: drop_fwd_rfw *) -lemma drops_bind2_fwd_rfw: ∀b,f,I,L,K,V. ⬇*[b, f] L ≘ K.ⓑ{I}V → ∀T. ♯{K, V} < ♯{L, T}. +lemma drops_bind2_fwd_rfw: ∀b,f,I,L,K,V. ⬇*[b,f] L ≘ K.ⓑ{I}V → ∀T. ♯{K,V} < ♯{L,T}. #b #f #I #L #K #V #HLK lapply (drops_fwd_lw … HLK) -HLK normalize in ⊢ (%→?→?%%); /3 width=3 by le_to_lt_to_lt, monotonic_lt_plus_r/ qed-. (* Advanced inversion lemma *************************************************) -lemma drops_inv_x_bind_xy: ∀b,f,I,L. ⬇*[b, f] L ≘ L.ⓘ{I} → ⊥. +lemma drops_inv_x_bind_xy: ∀b,f,I,L. ⬇*[b,f] L ≘ L.ⓘ{I} → ⊥. #b #f #I #L #H lapply (drops_fwd_lw … H) -b -f /2 width=4 by lt_le_false/ (**) (* full auto is a bit slow: 19s *) qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lex.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lex.ma index 1900d273d..76381a9fa 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/lex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lex.ma @@ -22,7 +22,7 @@ include "static_2/relocation/sex.ma". (* GENERIC EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS **************) definition lex (R): relation lenv ≝ - λL1,L2. ∃∃f. 𝐈⦃f⦄ & L1 ⪤[cfull, cext2 R, f] L2. + λL1,L2. ∃∃f. 𝐈⦃f⦄ & L1 ⪤[cfull,cext2 R,f] L2. interpretation "generic extension (local environment)" 'Relation R L1 L2 = (lex R L1 L2). diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts.ma index 060f3b805..4ec47cc91 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts.ma @@ -24,7 +24,7 @@ include "static_2/syntax/term.ma". *) inductive lifts: rtmap → relation term ≝ | lifts_sort: ∀f,s. lifts f (⋆s) (⋆s) -| lifts_lref: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → lifts f (#i1) (#i2) +| lifts_lref: ∀f,i1,i2. @⦃i1,f⦄ ≘ i2 → lifts f (#i1) (#i2) | lifts_gref: ∀f,l. lifts f (§l) (§l) | lifts_bind: ∀f,p,I,V1,V2,T1,T2. lifts f V1 V2 → lifts (⫯f) T1 T2 → @@ -56,6 +56,10 @@ definition deliftable2_bi: predicate (relation term) ≝ λR. ∀U1,U2. R U1 U2 → ∀f,T1. ⬆*[f] T1 ≘ U1 → ∀T2. ⬆*[f] T2 ≘ U2 → R T1 T2. +definition liftable2_dx: predicate (relation term) ≝ + λR. ∀T1,T2. R T1 T2 → ∀f,U2. ⬆*[f] T2 ≘ U2 → + ∃∃U1. ⬆*[f] T1 ≘ U1 & R U1 U2. + definition deliftable2_dx: predicate (relation term) ≝ λR. ∀U1,U2. R U1 U2 → ∀f,T2. ⬆*[f] T2 ≘ U2 → ∃∃T1. ⬆*[f] T1 ≘ U1 & R T1 T2. @@ -76,7 +80,7 @@ lemma lifts_inv_sort1: ∀f,Y,s. ⬆*[f] ⋆s ≘ Y → Y = ⋆s. /2 width=4 by lifts_inv_sort1_aux/ qed-. fact lifts_inv_lref1_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀i1. X = #i1 → - ∃∃i2. @⦃i1, f⦄ ≘ i2 & Y = #i2. + ∃∃i2. @⦃i1,f⦄ ≘ i2 & Y = #i2. #f #X #Y * -f -X -Y [ #f #s #x #H destruct | #f #i1 #i2 #Hi12 #x #H destruct /2 width=3 by ex2_intro/ @@ -89,7 +93,7 @@ qed-. (* Basic_1: was: lift1_lref *) (* Basic_2A1: includes: lift_inv_lref1 lift_inv_lref1_lt lift_inv_lref1_ge *) lemma lifts_inv_lref1: ∀f,Y,i1. ⬆*[f] #i1 ≘ Y → - ∃∃i2. @⦃i1, f⦄ ≘ i2 & Y = #i2. + ∃∃i2. @⦃i1,f⦄ ≘ i2 & Y = #i2. /2 width=3 by lifts_inv_lref1_aux/ qed-. fact lifts_inv_gref1_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀l. X = §l → Y = §l. @@ -158,7 +162,7 @@ lemma lifts_inv_sort2: ∀f,X,s. ⬆*[f] X ≘ ⋆s → X = ⋆s. /2 width=4 by lifts_inv_sort2_aux/ qed-. fact lifts_inv_lref2_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀i2. Y = #i2 → - ∃∃i1. @⦃i1, f⦄ ≘ i2 & X = #i1. + ∃∃i1. @⦃i1,f⦄ ≘ i2 & X = #i1. #f #X #Y * -f -X -Y [ #f #s #x #H destruct | #f #i1 #i2 #Hi12 #x #H destruct /2 width=3 by ex2_intro/ @@ -171,7 +175,7 @@ qed-. (* Basic_1: includes: lift_gen_lref lift_gen_lref_lt lift_gen_lref_false lift_gen_lref_ge *) (* Basic_2A1: includes: lift_inv_lref2 lift_inv_lref2_lt lift_inv_lref2_be lift_inv_lref2_ge lift_inv_lref2_plus *) lemma lifts_inv_lref2: ∀f,X,i2. ⬆*[f] X ≘ #i2 → - ∃∃i1. @⦃i1, f⦄ ≘ i2 & X = #i1. + ∃∃i1. @⦃i1,f⦄ ≘ i2 & X = #i1. /2 width=3 by lifts_inv_lref2_aux/ qed-. fact lifts_inv_gref2_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀l. Y = §l → X = §l. @@ -230,7 +234,7 @@ lemma lifts_inv_flat2: ∀f:rtmap. ∀I,V2,T2,X. ⬆*[f] X ≘ ⓕ{I}V2.T2 → lemma lifts_inv_atom1: ∀f,I,Y. ⬆*[f] ⓪{I} ≘ Y → ∨∨ ∃∃s. I = Sort s & Y = ⋆s - | ∃∃i,j. @⦃i, f⦄ ≘ j & I = LRef i & Y = #j + | ∃∃i,j. @⦃i,f⦄ ≘ j & I = LRef i & Y = #j | ∃∃l. I = GRef l & Y = §l. #f * #n #Y #H [ lapply (lifts_inv_sort1 … H) @@ -241,7 +245,7 @@ qed-. lemma lifts_inv_atom2: ∀f,I,X. ⬆*[f] X ≘ ⓪{I} → ∨∨ ∃∃s. X = ⋆s & I = Sort s - | ∃∃i,j. @⦃i, f⦄ ≘ j & X = #i & I = LRef j + | ∃∃i,j. @⦃i,f⦄ ≘ j & X = #i & I = LRef j | ∃∃l. X = §l & I = GRef l. #f * #n #X #H [ lapply (lifts_inv_sort2 … H) @@ -333,6 +337,11 @@ qed-. (* Basic properties *********************************************************) +lemma liftable2_sn_dx (R): symmetric … R → liftable2_sn R → liftable2_dx R. +#R #H2R #H1R #T1 #T2 #HT12 #f #U2 #HTU2 +elim (H1R … T1 … HTU2) -H1R /3 width=3 by ex2_intro/ +qed-. + lemma deliftable2_sn_dx (R): symmetric … R → deliftable2_sn R → deliftable2_dx R. #R #H2R #H1R #U1 #U2 #HU12 #f #T2 #HTU2 elim (H1R … U1 … HTU2) -H1R /3 width=3 by ex2_intro/ @@ -365,7 +374,7 @@ elim (IHV1 f) -IHV1 #V2 #HV12 ] qed-. -lemma lifts_push_zero (f): ⬆*[⫯f]#O ≘ #0. +lemma lifts_push_zero (f): ⬆*[⫯f]#0 ≘ #0. /2 width=1 by lifts_lref/ qed. lemma lifts_push_lref (f) (i1) (i2): ⬆*[f]#i1 ≘ #i2 → ⬆*[⫯f]#(↑i1) ≘ #(↑i2). diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_basic.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_basic.ma new file mode 100644 index 000000000..6d2ca03d9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_basic.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_2/relocation/rtmap_basic_after.ma". +include "static_2/notation/relations/rlift_4.ma". +include "static_2/relocation/lifts.ma". + +(* GENERIC RELOCATION FOR TERMS *********************************************) + +interpretation "basic relocation (term)" + 'RLift m n T1 T2 = (lifts (basic m n) T1 T2). + +(* Properties with basic relocation *****************************************) + +lemma lifts_lref_lt (m,n,i): i < m → ⬆[m,n] #i ≘ #i. +/3 width=1 by lifts_lref, at_basic_lt/ qed. + +lemma lifts_lref_ge (m,n,i): m ≤ i → ⬆[m,n] #i ≘ #(n+i). +/3 width=1 by lifts_lref, at_basic_ge/ qed. + +lemma lifts_lref_ge_minus (m,n,i): n+m ≤ i → ⬆[m,n] #(i-n) ≘ #i. +#m #n #i #Hi +>(plus_minus_m_m i n) in ⊢ (???%); +/3 width=2 by lifts_lref_ge, le_plus_to_minus_l, le_plus_b/ +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_tdeq.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_tdeq.ma index 12affa3a1..c76781d11 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_tdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_tdeq.ma @@ -17,12 +17,12 @@ include "static_2/relocation/lifts_lifts.ma". (* GENERIC RELOCATION FOR TERMS *********************************************) -(* Properties with degree-based equivalence for terms ***********************) +(* Properties with sort-irrelevant equivalence for terms ********************) -lemma tdeq_lifts_sn: ∀h,o. liftable2_sn (tdeq h o). -#h #o #T1 #T2 #H elim H -T1 -T2 [||| * ] -[ #s1 #s2 #d #Hs1 #Hs2 #f #X #H >(lifts_inv_sort1 … H) -H - /3 width=5 by lifts_sort, tdeq_sort, ex2_intro/ +lemma tdeq_lifts_sn: liftable2_sn tdeq. +#T1 #T2 #H elim H -T1 -T2 [||| * ] +[ #s1 #s2 #f #X #H >(lifts_inv_sort1 … H) -H + /3 width=3 by lifts_sort, tdeq_sort, ex2_intro/ | #i #f #X #H elim (lifts_inv_lref1 … H) -H /3 width=3 by lifts_lref, tdeq_lref, ex2_intro/ | #l #f #X #H >(lifts_inv_gref1 … H) -H @@ -38,15 +38,18 @@ lemma tdeq_lifts_sn: ∀h,o. liftable2_sn (tdeq h o). ] qed-. -lemma tdeq_lifts_bi: ∀h,o. liftable2_bi (tdeq h o). +lemma tdeq_lifts_dx: liftable2_dx tdeq. +/3 width=3 by tdeq_lifts_sn, liftable2_sn_dx, tdeq_sym/ qed-. + +lemma tdeq_lifts_bi: liftable2_bi tdeq. /3 width=6 by tdeq_lifts_sn, liftable2_sn_bi/ qed-. -(* Inversion lemmas with degree-based equivalence for terms *****************) +(* Inversion lemmas with sort-irrelevant equivalence for terms **************) -lemma tdeq_inv_lifts_sn: ∀h,o. deliftable2_sn (tdeq h o). -#h #o #U1 #U2 #H elim H -U1 -U2 [||| * ] -[ #s1 #s2 #d #Hs1 #Hs2 #f #X #H >(lifts_inv_sort2 … H) -H - /3 width=5 by lifts_sort, tdeq_sort, ex2_intro/ +lemma tdeq_inv_lifts_sn: deliftable2_sn tdeq. +#U1 #U2 #H elim H -U1 -U2 [||| * ] +[ #s1 #s2 #f #X #H >(lifts_inv_sort2 … H) -H + /3 width=3 by lifts_sort, tdeq_sort, ex2_intro/ | #i #f #X #H elim (lifts_inv_lref2 … H) -H /3 width=3 by lifts_lref, tdeq_lref, ex2_intro/ | #l #f #X #H >(lifts_inv_gref2 … H) -H @@ -62,15 +65,15 @@ lemma tdeq_inv_lifts_sn: ∀h,o. deliftable2_sn (tdeq h o). ] qed-. -lemma tdeq_inv_lifts_dx (h) (o): deliftable2_dx (tdeq h o). +lemma tdeq_inv_lifts_dx: deliftable2_dx tdeq. /3 width=3 by tdeq_inv_lifts_sn, deliftable2_sn_dx, tdeq_sym/ qed-. -lemma tdeq_inv_lifts_bi: ∀h,o. deliftable2_bi (tdeq h o). +lemma tdeq_inv_lifts_bi: deliftable2_bi tdeq. /3 width=6 by tdeq_inv_lifts_sn, deliftable2_sn_bi/ qed-. -lemma tdeq_lifts_inv_pair_sn (h) (o) (I) (f:rtmap): - ∀X,T. ⬆*[f]X ≘ T → ∀V. ②{I}V.T ≛[h,o] X → ⊥. -#h #o #I #f #X #T #H elim H -f -X -T +lemma tdeq_lifts_inv_pair_sn (I) (f:rtmap): + ∀X,T. ⬆*[f]X ≘ T → ∀V. ②{I}V.T ≛ X → ⊥. +#I #f #X #T #H elim H -f -X -T [ #f #s #V #H elim (tdeq_inv_pair1 … H) -H #X1 #X2 #_ #_ #H destruct | #f #i #j #_ #V #H diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_toeq.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_toeq.ma new file mode 100644 index 000000000..ffbddcbe4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_toeq.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 "static_2/syntax/toeq.ma". +include "static_2/relocation/lifts_lifts.ma". + +(* GENERIC RELOCATION FOR TERMS *********************************************) + +(* Properties with sort-irrelevant outer equivalence for terms **************) + +lemma toeq_lifts_sn: liftable2_sn toeq. +#T1 #T2 #H elim H -T1 -T2 [||| * ] +[ #s1 #s2 #f #X #H + >(lifts_inv_sort1 … H) -H + /2 width=3 by toeq_sort, ex2_intro/ +| #i #f #X #H + elim (lifts_inv_lref1 … H) -H #j #Hj #H destruct + /3 width=3 by toeq_lref, lifts_lref, ex2_intro/ +| #l #f #X #H + >(lifts_inv_gref1 … H) -H + /2 width=3 by toeq_gref, ex2_intro/ +| #p #I #V1 #V2 #T1 #T2 #f #X #H + elim (lifts_inv_bind1 … H) -H #W1 #U1 #_ #_ #H destruct -V1 -T1 + elim (lifts_total V2 f) #W2 #HVW2 + elim (lifts_total T2 (⫯f)) #U2 #HTU2 + /3 width=3 by toeq_pair, lifts_bind, ex2_intro/ +| #I #V1 #V2 #T1 #T2 #f #X #H + elim (lifts_inv_flat1 … H) -H #W1 #U1 #_ #_ #H destruct -V1 -T1 + elim (lifts_total V2 f) #W2 #HVW2 + elim (lifts_total T2 f) #U2 #HTU2 + /3 width=3 by toeq_pair, lifts_flat, ex2_intro/ +] +qed-. + +lemma toeq_lifts_dx: liftable2_dx toeq. +/3 width=3 by toeq_lifts_sn, liftable2_sn_dx, toeq_sym/ qed-. + +lemma toeq_lifts_bi: liftable2_bi toeq. +/3 width=6 by toeq_lifts_sn, liftable2_sn_bi/ qed-. + +(* Inversion lemmas with sort-irrelevant outer equivalence for terms ********) + +lemma toeq_inv_lifts_bi: deliftable2_bi toeq. +#U1 #U2 #H elim H -U1 -U2 [||| * ] +[ #s1 #s2 #f #X1 #H1 #X2 #H2 + >(lifts_inv_sort2 … H1) -H1 >(lifts_inv_sort2 … H2) -H2 + /1 width=1 by toeq_sort/ +| #j #f #X1 #H1 #X2 #H2 + elim (lifts_inv_lref2 … H1) -H1 #i1 #Hj1 #H destruct + elim (lifts_inv_lref2 … H2) -H2 #i2 #Hj2 #H destruct + <(at_inj … Hj2 … Hj1) -j -f -i1 + /1 width=1 by toeq_lref/ +| #l #f #X1 #H1 #X2 #H2 + >(lifts_inv_gref2 … H1) -H1 >(lifts_inv_gref2 … H2) -H2 + /1 width=1 by toeq_gref/ +| #p #I #W1 #W2 #U1 #U2 #f #X1 #H1 #X2 #H2 + elim (lifts_inv_bind2 … H1) -H1 #V1 #T1 #_ #_ #H destruct -W1 -U1 + elim (lifts_inv_bind2 … H2) -H2 #V2 #T2 #_ #_ #H destruct -W2 -U2 + /1 width=1 by toeq_pair/ +| #I #W1 #W2 #U1 #U2 #f #X1 #H1 #X2 #H2 + elim (lifts_inv_flat2 … H1) -H1 #V1 #T1 #_ #_ #H destruct -W1 -U1 + elim (lifts_inv_flat2 … H2) -H2 #V2 #T2 #_ #_ #H destruct -W2 -U2 + /1 width=1 by toeq_pair/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_tweq.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_tweq.ma new file mode 100644 index 000000000..addd91c72 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/lifts_tweq.ma @@ -0,0 +1,105 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/syntax/tweq.ma". +include "static_2/relocation/lifts_lifts.ma". + +(* GENERIC RELOCATION FOR TERMS *********************************************) + +(* Properties with sort-irrelevant whd equivalence for terms ****************) + +lemma tweq_lifts_sn: liftable2_sn tweq. +#T1 #T2 #H elim H -T1 -T2 +[ #s1 #s2 #f #X #H >(lifts_inv_sort1 … H) -H + /3 width=3 by lifts_sort, tweq_sort, ex2_intro/ +| #i #f #X #H elim (lifts_inv_lref1 … H) -H + /3 width=3 by lifts_lref, tweq_lref, ex2_intro/ +| #l #f #X #H >(lifts_inv_gref1 … H) -H + /2 width=3 by lifts_gref, tweq_gref, ex2_intro/ +| #p #V1 #V2 #T1 #T2 #_ #IHT #f #X #H + elim (lifts_inv_bind1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct + elim (lifts_total V2 f) #W2 #HVW2 + elim (true_or_false p) #H destruct + [ elim (IHT … HTU1) -T1 [| // ] #U2 #HTU2 #HU12 + | elim (lifts_total T2 (⫯f)) #U2 #HTU2 + ] + /3 width=4 by tweq_abbr_pos, lifts_bind, ex2_intro/ +| #p #V1 #V2 #T1 #T2 #f #X #H + elim (lifts_inv_bind1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct + elim (lifts_total V2 f) #W2 #HVW2 + elim (lifts_total T2 (⫯f)) #U2 #HTU2 + /3 width=3 by lifts_bind, ex2_intro/ +| #V1 #V2 #T1 #T2 #_ #IHT #f #X #H + elim (lifts_inv_flat1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct + elim (lifts_total V2 f) #W2 #HVW2 + elim (IHT … HTU1) -T1 #U2 #HTU2 #HU12 + /3 width=4 by lifts_flat, tweq_appl, ex2_intro/ +| #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f #X #H + elim (lifts_inv_flat1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct + elim (IHV … HVW1) -V1 #W2 #HVW2 #HW12 + elim (IHT … HTU1) -T1 #U2 #HTU2 #HU12 + /3 width=5 by lifts_flat, tweq_cast, ex2_intro/ +] +qed-. + +lemma tweq_lifts_dx: liftable2_dx tweq. +/3 width=3 by tweq_lifts_sn, liftable2_sn_dx, tweq_sym/ qed-. + +lemma tweq_lifts_bi: liftable2_bi tweq. +/3 width=6 by tweq_lifts_sn, liftable2_sn_bi/ qed-. + +(* Inversion lemmas with sort-irrelevant whd equivalence for terms **********) + +lemma tweq_inv_lifts_bi: deliftable2_bi tweq. +#U1 #U2 #H elim H -U1 -U2 +[ #s1 #s2 #f #X1 #H1 #X2 #H2 + >(lifts_inv_sort2 … H1) -H1 >(lifts_inv_sort2 … H2) -H2 + /1 width=1 by tweq_sort/ +| #j #f #X1 #H1 #X2 #H2 + elim (lifts_inv_lref2 … H1) -H1 #i1 #Hj1 #H destruct + elim (lifts_inv_lref2 … H2) -H2 #i2 #Hj2 #H destruct + <(at_inj … Hj2 … Hj1) -j -f -i1 + /1 width=1 by tweq_lref/ +| #l #f #X1 #H1 #X2 #H2 + >(lifts_inv_gref2 … H1) -H1 >(lifts_inv_gref2 … H2) -H2 + /1 width=1 by tweq_gref/ +| #p #W1 #W2 #U1 #U2 #_ #IH #f #X1 #H1 #X2 #H2 + elim (lifts_inv_bind2 … H1) -H1 #V1 #T1 #_ #HTU1 #H destruct -W1 + elim (lifts_inv_bind2 … H2) -H2 #V2 #T2 #_ #HTU2 #H destruct -W2 + elim (true_or_false p) #H destruct + [ /3 width=3 by tweq_abbr_pos/ + | /1 width=1 by tweq_abbr_neg/ + ] +| #p #W1 #W2 #U1 #U2 #f #X1 #H1 #X2 #H2 + elim (lifts_inv_bind2 … H1) -H1 #V1 #T1 #_ #_ #H destruct -W1 -U1 + elim (lifts_inv_bind2 … H2) -H2 #V2 #T2 #_ #_ #H destruct -W2 -U2 + /1 width=1 by tweq_abst/ +| #W1 #W2 #U1 #U2 #_ #IH #f #X1 #H1 #X2 #H2 + elim (lifts_inv_flat2 … H1) -H1 #V1 #T1 #_ #HTU1 #H destruct -W1 + elim (lifts_inv_flat2 … H2) -H2 #V2 #T2 #_ #HTU2 #H destruct -W2 + /3 width=3 by tweq_appl/ +| #W1 #W2 #U1 #U2 #_ #_ #IHW #IHU #f #X1 #H1 #X2 #H2 + elim (lifts_inv_flat2 … H1) -H1 #V1 #T1 #HVW1 #HTU1 #H destruct + elim (lifts_inv_flat2 … H2) -H2 #V2 #T2 #HVW2 #HTU2 #H destruct + /3 width=3 by tweq_cast/ +] +qed-. + +lemma tweq_inv_abbr_pos_x_lifts_y_y (T) (f:rtmap): + ∀V,U. +ⓓV.U ≅ T → ⬆*[f]T ≘ U → ⊥. +@(f_ind … tw) #n #IH #T #Hn #f #V #U #H1 #H2 destruct +elim (tweq_inv_abbr_pos_sn … H1) -H1 #X1 #X2 #HX2 #H destruct -V +elim (lifts_inv_bind1 … H2) -H2 #Y1 #Y2 #_ #HXY2 #H destruct +/2 width=7 by/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/sex.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/sex.ma index df09463c8..6247b8686 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/sex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/sex.ma @@ -38,7 +38,7 @@ definition R_pw_confluent2_sex: relation3 lenv bind bind → relation3 lenv bind relation3 rtmap lenv bind ≝ λR1,R2,RN1,RP1,RN2,RP2,f,L0,I0. ∀I1. R1 L0 I0 I1 → ∀I2. R2 L0 I0 I2 → - ∀L1. L0 ⪤[RN1, RP1, f] L1 → ∀L2. L0 ⪤[RN2, RP2, f] L2 → + ∀L1. L0 ⪤[RN1,RP1,f] L1 → ∀L2. L0 ⪤[RN2,RP2,f] L2 → ∃∃I. R2 L1 I1 I & R1 L2 I2 I. definition sex_transitive: relation3 lenv bind bind → relation3 lenv bind bind → @@ -46,22 +46,22 @@ definition sex_transitive: relation3 lenv bind bind → relation3 lenv bind bind relation3 lenv bind bind → relation3 lenv bind bind → relation3 rtmap lenv bind ≝ λR1,R2,R3,RN,RP,f,L1,I1. - ∀I. R1 L1 I1 I → ∀L2. L1 ⪤[RN, RP, f] L2 → + ∀I. R1 L1 I1 I → ∀L2. L1 ⪤[RN,RP,f] L2 → ∀I2. R2 L2 I I2 → R3 L1 I1 I2. (* Basic inversion lemmas ***************************************************) -fact sex_inv_atom1_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → X = ⋆ → Y = ⋆. +fact sex_inv_atom1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → X = ⋆ → Y = ⋆. #RN #RP #f #X #Y * -f -X -Y // #f #I1 #I2 #L1 #L2 #_ #_ #H destruct qed-. (* Basic_2A1: includes lpx_sn_inv_atom1 *) -lemma sex_inv_atom1: ∀RN,RP,f,Y. ⋆ ⪤[RN, RP, f] Y → Y = ⋆. +lemma sex_inv_atom1: ∀RN,RP,f,Y. ⋆ ⪤[RN,RP,f] Y → Y = ⋆. /2 width=6 by sex_inv_atom1_aux/ qed-. -fact sex_inv_next1_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J1,K1. X = K1.ⓘ{J1} → f = ↑g → - ∃∃J2,K2. K1 ⪤[RN, RP, g] K2 & RN K1 J1 J2 & Y = K2.ⓘ{J2}. +fact sex_inv_next1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.ⓘ{J1} → f = ↑g → + ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & Y = K2.ⓘ{J2}. #RN #RP #f #X #Y * -f -X -Y [ #f #g #J1 #K1 #H destruct | #f #I1 #I2 #L1 #L2 #HL #HI #g #J1 #K1 #H1 #H2 <(injective_next … H2) -g destruct @@ -71,12 +71,12 @@ fact sex_inv_next1_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J1,K1. X = K qed-. (* Basic_2A1: includes lpx_sn_inv_pair1 *) -lemma sex_inv_next1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ{J1} ⪤[RN, RP, ↑g] Y → - ∃∃J2,K2. K1 ⪤[RN, RP, g] K2 & RN K1 J1 J2 & Y = K2.ⓘ{J2}. +lemma sex_inv_next1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ{J1} ⪤[RN,RP,↑g] Y → + ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & Y = K2.ⓘ{J2}. /2 width=7 by sex_inv_next1_aux/ qed-. -fact sex_inv_push1_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J1,K1. X = K1.ⓘ{J1} → f = ⫯g → - ∃∃J2,K2. K1 ⪤[RN, RP, g] K2 & RP K1 J1 J2 & Y = K2.ⓘ{J2}. +fact sex_inv_push1_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J1,K1. X = K1.ⓘ{J1} → f = ⫯g → + ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & Y = K2.ⓘ{J2}. #RN #RP #f #X #Y * -f -X -Y [ #f #g #J1 #K1 #H destruct | #f #I1 #I2 #L1 #L2 #_ #_ #g #J1 #K1 #_ #H elim (discr_next_push … H) @@ -85,21 +85,21 @@ fact sex_inv_push1_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J1,K1. X = K ] qed-. -lemma sex_inv_push1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ{J1} ⪤[RN, RP, ⫯g] Y → - ∃∃J2,K2. K1 ⪤[RN, RP, g] K2 & RP K1 J1 J2 & Y = K2.ⓘ{J2}. +lemma sex_inv_push1: ∀RN,RP,g,J1,K1,Y. K1.ⓘ{J1} ⪤[RN,RP,⫯g] Y → + ∃∃J2,K2. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & Y = K2.ⓘ{J2}. /2 width=7 by sex_inv_push1_aux/ qed-. -fact sex_inv_atom2_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → Y = ⋆ → X = ⋆. +fact sex_inv_atom2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → Y = ⋆ → X = ⋆. #RN #RP #f #X #Y * -f -X -Y // #f #I1 #I2 #L1 #L2 #_ #_ #H destruct qed-. (* Basic_2A1: includes lpx_sn_inv_atom2 *) -lemma sex_inv_atom2: ∀RN,RP,f,X. X ⪤[RN, RP, f] ⋆ → X = ⋆. +lemma sex_inv_atom2: ∀RN,RP,f,X. X ⪤[RN,RP,f] ⋆ → X = ⋆. /2 width=6 by sex_inv_atom2_aux/ qed-. -fact sex_inv_next2_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J2,K2. Y = K2.ⓘ{J2} → f = ↑g → - ∃∃J1,K1. K1 ⪤[RN, RP, g] K2 & RN K1 J1 J2 & X = K1.ⓘ{J1}. +fact sex_inv_next2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.ⓘ{J2} → f = ↑g → + ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & X = K1.ⓘ{J1}. #RN #RP #f #X #Y * -f -X -Y [ #f #g #J2 #K2 #H destruct | #f #I1 #I2 #L1 #L2 #HL #HI #g #J2 #K2 #H1 #H2 <(injective_next … H2) -g destruct @@ -109,12 +109,12 @@ fact sex_inv_next2_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J2,K2. Y = K qed-. (* Basic_2A1: includes lpx_sn_inv_pair2 *) -lemma sex_inv_next2: ∀RN,RP,g,J2,X,K2. X ⪤[RN, RP, ↑g] K2.ⓘ{J2} → - ∃∃J1,K1. K1 ⪤[RN, RP, g] K2 & RN K1 J1 J2 & X = K1.ⓘ{J1}. +lemma sex_inv_next2: ∀RN,RP,g,J2,X,K2. X ⪤[RN,RP,↑g] K2.ⓘ{J2} → + ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RN K1 J1 J2 & X = K1.ⓘ{J1}. /2 width=7 by sex_inv_next2_aux/ qed-. -fact sex_inv_push2_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J2,K2. Y = K2.ⓘ{J2} → f = ⫯g → - ∃∃J1,K1. K1 ⪤[RN, RP, g] K2 & RP K1 J1 J2 & X = K1.ⓘ{J1}. +fact sex_inv_push2_aux: ∀RN,RP,f,X,Y. X ⪤[RN,RP,f] Y → ∀g,J2,K2. Y = K2.ⓘ{J2} → f = ⫯g → + ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & X = K1.ⓘ{J1}. #RN #RP #f #X #Y * -f -X -Y [ #f #J2 #K2 #g #H destruct | #f #I1 #I2 #L1 #L2 #_ #_ #g #J2 #K2 #_ #H elim (discr_next_push … H) @@ -123,28 +123,28 @@ fact sex_inv_push2_aux: ∀RN,RP,f,X,Y. X ⪤[RN, RP, f] Y → ∀g,J2,K2. Y = K ] qed-. -lemma sex_inv_push2: ∀RN,RP,g,J2,X,K2. X ⪤[RN, RP, ⫯g] K2.ⓘ{J2} → - ∃∃J1,K1. K1 ⪤[RN, RP, g] K2 & RP K1 J1 J2 & X = K1.ⓘ{J1}. +lemma sex_inv_push2: ∀RN,RP,g,J2,X,K2. X ⪤[RN,RP,⫯g] K2.ⓘ{J2} → + ∃∃J1,K1. K1 ⪤[RN,RP,g] K2 & RP K1 J1 J2 & X = K1.ⓘ{J1}. /2 width=7 by sex_inv_push2_aux/ qed-. (* Basic_2A1: includes lpx_sn_inv_pair *) lemma sex_inv_next: ∀RN,RP,f,I1,I2,L1,L2. - L1.ⓘ{I1} ⪤[RN, RP, ↑f] L2.ⓘ{I2} → - L1 ⪤[RN, RP, f] L2 ∧ RN L1 I1 I2. + L1.ⓘ{I1} ⪤[RN,RP,↑f] L2.ⓘ{I2} → + L1 ⪤[RN,RP,f] L2 ∧ RN L1 I1 I2. #RN #RP #f #I1 #I2 #L1 #L2 #H elim (sex_inv_next1 … H) -H #I0 #L0 #HL10 #HI10 #H destruct /2 width=1 by conj/ qed-. lemma sex_inv_push: ∀RN,RP,f,I1,I2,L1,L2. - L1.ⓘ{I1} ⪤[RN, RP, ⫯f] L2.ⓘ{I2} → - L1 ⪤[RN, RP, f] L2 ∧ RP L1 I1 I2. + L1.ⓘ{I1} ⪤[RN,RP,⫯f] L2.ⓘ{I2} → + L1 ⪤[RN,RP,f] L2 ∧ RP L1 I1 I2. #RN #RP #f #I1 #I2 #L1 #L2 #H elim (sex_inv_push1 … H) -H #I0 #L0 #HL10 #HI10 #H destruct /2 width=1 by conj/ qed-. -lemma sex_inv_tl: ∀RN,RP,f,I1,I2,L1,L2. L1 ⪤[RN, RP, ⫱f] L2 → +lemma sex_inv_tl: ∀RN,RP,f,I1,I2,L1,L2. L1 ⪤[RN,RP,⫱f] L2 → RN L1 I1 I2 → RP L1 I1 I2 → - L1.ⓘ{I1} ⪤[RN, RP, f] L2.ⓘ{I2}. + L1.ⓘ{I1} ⪤[RN,RP,f] L2.ⓘ{I2}. #RN #RP #f #I1 #I2 #L2 #L2 elim (pn_split f) * /2 width=1 by sex_next, sex_push/ qed-. @@ -152,8 +152,8 @@ qed-. (* Basic forward lemmas *****************************************************) lemma sex_fwd_bind: ∀RN,RP,f,I1,I2,L1,L2. - L1.ⓘ{I1} ⪤[RN, RP, f] L2.ⓘ{I2} → - L1 ⪤[RN, RP, ⫱f] L2. + L1.ⓘ{I1} ⪤[RN,RP,f] L2.ⓘ{I2} → + L1 ⪤[RN,RP,⫱f] L2. #RN #RP #f #I1 #I2 #L1 #L2 #Hf elim (pn_split f) * #g #H destruct [ elim (sex_inv_push … Hf) | elim (sex_inv_next … Hf) ] -Hf // @@ -161,7 +161,7 @@ qed-. (* Basic properties *********************************************************) -lemma sex_eq_repl_back: ∀RN,RP,L1,L2. eq_repl_back … (λf. L1 ⪤[RN, RP, f] L2). +lemma sex_eq_repl_back: ∀RN,RP,L1,L2. eq_repl_back … (λf. L1 ⪤[RN,RP,f] L2). #RN #RP #L1 #L2 #f1 #H elim H -f1 -L1 -L2 // #f1 #I1 #I2 #L1 #L2 #_ #HI #IH #f2 #H [ elim (eq_inv_nx … H) -H /3 width=3 by sex_next/ @@ -169,7 +169,7 @@ lemma sex_eq_repl_back: ∀RN,RP,L1,L2. eq_repl_back … (λf. L1 ⪤[RN, RP, f] ] qed-. -lemma sex_eq_repl_fwd: ∀RN,RP,L1,L2. eq_repl_fwd … (λf. L1 ⪤[RN, RP, f] L2). +lemma sex_eq_repl_fwd: ∀RN,RP,L1,L2. eq_repl_fwd … (λf. L1 ⪤[RN,RP,f] L2). #RN #RP #L1 #L2 @eq_repl_sym /2 width=3 by sex_eq_repl_back/ (**) (* full auto fails *) qed-. @@ -189,20 +189,20 @@ lemma sex_sym: ∀RN,RP. qed-. lemma sex_pair_repl: ∀RN,RP,f,I1,I2,L1,L2. - L1.ⓘ{I1} ⪤[RN, RP, f] L2.ⓘ{I2} → + L1.ⓘ{I1} ⪤[RN,RP,f] L2.ⓘ{I2} → ∀J1,J2. RN L1 J1 J2 → RP L1 J1 J2 → - L1.ⓘ{J1} ⪤[RN, RP, f] L2.ⓘ{J2}. + L1.ⓘ{J1} ⪤[RN,RP,f] L2.ⓘ{J2}. /3 width=3 by sex_inv_tl, sex_fwd_bind/ qed-. lemma sex_co: ∀RN1,RP1,RN2,RP2. RN1 ⊆ RN2 → RP1 ⊆ RP2 → - ∀f,L1,L2. L1 ⪤[RN1, RP1, f] L2 → L1 ⪤[RN2, RP2, f] L2. + ∀f,L1,L2. L1 ⪤[RN1,RP1,f] L2 → L1 ⪤[RN2,RP2,f] L2. #RN1 #RP1 #RN2 #RP2 #HRN #HRP #f #L1 #L2 #H elim H -f -L1 -L2 /3 width=1 by sex_atom, sex_next, sex_push/ qed-. lemma sex_co_isid: ∀RN1,RP1,RN2,RP2. RP1 ⊆ RP2 → - ∀f,L1,L2. L1 ⪤[RN1, RP1, f] L2 → 𝐈⦃f⦄ → - L1 ⪤[RN2, RP2, f] L2. + ∀f,L1,L2. L1 ⪤[RN1,RP1,f] L2 → 𝐈⦃f⦄ → + L1 ⪤[RN2,RP2,f] L2. #RN1 #RP1 #RN2 #RP2 #HR #f #L1 #L2 #H elim H -f -L1 -L2 // #f #I1 #I2 #K1 #K2 #_ #HI12 #IH #H [ elim (isid_inv_next … H) -H // @@ -211,8 +211,8 @@ lemma sex_co_isid: ∀RN1,RP1,RN2,RP2. RP1 ⊆ RP2 → qed-. lemma sex_sdj: ∀RN,RP. RP ⊆ RN → - ∀f1,L1,L2. L1 ⪤[RN, RP, f1] L2 → - ∀f2. f1 ∥ f2 → L1 ⪤[RP, RN, f2] L2. + ∀f1,L1,L2. L1 ⪤[RN,RP,f1] L2 → + ∀f2. f1 ∥ f2 → L1 ⪤[RP,RN,f2] L2. #RN #RP #HR #f1 #L1 #L2 #H elim H -f1 -L1 -L2 // #f1 #I1 #I2 #L1 #L2 #_ #HI12 #IH #f2 #H12 [ elim (sdj_inv_nx … H12) -H12 [2,3: // ] @@ -223,8 +223,8 @@ lemma sex_sdj: ∀RN,RP. RP ⊆ RN → qed-. lemma sle_sex_trans: ∀RN,RP. RN ⊆ RP → - ∀f2,L1,L2. L1 ⪤[RN, RP, f2] L2 → - ∀f1. f1 ⊆ f2 → L1 ⪤[RN, RP, f1] L2. + ∀f2,L1,L2. L1 ⪤[RN,RP,f2] L2 → + ∀f1. f1 ⊆ f2 → L1 ⪤[RN,RP,f1] L2. #RN #RP #HR #f2 #L1 #L2 #H elim H -f2 -L1 -L2 // #f2 #I1 #I2 #L1 #L2 #_ #HI12 #IH #f1 #H12 [ elim (pn_split f1) * ] @@ -236,8 +236,8 @@ lemma sle_sex_trans: ∀RN,RP. RN ⊆ RP → qed-. lemma sle_sex_conf: ∀RN,RP. RP ⊆ RN → - ∀f1,L1,L2. L1 ⪤[RN, RP, f1] L2 → - ∀f2. f1 ⊆ f2 → L1 ⪤[RN, RP, f2] L2. + ∀f1,L1,L2. L1 ⪤[RN,RP,f1] L2 → + ∀f2. f1 ⊆ f2 → L1 ⪤[RN,RP,f2] L2. #RN #RP #HR #f1 #L1 #L2 #H elim H -f1 -L1 -L2 // #f1 #I1 #I2 #L1 #L2 #_ #HI12 #IH #f2 #H12 [2: elim (pn_split f2) * ] @@ -249,8 +249,8 @@ lemma sle_sex_conf: ∀RN,RP. RP ⊆ RN → qed-. lemma sex_sle_split: ∀R1,R2,RP. c_reflexive … R1 → c_reflexive … R2 → - ∀f,L1,L2. L1 ⪤[R1, RP, f] L2 → ∀g. f ⊆ g → - ∃∃L. L1 ⪤[R1, RP, g] L & L ⪤[R2, cfull, f] L2. + ∀f,L1,L2. L1 ⪤[R1,RP,f] L2 → ∀g. f ⊆ g → + ∃∃L. L1 ⪤[R1,RP,g] L & L ⪤[R2,cfull,f] L2. #R1 #R2 #RP #HR1 #HR2 #f #L1 #L2 #H elim H -f -L1 -L2 [ /2 width=3 by sex_atom, ex2_intro/ ] #f #I1 #I2 #L1 #L2 #_ #HI12 #IH #y #H @@ -262,8 +262,8 @@ lemma sex_sle_split: ∀R1,R2,RP. c_reflexive … R1 → c_reflexive … R2 → qed-. lemma sex_sdj_split: ∀R1,R2,RP. c_reflexive … R1 → c_reflexive … R2 → - ∀f,L1,L2. L1 ⪤[R1, RP, f] L2 → ∀g. f ∥ g → - ∃∃L. L1 ⪤[RP, R1, g] L & L ⪤[R2, cfull, f] L2. + ∀f,L1,L2. L1 ⪤[R1,RP,f] L2 → ∀g. f ∥ g → + ∃∃L. L1 ⪤[RP,R1,g] L & L ⪤[R2,cfull,f] L2. #R1 #R2 #RP #HR1 #HR2 #f #L1 #L2 #H elim H -f -L1 -L2 [ /2 width=3 by sex_atom, ex2_intro/ ] #f #I1 #I2 #L1 #L2 #_ #HI12 #IH #y #H @@ -277,7 +277,7 @@ qed-. lemma sex_dec: ∀RN,RP. (∀L,I1,I2. Decidable (RN L I1 I2)) → (∀L,I1,I2. Decidable (RP L I1 I2)) → - ∀L1,L2,f. Decidable (L1 ⪤[RN, RP, f] L2). + ∀L1,L2,f. Decidable (L1 ⪤[RN,RP,f] L2). #RN #RP #HRN #HRP #L1 elim L1 -L1 [ * | #L1 #I1 #IH * ] [ /2 width=1 by sex_atom, or_introl/ | #L2 #I2 #f @or_intror #H diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/sex_length.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/sex_length.ma index a7b2a5d71..4a2379889 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/sex_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/sex_length.ma @@ -20,13 +20,13 @@ include "static_2/relocation/sex.ma". (* Forward lemmas with length for local environments ************************) (* Note: "#f #I1 #I2 #L1 #L2 >length_bind >length_bind //" was needed to conclude *) -lemma sex_fwd_length: ∀RN,RP,f,L1,L2. L1 ⪤[RN, RP, f] L2 → |L1| = |L2|. +lemma sex_fwd_length: ∀RN,RP,f,L1,L2. L1 ⪤[RN,RP,f] L2 → |L1| = |L2|. #RN #RP #f #L1 #L2 #H elim H -f -L1 -L2 // qed-. (* Properties with length for local environments ****************************) -lemma sex_length_cfull: ∀L1,L2. |L1| = |L2| → ∀f. L1 ⪤[cfull, cfull, f] L2. +lemma sex_length_cfull: ∀L1,L2. |L1| = |L2| → ∀f. L1 ⪤[cfull,cfull,f] L2. #L1 elim L1 -L1 [ #Y2 #H >(length_inv_zero_sn … H) -Y2 // | #L1 #I1 #IH #Y2 #H #f @@ -36,7 +36,7 @@ lemma sex_length_cfull: ∀L1,L2. |L1| = |L2| → ∀f. L1 ⪤[cfull, cfull, f] qed. lemma sex_length_isid: ∀R,L1,L2. |L1| = |L2| → - ∀f. 𝐈⦃f⦄ → L1 ⪤[R, cfull, f] L2. + ∀f. 𝐈⦃f⦄ → L1 ⪤[R,cfull,f] L2. #R #L1 elim L1 -L1 [ #Y2 #H >(length_inv_zero_sn … H) -Y2 // | #L1 #I1 #IH #Y2 #H #f #Hf diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/sex_sex.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/sex_sex.ma index 571379e2f..c1954b1a7 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/sex_sex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/sex_sex.ma @@ -23,9 +23,9 @@ theorem sex_trans_gen (RN1) (RP1) (RN2) (RP2) (RN) (RP): ∀L1,f. (∀g,I,K,n. ⬇*[n] L1 ≘ K.ⓘ{I} → ↑g = ⫱*[n] f → sex_transitive RN1 RN2 RN RN1 RP1 g K I) → (∀g,I,K,n. ⬇*[n] L1 ≘ K.ⓘ{I} → ⫯g = ⫱*[n] f → sex_transitive RP1 RP2 RP RN1 RP1 g K I) → - ∀L0. L1 ⪤[RN1, RP1, f] L0 → - ∀L2. L0 ⪤[RN2, RP2, f] L2 → - L1 ⪤[RN, RP, f] L2. + ∀L0. L1 ⪤[RN1,RP1,f] L0 → + ∀L2. L0 ⪤[RN2,RP2,f] L2 → + L1 ⪤[RN,RP,f] L2. #RN1 #RP1 #RN2 #RP2 #RN #RP #L1 elim L1 -L1 [ #f #_ #_ #L0 #H1 #L2 #H2 lapply (sex_inv_atom1 … H1) -H1 #H destruct @@ -50,8 +50,8 @@ theorem sex_trans (RN) (RP) (f): (∀g,I,K. sex_transitive RN RN RN RN RP g K I) Transitive … (sex RN RP f). /2 width=9 by sex_trans_gen/ qed-. -theorem sex_trans_id_cfull: ∀R1,R2,R3,L1,L,f. L1 ⪤[R1, cfull, f] L → 𝐈⦃f⦄ → - ∀L2. L ⪤[R2, cfull, f] L2 → L1 ⪤[R3, cfull, f] L2. +theorem sex_trans_id_cfull: ∀R1,R2,R3,L1,L,f. L1 ⪤[R1,cfull,f] L → 𝐈⦃f⦄ → + ∀L2. L ⪤[R2,cfull,f] L2 → L1 ⪤[R3,cfull,f] L2. #R1 #R2 #R3 #L1 #L #f #H elim H -L1 -L -f [ #f #Hf #L2 #H >(sex_inv_atom1 … H) -L2 // ] #f #I1 #I #K1 #K #HK1 #_ #IH #Hf #L2 #H @@ -93,9 +93,9 @@ theorem sex_canc_dx: ∀RN,RP,f. Transitive … (sex RN RP f) → /3 width=3 by/ qed-. lemma sex_meet: ∀RN,RP,L1,L2. - ∀f1. L1 ⪤[RN, RP, f1] L2 → - ∀f2. L1 ⪤[RN, RP, f2] L2 → - ∀f. f1 ⋒ f2 ≘ f → L1 ⪤[RN, RP, f] L2. + ∀f1. L1 ⪤[RN,RP,f1] L2 → + ∀f2. L1 ⪤[RN,RP,f2] L2 → + ∀f. f1 ⋒ f2 ≘ f → L1 ⪤[RN,RP,f] L2. #RN #RP #L1 #L2 #f1 #H elim H -f1 -L1 -L2 // #f1 #I1 #I2 #L1 #L2 #_ #HI12 #IH #f2 #H #f #Hf elim (pn_split f2) * #g2 #H2 destruct @@ -106,9 +106,9 @@ try elim (sex_inv_push … H) try elim (sex_inv_next … H) -H qed-. lemma sex_join: ∀RN,RP,L1,L2. - ∀f1. L1 ⪤[RN, RP, f1] L2 → - ∀f2. L1 ⪤[RN, RP, f2] L2 → - ∀f. f1 ⋓ f2 ≘ f → L1 ⪤[RN, RP, f] L2. + ∀f1. L1 ⪤[RN,RP,f1] L2 → + ∀f2. L1 ⪤[RN,RP,f2] L2 → + ∀f. f1 ⋓ f2 ≘ f → L1 ⪤[RN,RP,f] L2. #RN #RP #L1 #L2 #f1 #H elim H -f1 -L1 -L2 // #f1 #I1 #I2 #L1 #L2 #_ #HI12 #IH #f2 #H #f #Hf elim (pn_split f2) * #g2 #H2 destruct diff --git a/matita/matita/contribs/lambdadelta/static_2/relocation/sex_tc.ma b/matita/matita/contribs/lambdadelta/static_2/relocation/sex_tc.ma index 339ac98a7..8d1cf5538 100644 --- a/matita/matita/contribs/lambdadelta/static_2/relocation/sex_tc.ma +++ b/matita/matita/contribs/lambdadelta/static_2/relocation/sex_tc.ma @@ -34,7 +34,7 @@ lemma sex_tc_next_sn: ∀RN,RP. c_reflexive … RN → qed. lemma sex_tc_next_dx: ∀RN,RP. c_reflexive … RN → c_reflexive … RP → - ∀f,I1,I2,L1. (CTC … RN) L1 I1 I2 → ∀L2. L1 ⪤[RN, RP, f] L2 → + ∀f,I1,I2,L1. (CTC … RN) L1 I1 I2 → ∀L2. L1 ⪤[RN,RP,f] L2 → TC … (sex RN RP (↑f)) (L1.ⓘ{I1}) (L2.ⓘ{I2}). #RN #RP #HRN #HRP #f #I1 #I2 #L1 #H elim H -I2 /4 width=5 by sex_refl, sex_next, step, inj/ @@ -48,18 +48,18 @@ lemma sex_tc_push_sn: ∀RN,RP. c_reflexive … RP → qed. lemma sex_tc_push_dx: ∀RN,RP. c_reflexive … RN → c_reflexive … RP → - ∀f,I1,I2,L1. (CTC … RP) L1 I1 I2 → ∀L2. L1 ⪤[RN, RP, f] L2 → + ∀f,I1,I2,L1. (CTC … RP) L1 I1 I2 → ∀L2. L1 ⪤[RN,RP,f] L2 → TC … (sex RN RP (⫯f)) (L1.ⓘ{I1}) (L2.ⓘ{I2}). #RN #RP #HRN #HRP #f #I1 #I2 #L1 #H elim H -I2 /4 width=5 by sex_refl, sex_push, step, inj/ qed. -lemma sex_tc_inj_sn: ∀RN,RP,f,L1,L2. L1 ⪤[RN, RP, f] L2 → L1 ⪤[CTC … RN, RP, f] L2. +lemma sex_tc_inj_sn: ∀RN,RP,f,L1,L2. L1 ⪤[RN,RP,f] L2 → L1 ⪤[CTC … RN,RP,f] L2. #RN #RP #f #L1 #L2 #H elim H -f -L1 -L2 /3 width=1 by sex_push, sex_next, inj/ qed. -lemma sex_tc_inj_dx: ∀RN,RP,f,L1,L2. L1 ⪤[RN, RP, f] L2 → L1 ⪤[RN, CTC … RP, f] L2. +lemma sex_tc_inj_dx: ∀RN,RP,f,L1,L2. L1 ⪤[RN,RP,f] L2 → L1 ⪤[RN,CTC … RP,f] L2. #RN #RP #f #L1 #L2 #H elim H -f -L1 -L2 /3 width=1 by sex_push, sex_next, inj/ qed. @@ -82,8 +82,8 @@ qed. (* Basic_2A1: uses: TC_lpx_sn_ind *) theorem sex_tc_step_dx: ∀RN,RP. s_rs_transitive_isid RN RP → - ∀f,L1,L. L1 ⪤[RN, RP, f] L → 𝐈⦃f⦄ → - ∀L2. L ⪤[RN, CTC … RP, f] L2 → L1⪤ [RN, CTC … RP, f] L2. + ∀f,L1,L. L1 ⪤[RN,RP,f] L → 𝐈⦃f⦄ → + ∀L2. L ⪤[RN,CTC … RP,f] L2 → L1⪤ [RN,CTC … RP,f] L2. #RN #RP #HRP #f #L1 #L #H elim H -f -L1 -L [ #f #_ #Y #H -HRP >(sex_inv_atom1 … H) -Y // ] #f #I1 #I #L1 #L #HL1 #HI1 #IH #Hf #Y #H @@ -99,7 +99,7 @@ qed-. (* Advanced properties ******************************************************) lemma sex_tc_dx: ∀RN,RP. s_rs_transitive_isid RN RP → - ∀f. 𝐈⦃f⦄ → ∀L1,L2. TC … (sex RN RP f) L1 L2 → L1 ⪤[RN, CTC … RP, f] L2. + ∀f. 𝐈⦃f⦄ → ∀L1,L2. TC … (sex RN RP f) L1 L2 → L1 ⪤[RN,CTC … RP,f] L2. #RN #RP #HRP #f #Hf #L1 #L2 #H @(TC_ind_dx ??????? H) -L1 /3 width=3 by sex_tc_step_dx, sex_tc_inj_dx/ qed. @@ -107,13 +107,13 @@ qed. (* Advanced inversion lemmas ************************************************) lemma sex_inv_tc_sn: ∀RN,RP. c_reflexive … RN → c_reflexive … RP → - ∀f,L1,L2. L1 ⪤[CTC … RN, RP, f] L2 → TC … (sex RN RP f) L1 L2. + ∀f,L1,L2. L1 ⪤[CTC … RN,RP,f] L2 → TC … (sex RN RP f) L1 L2. #RN #RP #HRN #HRP #f #L1 #L2 #H elim H -f -L1 -L2 /2 width=1 by sex_tc_next, sex_tc_push_sn, sex_atom, inj/ qed-. lemma sex_inv_tc_dx: ∀RN,RP. c_reflexive … RN → c_reflexive … RP → - ∀f,L1,L2. L1 ⪤[RN, CTC … RP, f] L2 → TC … (sex RN RP f) L1 L2. + ∀f,L1,L2. L1 ⪤[RN,CTC … RP,f] L2 → TC … (sex RN RP f) L1 L2. #RN #RP #HRN #HRP #f #L1 #L2 #H elim H -f -L1 -L2 /2 width=1 by sex_tc_push, sex_tc_next_sn, sex_atom, inj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup.ma b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup.ma index e3dae5bf4..28cfb9ce0 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup.ma @@ -30,55 +30,55 @@ interpretation "plus-iterated structural successor (closure)" (* Basic properties *********************************************************) -lemma fqu_fqup: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄. +lemma fqu_fqup: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄. /2 width=1 by tri_inj/ qed. lemma fqup_strap1: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄. + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄. /2 width=5 by tri_step/ qed. lemma fqup_strap2: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ ⊐[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄. + ⦃G1,L1,T1⦄ ⬂[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄. /2 width=5 by tri_TC_strap/ qed. -lemma fqup_pair_sn: ∀b,I,G,L,V,T. ⦃G, L, ②{I}V.T⦄ ⊐+[b] ⦃G, L, V⦄. +lemma fqup_pair_sn: ∀b,I,G,L,V,T. ⦃G,L,②{I}V.T⦄ ⬂+[b] ⦃G,L,V⦄. /2 width=1 by fqu_pair_sn, fqu_fqup/ qed. -lemma fqup_bind_dx: ∀b,p,I,G,L,V,T. ⦃G, L, ⓑ{p,I}V.T⦄ ⊐+[b] ⦃G, L.ⓑ{I}V, T⦄. -/2 width=1 by fqu_bind_dx, fqu_fqup/ qed. +lemma fqup_bind_dx: ∀p,I,G,L,V,T. ⦃G,L,ⓑ{p,I}V.T⦄ ⬂+[Ⓣ] ⦃G,L.ⓑ{I}V,T⦄. +/3 width=1 by fqu_bind_dx, fqu_fqup/ qed. -lemma fqup_clear: ∀p,I,G,L,V,T. ⦃G, L, ⓑ{p,I}V.T⦄ ⊐+[Ⓕ] ⦃G, L.ⓧ, T⦄. +lemma fqup_clear: ∀p,I,G,L,V,T. ⦃G,L,ⓑ{p,I}V.T⦄ ⬂+[Ⓕ] ⦃G,L.ⓧ,T⦄. /3 width=1 by fqu_clear, fqu_fqup/ qed. -lemma fqup_flat_dx: ∀b,I,G,L,V,T. ⦃G, L, ⓕ{I}V.T⦄ ⊐+[b] ⦃G, L, T⦄. +lemma fqup_flat_dx: ∀b,I,G,L,V,T. ⦃G,L,ⓕ{I}V.T⦄ ⬂+[b] ⦃G,L,T⦄. /2 width=1 by fqu_flat_dx, fqu_fqup/ qed. -lemma fqup_flat_dx_pair_sn: ∀b,I1,I2,G,L,V1,V2,T. ⦃G, L, ⓕ{I1}V1.②{I2}V2.T⦄ ⊐+[b] ⦃G, L, V2⦄. +lemma fqup_flat_dx_pair_sn: ∀b,I1,I2,G,L,V1,V2,T. ⦃G,L,ⓕ{I1}V1.②{I2}V2.T⦄ ⬂+[b] ⦃G,L,V2⦄. /2 width=5 by fqu_pair_sn, fqup_strap1/ qed. -lemma fqup_bind_dx_flat_dx: ∀b,p,G,I1,I2,L,V1,V2,T. ⦃G, L, ⓑ{p,I1}V1.ⓕ{I2}V2.T⦄ ⊐+[b] ⦃G, L.ⓑ{I1}V1, T⦄. +lemma fqup_bind_dx_flat_dx: ∀p,G,I1,I2,L,V1,V2,T. ⦃G,L,ⓑ{p,I1}V1.ⓕ{I2}V2.T⦄ ⬂+[Ⓣ] ⦃G,L.ⓑ{I1}V1,T⦄. /2 width=5 by fqu_flat_dx, fqup_strap1/ qed. -lemma fqup_flat_dx_bind_dx: ∀b,p,I1,I2,G,L,V1,V2,T. ⦃G, L, ⓕ{I1}V1.ⓑ{p,I2}V2.T⦄ ⊐+[b] ⦃G, L.ⓑ{I2}V2, T⦄. -/2 width=5 by fqu_bind_dx, fqup_strap1/ qed. +lemma fqup_flat_dx_bind_dx: ∀p,I1,I2,G,L,V1,V2,T. ⦃G,L,ⓕ{I1}V1.ⓑ{p,I2}V2.T⦄ ⬂+[Ⓣ] ⦃G,L.ⓑ{I2}V2,T⦄. +/3 width=5 by fqu_bind_dx, fqup_strap1/ qed. (* Basic eliminators ********************************************************) lemma fqup_ind: ∀b,G1,L1,T1. ∀Q:relation3 …. - (∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → - (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐[b] ⦃G2, L2, T2⦄ → Q G L T → Q G2 L2 T2) → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → Q G2 L2 T2. + (∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → + (∀G,G2,L,L2,T,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂[b] ⦃G2,L2,T2⦄ → Q G L T → Q G2 L2 T2) → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → Q G2 L2 T2. #b #G1 #L1 #T1 #Q #IH1 #IH2 #G2 #L2 #T2 #H @(tri_TC_ind … IH1 IH2 G2 L2 T2 H) qed-. lemma fqup_ind_dx: ∀b,G2,L2,T2. ∀Q:relation3 …. - (∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → Q G1 L1 T1) → - (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ⊐[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐+[b] ⦃G2, L2, T2⦄ → Q G L T → Q G1 L1 T1) → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → Q G1 L1 T1. + (∀G1,L1,T1. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → Q G1 L1 T1) → + (∀G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ⬂[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂+[b] ⦃G2,L2,T2⦄ → Q G L T → Q G1 L1 T1) → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → Q G1 L1 T1. #b #G2 #L2 #T2 #Q #IH1 #IH2 #G1 #L1 #T1 #H @(tri_TC_ind_dx … IH1 IH2 G1 L1 T1 H) qed-. @@ -86,7 +86,7 @@ qed-. (* Advanced properties ******************************************************) lemma fqup_zeta (b) (p) (I) (G) (K) (V): - ∀T1,T2. ⬆*[1]T2 ≘ T1 → ⦃G,K,ⓑ{p,I}V.T1⦄ ⊐+[b] ⦃G,K,T2⦄. -/4 width=5 by fqup_strap2, fqu_fqup, fqu_drop/ qed. + ∀T1,T2. ⬆*[1]T2 ≘ T1 → ⦃G,K,ⓑ{p,I}V.T1⦄ ⬂+[b] ⦃G,K,T2⦄. +* /4 width=5 by fqup_strap2, fqu_fqup, fqu_drop, fqu_clear, fqu_bind_dx/ qed. (* Basic_2A1: removed theorems 1: fqup_drop *) diff --git a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_drops.ma b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_drops.ma index 4eafa94d2..c21d46c60 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_drops.ma @@ -20,7 +20,7 @@ include "static_2/s_computation/fqup.ma". (* Properties with generic slicing for local environments *******************) lemma fqup_drops_succ: ∀b,G,K,T,i,L,U. ⬇*[↑i] L ≘ K → ⬆*[↑i] T ≘ U → - ⦃G, L, U⦄ ⊐+[b] ⦃G, K, T⦄. + ⦃G,L,U⦄ ⬂+[b] ⦃G,K,T⦄. #b #G #K #T #i elim i -i [ #L #U #HLK #HTU elim (drops_inv_succ … HLK) -HLK #I #Y #HY #H destruct <(drops_fwd_isid … HY) -K // @@ -33,7 +33,7 @@ lemma fqup_drops_succ: ∀b,G,K,T,i,L,U. ⬇*[↑i] L ≘ K → ⬆*[↑i] T ≘ qed. lemma fqup_drops_strap1: ∀b,G1,G2,L1,K1,K2,T1,T2,U1,i. ⬇*[i] L1 ≘ K1 → ⬆*[i] T1 ≘ U1 → - ⦃G1, K1, T1⦄ ⊐[b] ⦃G2, K2, T2⦄ → ⦃G1, L1, U1⦄ ⊐+[b] ⦃G2, K2, T2⦄. + ⦃G1,K1,T1⦄ ⬂[b] ⦃G2,K2,T2⦄ → ⦃G1,L1,U1⦄ ⬂+[b] ⦃G2,K2,T2⦄. #b #G1 #G2 #L1 #K1 #K2 #T1 #T2 #U1 * [ #HLK1 #HTU1 #HT12 >(drops_fwd_isid … HLK1) -L1 // @@ -42,5 +42,5 @@ lemma fqup_drops_strap1: ∀b,G1,G2,L1,K1,K2,T1,T2,U1,i. ⬇*[i] L1 ≘ K1 → ] qed-. -lemma fqup_lref: ∀b,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, L, #i⦄ ⊐+[b] ⦃G, K, V⦄. +lemma fqup_lref: ∀b,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G,L,#i⦄ ⬂+[b] ⦃G,K,V⦄. /2 width=6 by fqup_drops_strap1/ qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_weight.ma b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_weight.ma index 25a81dfa8..94319671a 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqup_weight.ma @@ -19,8 +19,8 @@ include "static_2/s_computation/fqup.ma". (* Forward lemmas with weight for closures **********************************) -lemma fqup_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ♯{G2, L2, T2} < ♯{G1, L1, T1}. +lemma fqup_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ♯{G2,L2,T2} < ♯{G1,L1,T1}. #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 /3 width=3 by fqu_fwd_fw, transitive_lt/ qed-. @@ -28,7 +28,7 @@ qed-. (* Advanced eliminators *****************************************************) lemma fqup_wf_ind: ∀b. ∀Q:relation3 …. ( - ∀G1,L1,T1. (∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → + ∀G1,L1,T1. (∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → ∀G1,L1,T1. Q G1 L1 T1. #b #Q #HQ @(f3_ind … fw) #x #IHx #G1 #L1 #T1 #H destruct @@ -36,7 +36,7 @@ lemma fqup_wf_ind: ∀b. ∀Q:relation3 …. ( qed-. lemma fqup_wf_ind_eq: ∀b. ∀Q:relation3 …. ( - ∀G1,L1,T1. (∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → + ∀G1,L1,T1. (∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → ∀G2,L2,T2. G1 = G2 → L1 = L2 → T1 = T2 → Q G2 L2 T2 ) → ∀G1,L1,T1. Q G1 L1 T1. #b #Q #HQ @(f3_ind … fw) #x #IHx #G1 #L1 #T1 #H destruct diff --git a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus.ma b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus.ma index fb6a7ea7d..d1183daff 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus.ma @@ -31,15 +31,15 @@ interpretation "star-iterated structural successor (closure)" (* Basic eliminators ********************************************************) lemma fqus_ind: ∀b,G1,L1,T1. ∀Q:relation3 …. Q G1 L1 T1 → - (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → Q G L T → Q G2 L2 T2) → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → Q G2 L2 T2. + (∀G,G2,L,L2,T,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → Q G L T → Q G2 L2 T2) → + ∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → Q G2 L2 T2. #b #G1 #L1 #T1 #R #IH1 #IH2 #G2 #L2 #T2 #H @(tri_TC_star_ind … IH1 IH2 G2 L2 T2 H) // qed-. lemma fqus_ind_dx: ∀b,G2,L2,T2. ∀Q:relation3 …. Q G2 L2 T2 → - (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄ → Q G L T → Q G1 L1 T1) → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → Q G1 L1 T1. + (∀G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄ → Q G L T → Q G1 L1 T1) → + ∀G1,L1,T1. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → Q G1 L1 T1. #b #G2 #L2 #T2 #Q #IH1 #IH2 #G1 #L1 #T1 #H @(tri_TC_star_ind_dx … IH1 IH2 G1 L1 T1 H) // qed-. @@ -49,78 +49,78 @@ qed-. lemma fqus_refl: ∀b. tri_reflexive … (fqus b). /2 width=1 by tri_inj/ qed. -lemma fquq_fqus: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fquq_fqus: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄. /2 width=1 by tri_inj/ qed. -lemma fqus_strap1: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqus_strap1: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G,L,T⦄ → + ⦃G,L,T⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄. /2 width=5 by tri_step/ qed-. -lemma fqus_strap2: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqus_strap2: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G,L,T⦄ → + ⦃G,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄. /2 width=5 by tri_TC_strap/ qed-. (* Basic inversion lemmas ***************************************************) -lemma fqus_inv_fqu_sn: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → +lemma fqus_inv_fqu_sn: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → (∧∧ G1 = G2 & L1 = L2 & T1 = T2) ∨ - ∃∃G,L,T. ⦃G1, L1, T1⦄ ⊐[b] ⦃G, L, T⦄ & ⦃G, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄. + ∃∃G,L,T. ⦃G1,L1,T1⦄ ⬂[b] ⦃G,L,T⦄ & ⦃G,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄. #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 @(fqus_ind_dx … H12) -G1 -L1 -T1 /3 width=1 by and3_intro, or_introl/ #G1 #G #L1 #L #T1 #T * /3 width=5 by ex2_3_intro, or_intror/ * #HG #HL #HT #_ destruct // qed-. -lemma fqus_inv_sort1: ∀b,G1,G2,L1,L2,T2,s. ⦃G1, L1, ⋆s⦄ ⊐*[b] ⦃G2, L2, T2⦄ → +lemma fqus_inv_sort1: ∀b,G1,G2,L1,L2,T2,s. ⦃G1,L1,⋆s⦄ ⬂*[b] ⦃G2,L2,T2⦄ → (∧∧ G1 = G2 & L1 = L2 & ⋆s = T2) ∨ - ∃∃J,L. ⦃G1, L, ⋆s⦄ ⊐*[b] ⦃G2, L2, T2⦄ & L1 = L.ⓘ{J}. + ∃∃J,L. ⦃G1,L,⋆s⦄ ⬂*[b] ⦃G2,L2,T2⦄ & L1 = L.ⓘ{J}. #b #G1 #G2 #L1 #L2 #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/ #G #L #T #H elim (fqu_inv_sort1 … H) -H /3 width=4 by ex2_2_intro, or_intror/ qed-. -lemma fqus_inv_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐*[b] ⦃G2, L2, T2⦄ → +lemma fqus_inv_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1,L1,#i⦄ ⬂*[b] ⦃G2,L2,T2⦄ → ∨∨ ∧∧ G1 = G2 & L1 = L2 & #i = T2 - | ∃∃J,L,V. ⦃G1, L, V⦄ ⊐*[b] ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V & i = 0 - | ∃∃J,L,j. ⦃G1, L, #j⦄ ⊐*[b] ⦃G2, L2, T2⦄ & L1 = L.ⓘ{J} & i = ↑j. + | ∃∃J,L,V. ⦃G1,L,V⦄ ⬂*[b] ⦃G2,L2,T2⦄ & L1 = L.ⓑ{J}V & i = 0 + | ∃∃J,L,j. ⦃G1,L,#j⦄ ⬂*[b] ⦃G2,L2,T2⦄ & L1 = L.ⓘ{J} & i = ↑j. #b #G1 #G2 #L1 #L2 #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or3_intro0/ #G #L #T #H elim (fqu_inv_lref1 … H) -H * /3 width=7 by or3_intro1, or3_intro2, ex3_4_intro, ex3_3_intro/ qed-. -lemma fqus_inv_gref1: ∀b,G1,G2,L1,L2,T2,l. ⦃G1, L1, §l⦄ ⊐*[b] ⦃G2, L2, T2⦄ → +lemma fqus_inv_gref1: ∀b,G1,G2,L1,L2,T2,l. ⦃G1,L1,§l⦄ ⬂*[b] ⦃G2,L2,T2⦄ → (∧∧ G1 = G2 & L1 = L2 & §l = T2) ∨ - ∃∃J,L. ⦃G1, L, §l⦄ ⊐*[b] ⦃G2, L2, T2⦄ & L1 = L.ⓘ{J}. + ∃∃J,L. ⦃G1,L,§l⦄ ⬂*[b] ⦃G2,L2,T2⦄ & L1 = L.ⓘ{J}. #b #G1 #G2 #L1 #L2 #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/ #G #L #T #H elim (fqu_inv_gref1 … H) -H /3 width=4 by ex2_2_intro, or_intror/ qed-. -lemma fqus_inv_bind1: ∀b,p,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓑ{p,I}V1.T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → +lemma fqus_inv_bind1: ∀b,p,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1,L1,ⓑ{p,I}V1.T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓑ{p,I}V1.T1 = T2 - | ⦃G1, L1, V1⦄ ⊐*[b] ⦃G2, L2, T2⦄ - | ⦃G1, L1.ⓑ{I}V1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ - | ⦃G1, L1.ⓧ, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ ∧ b = Ⓕ - | ∃∃J,L,T. ⦃G1, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄ & ⬆*[1] T ≘ ⓑ{p,I}V1.T1 & L1 = L.ⓘ{J}. + | ⦃G1,L1,V1⦄ ⬂*[b] ⦃G2,L2,T2⦄ + | ∧∧ ⦃G1,L1.ⓑ{I}V1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ & b = Ⓣ + | ∧∧ ⦃G1,L1.ⓧ,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ & b = Ⓕ + | ∃∃J,L,T. ⦃G1,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄ & ⬆*[1] T ≘ ⓑ{p,I}V1.T1 & L1 = L.ⓘ{J}. #b #p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or5_intro0/ #G #L #T #H elim (fqu_inv_bind1 … H) -H * -[4: #J ] #H1 #H2 #H3 [4: #Hb ] #H destruct +[4: #J ] #H1 #H2 #H3 [3,4: #Hb ] #H destruct /3 width=6 by or5_intro1, or5_intro2, or5_intro3, or5_intro4, ex3_3_intro, conj/ qed-. -lemma fqus_inv_bind1_true: ∀p,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓑ{p,I}V1.T1⦄ ⊐* ⦃G2, L2, T2⦄ → +lemma fqus_inv_bind1_true: ∀p,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1,L1,ⓑ{p,I}V1.T1⦄ ⬂* ⦃G2,L2,T2⦄ → ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓑ{p,I}V1.T1 = T2 - | ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄ - | ⦃G1, L1.ⓑ{I}V1, T1⦄ ⊐* ⦃G2, L2, T2⦄ - | ∃∃J,L,T. ⦃G1, L, T⦄ ⊐* ⦃G2, L2, T2⦄ & ⬆*[1] T ≘ ⓑ{p,I}V1.T1 & L1 = L.ⓘ{J}. -#p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_bind1 … H) -H [1,4: * ] -/3 width=1 by and3_intro, or4_intro0, or4_intro1, or4_intro2, or4_intro3, ex3_3_intro/ + | ⦃G1,L1,V1⦄ ⬂* ⦃G2,L2,T2⦄ + | ⦃G1,L1.ⓑ{I}V1,T1⦄ ⬂* ⦃G2,L2,T2⦄ + | ∃∃J,L,T. ⦃G1,L,T⦄ ⬂* ⦃G2,L2,T2⦄ & ⬆*[1] T ≘ ⓑ{p,I}V1.T1 & L1 = L.ⓘ{J}. +#p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_bind1 … H) -H [1,3,4: * ] +/3 width=1 by and3_intro, or4_intro0, or4_intro1, or4_intro2, or4_intro3/ #_ #H destruct qed-. -lemma fqus_inv_flat1: ∀b,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓕ{I}V1.T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → +lemma fqus_inv_flat1: ∀b,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1,L1,ⓕ{I}V1.T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓕ{I}V1.T1 = T2 - | ⦃G1, L1, V1⦄ ⊐*[b] ⦃G2, L2, T2⦄ - | ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ - | ∃∃J,L,T. ⦃G1, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄ & ⬆*[1] T ≘ ⓕ{I}V1.T1 & L1 = L.ⓘ{J}. + | ⦃G1,L1,V1⦄ ⬂*[b] ⦃G2,L2,T2⦄ + | ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ + | ∃∃J,L,T. ⦃G1,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄ & ⬆*[1] T ≘ ⓕ{I}V1.T1 & L1 = L.ⓘ{J}. #b #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or4_intro0/ #G #L #T #H elim (fqu_inv_flat1 … H) -H * [3: #J ] #H1 #H2 #H3 #H destruct @@ -129,35 +129,35 @@ qed-. (* Advanced inversion lemmas ************************************************) -lemma fqus_inv_atom1: ∀b,I,G1,G2,L2,T2. ⦃G1, ⋆, ⓪{I}⦄ ⊐*[b] ⦃G2, L2, T2⦄ → +lemma fqus_inv_atom1: ∀b,I,G1,G2,L2,T2. ⦃G1,⋆,⓪{I}⦄ ⬂*[b] ⦃G2,L2,T2⦄ → ∧∧ G1 = G2 & ⋆ = L2 & ⓪{I} = T2. #b #I #G1 #G2 #L2 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /2 width=1 by and3_intro/ #G #L #T #H elim (fqu_inv_atom1 … H) qed-. -lemma fqus_inv_sort1_bind: ∀b,I,G1,G2,L1,L2,T2,s. ⦃G1, L1.ⓘ{I}, ⋆s⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - (∧∧ G1 = G2 & L1.ⓘ{I} = L2 & ⋆s = T2) ∨ ⦃G1, L1, ⋆s⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqus_inv_sort1_bind: ∀b,I,G1,G2,L1,L2,T2,s. ⦃G1,L1.ⓘ{I},⋆s⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + (∧∧ G1 = G2 & L1.ⓘ{I} = L2 & ⋆s = T2) ∨ ⦃G1,L1,⋆s⦄ ⬂*[b] ⦃G2,L2,T2⦄. #b #I #G1 #G2 #L1 #L2 #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/ #G #L #T #H elim (fqu_inv_sort1_bind … H) -H #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/ qed-. -lemma fqus_inv_zero1_pair: ∀b,I,G1,G2,L1,L2,V1,T2. ⦃G1, L1.ⓑ{I}V1, #0⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #0 = T2) ∨ ⦃G1, L1, V1⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqus_inv_zero1_pair: ∀b,I,G1,G2,L1,L2,V1,T2. ⦃G1,L1.ⓑ{I}V1,#0⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #0 = T2) ∨ ⦃G1,L1,V1⦄ ⬂*[b] ⦃G2,L2,T2⦄. #b #I #G1 #G2 #L1 #L2 #V1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/ #G #L #T #H elim (fqu_inv_zero1_pair … H) -H #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/ qed-. -lemma fqus_inv_lref1_bind: ∀b,I,G1,G2,L1,L2,T2,i. ⦃G1, L1.ⓘ{I}, #↑i⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - (∧∧ G1 = G2 & L1.ⓘ{I} = L2 & #(↑i) = T2) ∨ ⦃G1, L1, #i⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqus_inv_lref1_bind: ∀b,I,G1,G2,L1,L2,T2,i. ⦃G1,L1.ⓘ{I},#↑i⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + (∧∧ G1 = G2 & L1.ⓘ{I} = L2 & #(↑i) = T2) ∨ ⦃G1,L1,#i⦄ ⬂*[b] ⦃G2,L2,T2⦄. #b #I #G1 #G2 #L1 #L2 #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/ #G #L #T #H elim (fqu_inv_lref1_bind … H) -H #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/ qed-. -lemma fqus_inv_gref1_bind: ∀b,I,G1,G2,L1,L2,T2,l. ⦃G1, L1.ⓘ{I}, §l⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - (∧∧ G1 = G2 & L1.ⓘ{I} = L2 & §l = T2) ∨ ⦃G1, L1, §l⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqus_inv_gref1_bind: ∀b,I,G1,G2,L1,L2,T2,l. ⦃G1,L1.ⓘ{I},§l⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + (∧∧ G1 = G2 & L1.ⓘ{I} = L2 & §l = T2) ∨ ⦃G1,L1,§l⦄ ⬂*[b] ⦃G2,L2,T2⦄. #b #I #G1 #G2 #L1 #L2 #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/ #G #L #T #H elim (fqu_inv_gref1_bind … H) -H #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/ diff --git a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_drops.ma b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_drops.ma index 0d2797139..24ba92a09 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_drops.ma @@ -20,7 +20,7 @@ include "static_2/s_computation/fqus_fqup.ma". (* Properties with generic slicing for local environments *******************) lemma fqus_drops: ∀b,G,L,K,T,U,i. ⬇*[i] L ≘ K → ⬆*[i] T ≘ U → - ⦃G, L, U⦄ ⊐*[b] ⦃G, K, T⦄. + ⦃G,L,U⦄ ⬂*[b] ⦃G,K,T⦄. #b #G #L #K #T #U * /3 width=3 by fqup_drops_succ, fqup_fqus/ #HLK #HTU <(lifts_fwd_isid … HTU) -U // <(drops_fwd_isid … HLK) -K // qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_fqup.ma b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_fqup.ma index 05a450dae..f59fd10aa 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_fqup.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_fqup.ma @@ -19,14 +19,14 @@ include "static_2/s_computation/fqus.ma". (* Alternative definition with plus-iterated supclosure *********************) -lemma fqup_fqus: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqup_fqus: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄. #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 /3 width=5 by fqus_strap1, fquq_fqus, fqu_fquq/ qed. (* Basic_2A1: was: fqus_inv_gen *) -lemma fqus_inv_fqup: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ ∨ (∧∧ G1 = G2 & L1 = L2 & T1 = T2). +lemma fqus_inv_fqup: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ ∨ (∧∧ G1 = G2 & L1 = L2 & T1 = T2). #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 // #G #G2 #L #L2 #T #T2 #_ * [ #H2 * /3 width=5 by fqup_strap1, or_introl/ @@ -37,38 +37,38 @@ qed-. (* Advanced properties ******************************************************) -lemma fqus_strap1_fqu: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄. +lemma fqus_strap1_fqu: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄. #b #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 elim (fqus_inv_fqup … H1) -H1 [ /2 width=5 by fqup_strap1/ | * /2 width=1 by fqu_fqup/ ] qed-. -lemma fqus_strap2_fqu: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄. +lemma fqus_strap2_fqu: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄. #b #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 elim (fqus_inv_fqup … H2) -H2 [ /2 width=5 by fqup_strap2/ | * /2 width=1 by fqu_fqup/ ] qed-. -lemma fqus_fqup_trans: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄. +lemma fqus_fqup_trans: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G,L,T⦄ → ⦃G,L,T⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄. #b #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 @(fqup_ind … H2) -H2 -G2 -L2 -T2 /2 width=5 by fqus_strap1_fqu, fqup_strap1/ qed-. -lemma fqup_fqus_trans: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄. +lemma fqup_fqus_trans: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G,L,T⦄ → + ⦃G,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄. #b #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 @(fqup_ind_dx … H1) -H1 -G1 -L1 -T1 /3 width=5 by fqus_strap2_fqu, fqup_strap2/ qed-. (* Advanced inversion lemmas for plus-iterated supclosure *******************) -lemma fqup_inv_step_sn: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ → - ∃∃G,L,T. ⦃G1, L1, T1⦄ ⊐[b] ⦃G, L, T⦄ & ⦃G, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄. +lemma fqup_inv_step_sn: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ → + ∃∃G,L,T. ⦃G1,L1,T1⦄ ⬂[b] ⦃G,L,T⦄ & ⦃G,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄. #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind_dx … H) -G1 -L1 -T1 /2 width=5 by ex2_3_intro/ #G1 #G #L1 #L #T1 #T #H1 #_ * /4 width=9 by fqus_strap2, fqu_fquq, ex2_3_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_weight.ma b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_weight.ma index f94366706..72c46008f 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_computation/fqus_weight.ma @@ -19,15 +19,15 @@ include "static_2/s_computation/fqus.ma". (* Forward lemmas with weight for closures **********************************) -lemma fqus_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ♯{G2, L2, T2} ≤ ♯{G1, L1, T1}. +lemma fqus_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ♯{G2,L2,T2} ≤ ♯{G1,L1,T1}. #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -L2 -T2 /3 width=3 by fquq_fwd_fw, transitive_le/ qed-. (* Advanced inversion lemmas ************************************************) -lemma fqus_inv_refl_atom3: ∀b,I,G,L,X. ⦃G, L, ⓪{I}⦄ ⊐*[b] ⦃G, L, X⦄ → ⓪{I} = X. +lemma fqus_inv_refl_atom3: ∀b,I,G,L,X. ⦃G,L,⓪{I}⦄ ⬂*[b] ⦃G,L,X⦄ → ⓪{I} = X. #b #I #G #L #X #H elim (fqus_inv_fqu_sn … H) -H * // #G0 #L0 #T0 #H1 #H2 lapply (fqu_fwd_fw … H1) lapply (fqus_fwd_fw … H2) -H2 -H1 #H2 #H1 lapply (le_to_lt_to_lt … H2 H1) -G0 -L0 -T0 diff --git a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu.ma b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu.ma index b834566d3..19dd4d45d 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu.ma @@ -28,7 +28,7 @@ include "static_2/relocation/lifts.ma". inductive fqu (b:bool): tri_relation genv lenv term ≝ | fqu_lref_O : ∀I,G,L,V. fqu b G (L.ⓑ{I}V) (#0) G L V | fqu_pair_sn: ∀I,G,L,V,T. fqu b G L (②{I}V.T) G L V -| fqu_bind_dx: ∀p,I,G,L,V,T. fqu b G L (ⓑ{p,I}V.T) G (L.ⓑ{I}V) T +| fqu_bind_dx: ∀p,I,G,L,V,T. b = Ⓣ → fqu b G L (ⓑ{p,I}V.T) G (L.ⓑ{I}V) T | fqu_clear : ∀p,I,G,L,V,T. b = Ⓕ → fqu b G L (ⓑ{p,I}V.T) G (L.ⓧ) T | fqu_flat_dx: ∀I,G,L,V,T. fqu b G L (ⓕ{I}V.T) G L T | fqu_drop : ∀I,G,L,T,U. ⬆*[1] T ≘ U → fqu b G (L.ⓘ{I}) U G L T @@ -44,24 +44,24 @@ interpretation (* Basic properties *********************************************************) -lemma fqu_sort: ∀b,I,G,L,s. ⦃G, L.ⓘ{I}, ⋆s⦄ ⊐[b] ⦃G, L, ⋆s⦄. +lemma fqu_sort: ∀b,I,G,L,s. ⦃G,L.ⓘ{I},⋆s⦄ ⬂[b] ⦃G,L,⋆s⦄. /2 width=1 by fqu_drop/ qed. -lemma fqu_lref_S: ∀b,I,G,L,i. ⦃G, L.ⓘ{I}, #↑i⦄ ⊐[b] ⦃G, L, #i⦄. +lemma fqu_lref_S: ∀b,I,G,L,i. ⦃G,L.ⓘ{I},#↑i⦄ ⬂[b] ⦃G,L,#i⦄. /2 width=1 by fqu_drop/ qed. -lemma fqu_gref: ∀b,I,G,L,l. ⦃G, L.ⓘ{I}, §l⦄ ⊐[b] ⦃G, L, §l⦄. +lemma fqu_gref: ∀b,I,G,L,l. ⦃G,L.ⓘ{I},§l⦄ ⬂[b] ⦃G,L,§l⦄. /2 width=1 by fqu_drop/ qed. (* Basic inversion lemmas ***************************************************) -fact fqu_inv_sort1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +fact fqu_inv_sort1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∀s. T1 = ⋆s → ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & T2 = ⋆s. #b #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G #L #T #s #H destruct | #I #G #L #V #T #s #H destruct -| #p #I #G #L #V #T #s #H destruct +| #p #I #G #L #V #T #_ #s #H destruct | #p #I #G #L #V #T #_ #s #H destruct | #I #G #L #V #T #s #H destruct | #I #G #L #T #U #HI12 #s #H destruct @@ -69,18 +69,18 @@ fact fqu_inv_sort1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L ] qed-. -lemma fqu_inv_sort1: ∀b,G1,G2,L1,L2,T2,s. ⦃G1, L1, ⋆s⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_sort1: ∀b,G1,G2,L1,L2,T2,s. ⦃G1,L1,⋆s⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & T2 = ⋆s. /2 width=4 by fqu_inv_sort1_aux/ qed-. -fact fqu_inv_lref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +fact fqu_inv_lref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∀i. T1 = #i → (∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & T2 = V & i = 0) ∨ ∃∃J,j. G1 = G2 & L1 = L2.ⓘ{J} & T2 = #j & i = ↑j. #b #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G #L #T #i #H destruct /3 width=4 by ex4_2_intro, or_introl/ | #I #G #L #V #T #i #H destruct -| #p #I #G #L #V #T #i #H destruct +| #p #I #G #L #V #T #_ #i #H destruct | #p #I #G #L #V #T #_ #i #H destruct | #I #G #L #V #T #i #H destruct | #I #G #L #T #U #HI12 #i #H destruct @@ -88,18 +88,18 @@ fact fqu_inv_lref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L ] qed-. -lemma fqu_inv_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1,L1,#i⦄ ⬂[b] ⦃G2,L2,T2⦄ → (∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & T2 = V & i = 0) ∨ ∃∃J,j. G1 = G2 & L1 = L2.ⓘ{J} & T2 = #j & i = ↑j. /2 width=4 by fqu_inv_lref1_aux/ qed-. -fact fqu_inv_gref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +fact fqu_inv_gref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∀l. T1 = §l → ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & T2 = §l. #b #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G #L #T #l #H destruct | #I #G #L #V #T #l #H destruct -| #p #I #G #L #V #T #l #H destruct +| #p #I #G #L #V #T #_ #l #H destruct | #p #I #G #L #V #T #_ #l #H destruct | #I #G #L #V #T #s #H destruct | #I #G #L #T #U #HI12 #l #H destruct @@ -107,43 +107,44 @@ fact fqu_inv_gref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L ] qed-. -lemma fqu_inv_gref1: ∀b,G1,G2,L1,L2,T2,l. ⦃G1, L1, §l⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_gref1: ∀b,G1,G2,L1,L2,T2,l. ⦃G1,L1,§l⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & T2 = §l. /2 width=4 by fqu_inv_gref1_aux/ qed-. -fact fqu_inv_bind1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +fact fqu_inv_bind1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∀p,I,V1,U1. T1 = ⓑ{p,I}V1.U1 → ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2 - | ∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2 + | ∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2 & b = Ⓣ | ∧∧ G1 = G2 & L1.ⓧ = L2 & U1 = T2 & b = Ⓕ | ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & ⬆*[1] T2 ≘ ⓑ{p,I}V1.U1. #b #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G #L #T #q #J #V0 #U0 #H destruct | #I #G #L #V #T #q #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or4_intro0/ -| #p #I #G #L #V #T #q #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or4_intro1/ +| #p #I #G #L #V #T #Hb #q #J #V0 #U0 #H destruct /3 width=1 by and4_intro, or4_intro1/ | #p #I #G #L #V #T #Hb #q #J #V0 #U0 #H destruct /3 width=1 by and4_intro, or4_intro2/ | #I #G #L #V #T #q #J #V0 #U0 #H destruct | #I #G #L #T #U #HTU #q #J #V0 #U0 #H destruct /3 width=2 by or4_intro3, ex3_intro/ ] qed-. -lemma fqu_inv_bind1: ∀b,p,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1, L1, ⓑ{p,I}V1.U1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_bind1: ∀b,p,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1,L1,ⓑ{p,I}V1.U1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2 - | ∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2 + | ∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2 & b = Ⓣ | ∧∧ G1 = G2 & L1.ⓧ = L2 & U1 = T2 & b = Ⓕ | ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & ⬆*[1] T2 ≘ ⓑ{p,I}V1.U1. /2 width=4 by fqu_inv_bind1_aux/ qed-. -lemma fqu_inv_bind1_true: ∀p,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1, L1, ⓑ{p,I}V1.U1⦄ ⊐ ⦃G2, L2, T2⦄ → +lemma fqu_inv_bind1_true: ∀p,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1,L1,ⓑ{p,I}V1.U1⦄ ⬂ ⦃G2,L2,T2⦄ → ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2 | ∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2 | ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & ⬆*[1] T2 ≘ ⓑ{p,I}V1.U1. #p #I #G1 #G2 #L1 #L2 #V1 #U1 #T2 #H elim (fqu_inv_bind1 … H) -H -/3 width=1 by or3_intro0, or3_intro1, or3_intro2/ -* #_ #_ #_ #H destruct +/3 width=1 by or3_intro0, or3_intro2/ +* #HG #HL #HU #H destruct +/3 width=1 by and3_intro, or3_intro1/ qed-. -fact fqu_inv_flat1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +fact fqu_inv_flat1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∀I,V1,U1. T1 = ⓕ{I}V1.U1 → ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2 | ∧∧ G1 = G2 & L1 = L2 & U1 = T2 @@ -151,14 +152,14 @@ fact fqu_inv_flat1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L #b #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G #L #T #J #V0 #U0 #H destruct | #I #G #L #V #T #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or3_intro0/ -| #p #I #G #L #V #T #J #V0 #U0 #H destruct +| #p #I #G #L #V #T #_ #J #V0 #U0 #H destruct | #p #I #G #L #V #T #_ #J #V0 #U0 #H destruct | #I #G #L #V #T #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or3_intro1/ | #I #G #L #T #U #HTU #J #V0 #U0 #H destruct /3 width=2 by or3_intro2, ex3_intro/ ] qed-. -lemma fqu_inv_flat1: ∀b,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1, L1, ⓕ{I}V1.U1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_flat1: ∀b,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1,L1,ⓕ{I}V1.U1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2 | ∧∧ G1 = G2 & L1 = L2 & U1 = T2 | ∃∃J. G1 = G2 & L1 = L2.ⓘ{J} & ⬆*[1] T2 ≘ ⓕ{I}V1.U1. @@ -166,31 +167,31 @@ lemma fqu_inv_flat1: ∀b,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1, L1, ⓕ{I}V1.U1⦄ ⊐[ (* Advanced inversion lemmas ************************************************) -lemma fqu_inv_atom1: ∀b,I,G1,G2,L2,T2. ⦃G1, ⋆, ⓪{I}⦄ ⊐[b] ⦃G2, L2, T2⦄ → ⊥. +lemma fqu_inv_atom1: ∀b,I,G1,G2,L2,T2. ⦃G1,⋆,⓪{I}⦄ ⬂[b] ⦃G2,L2,T2⦄ → ⊥. #b * #x #G1 #G2 #L2 #T2 #H [ elim (fqu_inv_sort1 … H) | elim (fqu_inv_lref1 … H) * | elim (fqu_inv_gref1 … H) ] -H #I [2: #V |3: #i ] #_ #H destruct qed-. -lemma fqu_inv_sort1_bind: ∀b,I,G1,G2,K,L2,T2,s. ⦃G1, K.ⓘ{I}, ⋆s⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_sort1_bind: ∀b,I,G1,G2,K,L2,T2,s. ⦃G1,K.ⓘ{I},⋆s⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∧∧ G1 = G2 & L2 = K & T2 = ⋆s. #b #I #G1 #G2 #K #L2 #T2 #s #H elim (fqu_inv_sort1 … H) -H #Z #X #H1 #H2 destruct /2 width=1 by and3_intro/ qed-. -lemma fqu_inv_zero1_pair: ∀b,I,G1,G2,K,L2,V,T2. ⦃G1, K.ⓑ{I}V, #0⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_zero1_pair: ∀b,I,G1,G2,K,L2,V,T2. ⦃G1,K.ⓑ{I}V,#0⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∧∧ G1 = G2 & L2 = K & T2 = V. #b #I #G1 #G2 #K #L2 #V #T2 #H elim (fqu_inv_lref1 … H) -H * #Z #X #H1 #H2 #H3 #H4 destruct /2 width=1 by and3_intro/ qed-. -lemma fqu_inv_lref1_bind: ∀b,I,G1,G2,K,L2,T2,i. ⦃G1, K.ⓘ{I}, #(↑i)⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_lref1_bind: ∀b,I,G1,G2,K,L2,T2,i. ⦃G1,K.ⓘ{I},#(↑i)⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∧∧ G1 = G2 & L2 = K & T2 = #i. #b #I #G1 #G2 #K #L2 #T2 #i #H elim (fqu_inv_lref1 … H) -H * #Z #X #H1 #H2 #H3 #H4 destruct /2 width=1 by and3_intro/ qed-. -lemma fqu_inv_gref1_bind: ∀b,I,G1,G2,K,L2,T2,l. ⦃G1, K.ⓘ{I}, §l⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_inv_gref1_bind: ∀b,I,G1,G2,K,L2,T2,l. ⦃G1,K.ⓘ{I},§l⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∧∧ G1 = G2 & L2 = K & T2 = §l. #b #I #G1 #G2 #K #L2 #T2 #l #H elim (fqu_inv_gref1 … H) -H #Z #H1 #H2 #H3 destruct /2 width=1 by and3_intro/ diff --git a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_length.ma b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_length.ma index 2cfea06b8..e9d8fcbfc 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_length.ma @@ -19,13 +19,13 @@ include "static_2/s_transition/fqu.ma". (* Forward lemmas with length for local environments ************************) -fact fqu_fwd_length_lref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → +fact fqu_fwd_length_lref1_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ∀i. T1 = #i → |L2| < |L1|. #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 // [2,3: #p] -#I #G #L #V #T [2: #_ ] #j #H destruct +#I #G #L #V #T [1,2: #_ ] #j #H destruct qed-. -lemma fqu_fwd_length_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐[b] ⦃G2, L2, T2⦄ → +lemma fqu_fwd_length_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1,L1,#i⦄ ⬂[b] ⦃G2,L2,T2⦄ → |L2| < |L1|. /2 width=8 by fqu_fwd_length_lref1_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_tdeq.ma b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_tdeq.ma index 7deebbc61..fa341e425 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_tdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_tdeq.ma @@ -17,11 +17,11 @@ include "static_2/s_transition/fqu_length.ma". (* SUPCLOSURE ***************************************************************) -(* Inversion lemmas with context-free degree-based equivalence for terms ****) +(* Inversion lemmas with context-free sort-irrelevant equivalence for terms *) -fact fqu_inv_tdeq_aux: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → - G1 = G2 → |L1| = |L2| → T1 ≛[h, o] T2 → ⊥. -#h #o #b #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2 +fact fqu_inv_tdeq_aux: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → + G1 = G2 → |L1| = |L2| → T1 ≛ T2 → ⊥. +#b #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2 [1: #I #G #L #V #_ #H elim (succ_inv_refl_sn … H) |6: #I #G #L #T #U #_ #_ #H elim (succ_inv_refl_sn … H) ] @@ -29,8 +29,8 @@ fact fqu_inv_tdeq_aux: ∀h,o,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2 qed-. (* Basic_2A1: uses: fqu_inv_eq *) -lemma fqu_inv_tdeq: ∀h,o,b,G,L1,L2,T1,T2. ⦃G, L1, T1⦄ ⊐[b] ⦃G, L2, T2⦄ → - |L1| = |L2| → T1 ≛[h, o] T2 → ⊥. -#h #o #b #G #L1 #L2 #T1 #T2 #H +lemma fqu_inv_tdeq: ∀b,G,L1,L2,T1,T2. ⦃G,L1,T1⦄ ⬂[b] ⦃G,L2,T2⦄ → + |L1| = |L2| → T1 ≛ T2 → ⊥. +#b #G #L1 #L2 #T1 #T2 #H @(fqu_inv_tdeq_aux … H) // (**) (* full auto fails *) qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_weight.ma b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_weight.ma index 365f5c2db..3b9964b46 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_transition/fqu_weight.ma @@ -20,8 +20,8 @@ include "static_2/s_transition/fqu.ma". (* Forward lemmas with weight for closures **********************************) -lemma fqu_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → - ♯{G2, L2, T2} < ♯{G1, L1, T1}. +lemma fqu_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → + ♯{G2,L2,T2} < ♯{G1,L1,T1}. #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 // #I #I1 #I2 #G #L #HI12 normalize in ⊢ (?%%); -I1 <(lifts_fwd_tw … HI12) /3 width=1 by monotonic_lt_plus_r, monotonic_lt_plus_l/ @@ -30,7 +30,7 @@ qed-. (* Advanced eliminators *****************************************************) lemma fqu_wf_ind: ∀b. ∀Q:relation3 …. ( - ∀G1,L1,T1. (∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → Q G2 L2 T2) → + ∀G1,L1,T1. (∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → Q G2 L2 T2) → Q G1 L1 T1 ) → ∀G1,L1,T1. Q G1 L1 T1. #b #Q #HQ @(f3_ind … fw) #x #IHx #G1 #L1 #T1 #H destruct /4 width=2 by fqu_fwd_fw/ diff --git a/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq.ma b/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq.ma index fc36281aa..d7736ab20 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq.ma @@ -37,7 +37,7 @@ interpretation lemma fquq_refl: ∀b. tri_reflexive … (fquq b). // qed. -lemma fqu_fquq: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄. +lemma fqu_fquq: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄. /2 width=1 by or_introl/ qed. (* Basic_2A1: removed theorems 8: diff --git a/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_length.ma b/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_length.ma index 08a70b7c3..3985a6c9e 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_length.ma @@ -19,7 +19,7 @@ include "static_2/s_transition/fquq.ma". (* Forward lemmas with length for local environments ************************) -lemma fquq_fwd_length_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → +lemma fquq_fwd_length_lref1: ∀b,G1,G2,L1,L2,T2,i. ⦃G1,L1,#i⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → |L2| ≤ |L1|. #b #G1 #G2 #L1 #L2 #T2 #i #H elim H -H [2: * ] /3 width=6 by fqu_fwd_length_lref1, lt_to_le/ diff --git a/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_weight.ma b/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_weight.ma index 8a8ef78a7..3aab7face 100644 --- a/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/s_transition/fquq_weight.ma @@ -19,8 +19,8 @@ include "static_2/s_transition/fquq.ma". (* Forward lemmas with weight for closures **********************************) -lemma fquq_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ → - ♯{G2, L2, T2} ≤ ♯{G1, L1, T1}. +lemma fquq_fwd_fw: ∀b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ → + ♯{G2,L2,T2} ≤ ♯{G1,L1,T1}. #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -H [2: * ] /3 width=2 by fqu_fwd_fw, lt_to_le/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/aaa.ma b/matita/matita/contribs/lambdadelta/static_2/static/aaa.ma index b7e9ca046..d204bdc21 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/aaa.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/aaa.ma @@ -37,7 +37,7 @@ interpretation "atomic arity assignment (term)" (* Basic inversion lemmas ***************************************************) -fact aaa_inv_sort_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀s. T = ⋆s → A = ⓪. +fact aaa_inv_sort_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ∀s. T = ⋆s → A = ⓪. #G #L #T #A * -G -L -T -A // [ #I #G #L #V #B #_ #s #H destruct | #I #G #L #A #i #_ #s #H destruct @@ -48,11 +48,11 @@ fact aaa_inv_sort_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀s. T = ⋆s → ] qed-. -lemma aaa_inv_sort: ∀G,L,A,s. ⦃G, L⦄ ⊢ ⋆s ⁝ A → A = ⓪. +lemma aaa_inv_sort: ∀G,L,A,s. ⦃G,L⦄ ⊢ ⋆s ⁝ A → A = ⓪. /2 width=6 by aaa_inv_sort_aux/ qed-. -fact aaa_inv_zero_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → T = #0 → - ∃∃I,K,V. L = K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ⁝ A. +fact aaa_inv_zero_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → T = #0 → + ∃∃I,K,V. L = K.ⓑ{I}V & ⦃G,K⦄ ⊢ V ⁝ A. #G #L #T #A * -G -L -T -A /2 width=5 by ex2_3_intro/ [ #G #L #s #H destruct | #I #G #L #A #i #_ #H destruct @@ -63,12 +63,12 @@ fact aaa_inv_zero_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → T = #0 → ] qed-. -lemma aaa_inv_zero: ∀G,L,A. ⦃G, L⦄ ⊢ #0 ⁝ A → - ∃∃I,K,V. L = K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ⁝ A. +lemma aaa_inv_zero: ∀G,L,A. ⦃G,L⦄ ⊢ #0 ⁝ A → + ∃∃I,K,V. L = K.ⓑ{I}V & ⦃G,K⦄ ⊢ V ⁝ A. /2 width=3 by aaa_inv_zero_aux/ qed-. -fact aaa_inv_lref_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀i. T = #(↑i) → - ∃∃I,K. L = K.ⓘ{I} & ⦃G, K⦄ ⊢ #i ⁝ A. +fact aaa_inv_lref_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ∀i. T = #(↑i) → + ∃∃I,K. L = K.ⓘ{I} & ⦃G,K⦄ ⊢ #i ⁝ A. #G #L #T #A * -G -L -T -A [ #G #L #s #j #H destruct | #I #G #L #V #B #_ #j #H destruct @@ -80,11 +80,11 @@ fact aaa_inv_lref_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀i. T = #(↑i) ] qed-. -lemma aaa_inv_lref: ∀G,L,A,i. ⦃G, L⦄ ⊢ #↑i ⁝ A → - ∃∃I,K. L = K.ⓘ{I} & ⦃G, K⦄ ⊢ #i ⁝ A. +lemma aaa_inv_lref: ∀G,L,A,i. ⦃G,L⦄ ⊢ #↑i ⁝ A → + ∃∃I,K. L = K.ⓘ{I} & ⦃G,K⦄ ⊢ #i ⁝ A. /2 width=3 by aaa_inv_lref_aux/ qed-. -fact aaa_inv_gref_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀l. T = §l → ⊥. +fact aaa_inv_gref_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ∀l. T = §l → ⊥. #G #L #T #A * -G -L -T -A [ #G #L #s #k #H destruct | #I #G #L #V #B #_ #k #H destruct @@ -96,11 +96,11 @@ fact aaa_inv_gref_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀l. T = §l → ] qed-. -lemma aaa_inv_gref: ∀G,L,A,l. ⦃G, L⦄ ⊢ §l ⁝ A → ⊥. +lemma aaa_inv_gref: ∀G,L,A,l. ⦃G,L⦄ ⊢ §l ⁝ A → ⊥. /2 width=7 by aaa_inv_gref_aux/ qed-. -fact aaa_inv_abbr_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀p,W,U. T = ⓓ{p}W.U → - ∃∃B. ⦃G, L⦄ ⊢ W ⁝ B & ⦃G, L.ⓓW⦄ ⊢ U ⁝ A. +fact aaa_inv_abbr_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ∀p,W,U. T = ⓓ{p}W.U → + ∃∃B. ⦃G,L⦄ ⊢ W ⁝ B & ⦃G,L.ⓓW⦄ ⊢ U ⁝ A. #G #L #T #A * -G -L -T -A [ #G #L #s #q #W #U #H destruct | #I #G #L #V #B #_ #q #W #U #H destruct @@ -112,12 +112,12 @@ fact aaa_inv_abbr_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀p,W,U. T = ⓓ{ ] qed-. -lemma aaa_inv_abbr: ∀p,G,L,V,T,A. ⦃G, L⦄ ⊢ ⓓ{p}V.T ⁝ A → - ∃∃B. ⦃G, L⦄ ⊢ V ⁝ B & ⦃G, L.ⓓV⦄ ⊢ T ⁝ A. +lemma aaa_inv_abbr: ∀p,G,L,V,T,A. ⦃G,L⦄ ⊢ ⓓ{p}V.T ⁝ A → + ∃∃B. ⦃G,L⦄ ⊢ V ⁝ B & ⦃G,L.ⓓV⦄ ⊢ T ⁝ A. /2 width=4 by aaa_inv_abbr_aux/ qed-. -fact aaa_inv_abst_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀p,W,U. T = ⓛ{p}W.U → - ∃∃B1,B2. ⦃G, L⦄ ⊢ W ⁝ B1 & ⦃G, L.ⓛW⦄ ⊢ U ⁝ B2 & A = ②B1.B2. +fact aaa_inv_abst_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ∀p,W,U. T = ⓛ{p}W.U → + ∃∃B1,B2. ⦃G,L⦄ ⊢ W ⁝ B1 & ⦃G,L.ⓛW⦄ ⊢ U ⁝ B2 & A = ②B1.B2. #G #L #T #A * -G -L -T -A [ #G #L #s #q #W #U #H destruct | #I #G #L #V #B #_ #q #W #U #H destruct @@ -129,12 +129,12 @@ fact aaa_inv_abst_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀p,W,U. T = ⓛ{ ] qed-. -lemma aaa_inv_abst: ∀p,G,L,W,T,A. ⦃G, L⦄ ⊢ ⓛ{p}W.T ⁝ A → - ∃∃B1,B2. ⦃G, L⦄ ⊢ W ⁝ B1 & ⦃G, L.ⓛW⦄ ⊢ T ⁝ B2 & A = ②B1.B2. +lemma aaa_inv_abst: ∀p,G,L,W,T,A. ⦃G,L⦄ ⊢ ⓛ{p}W.T ⁝ A → + ∃∃B1,B2. ⦃G,L⦄ ⊢ W ⁝ B1 & ⦃G,L.ⓛW⦄ ⊢ T ⁝ B2 & A = ②B1.B2. /2 width=4 by aaa_inv_abst_aux/ qed-. -fact aaa_inv_appl_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀W,U. T = ⓐW.U → - ∃∃B. ⦃G, L⦄ ⊢ W ⁝ B & ⦃G, L⦄ ⊢ U ⁝ ②B.A. +fact aaa_inv_appl_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ∀W,U. T = ⓐW.U → + ∃∃B. ⦃G,L⦄ ⊢ W ⁝ B & ⦃G,L⦄ ⊢ U ⁝ ②B.A. #G #L #T #A * -G -L -T -A [ #G #L #s #W #U #H destruct | #I #G #L #V #B #_ #W #U #H destruct @@ -146,12 +146,12 @@ fact aaa_inv_appl_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀W,U. T = ⓐW.U ] qed-. -lemma aaa_inv_appl: ∀G,L,V,T,A. ⦃G, L⦄ ⊢ ⓐV.T ⁝ A → - ∃∃B. ⦃G, L⦄ ⊢ V ⁝ B & ⦃G, L⦄ ⊢ T ⁝ ②B.A. +lemma aaa_inv_appl: ∀G,L,V,T,A. ⦃G,L⦄ ⊢ ⓐV.T ⁝ A → + ∃∃B. ⦃G,L⦄ ⊢ V ⁝ B & ⦃G,L⦄ ⊢ T ⁝ ②B.A. /2 width=3 by aaa_inv_appl_aux/ qed-. -fact aaa_inv_cast_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀W,U. T = ⓝW.U → - ⦃G, L⦄ ⊢ W ⁝ A ∧ ⦃G, L⦄ ⊢ U ⁝ A. +fact aaa_inv_cast_aux: ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ∀W,U. T = ⓝW.U → + ⦃G,L⦄ ⊢ W ⁝ A ∧ ⦃G,L⦄ ⊢ U ⁝ A. #G #L #T #A * -G -L -T -A [ #G #L #s #W #U #H destruct | #I #G #L #V #B #_ #W #U #H destruct @@ -163,6 +163,6 @@ fact aaa_inv_cast_aux: ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀W,U. T = ⓝW.U ] qed-. -lemma aaa_inv_cast: ∀G,L,W,T,A. ⦃G, L⦄ ⊢ ⓝW.T ⁝ A → - ⦃G, L⦄ ⊢ W ⁝ A ∧ ⦃G, L⦄ ⊢ T ⁝ A. +lemma aaa_inv_cast: ∀G,L,W,T,A. ⦃G,L⦄ ⊢ ⓝW.T ⁝ A → + ⦃G,L⦄ ⊢ W ⁝ A ∧ ⦃G,L⦄ ⊢ T ⁝ A. /2 width=3 by aaa_inv_cast_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/aaa_aaa.ma b/matita/matita/contribs/lambdadelta/static_2/static/aaa_aaa.ma index 15b4fe4e1..968112846 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/aaa_aaa.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/aaa_aaa.ma @@ -18,7 +18,7 @@ include "static_2/static/aaa.ma". (* Main inversion lemmas ****************************************************) -theorem aaa_mono: ∀G,L,T,A1. ⦃G, L⦄ ⊢ T ⁝ A1 → ∀A2. ⦃G, L⦄ ⊢ T ⁝ A2 → A1 = A2. +theorem aaa_mono: ∀G,L,T,A1. ⦃G,L⦄ ⊢ T ⁝ A1 → ∀A2. ⦃G,L⦄ ⊢ T ⁝ A2 → A1 = A2. #G #L #T #A1 #H elim H -G -L -T -A1 [ #G #L #s #A2 #H >(aaa_inv_sort … H) -H // | #I1 #G #L #V1 #B #_ #IH #A2 #H @@ -36,3 +36,22 @@ theorem aaa_mono: ∀G,L,T,A1. ⦃G, L⦄ ⊢ T ⁝ A1 → ∀A2. ⦃G, L⦄ ⊢ elim (aaa_inv_cast … H) -H /2 width=1 by/ ] qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma aaa_aaa_inv_appl (G) (L) (V) (T) (B) (X): + ∀A. ⦃G,L⦄ ⊢ ⓐV.T ⁝ A → ⦃G,L⦄ ⊢ V ⁝ B → ⦃G,L⦄⊢ T ⁝ X → ②B.A = X. +#G #L #V #T #B #X #A #H #H1V #H1T +elim (aaa_inv_appl … H) -H #B0 #H2V #H2T +lapply (aaa_mono … H2V … H1V) -V #H destruct +lapply (aaa_mono … H2T … H1T) -G -L -T // +qed-. + +lemma aaa_aaa_inv_cast (G) (L) (U) (T) (B) (A): + ∀X. ⦃G,L⦄ ⊢ ⓝU.T ⁝ X → ⦃G,L⦄ ⊢ U ⁝ B → ⦃G,L⦄⊢ T ⁝ A → ∧∧ B = X & A = X. +#G #L #U #T #B #A #X #H #H1U #H1T +elim (aaa_inv_cast … H) -H #H2U #H2T +lapply (aaa_mono … H1U … H2U) -U #HB +lapply (aaa_mono … H1T … H2T) -G -L -T #HA +/2 width=1 by conj/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/aaa_dec.ma b/matita/matita/contribs/lambdadelta/static_2/static/aaa_dec.ma new file mode 100644 index 000000000..045657326 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/static/aaa_dec.ma @@ -0,0 +1,80 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/static/aaa_drops.ma". +include "static_2/static/aaa_aaa.ma". + +(* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************) + +(* Main properties **********************************************************) + +theorem aaa_dec (G) (L) (T): Decidable (∃A. ⦃G,L⦄ ⊢ T ⁝ A). +#G #L #T @(fqup_wf_ind_eq (Ⓣ) … G L T) -G -L -T +#G0 #L0 #T0 #IH #G #L * * [||| #p * | * ] +[ #s #HG #HL #HT destruct -IH + /3 width=2 by aaa_sort, ex_intro, or_introl/ +| #i #HG #HL #HT destruct + elim (drops_F_uni L i) [| * * #I [| #V ] #K ] #HLK + [1,2: -IH + @or_intror * #A #H + elim (aaa_inv_lref_drops … H) -H #J #Y #X #HLY #_ -G -A + lapply (drops_mono … HLY … HLK) -L -i #H destruct + | elim (IH G K V) -IH [3: /2 width=2 by fqup_lref/ ] + [ * /4 width=6 by aaa_lref_drops, ex_intro, or_introl/ + | #H0 @or_intror * #A #H + lapply (aaa_pair_inv_lref … H … HLK) -I -L -i + /3 width=2 by ex_intro/ + ] + ] +| #l #HG #HL #HT destruct -IH + @or_intror * #A #H + @(aaa_inv_gref … H) +| #V #T #HG #HL #HT destruct + elim (IH G L V) [ * #B #HB | #HnB | // ] + [ elim (IH G (L.ⓓV) T) [ * #A #HA | #HnA | // ] ] -IH + [ /4 width=2 by aaa_abbr, ex_intro, or_introl/ ] + @or_intror * #A #H + elim (aaa_inv_abbr … H) -H #B0 #HB0 #HA0 + /3 width=2 by ex_intro/ +| #W #T #HG #HL #HT destruct + elim (IH G L W) [ * #B #HB | #HnB | // ] + [ elim (IH G (L.ⓛW) T) [ * #A #HA | #HnA | // ] ] -IH + [ /4 width=2 by aaa_abst, ex_intro, or_introl/ ] + @or_intror * #A #H + elim (aaa_inv_abst … H) -H #B0 #A0 #HB0 #HA0 #H destruct + /3 width=2 by ex_intro/ +| #V #T #HG #HL #HT destruct + elim (IH G L V) [ * #B #HB | #HnB | // ] + [ elim (IH G L T) [ * #X #HX | #HnX | // ] ] -IH + [ elim (is_apear_dec B X) [ * #A #H destruct | #HnX ] + [ /4 width=4 by aaa_appl, ex_intro, or_introl/ ] + ] + @or_intror * #A #H + [ lapply (aaa_aaa_inv_appl … H HB HX) -G -L -V -T + |*: elim (aaa_inv_appl … H) -H #B0 #HB0 #HA0 + ] + /3 width=2 by ex_intro/ +| #U #T #HG #HL #HT destruct + elim (IH G L U) [ * #B #HB | #HnB | // ] + [ elim (IH G L T) [ * #A #HA | #HnA | // ] ] -IH + [ elim (eq_aarity_dec B A) [ #H destruct | #HnA ] + [ /4 width=3 by aaa_cast, ex_intro, or_introl/ ] + ] + @or_intror * #X #H + [ elim (aaa_aaa_inv_cast … H HB HA) -G -L -U -T + |*: elim (aaa_inv_cast … H) -H #HU #HT + ] + /3 width=2 by ex_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/aaa_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/aaa_drops.ma index 1cc311ddf..b04f0c05f 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/aaa_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/aaa_drops.ma @@ -22,7 +22,7 @@ include "static_2/static/aaa.ma". (* Advanced properties ******************************************************) (* Basic_2A1: was: aaa_lref *) -lemma aaa_lref_drops: ∀I,G,K,V,B,i,L. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ⁝ B → ⦃G, L⦄ ⊢ #i ⁝ B. +lemma aaa_lref_drops: ∀I,G,K,V,B,i,L. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G,K⦄ ⊢ V ⁝ B → ⦃G,L⦄ ⊢ #i ⁝ B. #I #G #K #V #B #i elim i -i [ #L #H lapply (drops_fwd_isid … H ?) -H // #H destruct /2 width=1 by aaa_zero/ @@ -34,8 +34,8 @@ qed. (* Advanced inversion lemmas ************************************************) (* Basic_2A1: was: aaa_inv_lref *) -lemma aaa_inv_lref_drops: ∀G,A,i,L. ⦃G, L⦄ ⊢ #i ⁝ A → - ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ⁝ A. +lemma aaa_inv_lref_drops: ∀G,A,i,L. ⦃G,L⦄ ⊢ #i ⁝ A → + ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G,K⦄ ⊢ V ⁝ A. #G #A #i elim i -i [ #L #H elim (aaa_inv_zero … H) -H /3 width=5 by drops_refl, ex2_3_intro/ | #i #IH #L #H elim (aaa_inv_lref … H) -H @@ -43,12 +43,19 @@ lemma aaa_inv_lref_drops: ∀G,A,i,L. ⦃G, L⦄ ⊢ #i ⁝ A → ] qed-. +lemma aaa_pair_inv_lref (G) (L) (i): + ∀A. ⦃G,L⦄ ⊢ #i ⁝ A → ∀I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G,K⦄ ⊢ V ⁝ A. +#G #L #i #A #H #I #K #V #HLK +elim (aaa_inv_lref_drops … H) -H #J #Y #X #HLY #HX +lapply (drops_mono … HLY … HLK) -L -i #H destruct // +qed-. + (* Properties with generic slicing for local environments *******************) (* Basic_2A1: includes: aaa_lift *) (* Note: it should use drops_split_trans_pair2 *) -lemma aaa_lifts: ∀G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A → ∀b,f,L2. ⬇*[b, f] L2 ≘ L1 → - ∀T2. ⬆*[f] T1 ≘ T2 → ⦃G, L2⦄ ⊢ T2 ⁝ A. +lemma aaa_lifts: ∀G,L1,T1,A. ⦃G,L1⦄ ⊢ T1 ⁝ A → ∀b,f,L2. ⬇*[b,f] L2 ≘ L1 → + ∀T2. ⬆*[f] T1 ≘ T2 → ⦃G,L2⦄ ⊢ T2 ⁝ A. @(fqup_wf_ind_eq (Ⓣ)) #G0 #L0 #T0 #IH #G #L1 * * [ #s #HG #HL #HT #A #H #b #f #L2 #HL21 #X #HX -b -IH lapply (aaa_inv_sort … H) -H #H destruct @@ -86,8 +93,8 @@ qed-. (* Inversion lemmas with generic slicing for local environments *************) (* Basic_2A1: includes: aaa_inv_lift *) -lemma aaa_inv_lifts: ∀G,L2,T2,A. ⦃G, L2⦄ ⊢ T2 ⁝ A → ∀b,f,L1. ⬇*[b, f] L2 ≘ L1 → - ∀T1. ⬆*[f] T1 ≘ T2 → ⦃G, L1⦄ ⊢ T1 ⁝ A. +lemma aaa_inv_lifts: ∀G,L2,T2,A. ⦃G,L2⦄ ⊢ T2 ⁝ A → ∀b,f,L1. ⬇*[b,f] L2 ≘ L1 → + ∀T1. ⬆*[f] T1 ≘ T2 → ⦃G,L1⦄ ⊢ T1 ⁝ A. @(fqup_wf_ind_eq (Ⓣ)) #G0 #L0 #T0 #IH #G #L2 * * [ #s #HG #HL #HT #A #H #b #f #L1 #HL21 #X #HX -b -IH lapply (aaa_inv_sort … H) -H #H destruct diff --git a/matita/matita/contribs/lambdadelta/static_2/static/aaa_fdeq.ma b/matita/matita/contribs/lambdadelta/static_2/static/aaa_fdeq.ma index 4572fda32..d002095bb 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/aaa_fdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/aaa_fdeq.ma @@ -17,9 +17,9 @@ include "static_2/static/aaa_rdeq.ma". (* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************) -(* Properties with degree-based equivalence on referred entries *************) +(* Properties with sort-irrelevant equivalence on referred entries **********) -lemma aaa_fdeq_conf: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → - ∀A. ⦃G1, L1⦄ ⊢ T1 ⁝ A → ⦃G2, L2⦄ ⊢ T2 ⁝ A. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 -/2 width=7 by aaa_tdeq_conf_rdeq/ qed-. +lemma aaa_fdeq_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → + ∀A. ⦃G1,L1⦄ ⊢ T1 ⁝ A → ⦃G2,L2⦄ ⊢ T2 ⁝ A. +#G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 +/2 width=5 by aaa_tdeq_conf_rdeq/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/aaa_fqus.ma b/matita/matita/contribs/lambdadelta/static_2/static/aaa_fqus.ma index f02455f9f..4ba7d8c56 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/aaa_fqus.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/aaa_fqus.ma @@ -19,8 +19,8 @@ include "static_2/static/aaa_drops.ma". (* Properties on supclosure *************************************************) -lemma aaa_fqu_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ → - ∀A1. ⦃G1, L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2, L2⦄ ⊢ T2 ⁝ A2. +lemma aaa_fqu_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂ ⦃G2,L2,T2⦄ → + ∀A1. ⦃G1,L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2,L2⦄ ⊢ T2 ⁝ A2. #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G #L #T #A #H elim (aaa_inv_zero … H) -H #J #K #V #H #HA destruct /2 width=2 by ex_intro/ @@ -30,7 +30,7 @@ lemma aaa_fqu_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ | elim (aaa_inv_appl … H) | elim (aaa_inv_cast … H) ] -H /2 width=2 by ex_intro/ -| #p * #G #L #V #T #X #H +| #p * #G #L #V #T #_ #X #H [ elim (aaa_inv_abbr … H) | elim (aaa_inv_abst … H) ] -H /2 width=2 by ex_intro/ @@ -43,21 +43,21 @@ lemma aaa_fqu_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ ] qed-. -lemma aaa_fquq_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ → - ∀A1. ⦃G1, L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2, L2⦄ ⊢ T2 ⁝ A2. +lemma aaa_fquq_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮ ⦃G2,L2,T2⦄ → + ∀A1. ⦃G1,L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2,L2⦄ ⊢ T2 ⁝ A2. #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -H /2 width=6 by aaa_fqu_conf/ * #H1 #H2 #H3 destruct /2 width=2 by ex_intro/ qed-. -lemma aaa_fqup_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → - ∀A1. ⦃G1, L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2, L2⦄ ⊢ T2 ⁝ A2. +lemma aaa_fqup_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+ ⦃G2,L2,T2⦄ → + ∀A1. ⦃G1,L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2,L2⦄ ⊢ T2 ⁝ A2. #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 [2: #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #A #HA elim (IH1 … HA) -IH1 -A ] /2 width=6 by aaa_fqu_conf/ qed-. -lemma aaa_fqus_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ → - ∀A1. ⦃G1, L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2, L2⦄ ⊢ T2 ⁝ A2. +lemma aaa_fqus_conf: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂* ⦃G2,L2,T2⦄ → + ∀A1. ⦃G1,L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2,L2⦄ ⊢ T2 ⁝ A2. #G1 #G2 #L1 #L2 #T1 #T2 #H elim(fqus_inv_fqup … H) -H /2 width=6 by aaa_fqup_conf/ * #H1 #H2 #H3 destruct /2 width=2 by ex_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/aaa_rdeq.ma b/matita/matita/contribs/lambdadelta/static_2/static/aaa_rdeq.ma index 23760c8bd..c08a02487 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/aaa_rdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/aaa_rdeq.ma @@ -17,11 +17,11 @@ include "static_2/static/aaa.ma". (* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************) -(* Properties with degree-based equivalence on referred entries *************) +(* Properties with sort-irrelevant equivalence on referred entries **********) -lemma aaa_tdeq_conf_rdeq: ∀h,o,G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A → ∀T2. T1 ≛[h, o] T2 → - ∀L2. L1 ≛[h, o, T1] L2 → ⦃G, L2⦄ ⊢ T2 ⁝ A. -#h #o #G #L1 #T1 #A #H elim H -G -L1 -T1 -A +lemma aaa_tdeq_conf_rdeq: ∀G,L1,T1,A. ⦃G,L1⦄ ⊢ T1 ⁝ A → ∀T2. T1 ≛ T2 → + ∀L2. L1 ≛[T1] L2 → ⦃G,L2⦄ ⊢ T2 ⁝ A. +#G #L1 #T1 #A #H elim H -G -L1 -T1 -A [ #G #L1 #s1 #X #H1 elim (tdeq_inv_sort1 … H1) -H1 // | #I #G #L1 #V1 #B #_ #IH #X #H1 >(tdeq_inv_lref1 … H1) -H1 #Y #H2 elim (rdeq_inv_zero_pair_sn … H2) -H2 diff --git a/matita/matita/contribs/lambdadelta/static_2/static/fdeq.ma b/matita/matita/contribs/lambdadelta/static_2/static/fdeq.ma index 25427895c..1c5b47ba1 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/fdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/fdeq.ma @@ -12,37 +12,37 @@ (* *) (**************************************************************************) -include "static_2/notation/relations/stareqsn_8.ma". +include "static_2/notation/relations/stareqsn_6.ma". include "static_2/syntax/genv.ma". include "static_2/static/rdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES ****************) +(* SORT-IRRELEVANT EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES *************) -inductive fdeq (h) (o) (G) (L1) (T1): relation3 genv lenv term ≝ -| fdeq_intro_sn: ∀L2,T2. L1 ≛[h, o, T1] L2 → T1 ≛[h, o] T2 → - fdeq h o G L1 T1 G L2 T2 +inductive fdeq (G) (L1) (T1): relation3 genv lenv term ≝ +| fdeq_intro_sn: ∀L2,T2. L1 ≛[T1] L2 → T1 ≛ T2 → + fdeq G L1 T1 G L2 T2 . interpretation - "degree-based equivalence on referred entries (closure)" - 'StarEqSn h o G1 L1 T1 G2 L2 T2 = (fdeq h o G1 L1 T1 G2 L2 T2). + "sort-irrelevant equivalence on referred entries (closure)" + 'StarEqSn G1 L1 T1 G2 L2 T2 = (fdeq G1 L1 T1 G2 L2 T2). (* Basic_properties *********************************************************) -lemma fdeq_intro_dx (h) (o) (G): ∀L1,L2,T2. L1 ≛[h, o, T2] L2 → - ∀T1. T1 ≛[h, o] T2 → ⦃G, L1, T1⦄ ≛[h, o] ⦃G, L2, T2⦄. +lemma fdeq_intro_dx (G): ∀L1,L2,T2. L1 ≛[T2] L2 → + ∀T1. T1 ≛ T2 → ⦃G,L1,T1⦄ ≛ ⦃G,L2,T2⦄. /3 width=3 by fdeq_intro_sn, tdeq_rdeq_div/ qed. (* Basic inversion lemmas ***************************************************) -lemma fdeq_inv_gen_sn: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → - ∧∧ G1 = G2 & L1 ≛[h, o, T1] L2 & T1 ≛[h, o] T2. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=1 by and3_intro/ +lemma fdeq_inv_gen_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → + ∧∧ G1 = G2 & L1 ≛[T1] L2 & T1 ≛ T2. +#G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=1 by and3_intro/ qed-. -lemma fdeq_inv_gen_dx: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → - ∧∧ G1 = G2 & L1 ≛[h, o, T2] L2 & T1 ≛[h, o] T2. -#h #o #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 +lemma fdeq_inv_gen_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → + ∧∧ G1 = G2 & L1 ≛[T2] L2 & T1 ≛ T2. +#G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /3 width=3 by tdeq_rdeq_conf, and3_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fdeq.ma b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fdeq.ma index 729185985..1edc17d50 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fdeq.ma @@ -15,37 +15,37 @@ include "static_2/static/rdeq_rdeq.ma". include "static_2/static/fdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES ****************) +(* SORT-IRRELEVANT EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES *************) (* Advanced properties ******************************************************) -lemma fdeq_sym: ∀h,o. tri_symmetric … (fdeq h o). -#h #o #G1 #G2 #L1 #L2 #T1 #T2 * -G1 -L1 -T1 +lemma fdeq_sym: tri_symmetric … fdeq. +#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -L1 -T1 /3 width=1 by fdeq_intro_dx, rdeq_sym, tdeq_sym/ qed-. (* Main properties **********************************************************) -theorem fdeq_trans: ∀h,o. tri_transitive … (fdeq h o). -#h #o #G1 #G #L1 #L #T1 #T * -G -L -T +theorem fdeq_trans: tri_transitive … fdeq. +#G1 #G #L1 #L #T1 #T * -G -L -T #L #T #HL1 #HT1 #G2 #L2 #T2 * -G2 -L2 -T2 /4 width=5 by fdeq_intro_sn, rdeq_trans, tdeq_rdeq_div, tdeq_trans/ qed-. -theorem fdeq_canc_sn: ∀h,o,G,G1,G2,L,L1,L2,T,T1,T2. - ⦃G, L, T⦄ ≛[h, o] ⦃G1, L1, T1⦄→ ⦃G, L, T⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄. +theorem fdeq_canc_sn: ∀G,G1,L,L1,T,T1. ⦃G,L,T⦄ ≛ ⦃G1,L1,T1⦄→ + ∀G2,L2,T2. ⦃G,L,T⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄. /3 width=5 by fdeq_trans, fdeq_sym/ qed-. -theorem fdeq_canc_dx: ∀h,o,G1,G2,G,L1,L2,L,T1,T2,T. - ⦃G1, L1, T1⦄ ≛[h, o] ⦃G, L, T⦄ → ⦃G2, L2, T2⦄ ≛[h, o] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄. +theorem fdeq_canc_dx: ∀G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≛ ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G2,L2,T2⦄ ≛ ⦃G,L,T⦄ → ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄. /3 width=5 by fdeq_trans, fdeq_sym/ qed-. (* Main inversion lemmas with degree-based equivalence on terms *************) -theorem fdeq_tdneq_repl_dx: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → - ∀U1,U2. ⦃G1, L1, U1⦄ ≛[h, o] ⦃G2, L2, U2⦄ → - (T2 ≛[h, o] U2 → ⊥) → (T1 ≛[h, o] U1 → ⊥). -#h #o #G1 #G2 #L1 #L2 #T1 #T2 #HT #U1 #U2 #HU #HnTU2 #HTU1 +theorem fdeq_tdneq_repl_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → + ∀U1,U2. ⦃G1,L1,U1⦄ ≛ ⦃G2,L2,U2⦄ → + (T2 ≛ U2 → ⊥) → (T1 ≛ U1 → ⊥). +#G1 #G2 #L1 #L2 #T1 #T2 #HT #U1 #U2 #HU #HnTU2 #HTU1 elim (fdeq_inv_gen_sn … HT) -HT #_ #_ #HT elim (fdeq_inv_gen_sn … HU) -HU #_ #_ #HU /3 width=5 by tdeq_repl/ diff --git a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqup.ma b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqup.ma index 6a4f49e57..333a0f787 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqup.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqup.ma @@ -15,15 +15,15 @@ include "static_2/static/rdeq_fqup.ma". include "static_2/static/fdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES ****************) +(* SORT-IRRELEVANT EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES *************) -(* Properties with degree-based equivalence for terms ***********************) +(* Properties with sort-irrelevant equivalence for terms ********************) -lemma tdeq_fdeq: ∀h,o,T1,T2. T1 ≛[h, o] T2 → - ∀G,L. ⦃G, L, T1⦄ ≛[h, o] ⦃G, L, T2⦄. +lemma tdeq_fdeq: ∀T1,T2. T1 ≛ T2 → + ∀G,L. ⦃G,L,T1⦄ ≛ ⦃G,L,T2⦄. /2 width=1 by fdeq_intro_sn/ qed. (* Advanced properties ******************************************************) -lemma fdeq_refl: ∀h,o. tri_reflexive … (fdeq h o). +lemma fdeq_refl: tri_reflexive … fdeq. /2 width=1 by fdeq_intro_sn/ qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqus.ma b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqus.ma index 4274cd40f..ce0dda0d0 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqus.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_fqus.ma @@ -15,14 +15,14 @@ include "static_2/static/rdeq_fqus.ma". include "static_2/static/fdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES ****************) +(* SORT-IRRELEVANT EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES *************) (* Properties with star-iterated structural successor for closures **********) -lemma fdeq_fqus_trans: ∀h,o,b,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ ⊐*[b] ⦃G2, L2, T2⦄ → - ∃∃G,L0,T0. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G, L0, T0⦄ & ⦃G, L0, T0⦄ ≛[h, o] ⦃G2, L2, T2⦄. -#h #o #b #G1 #G #L1 #L #T1 #T #H1 #G2 #L2 #T2 #H2 +lemma fdeq_fqus_trans: ∀b,G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≛ ⦃G,L,T⦄ → + ∀G2,L2,T2. ⦃G,L,T⦄ ⬂*[b] ⦃G2,L2,T2⦄ → + ∃∃G,L0,T0. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G,L0,T0⦄ & ⦃G,L0,T0⦄ ≛ ⦃G2,L2,T2⦄. +#b #G1 #G #L1 #L #T1 #T #H1 #G2 #L2 #T2 #H2 elim(fdeq_inv_gen_dx … H1) -H1 #HG #HL1 #HT1 destruct elim (rdeq_fqus_trans … H2 … HL1) -L #L #T0 #H2 #HT02 #HL2 elim (tdeq_fqus_trans … H2 … HT1) -T #L0 #T #H2 #HT0 #HL0 diff --git a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_req.ma b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_req.ma index 0c0d9c3bc..5dbf18b5e 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/fdeq_req.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/fdeq_req.ma @@ -15,13 +15,13 @@ include "static_2/static/rdeq_req.ma". include "static_2/static/fdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES ****************) +(* SORT-IRRELEVANT EQUIVALENCE FOR CLOSURES ON REFERRED ENTRIES *************) (* Properties with syntactic equivalence on referred entries ****************) -lemma req_rdeq_trans: ∀h,o,L1,L,T1. L1 ≡[T1] L → - ∀G1,G2,L2,T2. ⦃G1, L, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄. -#h #o #L1 #L #T1 #HL1 #G1 #G2 #L2 #T2 #H +lemma req_rdeq_trans: ∀L1,L,T1. L1 ≡[T1] L → + ∀G1,G2,L2,T2. ⦃G1,L,T1⦄ ≛ ⦃G2,L2,T2⦄ → ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄. +#L1 #L #T1 #HL1 #G1 #G2 #L2 #T2 #H elim (fdeq_inv_gen_sn … H) -H #H #HL2 #T12 destruct /3 width=3 by fdeq_intro_sn, req_rdeq_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/frees.ma b/matita/matita/contribs/lambdadelta/static_2/static/frees.ma index 054003f83..a312c2525 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/frees.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/frees.ma @@ -13,7 +13,7 @@ (**************************************************************************) include "ground_2/relocation/rtmap_sor.ma". -include "static_2/notation/relations/freestar_3.ma". +include "static_2/notation/relations/freeplus_3.ma". include "static_2/syntax/lenv.ma". (* CONTEXT-SENSITIVE FREE VARIABLES *****************************************) @@ -35,11 +35,11 @@ inductive frees: relation3 lenv term rtmap ≝ interpretation "context-sensitive free variables (term)" - 'FreeStar L T f = (frees L T f). + 'FreePlus L T f = (frees L T f). (* Basic inversion lemmas ***************************************************) -fact frees_inv_sort_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀x. X = ⋆x → 𝐈⦃f⦄. +fact frees_inv_sort_aux: ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀x. X = ⋆x → 𝐈⦃f⦄. #L #X #f #H elim H -f -L -X // [ #f #i #_ #x #H destruct | #f #_ #L #V #_ #_ #x #H destruct @@ -50,11 +50,12 @@ fact frees_inv_sort_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀x. X = ⋆x ] qed-. -lemma frees_inv_sort: ∀f,L,s. L ⊢ 𝐅*⦃⋆s⦄ ≘ f → 𝐈⦃f⦄. +lemma frees_inv_sort: ∀f,L,s. L ⊢ 𝐅+⦃⋆s⦄ ≘ f → 𝐈⦃f⦄. /2 width=5 by frees_inv_sort_aux/ qed-. -fact frees_inv_atom_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀i. L = ⋆ → X = #i → - ∃∃g. 𝐈⦃g⦄ & f = ⫯*[i]↑g. +fact frees_inv_atom_aux: + ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀i. L = ⋆ → X = #i → + ∃∃g. 𝐈⦃g⦄ & f = ⫯*[i]↑g. #f #L #X #H elim H -f -L -X [ #f #L #s #_ #j #_ #H destruct | #f #i #Hf #j #_ #H destruct /2 width=3 by ex2_intro/ @@ -67,11 +68,12 @@ fact frees_inv_atom_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀i. L = ⋆ ] qed-. -lemma frees_inv_atom: ∀f,i. ⋆ ⊢ 𝐅*⦃#i⦄ ≘ f → ∃∃g. 𝐈⦃g⦄ & f = ⫯*[i]↑g. +lemma frees_inv_atom: ∀f,i. ⋆ ⊢ 𝐅+⦃#i⦄ ≘ f → ∃∃g. 𝐈⦃g⦄ & f = ⫯*[i]↑g. /2 width=5 by frees_inv_atom_aux/ qed-. -fact frees_inv_pair_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,K,V. L = K.ⓑ{I}V → X = #0 → - ∃∃g. K ⊢ 𝐅*⦃V⦄ ≘ g & f = ↑g. +fact frees_inv_pair_aux: + ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀I,K,V. L = K.ⓑ{I}V → X = #0 → + ∃∃g. K ⊢ 𝐅+⦃V⦄ ≘ g & f = ↑g. #f #L #X * -f -L -X [ #f #L #s #_ #Z #Y #X #_ #H destruct | #f #i #_ #Z #Y #X #H destruct @@ -84,11 +86,12 @@ fact frees_inv_pair_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,K,V. L = K. ] qed-. -lemma frees_inv_pair: ∀f,I,K,V. K.ⓑ{I}V ⊢ 𝐅*⦃#0⦄ ≘ f → ∃∃g. K ⊢ 𝐅*⦃V⦄ ≘ g & f = ↑g. +lemma frees_inv_pair: ∀f,I,K,V. K.ⓑ{I}V ⊢ 𝐅+⦃#0⦄ ≘ f → ∃∃g. K ⊢ 𝐅+⦃V⦄ ≘ g & f = ↑g. /2 width=6 by frees_inv_pair_aux/ qed-. -fact frees_inv_unit_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,K. L = K.ⓤ{I} → X = #0 → - ∃∃g. 𝐈⦃g⦄ & f = ↑g. +fact frees_inv_unit_aux: + ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀I,K. L = K.ⓤ{I} → X = #0 → + ∃∃g. 𝐈⦃g⦄ & f = ↑g. #f #L #X * -f -L -X [ #f #L #s #_ #Z #Y #_ #H destruct | #f #i #_ #Z #Y #H destruct @@ -101,11 +104,12 @@ fact frees_inv_unit_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,K. L = K. ] qed-. -lemma frees_inv_unit: ∀f,I,K. K.ⓤ{I} ⊢ 𝐅*⦃#0⦄ ≘ f → ∃∃g. 𝐈⦃g⦄ & f = ↑g. +lemma frees_inv_unit: ∀f,I,K. K.ⓤ{I} ⊢ 𝐅+⦃#0⦄ ≘ f → ∃∃g. 𝐈⦃g⦄ & f = ↑g. /2 width=7 by frees_inv_unit_aux/ qed-. -fact frees_inv_lref_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,K,j. L = K.ⓘ{I} → X = #(↑j) → - ∃∃g. K ⊢ 𝐅*⦃#j⦄ ≘ g & f = ⫯g. +fact frees_inv_lref_aux: + ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀I,K,j. L = K.ⓘ{I} → X = #(↑j) → + ∃∃g. K ⊢ 𝐅+⦃#j⦄ ≘ g & f = ⫯g. #f #L #X * -f -L -X [ #f #L #s #_ #Z #Y #j #_ #H destruct | #f #i #_ #Z #Y #j #H destruct @@ -118,11 +122,12 @@ fact frees_inv_lref_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,K,j. L = K. ] qed-. -lemma frees_inv_lref: ∀f,I,K,i. K.ⓘ{I} ⊢ 𝐅*⦃#(↑i)⦄ ≘ f → - ∃∃g. K ⊢ 𝐅*⦃#i⦄ ≘ g & f = ⫯g. +lemma frees_inv_lref: + ∀f,I,K,i. K.ⓘ{I} ⊢ 𝐅+⦃#(↑i)⦄ ≘ f → + ∃∃g. K ⊢ 𝐅+⦃#i⦄ ≘ g & f = ⫯g. /2 width=6 by frees_inv_lref_aux/ qed-. -fact frees_inv_gref_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀x. X = §x → 𝐈⦃f⦄. +fact frees_inv_gref_aux: ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀x. X = §x → 𝐈⦃f⦄. #f #L #X #H elim H -f -L -X // [ #f #i #_ #x #H destruct | #f #_ #L #V #_ #_ #x #H destruct @@ -133,11 +138,12 @@ fact frees_inv_gref_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀x. X = §x ] qed-. -lemma frees_inv_gref: ∀f,L,l. L ⊢ 𝐅*⦃§l⦄ ≘ f → 𝐈⦃f⦄. +lemma frees_inv_gref: ∀f,L,l. L ⊢ 𝐅+⦃§l⦄ ≘ f → 𝐈⦃f⦄. /2 width=5 by frees_inv_gref_aux/ qed-. -fact frees_inv_bind_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀p,I,V,T. X = ⓑ{p,I}V.T → - ∃∃f1,f2. L ⊢ 𝐅*⦃V⦄ ≘ f1 & L.ⓑ{I}V ⊢ 𝐅*⦃T⦄ ≘ f2 & f1 ⋓ ⫱f2 ≘ f. +fact frees_inv_bind_aux: + ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀p,I,V,T. X = ⓑ{p,I}V.T → + ∃∃f1,f2. L ⊢ 𝐅+⦃V⦄ ≘ f1 & L.ⓑ{I}V ⊢ 𝐅+⦃T⦄ ≘ f2 & f1 ⋓ ⫱f2 ≘ f. #f #L #X * -f -L -X [ #f #L #s #_ #q #J #W #U #H destruct | #f #i #_ #q #J #W #U #H destruct @@ -150,12 +156,13 @@ fact frees_inv_bind_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀p,I,V,T. X = ] qed-. -lemma frees_inv_bind: ∀f,p,I,L,V,T. L ⊢ 𝐅*⦃ⓑ{p,I}V.T⦄ ≘ f → - ∃∃f1,f2. L ⊢ 𝐅*⦃V⦄ ≘ f1 & L.ⓑ{I}V ⊢ 𝐅*⦃T⦄ ≘ f2 & f1 ⋓ ⫱f2 ≘ f. +lemma frees_inv_bind: + ∀f,p,I,L,V,T. L ⊢ 𝐅+⦃ⓑ{p,I}V.T⦄ ≘ f → + ∃∃f1,f2. L ⊢ 𝐅+⦃V⦄ ≘ f1 & L.ⓑ{I}V ⊢ 𝐅+⦃T⦄ ≘ f2 & f1 ⋓ ⫱f2 ≘ f. /2 width=4 by frees_inv_bind_aux/ qed-. -fact frees_inv_flat_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,V,T. X = ⓕ{I}V.T → - ∃∃f1,f2. L ⊢ 𝐅*⦃V⦄ ≘ f1 & L ⊢ 𝐅*⦃T⦄ ≘ f2 & f1 ⋓ f2 ≘ f. +fact frees_inv_flat_aux: ∀f,L,X. L ⊢ 𝐅+⦃X⦄ ≘ f → ∀I,V,T. X = ⓕ{I}V.T → + ∃∃f1,f2. L ⊢ 𝐅+⦃V⦄ ≘ f1 & L ⊢ 𝐅+⦃T⦄ ≘ f2 & f1 ⋓ f2 ≘ f. #f #L #X * -f -L -X [ #f #L #s #_ #J #W #U #H destruct | #f #i #_ #J #W #U #H destruct @@ -168,13 +175,14 @@ fact frees_inv_flat_aux: ∀f,L,X. L ⊢ 𝐅*⦃X⦄ ≘ f → ∀I,V,T. X = ] qed-. -lemma frees_inv_flat: ∀f,I,L,V,T. L ⊢ 𝐅*⦃ⓕ{I}V.T⦄ ≘ f → - ∃∃f1,f2. L ⊢ 𝐅*⦃V⦄ ≘ f1 & L ⊢ 𝐅*⦃T⦄ ≘ f2 & f1 ⋓ f2 ≘ f. +lemma frees_inv_flat: + ∀f,I,L,V,T. L ⊢ 𝐅+⦃ⓕ{I}V.T⦄ ≘ f → + ∃∃f1,f2. L ⊢ 𝐅+⦃V⦄ ≘ f1 & L ⊢ 𝐅+⦃T⦄ ≘ f2 & f1 ⋓ f2 ≘ f. /2 width=4 by frees_inv_flat_aux/ qed-. (* Basic properties ********************************************************) -lemma frees_eq_repl_back: ∀L,T. eq_repl_back … (λf. L ⊢ 𝐅*⦃T⦄ ≘ f). +lemma frees_eq_repl_back: ∀L,T. eq_repl_back … (λf. L ⊢ 𝐅+⦃T⦄ ≘ f). #L #T #f1 #H elim H -f1 -L -T [ /3 width=3 by frees_sort, isid_eq_repl_back/ | #f1 #i #Hf1 #g2 #H @@ -195,11 +203,11 @@ lemma frees_eq_repl_back: ∀L,T. eq_repl_back … (λf. L ⊢ 𝐅*⦃T⦄ ≘ ] qed-. -lemma frees_eq_repl_fwd: ∀L,T. eq_repl_fwd … (λf. L ⊢ 𝐅*⦃T⦄ ≘ f). +lemma frees_eq_repl_fwd: ∀L,T. eq_repl_fwd … (λf. L ⊢ 𝐅+⦃T⦄ ≘ f). #L #T @eq_repl_sym /2 width=3 by frees_eq_repl_back/ qed-. -lemma frees_lref_push: ∀f,i. ⋆ ⊢ 𝐅*⦃#i⦄ ≘ f → ⋆ ⊢ 𝐅*⦃#↑i⦄ ≘ ⫯f. +lemma frees_lref_push: ∀f,i. ⋆ ⊢ 𝐅+⦃#i⦄ ≘ f → ⋆ ⊢ 𝐅+⦃#↑i⦄ ≘ ⫯f. #f #i #H elim (frees_inv_atom … H) -H #g #Hg #H destruct /2 width=1 by frees_atom/ @@ -207,7 +215,7 @@ qed. (* Forward lemmas with test for finite colength *****************************) -lemma frees_fwd_isfin: ∀f,L,T. L ⊢ 𝐅*⦃T⦄ ≘ f → 𝐅⦃f⦄. +lemma frees_fwd_isfin: ∀f,L,T. L ⊢ 𝐅+⦃T⦄ ≘ f → 𝐅⦃f⦄. #f #L #T #H elim H -f -L -T /4 width=5 by sor_isfin, isfin_isid, isfin_tl, isfin_pushs, isfin_push, isfin_next/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/frees_append.ma b/matita/matita/contribs/lambdadelta/static_2/static/frees_append.ma index ce8d34808..42523bb39 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/frees_append.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/frees_append.ma @@ -19,7 +19,7 @@ include "static_2/static/frees.ma". (* Properties with append for local environments ****************************) -lemma frees_append_void: ∀f,K,T. K ⊢ 𝐅*⦃T⦄ ≘ f → ⓧ.K ⊢ 𝐅*⦃T⦄ ≘ f. +lemma frees_append_void: ∀f,K,T. K ⊢ 𝐅+⦃T⦄ ≘ f → ⓧ.K ⊢ 𝐅+⦃T⦄ ≘ f. #f #K #T #H elim H -f -K -T [ /2 width=1 by frees_sort/ | #f * /3 width=1 by frees_atom, frees_unit, frees_lref/ @@ -34,8 +34,9 @@ qed. (* Inversion lemmas with append for local environments **********************) -fact frees_inv_append_void_aux: ∀f,L,T. L ⊢ 𝐅*⦃T⦄ ≘ f → - ∀K. L = ⓧ.K → K ⊢ 𝐅*⦃T⦄ ≘ f. +fact frees_inv_append_void_aux: + ∀f,L,T. L ⊢ 𝐅+⦃T⦄ ≘ f → + ∀K. L = ⓧ.K → K ⊢ 𝐅+⦃T⦄ ≘ f. #f #L #T #H elim H -f -L -T [ /2 width=1 by frees_sort/ | #f #i #_ #K #H @@ -55,5 +56,5 @@ fact frees_inv_append_void_aux: ∀f,L,T. L ⊢ 𝐅*⦃T⦄ ≘ f → ] qed-. -lemma frees_inv_append_void: ∀f,K,T. ⓧ.K ⊢ 𝐅*⦃T⦄ ≘ f → K ⊢ 𝐅*⦃T⦄ ≘ f. +lemma frees_inv_append_void: ∀f,K,T. ⓧ.K ⊢ 𝐅+⦃T⦄ ≘ f → K ⊢ 𝐅+⦃T⦄ ≘ f. /2 width=3 by frees_inv_append_void_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/frees_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/frees_drops.ma index 3c6466086..d936eda81 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/frees_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/frees_drops.ma @@ -20,8 +20,9 @@ include "static_2/static/frees_fqup.ma". (* Advanced properties ******************************************************) -lemma frees_atom_drops: ∀b,L,i. ⬇*[b, 𝐔❴i❵] L ≘ ⋆ → - ∀f. 𝐈⦃f⦄ → L ⊢ 𝐅*⦃#i⦄ ≘ ⫯*[i]↑f. +lemma frees_atom_drops: + ∀b,L,i. ⬇*[b,𝐔❴i❵] L ≘ ⋆ → + ∀f. 𝐈⦃f⦄ → L ⊢ 𝐅+⦃#i⦄ ≘ ⫯*[i]↑f. #b #L elim L -L /2 width=1 by frees_atom/ #L #I #IH * [ #H lapply (drops_fwd_isid … H ?) -H // #H destruct @@ -29,16 +30,18 @@ lemma frees_atom_drops: ∀b,L,i. ⬇*[b, 𝐔❴i❵] L ≘ ⋆ → ] qed. -lemma frees_pair_drops: ∀f,K,V. K ⊢ 𝐅*⦃V⦄ ≘ f → - ∀i,I,L. ⬇*[i] L ≘ K.ⓑ{I}V → L ⊢ 𝐅*⦃#i⦄ ≘ ⫯*[i] ↑f. +lemma frees_pair_drops: + ∀f,K,V. K ⊢ 𝐅+⦃V⦄ ≘ f → + ∀i,I,L. ⬇*[i] L ≘ K.ⓑ{I}V → L ⊢ 𝐅+⦃#i⦄ ≘ ⫯*[i] ↑f. #f #K #V #Hf #i elim i -i [ #I #L #H lapply (drops_fwd_isid … H ?) -H /2 width=1 by frees_pair/ | #i #IH #I #L #H elim (drops_inv_succ … H) -H /3 width=2 by frees_lref/ ] qed. -lemma frees_unit_drops: ∀f. 𝐈⦃f⦄ → ∀I,K,i,L. ⬇*[i] L ≘ K.ⓤ{I} → - L ⊢ 𝐅*⦃#i⦄ ≘ ⫯*[i] ↑f. +lemma frees_unit_drops: + ∀f. 𝐈⦃f⦄ → ∀I,K,i,L. ⬇*[i] L ≘ K.ⓤ{I} → + L ⊢ 𝐅+⦃#i⦄ ≘ ⫯*[i] ↑f. #f #Hf #I #K #i elim i -i [ #L #H lapply (drops_fwd_isid … H ?) -H /2 width=1 by frees_unit/ | #i #IH #Y #H elim (drops_inv_succ … H) -H @@ -46,16 +49,18 @@ lemma frees_unit_drops: ∀f. 𝐈⦃f⦄ → ∀I,K,i,L. ⬇*[i] L ≘ K.ⓤ{I ] qed. (* -lemma frees_sort_pushs: ∀f,K,s. K ⊢ 𝐅*⦃⋆s⦄ ≘ f → - ∀i,L. ⬇*[i] L ≘ K → L ⊢ 𝐅*⦃⋆s⦄ ≘ ⫯*[i] f. +lemma frees_sort_pushs: + ∀f,K,s. K ⊢ 𝐅+⦃⋆s⦄ ≘ f → + ∀i,L. ⬇*[i] L ≘ K → L ⊢ 𝐅+⦃⋆s⦄ ≘ ⫯*[i] f. #f #K #s #Hf #i elim i -i [ #L #H lapply (drops_fwd_isid … H ?) -H // | #i #IH #L #H elim (drops_inv_succ … H) -H /3 width=1 by frees_sort/ ] qed. *) -lemma frees_lref_pushs: ∀f,K,j. K ⊢ 𝐅*⦃#j⦄ ≘ f → - ∀i,L. ⬇*[i] L ≘ K → L ⊢ 𝐅*⦃#(i+j)⦄ ≘ ⫯*[i] f. +lemma frees_lref_pushs: + ∀f,K,j. K ⊢ 𝐅+⦃#j⦄ ≘ f → + ∀i,L. ⬇*[i] L ≘ K → L ⊢ 𝐅+⦃#(i+j)⦄ ≘ ⫯*[i] f. #f #K #j #Hf #i elim i -i [ #L #H lapply (drops_fwd_isid … H ?) -H // | #i #IH #L #H elim (drops_inv_succ … H) -H @@ -63,8 +68,9 @@ lemma frees_lref_pushs: ∀f,K,j. K ⊢ 𝐅*⦃#j⦄ ≘ f → ] qed. (* -lemma frees_gref_pushs: ∀f,K,l. K ⊢ 𝐅*⦃§l⦄ ≘ f → - ∀i,L. ⬇*[i] L ≘ K → L ⊢ 𝐅*⦃§l⦄ ≘ ⫯*[i] f. +lemma frees_gref_pushs: + ∀f,K,l. K ⊢ 𝐅+⦃§l⦄ ≘ f → + ∀i,L. ⬇*[i] L ≘ K → L ⊢ 𝐅+⦃§l⦄ ≘ ⫯*[i] f. #f #K #l #Hf #i elim i -i [ #L #H lapply (drops_fwd_isid … H ?) -H // | #i #IH #L #H elim (drops_inv_succ … H) -H /3 width=1 by frees_gref/ @@ -73,11 +79,11 @@ qed. *) (* Advanced inversion lemmas ************************************************) -lemma frees_inv_lref_drops: ∀L,i,f. L ⊢ 𝐅*⦃#i⦄ ≘ f → - ∨∨ ∃∃g. ⬇*[Ⓕ, 𝐔❴i❵] L ≘ ⋆ & 𝐈⦃g⦄ & f = ⫯*[i] ↑g - | ∃∃g,I,K,V. K ⊢ 𝐅*⦃V⦄ ≘ g & - ⬇*[i] L ≘ K.ⓑ{I}V & f = ⫯*[i] ↑g - | ∃∃g,I,K. ⬇*[i] L ≘ K.ⓤ{I} & 𝐈⦃g⦄ & f = ⫯*[i] ↑g. +lemma frees_inv_lref_drops: + ∀L,i,f. L ⊢ 𝐅+⦃#i⦄ ≘ f → + ∨∨ ∃∃g. ⬇*[Ⓕ,𝐔❴i❵] L ≘ ⋆ & 𝐈⦃g⦄ & f = ⫯*[i] ↑g + | ∃∃g,I,K,V. K ⊢ 𝐅+⦃V⦄ ≘ g & ⬇*[i] L ≘ K.ⓑ{I}V & f = ⫯*[i] ↑g + | ∃∃g,I,K. ⬇*[i] L ≘ K.ⓤ{I} & 𝐈⦃g⦄ & f = ⫯*[i] ↑g. #L elim L -L [ #i #g | #L #I #IH * [ #g cases I -I [ #I | #I #V ] -IH | #i #g ] ] #H [ elim (frees_inv_atom … H) -H #f #Hf #H destruct @@ -97,9 +103,10 @@ qed-. (* Properties with generic slicing for local environments *******************) -lemma frees_lifts: ∀b,f1,K,T. K ⊢ 𝐅*⦃T⦄ ≘ f1 → - ∀f,L. ⬇*[b, f] L ≘ K → ∀U. ⬆*[f] T ≘ U → - ∀f2. f ~⊚ f1 ≘ f2 → L ⊢ 𝐅*⦃U⦄ ≘ f2. +lemma frees_lifts: + ∀b,f1,K,T. K ⊢ 𝐅+⦃T⦄ ≘ f1 → + ∀f,L. ⬇*[b,f] L ≘ K → ∀U. ⬆*[f] T ≘ U → + ∀f2. f ~⊚ f1 ≘ f2 → L ⊢ 𝐅+⦃U⦄ ≘ f2. #b #f1 #K #T #H lapply (frees_fwd_isfin … H) elim H -f1 -K -T [ #f1 #K #s #Hf1 #_ #f #L #HLK #U #H2 #f2 #H3 lapply (coafter_isid_inv_dx … H3 … Hf1) -f1 #Hf2 @@ -154,48 +161,54 @@ lemma frees_lifts: ∀b,f1,K,T. K ⊢ 𝐅*⦃T⦄ ≘ f1 → ] qed-. -lemma frees_lifts_SO: ∀b,L,K. ⬇*[b, 𝐔❴1❵] L ≘ K → ∀T,U. ⬆*[1] T ≘ U → - ∀f. K ⊢ 𝐅*⦃T⦄ ≘ f → L ⊢ 𝐅*⦃U⦄ ≘ ⫯f. +lemma frees_lifts_SO: + ∀b,L,K. ⬇*[b,𝐔❴1❵] L ≘ K → ∀T,U. ⬆*[1] T ≘ U → + ∀f. K ⊢ 𝐅+⦃T⦄ ≘ f → L ⊢ 𝐅+⦃U⦄ ≘ ⫯f. #b #L #K #HLK #T #U #HTU #f #Hf @(frees_lifts b … Hf … HTU) // (**) (* auto fails *) qed. (* Forward lemmas with generic slicing for local environments ***************) -lemma frees_fwd_coafter: ∀b,f2,L,U. L ⊢ 𝐅*⦃U⦄ ≘ f2 → - ∀f,K. ⬇*[b, f] L ≘ K → ∀T. ⬆*[f] T ≘ U → - ∀f1. K ⊢ 𝐅*⦃T⦄ ≘ f1 → f ~⊚ f1 ≘ f2. +lemma frees_fwd_coafter: + ∀b,f2,L,U. L ⊢ 𝐅+⦃U⦄ ≘ f2 → + ∀f,K. ⬇*[b,f] L ≘ K → ∀T. ⬆*[f] T ≘ U → + ∀f1. K ⊢ 𝐅+⦃T⦄ ≘ f1 → f ~⊚ f1 ≘ f2. /4 width=11 by frees_lifts, frees_mono, coafter_eq_repl_back0/ qed-. (* Inversion lemmas with generic slicing for local environments *************) -lemma frees_inv_lifts_ex: ∀b,f2,L,U. L ⊢ 𝐅*⦃U⦄ ≘ f2 → - ∀f,K. ⬇*[b, f] L ≘ K → ∀T. ⬆*[f] T ≘ U → - ∃∃f1. f ~⊚ f1 ≘ f2 & K ⊢ 𝐅*⦃T⦄ ≘ f1. +lemma frees_inv_lifts_ex: + ∀b,f2,L,U. L ⊢ 𝐅+⦃U⦄ ≘ f2 → + ∀f,K. ⬇*[b,f] L ≘ K → ∀T. ⬆*[f] T ≘ U → + ∃∃f1. f ~⊚ f1 ≘ f2 & K ⊢ 𝐅+⦃T⦄ ≘ f1. #b #f2 #L #U #Hf2 #f #K #HLK #T elim (frees_total K T) /3 width=9 by frees_fwd_coafter, ex2_intro/ qed-. -lemma frees_inv_lifts_SO: ∀b,f,L,U. L ⊢ 𝐅*⦃U⦄ ≘ f → - ∀K. ⬇*[b, 𝐔❴1❵] L ≘ K → ∀T. ⬆*[1] T ≘ U → - K ⊢ 𝐅*⦃T⦄ ≘ ⫱f. +lemma frees_inv_lifts_SO: + ∀b,f,L,U. L ⊢ 𝐅+⦃U⦄ ≘ f → + ∀K. ⬇*[b,𝐔❴1❵] L ≘ K → ∀T. ⬆*[1] T ≘ U → + K ⊢ 𝐅+⦃T⦄ ≘ ⫱f. #b #f #L #U #H #K #HLK #T #HTU elim(frees_inv_lifts_ex … H … HLK … HTU) -b -L -U #f1 #Hf #Hf1 elim (coafter_inv_nxx … Hf) -Hf /3 width=5 by frees_eq_repl_back, coafter_isid_inv_sn/ qed-. -lemma frees_inv_lifts: ∀b,f2,L,U. L ⊢ 𝐅*⦃U⦄ ≘ f2 → - ∀f,K. ⬇*[b, f] L ≘ K → ∀T. ⬆*[f] T ≘ U → - ∀f1. f ~⊚ f1 ≘ f2 → K ⊢ 𝐅*⦃T⦄ ≘ f1. +lemma frees_inv_lifts: + ∀b,f2,L,U. L ⊢ 𝐅+⦃U⦄ ≘ f2 → + ∀f,K. ⬇*[b,f] L ≘ K → ∀T. ⬆*[f] T ≘ U → + ∀f1. f ~⊚ f1 ≘ f2 → K ⊢ 𝐅+⦃T⦄ ≘ f1. #b #f2 #L #U #H #f #K #HLK #T #HTU #f1 #Hf2 elim (frees_inv_lifts_ex … H … HLK … HTU) -b -L -U /3 width=7 by frees_eq_repl_back, coafter_inj/ qed-. (* Note: this is used by rex_conf and might be modified *) -lemma frees_inv_drops_next: ∀f1,L1,T1. L1 ⊢ 𝐅*⦃T1⦄ ≘ f1 → - ∀I2,L2,V2,n. ⬇*[n] L1 ≘ L2.ⓑ{I2}V2 → - ∀g1. ↑g1 = ⫱*[n] f1 → - ∃∃g2. L2 ⊢ 𝐅*⦃V2⦄ ≘ g2 & g2 ⊆ g1. +lemma frees_inv_drops_next: + ∀f1,L1,T1. L1 ⊢ 𝐅+⦃T1⦄ ≘ f1 → + ∀I2,L2,V2,n. ⬇*[n] L1 ≘ L2.ⓑ{I2}V2 → + ∀g1. ↑g1 = ⫱*[n] f1 → + ∃∃g2. L2 ⊢ 𝐅+⦃V2⦄ ≘ g2 & g2 ⊆ g1. #f1 #L1 #T1 #H elim H -f1 -L1 -T1 [ #f1 #L1 #s #Hf1 #I2 #L2 #V2 #n #_ #g1 #H1 -I2 -L1 -s lapply (isid_tls n … Hf1) -Hf1

(lifts_inv_sort1 … H0) -H0 lapply (acr_gcr … H1RP H2RP (⓪)) #HAtom - lapply (s4 … HAtom G L2 (Ⓔ)) /2 width=1 by/ + lapply (s2 … HAtom G L2 (Ⓔ)) /3 width=7 by cp1, simple_atom/ | #i #HG #HL #HT #A #HA #b #f #L0 #HL01 #X0 #H0 #L2 #HL20 destruct elim (aaa_inv_lref_drops … HA) -HA #I #K1 #V1 #HLK1 #HKV1 elim (lifts_inv_lref1 … H0) -H0 #j #Hf #H destruct @@ -91,11 +91,11 @@ qed. (* Basic_1: was: sc3_arity *) lemma acr_aaa: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → - ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ⦃G, L, T⦄ ϵ[RP] 〚A〛. + ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → ⦃G,L,T⦄ ϵ[RP] 〚A〛. /3 width=9 by drops_refl, lifts_refl, acr_aaa_csubc_lifts/ qed. lemma gcr_aaa: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → - ∀G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → RP G L T. + ∀G,L,T,A. ⦃G,L⦄ ⊢ T ⁝ A → RP G L T. #RR #RS #RP #H1RP #H2RP #G #L #T #A #HT lapply (acr_gcr … H1RP H2RP A) #HA @(s1 … HA) /2 width=4 by acr_aaa/ 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 5a5d9ee22..d13387c3f 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/gcp_cr.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/gcp_cr.ma @@ -28,16 +28,13 @@ definition S1 ≝ λRP,C:candidate. (* Note: this is Tait's iii, or Girard's CR4 *) definition S2 ≝ λRR:relation4 genv lenv term term. λRS:relation term. λRP,C:candidate. ∀G,L,Vs. all … (RP G L) Vs → - ∀T. 𝐒⦃T⦄ → NF … (RR G L) RS T → C G L (ⒶVs.T). + ∀T. 𝐒⦃T⦄ → nf RR RS G L T → C G L (ⒶVs.T). (* Note: this generalizes Tait's ii *) definition S3 ≝ λC:candidate. ∀a,G,L,Vs,V,T,W. C G L (ⒶVs.ⓓ{a}ⓝW.V.T) → C G L (ⒶVs.ⓐV.ⓛ{a}W.T). -definition S4 ≝ λRP,C:candidate. - ∀G,L,Vs. all … (RP G L) Vs → ∀s. C G L (ⒶVs.⋆s). - definition S5 ≝ λC:candidate. ∀I,G,L,K,Vs,V1,V2,i. C G L (ⒶVs.V2) → ⬆*[↑i] V1 ≘ V2 → ⬇*[i] L ≘ K.ⓑ{I}V1 → C G L (ⒶVs.#i). @@ -54,7 +51,6 @@ record gcr (RR:relation4 genv lenv term term) (RS:relation term) (RP,C:candidate { s1: S1 RP C; s2: S2 RR RS RP C; s3: S3 C; - s4: S4 RP C; s5: S5 C; s6: S6 RP C; s7: S7 C @@ -63,7 +59,7 @@ record gcr (RR:relation4 genv lenv term term) (RS:relation term) (RP,C:candidate (* the functional construction for candidates *) definition cfun: candidate → candidate → candidate ≝ λC1,C2,G,K,T. ∀f,L,W,U. - ⬇*[Ⓕ, f] L ≘ K → ⬆*[f] T ≘ U → C1 G L W → C2 G L (ⓐW.U). + ⬇*[Ⓕ,f] L ≘ K → ⬆*[f] T ≘ U → C1 G L W → C2 G L (ⓐW.U). (* the reducibility candidate associated to an atomic arity *) rec definition acr (RP:candidate) (A:aarity) on A: candidate ≝ @@ -99,12 +95,14 @@ qed-. (* Basic_1: was: sc3_sn3 sc3_abst sc3_appl sc3_abbr sc3_bind sc3_cast *) +(* Note: one sort must exist *) lemma acr_gcr: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → ∀A. gcr RR RS RP (acr RP A). #RR #RS #RP #H1RP #H2RP #A elim A -A // #B #A #IHB #IHA @mk_gcr [ #G #L #T #H - elim (cp1 … H1RP G L) #s #HK + 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 /3 width=6 by s1, cp3, drops_refl, lifts_refl/ @@ -117,11 +115,6 @@ lemma acr_gcr: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → elim (lifts_inv_flat1 … H0) -H0 #U0 #X #HU0 #HX #H destruct elim (lifts_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT0 #H destruct @(s3 … IHA … (V0⨮V0s)) /5 width=6 by lifts_applv, lifts_flat, lifts_bind/ -| #G #L #Vs #HVs #s #f #L0 #V0 #X #HL0 #H #HB - elim (lifts_inv_applv1 … H) -H #V0s #X0 #HV0s #H0 #H destruct - >(lifts_inv_sort1 … H0) -X0 - lapply (s1 … IHB … HB) #HV0 - @(s4 … IHA … (V0⨮V0s)) /3 width=7 by gcp2_all, conj/ | #I #G #L #K #Vs #V1 #V2 #i #HA #HV12 #HLK #f #L0 #V0 #X #HL0 #H #HB elim (lifts_inv_applv1 … H) -H #V0s #X0 #HV0s #H0 #H destruct elim (lifts_inv_lref1 … H0) -H0 #j #Hf #H destruct @@ -155,11 +148,11 @@ lemma acr_gcr: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → qed. lemma acr_abst: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → - ∀p,G,L,W,T,A,B. ⦃G, L, W⦄ ϵ[RP] 〚B〛 → ( - ∀b,f,L0,V0,W0,T0. ⬇*[b, f] L0 ≘ L → ⬆*[f] W ≘ W0 → ⬆*[⫯f] T ≘ T0 → - ⦃G, L0, V0⦄ ϵ[RP] 〚B〛 → ⦃G, L0, W0⦄ ϵ[RP] 〚B〛 → ⦃G, L0.ⓓⓝW0.V0, T0⦄ ϵ[RP] 〚A〛 + ∀p,G,L,W,T,A,B. ⦃G,L,W⦄ ϵ[RP] 〚B〛 → ( + ∀b,f,L0,V0,W0,T0. ⬇*[b,f] L0 ≘ L → ⬆*[f] W ≘ W0 → ⬆*[⫯f] T ≘ T0 → + ⦃G,L0,V0⦄ ϵ[RP] 〚B〛 → ⦃G,L0,W0⦄ ϵ[RP] 〚B〛 → ⦃G,L0.ⓓⓝW0.V0,T0⦄ ϵ[RP] 〚A〛 ) → - ⦃G, L, ⓛ{p}W.T⦄ ϵ[RP] 〚②B.A〛. + ⦃G,L,ⓛ{p}W.T⦄ ϵ[RP] 〚②B.A〛. #RR #RS #RP #H1RP #H2RP #p #G #L #W #T #A #B #HW #HA #f #L0 #V0 #X #HL0 #H #HB lapply (acr_gcr … H1RP H2RP A) #HCA lapply (acr_gcr … H1RP H2RP B) #HCB diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsuba.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsuba.ma index 7277086ac..9f8404cd0 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsuba.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsuba.ma @@ -20,7 +20,7 @@ include "static_2/static/aaa.ma". inductive lsuba (G:genv): relation lenv ≝ | lsuba_atom: lsuba G (⋆) (⋆) | lsuba_bind: ∀I,L1,L2. lsuba G L1 L2 → lsuba G (L1.ⓘ{I}) (L2.ⓘ{I}) -| lsuba_beta: ∀L1,L2,W,V,A. ⦃G, L1⦄ ⊢ ⓝW.V ⁝ A → ⦃G, L2⦄ ⊢ W ⁝ A → +| lsuba_beta: ∀L1,L2,W,V,A. ⦃G,L1⦄ ⊢ ⓝW.V ⁝ A → ⦃G,L2⦄ ⊢ W ⁝ A → lsuba G L1 L2 → lsuba G (L1.ⓓⓝW.V) (L2.ⓛW) . @@ -43,7 +43,7 @@ lemma lsuba_inv_atom1: ∀G,L2. G ⊢ ⋆ ⫃⁝ L2 → L2 = ⋆. fact lsuba_inv_bind1_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K1. L1 = K1.ⓘ{I} → (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓘ{I}) ∨ - ∃∃K2,W,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & + ∃∃K2,W,V,A. ⦃G,K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW. #G #L1 #L2 * -L1 -L2 [ #J #K1 #H destruct @@ -54,7 +54,7 @@ qed-. lemma lsuba_inv_bind1: ∀I,G,K1,L2. G ⊢ K1.ⓘ{I} ⫃⁝ L2 → (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓘ{I}) ∨ - ∃∃K2,W,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 & + ∃∃K2,W,V,A. ⦃G,K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW. /2 width=3 by lsuba_inv_bind1_aux/ qed-. @@ -71,7 +71,7 @@ lemma lsubc_inv_atom2: ∀G,L1. G ⊢ L1 ⫃⁝ ⋆ → L1 = ⋆. fact lsuba_inv_bind2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K2. L2 = K2.ⓘ{I} → (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓘ{I}) ∨ - ∃∃K1,V,W, A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & + ∃∃K1,V,W,A. ⦃G,K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V. #G #L1 #L2 * -L1 -L2 [ #J #K2 #H destruct @@ -82,7 +82,7 @@ qed-. lemma lsuba_inv_bind2: ∀I,G,L1,K2. G ⊢ L1 ⫃⁝ K2.ⓘ{I} → (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓘ{I}) ∨ - ∃∃K1,V,W,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 & + ∃∃K1,V,W,A. ⦃G,K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V. /2 width=3 by lsuba_inv_bind2_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsuba_aaa.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsuba_aaa.ma index d03aecd11..9a42e6bf9 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsuba_aaa.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsuba_aaa.ma @@ -19,8 +19,8 @@ include "static_2/static/lsuba.ma". (* Properties with atomic arity assignment **********************************) -lemma lsuba_aaa_conf: ∀G,L1,V,A. ⦃G, L1⦄ ⊢ V ⁝ A → - ∀L2. G ⊢ L1 ⫃⁝ L2 → ⦃G, L2⦄ ⊢ V ⁝ A. +lemma lsuba_aaa_conf: ∀G,L1,V,A. ⦃G,L1⦄ ⊢ V ⁝ A → + ∀L2. G ⊢ L1 ⫃⁝ L2 → ⦃G,L2⦄ ⊢ V ⁝ A. #G #L1 #V #A #H elim H -G -L1 -V -A [ // | #I #G #L1 #V #A #HA #IH #L2 #H @@ -36,8 +36,8 @@ lemma lsuba_aaa_conf: ∀G,L1,V,A. ⦃G, L1⦄ ⊢ V ⁝ A → ] qed-. -lemma lsuba_aaa_trans: ∀G,L2,V,A. ⦃G, L2⦄ ⊢ V ⁝ A → - ∀L1. G ⊢ L1 ⫃⁝ L2 → ⦃G, L1⦄ ⊢ V ⁝ A. +lemma lsuba_aaa_trans: ∀G,L2,V,A. ⦃G,L2⦄ ⊢ V ⁝ A → + ∀L1. G ⊢ L1 ⫃⁝ L2 → ⦃G,L1⦄ ⊢ V ⁝ A. #G #L2 #V #A #H elim H -G -L2 -V -A [ // | #I #G #L2 #V #A #HA #IH #L1 #H diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsuba_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsuba_drops.ma index bfec752e7..86d3a1bb9 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsuba_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsuba_drops.ma @@ -22,8 +22,8 @@ include "static_2/static/lsuba.ma". (* Note: the premise 𝐔⦃f⦄ cannot be removed *) (* Basic_2A1: includes: lsuba_drop_O1_conf *) lemma lsuba_drops_conf_isuni: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → - ∀b,f,K1. 𝐔⦃f⦄ → ⬇*[b, f] L1 ≘ K1 → - ∃∃K2. G ⊢ K1 ⫃⁝ K2 & ⬇*[b, f] L2 ≘ K2. + ∀b,f,K1. 𝐔⦃f⦄ → ⬇*[b,f] L1 ≘ K1 → + ∃∃K2. G ⊢ K1 ⫃⁝ K2 & ⬇*[b,f] L2 ≘ K2. #G #L1 #L2 #H elim H -L1 -L2 [ /2 width=3 by ex2_intro/ | #I #L1 #L2 #HL12 #IH #b #f #K1 #Hf #H @@ -46,8 +46,8 @@ qed-. (* Note: the premise 𝐔⦃f⦄ cannot be removed *) (* Basic_2A1: includes: lsuba_drop_O1_trans *) lemma lsuba_drops_trans_isuni: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → - ∀b,f,K2. 𝐔⦃f⦄ → ⬇*[b, f] L2 ≘ K2 → - ∃∃K1. G ⊢ K1 ⫃⁝ K2 & ⬇*[b, f] L1 ≘ K1. + ∀b,f,K2. 𝐔⦃f⦄ → ⬇*[b,f] L2 ≘ K2 → + ∃∃K1. G ⊢ K1 ⫃⁝ K2 & ⬇*[b,f] L1 ≘ K1. #G #L1 #L2 #H elim H -L1 -L2 [ /2 width=3 by ex2_intro/ | #I #L1 #L2 #HL12 #IH #b #f #K2 #Hf #H diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubc.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubc.ma index d7d1c565a..3e1637e7a 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubc.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubc.ma @@ -21,7 +21,7 @@ include "static_2/static/gcp_cr.ma". inductive lsubc (RP) (G): relation lenv ≝ | lsubc_atom: lsubc RP G (⋆) (⋆) | lsubc_bind: ∀I,L1,L2. lsubc RP G L1 L2 → lsubc RP G (L1.ⓘ{I}) (L2.ⓘ{I}) -| lsubc_beta: ∀L1,L2,V,W,A. ⦃G, L1, V⦄ ϵ[RP] 〚A〛 → ⦃G, L1, W⦄ ϵ[RP] 〚A〛 → ⦃G, L2⦄ ⊢ W ⁝ A → +| lsubc_beta: ∀L1,L2,V,W,A. ⦃G,L1,V⦄ ϵ[RP] 〚A〛 → ⦃G,L1,W⦄ ϵ[RP] 〚A〛 → ⦃G,L2⦄ ⊢ W ⁝ A → lsubc RP G L1 L2 → lsubc RP G (L1. ⓓⓝW.V) (L2.ⓛW) . @@ -45,7 +45,7 @@ lemma lsubc_inv_atom1: ∀RP,G,L2. G ⊢ ⋆ ⫃[RP] L2 → L2 = ⋆. fact lsubc_inv_bind1_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K1. L1 = K1.ⓘ{I} → (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ{I}) ∨ - ∃∃K2,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A & + ∃∃K2,V,W,A. ⦃G,K1,V⦄ ϵ[RP] 〚A〛 & ⦃G,K1,W⦄ ϵ[RP] 〚A〛 & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃[RP] K2 & L2 = K2. ⓛW & I = BPair Abbr (ⓝW.V). #RP #G #L1 #L2 * -L1 -L2 @@ -59,7 +59,7 @@ qed-. (* Basic_1: was: csubc_gen_head_r *) lemma lsubc_inv_bind1: ∀RP,I,G,K1,L2. G ⊢ K1.ⓘ{I} ⫃[RP] L2 → (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ{I}) ∨ - ∃∃K2,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A & + ∃∃K2,V,W,A. ⦃G,K1,V⦄ ϵ[RP] 〚A〛 & ⦃G,K1,W⦄ ϵ[RP] 〚A〛 & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓛW & I = BPair Abbr (ⓝW.V). /2 width=3 by lsubc_inv_bind1_aux/ qed-. @@ -78,7 +78,7 @@ lemma lsubc_inv_atom2: ∀RP,G,L1. G ⊢ L1 ⫃[RP] ⋆ → L1 = ⋆. fact lsubc_inv_bind2_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K2. L2 = K2.ⓘ{I} → (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1. ⓘ{I}) ∨ - ∃∃K1,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A & + ∃∃K1,V,W,A. ⦃G,K1,V⦄ ϵ[RP] 〚A〛 & ⦃G,K1,W⦄ ϵ[RP] 〚A〛 & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃[RP] K2 & L1 = K1.ⓓⓝW.V & I = BPair Abst W. #RP #G #L1 #L2 * -L1 -L2 @@ -92,7 +92,7 @@ qed-. (* Basic_1: was just: csubc_gen_head_l *) lemma lsubc_inv_bind2: ∀RP,I,G,L1,K2. G ⊢ L1 ⫃[RP] K2.ⓘ{I} → (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1.ⓘ{I}) ∨ - ∃∃K1,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A & + ∃∃K1,V,W,A. ⦃G,K1,V⦄ ϵ[RP] 〚A〛 & ⦃G,K1,W⦄ ϵ[RP] 〚A〛 & ⦃G,K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃[RP] K2 & L1 = K1.ⓓⓝW.V & I = BPair Abst W. /2 width=3 by lsubc_inv_bind2_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubc_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubc_drops.ma index 9fe4888bf..c4f586513 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubc_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubc_drops.ma @@ -23,8 +23,8 @@ include "static_2/static/lsubc.ma". (* Basic_1: includes: csubc_drop_conf_O *) (* Basic_2A1: includes: lsubc_drop_O1_trans *) lemma lsubc_drops_trans_isuni: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → - ∀b,f,K2. 𝐔⦃f⦄ → ⬇*[b, f] L2 ≘ K2 → - ∃∃K1. ⬇*[b, f] L1 ≘ K1 & G ⊢ K1 ⫃[RP] K2. + ∀b,f,K2. 𝐔⦃f⦄ → ⬇*[b,f] L2 ≘ K2 → + ∃∃K1. ⬇*[b,f] L1 ≘ K1 & G ⊢ K1 ⫃[RP] K2. #RP #G #L1 #L2 #H elim H -L1 -L2 [ /2 width=3 by ex2_intro/ | #I #L1 #L2 #HL12 #IH #b #f #K2 #Hf #H @@ -48,8 +48,8 @@ qed-. (* Basic_1: includes: csubc_drop_conf_rev *) (* Basic_2A1: includes: drop_lsubc_trans *) lemma drops_lsubc_trans: ∀RR,RS,RP. gcp RR RS RP → - ∀b,f,G,L1,K1. ⬇*[b, f] L1 ≘ K1 → ∀K2. G ⊢ K1 ⫃[RP] K2 → - ∃∃L2. G ⊢ L1 ⫃[RP] L2 & ⬇*[b, f] L2 ≘ K2. + ∀b,f,G,L1,K1. ⬇*[b,f] L1 ≘ K1 → ∀K2. G ⊢ K1 ⫃[RP] K2 → + ∃∃L2. G ⊢ L1 ⫃[RP] L2 & ⬇*[b,f] L2 ≘ K2. #RR #RS #RP #HR #b #f #G #L1 #K1 #H elim H -f -L1 -K1 [ #f #Hf #Y #H lapply (lsubc_inv_atom1 … H) -H #H destruct /4 width=3 by lsubc_atom, drops_atom, ex2_intro/ diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubf.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubf.ma index 3c69f7f52..e2ac985dc 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubf.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubf.ma @@ -24,9 +24,9 @@ inductive lsubf: relation4 lenv rtmap lenv rtmap ≝ lsubf (L1.ⓘ{I1}) (⫯f1) (L2.ⓘ{I2}) (⫯f2) | lsubf_bind: ∀f1,f2,I,L1,L2. lsubf L1 f1 L2 f2 → lsubf (L1.ⓘ{I}) (↑f1) (L2.ⓘ{I}) (↑f2) -| lsubf_beta: ∀f,f0,f1,f2,L1,L2,W,V. L1 ⊢ 𝐅*⦃V⦄ ≘ f → f0 ⋓ f ≘ f1 → +| lsubf_beta: ∀f,f0,f1,f2,L1,L2,W,V. L1 ⊢ 𝐅+⦃V⦄ ≘ f → f0 ⋓ f ≘ f1 → lsubf L1 f0 L2 f2 → lsubf (L1.ⓓⓝW.V) (↑f1) (L2.ⓛW) (↑f2) -| lsubf_unit: ∀f,f0,f1,f2,I1,I2,L1,L2,V. L1 ⊢ 𝐅*⦃V⦄ ≘ f → f0 ⋓ f ≘ f1 → +| lsubf_unit: ∀f,f0,f1,f2,I1,I2,L1,L2,V. L1 ⊢ 𝐅+⦃V⦄ ≘ f → f0 ⋓ f ≘ f1 → lsubf L1 f0 L2 f2 → lsubf (L1.ⓑ{I1}V) (↑f1) (L2.ⓤ{I2}) (↑f2) . @@ -36,8 +36,9 @@ interpretation (* Basic inversion lemmas ***************************************************) -fact lsubf_inv_atom1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → L1 = ⋆ → - f1 ≡ f2 ∧ L2 = ⋆. +fact lsubf_inv_atom1_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → L1 = ⋆ → + ∧∧ f1 ≡ f2 & L2 = ⋆. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ /2 width=1 by conj/ | #f1 #f2 #I1 #I2 #L1 #L2 #_ #H destruct @@ -47,12 +48,13 @@ fact lsubf_inv_atom1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_atom1: ∀f1,f2,L2. ⦃⋆, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → f1 ≡ f2 ∧ L2 = ⋆. +lemma lsubf_inv_atom1: ∀f1,f2,L2. ⦃⋆,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → ∧∧ f1 ≡ f2 & L2 = ⋆. /2 width=3 by lsubf_inv_atom1_aux/ qed-. -fact lsubf_inv_push1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∀g1,I1,K1. f1 = ⫯g1 → L1 = K1.ⓘ{I1} → - ∃∃g2,I2,K2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ⫯g2 & L2 = K2.ⓘ{I2}. +fact lsubf_inv_push1_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∀g1,I1,K1. f1 = ⫯g1 → L1 = K1.ⓘ{I1} → + ∃∃g2,I2,K2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ⫯g2 & L2 = K2.ⓘ{I2}. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ #f1 #f2 #_ #g1 #J1 #K1 #_ #H destruct | #f1 #f2 #I1 #I2 #L1 #L2 #H12 #g1 #J1 #K1 #H1 #H2 destruct @@ -63,19 +65,20 @@ fact lsubf_inv_push1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_push1: ∀g1,f2,I1,K1,L2. ⦃K1.ⓘ{I1}, ⫯g1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∃∃g2,I2,K2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ⫯g2 & L2 = K2.ⓘ{I2}. +lemma lsubf_inv_push1: + ∀g1,f2,I1,K1,L2. ⦃K1.ⓘ{I1},⫯g1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∃∃g2,I2,K2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ⫯g2 & L2 = K2.ⓘ{I2}. /2 width=6 by lsubf_inv_push1_aux/ qed-. -fact lsubf_inv_pair1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∀g1,I,K1,X. f1 = ↑g1 → L1 = K1.ⓑ{I}X → - ∨∨ ∃∃g2,K2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ↑g2 & L2 = K2.ⓑ{I}X - | ∃∃g,g0,g2,K2,W,V. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & - I = Abbr & X = ⓝW.V & L2 = K2.ⓛW - | ∃∃g,g0,g2,J,K2. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃X⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & - L2 = K2.ⓤ{J}. +fact lsubf_inv_pair1_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∀g1,I,K1,X. f1 = ↑g1 → L1 = K1.ⓑ{I}X → + ∨∨ ∃∃g2,K2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ↑g2 & L2 = K2.ⓑ{I}X + | ∃∃g,g0,g2,K2,W,V. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & + I = Abbr & X = ⓝW.V & L2 = K2.ⓛW + | ∃∃g,g0,g2,J,K2. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃X⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & L2 = K2.ⓤ{J}. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ #f1 #f2 #_ #g1 #J #K1 #X #_ #H destruct | #f1 #f2 #I1 #I2 #L1 #L2 #H12 #g1 #J #K1 #X #H elim (discr_push_next … H) @@ -88,19 +91,20 @@ fact lsubf_inv_pair1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_pair1: ∀g1,f2,I,K1,L2,X. ⦃K1.ⓑ{I}X, ↑g1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∨∨ ∃∃g2,K2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ↑g2 & L2 = K2.ⓑ{I}X - | ∃∃g,g0,g2,K2,W,V. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & - I = Abbr & X = ⓝW.V & L2 = K2.ⓛW - | ∃∃g,g0,g2,J,K2. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃X⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & - L2 = K2.ⓤ{J}. +lemma lsubf_inv_pair1: + ∀g1,f2,I,K1,L2,X. ⦃K1.ⓑ{I}X,↑g1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∨∨ ∃∃g2,K2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ↑g2 & L2 = K2.ⓑ{I}X + | ∃∃g,g0,g2,K2,W,V. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & + I = Abbr & X = ⓝW.V & L2 = K2.ⓛW + | ∃∃g,g0,g2,J,K2. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃X⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2 & L2 = K2.ⓤ{J}. /2 width=5 by lsubf_inv_pair1_aux/ qed-. -fact lsubf_inv_unit1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∀g1,I,K1. f1 = ↑g1 → L1 = K1.ⓤ{I} → - ∃∃g2,K2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ↑g2 & L2 = K2.ⓤ{I}. +fact lsubf_inv_unit1_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∀g1,I,K1. f1 = ↑g1 → L1 = K1.ⓤ{I} → + ∃∃g2,K2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ↑g2 & L2 = K2.ⓤ{I}. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ #f1 #f2 #_ #g1 #J #K1 #_ #H destruct | #f1 #f2 #I1 #I2 #L1 #L2 #H12 #g1 #J #K1 #H elim (discr_push_next … H) @@ -111,12 +115,14 @@ fact lsubf_inv_unit1_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_unit1: ∀g1,f2,I,K1,L2. ⦃K1.ⓤ{I}, ↑g1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∃∃g2,K2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ↑g2 & L2 = K2.ⓤ{I}. +lemma lsubf_inv_unit1: + ∀g1,f2,I,K1,L2. ⦃K1.ⓤ{I},↑g1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∃∃g2,K2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ↑g2 & L2 = K2.ⓤ{I}. /2 width=5 by lsubf_inv_unit1_aux/ qed-. -fact lsubf_inv_atom2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → L2 = ⋆ → - f1 ≡ f2 ∧ L1 = ⋆. +fact lsubf_inv_atom2_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → L2 = ⋆ → + ∧∧ f1 ≡ f2 & L1 = ⋆. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ /2 width=1 by conj/ | #f1 #f2 #I1 #I2 #L1 #L2 #_ #H destruct @@ -126,12 +132,13 @@ fact lsubf_inv_atom2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_atom2: ∀f1,f2,L1. ⦃L1, f1⦄ ⫃𝐅* ⦃⋆, f2⦄ → f1 ≡ f2 ∧ L1 = ⋆. +lemma lsubf_inv_atom2: ∀f1,f2,L1. ⦃L1,f1⦄ ⫃𝐅+ ⦃⋆,f2⦄ → ∧∧f1 ≡ f2 & L1 = ⋆. /2 width=3 by lsubf_inv_atom2_aux/ qed-. -fact lsubf_inv_push2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∀g2,I2,K2. f2 = ⫯g2 → L2 = K2.ⓘ{I2} → - ∃∃g1,I1,K1. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f1 = ⫯g1 & L1 = K1.ⓘ{I1}. +fact lsubf_inv_push2_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∀g2,I2,K2. f2 = ⫯g2 → L2 = K2.ⓘ{I2} → + ∃∃g1,I1,K1. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f1 = ⫯g1 & L1 = K1.ⓘ{I1}. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ #f1 #f2 #_ #g2 #J2 #K2 #_ #H destruct | #f1 #f2 #I1 #I2 #L1 #L2 #H12 #g2 #J2 #K2 #H1 #H2 destruct @@ -142,16 +149,18 @@ fact lsubf_inv_push2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_push2: ∀f1,g2,I2,L1,K2. ⦃L1, f1⦄ ⫃𝐅* ⦃K2.ⓘ{I2}, ⫯g2⦄ → - ∃∃g1,I1,K1. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f1 = ⫯g1 & L1 = K1.ⓘ{I1}. +lemma lsubf_inv_push2: + ∀f1,g2,I2,L1,K2. ⦃L1,f1⦄ ⫃𝐅+ ⦃K2.ⓘ{I2},⫯g2⦄ → + ∃∃g1,I1,K1. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f1 = ⫯g1 & L1 = K1.ⓘ{I1}. /2 width=6 by lsubf_inv_push2_aux/ qed-. -fact lsubf_inv_pair2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∀g2,I,K2,W. f2 = ↑g2 → L2 = K2.ⓑ{I}W → - ∨∨ ∃∃g1,K1. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f1 = ↑g1 & L1 = K1.ⓑ{I}W - | ∃∃g,g0,g1,K1,V. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & - I = Abst & L1 = K1.ⓓⓝW.V. +fact lsubf_inv_pair2_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∀g2,I,K2,W. f2 = ↑g2 → L2 = K2.ⓑ{I}W → + ∨∨ ∃∃g1,K1. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f1 = ↑g1 & L1 = K1.ⓑ{I}W + | ∃∃g,g0,g1,K1,V. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & + I = Abst & L1 = K1.ⓓⓝW.V. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ #f1 #f2 #_ #g2 #J #K2 #X #_ #H destruct | #f1 #f2 #I1 #I2 #L1 #L2 #H12 #g2 #J #K2 #X #H elim (discr_push_next … H) @@ -163,19 +172,20 @@ fact lsubf_inv_pair2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_pair2: ∀f1,g2,I,L1,K2,W. ⦃L1, f1⦄ ⫃𝐅* ⦃K2.ⓑ{I}W, ↑g2⦄ → - ∨∨ ∃∃g1,K1. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f1 = ↑g1 & L1 = K1.ⓑ{I}W - | ∃∃g,g0,g1,K1,V. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & - I = Abst & L1 = K1.ⓓⓝW.V. +lemma lsubf_inv_pair2: + ∀f1,g2,I,L1,K2,W. ⦃L1,f1⦄ ⫃𝐅+ ⦃K2.ⓑ{I}W,↑g2⦄ → + ∨∨ ∃∃g1,K1. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f1 = ↑g1 & L1 = K1.ⓑ{I}W + | ∃∃g,g0,g1,K1,V. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & + I = Abst & L1 = K1.ⓓⓝW.V. /2 width=5 by lsubf_inv_pair2_aux/ qed-. -fact lsubf_inv_unit2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∀g2,I,K2. f2 = ↑g2 → L2 = K2.ⓤ{I} → - ∨∨ ∃∃g1,K1. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f1 = ↑g1 & L1 = K1.ⓤ{I} - | ∃∃g,g0,g1,J,K1,V. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & - L1 = K1.ⓑ{J}V. +fact lsubf_inv_unit2_aux: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∀g2,I,K2. f2 = ↑g2 → L2 = K2.ⓤ{I} → + ∨∨ ∃∃g1,K1. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f1 = ↑g1 & L1 = K1.ⓤ{I} + | ∃∃g,g0,g1,J,K1,V. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & L1 = K1.ⓑ{J}V. #f1 #f2 #L1 #L2 * -f1 -f2 -L1 -L2 [ #f1 #f2 #_ #g2 #J #K2 #_ #H destruct | #f1 #f2 #I1 #I2 #L1 #L2 #H12 #g2 #J #K2 #H elim (discr_push_next … H) @@ -187,27 +197,29 @@ fact lsubf_inv_unit2_aux: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_inv_unit2: ∀f1,g2,I,L1,K2. ⦃L1, f1⦄ ⫃𝐅* ⦃K2.ⓤ{I}, ↑g2⦄ → - ∨∨ ∃∃g1,K1. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f1 = ↑g1 & L1 = K1.ⓤ{I} - | ∃∃g,g0,g1,J,K1,V. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & - K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & - L1 = K1.ⓑ{J}V. +lemma lsubf_inv_unit2: + ∀f1,g2,I,L1,K2. ⦃L1,f1⦄ ⫃𝐅+ ⦃K2.ⓤ{I},↑g2⦄ → + ∨∨ ∃∃g1,K1. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f1 = ↑g1 & L1 = K1.ⓤ{I} + | ∃∃g,g0,g1,J,K1,V. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & + K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f1 = ↑g1 & L1 = K1.ⓑ{J}V. /2 width=5 by lsubf_inv_unit2_aux/ qed-. (* Advanced inversion lemmas ************************************************) -lemma lsubf_inv_atom: ∀f1,f2. ⦃⋆, f1⦄ ⫃𝐅* ⦃⋆, f2⦄ → f1 ≡ f2. +lemma lsubf_inv_atom: ∀f1,f2. ⦃⋆,f1⦄ ⫃𝐅+ ⦃⋆,f2⦄ → f1 ≡ f2. #f1 #f2 #H elim (lsubf_inv_atom1 … H) -H // qed-. -lemma lsubf_inv_push_sn: ∀g1,f2,I1,I2,K1,K2. ⦃K1.ⓘ{I1}, ⫯g1⦄ ⫃𝐅* ⦃K2.ⓘ{I2}, f2⦄ → - ∃∃g2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ⫯g2. +lemma lsubf_inv_push_sn: + ∀g1,f2,I1,I2,K1,K2. ⦃K1.ⓘ{I1},⫯g1⦄ ⫃𝐅+ ⦃K2.ⓘ{I2},f2⦄ → + ∃∃g2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ⫯g2. #g1 #f2 #I #K1 #K2 #X #H elim (lsubf_inv_push1 … H) -H #g2 #I #Y #H0 #H2 #H destruct /2 width=3 by ex2_intro/ qed-. -lemma lsubf_inv_bind_sn: ∀g1,f2,I,K1,K2. ⦃K1.ⓘ{I}, ↑g1⦄ ⫃𝐅* ⦃K2.ⓘ{I}, f2⦄ → - ∃∃g2. ⦃K1, g1⦄ ⫃𝐅* ⦃K2, g2⦄ & f2 = ↑g2. +lemma lsubf_inv_bind_sn: + ∀g1,f2,I,K1,K2. ⦃K1.ⓘ{I},↑g1⦄ ⫃𝐅+ ⦃K2.ⓘ{I},f2⦄ → + ∃∃g2. ⦃K1,g1⦄ ⫃𝐅+ ⦃K2,g2⦄ & f2 = ↑g2. #g1 #f2 * #I [2: #X ] #K1 #K2 #H [ elim (lsubf_inv_pair1 … H) -H * [ #z2 #Y2 #H2 #H #H0 destruct /2 width=3 by ex2_intro/ @@ -219,8 +231,9 @@ lemma lsubf_inv_bind_sn: ∀g1,f2,I,K1,K2. ⦃K1.ⓘ{I}, ↑g1⦄ ⫃𝐅* ⦃K2 ] qed-. -lemma lsubf_inv_beta_sn: ∀g1,f2,K1,K2,V,W. ⦃K1.ⓓⓝW.V, ↑g1⦄ ⫃𝐅* ⦃K2.ⓛW, f2⦄ → - ∃∃g,g0,g2. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2. +lemma lsubf_inv_beta_sn: + ∀g1,f2,K1,K2,V,W. ⦃K1.ⓓⓝW.V,↑g1⦄ ⫃𝐅+ ⦃K2.ⓛW,f2⦄ → + ∃∃g,g0,g2. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2. #g1 #f2 #K1 #K2 #V #W #H elim (lsubf_inv_pair1 … H) -H * [ #z2 #Y2 #_ #_ #H destruct | #z #z0 #z2 #Y2 #X0 #X #H02 #Hz #Hg1 #H #_ #H0 #H1 destruct @@ -229,8 +242,9 @@ lemma lsubf_inv_beta_sn: ∀g1,f2,K1,K2,V,W. ⦃K1.ⓓⓝW.V, ↑g1⦄ ⫃𝐅* ] qed-. -lemma lsubf_inv_unit_sn: ∀g1,f2,I,J,K1,K2,V. ⦃K1.ⓑ{I}V, ↑g1⦄ ⫃𝐅* ⦃K2.ⓤ{J}, f2⦄ → - ∃∃g,g0,g2. ⦃K1, g0⦄ ⫃𝐅* ⦃K2, g2⦄ & K1 ⊢ 𝐅*⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2. +lemma lsubf_inv_unit_sn: + ∀g1,f2,I,J,K1,K2,V. ⦃K1.ⓑ{I}V,↑g1⦄ ⫃𝐅+ ⦃K2.ⓤ{J},f2⦄ → + ∃∃g,g0,g2. ⦃K1,g0⦄ ⫃𝐅+ ⦃K2,g2⦄ & K1 ⊢ 𝐅+⦃V⦄ ≘ g & g0 ⋓ g ≘ g1 & f2 = ↑g2. #g1 #f2 #I #J #K1 #K2 #V #H elim (lsubf_inv_pair1 … H) -H * [ #z2 #Y2 #_ #_ #H destruct | #z #z0 #z2 #Y2 #X0 #X #_ #_ #_ #_ #_ #_ #H destruct @@ -239,7 +253,7 @@ lemma lsubf_inv_unit_sn: ∀g1,f2,I,J,K1,K2,V. ⦃K1.ⓑ{I}V, ↑g1⦄ ⫃𝐅* ] qed-. -lemma lsubf_inv_refl: ∀L,f1,f2. ⦃L,f1⦄ ⫃𝐅* ⦃L,f2⦄ → f1 ≡ f2. +lemma lsubf_inv_refl: ∀L,f1,f2. ⦃L,f1⦄ ⫃𝐅+ ⦃L,f2⦄ → f1 ≡ f2. #L elim L -L /2 width=1 by lsubf_inv_atom/ #L #I #IH #f1 #f2 #H12 elim (pn_split f1) * #g1 #H destruct @@ -249,15 +263,15 @@ qed-. (* Basic forward lemmas *****************************************************) -lemma lsubf_fwd_bind_tl: ∀f1,f2,I,L1,L2. - ⦃L1.ⓘ{I}, f1⦄ ⫃𝐅* ⦃L2.ⓘ{I}, f2⦄ → ⦃L1, ⫱f1⦄ ⫃𝐅* ⦃L2, ⫱f2⦄. +lemma lsubf_fwd_bind_tl: + ∀f1,f2,I,L1,L2. ⦃L1.ⓘ{I},f1⦄ ⫃𝐅+ ⦃L2.ⓘ{I},f2⦄ → ⦃L1,⫱f1⦄ ⫃𝐅+ ⦃L2,⫱f2⦄. #f1 #f2 #I #L1 #L2 #H elim (pn_split f1) * #g1 #H0 destruct [ elim (lsubf_inv_push_sn … H) | elim (lsubf_inv_bind_sn … H) ] -H #g2 #H12 #H destruct // qed-. -lemma lsubf_fwd_isid_dx: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → 𝐈⦃f2⦄ → 𝐈⦃f1⦄. +lemma lsubf_fwd_isid_dx: ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → 𝐈⦃f2⦄ → 𝐈⦃f1⦄. #f1 #f2 #L1 #L2 #H elim H -f1 -f2 -L1 -L2 [ /2 width=3 by isid_eq_repl_fwd/ | /4 width=3 by isid_inv_push, isid_push/ @@ -267,7 +281,7 @@ lemma lsubf_fwd_isid_dx: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_fwd_isid_sn: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → 𝐈⦃f1⦄ → 𝐈⦃f2⦄. +lemma lsubf_fwd_isid_sn: ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → 𝐈⦃f1⦄ → 𝐈⦃f2⦄. #f1 #f2 #L1 #L2 #H elim H -f1 -f2 -L1 -L2 [ /2 width=3 by isid_eq_repl_back/ | /4 width=3 by isid_inv_push, isid_push/ @@ -277,22 +291,22 @@ lemma lsubf_fwd_isid_sn: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → ] qed-. -lemma lsubf_fwd_sle: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → f2 ⊆ f1. +lemma lsubf_fwd_sle: ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → f2 ⊆ f1. #f1 #f2 #L1 #L2 #H elim H -f1 -f2 -L1 -L2 /3 width=5 by sor_inv_sle_sn_trans, sle_next, sle_push, sle_refl_eq, eq_sym/ qed-. (* Basic properties *********************************************************) -axiom lsubf_eq_repl_back1: ∀f2,L1,L2. eq_repl_back … (λf1. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄). +axiom lsubf_eq_repl_back1: ∀f2,L1,L2. eq_repl_back … (λf1. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄). -lemma lsubf_eq_repl_fwd1: ∀f2,L1,L2. eq_repl_fwd … (λf1. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄). +lemma lsubf_eq_repl_fwd1: ∀f2,L1,L2. eq_repl_fwd … (λf1. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄). #f2 #L1 #L2 @eq_repl_sym /2 width=3 by lsubf_eq_repl_back1/ qed-. -axiom lsubf_eq_repl_back2: ∀f1,L1,L2. eq_repl_back … (λf2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄). +axiom lsubf_eq_repl_back2: ∀f1,L1,L2. eq_repl_back … (λf2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄). -lemma lsubf_eq_repl_fwd2: ∀f1,L1,L2. eq_repl_fwd … (λf2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄). +lemma lsubf_eq_repl_fwd2: ∀f1,L1,L2. eq_repl_fwd … (λf2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄). #f1 #L1 #L2 @eq_repl_sym /2 width=3 by lsubf_eq_repl_back2/ qed-. @@ -302,19 +316,21 @@ lemma lsubf_refl: bi_reflexive … lsubf. /2 width=1 by lsubf_push, lsubf_bind/ qed. -lemma lsubf_refl_eq: ∀f1,f2,L. f1 ≡ f2 → ⦃L, f1⦄ ⫃𝐅* ⦃L, f2⦄. +lemma lsubf_refl_eq: ∀f1,f2,L. f1 ≡ f2 → ⦃L,f1⦄ ⫃𝐅+ ⦃L,f2⦄. /2 width=3 by lsubf_eq_repl_back2/ qed. -lemma lsubf_bind_tl_dx: ∀g1,f2,I,L1,L2. ⦃L1, g1⦄ ⫃𝐅* ⦃L2, ⫱f2⦄ → - ∃∃f1. ⦃L1.ⓘ{I}, f1⦄ ⫃𝐅* ⦃L2.ⓘ{I}, f2⦄ & g1 = ⫱f1. +lemma lsubf_bind_tl_dx: + ∀g1,f2,I,L1,L2. ⦃L1,g1⦄ ⫃𝐅+ ⦃L2,⫱f2⦄ → + ∃∃f1. ⦃L1.ⓘ{I},f1⦄ ⫃𝐅+ ⦃L2.ⓘ{I},f2⦄ & g1 = ⫱f1. #g1 #f2 #I #L1 #L2 #H elim (pn_split f2) * #g2 #H2 destruct @ex2_intro [1,2,4,5: /2 width=2 by lsubf_push, lsubf_bind/ ] // (**) (* constructor needed *) qed-. -lemma lsubf_beta_tl_dx: ∀f,f0,g1,L1,V. L1 ⊢ 𝐅*⦃V⦄ ≘ f → f0 ⋓ f ≘ g1 → - ∀f2,L2,W. ⦃L1, f0⦄ ⫃𝐅* ⦃L2, ⫱f2⦄ → - ∃∃f1. ⦃L1.ⓓⓝW.V, f1⦄ ⫃𝐅* ⦃L2.ⓛW, f2⦄ & ⫱f1 ⊆ g1. +lemma lsubf_beta_tl_dx: + ∀f,f0,g1,L1,V. L1 ⊢ 𝐅+⦃V⦄ ≘ f → f0 ⋓ f ≘ g1 → + ∀f2,L2,W. ⦃L1,f0⦄ ⫃𝐅+ ⦃L2,⫱f2⦄ → + ∃∃f1. ⦃L1.ⓓⓝW.V,f1⦄ ⫃𝐅+ ⦃L2.ⓛW,f2⦄ & ⫱f1 ⊆ g1. #f #f0 #g1 #L1 #V #Hf #Hg1 #f2 elim (pn_split f2) * #x2 #H2 #L2 #W #HL12 destruct [ /3 width=4 by lsubf_push, sor_inv_sle_sn, ex2_intro/ @@ -323,9 +339,10 @@ elim (pn_split f2) * #x2 #H2 #L2 #W #HL12 destruct qed-. (* Note: this might be moved *) -lemma lsubf_inv_sor_dx: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - ∀f2l,f2r. f2l⋓f2r ≘ f2 → - ∃∃f1l,f1r. ⦃L1, f1l⦄ ⫃𝐅* ⦃L2, f2l⦄ & ⦃L1, f1r⦄ ⫃𝐅* ⦃L2, f2r⦄ & f1l⋓f1r ≘ f1. +lemma lsubf_inv_sor_dx: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → + ∀f2l,f2r. f2l⋓f2r ≘ f2 → + ∃∃f1l,f1r. ⦃L1,f1l⦄ ⫃𝐅+ ⦃L2,f2l⦄ & ⦃L1,f1r⦄ ⫃𝐅+ ⦃L2,f2r⦄ & f1l⋓f1r ≘ f1. #f1 #f2 #L1 #L2 #H elim H -f1 -f2 -L1 -L2 [ /3 width=7 by sor_eq_repl_fwd3, ex3_2_intro/ | #g1 #g2 #I1 #I2 #L1 #L2 #_ #IH #f2l #f2r #H diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubf_frees.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubf_frees.ma index 7a39036b5..963893a24 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubf_frees.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubf_frees.ma @@ -18,8 +18,9 @@ include "static_2/static/lsubf.ma". (* Properties with context-sensitive free variables *************************) -lemma lsubf_frees_trans: ∀f2,L2,T. L2 ⊢ 𝐅*⦃T⦄ ≘ f2 → - ∀f1,L1. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → L1 ⊢ 𝐅*⦃T⦄ ≘ f1. +lemma lsubf_frees_trans: + ∀f2,L2,T. L2 ⊢ 𝐅+⦃T⦄ ≘ f2 → + ∀f1,L1. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → L1 ⊢ 𝐅+⦃T⦄ ≘ f1. #f2 #L2 #T #H elim H -f2 -L2 -T [ /3 width=5 by lsubf_fwd_isid_dx, frees_sort/ | #f2 #i #Hf2 #g1 #Y1 #H diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubf.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubf.ma index 79f33abda..63173fbf7 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubf.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubf.ma @@ -19,9 +19,10 @@ include "static_2/static/lsubf.ma". (* Main properties **********************************************************) -theorem lsubf_sor: ∀K,L,g1,f1. ⦃K, g1⦄ ⫃𝐅* ⦃L, f1⦄ → - ∀g2,f2. ⦃K, g2⦄ ⫃𝐅* ⦃L, f2⦄ → - ∀g. g1 ⋓ g2 ≘ g → ∀f. f1 ⋓ f2 ≘ f → ⦃K, g⦄ ⫃𝐅* ⦃L, f⦄. +theorem lsubf_sor: + ∀K,L,g1,f1. ⦃K,g1⦄ ⫃𝐅+ ⦃L,f1⦄ → + ∀g2,f2. ⦃K,g2⦄ ⫃𝐅+ ⦃L,f2⦄ → + ∀g. g1 ⋓ g2 ≘ g → ∀f. f1 ⋓ f2 ≘ f → ⦃K,g⦄ ⫃𝐅+ ⦃L,f⦄. #K elim K -K [ #L #g1 #f1 #H1 #g2 #f2 #H2 #g #Hg #f #Hf elim (lsubf_inv_atom1 … H1) -H1 #H1 #H destruct diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubr.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubr.ma index a021ca5a4..88d2ad9ba 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubr.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubr.ma @@ -19,8 +19,8 @@ include "static_2/static/lsubf_lsubf.ma". (* Forward lemmas with restricted refinement for local environments *********) -lemma lsubf_fwd_lsubr_isdiv: ∀f1,f2,L1,L2. ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄ → - 𝛀⦃f1⦄ → 𝛀⦃f2⦄ → L1 ⫃ L2. +lemma lsubf_fwd_lsubr_isdiv: + ∀f1,f2,L1,L2. ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄ → 𝛀⦃f1⦄ → 𝛀⦃f2⦄ → L1 ⫃ L2. #f1 #f2 #L1 #L2 #H elim H -f1 -f2 -L1 -L2 /4 width=3 by lsubr_bind, isdiv_inv_next/ [ #f1 #f2 #I1 #I2 #L1 #L2 #_ #_ #H @@ -32,8 +32,8 @@ qed-. (* Properties with restricted refinement for local environments *************) -lemma lsubr_lsubf_isid: ∀L1,L2. L1 ⫃ L2 → - ∀f1,f2. 𝐈⦃f1⦄ → 𝐈⦃f2⦄ → ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄. +lemma lsubr_lsubf_isid: + ∀L1,L2. L1 ⫃ L2 → ∀f1,f2. 𝐈⦃f1⦄ → 𝐈⦃f2⦄ → ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄. #L1 #L2 #H elim H -L1 -L2 [ /3 width=1 by lsubf_atom, isid_inv_eq_repl/ | #I #L1 #L2 | #L1 #L2 #V #W | #I1 #I2 #L1 #L2 #V @@ -44,8 +44,9 @@ elim (isid_inv_gen … Hf2) -Hf2 #g2 #Hg2 #H destruct /3 width=1 by lsubf_push/ qed. -lemma lsubr_lsubf: ∀f2,L2,T. L2 ⊢ 𝐅*⦃T⦄ ≘ f2 → ∀L1. L1 ⫃ L2 → - ∀f1. L1 ⊢ 𝐅*⦃T⦄ ≘ f1 → ⦃L1, f1⦄ ⫃𝐅* ⦃L2, f2⦄. +lemma lsubr_lsubf: + ∀f2,L2,T. L2 ⊢ 𝐅+⦃T⦄ ≘ f2 → ∀L1. L1 ⫃ L2 → + ∀f1. L1 ⊢ 𝐅+⦃T⦄ ≘ f1 → ⦃L1,f1⦄ ⫃𝐅+ ⦃L2,f2⦄. #f2 #L2 #T #H elim H -f2 -L2 -T [ #f2 #L2 #s #Hf2 #L1 #HL12 #f1 #Hf1 lapply (frees_inv_sort … Hf1) -Hf1 /2 width=1 by lsubr_lsubf_isid/ diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubr.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubr.ma index 5ec8a33f1..5ff763dcb 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubr.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubr.ma @@ -49,12 +49,11 @@ qed-. lemma lsubr_inv_atom1: ∀L2. ⋆ ⫃ L2 → L2 = ⋆. /2 width=3 by lsubr_inv_atom1_aux/ qed-. -fact lsubr_inv_bind1_aux: ∀L1,L2. L1 ⫃ L2 → ∀I,K1. L1 = K1.ⓘ{I} → - ∨∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓘ{I} - | ∃∃K2,V,W. K1 ⫃ K2 & L2 = K2.ⓛW & - I = BPair Abbr (ⓝW.V) - | ∃∃J1,J2,K2,V. K1 ⫃ K2 & L2 = K2.ⓤ{J2} & - I = BPair J1 V. +fact lsubr_inv_bind1_aux: + ∀L1,L2. L1 ⫃ L2 → ∀I,K1. L1 = K1.ⓘ{I} → + ∨∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓘ{I} + | ∃∃K2,V,W. K1 ⫃ K2 & L2 = K2.ⓛW & I = BPair Abbr (ⓝW.V) + | ∃∃J1,J2,K2,V. K1 ⫃ K2 & L2 = K2.ⓤ{J2} & I = BPair J1 V. #L1 #L2 * -L1 -L2 [ #J #K1 #H destruct | #I #L1 #L2 #HL12 #J #K1 #H destruct /3 width=3 by or3_intro0, ex2_intro/ @@ -64,12 +63,11 @@ fact lsubr_inv_bind1_aux: ∀L1,L2. L1 ⫃ L2 → ∀I,K1. L1 = K1.ⓘ{I} → qed-. (* Basic_2A1: uses: lsubr_inv_pair1 *) -lemma lsubr_inv_bind1: ∀I,K1,L2. K1.ⓘ{I} ⫃ L2 → - ∨∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓘ{I} - | ∃∃K2,V,W. K1 ⫃ K2 & L2 = K2.ⓛW & - I = BPair Abbr (ⓝW.V) - | ∃∃J1,J2,K2,V. K1 ⫃ K2 & L2 = K2.ⓤ{J2} & - I = BPair J1 V. +lemma lsubr_inv_bind1: + ∀I,K1,L2. K1.ⓘ{I} ⫃ L2 → + ∨∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓘ{I} + | ∃∃K2,V,W. K1 ⫃ K2 & L2 = K2.ⓛW & I = BPair Abbr (ⓝW.V) + | ∃∃J1,J2,K2,V. K1 ⫃ K2 & L2 = K2.ⓤ{J2} & I = BPair J1 V. /2 width=3 by lsubr_inv_bind1_aux/ qed-. fact lsubr_inv_atom2_aux: ∀L1,L2. L1 ⫃ L2 → L2 = ⋆ → L1 = ⋆. @@ -83,10 +81,11 @@ qed-. lemma lsubr_inv_atom2: ∀L1. L1 ⫃ ⋆ → L1 = ⋆. /2 width=3 by lsubr_inv_atom2_aux/ qed-. -fact lsubr_inv_bind2_aux: ∀L1,L2. L1 ⫃ L2 → ∀I,K2. L2 = K2.ⓘ{I} → - ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓘ{I} - | ∃∃K1,W,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V & I = BPair Abst W - | ∃∃J1,J2,K1,V. K1 ⫃ K2 & L1 = K1.ⓑ{J1}V & I = BUnit J2. +fact lsubr_inv_bind2_aux: + ∀L1,L2. L1 ⫃ L2 → ∀I,K2. L2 = K2.ⓘ{I} → + ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓘ{I} + | ∃∃K1,W,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V & I = BPair Abst W + | ∃∃J1,J2,K1,V. K1 ⫃ K2 & L1 = K1.ⓑ{J1}V & I = BUnit J2. #L1 #L2 * -L1 -L2 [ #J #K2 #H destruct | #I #L1 #L2 #HL12 #J #K2 #H destruct /3 width=3 by ex2_intro, or3_intro0/ @@ -95,82 +94,91 @@ fact lsubr_inv_bind2_aux: ∀L1,L2. L1 ⫃ L2 → ∀I,K2. L2 = K2.ⓘ{I} → ] qed-. -lemma lsubr_inv_bind2: ∀I,L1,K2. L1 ⫃ K2.ⓘ{I} → - ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓘ{I} - | ∃∃K1,W,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V & I = BPair Abst W - | ∃∃J1,J2,K1,V. K1 ⫃ K2 & L1 = K1.ⓑ{J1}V & I = BUnit J2. +lemma lsubr_inv_bind2: + ∀I,L1,K2. L1 ⫃ K2.ⓘ{I} → + ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓘ{I} + | ∃∃K1,W,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V & I = BPair Abst W + | ∃∃J1,J2,K1,V. K1 ⫃ K2 & L1 = K1.ⓑ{J1}V & I = BUnit J2. /2 width=3 by lsubr_inv_bind2_aux/ qed-. (* Advanced inversion lemmas ************************************************) -lemma lsubr_inv_abst1: ∀K1,L2,W. K1.ⓛW ⫃ L2 → - ∨∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓛW - | ∃∃I2,K2. K1 ⫃ K2 & L2 = K2.ⓤ{I2}. +lemma lsubr_inv_abst1: + ∀K1,L2,W. K1.ⓛW ⫃ L2 → + ∨∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓛW + | ∃∃I2,K2. K1 ⫃ K2 & L2 = K2.ⓤ{I2}. #K1 #L2 #W #H elim (lsubr_inv_bind1 … H) -H * /3 width=4 by ex2_2_intro, ex2_intro, or_introl, or_intror/ #K2 #V2 #W2 #_ #_ #H destruct qed-. -lemma lsubr_inv_unit1: ∀I,K1,L2. K1.ⓤ{I} ⫃ L2 → - ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓤ{I}. +lemma lsubr_inv_unit1: + ∀I,K1,L2. K1.ⓤ{I} ⫃ L2 → + ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓤ{I}. #I #K1 #L2 #H elim (lsubr_inv_bind1 … H) -H * [ #K2 #HK12 #H destruct /2 width=3 by ex2_intro/ | #K2 #V #W #_ #_ #H destruct -| #I1 #I2 #K2 #V #_ #_ #H destruct +| #J1 #J2 #K2 #V #_ #_ #H destruct ] qed-. -lemma lsubr_inv_pair2: ∀I,L1,K2,W. L1 ⫃ K2.ⓑ{I}W → - ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓑ{I}W - | ∃∃K1,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V & I = Abst. +lemma lsubr_inv_pair2: + ∀I,L1,K2,W. L1 ⫃ K2.ⓑ{I}W → + ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓑ{I}W + | ∃∃K1,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V & I = Abst. #I #L1 #K2 #W #H elim (lsubr_inv_bind2 … H) -H * [ /3 width=3 by ex2_intro, or_introl/ -| #K2 #X #V #HK12 #H1 #H2 destruct /3 width=4 by ex3_2_intro, or_intror/ -| #I1 #I1 #K2 #V #_ #_ #H destruct +| #K1 #X #V #HK12 #H1 #H2 destruct /3 width=4 by ex3_2_intro, or_intror/ +| #J1 #J1 #K1 #V #_ #_ #H destruct ] qed-. -lemma lsubr_inv_abbr2: ∀L1,K2,V. L1 ⫃ K2.ⓓV → - ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓓV. +lemma lsubr_inv_abbr2: + ∀L1,K2,V. L1 ⫃ K2.ⓓV → + ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓓV. #L1 #K2 #V #H elim (lsubr_inv_pair2 … H) -H * [ /2 width=3 by ex2_intro/ | #K1 #X #_ #_ #H destruct ] qed-. -lemma lsubr_inv_abst2: ∀L1,K2,W. L1 ⫃ K2.ⓛW → - ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓛW - | ∃∃K1,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V. +lemma lsubr_inv_abst2: + ∀L1,K2,W. L1 ⫃ K2.ⓛW → + ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓛW + | ∃∃K1,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V. #L1 #K2 #W #H elim (lsubr_inv_pair2 … H) -H * /3 width=4 by ex2_2_intro, ex2_intro, or_introl, or_intror/ qed-. -lemma lsubr_inv_unit2: ∀I,L1,K2. L1 ⫃ K2.ⓤ{I} → - ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓤ{I} - | ∃∃J,K1,V. K1 ⫃ K2 & L1 = K1.ⓑ{J}V. +lemma lsubr_inv_unit2: + ∀I,L1,K2. L1 ⫃ K2.ⓤ{I} → + ∨∨ ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓤ{I} + | ∃∃J,K1,V. K1 ⫃ K2 & L1 = K1.ⓑ{J}V. #I #L1 #K2 #H elim (lsubr_inv_bind2 … H) -H * [ /3 width=3 by ex2_intro, or_introl/ | #K1 #W #V #_ #_ #H destruct -| #I1 #I2 #K1 #V #HK12 #H1 #H2 destruct /3 width=5 by ex2_3_intro, or_intror/ +| #J1 #J2 #K1 #V #HK12 #H1 #H2 destruct /3 width=5 by ex2_3_intro, or_intror/ ] qed-. (* Basic forward lemmas *****************************************************) -lemma lsubr_fwd_bind1: ∀I1,K1,L2. K1.ⓘ{I1} ⫃ L2 → - ∃∃I2,K2. K1 ⫃ K2 & L2 = K2.ⓘ{I2}. +lemma lsubr_fwd_bind1: + ∀I1,K1,L2. K1.ⓘ{I1} ⫃ L2 → + ∃∃I2,K2. K1 ⫃ K2 & L2 = K2.ⓘ{I2}. #I1 #K1 #L2 #H elim (lsubr_inv_bind1 … H) -H * [ #K2 #HK12 #H destruct /3 width=4 by ex2_2_intro/ | #K2 #W1 #V1 #HK12 #H1 #H2 destruct /3 width=4 by ex2_2_intro/ -| #I1 #I2 #K2 #V1 #HK12 #H1 #H2 destruct /3 width=4 by ex2_2_intro/ +| #J1 #J2 #K2 #V1 #HK12 #H1 #H2 destruct /3 width=4 by ex2_2_intro/ ] qed-. -lemma lsubr_fwd_bind2: ∀I2,L1,K2. L1 ⫃ K2.ⓘ{I2} → - ∃∃I1,K1. K1 ⫃ K2 & L1 = K1.ⓘ{I1}. +lemma lsubr_fwd_bind2: + ∀I2,L1,K2. L1 ⫃ K2.ⓘ{I2} → + ∃∃I1,K1. K1 ⫃ K2 & L1 = K1.ⓘ{I1}. #I2 #L1 #K2 #H elim (lsubr_inv_bind2 … H) -H * [ #K1 #HK12 #H destruct /3 width=4 by ex2_2_intro/ | #K1 #W1 #V1 #HK12 #H1 #H2 destruct /3 width=4 by ex2_2_intro/ -| #I1 #I2 #K1 #V1 #HK12 #H1 #H2 destruct /3 width=4 by ex2_2_intro/ +| #J1 #J2 #K1 #V1 #HK12 #H1 #H2 destruct /3 width=4 by ex2_2_intro/ ] qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubr_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubr_drops.ma index 9257f34dc..ac9e9e41f 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubr_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubr_drops.ma @@ -20,11 +20,12 @@ include "static_2/static/lsubr.ma". (* Forward lemmas with generic slicing for local environments ***************) (* Basic_2A1: includes: lsubr_fwd_drop2_pair *) -lemma lsubr_fwd_drops2_bind: ∀L1,L2. L1 ⫃ L2 → - ∀b,f,I,K2. 𝐔⦃f⦄ → ⬇*[b, f] L2 ≘ K2.ⓘ{I} → - ∨∨ ∃∃K1. K1 ⫃ K2 & ⬇*[b, f] L1 ≘ K1.ⓘ{I} - | ∃∃K1,W,V. K1 ⫃ K2 & ⬇*[b, f] L1 ≘ K1.ⓓⓝW.V & I = BPair Abst W - | ∃∃J1,J2,K1,V. K1 ⫃ K2 & ⬇*[b, f] L1 ≘ K1.ⓑ{J1}V & I = BUnit J2. +lemma lsubr_fwd_drops2_bind: + ∀L1,L2. L1 ⫃ L2 → + ∀b,f,I,K2. 𝐔⦃f⦄ → ⬇*[b,f] L2 ≘ K2.ⓘ{I} → + ∨∨ ∃∃K1. K1 ⫃ K2 & ⬇*[b,f] L1 ≘ K1.ⓘ{I} + | ∃∃K1,W,V. K1 ⫃ K2 & ⬇*[b,f] L1 ≘ K1.ⓓⓝW.V & I = BPair Abst W + | ∃∃J1,J2,K1,V. K1 ⫃ K2 & ⬇*[b,f] L1 ≘ K1.ⓑ{J1}V & I = BUnit J2. #L1 #L2 #H elim H -L1 -L2 [ #b #f #I #K2 #_ #H elim (drops_inv_atom1 … H) -H #H destruct @@ -41,9 +42,10 @@ elim (drops_inv_bind1_isuni … Hf H) -Hf -H * qed-. (* Basic_2A1: includes: lsubr_fwd_drop2_abbr *) -lemma lsubr_fwd_drops2_abbr: ∀L1,L2. L1 ⫃ L2 → - ∀b,f,K2,V. 𝐔⦃f⦄ → ⬇*[b, f] L2 ≘ K2.ⓓV → - ∃∃K1. K1 ⫃ K2 & ⬇*[b, f] L1 ≘ K1.ⓓV. +lemma lsubr_fwd_drops2_abbr: + ∀L1,L2. L1 ⫃ L2 → + ∀b,f,K2,V. 𝐔⦃f⦄ → ⬇*[b,f] L2 ≘ K2.ⓓV → + ∃∃K1. K1 ⫃ K2 & ⬇*[b,f] L1 ≘ K1.ⓓV. #L1 #L2 #HL12 #b #f #K2 #V #Hf #HLK2 elim (lsubr_fwd_drops2_bind … HL12 … Hf HLK2) -L2 -Hf // * [ #K1 #W #V #_ #_ #H destruct diff --git a/matita/matita/contribs/lambdadelta/static_2/static/lsubr_lsubr.ma b/matita/matita/contribs/lambdadelta/static_2/static/lsubr_lsubr.ma index 3bf83b81e..2aba1cf65 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/lsubr_lsubr.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/lsubr_lsubr.ma @@ -21,12 +21,12 @@ include "static_2/static/lsubr.ma". theorem lsubr_trans: Transitive … lsubr. #L1 #L #H elim H -L1 -L // [ #I #L1 #L #_ #IH #X #H elim (lsubr_inv_bind1 … H) -H * - [ #L2 #HL2 #H | #L2 #V #W #HL2 #H1 #H2 | #I1 #I2 #L2 #V #Hl2 #H1 #H2 ] + [ #L2 #HL2 #H | #L2 #V #W #HL2 #H1 #H2 | #I1 #I2 #L2 #V #HL2 #H1 #H2 ] destruct /3 width=1 by lsubr_bind, lsubr_beta, lsubr_unit/ | #L1 #L #V #W #_ #IH #X #H elim (lsubr_inv_abst1 … H) -H * [ #L2 #HL2 #H | #I #L2 #HL2 #H ] destruct /3 width=1 by lsubr_beta, lsubr_unit/ | #I1 #I2 #L1 #L #V #_ #IH #X #H elim (lsubr_inv_unit1 … H) -H - /4 width=1 by lsubr_unit/ + #L2 #HL2 #H destruct /4 width=1 by lsubr_unit/ ] qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rdeq.ma b/matita/matita/contribs/lambdadelta/static_2/static/rdeq.ma index f2de0dfe6..2e155d1ee 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rdeq.ma @@ -12,30 +12,30 @@ (* *) (**************************************************************************) -include "static_2/notation/relations/stareqsn_5.ma". +include "static_2/notation/relations/stareqsn_3.ma". include "static_2/syntax/tdeq_ext.ma". include "static_2/static/rex.ma". -(* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******) +(* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***) -definition rdeq (h) (o): relation3 term lenv lenv ≝ - rex (cdeq h o). +definition rdeq: relation3 term lenv lenv ≝ + rex cdeq. interpretation - "degree-based equivalence on referred entries (local environment)" - 'StarEqSn h o T L1 L2 = (rdeq h o T L1 L2). + "sort-irrelevant equivalence on referred entries (local environment)" + 'StarEqSn T L1 L2 = (rdeq T L1 L2). interpretation - "degree-based ranged equivalence (local environment)" - 'StarEqSn h o f L1 L2 = (sex (cdeq_ext h o) cfull f L1 L2). + "sort-irrelevant ranged equivalence (local environment)" + 'StarEqSn f L1 L2 = (sex cdeq_ext cfull f L1 L2). (* Basic properties ***********************************************************) -lemma frees_tdeq_conf_rdeq (h) (o): ∀f,L1,T1. L1 ⊢ 𝐅*⦃T1⦄ ≘ f → ∀T2. T1 ≛[h, o] T2 → - ∀L2. L1 ≛[h, o, f] L2 → L2 ⊢ 𝐅*⦃T2⦄ ≘ f. -#h #o #f #L1 #T1 #H elim H -f -L1 -T1 +lemma frees_tdeq_conf_rdeq: ∀f,L1,T1. L1 ⊢ 𝐅+⦃T1⦄ ≘ f → ∀T2. T1 ≛ T2 → + ∀L2. L1 ≛[f] L2 → L2 ⊢ 𝐅+⦃T2⦄ ≘ f. +#f #L1 #T1 #H elim H -f -L1 -T1 [ #f #L1 #s1 #Hf #X #H1 #L2 #_ - elim (tdeq_inv_sort1 … H1) -H1 #s2 #d #_ #_ #H destruct + elim (tdeq_inv_sort1 … H1) -H1 #s2 #H destruct /2 width=3 by frees_sort/ | #f #i #Hf #X #H1 >(tdeq_inv_lref1 … H1) -X #Y #H2 @@ -65,130 +65,130 @@ lemma frees_tdeq_conf_rdeq (h) (o): ∀f,L1,T1. L1 ⊢ 𝐅*⦃T1⦄ ≘ f → ] qed-. -lemma frees_tdeq_conf (h) (o): ∀f,L,T1. L ⊢ 𝐅*⦃T1⦄ ≘ f → - ∀T2. T1 ≛[h, o] T2 → L ⊢ 𝐅*⦃T2⦄ ≘ f. +lemma frees_tdeq_conf: ∀f,L,T1. L ⊢ 𝐅+⦃T1⦄ ≘ f → + ∀T2. T1 ≛ T2 → L ⊢ 𝐅+⦃T2⦄ ≘ f. /4 width=7 by frees_tdeq_conf_rdeq, sex_refl, ext2_refl/ qed-. -lemma frees_rdeq_conf (h) (o): ∀f,L1,T. L1 ⊢ 𝐅*⦃T⦄ ≘ f → - ∀L2. L1 ≛[h, o, f] L2 → L2 ⊢ 𝐅*⦃T⦄ ≘ f. +lemma frees_rdeq_conf: ∀f,L1,T. L1 ⊢ 𝐅+⦃T⦄ ≘ f → + ∀L2. L1 ≛[f] L2 → L2 ⊢ 𝐅+⦃T⦄ ≘ f. /2 width=7 by frees_tdeq_conf_rdeq, tdeq_refl/ qed-. -lemma tdeq_rex_conf (R) (h) (o): s_r_confluent1 … (cdeq h o) (rex R). -#R #h #o #L1 #T1 #T2 #HT12 #L2 * +lemma tdeq_rex_conf (R): s_r_confluent1 … cdeq (rex R). +#R #L1 #T1 #T2 #HT12 #L2 * /3 width=5 by frees_tdeq_conf, ex2_intro/ qed-. -lemma tdeq_rex_div (R) (h) (o): ∀T1,T2. T1 ≛[h, o] T2 → - ∀L1,L2. L1 ⪤[R, T2] L2 → L1 ⪤[R, T1] L2. +lemma tdeq_rex_div (R): ∀T1,T2. T1 ≛ T2 → + ∀L1,L2. L1 ⪤[R,T2] L2 → L1 ⪤[R,T1] L2. /3 width=5 by tdeq_rex_conf, tdeq_sym/ qed-. -lemma tdeq_rdeq_conf (h) (o): s_r_confluent1 … (cdeq h o) (rdeq h o). +lemma tdeq_rdeq_conf: s_r_confluent1 … cdeq rdeq. /2 width=5 by tdeq_rex_conf/ qed-. -lemma tdeq_rdeq_div (h) (o): ∀T1,T2. T1 ≛[h, o] T2 → - ∀L1,L2. L1 ≛[h, o, T2] L2 → L1 ≛[h, o, T1] L2. +lemma tdeq_rdeq_div: ∀T1,T2. T1 ≛ T2 → + ∀L1,L2. L1 ≛[T2] L2 → L1 ≛[T1] L2. /2 width=5 by tdeq_rex_div/ qed-. -lemma rdeq_atom (h) (o): ∀I. ⋆ ≛[h, o, ⓪{I}] ⋆. +lemma rdeq_atom: ∀I. ⋆ ≛[⓪{I}] ⋆. /2 width=1 by rex_atom/ qed. -lemma rdeq_sort (h) (o): ∀I1,I2,L1,L2,s. - L1 ≛[h, o, ⋆s] L2 → L1.ⓘ{I1} ≛[h, o, ⋆s] L2.ⓘ{I2}. +lemma rdeq_sort: ∀I1,I2,L1,L2,s. + L1 ≛[⋆s] L2 → L1.ⓘ{I1} ≛[⋆s] L2.ⓘ{I2}. /2 width=1 by rex_sort/ qed. -lemma rdeq_pair (h) (o): ∀I,L1,L2,V1,V2. L1 ≛[h, o, V1] L2 → V1 ≛[h, o] V2 → - L1.ⓑ{I}V1 ≛[h, o, #0] L2.ⓑ{I}V2. +lemma rdeq_pair: ∀I,L1,L2,V1,V2. + L1 ≛[V1] L2 → V1 ≛ V2 → L1.ⓑ{I}V1 ≛[#0] L2.ⓑ{I}V2. /2 width=1 by rex_pair/ qed. (* -lemma rdeq_unit (h) (o): ∀f,I,L1,L2. 𝐈⦃f⦄ → L1 ⪤[cdeq_ext h o, cfull, f] L2 → - L1.ⓤ{I} ≛[h, o, #0] L2.ⓤ{I}. +lemma rdeq_unit: ∀f,I,L1,L2. 𝐈⦃f⦄ → L1 ⪤[cdeq_ext,cfull,f] L2 → + L1.ⓤ{I} ≛[#0] L2.ⓤ{I}. /2 width=3 by rex_unit/ qed. *) -lemma rdeq_lref (h) (o): ∀I1,I2,L1,L2,i. - L1 ≛[h, o, #i] L2 → L1.ⓘ{I1} ≛[h, o, #↑i] L2.ⓘ{I2}. +lemma rdeq_lref: ∀I1,I2,L1,L2,i. + L1 ≛[#i] L2 → L1.ⓘ{I1} ≛[#↑i] L2.ⓘ{I2}. /2 width=1 by rex_lref/ qed. -lemma rdeq_gref (h) (o): ∀I1,I2,L1,L2,l. - L1 ≛[h, o, §l] L2 → L1.ⓘ{I1} ≛[h, o, §l] L2.ⓘ{I2}. +lemma rdeq_gref: ∀I1,I2,L1,L2,l. + L1 ≛[§l] L2 → L1.ⓘ{I1} ≛[§l] L2.ⓘ{I2}. /2 width=1 by rex_gref/ qed. -lemma rdeq_bind_repl_dx (h) (o): ∀I,I1,L1,L2.∀T:term. - L1.ⓘ{I} ≛[h, o, T] L2.ⓘ{I1} → - ∀I2. I ≛[h, o] I2 → - L1.ⓘ{I} ≛[h, o, T] L2.ⓘ{I2}. +lemma rdeq_bind_repl_dx: ∀I,I1,L1,L2.∀T:term. + L1.ⓘ{I} ≛[T] L2.ⓘ{I1} → + ∀I2. I ≛ I2 → + L1.ⓘ{I} ≛[T] L2.ⓘ{I2}. /2 width=2 by rex_bind_repl_dx/ qed-. (* Basic inversion lemmas ***************************************************) -lemma rdeq_inv_atom_sn (h) (o): ∀Y2. ∀T:term. ⋆ ≛[h, o, T] Y2 → Y2 = ⋆. +lemma rdeq_inv_atom_sn: ∀Y2. ∀T:term. ⋆ ≛[T] Y2 → Y2 = ⋆. /2 width=3 by rex_inv_atom_sn/ qed-. -lemma rdeq_inv_atom_dx (h) (o): ∀Y1. ∀T:term. Y1 ≛[h, o, T] ⋆ → Y1 = ⋆. +lemma rdeq_inv_atom_dx: ∀Y1. ∀T:term. Y1 ≛[T] ⋆ → Y1 = ⋆. /2 width=3 by rex_inv_atom_dx/ qed-. (* -lemma rdeq_inv_zero (h) (o): ∀Y1,Y2. Y1 ≛[h, o, #0] Y2 → - ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ - | ∃∃I,L1,L2,V1,V2. L1 ≛[h, o, V1] L2 & V1 ≛[h, o] V2 & - Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2 - | ∃∃f,I,L1,L2. 𝐈⦃f⦄ & L1 ⪤[cdeq_ext h o, cfull, f] L2 & - Y1 = L1.ⓤ{I} & Y2 = L2.ⓤ{I}. -#h #o #Y1 #Y2 #H elim (rex_inv_zero … H) -H * +lemma rdeq_inv_zero: ∀Y1,Y2. Y1 ≛[#0] Y2 → + ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ + | ∃∃I,L1,L2,V1,V2. L1 ≛[V1] L2 & V1 ≛ V2 & + Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2 + | ∃∃f,I,L1,L2. 𝐈⦃f⦄ & L1 ⪤[cdeq_ext h o,cfull,f] L2 & + Y1 = L1.ⓤ{I} & Y2 = L2.ⓤ{I}. +#Y1 #Y2 #H elim (rex_inv_zero … H) -H * /3 width=9 by or3_intro0, or3_intro1, or3_intro2, ex4_5_intro, ex4_4_intro, conj/ qed-. *) -lemma rdeq_inv_lref (h) (o): ∀Y1,Y2,i. Y1 ≛[h, o, #↑i] Y2 → - ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ - | ∃∃I1,I2,L1,L2. L1 ≛[h, o, #i] L2 & - Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. +lemma rdeq_inv_lref: ∀Y1,Y2,i. Y1 ≛[#↑i] Y2 → + ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ + | ∃∃I1,I2,L1,L2. L1 ≛[#i] L2 & + Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. /2 width=1 by rex_inv_lref/ qed-. (* Basic_2A1: uses: lleq_inv_bind lleq_inv_bind_O *) -lemma rdeq_inv_bind (h) (o): ∀p,I,L1,L2,V,T. L1 ≛[h, o, ⓑ{p,I}V.T] L2 → - ∧∧ L1 ≛[h, o, V] L2 & L1.ⓑ{I}V ≛[h, o, T] L2.ⓑ{I}V. +lemma rdeq_inv_bind: ∀p,I,L1,L2,V,T. L1 ≛[ⓑ{p,I}V.T] L2 → + ∧∧ L1 ≛[V] L2 & L1.ⓑ{I}V ≛[T] L2.ⓑ{I}V. /2 width=2 by rex_inv_bind/ qed-. (* Basic_2A1: uses: lleq_inv_flat *) -lemma rdeq_inv_flat (h) (o): ∀I,L1,L2,V,T. L1 ≛[h, o, ⓕ{I}V.T] L2 → - ∧∧ L1 ≛[h, o, V] L2 & L1 ≛[h, o, T] L2. +lemma rdeq_inv_flat: ∀I,L1,L2,V,T. L1 ≛[ⓕ{I}V.T] L2 → + ∧∧ L1 ≛[V] L2 & L1 ≛[T] L2. /2 width=2 by rex_inv_flat/ qed-. (* Advanced inversion lemmas ************************************************) -lemma rdeq_inv_zero_pair_sn (h) (o): ∀I,Y2,L1,V1. L1.ⓑ{I}V1 ≛[h, o, #0] Y2 → - ∃∃L2,V2. L1 ≛[h, o, V1] L2 & V1 ≛[h, o] V2 & Y2 = L2.ⓑ{I}V2. +lemma rdeq_inv_zero_pair_sn: ∀I,Y2,L1,V1. L1.ⓑ{I}V1 ≛[#0] Y2 → + ∃∃L2,V2. L1 ≛[V1] L2 & V1 ≛ V2 & Y2 = L2.ⓑ{I}V2. /2 width=1 by rex_inv_zero_pair_sn/ qed-. -lemma rdeq_inv_zero_pair_dx (h) (o): ∀I,Y1,L2,V2. Y1 ≛[h, o, #0] L2.ⓑ{I}V2 → - ∃∃L1,V1. L1 ≛[h, o, V1] L2 & V1 ≛[h, o] V2 & Y1 = L1.ⓑ{I}V1. +lemma rdeq_inv_zero_pair_dx: ∀I,Y1,L2,V2. Y1 ≛[#0] L2.ⓑ{I}V2 → + ∃∃L1,V1. L1 ≛[V1] L2 & V1 ≛ V2 & Y1 = L1.ⓑ{I}V1. /2 width=1 by rex_inv_zero_pair_dx/ qed-. -lemma rdeq_inv_lref_bind_sn (h) (o): ∀I1,Y2,L1,i. L1.ⓘ{I1} ≛[h, o, #↑i] Y2 → - ∃∃I2,L2. L1 ≛[h, o, #i] L2 & Y2 = L2.ⓘ{I2}. +lemma rdeq_inv_lref_bind_sn: ∀I1,Y2,L1,i. L1.ⓘ{I1} ≛[#↑i] Y2 → + ∃∃I2,L2. L1 ≛[#i] L2 & Y2 = L2.ⓘ{I2}. /2 width=2 by rex_inv_lref_bind_sn/ qed-. -lemma rdeq_inv_lref_bind_dx (h) (o): ∀I2,Y1,L2,i. Y1 ≛[h, o, #↑i] L2.ⓘ{I2} → - ∃∃I1,L1. L1 ≛[h, o, #i] L2 & Y1 = L1.ⓘ{I1}. +lemma rdeq_inv_lref_bind_dx: ∀I2,Y1,L2,i. Y1 ≛[#↑i] L2.ⓘ{I2} → + ∃∃I1,L1. L1 ≛[#i] L2 & Y1 = L1.ⓘ{I1}. /2 width=2 by rex_inv_lref_bind_dx/ qed-. (* Basic forward lemmas *****************************************************) -lemma rdeq_fwd_zero_pair (h) (o): ∀I,K1,K2,V1,V2. - K1.ⓑ{I}V1 ≛[h, o, #0] K2.ⓑ{I}V2 → K1 ≛[h, o, V1] K2. +lemma rdeq_fwd_zero_pair: ∀I,K1,K2,V1,V2. + K1.ⓑ{I}V1 ≛[#0] K2.ⓑ{I}V2 → K1 ≛[V1] K2. /2 width=3 by rex_fwd_zero_pair/ qed-. (* Basic_2A1: uses: lleq_fwd_bind_sn lleq_fwd_flat_sn *) -lemma rdeq_fwd_pair_sn (h) (o): ∀I,L1,L2,V,T. L1 ≛[h, o, ②{I}V.T] L2 → L1 ≛[h, o, V] L2. +lemma rdeq_fwd_pair_sn: ∀I,L1,L2,V,T. L1 ≛[②{I}V.T] L2 → L1 ≛[V] L2. /2 width=3 by rex_fwd_pair_sn/ qed-. (* Basic_2A1: uses: lleq_fwd_bind_dx lleq_fwd_bind_O_dx *) -lemma rdeq_fwd_bind_dx (h) (o): ∀p,I,L1,L2,V,T. - L1 ≛[h, o, ⓑ{p,I}V.T] L2 → L1.ⓑ{I}V ≛[h, o, T] L2.ⓑ{I}V. +lemma rdeq_fwd_bind_dx: ∀p,I,L1,L2,V,T. + L1 ≛[ⓑ{p,I}V.T] L2 → L1.ⓑ{I}V ≛[T] L2.ⓑ{I}V. /2 width=2 by rex_fwd_bind_dx/ qed-. (* Basic_2A1: uses: lleq_fwd_flat_dx *) -lemma rdeq_fwd_flat_dx (h) (o): ∀I,L1,L2,V,T. L1 ≛[h, o, ⓕ{I}V.T] L2 → L1 ≛[h, o, T] L2. +lemma rdeq_fwd_flat_dx: ∀I,L1,L2,V,T. L1 ≛[ⓕ{I}V.T] L2 → L1 ≛[T] L2. /2 width=3 by rex_fwd_flat_dx/ qed-. -lemma rdeq_fwd_dx (h) (o): ∀I2,L1,K2. ∀T:term. L1 ≛[h, o, T] K2.ⓘ{I2} → - ∃∃I1,K1. L1 = K1.ⓘ{I1}. +lemma rdeq_fwd_dx: ∀I2,L1,K2. ∀T:term. L1 ≛[T] K2.ⓘ{I2} → + ∃∃I1,K1. L1 = K1.ⓘ{I1}. /2 width=5 by rex_fwd_dx/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_drops.ma index 825ed84d9..6246d21a2 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_drops.ma @@ -16,37 +16,37 @@ include "static_2/relocation/lifts_tdeq.ma". include "static_2/static/rex_drops.ma". include "static_2/static/rdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******) +(* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***) (* Properties with generic slicing for local environments *******************) -lemma rdeq_lifts_sn: ∀h,o. f_dedropable_sn (cdeq h o). +lemma rdeq_lifts_sn: f_dedropable_sn cdeq. /3 width=5 by rex_liftable_dedropable_sn, tdeq_lifts_sn/ qed-. (* Inversion lemmas with generic slicing for local environments *************) -lemma rdeq_inv_lifts_sn: ∀h,o. f_dropable_sn (cdeq h o). +lemma rdeq_inv_lifts_sn: f_dropable_sn cdeq. /2 width=5 by rex_dropable_sn/ qed-. -lemma rdeq_inv_lifts_dx: ∀h,o. f_dropable_dx (cdeq h o). +lemma rdeq_inv_lifts_dx: f_dropable_dx cdeq. /2 width=5 by rex_dropable_dx/ qed-. -lemma rdeq_inv_lifts_bi: ∀h,o,L1,L2,U. L1 ≛[h, o, U] L2 → ∀b,f. 𝐔⦃f⦄ → - ∀K1,K2. ⬇*[b, f] L1 ≘ K1 → ⬇*[b, f] L2 ≘ K2 → - ∀T. ⬆*[f] T ≘ U → K1 ≛[h, o, T] K2. +lemma rdeq_inv_lifts_bi: ∀L1,L2,U. L1 ≛[U] L2 → ∀b,f. 𝐔⦃f⦄ → + ∀K1,K2. ⬇*[b,f] L1 ≘ K1 → ⬇*[b,f] L2 ≘ K2 → + ∀T. ⬆*[f] T ≘ U → K1 ≛[T] K2. /2 width=10 by rex_inv_lifts_bi/ qed-. -lemma rdeq_inv_lref_pair_sn: ∀h,o,L1,L2,i. L1 ≛[h, o, #i] L2 → ∀I,K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 → - ∃∃K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 & K1 ≛[h, o, V1] K2 & V1 ≛[h, o] V2. +lemma rdeq_inv_lref_pair_sn: ∀L1,L2,i. L1 ≛[#i] L2 → ∀I,K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 → + ∃∃K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 & K1 ≛[V1] K2 & V1 ≛ V2. /2 width=3 by rex_inv_lref_pair_sn/ qed-. -lemma rdeq_inv_lref_pair_dx: ∀h,o,L1,L2,i. L1 ≛[h, o, #i] L2 → ∀I,K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 → - ∃∃K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 & K1 ≛[h, o, V1] K2 & V1 ≛[h, o] V2. +lemma rdeq_inv_lref_pair_dx: ∀L1,L2,i. L1 ≛[#i] L2 → ∀I,K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 → + ∃∃K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 & K1 ≛[V1] K2 & V1 ≛ V2. /2 width=3 by rex_inv_lref_pair_dx/ qed-. -lemma rdeq_inv_lref_pair_bi (h) (o) (L1) (L2) (i): - L1 ≛[h,o,#i] L2 → +lemma rdeq_inv_lref_pair_bi (L1) (L2) (i): + L1 ≛[#i] L2 → ∀I1,K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I1}V1 → ∀I2,K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I2}V2 → - ∧∧ K1 ≛[h,o,V1] K2 & V1 ≛[h,o] V2 & I1 = I2. + ∧∧ K1 ≛[V1] K2 & V1 ≛ V2 & I1 = I2. /2 width=6 by rex_inv_lref_pair_bi/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqup.ma b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqup.ma index e1a7afb3a..904bb601b 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqup.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqup.ma @@ -15,25 +15,25 @@ include "static_2/static/rex_fqup.ma". include "static_2/static/rdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******) +(* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***) (* Advanced properties ******************************************************) -lemma rdeq_refl: ∀h,o,T. reflexive … (rdeq h o T). +lemma rdeq_refl: ∀T. reflexive … (rdeq T). /2 width=1 by rex_refl/ qed. -lemma rdeq_pair_refl: ∀h,o,V1,V2. V1 ≛[h, o] V2 → - ∀I,L. ∀T:term. L.ⓑ{I}V1 ≛[h, o, T] L.ⓑ{I}V2. +lemma rdeq_pair_refl: ∀V1,V2. V1 ≛ V2 → + ∀I,L. ∀T:term. L.ⓑ{I}V1 ≛[T] L.ⓑ{I}V2. /2 width=1 by rex_pair_refl/ qed. (* Advanced inversion lemmas ************************************************) -lemma rdeq_inv_bind_void: ∀h,o,p,I,L1,L2,V,T. L1 ≛[h, o, ⓑ{p,I}V.T] L2 → - L1 ≛[h, o, V] L2 ∧ L1.ⓧ ≛[h, o, T] L2.ⓧ. +lemma rdeq_inv_bind_void: ∀p,I,L1,L2,V,T. L1 ≛[ⓑ{p,I}V.T] L2 → + L1 ≛[V] L2 ∧ L1.ⓧ ≛[T] L2.ⓧ. /2 width=3 by rex_inv_bind_void/ qed-. (* Advanced forward lemmas **************************************************) -lemma rdeq_fwd_bind_dx_void: ∀h,o,p,I,L1,L2,V,T. - L1 ≛[h, o, ⓑ{p,I}V.T] L2 → L1.ⓧ ≛[h, o, T] L2.ⓧ. +lemma rdeq_fwd_bind_dx_void: ∀p,I,L1,L2,V,T. + L1 ≛[ⓑ{p,I}V.T] L2 → L1.ⓧ ≛[T] L2.ⓧ. /2 width=4 by rex_fwd_bind_dx_void/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqus.ma b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqus.ma index 3ebf19118..d69864390 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqus.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_fqus.ma @@ -17,20 +17,20 @@ include "static_2/static/rdeq_drops.ma". include "static_2/static/rdeq_fqup.ma". include "static_2/static/rdeq_rdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******) +(* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***) (* Properties with extended structural successor for closures ***************) -lemma fqu_tdeq_conf: ∀h,o,b,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, L2, T1⦄ → - ∀U2. U1 ≛[h, o] U2 → - ∃∃L,T2. ⦃G1, L1, U2⦄ ⊐[b] ⦃G2, L, T2⦄ & L2 ≛[h, o, T1] L & T1 ≛[h, o] T2. -#h #o #b #G1 #G2 #L1 #L2 #U1 #T1 #H elim H -G1 -G2 -L1 -L2 -U1 -T1 +lemma fqu_tdeq_conf: ∀b,G1,G2,L1,L2,U1,T1. ⦃G1,L1,U1⦄ ⬂[b] ⦃G2,L2,T1⦄ → + ∀U2. U1 ≛ U2 → + ∃∃L,T2. ⦃G1,L1,U2⦄ ⬂[b] ⦃G2,L,T2⦄ & L2 ≛[T1] L & T1 ≛ T2. +#b #G1 #G2 #L1 #L2 #U1 #T1 #H elim H -G1 -G2 -L1 -L2 -U1 -T1 [ #I #G #L #W #X #H >(tdeq_inv_lref1 … H) -X /2 width=5 by fqu_lref_O, ex3_2_intro/ | #I #G #L #W1 #U1 #X #H elim (tdeq_inv_pair1 … H) -H #W2 #U2 #HW12 #_ #H destruct /2 width=5 by fqu_pair_sn, ex3_2_intro/ -| #p #I #G #L #W1 #U1 #X #H +| #p #I #G #L #W1 #U1 #Hb #X #H elim (tdeq_inv_pair1 … H) -H #W2 #U2 #HW12 #HU12 #H destruct /3 width=5 by rdeq_pair_refl, fqu_bind_dx, ex3_2_intro/ | #p #I #G #L #W1 #U1 #Hb #X #H @@ -45,19 +45,19 @@ lemma fqu_tdeq_conf: ∀h,o,b,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, ] qed-. -lemma tdeq_fqu_trans: ∀h,o,b,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, L2, T1⦄ → - ∀U2. U2 ≛[h, o] U1 → - ∃∃L,T2. ⦃G1, L1, U2⦄ ⊐[b] ⦃G2, L, T2⦄ & T2 ≛[h, o] T1 & L ≛[h, o, T1] L2. -#h #o #b #G1 #G2 #L1 #L2 #U1 #T1 #H12 #U2 #HU21 -elim (fqu_tdeq_conf … o … H12 U2) -H12 +lemma tdeq_fqu_trans: ∀b,G1,G2,L1,L2,U1,T1. ⦃G1,L1,U1⦄ ⬂[b] ⦃G2,L2,T1⦄ → + ∀U2. U2 ≛ U1 → + ∃∃L,T2. ⦃G1,L1,U2⦄ ⬂[b] ⦃G2,L,T2⦄ & T2 ≛ T1 & L ≛[T1] L2. +#b #G1 #G2 #L1 #L2 #U1 #T1 #H12 #U2 #HU21 +elim (fqu_tdeq_conf … H12 U2) -H12 /3 width=5 by rdeq_sym, tdeq_sym, ex3_2_intro/ qed-. (* Basic_2A1: uses: lleq_fqu_trans *) -lemma rdeq_fqu_trans: ∀h,o,b,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐[b] ⦃G2, K2, U⦄ → - ∀L1. L1 ≛[h, o, T] L2 → - ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐[b] ⦃G2, K1, U0⦄ & U0 ≛[h, o] U & K1 ≛[h, o, U] K2. -#h #o #b #G1 #G2 #L2 #K2 #T #U #H elim H -G1 -G2 -L2 -K2 -T -U +lemma rdeq_fqu_trans: ∀b,G1,G2,L2,K2,T,U. ⦃G1,L2,T⦄ ⬂[b] ⦃G2,K2,U⦄ → + ∀L1. L1 ≛[T] L2 → + ∃∃K1,U0. ⦃G1,L1,T⦄ ⬂[b] ⦃G2,K1,U0⦄ & U0 ≛ U & K1 ≛[U] K2. +#b #G1 #G2 #L2 #K2 #T #U #H elim H -G1 -G2 -L2 -K2 -T -U [ #I #G #L2 #V2 #L1 #H elim (rdeq_inv_zero_pair_dx … H) -H #K1 #V1 #HV1 #HV12 #H destruct /3 width=7 by tdeq_rdeq_conf, fqu_lref_O, ex3_2_intro/ @@ -66,8 +66,8 @@ lemma rdeq_fqu_trans: ∀h,o,b,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐[b] ⦃G2, K2 | elim (rdeq_inv_flat … H) ] -H /2 width=5 by fqu_pair_sn, ex3_2_intro/ -| #p #I #G #L2 #V #T #L1 #H elim (rdeq_inv_bind … H) -H - /2 width=5 by fqu_bind_dx, ex3_2_intro/ +| #p #I #G #L2 #V #T #Hb #L1 #H elim (rdeq_inv_bind … H) -H + /3 width=5 by fqu_bind_dx, ex3_2_intro/ | #p #I #G #L2 #V #T #Hb #L1 #H elim (rdeq_inv_bind_void … H) -H /3 width=5 by fqu_clear, ex3_2_intro/ | #I #G #L2 #V #T #L1 #H elim (rdeq_inv_flat … H) -H @@ -80,10 +80,10 @@ qed-. (* Properties with optional structural successor for closures ***************) -lemma tdeq_fquq_trans: ∀h,o,b,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐⸮[b] ⦃G2, L2, T1⦄ → - ∀U2. U2 ≛[h, o] U1 → - ∃∃L,T2. ⦃G1, L1, U2⦄ ⊐⸮[b] ⦃G2, L, T2⦄ & T2 ≛[h, o] T1 & L ≛[h, o, T1] L2. -#h #o #b #G1 #G2 #L1 #L2 #U1 #T1 #H elim H -H +lemma tdeq_fquq_trans: ∀b,G1,G2,L1,L2,U1,T1. ⦃G1,L1,U1⦄ ⬂⸮[b] ⦃G2,L2,T1⦄ → + ∀U2. U2 ≛ U1 → + ∃∃L,T2. ⦃G1,L1,U2⦄ ⬂⸮[b] ⦃G2,L,T2⦄ & T2 ≛ T1 & L ≛[T1] L2. +#b #G1 #G2 #L1 #L2 #U1 #T1 #H elim H -H [ #H #U2 #HU21 elim (tdeq_fqu_trans … H … HU21) -U1 /3 width=5 by fqu_fquq, ex3_2_intro/ | * #HG #HL #HT destruct /2 width=5 by ex3_2_intro/ @@ -91,10 +91,10 @@ lemma tdeq_fquq_trans: ∀h,o,b,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐⸮[b] qed-. (* Basic_2A1: was just: lleq_fquq_trans *) -lemma rdeq_fquq_trans: ∀h,o,b,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐⸮[b] ⦃G2, K2, U⦄ → - ∀L1. L1 ≛[h, o, T] L2 → - ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐⸮[b] ⦃G2, K1, U0⦄ & U0 ≛[h, o] U & K1 ≛[h, o, U] K2. -#h #o #b #G1 #G2 #L2 #K2 #T #U #H elim H -H +lemma rdeq_fquq_trans: ∀b,G1,G2,L2,K2,T,U. ⦃G1,L2,T⦄ ⬂⸮[b] ⦃G2,K2,U⦄ → + ∀L1. L1 ≛[T] L2 → + ∃∃K1,U0. ⦃G1,L1,T⦄ ⬂⸮[b] ⦃G2,K1,U0⦄ & U0 ≛ U & K1 ≛[U] K2. +#b #G1 #G2 #L2 #K2 #T #U #H elim H -H [ #H #L1 #HL12 elim (rdeq_fqu_trans … H … HL12) -L2 /3 width=5 by fqu_fquq, ex3_2_intro/ | * #HG #HL #HT destruct /2 width=5 by ex3_2_intro/ ] @@ -103,10 +103,10 @@ qed-. (* Properties with plus-iterated structural successor for closures **********) (* Basic_2A1: was just: lleq_fqup_trans *) -lemma rdeq_fqup_trans: ∀h,o,b,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐+[b] ⦃G2, K2, U⦄ → - ∀L1. L1 ≛[h, o, T] L2 → - ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐+[b] ⦃G2, K1, U0⦄ & U0 ≛[h, o] U & K1 ≛[h, o, U] K2. -#h #o #b #G1 #G2 #L2 #K2 #T #U #H @(fqup_ind … H) -G2 -K2 -U +lemma rdeq_fqup_trans: ∀b,G1,G2,L2,K2,T,U. ⦃G1,L2,T⦄ ⬂+[b] ⦃G2,K2,U⦄ → + ∀L1. L1 ≛[T] L2 → + ∃∃K1,U0. ⦃G1,L1,T⦄ ⬂+[b] ⦃G2,K1,U0⦄ & U0 ≛ U & K1 ≛[U] K2. +#b #G1 #G2 #L2 #K2 #T #U #H @(fqup_ind … H) -G2 -K2 -U [ #G2 #K2 #U #HTU #L1 #HL12 elim (rdeq_fqu_trans … HTU … HL12) -L2 /3 width=5 by fqu_fqup, ex3_2_intro/ | #G #G2 #K #K2 #U #U2 #_ #HU2 #IHTU #L1 #HL12 @@ -118,10 +118,10 @@ lemma rdeq_fqup_trans: ∀h,o,b,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐+[b] ⦃G2, ] qed-. -lemma tdeq_fqup_trans: ∀h,o,b,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐+[b] ⦃G2, L2, T1⦄ → - ∀U2. U2 ≛[h, o] U1 → - ∃∃L,T2. ⦃G1, L1, U2⦄ ⊐+[b] ⦃G2, L, T2⦄ & T2 ≛[h, o] T1 & L ≛[h, o, T1] L2. -#h #o #b #G1 #G2 #L1 #L2 #U1 #T1 #H @(fqup_ind_dx … H) -G1 -L1 -U1 +lemma tdeq_fqup_trans: ∀b,G1,G2,L1,L2,U1,T1. ⦃G1,L1,U1⦄ ⬂+[b] ⦃G2,L2,T1⦄ → + ∀U2. U2 ≛ U1 → + ∃∃L,T2. ⦃G1,L1,U2⦄ ⬂+[b] ⦃G2,L,T2⦄ & T2 ≛ T1 & L ≛[T1] L2. +#b #G1 #G2 #L1 #L2 #U1 #T1 #H @(fqup_ind_dx … H) -G1 -L1 -U1 [ #G1 #L1 #U1 #H #U2 #HU21 elim (tdeq_fqu_trans … H … HU21) -U1 /3 width=5 by fqu_fqup, ex3_2_intro/ | #G1 #G #L1 #L #U1 #U #H #_ #IH #U2 #HU21 @@ -136,20 +136,20 @@ qed-. (* Properties with star-iterated structural successor for closures **********) -lemma tdeq_fqus_trans: ∀h,o,b,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐*[b] ⦃G2, L2, T1⦄ → - ∀U2. U2 ≛[h, o] U1 → - ∃∃L,T2. ⦃G1, L1, U2⦄ ⊐*[b] ⦃G2, L, T2⦄ & T2 ≛[h, o] T1 & L ≛[h, o, T1] L2. -#h #o #b #G1 #G2 #L1 #L2 #U1 #T1 #H #U2 #HU21 elim(fqus_inv_fqup … H) -H +lemma tdeq_fqus_trans: ∀b,G1,G2,L1,L2,U1,T1. ⦃G1,L1,U1⦄ ⬂*[b] ⦃G2,L2,T1⦄ → + ∀U2. U2 ≛ U1 → + ∃∃L,T2. ⦃G1,L1,U2⦄ ⬂*[b] ⦃G2,L,T2⦄ & T2 ≛ T1 & L ≛[T1] L2. +#b #G1 #G2 #L1 #L2 #U1 #T1 #H #U2 #HU21 elim(fqus_inv_fqup … H) -H [ #H elim (tdeq_fqup_trans … H … HU21) -U1 /3 width=5 by fqup_fqus, ex3_2_intro/ | * #HG #HL #HT destruct /2 width=5 by ex3_2_intro/ ] qed-. (* Basic_2A1: was just: lleq_fqus_trans *) -lemma rdeq_fqus_trans: ∀h,o,b,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐*[b] ⦃G2, K2, U⦄ → - ∀L1. L1 ≛[h, o, T] L2 → - ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐*[b] ⦃G2, K1, U0⦄ & U0 ≛[h, o] U & K1 ≛[h, o, U] K2. -#h #o #b #G1 #G2 #L2 #K2 #T #U #H #L1 #HL12 elim(fqus_inv_fqup … H) -H +lemma rdeq_fqus_trans: ∀b,G1,G2,L2,K2,T,U. ⦃G1,L2,T⦄ ⬂*[b] ⦃G2,K2,U⦄ → + ∀L1. L1 ≛[T] L2 → + ∃∃K1,U0. ⦃G1,L1,T⦄ ⬂*[b] ⦃G2,K1,U0⦄ & U0 ≛ U & K1 ≛[U] K2. +#b #G1 #G2 #L2 #K2 #T #U #H #L1 #HL12 elim(fqus_inv_fqup … H) -H [ #H elim (rdeq_fqup_trans … H … HL12) -L2 /3 width=5 by fqup_fqus, ex3_2_intro/ | * #HG #HL #HT destruct /2 width=5 by ex3_2_intro/ ] diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_length.ma b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_length.ma index e0f3bb236..967c4c0e6 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_length.ma @@ -17,13 +17,13 @@ include "static_2/static/rex_length.ma". include "static_2/static/rex_fsle.ma". include "static_2/static/rdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******) +(* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***) (* Advanved properties with free variables inclusion ************************) -lemma rdeq_fsge_comp (h) (o): rex_fsge_compatible (cdeq h o). -#h #o #L1 #L2 #T * #f1 #Hf1 #HL12 -lapply (frees_rdeq_conf h o … Hf1 … HL12) +lemma rdeq_fsge_comp: rex_fsge_compatible cdeq. +#L1 #L2 #T * #f1 #Hf1 #HL12 +lapply (frees_rdeq_conf … Hf1 … HL12) lapply (sex_fwd_length … HL12) /3 width=8 by lveq_length_eq, ex4_4_intro/ (**) (* full auto fails *) qed-. @@ -31,25 +31,25 @@ qed-. (* Properties with length for local environments ****************************) (* Basic_2A1: uses: lleq_sort *) -lemma rdeq_sort_length (h) (o): ∀L1,L2. |L1| = |L2| → ∀s. L1 ≛[h, o, ⋆s] L2. +lemma rdeq_sort_length: ∀L1,L2. |L1| = |L2| → ∀s. L1 ≛[⋆s] L2. /2 width=1 by rex_sort_length/ qed. (* Basic_2A1: uses: lleq_gref *) -lemma rdeq_gref_length (h) (o): ∀L1,L2. |L1| = |L2| → ∀l. L1 ≛[h, o, §l] L2. +lemma rdeq_gref_length: ∀L1,L2. |L1| = |L2| → ∀l. L1 ≛[§l] L2. /2 width=1 by rex_gref_length/ qed. -lemma rdeq_unit_length (h) (o): ∀L1,L2. |L1| = |L2| → - ∀I. L1.ⓤ{I} ≛[h, o, #0] L2.ⓤ{I}. +lemma rdeq_unit_length: ∀L1,L2. |L1| = |L2| → + ∀I. L1.ⓤ{I} ≛[#0] L2.ⓤ{I}. /2 width=1 by rex_unit_length/ qed. (* Basic_2A1: uses: lleq_lift_le lleq_lift_ge *) -lemma rdeq_lifts_bi (h) (o): ∀L1,L2. |L1| = |L2| → ∀K1,K2,T. K1 ≛[h, o, T] K2 → - ∀b,f. ⬇*[b, f] L1 ≘ K1 → ⬇*[b, f] L2 ≘ K2 → - ∀U. ⬆*[f] T ≘ U → L1 ≛[h, o, U] L2. +lemma rdeq_lifts_bi: ∀L1,L2. |L1| = |L2| → ∀K1,K2,T. K1 ≛[T] K2 → + ∀b,f. ⬇*[b,f] L1 ≘ K1 → ⬇*[b,f] L2 ≘ K2 → + ∀U. ⬆*[f] T ≘ U → L1 ≛[U] L2. /3 width=9 by rex_lifts_bi, tdeq_lifts_sn/ qed-. (* Forward lemmas with length for local environments ************************) (* Basic_2A1: lleq_fwd_length *) -lemma rdeq_fwd_length (h) (o): ∀L1,L2. ∀T:term. L1 ≛[h, o, T] L2 → |L1| = |L2|. +lemma rdeq_fwd_length: ∀L1,L2. ∀T:term. L1 ≛[T] L2 → |L1| = |L2|. /2 width=3 by rex_fwd_length/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_rdeq.ma b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_rdeq.ma index 316438d66..30069162d 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_rdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_rdeq.ma @@ -16,85 +16,84 @@ include "static_2/syntax/ext2_ext2.ma". include "static_2/syntax/tdeq_tdeq.ma". include "static_2/static/rdeq_length.ma". -(* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******) +(* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***) (* Advanced properties ******************************************************) (* Basic_2A1: uses: lleq_sym *) -lemma rdeq_sym: ∀h,o,T. symmetric … (rdeq h o T). +lemma rdeq_sym: ∀T. symmetric … (rdeq T). /3 width=3 by rdeq_fsge_comp, rex_sym, tdeq_sym/ qed-. (* Basic_2A1: uses: lleq_dec *) -lemma rdeq_dec: ∀h,o,L1,L2. ∀T:term. Decidable (L1 ≛[h, o, T] L2). +lemma rdeq_dec: ∀L1,L2. ∀T:term. Decidable (L1 ≛[T] L2). /3 width=1 by rex_dec, tdeq_dec/ qed-. (* Main properties **********************************************************) (* Basic_2A1: uses: lleq_bind lleq_bind_O *) -theorem rdeq_bind: ∀h,o,p,I,L1,L2,V1,V2,T. - L1 ≛[h, o, V1] L2 → L1.ⓑ{I}V1 ≛[h, o, T] L2.ⓑ{I}V2 → - L1 ≛[h, o, ⓑ{p,I}V1.T] L2. +theorem rdeq_bind: ∀p,I,L1,L2,V1,V2,T. + L1 ≛[V1] L2 → L1.ⓑ{I}V1 ≛[T] L2.ⓑ{I}V2 → + L1 ≛[ⓑ{p,I}V1.T] L2. /2 width=2 by rex_bind/ qed. (* Basic_2A1: uses: lleq_flat *) -theorem rdeq_flat: ∀h,o,I,L1,L2,V,T. L1 ≛[h, o, V] L2 → L1 ≛[h, o, T] L2 → - L1 ≛[h, o, ⓕ{I}V.T] L2. +theorem rdeq_flat: ∀I,L1,L2,V,T. + L1 ≛[V] L2 → L1 ≛[T] L2 → L1 ≛[ⓕ{I}V.T] L2. /2 width=1 by rex_flat/ qed. -theorem rdeq_bind_void: ∀h,o,p,I,L1,L2,V,T. - L1 ≛[h, o, V] L2 → L1.ⓧ ≛[h, o, T] L2.ⓧ → - L1 ≛[h, o, ⓑ{p,I}V.T] L2. +theorem rdeq_bind_void: ∀p,I,L1,L2,V,T. + L1 ≛[V] L2 → L1.ⓧ ≛[T] L2.ⓧ → L1 ≛[ⓑ{p,I}V.T] L2. /2 width=1 by rex_bind_void/ qed. (* Basic_2A1: uses: lleq_trans *) -theorem rdeq_trans: ∀h,o,T. Transitive … (rdeq h o T). -#h #o #T #L1 #L * #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2 +theorem rdeq_trans: ∀T. Transitive … (rdeq T). +#T #L1 #L * #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2 lapply (frees_tdeq_conf_rdeq … Hf1 T … HL1) // #H0 lapply (frees_mono … Hf2 … H0) -Hf2 -H0 /5 width=7 by sex_trans, sex_eq_repl_back, tdeq_trans, ext2_trans, ex2_intro/ qed-. (* Basic_2A1: uses: lleq_canc_sn *) -theorem rdeq_canc_sn: ∀h,o,T. left_cancellable … (rdeq h o T). +theorem rdeq_canc_sn: ∀T. left_cancellable … (rdeq T). /3 width=3 by rdeq_trans, rdeq_sym/ qed-. (* Basic_2A1: uses: lleq_canc_dx *) -theorem rdeq_canc_dx: ∀h,o,T. right_cancellable … (rdeq h o T). +theorem rdeq_canc_dx: ∀T. right_cancellable … (rdeq T). /3 width=3 by rdeq_trans, rdeq_sym/ qed-. -theorem rdeq_repl: ∀h,o,L1,L2. ∀T:term. L1 ≛[h, o, T] L2 → - ∀K1. L1 ≛[h, o, T] K1 → ∀K2. L2 ≛[h, o, T] K2 → K1 ≛[h, o, T] K2. +theorem rdeq_repl: ∀L1,L2. ∀T:term. L1 ≛[T] L2 → + ∀K1. L1 ≛[T] K1 → ∀K2. L2 ≛[T] K2 → K1 ≛[T] K2. /3 width=3 by rdeq_canc_sn, rdeq_trans/ qed-. (* Negated properties *******************************************************) (* Note: auto works with /4 width=8/ so rdeq_canc_sn is preferred **********) (* Basic_2A1: uses: lleq_nlleq_trans *) -lemma rdeq_rdneq_trans: ∀h,o.∀T:term.∀L1,L. L1 ≛[h, o, T] L → - ∀L2. (L ≛[h, o, T] L2 → ⊥) → (L1 ≛[h, o, T] L2 → ⊥). +lemma rdeq_rdneq_trans: ∀T:term.∀L1,L. L1 ≛[T] L → + ∀L2. (L ≛[T] L2 → ⊥) → (L1 ≛[T] L2 → ⊥). /3 width=3 by rdeq_canc_sn/ qed-. (* Basic_2A1: uses: nlleq_lleq_div *) -lemma rdneq_rdeq_div: ∀h,o.∀T:term.∀L2,L. L2 ≛[h, o, T] L → - ∀L1. (L1 ≛[h, o, T] L → ⊥) → (L1 ≛[h, o, T] L2 → ⊥). +lemma rdneq_rdeq_div: ∀T:term.∀L2,L. L2 ≛[T] L → + ∀L1. (L1 ≛[T] L → ⊥) → (L1 ≛[T] L2 → ⊥). /3 width=3 by rdeq_trans/ qed-. -theorem rdneq_rdeq_canc_dx: ∀h,o,L1,L. ∀T:term. (L1 ≛[h, o, T] L → ⊥) → - ∀L2. L2 ≛[h, o, T] L → L1 ≛[h, o, T] L2 → ⊥. +theorem rdneq_rdeq_canc_dx: ∀L1,L. ∀T:term. (L1 ≛[T] L → ⊥) → + ∀L2. L2 ≛[T] L → L1 ≛[T] L2 → ⊥. /3 width=3 by rdeq_trans/ qed-. (* Negated inversion lemmas *************************************************) (* Basic_2A1: uses: nlleq_inv_bind nlleq_inv_bind_O *) -lemma rdneq_inv_bind: ∀h,o,p,I,L1,L2,V,T. (L1 ≛[h, o, ⓑ{p,I}V.T] L2 → ⊥) → - (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1.ⓑ{I}V ≛[h, o, T] L2.ⓑ{I}V → ⊥). +lemma rdneq_inv_bind: ∀p,I,L1,L2,V,T. (L1 ≛[ⓑ{p,I}V.T] L2 → ⊥) → + (L1 ≛[V] L2 → ⊥) ∨ (L1.ⓑ{I}V ≛[T] L2.ⓑ{I}V → ⊥). /3 width=2 by rnex_inv_bind, tdeq_dec/ qed-. (* Basic_2A1: uses: nlleq_inv_flat *) -lemma rdneq_inv_flat: ∀h,o,I,L1,L2,V,T. (L1 ≛[h, o, ⓕ{I}V.T] L2 → ⊥) → - (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1 ≛[h, o, T] L2 → ⊥). +lemma rdneq_inv_flat: ∀I,L1,L2,V,T. (L1 ≛[ⓕ{I}V.T] L2 → ⊥) → + (L1 ≛[V] L2 → ⊥) ∨ (L1 ≛[T] L2 → ⊥). /3 width=2 by rnex_inv_flat, tdeq_dec/ qed-. -lemma rdneq_inv_bind_void: ∀h,o,p,I,L1,L2,V,T. (L1 ≛[h, o, ⓑ{p,I}V.T] L2 → ⊥) → - (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1.ⓧ ≛[h, o, T] L2.ⓧ → ⊥). +lemma rdneq_inv_bind_void: ∀p,I,L1,L2,V,T. (L1 ≛[ⓑ{p,I}V.T] L2 → ⊥) → + (L1 ≛[V] L2 → ⊥) ∨ (L1.ⓧ ≛[T] L2.ⓧ → ⊥). /3 width=3 by rnex_inv_bind_void, tdeq_dec/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_req.ma b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_req.ma index ab3ebca98..5ef8bef9b 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rdeq_req.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rdeq_req.ma @@ -15,13 +15,13 @@ include "static_2/static/req_fsle.ma". include "static_2/static/rdeq.ma". -(* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******) +(* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***) (* Properties with syntactic equivalence on referred entries ****************) -lemma req_rdeq: ∀h,o,L1,L2. ∀T:term. L1 ≡[T] L2 → L1 ≛[h, o, T] L2. +lemma req_rdeq: ∀L1,L2. ∀T:term. L1 ≡[T] L2 → L1 ≛[T] L2. /2 width=3 by rex_co/ qed. -lemma req_rdeq_trans: ∀h,o,L1,L. ∀T:term. L1 ≡[T] L → - ∀L2. L ≛[h, o, T] L2 → L1 ≛[h, o, T] L2. +lemma req_rdeq_trans: ∀L1,L. ∀T:term. L1 ≡[T] L → + ∀L2. L ≛[T] L2 → L1 ≛[T] L2. /2 width=3 by req_rex_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/req.ma b/matita/matita/contribs/lambdadelta/static_2/static/req.ma index 13965b92d..acfb6c4e8 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/req.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/req.ma @@ -69,15 +69,15 @@ lemma req_inv_lref_bind_dx: ∀I2,K2,L1,i. L1 ≡[#↑i] K2.ⓘ{I2} → (* Basic_2A1: was: llpx_sn_lrefl *) (* Basic_2A1: this should have been lleq_fwd_llpx_sn *) lemma req_fwd_rex: ∀R. c_reflexive … R → - ∀L1,L2,T. L1 ≡[T] L2 → L1 ⪤[R, T] L2. + ∀L1,L2,T. L1 ≡[T] L2 → L1 ⪤[R,T] L2. #R #HR #L1 #L2 #T * #f #Hf #HL12 /4 width=7 by sex_co, cext2_co, ex2_intro/ qed-. (* Basic_properties *********************************************************) -lemma frees_req_conf: ∀f,L1,T. L1 ⊢ 𝐅*⦃T⦄ ≘ f → - ∀L2. L1 ≡[T] L2 → L2 ⊢ 𝐅*⦃T⦄ ≘ f. +lemma frees_req_conf: ∀f,L1,T. L1 ⊢ 𝐅+⦃T⦄ ≘ f → + ∀L2. L1 ≡[T] L2 → L2 ⊢ 𝐅+⦃T⦄ ≘ f. #f #L1 #T #H elim H -f -L1 -T [ /2 width=3 by frees_sort/ | #f #i #Hf #L2 #H2 diff --git a/matita/matita/contribs/lambdadelta/static_2/static/req_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/req_drops.ma index 0eae38683..76f25cd40 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/req_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/req_drops.ma @@ -21,6 +21,6 @@ include "static_2/static/req.ma". (* Basic_2A1: uses: lleq_inv_lift_le lleq_inv_lift_be lleq_inv_lift_ge *) lemma req_inv_lifts_bi: ∀L1,L2,U. L1 ≡[U] L2 → ∀b,f. 𝐔⦃f⦄ → - ∀K1,K2. ⬇*[b, f] L1 ≘ K1 → ⬇*[b, f] L2 ≘ K2 → + ∀K1,K2. ⬇*[b,f] L1 ≘ K1 → ⬇*[b,f] L2 ≘ K2 → ∀T. ⬆*[f] T ≘ U → K1 ≡[T] K2. /2 width=10 by rex_inv_lifts_bi/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/req_fsle.ma b/matita/matita/contribs/lambdadelta/static_2/static/req_fsle.ma index d91c9905b..efafbb903 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/req_fsle.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/req_fsle.ma @@ -29,5 +29,5 @@ qed. (* Forward lemmas with free variables inclusion for restricted closures *****) lemma req_rex_trans: ∀R. req_transitive R → - ∀L1,L,T. L1 ≡[T] L → ∀L2. L ⪤[R, T] L2 → L1 ⪤[R, T] L2. + ∀L1,L,T. L1 ≡[T] L → ∀L2. L ⪤[R,T] L2 → L1 ⪤[R,T] L2. /4 width=16 by req_fsle_comp, rex_trans_fsle, rex_trans_next/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rex.ma b/matita/matita/contribs/lambdadelta/static_2/static/rex.ma index 515e24bef..07ad9fe05 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex.ma @@ -21,7 +21,7 @@ include "static_2/static/frees.ma". (* GENERIC EXTENSION ON REFERRED ENTRIES OF A CONTEXT-SENSITIVE REALTION ****) definition rex (R) (T): relation lenv ≝ - λL1,L2. ∃∃f. L1 ⊢ 𝐅*⦃T⦄ ≘ f & L1 ⪤[cext2 R, cfull, f] L2. + λL1,L2. ∃∃f. L1 ⊢ 𝐅+⦃T⦄ ≘ f & L1 ⪤[cext2 R,cfull,f] L2. interpretation "generic extension on referred entries (local environment)" 'Relation R T L1 L2 = (rex R T L1 L2). @@ -30,33 +30,33 @@ definition R_confluent2_rex: relation4 (relation3 lenv term term) (relation3 lenv term term) … ≝ λR1,R2,RP1,RP2. ∀L0,T0,T1. R1 L0 T0 T1 → ∀T2. R2 L0 T0 T2 → - ∀L1. L0 ⪤[RP1, T0] L1 → ∀L2. L0 ⪤[RP2, T0] L2 → + ∀L1. L0 ⪤[RP1,T0] L1 → ∀L2. L0 ⪤[RP2,T0] L2 → ∃∃T. R2 L1 T1 T & R1 L2 T2 T. definition rex_confluent: relation … ≝ λR1,R2. - ∀K1,K,V1. K1 ⪤[R1, V1] K → ∀V. R1 K1 V1 V → - ∀K2. K ⪤[R2, V] K2 → K ⪤[R2, V1] K2. + ∀K1,K,V1. K1 ⪤[R1,V1] K → ∀V. R1 K1 V1 V → + ∀K2. K ⪤[R2,V] K2 → K ⪤[R2,V1] K2. definition rex_transitive: relation3 ? (relation3 ?? term) … ≝ λR1,R2,R3. - ∀K1,K,V1. K1 ⪤[R1, V1] K → + ∀K1,K,V1. K1 ⪤[R1,V1] K → ∀V. R1 K1 V1 V → ∀V2. R2 K V V2 → R3 K1 V1 V2. (* Basic inversion lemmas ***************************************************) -lemma rex_inv_atom_sn (R): ∀Y2,T. ⋆ ⪤[R, T] Y2 → Y2 = ⋆. +lemma rex_inv_atom_sn (R): ∀Y2,T. ⋆ ⪤[R,T] Y2 → Y2 = ⋆. #R #Y2 #T * /2 width=4 by sex_inv_atom1/ qed-. -lemma rex_inv_atom_dx (R): ∀Y1,T. Y1 ⪤[R, T] ⋆ → Y1 = ⋆. +lemma rex_inv_atom_dx (R): ∀Y1,T. Y1 ⪤[R,T] ⋆ → Y1 = ⋆. #R #I #Y1 * /2 width=4 by sex_inv_atom2/ qed-. -lemma rex_inv_sort (R): ∀Y1,Y2,s. Y1 ⪤[R, ⋆s] Y2 → - ∨∨ Y1 = ⋆ ∧ Y2 = ⋆ - | ∃∃I1,I2,L1,L2. L1 ⪤[R, ⋆s] L2 & - Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. +lemma rex_inv_sort (R): + ∀Y1,Y2,s. Y1 ⪤[R,⋆s] Y2 → + ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ + | ∃∃I1,I2,L1,L2. L1 ⪤[R,⋆s] L2 & Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. #R * [ | #Y1 #I1 ] #Y2 #s * #f #H1 #H2 [ lapply (sex_inv_atom1 … H2) -H2 /3 width=1 by or_introl, conj/ | lapply (frees_inv_sort … H1) -H1 #Hf @@ -66,12 +66,13 @@ lemma rex_inv_sort (R): ∀Y1,Y2,s. Y1 ⪤[R, ⋆s] Y2 → ] qed-. -lemma rex_inv_zero (R): ∀Y1,Y2. Y1 ⪤[R, #0] Y2 → - ∨∨ Y1 = ⋆ ∧ Y2 = ⋆ - | ∃∃I,L1,L2,V1,V2. L1 ⪤[R, V1] L2 & R L1 V1 V2 & - Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2 - | ∃∃f,I,L1,L2. 𝐈⦃f⦄ & L1 ⪤[cext2 R, cfull, f] L2 & - Y1 = L1.ⓤ{I} & Y2 = L2.ⓤ{I}. +lemma rex_inv_zero (R): + ∀Y1,Y2. Y1 ⪤[R,#0] Y2 → + ∨∨ Y1 = ⋆ ∧ Y2 = ⋆ + | ∃∃I,L1,L2,V1,V2. L1 ⪤[R,V1] L2 & R L1 V1 V2 & + Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2 + | ∃∃f,I,L1,L2. 𝐈⦃f⦄ & L1 ⪤[cext2 R,cfull,f] L2 & + Y1 = L1.ⓤ{I} & Y2 = L2.ⓤ{I}. #R * [ | #Y1 * #I1 [ | #X ] ] #Y2 * #f #H1 #H2 [ lapply (sex_inv_atom1 … H2) -H2 /3 width=1 by or3_intro0, conj/ | elim (frees_inv_unit … H1) -H1 #g #HX #H destruct @@ -84,10 +85,10 @@ lemma rex_inv_zero (R): ∀Y1,Y2. Y1 ⪤[R, #0] Y2 → ] qed-. -lemma rex_inv_lref (R): ∀Y1,Y2,i. Y1 ⪤[R, #↑i] Y2 → - ∨∨ Y1 = ⋆ ∧ Y2 = ⋆ - | ∃∃I1,I2,L1,L2. L1 ⪤[R, #i] L2 & - Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. +lemma rex_inv_lref (R): + ∀Y1,Y2,i. Y1 ⪤[R,#↑i] Y2 → + ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ + | ∃∃I1,I2,L1,L2. L1 ⪤[R,#i] L2 & Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. #R * [ | #Y1 #I1 ] #Y2 #i * #f #H1 #H2 [ lapply (sex_inv_atom1 … H2) -H2 /3 width=1 by or_introl, conj/ | elim (frees_inv_lref … H1) -H1 #g #Hg #H destruct @@ -96,10 +97,10 @@ lemma rex_inv_lref (R): ∀Y1,Y2,i. Y1 ⪤[R, #↑i] Y2 → ] qed-. -lemma rex_inv_gref (R): ∀Y1,Y2,l. Y1 ⪤[R, §l] Y2 → - ∨∨ Y1 = ⋆ ∧ Y2 = ⋆ - | ∃∃I1,I2,L1,L2. L1 ⪤[R, §l] L2 & - Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. +lemma rex_inv_gref (R): + ∀Y1,Y2,l. Y1 ⪤[R,§l] Y2 → + ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ + | ∃∃I1,I2,L1,L2. L1 ⪤[R,§l] L2 & Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}. #R * [ | #Y1 #I1 ] #Y2 #l * #f #H1 #H2 [ lapply (sex_inv_atom1 … H2) -H2 /3 width=1 by or_introl, conj/ | lapply (frees_inv_gref … H1) -H1 #Hf @@ -110,40 +111,44 @@ lemma rex_inv_gref (R): ∀Y1,Y2,l. Y1 ⪤[R, §l] Y2 → qed-. (* Basic_2A1: uses: llpx_sn_inv_bind llpx_sn_inv_bind_O *) -lemma rex_inv_bind (R): ∀p,I,L1,L2,V1,V2,T. L1 ⪤[R, ⓑ{p,I}V1.T] L2 → R L1 V1 V2 → - ∧∧ L1 ⪤[R, V1] L2 & L1.ⓑ{I}V1 ⪤[R, T] L2.ⓑ{I}V2. +lemma rex_inv_bind (R): + ∀p,I,L1,L2,V1,V2,T. L1 ⪤[R,ⓑ{p,I}V1.T] L2 → R L1 V1 V2 → + ∧∧ L1 ⪤[R,V1] L2 & L1.ⓑ{I}V1 ⪤[R,T] L2.ⓑ{I}V2. #R #p #I #L1 #L2 #V1 #V2 #T * #f #Hf #HL #HV elim (frees_inv_bind … Hf) -Hf /6 width=6 by sle_sex_trans, sex_inv_tl, ext2_pair, sor_inv_sle_dx, sor_inv_sle_sn, ex2_intro, conj/ qed-. (* Basic_2A1: uses: llpx_sn_inv_flat *) -lemma rex_inv_flat (R): ∀I,L1,L2,V,T. L1 ⪤[R, ⓕ{I}V.T] L2 → - ∧∧ L1 ⪤[R, V] L2 & L1 ⪤[R, T] L2. +lemma rex_inv_flat (R): + ∀I,L1,L2,V,T. L1 ⪤[R,ⓕ{I}V.T] L2 → + ∧∧ L1 ⪤[R,V] L2 & L1 ⪤[R,T] L2. #R #I #L1 #L2 #V #T * #f #Hf #HL elim (frees_inv_flat … Hf) -Hf /5 width=6 by sle_sex_trans, sor_inv_sle_dx, sor_inv_sle_sn, ex2_intro, conj/ qed-. (* Advanced inversion lemmas ************************************************) -lemma rex_inv_sort_bind_sn (R): ∀I1,K1,L2,s. K1.ⓘ{I1} ⪤[R, ⋆s] L2 → - ∃∃I2,K2. K1 ⪤[R, ⋆s] K2 & L2 = K2.ⓘ{I2}. +lemma rex_inv_sort_bind_sn (R): + ∀I1,K1,L2,s. K1.ⓘ{I1} ⪤[R,⋆s] L2 → + ∃∃I2,K2. K1 ⪤[R,⋆s] K2 & L2 = K2.ⓘ{I2}. #R #I1 #K1 #L2 #s #H elim (rex_inv_sort … H) -H * [ #H destruct | #Z1 #I2 #Y1 #K2 #Hs #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rex_inv_sort_bind_dx (R): ∀I2,K2,L1,s. L1 ⪤[R, ⋆s] K2.ⓘ{I2} → - ∃∃I1,K1. K1 ⪤[R, ⋆s] K2 & L1 = K1.ⓘ{I1}. +lemma rex_inv_sort_bind_dx (R): + ∀I2,K2,L1,s. L1 ⪤[R,⋆s] K2.ⓘ{I2} → + ∃∃I1,K1. K1 ⪤[R,⋆s] K2 & L1 = K1.ⓘ{I1}. #R #I2 #K2 #L1 #s #H elim (rex_inv_sort … H) -H * [ #_ #H destruct | #I1 #Z2 #K1 #Y2 #Hs #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rex_inv_zero_pair_sn (R): ∀I,L2,K1,V1. K1.ⓑ{I}V1 ⪤[R, #0] L2 → - ∃∃K2,V2. K1 ⪤[R, V1] K2 & R K1 V1 V2 & - L2 = K2.ⓑ{I}V2. +lemma rex_inv_zero_pair_sn (R): + ∀I,L2,K1,V1. K1.ⓑ{I}V1 ⪤[R,#0] L2 → + ∃∃K2,V2. K1 ⪤[R,V1] K2 & R K1 V1 V2 & L2 = K2.ⓑ{I}V2. #R #I #L2 #K1 #V1 #H elim (rex_inv_zero … H) -H * [ #H destruct | #Z #Y1 #K2 #X1 #V2 #HK12 #HV12 #H1 #H2 destruct @@ -152,9 +157,9 @@ lemma rex_inv_zero_pair_sn (R): ∀I,L2,K1,V1. K1.ⓑ{I}V1 ⪤[R, #0] L2 → ] qed-. -lemma rex_inv_zero_pair_dx (R): ∀I,L1,K2,V2. L1 ⪤[R, #0] K2.ⓑ{I}V2 → - ∃∃K1,V1. K1 ⪤[R, V1] K2 & R K1 V1 V2 & - L1 = K1.ⓑ{I}V1. +lemma rex_inv_zero_pair_dx (R): + ∀I,L1,K2,V2. L1 ⪤[R,#0] K2.ⓑ{I}V2 → + ∃∃K1,V1. K1 ⪤[R,V1] K2 & R K1 V1 V2 & L1 = K1.ⓑ{I}V1. #R #I #L1 #K2 #V2 #H elim (rex_inv_zero … H) -H * [ #_ #H destruct | #Z #K1 #Y2 #V1 #X2 #HK12 #HV12 #H1 #H2 destruct @@ -163,9 +168,9 @@ lemma rex_inv_zero_pair_dx (R): ∀I,L1,K2,V2. L1 ⪤[R, #0] K2.ⓑ{I}V2 → ] qed-. -lemma rex_inv_zero_unit_sn (R): ∀I,K1,L2. K1.ⓤ{I} ⪤[R, #0] L2 → - ∃∃f,K2. 𝐈⦃f⦄ & K1 ⪤[cext2 R, cfull, f] K2 & - L2 = K2.ⓤ{I}. +lemma rex_inv_zero_unit_sn (R): + ∀I,K1,L2. K1.ⓤ{I} ⪤[R,#0] L2 → + ∃∃f,K2. 𝐈⦃f⦄ & K1 ⪤[cext2 R,cfull,f] K2 & L2 = K2.ⓤ{I}. #R #I #K1 #L2 #H elim (rex_inv_zero … H) -H * [ #H destruct | #Z #Y1 #Y2 #X1 #X2 #_ #_ #H destruct @@ -173,9 +178,9 @@ lemma rex_inv_zero_unit_sn (R): ∀I,K1,L2. K1.ⓤ{I} ⪤[R, #0] L2 → ] qed-. -lemma rex_inv_zero_unit_dx (R): ∀I,L1,K2. L1 ⪤[R, #0] K2.ⓤ{I} → - ∃∃f,K1. 𝐈⦃f⦄ & K1 ⪤[cext2 R, cfull, f] K2 & - L1 = K1.ⓤ{I}. +lemma rex_inv_zero_unit_dx (R): + ∀I,L1,K2. L1 ⪤[R,#0] K2.ⓤ{I} → + ∃∃f,K1. 𝐈⦃f⦄ & K1 ⪤[cext2 R,cfull,f] K2 & L1 = K1.ⓤ{I}. #R #I #L1 #K2 #H elim (rex_inv_zero … H) -H * [ #_ #H destruct | #Z #Y1 #Y2 #X1 #X2 #_ #_ #_ #H destruct @@ -183,32 +188,36 @@ lemma rex_inv_zero_unit_dx (R): ∀I,L1,K2. L1 ⪤[R, #0] K2.ⓤ{I} → ] qed-. -lemma rex_inv_lref_bind_sn (R): ∀I1,K1,L2,i. K1.ⓘ{I1} ⪤[R, #↑i] L2 → - ∃∃I2,K2. K1 ⪤[R, #i] K2 & L2 = K2.ⓘ{I2}. +lemma rex_inv_lref_bind_sn (R): + ∀I1,K1,L2,i. K1.ⓘ{I1} ⪤[R,#↑i] L2 → + ∃∃I2,K2. K1 ⪤[R,#i] K2 & L2 = K2.ⓘ{I2}. #R #I1 #K1 #L2 #i #H elim (rex_inv_lref … H) -H * [ #H destruct | #Z1 #I2 #Y1 #K2 #Hi #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rex_inv_lref_bind_dx (R): ∀I2,K2,L1,i. L1 ⪤[R, #↑i] K2.ⓘ{I2} → - ∃∃I1,K1. K1 ⪤[R, #i] K2 & L1 = K1.ⓘ{I1}. +lemma rex_inv_lref_bind_dx (R): + ∀I2,K2,L1,i. L1 ⪤[R,#↑i] K2.ⓘ{I2} → + ∃∃I1,K1. K1 ⪤[R,#i] K2 & L1 = K1.ⓘ{I1}. #R #I2 #K2 #L1 #i #H elim (rex_inv_lref … H) -H * [ #_ #H destruct | #I1 #Z2 #K1 #Y2 #Hi #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rex_inv_gref_bind_sn (R): ∀I1,K1,L2,l. K1.ⓘ{I1} ⪤[R, §l] L2 → - ∃∃I2,K2. K1 ⪤[R, §l] K2 & L2 = K2.ⓘ{I2}. +lemma rex_inv_gref_bind_sn (R): + ∀I1,K1,L2,l. K1.ⓘ{I1} ⪤[R,§l] L2 → + ∃∃I2,K2. K1 ⪤[R,§l] K2 & L2 = K2.ⓘ{I2}. #R #I1 #K1 #L2 #l #H elim (rex_inv_gref … H) -H * [ #H destruct | #Z1 #I2 #Y1 #K2 #Hl #H1 #H2 destruct /2 width=4 by ex2_2_intro/ ] qed-. -lemma rex_inv_gref_bind_dx (R): ∀I2,K2,L1,l. L1 ⪤[R, §l] K2.ⓘ{I2} → - ∃∃I1,K1. K1 ⪤[R, §l] K2 & L1 = K1.ⓘ{I1}. +lemma rex_inv_gref_bind_dx (R): + ∀I2,K2,L1,l. L1 ⪤[R,§l] K2.ⓘ{I2} → + ∃∃I1,K1. K1 ⪤[R,§l] K2 & L1 = K1.ⓘ{I1}. #R #I2 #K2 #L1 #l #H elim (rex_inv_gref … H) -H * [ #_ #H destruct | #I1 #Z2 #K1 #Y2 #Hl #H1 #H2 destruct /2 width=4 by ex2_2_intro/ @@ -217,32 +226,34 @@ qed-. (* Basic forward lemmas *****************************************************) -lemma rex_fwd_zero_pair (R): ∀I,K1,K2,V1,V2. - K1.ⓑ{I}V1 ⪤[R, #0] K2.ⓑ{I}V2 → K1 ⪤[R, V1] K2. +lemma rex_fwd_zero_pair (R): + ∀I,K1,K2,V1,V2. K1.ⓑ{I}V1 ⪤[R,#0] K2.ⓑ{I}V2 → K1 ⪤[R,V1] K2. #R #I #K1 #K2 #V1 #V2 #H elim (rex_inv_zero_pair_sn … H) -H #Y #X #HK12 #_ #H destruct // qed-. (* Basic_2A1: uses: llpx_sn_fwd_pair_sn llpx_sn_fwd_bind_sn llpx_sn_fwd_flat_sn *) -lemma rex_fwd_pair_sn (R): ∀I,L1,L2,V,T. L1 ⪤[R, ②{I}V.T] L2 → L1 ⪤[R, V] L2. +lemma rex_fwd_pair_sn (R): ∀I,L1,L2,V,T. L1 ⪤[R,②{I}V.T] L2 → L1 ⪤[R,V] L2. #R * [ #p ] #I #L1 #L2 #V #T * #f #Hf #HL [ elim (frees_inv_bind … Hf) | elim (frees_inv_flat … Hf) ] -Hf /4 width=6 by sle_sex_trans, sor_inv_sle_sn, ex2_intro/ qed-. (* Basic_2A1: uses: llpx_sn_fwd_bind_dx llpx_sn_fwd_bind_O_dx *) -lemma rex_fwd_bind_dx (R): ∀p,I,L1,L2,V1,V2,T. L1 ⪤[R, ⓑ{p,I}V1.T] L2 → - R L1 V1 V2 → L1.ⓑ{I}V1 ⪤[R, T] L2.ⓑ{I}V2. +lemma rex_fwd_bind_dx (R): + ∀p,I,L1,L2,V1,V2,T. L1 ⪤[R,ⓑ{p,I}V1.T] L2 → + R L1 V1 V2 → L1.ⓑ{I}V1 ⪤[R,T] L2.ⓑ{I}V2. #R #p #I #L1 #L2 #V1 #V2 #T #H #HV elim (rex_inv_bind … H HV) -H -HV // qed-. (* Basic_2A1: uses: llpx_sn_fwd_flat_dx *) -lemma rex_fwd_flat_dx (R): ∀I,L1,L2,V,T. L1 ⪤[R, ⓕ{I}V.T] L2 → L1 ⪤[R, T] L2. +lemma rex_fwd_flat_dx (R): ∀I,L1,L2,V,T. L1 ⪤[R,ⓕ{I}V.T] L2 → L1 ⪤[R,T] L2. #R #I #L1 #L2 #V #T #H elim (rex_inv_flat … H) -H // qed-. -lemma rex_fwd_dx (R): ∀I2,L1,K2,T. L1 ⪤[R, T] K2.ⓘ{I2} → - ∃∃I1,K1. L1 = K1.ⓘ{I1}. +lemma rex_fwd_dx (R): + ∀I2,L1,K2,T. L1 ⪤[R,T] K2.ⓘ{I2} → + ∃∃I1,K1. L1 = K1.ⓘ{I1}. #R #I2 #L1 #K2 #T * #f elim (pn_split f) * #g #Hg #_ #Hf destruct [ elim (sex_inv_push2 … Hf) | elim (sex_inv_next2 … Hf) ] -Hf #I1 #K1 #_ #_ #H destruct /2 width=3 by ex1_2_intro/ @@ -250,63 +261,66 @@ qed-. (* Basic properties *********************************************************) -lemma rex_atom (R): ∀I. ⋆ ⪤[R, ⓪{I}] ⋆. +lemma rex_atom (R): ∀I. ⋆ ⪤[R,⓪{I}] ⋆. #R * /3 width=3 by frees_sort, frees_atom, frees_gref, sex_atom, ex2_intro/ qed. -lemma rex_sort (R): ∀I1,I2,L1,L2,s. - L1 ⪤[R, ⋆s] L2 → L1.ⓘ{I1} ⪤[R, ⋆s] L2.ⓘ{I2}. +lemma rex_sort (R): + ∀I1,I2,L1,L2,s. L1 ⪤[R,⋆s] L2 → L1.ⓘ{I1} ⪤[R,⋆s] L2.ⓘ{I2}. #R #I1 #I2 #L1 #L2 #s * #f #Hf #H12 lapply (frees_inv_sort … Hf) -Hf /4 width=3 by frees_sort, sex_push, isid_push, ex2_intro/ qed. -lemma rex_pair (R): ∀I,L1,L2,V1,V2. L1 ⪤[R, V1] L2 → - R L1 V1 V2 → L1.ⓑ{I}V1 ⪤[R, #0] L2.ⓑ{I}V2. +lemma rex_pair (R): + ∀I,L1,L2,V1,V2. L1 ⪤[R,V1] L2 → + R L1 V1 V2 → L1.ⓑ{I}V1 ⪤[R,#0] L2.ⓑ{I}V2. #R #I1 #I2 #L1 #L2 #V1 * /4 width=3 by ext2_pair, frees_pair, sex_next, ex2_intro/ qed. -lemma rex_unit (R): ∀f,I,L1,L2. 𝐈⦃f⦄ → L1 ⪤[cext2 R, cfull, f] L2 → - L1.ⓤ{I} ⪤[R, #0] L2.ⓤ{I}. +lemma rex_unit (R): + ∀f,I,L1,L2. 𝐈⦃f⦄ → L1 ⪤[cext2 R,cfull,f] L2 → + L1.ⓤ{I} ⪤[R,#0] L2.ⓤ{I}. /4 width=3 by frees_unit, sex_next, ext2_unit, ex2_intro/ qed. -lemma rex_lref (R): ∀I1,I2,L1,L2,i. - L1 ⪤[R, #i] L2 → L1.ⓘ{I1} ⪤[R, #↑i] L2.ⓘ{I2}. +lemma rex_lref (R): + ∀I1,I2,L1,L2,i. L1 ⪤[R,#i] L2 → L1.ⓘ{I1} ⪤[R,#↑i] L2.ⓘ{I2}. #R #I1 #I2 #L1 #L2 #i * /3 width=3 by sex_push, frees_lref, ex2_intro/ qed. -lemma rex_gref (R): ∀I1,I2,L1,L2,l. - L1 ⪤[R, §l] L2 → L1.ⓘ{I1} ⪤[R, §l] L2.ⓘ{I2}. +lemma rex_gref (R): + ∀I1,I2,L1,L2,l. L1 ⪤[R,§l] L2 → L1.ⓘ{I1} ⪤[R,§l] L2.ⓘ{I2}. #R #I1 #I2 #L1 #L2 #l * #f #Hf #H12 lapply (frees_inv_gref … Hf) -Hf /4 width=3 by frees_gref, sex_push, isid_push, ex2_intro/ qed. -lemma rex_bind_repl_dx (R): ∀I,I1,L1,L2,T. - L1.ⓘ{I} ⪤[R, T] L2.ⓘ{I1} → - ∀I2. cext2 R L1 I I2 → - L1.ⓘ{I} ⪤[R, T] L2.ⓘ{I2}. +lemma rex_bind_repl_dx (R): + ∀I,I1,L1,L2,T. L1.ⓘ{I} ⪤[R,T] L2.ⓘ{I1} → + ∀I2. cext2 R L1 I I2 → L1.ⓘ{I} ⪤[R,T] L2.ⓘ{I2}. #R #I #I1 #L1 #L2 #T * #f #Hf #HL12 #I2 #HR /3 width=5 by sex_pair_repl, ex2_intro/ qed-. (* Basic_2A1: uses: llpx_sn_co *) -lemma rex_co (R1) (R2): (∀L,T1,T2. R1 L T1 T2 → R2 L T1 T2) → - ∀L1,L2,T. L1 ⪤[R1, T] L2 → L1 ⪤[R2, T] L2. +lemma rex_co (R1) (R2): + (∀L,T1,T2. R1 L T1 T2 → R2 L T1 T2) → + ∀L1,L2,T. L1 ⪤[R1,T] L2 → L1 ⪤[R2,T] L2. #R1 #R2 #HR #L1 #L2 #T * /5 width=7 by sex_co, cext2_co, ex2_intro/ qed-. -lemma rex_isid (R1) (R2): ∀L1,L2,T1,T2. - (∀f. L1 ⊢ 𝐅*⦃T1⦄ ≘ f → 𝐈⦃f⦄) → - (∀f. 𝐈⦃f⦄ → L1 ⊢ 𝐅*⦃T2⦄ ≘ f) → - L1 ⪤[R1, T1] L2 → L1 ⪤[R2, T2] L2. +lemma rex_isid (R1) (R2): + ∀L1,L2,T1,T2. + (∀f. L1 ⊢ 𝐅+⦃T1⦄ ≘ f → 𝐈⦃f⦄) → + (∀f. 𝐈⦃f⦄ → L1 ⊢ 𝐅+⦃T2⦄ ≘ f) → + L1 ⪤[R1,T1] L2 → L1 ⪤[R2,T2] L2. #R1 #R2 #L1 #L2 #T1 #T2 #H1 #H2 * /4 width=7 by sex_co_isid, ex2_intro/ qed-. lemma rex_unit_sn (R1) (R2): - ∀I,K1,L2. K1.ⓤ{I} ⪤[R1, #0] L2 → K1.ⓤ{I} ⪤[R2, #0] L2. + ∀I,K1,L2. K1.ⓤ{I} ⪤[R1,#0] L2 → K1.ⓤ{I} ⪤[R2,#0] L2. #R1 #R2 #I #K1 #L2 #H elim (rex_inv_zero_unit_sn … H) -H #f #K2 #Hf #HK12 #H destruct /3 width=7 by rex_unit, sex_co_isid/ diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rex_drops.ma b/matita/matita/contribs/lambdadelta/static_2/static/rex_drops.ma index 60e335d57..f3421b04c 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex_drops.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex_drops.ma @@ -20,29 +20,30 @@ include "static_2/static/rex.ma". (* GENERIC EXTENSION ON REFERRED ENTRIES OF A CONTEXT-SENSITIVE REALTION ****) definition f_dedropable_sn: predicate (relation3 lenv term term) ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → - ∀K2,T. K1 ⪤[R, T] K2 → ∀U. ⬆*[f] T ≘ U → - ∃∃L2. L1 ⪤[R, U] L2 & ⬇*[b, f] L2 ≘ K2 & L1 ≡[f] L2. + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → + ∀K2,T. K1 ⪤[R,T] K2 → ∀U. ⬆*[f] T ≘ U → + ∃∃L2. L1 ⪤[R,U] L2 & ⬇*[b,f] L2 ≘ K2 & L1 ≡[f] L2. definition f_dropable_sn: predicate (relation3 lenv term term) ≝ - λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≘ K1 → 𝐔⦃f⦄ → - ∀L2,U. L1 ⪤[R, U] L2 → ∀T. ⬆*[f] T ≘ U → - ∃∃K2. K1 ⪤[R, T] K2 & ⬇*[b, f] L2 ≘ K2. + λR. ∀b,f,L1,K1. ⬇*[b,f] L1 ≘ K1 → 𝐔⦃f⦄ → + ∀L2,U. L1 ⪤[R,U] L2 → ∀T. ⬆*[f] T ≘ U → + ∃∃K2. K1 ⪤[R,T] K2 & ⬇*[b,f] L2 ≘ K2. definition f_dropable_dx: predicate (relation3 lenv term term) ≝ - λR. ∀L1,L2,U. L1 ⪤[R, U] L2 → - ∀b,f,K2. ⬇*[b, f] L2 ≘ K2 → 𝐔⦃f⦄ → ∀T. ⬆*[f] T ≘ U → - ∃∃K1. ⬇*[b, f] L1 ≘ K1 & K1 ⪤[R, T] K2. + λR. ∀L1,L2,U. L1 ⪤[R,U] L2 → + ∀b,f,K2. ⬇*[b,f] L2 ≘ K2 → 𝐔⦃f⦄ → ∀T. ⬆*[f] T ≘ U → + ∃∃K1. ⬇*[b,f] L1 ≘ K1 & K1 ⪤[R,T] K2. definition f_transitive_next: relation3 … ≝ λR1,R2,R3. - ∀f,L,T. L ⊢ 𝐅*⦃T⦄ ≘ f → + ∀f,L,T. L ⊢ 𝐅+⦃T⦄ ≘ f → ∀g,I,K,n. ⬇*[n] L ≘ K.ⓘ{I} → ↑g = ⫱*[n] f → sex_transitive (cext2 R1) (cext2 R2) (cext2 R3) (cext2 R1) cfull g K I. (* Properties with generic slicing for local environments *******************) -lemma rex_liftable_dedropable_sn: ∀R. (∀L. reflexive ? (R L)) → - d_liftable2_sn … lifts R → f_dedropable_sn R. +lemma rex_liftable_dedropable_sn (R): + (∀L. reflexive ? (R L)) → + d_liftable2_sn … lifts R → f_dedropable_sn R. #R #H1R #H2R #b #f #L1 #K1 #HLK1 #K2 #T * #f1 #Hf1 #HK12 #U #HTU elim (frees_total L1 U) #f2 #Hf2 lapply (frees_fwd_coafter … Hf2 … HLK1 … HTU … Hf1) -HTU #Hf @@ -50,7 +51,8 @@ elim (sex_liftable_co_dedropable_sn … HLK1 … HK12 … Hf) -f1 -K1 /3 width=6 by cext2_d_liftable2_sn, cfull_lift_sn, ext2_refl, ex3_intro, ex2_intro/ qed-. -lemma rex_trans_next: ∀R1,R2,R3. rex_transitive R1 R2 R3 → f_transitive_next R1 R2 R3. +lemma rex_trans_next (R1) (R2) (R3): + rex_transitive R1 R2 R3 → f_transitive_next R1 R2 R3. #R1 #R2 #R3 #HR #f #L1 #T #Hf #g #I1 #K1 #n #HLK #Hgf #I #H generalize in match HLK; -HLK elim H -I1 -I [ #I #_ #L2 #_ #I2 #H @@ -67,7 +69,7 @@ qed. (* Basic_2A1: uses: llpx_sn_inv_lift_le llpx_sn_inv_lift_be llpx_sn_inv_lift_ge *) (* Basic_2A1: was: llpx_sn_drop_conf_O *) -lemma rex_dropable_sn: ∀R. f_dropable_sn R. +lemma rex_dropable_sn (R): f_dropable_sn R. #R #b #f #L1 #K1 #HLK1 #H1f #L2 #U * #f2 #Hf2 #HL12 #T #HTU elim (frees_total K1 T) #f1 #Hf1 lapply (frees_fwd_coafter … Hf2 … HLK1 … HTU … Hf1) -HTU #H2f @@ -77,7 +79,7 @@ qed-. (* Basic_2A1: was: llpx_sn_drop_trans_O *) (* Note: the proof might be simplified *) -lemma rex_dropable_dx: ∀R. f_dropable_dx R. +lemma rex_dropable_dx (R): f_dropable_dx R. #R #L1 #L2 #U * #f2 #Hf2 #HL12 #b #f #K2 #HLK2 #H1f #T #HTU elim (drops_isuni_ex … H1f L1) #K1 #HLK1 elim (frees_total K1 T) #f1 #Hf1 @@ -87,48 +89,53 @@ elim (sex_co_dropable_dx … HL12 … HLK2 … H2f) -L2 qed-. (* Basic_2A1: uses: llpx_sn_inv_lift_O *) -lemma rex_inv_lifts_bi: ∀R,L1,L2,U. L1 ⪤[R, U] L2 → ∀b,f. 𝐔⦃f⦄ → - ∀K1,K2. ⬇*[b, f] L1 ≘ K1 → ⬇*[b, f] L2 ≘ K2 → - ∀T. ⬆*[f] T ≘ U → K1 ⪤[R, T] K2. +lemma rex_inv_lifts_bi (R): + ∀L1,L2,U. L1 ⪤[R,U] L2 → ∀b,f. 𝐔⦃f⦄ → + ∀K1,K2. ⬇*[b,f] L1 ≘ K1 → ⬇*[b,f] L2 ≘ K2 → + ∀T. ⬆*[f] T ≘ U → K1 ⪤[R,T] K2. #R #L1 #L2 #U #HL12 #b #f #Hf #K1 #K2 #HLK1 #HLK2 #T #HTU elim (rex_dropable_sn … HLK1 … HL12 … HTU) -L1 -U // #Y #HK12 #HY lapply (drops_mono … HY … HLK2) -b -f -L2 #H destruct // qed-. -lemma rex_inv_lref_pair_sn: ∀R,L1,L2,i. L1 ⪤[R, #i] L2 → ∀I,K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 → - ∃∃K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 & K1 ⪤[R, V1] K2 & R K1 V1 V2. +lemma rex_inv_lref_pair_sn (R): + ∀L1,L2,i. L1 ⪤[R,#i] L2 → ∀I,K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 → + ∃∃K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 & K1 ⪤[R,V1] K2 & R K1 V1 V2. #R #L1 #L2 #i #HL12 #I #K1 #V1 #HLK1 elim (rex_dropable_sn … HLK1 … HL12 (#0)) -HLK1 -HL12 // #Y #HY #HLK2 elim (rex_inv_zero_pair_sn … HY) -HY #K2 #V2 #HK12 #HV12 #H destruct /2 width=5 by ex3_2_intro/ qed-. -lemma rex_inv_lref_pair_dx: ∀R,L1,L2,i. L1 ⪤[R, #i] L2 → ∀I,K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 → - ∃∃K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 & K1 ⪤[R, V1] K2 & R K1 V1 V2. +lemma rex_inv_lref_pair_dx (R): + ∀L1,L2,i. L1 ⪤[R,#i] L2 → ∀I,K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I}V2 → + ∃∃K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I}V1 & K1 ⪤[R,V1] K2 & R K1 V1 V2. #R #L1 #L2 #i #HL12 #I #K2 #V2 #HLK2 elim (rex_dropable_dx … HL12 … HLK2 … (#0)) -HLK2 -HL12 // #Y #HLK1 #HY elim (rex_inv_zero_pair_dx … HY) -HY #K1 #V1 #HK12 #HV12 #H destruct /2 width=5 by ex3_2_intro/ qed-. lemma rex_inv_lref_pair_bi (R) (L1) (L2) (i): - L1 ⪤[R, #i] L2 → - ∀I1,K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I1}V1 → - ∀I2,K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I2}V2 → - ∧∧ K1 ⪤[R, V1] K2 & R K1 V1 V2 & I1 = I2. + L1 ⪤[R,#i] L2 → + ∀I1,K1,V1. ⬇*[i] L1 ≘ K1.ⓑ{I1}V1 → + ∀I2,K2,V2. ⬇*[i] L2 ≘ K2.ⓑ{I2}V2 → + ∧∧ K1 ⪤[R,V1] K2 & R K1 V1 V2 & I1 = I2. #R #L1 #L2 #i #H12 #I1 #K1 #V1 #H1 #I2 #K2 #V2 #H2 elim (rex_inv_lref_pair_sn … H12 … H1) -L1 #Y2 #X2 #HLY2 #HK12 #HV12 lapply (drops_mono … HLY2 … H2) -HLY2 -H2 #H destruct /2 width=1 by and3_intro/ qed-. -lemma rex_inv_lref_unit_sn: ∀R,L1,L2,i. L1 ⪤[R, #i] L2 → ∀I,K1. ⬇*[i] L1 ≘ K1.ⓤ{I} → - ∃∃f,K2. ⬇*[i] L2 ≘ K2.ⓤ{I} & K1 ⪤[cext2 R, cfull, f] K2 & 𝐈⦃f⦄. +lemma rex_inv_lref_unit_sn (R): + ∀L1,L2,i. L1 ⪤[R,#i] L2 → ∀I,K1. ⬇*[i] L1 ≘ K1.ⓤ{I} → + ∃∃f,K2. ⬇*[i] L2 ≘ K2.ⓤ{I} & K1 ⪤[cext2 R,cfull,f] K2 & 𝐈⦃f⦄. #R #L1 #L2 #i #HL12 #I #K1 #HLK1 elim (rex_dropable_sn … HLK1 … HL12 (#0)) -HLK1 -HL12 // #Y #HY #HLK2 elim (rex_inv_zero_unit_sn … HY) -HY #f #K2 #Hf #HK12 #H destruct /2 width=5 by ex3_2_intro/ qed-. -lemma rex_inv_lref_unit_dx: ∀R,L1,L2,i. L1 ⪤[R, #i] L2 → ∀I,K2. ⬇*[i] L2 ≘ K2.ⓤ{I} → - ∃∃f,K1. ⬇*[i] L1 ≘ K1.ⓤ{I} & K1 ⪤[cext2 R, cfull, f] K2 & 𝐈⦃f⦄. +lemma rex_inv_lref_unit_dx (R): + ∀L1,L2,i. L1 ⪤[R,#i] L2 → ∀I,K2. ⬇*[i] L2 ≘ K2.ⓤ{I} → + ∃∃f,K1. ⬇*[i] L1 ≘ K1.ⓤ{I} & K1 ⪤[cext2 R,cfull,f] K2 & 𝐈⦃f⦄. #R #L1 #L2 #i #HL12 #I #K2 #HLK2 elim (rex_dropable_dx … HL12 … HLK2 … (#0)) -HLK2 -HL12 // #Y #HLK1 #HY elim (rex_inv_zero_unit_dx … HY) -HY #f #K2 #Hf #HK12 #H destruct /2 width=5 by ex3_2_intro/ diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rex_fqup.ma b/matita/matita/contribs/lambdadelta/static_2/static/rex_fqup.ma index c45914f34..601e8b28d 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex_fqup.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex_fqup.ma @@ -20,13 +20,14 @@ include "static_2/static/rex.ma". (* Advanced properties ******************************************************) (* Basic_2A1: uses: llpx_sn_refl *) -lemma rex_refl: ∀R. (∀L. reflexive … (R L)) → ∀L,T. L ⪤[R, T] L. +lemma rex_refl (R): (∀L. reflexive … (R L)) → ∀L,T. L ⪤[R,T] L. #R #HR #L #T elim (frees_total L T) /4 width=3 by sex_refl, ext2_refl, ex2_intro/ qed. -lemma rex_pair_refl: ∀R. (∀L. reflexive … (R L)) → - ∀L,V1,V2. R L V1 V2 → ∀I,T. L.ⓑ{I}V1 ⪤[R, T] L.ⓑ{I}V2. +lemma rex_pair_refl (R): + (∀L. reflexive … (R L)) → + ∀L,V1,V2. R L V1 V2 → ∀I,T. L.ⓑ{I}V1 ⪤[R,T] L.ⓑ{I}V2. #R #HR #L #V1 #V2 #HV12 #I #T elim (frees_total (L.ⓑ{I}V1) T) #f #Hf elim (pn_split f) * #g #H destruct @@ -35,15 +36,15 @@ qed. (* Advanced inversion lemmas ************************************************) -lemma rex_inv_bind_void: ∀R,p,I,L1,L2,V,T. L1 ⪤[R, ⓑ{p,I}V.T] L2 → - L1 ⪤[R, V] L2 ∧ L1.ⓧ ⪤[R, T] L2.ⓧ. +lemma rex_inv_bind_void (R): + ∀p,I,L1,L2,V,T. L1 ⪤[R,ⓑ{p,I}V.T] L2 → L1 ⪤[R,V] L2 ∧ L1.ⓧ ⪤[R,T] L2.ⓧ. #R #p #I #L1 #L2 #V #T * #f #Hf #HL elim (frees_inv_bind_void … Hf) -Hf /6 width=6 by sle_sex_trans, sex_inv_tl, sor_inv_sle_dx, sor_inv_sle_sn, ex2_intro, conj/ qed-. (* Advanced forward lemmas **************************************************) -lemma rex_fwd_bind_dx_void: ∀R,p,I,L1,L2,V,T. L1 ⪤[R, ⓑ{p,I}V.T] L2 → - L1.ⓧ ⪤[R, T] L2.ⓧ. +lemma rex_fwd_bind_dx_void (R): + ∀p,I,L1,L2,V,T. L1 ⪤[R,ⓑ{p,I}V.T] L2 → L1.ⓧ ⪤[R,T] L2.ⓧ. #R #p #I #L1 #L2 #V #T #H elim (rex_inv_bind_void … H) -H // qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rex_fsle.ma b/matita/matita/contribs/lambdadelta/static_2/static/rex_fsle.ma index 24f68014d..7974bb900 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex_fsle.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex_fsle.ma @@ -20,20 +20,21 @@ include "static_2/static/rex_rex.ma". (* GENERIC EXTENSION ON REFERRED ENTRIES OF A CONTEXT-SENSITIVE REALTION ****) definition R_fsge_compatible: predicate (relation3 …) ≝ λRN. - ∀L,T1,T2. RN L T1 T2 → ⦃L, T2⦄ ⊆ ⦃L, T1⦄. + ∀L,T1,T2. RN L T1 T2 → ⦃L,T2⦄ ⊆ ⦃L,T1⦄. definition rex_fsge_compatible: predicate (relation3 …) ≝ λRN. - ∀L1,L2,T. L1 ⪤[RN, T] L2 → ⦃L2, T⦄ ⊆ ⦃L1, T⦄. + ∀L1,L2,T. L1 ⪤[RN,T] L2 → ⦃L2,T⦄ ⊆ ⦃L1,T⦄. definition rex_fsle_compatible: predicate (relation3 …) ≝ λRN. - ∀L1,L2,T. L1 ⪤[RN, T] L2 → ⦃L1, T⦄ ⊆ ⦃L2, T⦄. + ∀L1,L2,T. L1 ⪤[RN,T] L2 → ⦃L1,T⦄ ⊆ ⦃L2,T⦄. (* Basic inversions with free variables inclusion for restricted closures ***) -lemma frees_sex_conf: ∀R. rex_fsge_compatible R → - ∀L1,T,f1. L1 ⊢ 𝐅*⦃T⦄ ≘ f1 → - ∀L2. L1 ⪤[cext2 R, cfull, f1] L2 → - ∃∃f2. L2 ⊢ 𝐅*⦃T⦄ ≘ f2 & f2 ⊆ f1. +lemma frees_sex_conf (R): + rex_fsge_compatible R → + ∀L1,T,f1. L1 ⊢ 𝐅+⦃T⦄ ≘ f1 → + ∀L2. L1 ⪤[cext2 R,cfull,f1] L2 → + ∃∃f2. L2 ⊢ 𝐅+⦃T⦄ ≘ f2 & f2 ⊆ f1. #R #HR #L1 #T #f1 #Hf1 #L2 #H1L lapply (HR L1 L2 T ?) /2 width=3 by ex2_intro/ #H2L @(fsle_frees_trans_eq … H2L … Hf1) /3 width=4 by sex_fwd_length, sym_eq/ @@ -41,27 +42,30 @@ qed-. (* Properties with free variables inclusion for restricted closures *********) -(* Note: we just need lveq_inv_refl: ∀L,n1,n2. L ≋ⓧ*[n1, n2] L → ∧∧ 0 = n1 & 0 = n2 *) -lemma fsge_rex_trans: ∀R,L1,T1,T2. ⦃L1, T1⦄ ⊆ ⦃L1, T2⦄ → - ∀L2. L1 ⪤[R, T2] L2 → L1 ⪤[R, T1] L2. +(* Note: we just need lveq_inv_refl: ∀L, n1, n2. L ≋ⓧ*[n1, n2] L → ∧∧ 0 = n1 & 0 = n2 *) +lemma fsge_rex_trans (R): + ∀L1,T1,T2. ⦃L1,T1⦄ ⊆ ⦃L1,T2⦄ → + ∀L2. L1 ⪤[R,T2] L2 → L1 ⪤[R,T1] L2. #R #L1 #T1 #T2 * #n1 #n2 #f1 #f2 #Hf1 #Hf2 #Hn #Hf #L2 #HL12 elim (lveq_inj_length … Hn ?) // #H1 #H2 destruct /4 width=5 by rex_inv_frees, sle_sex_trans, ex2_intro/ qed-. -lemma rex_sym: ∀R. rex_fsge_compatible R → - (∀L1,L2,T1,T2. R L1 T1 T2 → R L2 T2 T1) → - ∀T. symmetric … (rex R T). +lemma rex_sym (R): + rex_fsge_compatible R → + (∀L1,L2,T1,T2. R L1 T1 T2 → R L2 T2 T1) → + ∀T. symmetric … (rex R T). #R #H1R #H2R #T #L1 #L2 * #f1 #Hf1 #HL12 elim (frees_sex_conf … Hf1 … HL12) -Hf1 // /5 width=5 by sle_sex_trans, sex_sym, cext2_sym, ex2_intro/ qed-. -lemma rex_pair_sn_split: ∀R1,R2. (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → - rex_fsge_compatible R1 → - ∀L1,L2,V. L1 ⪤[R1, V] L2 → ∀I,T. - ∃∃L. L1 ⪤[R1, ②{I}V.T] L & L ⪤[R2, V] L2. +lemma rex_pair_sn_split (R1) (R2): + (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → + rex_fsge_compatible R1 → + ∀L1,L2,V. L1 ⪤[R1,V] L2 → ∀I,T. + ∃∃L. L1 ⪤[R1,②{I}V.T] L & L ⪤[R2,V] L2. #R1 #R2 #HR1 #HR2 #HR #L1 #L2 #V * #f #Hf #HL12 * [ #p ] #I #T [ elim (frees_total L1 (ⓑ{p,I}V.T)) #g #Hg elim (frees_inv_bind … Hg) #y1 #y2 #H #_ #Hy @@ -77,10 +81,11 @@ elim (frees_sex_conf … Hf … H) -Hf -H /4 width=7 by sle_sex_trans, ex2_intro/ qed-. -lemma rex_flat_dx_split: ∀R1,R2. (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → - rex_fsge_compatible R1 → - ∀L1,L2,T. L1 ⪤[R1, T] L2 → ∀I,V. - ∃∃L. L1 ⪤[R1, ⓕ{I}V.T] L & L ⪤[R2, T] L2. +lemma rex_flat_dx_split (R1) (R2): + (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → + rex_fsge_compatible R1 → + ∀L1,L2,T. L1 ⪤[R1,T] L2 → ∀I,V. + ∃∃L. L1 ⪤[R1,ⓕ{I}V.T] L & L ⪤[R2,T] L2. #R1 #R2 #HR1 #HR2 #HR #L1 #L2 #T * #f #Hf #HL12 #I #V elim (frees_total L1 (ⓕ{I}V.T)) #g #Hg elim (frees_inv_flat … Hg) #y1 #y2 #_ #H #Hy @@ -93,10 +98,11 @@ elim (frees_sex_conf … Hf … H) -Hf -H /4 width=7 by sle_sex_trans, ex2_intro/ qed-. -lemma rex_bind_dx_split: ∀R1,R2. (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → - rex_fsge_compatible R1 → - ∀I,L1,L2,V1,T. L1.ⓑ{I}V1 ⪤[R1, T] L2 → ∀p. - ∃∃L,V. L1 ⪤[R1, ⓑ{p,I}V1.T] L & L.ⓑ{I}V ⪤[R2, T] L2 & R1 L1 V1 V. +lemma rex_bind_dx_split (R1) (R2): + (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → + rex_fsge_compatible R1 → + ∀I,L1,L2,V1,T. L1.ⓑ{I}V1 ⪤[R1,T] L2 → ∀p. + ∃∃L,V. L1 ⪤[R1,ⓑ{p,I}V1.T] L & L.ⓑ{I}V ⪤[R2,T] L2 & R1 L1 V1 V. #R1 #R2 #HR1 #HR2 #HR #I #L1 #L2 #V1 #T * #f #Hf #HL12 #p elim (frees_total L1 (ⓑ{p,I}V1.T)) #g #Hg elim (frees_inv_bind … Hg) #y1 #y2 #_ #H #Hy @@ -113,10 +119,11 @@ elim (frees_sex_conf … Hf … H0) -Hf -H0 /4 width=7 by sle_sex_trans, ex3_2_intro, ex2_intro/ qed-. -lemma rex_bind_dx_split_void: ∀R1,R2. (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → - rex_fsge_compatible R1 → - ∀L1,L2,T. L1.ⓧ ⪤[R1, T] L2 → ∀p,I,V. - ∃∃L. L1 ⪤[R1, ⓑ{p,I}V.T] L & L.ⓧ ⪤[R2, T] L2. +lemma rex_bind_dx_split_void (R1) (R2): + (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) → + rex_fsge_compatible R1 → + ∀L1,L2,T. L1.ⓧ ⪤[R1,T] L2 → ∀p,I,V. + ∃∃L. L1 ⪤[R1,ⓑ{p,I}V.T] L & L.ⓧ ⪤[R2,T] L2. #R1 #R2 #HR1 #HR2 #HR #L1 #L2 #T * #f #Hf #HL12 #p #I #V elim (frees_total L1 (ⓑ{p,I}V.T)) #g #Hg elim (frees_inv_bind_void … Hg) #y1 #y2 #_ #H #Hy @@ -135,11 +142,10 @@ qed-. (* Main properties with free variables inclusion for restricted closures ****) -theorem rex_conf: ∀R1,R2. - rex_fsge_compatible R1 → - rex_fsge_compatible R2 → - R_confluent2_rex R1 R2 R1 R2 → - ∀T. confluent2 … (rex R1 T) (rex R2 T). +theorem rex_conf (R1) (R2): + rex_fsge_compatible R1 → rex_fsge_compatible R2 → + R_confluent2_rex R1 R2 R1 R2 → + ∀T. confluent2 … (rex R1 T) (rex R2 T). #R1 #R2 #HR1 #HR2 #HR12 #T #L0 #L1 * #f1 #Hf1 #HL01 #L2 * #f #Hf #HL02 lapply (frees_mono … Hf1 … Hf) -Hf1 #Hf12 lapply (sex_eq_repl_back … HL01 … Hf12) -f1 #HL01 @@ -164,10 +170,9 @@ elim (sex_conf … HL01 … HL02) /2 width=3 by ex2_intro/ [ | -HL01 -HL02 ] ] qed-. -theorem rex_trans_fsle: ∀R1,R2,R3. - rex_fsle_compatible R1 → f_transitive_next R1 R2 R3 → - ∀L1,L,T. L1 ⪤[R1, T] L → - ∀L2. L ⪤[R2, T] L2 → L1 ⪤[R3, T] L2. +theorem rex_trans_fsle (R1) (R2) (R3): + rex_fsle_compatible R1 → f_transitive_next R1 R2 R3 → + ∀L1,L,T. L1 ⪤[R1,T] L → ∀L2. L ⪤[R2,T] L2 → L1 ⪤[R3,T] L2. #R1 #R2 #R3 #H1R #H2R #L1 #L #T #H lapply (H1R … H) -H1R #H0 cases H -H #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2 diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rex_length.ma b/matita/matita/contribs/lambdadelta/static_2/static/rex_length.ma index e279e159d..0fa17450b 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex_length.ma @@ -20,14 +20,14 @@ include "static_2/static/rex_drops.ma". (* Forward lemmas with length for local environments ************************) (* Basic_2A1: uses: llpx_sn_fwd_length *) -lemma rex_fwd_length (R): ∀L1,L2,T. L1 ⪤[R, T] L2 → |L1| = |L2|. +lemma rex_fwd_length (R): ∀L1,L2,T. L1 ⪤[R,T] L2 → |L1| = |L2|. #R #L1 #L2 #T * /2 width=4 by sex_fwd_length/ qed-. (* Properties with length for local environments ****************************) (* Basic_2A1: uses: llpx_sn_sort *) -lemma rex_sort_length (R): ∀L1,L2. |L1| = |L2| → ∀s. L1 ⪤[R, ⋆s] L2. +lemma rex_sort_length (R): ∀L1,L2. |L1| = |L2| → ∀s. L1 ⪤[R,⋆s] L2. #R #L1 elim L1 -L1 [ #Y #H #s >(length_inv_zero_sn … H) -H // | #K1 #I1 #IH #Y #H #s @@ -37,7 +37,7 @@ lemma rex_sort_length (R): ∀L1,L2. |L1| = |L2| → ∀s. L1 ⪤[R, ⋆s] L2. qed. (* Basic_2A1: uses: llpx_sn_gref *) -lemma rex_gref_length (R): ∀L1,L2. |L1| = |L2| → ∀l. L1 ⪤[R, §l] L2. +lemma rex_gref_length (R): ∀L1,L2. |L1| = |L2| → ∀l. L1 ⪤[R,§l] L2. #R #L1 elim L1 -L1 [ #Y #H #s >(length_inv_zero_sn … H) -H // | #K1 #I1 #IH #Y #H #s @@ -46,14 +46,15 @@ lemma rex_gref_length (R): ∀L1,L2. |L1| = |L2| → ∀l. L1 ⪤[R, §l] L2. ] qed. -lemma rex_unit_length (R): ∀L1,L2. |L1| = |L2| → ∀I. L1.ⓤ{I} ⪤[R, #0] L2.ⓤ{I}. +lemma rex_unit_length (R): ∀L1,L2. |L1| = |L2| → ∀I. L1.ⓤ{I} ⪤[R,#0] L2.ⓤ{I}. /3 width=3 by rex_unit, sex_length_isid/ qed. (* Basic_2A1: uses: llpx_sn_lift_le llpx_sn_lift_ge *) -lemma rex_lifts_bi (R): d_liftable2_sn … lifts R → - ∀L1,L2. |L1| = |L2| → ∀K1,K2,T. K1 ⪤[R, T] K2 → - ∀b,f. ⬇*[b, f] L1 ≘ K1 → ⬇*[b, f] L2 ≘ K2 → - ∀U. ⬆*[f] T ≘ U → L1 ⪤[R, U] L2. +lemma rex_lifts_bi (R): + d_liftable2_sn … lifts R → + ∀L1,L2. |L1| = |L2| → ∀K1,K2,T. K1 ⪤[R,T] K2 → + ∀b,f. ⬇*[b,f] L1 ≘ K1 → ⬇*[b,f] L2 ≘ K2 → + ∀U. ⬆*[f] T ≘ U → L1 ⪤[R,U] L2. #R #HR #L1 #L2 #HL12 #K1 #K2 #T * #f1 #Hf1 #HK12 #b #f #HLK1 #HLK2 #U #HTU elim (frees_total L1 U) #f2 #Hf2 lapply (frees_fwd_coafter … Hf2 … HLK1 … HTU … Hf1) -HTU #Hf @@ -62,11 +63,12 @@ qed-. (* Inversion lemmas with length for local environment ***********************) -lemma rex_inv_zero_length (R): ∀Y1,Y2. Y1 ⪤[R, #0] Y2 → - ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ - | ∃∃I,L1,L2,V1,V2. L1 ⪤[R, V1] L2 & R L1 V1 V2 & - Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2 - | ∃∃I,L1,L2. |L1| = |L2| & Y1 = L1.ⓤ{I} & Y2 = L2.ⓤ{I}. +lemma rex_inv_zero_length (R): + ∀Y1,Y2. Y1 ⪤[R,#0] Y2 → + ∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆ + | ∃∃I,L1,L2,V1,V2. L1 ⪤[R,V1] L2 & R L1 V1 V2 & + Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2 + | ∃∃I,L1,L2. |L1| = |L2| & Y1 = L1.ⓤ{I} & Y2 = L2.ⓤ{I}. #R #Y1 #Y2 #H elim (rex_inv_zero … H) -H * /4 width=9 by sex_fwd_length, ex4_5_intro, ex3_3_intro, or3_intro2, or3_intro1, or3_intro0, conj/ qed-. 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 ffaebbc2e..dd074c1c4 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex_lex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex_lex.ma @@ -20,7 +20,8 @@ include "static_2/static/req.ma". (* Properties with generic extension of a context-sensitive relation ********) -lemma rex_lex: ∀R,L1,L2. L1 ⪤[R] L2 → ∀T. L1 ⪤[R, T] L2. +lemma rex_lex (R): + ∀L1,L2. L1 ⪤[R] L2 → ∀T. L1 ⪤[R,T] L2. #R #L1 #L2 * #f #Hf #HL12 #T elim (frees_total L1 T) #g #Hg /4 width=5 by sex_sdj, sdj_isid_sn, ex2_intro/ @@ -28,10 +29,10 @@ qed. (* Inversion lemmas with generic extension of a context sensitive relation **) -lemma rex_inv_lex_req: ∀R. c_reflexive … R → - rex_fsge_compatible R → - ∀L1,L2,T. L1 ⪤[R, T] L2 → - ∃∃L. L1 ⪤[R] L & L ≡[T] L2. +lemma rex_inv_lex_req (R): + c_reflexive … R → rex_fsge_compatible 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 … ceq_ext … HL 𝐈𝐝 ?) -HL [ #L0 #HL10 #HL02 |*: /2 width=1 by ext2_refl, sdj_isid_dx/ ] -H1R diff --git a/matita/matita/contribs/lambdadelta/static_2/static/rex_rex.ma b/matita/matita/contribs/lambdadelta/static_2/static/rex_rex.ma index 08a4f192c..10d2b9178 100644 --- a/matita/matita/contribs/lambdadelta/static_2/static/rex_rex.ma +++ b/matita/matita/contribs/lambdadelta/static_2/static/rex_rex.ma @@ -20,16 +20,18 @@ include "static_2/static/rex.ma". (* Advanced inversion lemmas ************************************************) -lemma rex_inv_frees: ∀R,L1,L2,T. L1 ⪤[R, T] L2 → - ∀f. L1 ⊢ 𝐅*⦃T⦄ ≘ f → L1 ⪤[cext2 R, cfull, f] L2. +lemma rex_inv_frees (R): + ∀L1,L2,T. L1 ⪤[R,T] L2 → + ∀f. L1 ⊢ 𝐅+⦃T⦄ ≘ f → L1 ⪤[cext2 R,cfull,f] L2. #R #L1 #L2 #T * /3 width=6 by frees_mono, sex_eq_repl_back/ qed-. (* Advanced properties ******************************************************) (* Basic_2A1: uses: llpx_sn_dec *) -lemma rex_dec: ∀R. (∀L,T1,T2. Decidable (R L T1 T2)) → - ∀L1,L2,T. Decidable (L1 ⪤[R, T] L2). +lemma rex_dec (R): + (∀L,T1,T2. Decidable (R L T1 T2)) → + ∀L1,L2,T. Decidable (L1 ⪤[R,T] L2). #R #HR #L1 #L2 #T elim (frees_total L1 T) #f #Hf elim (sex_dec (cext2 R) cfull … L1 L2 f) @@ -39,25 +41,23 @@ qed-. (* Main properties **********************************************************) (* Basic_2A1: uses: llpx_sn_bind llpx_sn_bind_O *) -theorem rex_bind: ∀R,p,I,L1,L2,V1,V2,T. - L1 ⪤[R, V1] L2 → L1.ⓑ{I}V1 ⪤[R, T] L2.ⓑ{I}V2 → - L1 ⪤[R, ⓑ{p,I}V1.T] L2. +theorem rex_bind (R) (p) (I): + ∀L1,L2,V1,V2,T. L1 ⪤[R,V1] L2 → L1.ⓑ{I}V1 ⪤[R,T] L2.ⓑ{I}V2 → + L1 ⪤[R,ⓑ{p,I}V1.T] L2. #R #p #I #L1 #L2 #V1 #V2 #T * #f1 #HV #Hf1 * #f2 #HT #Hf2 lapply (sex_fwd_bind … Hf2) -Hf2 #Hf2 elim (sor_isfin_ex f1 (⫱f2)) /3 width=7 by frees_fwd_isfin, frees_bind, sex_join, isfin_tl, ex2_intro/ qed. (* Basic_2A1: llpx_sn_flat *) -theorem rex_flat: ∀R,I,L1,L2,V,T. - L1 ⪤[R, V] L2 → L1 ⪤[R, T] L2 → - L1 ⪤[R, ⓕ{I}V.T] L2. +theorem rex_flat (R) (I): + ∀L1,L2,V,T. L1 ⪤[R,V] L2 → L1 ⪤[R,T] L2 → L1 ⪤[R,ⓕ{I}V.T] L2. #R #I #L1 #L2 #V #T * #f1 #HV #Hf1 * #f2 #HT #Hf2 elim (sor_isfin_ex f1 f2) /3 width=7 by frees_fwd_isfin, frees_flat, sex_join, ex2_intro/ qed. -theorem rex_bind_void: ∀R,p,I,L1,L2,V,T. - L1 ⪤[R, V] L2 → L1.ⓧ ⪤[R, T] L2.ⓧ → - L1 ⪤[R, ⓑ{p,I}V.T] L2. +theorem rex_bind_void (R) (p) (I): + ∀L1,L2,V,T. L1 ⪤[R,V] L2 → L1.ⓧ ⪤[R,T] L2.ⓧ → L1 ⪤[R,ⓑ{p,I}V.T] L2. #R #p #I #L1 #L2 #V #T * #f1 #HV #Hf1 * #f2 #HT #Hf2 lapply (sex_fwd_bind … Hf2) -Hf2 #Hf2 elim (sor_isfin_ex f1 (⫱f2)) /3 width=7 by frees_fwd_isfin, frees_bind_void, sex_join, isfin_tl, ex2_intro/ @@ -66,24 +66,27 @@ qed. (* Negated inversion lemmas *************************************************) (* Basic_2A1: uses: nllpx_sn_inv_bind nllpx_sn_inv_bind_O *) -lemma rnex_inv_bind: ∀R. (∀L,T1,T2. Decidable (R L T1 T2)) → - ∀p,I,L1,L2,V,T. (L1 ⪤[R, ⓑ{p,I}V.T] L2 → ⊥) → - (L1 ⪤[R, V] L2 → ⊥) ∨ (L1.ⓑ{I}V ⪤[R, T] L2.ⓑ{I}V → ⊥). +lemma rnex_inv_bind (R): + (∀L,T1,T2. Decidable (R L T1 T2)) → + ∀p,I,L1,L2,V,T. (L1 ⪤[R,ⓑ{p,I}V.T] L2 → ⊥) → + ∨∨ (L1 ⪤[R,V] L2 → ⊥) | (L1.ⓑ{I}V ⪤[R,T] L2.ⓑ{I}V → ⊥). #R #HR #p #I #L1 #L2 #V #T #H elim (rex_dec … HR L1 L2 V) /4 width=2 by rex_bind, or_intror, or_introl/ qed-. (* Basic_2A1: uses: nllpx_sn_inv_flat *) -lemma rnex_inv_flat: ∀R. (∀L,T1,T2. Decidable (R L T1 T2)) → - ∀I,L1,L2,V,T. (L1 ⪤[R, ⓕ{I}V.T] L2 → ⊥) → - (L1 ⪤[R, V] L2 → ⊥) ∨ (L1 ⪤[R, T] L2 → ⊥). +lemma rnex_inv_flat (R): + (∀L,T1,T2. Decidable (R L T1 T2)) → + ∀I,L1,L2,V,T. (L1 ⪤[R,ⓕ{I}V.T] L2 → ⊥) → + ∨∨ (L1 ⪤[R,V] L2 → ⊥) | (L1 ⪤[R,T] L2 → ⊥). #R #HR #I #L1 #L2 #V #T #H elim (rex_dec … HR L1 L2 V) /4 width=1 by rex_flat, or_intror, or_introl/ qed-. -lemma rnex_inv_bind_void: ∀R. (∀L,T1,T2. Decidable (R L T1 T2)) → - ∀p,I,L1,L2,V,T. (L1 ⪤[R, ⓑ{p,I}V.T] L2 → ⊥) → - (L1 ⪤[R, V] L2 → ⊥) ∨ (L1.ⓧ ⪤[R, T] L2.ⓧ → ⊥). +lemma rnex_inv_bind_void (R): + (∀L,T1,T2. Decidable (R L T1 T2)) → + ∀p,I,L1,L2,V,T. (L1 ⪤[R,ⓑ{p,I}V.T] L2 → ⊥) → + ∨∨ (L1 ⪤[R,V] L2 → ⊥) | (L1.ⓧ ⪤[R,T] L2.ⓧ → ⊥). #R #HR #p #I #L1 #L2 #V #T #H elim (rex_dec … HR L1 L2 V) /4 width=2 by rex_bind_void, or_intror, or_introl/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/aarity.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/aarity.ma index 89199fabb..db3820964 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/aarity.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/aarity.ma @@ -72,3 +72,11 @@ lemma eq_aarity_dec: ∀A1,A2:aarity. Decidable (A1 = A2). ] ] qed-. + +lemma is_apear_dec (B) (X): Decidable (∃A. ②B.A = X). +#B * [| #X #A ] +[| elim (eq_aarity_dec X B) #HX ] +[| /3 width=2 by ex_intro, or_introl/ ] +@or_intror * #A #H destruct +/2 width=1 by/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/ac.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/ac.ma new file mode 100644 index 000000000..aef4c4452 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/ac.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_2/lib/arith.ma". +include "static_2/notation/functions/one_0.ma". +include "static_2/notation/functions/two_0.ma". +include "static_2/notation/functions/omega_0.ma". + +(* APPLICABILITY CONDITION **************************************************) + +(* applicability condition specification *) +record ac: Type[0] ≝ { +(* applicability domain *) + ad: predicate nat +}. + +(* applicability condition postulates *) +record ac_props (a): Prop ≝ { + ac_dec: ∀m. Decidable (∃∃n. ad a n & m ≤ n) +}. + +(* Notable specifications ***************************************************) + +definition apply_top: predicate nat ≝ λn. ⊤. + +definition ac_top: ac ≝ mk_ac apply_top. + +interpretation "any number (applicability domain)" + 'Omega = (ac_top). + +lemma ac_top_props: ac_props ac_top ≝ mk_ac_props …. +/3 width=3 by or_introl, ex2_intro/ +qed. + +definition ac_eq (k): ac ≝ mk_ac (eq … k). + +interpretation "one (applicability domain)" + 'Two = (ac_eq (S O)). + +interpretation "zero (applicability domain)" + 'One = (ac_eq O). + +lemma ac_eq_props (k): ac_props (ac_eq k) ≝ mk_ac_props …. +#m elim (le_dec m k) #Hm +[ /3 width=3 by or_introl, ex2_intro/ +| @or_intror * #n #Hn #Hmn destruct /2 width=1 by/ +] +qed. + +definition ac_le (k): ac ≝ mk_ac (λn. n ≤ k). + +lemma ac_le_props (k): ac_props (ac_le k) ≝ mk_ac_props …. +#m elim (le_dec m k) #Hm +[ /3 width=3 by or_introl, ex2_intro/ +| @or_intror * #n #Hn #Hmn + /3 width=3 by transitive_le/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/acle.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/acle.ma new file mode 100644 index 000000000..30a025356 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/acle.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 "static_2/syntax/ac.ma". + +(* APPLICABILITY CONDITION PREORDER *****************************************) + +definition acle: relation ac ≝ + λa1,a2. ∀m. ad a1 m → ∃∃n. ad a2 n & m ≤ n. + +interpretation "preorder (applicability domain)" + 'subseteq a1 a2 = (acle a1 a2). + +(* Basic properties *********************************************************) + +lemma acle_refl: reflexive … acle. +/2 width=3 by ex2_intro/ qed. + +lemma acle_omega (a): a ⊆ 𝛚. +/2 width=1 by acle_refl/ +qed. + +lemma acle_one (a): ∀n. ad a n → 𝟏 ⊆ a. +#a #n #Ha #m #Hm destruct +/2 width=3 by ex2_intro/ +qed. + +lemma acle_eq_monotonic_le (k1) (k2): + k1 ≤ k2 → (ac_eq k1) ⊆ (ac_eq k2). +#k1 #k2 #Hk #m #Hm destruct +/2 width=3 by ex2_intro/ +qed. + +lemma acle_le_monotonic_le (k1) (k2): + k1 ≤ k2 → (ac_le k1) ⊆ (ac_le k2). +#k1 #k2 #Hk #m #Hm +/3 width=3 by acle_refl, transitive_le/ +qed. + +lemma acle_eq_le (k): (ac_eq k) ⊆ (ac_le k). +#k #m #Hm destruct +/2 width=1 by acle_refl, le_n/ +qed. + +lemma acle_le_eq (k): (ac_le k) ⊆ (ac_eq k). +#k #m #Hm /2 width=3 by ex2_intro/ +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/acle_acle.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/acle_acle.ma new file mode 100644 index 000000000..9b8998900 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/acle_acle.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 "static_2/syntax/acle.ma". + +(* APPLICABILITY CONDITION PREORDER *****************************************) + +(* Main properties **********************************************************) + +theorem acle_trans: Transitive … acle. +#a1 #a #Ha1 #a2 #Ha2 #m1 #Hm1 +elim (Ha1 … Hm1) -Ha1 -Hm1 #m #Ha #Hm1 +elim (Ha2 … Ha) -Ha2 -Ha #m2 #Ha2 #Hm2 +/3 width=5 by transitive_le, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/cl_restricted_weight.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/cl_restricted_weight.ma index 31c3f7adc..bc5b92945 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/cl_restricted_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/cl_restricted_weight.ma @@ -24,27 +24,27 @@ interpretation "weight (restricted closure)" 'Weight L T = (rfw L T). (* Basic properties *********************************************************) (* Basic_1: was: flt_shift *) -lemma rfw_shift: ∀p,I,K,V,T. ♯{K.ⓑ{I}V, T} < ♯{K, ⓑ{p,I}V.T}. +lemma rfw_shift: ∀p,I,K,V,T. ♯{K.ⓑ{I}V,T} < ♯{K,ⓑ{p,I}V.T}. normalize /2 width=1 by monotonic_le_plus_r/ qed. -lemma rfw_clear: ∀p,I1,I2,K,V,T. ♯{K.ⓤ{I1}, T} < ♯{K, ⓑ{p,I2}V.T}. +lemma rfw_clear: ∀p,I1,I2,K,V,T. ♯{K.ⓤ{I1},T} < ♯{K,ⓑ{p,I2}V.T}. normalize /4 width=1 by monotonic_le_plus_r, le_S_S/ qed. -lemma rfw_tpair_sn: ∀I,L,V,T. ♯{L, V} < ♯{L, ②{I}V.T}. +lemma rfw_tpair_sn: ∀I,L,V,T. ♯{L,V} < ♯{L,②{I}V.T}. normalize in ⊢ (?→?→?→?→?%%); // qed. -lemma rfw_tpair_dx: ∀I,L,V,T. ♯{L, T} < ♯{L, ②{I}V.T}. +lemma rfw_tpair_dx: ∀I,L,V,T. ♯{L,T} < ♯{L,②{I}V.T}. normalize in ⊢ (?→?→?→?→?%%); // qed. -lemma rfw_lpair_sn: ∀I,L,V,T. ♯{L, V} < ♯{L.ⓑ{I}V, T}. +lemma rfw_lpair_sn: ∀I,L,V,T. ♯{L,V} < ♯{L.ⓑ{I}V,T}. normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ qed. -lemma rfw_lpair_dx: ∀I,L,V,T. ♯{L, T} < ♯{L.ⓑ{I}V, T}. +lemma rfw_lpair_dx: ∀I,L,V,T. ♯{L,T} < ♯{L.ⓑ{I}V,T}. normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/cl_weight.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/cl_weight.ma index a51094adc..af52e35b1 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/cl_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/cl_weight.ma @@ -26,23 +26,23 @@ interpretation "weight (closure)" 'Weight G L T = (fw G L T). (* Basic properties *********************************************************) (* Basic_1: was: flt_shift *) -lemma fw_shift: ∀p,I,G,K,V,T. ♯{G, K.ⓑ{I}V, T} < ♯{G, K, ⓑ{p,I}V.T}. +lemma fw_shift: ∀p,I,G,K,V,T. ♯{G,K.ⓑ{I}V,T} < ♯{G,K,ⓑ{p,I}V.T}. normalize /2 width=1 by monotonic_le_plus_r/ qed. -lemma fw_clear: ∀p,I1,I2,G,K,V,T. ♯{G, K.ⓤ{I1}, T} < ♯{G, K, ⓑ{p,I2}V.T}. +lemma fw_clear: ∀p,I1,I2,G,K,V,T. ♯{G,K.ⓤ{I1},T} < ♯{G,K,ⓑ{p,I2}V.T}. normalize /4 width=1 by monotonic_le_plus_r, le_S_S/ qed. -lemma fw_tpair_sn: ∀I,G,L,V,T. ♯{G, L, V} < ♯{G, L, ②{I}V.T}. +lemma fw_tpair_sn: ∀I,G,L,V,T. ♯{G,L,V} < ♯{G,L,②{I}V.T}. normalize in ⊢ (?→?→?→?→?→?%%); // qed. -lemma fw_tpair_dx: ∀I,G,L,V,T. ♯{G, L, T} < ♯{G, L, ②{I}V.T}. +lemma fw_tpair_dx: ∀I,G,L,V,T. ♯{G,L,T} < ♯{G,L,②{I}V.T}. normalize in ⊢ (?→?→?→?→?→?%%); // qed. -lemma fw_lpair_sn: ∀I,G,L,V,T. ♯{G, L, V} < ♯{G, L.ⓑ{I}V, T}. +lemma fw_lpair_sn: ∀I,G,L,V,T. ♯{G,L,V} < ♯{G,L.ⓑ{I}V,T}. normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/item_sd.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/item_sd.ma deleted file mode 100644 index 8a9ae7183..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/item_sd.ma +++ /dev/null @@ -1,124 +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 "static_2/syntax/item_sh.ma". - -(* SORT DEGREE **************************************************************) - -(* sort degree specification *) -record sd (h:sh): Type[0] ≝ { - deg : relation nat; (* degree of the sort *) - deg_total: ∀s. ∃d. deg s d; (* functional relation axioms *) - deg_mono : ∀s,d1,d2. deg s d1 → deg s d2 → d1 = d2; - deg_next : ∀s,d. deg s d → deg (next h s) (↓d) (* compatibility condition *) -}. - -(* Notable specifications ***************************************************) - -definition deg_O: relation nat ≝ λs,d. d = 0. - -definition sd_O: ∀h. sd h ≝ λh. mk_sd h deg_O …. -/2 width=2 by le_n_O_to_eq, le_n, ex_intro/ defined. - -(* Basic_2A1: includes: deg_SO_pos *) -inductive deg_SO (h:sh) (s:nat) (s0:nat): predicate nat ≝ -| deg_SO_succ : ∀n. (next h)^n s0 = s → deg_SO h s s0 (↑n) -| deg_SO_zero: ((∃n. (next h)^n s0 = s) → ⊥) → deg_SO h s s0 0 -. - -fact deg_SO_inv_succ_aux: ∀h,s,s0,n0. deg_SO h s s0 n0 → ∀n. n0 = ↑n → - (next h)^n s0 = s. -#h #s #s0 #n0 * -n0 -[ #n #Hn #x #H destruct // -| #_ #x #H destruct -] -qed-. - -(* Basic_2A1: was: deg_SO_inv_pos *) -lemma deg_SO_inv_succ: ∀h,s,s0,n. deg_SO h s s0 (↑n) → (next h)^n s0 = s. -/2 width=3 by deg_SO_inv_succ_aux/ qed-. - -lemma deg_SO_refl: ∀h,s. deg_SO h s s 1. -#h #s @(deg_SO_succ … 0 ?) // -qed. - -lemma deg_SO_gt: ∀h,s1,s2. s1 < s2 → deg_SO h s1 s2 0. -#h #s1 #s2 #HK12 @deg_SO_zero * #n elim n -n normalize -[ #H destruct - elim (lt_refl_false … HK12) -| #n #_ #H - lapply (next_lt h ((next h)^n s2)) >H -H #H - lapply (transitive_lt … H HK12) -s1 #H1 - lapply (nexts_le h s2 n) #H2 - lapply (le_to_lt_to_lt … H2 H1) -h -n #H - elim (lt_refl_false … H) -] -qed. - -definition sd_SO: ∀h. nat → sd h ≝ λh,s. mk_sd h (deg_SO h s) …. -[ #s0 - lapply (nexts_dec h s0 s) * - [ * /3 width=2 by deg_SO_succ, ex_intro/ | /4 width=2 by deg_SO_zero, ex_intro/ ] -| #K0 #d1 #d2 * [ #n1 ] #H1 * [1,3: #n2 ] #H2 // - [ < H2 in H1; -H2 #H - lapply (nexts_inj … H) -H #H destruct // - | elim H1 /2 width=2 by ex_intro/ - | elim H2 /2 width=2 by ex_intro/ - ] -| #s0 #n * - [ #d #H destruct elim d -d normalize - /2 width=1 by deg_SO_gt, deg_SO_succ, next_lt/ - | #H1 @deg_SO_zero * #d #H2 destruct - @H1 -H1 @(ex_intro … (↑d)) /2 width=1 by sym_eq/ (**) (* explicit constructor *) - ] -] -defined. - -rec definition sd_d (h:sh) (s:nat) (d:nat) on d : sd h ≝ - match d with - [ O ⇒ sd_O h - | S d ⇒ match d with - [ O ⇒ sd_SO h s - | _ ⇒ sd_d h (next h s) d - ] - ]. - -(* Basic inversion lemmas ***************************************************) - -lemma deg_inv_pred: ∀h,o,s,d. deg h o (next h s) (↑d) → deg h o s (↑↑d). -#h #o #s #d #H1 -elim (deg_total h o s) #n #H0 -lapply (deg_next … H0) #H2 -lapply (deg_mono … H1 H2) -H1 -H2 #H >H >S_pred /2 width=2 by ltn_to_ltO/ -qed-. - -lemma deg_inv_prec: ∀h,o,s,n,d. deg h o ((next h)^n s) (↑d) → deg h o s (↑(d+n)). -#h #o #s #n elim n -n normalize /3 width=1 by deg_inv_pred/ -qed-. - -(* Basic properties *********************************************************) - -lemma deg_iter: ∀h,o,s,d,n. deg h o s d → deg h o ((next h)^n s) (d-n). -#h #o #s #d #n elim n -n normalize /3 width=1 by deg_next/ -qed. - -lemma deg_next_SO: ∀h,o,s,d. deg h o s (↑d) → deg h o (next h s) d. -/2 width=1 by deg_next/ qed-. - -lemma sd_d_SS: ∀h,s,d. sd_d h s (↑↑d) = sd_d h (next h s) (↑d). -// qed. - -lemma sd_d_correct: ∀h,d,s. deg h (sd_d h s d) s d. -#h #d elim d -d // #d elim d -d /3 width=1 by deg_inv_pred/ -qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/item_sh.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/item_sh.ma deleted file mode 100644 index 9e0b03f73..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/item_sh.ma +++ /dev/null @@ -1,44 +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_2/lib/arith.ma". - -(* SORT HIERARCHY ***********************************************************) - -(* sort hierarchy specification *) -record sh: Type[0] ≝ { - next : nat → nat; (* next sort in the hierarchy *) - next_lt: ∀s. s < next s (* strict monotonicity condition *) -}. - -definition sh_N: sh ≝ mk_sh S …. -// defined. - -(* Basic properties *********************************************************) - -lemma nexts_le: ∀h,s,n. s ≤ (next h)^n s. -#h #s #n elim n -n // normalize #n #IH -lapply (next_lt h ((next h)^n s)) #H -lapply (le_to_lt_to_lt … IH H) -IH -H /2 width=2 by lt_to_le/ -qed. - -lemma nexts_lt: ∀h,s,n. s < (next h)^(↑n) s. -#h #s #n normalize -lapply (nexts_le h s n) #H -@(le_to_lt_to_lt … H) // -qed. - -axiom nexts_dec: ∀h,s1,s2. Decidable (∃n. (next h)^n s1 = s2). - -axiom nexts_inj: ∀h,s,n1,n2. (next h)^n1 s = (next h)^n2 s → n1 = n2. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/lveq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/lveq.ma index 855978783..e6d2fcbfc 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/lveq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/lveq.ma @@ -32,7 +32,7 @@ interpretation "equivalence up to exclusion binders (local environment)" (* Basic properties *********************************************************) -lemma lveq_refl: ∀L. L ≋ⓧ*[0, 0] L. +lemma lveq_refl: ∀L. L ≋ⓧ*[0,0] L. #L elim L -L /2 width=1 by lveq_atom, lveq_bind/ qed. @@ -43,10 +43,10 @@ qed-. (* Basic inversion lemmas ***************************************************) -fact lveq_inv_zero_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +fact lveq_inv_zero_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → 0 = n1 → 0 = n2 → ∨∨ ∧∧ ⋆ = L1 & ⋆ = L2 - | ∃∃I1,I2,K1,K2. K1 ≋ⓧ*[0, 0] K2 & K1.ⓘ{I1} = L1 & K2.ⓘ{I2} = L2. + | ∃∃I1,I2,K1,K2. K1 ≋ⓧ*[0,0] K2 & K1.ⓘ{I1} = L1 & K2.ⓘ{I2} = L2. #L1 #L2 #n1 #n2 * -L1 -L2 -n1 -n2 [1: /3 width=1 by or_introl, conj/ |2: /3 width=7 by ex3_4_intro, or_intror/ @@ -54,14 +54,14 @@ fact lveq_inv_zero_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → ] qed-. -lemma lveq_inv_zero: ∀L1,L2. L1 ≋ⓧ*[0, 0] L2 → +lemma lveq_inv_zero: ∀L1,L2. L1 ≋ⓧ*[0,0] L2 → ∨∨ ∧∧ ⋆ = L1 & ⋆ = L2 - | ∃∃I1,I2,K1,K2. K1 ≋ⓧ*[0, 0] K2 & K1.ⓘ{I1} = L1 & K2.ⓘ{I2} = L2. + | ∃∃I1,I2,K1,K2. K1 ≋ⓧ*[0,0] K2 & K1.ⓘ{I1} = L1 & K2.ⓘ{I2} = L2. /2 width=5 by lveq_inv_zero_aux/ qed-. -fact lveq_inv_succ_sn_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +fact lveq_inv_succ_sn_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → ∀m1. ↑m1 = n1 → - ∃∃K1. K1 ≋ⓧ*[m1, 0] L2 & K1.ⓧ = L1 & 0 = n2. + ∃∃K1. K1 ≋ⓧ*[m1,0] L2 & K1.ⓧ = L1 & 0 = n2. #L1 #L2 #n1 #n2 * -L1 -L2 -n1 -n2 [1: #m #H destruct |2: #I1 #I2 #K1 #K2 #_ #m #H destruct @@ -69,18 +69,18 @@ fact lveq_inv_succ_sn_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → ] qed-. -lemma lveq_inv_succ_sn: ∀L1,K2,n1,n2. L1 ≋ⓧ*[↑n1, n2] K2 → - ∃∃K1. K1 ≋ⓧ*[n1, 0] K2 & K1.ⓧ = L1 & 0 = n2. +lemma lveq_inv_succ_sn: ∀L1,K2,n1,n2. L1 ≋ⓧ*[↑n1,n2] K2 → + ∃∃K1. K1 ≋ⓧ*[n1,0] K2 & K1.ⓧ = L1 & 0 = n2. /2 width=3 by lveq_inv_succ_sn_aux/ qed-. -lemma lveq_inv_succ_dx: ∀K1,L2,n1,n2. K1 ≋ⓧ*[n1, ↑n2] L2 → - ∃∃K2. K1 ≋ⓧ*[0, n2] K2 & K2.ⓧ = L2 & 0 = n1. +lemma lveq_inv_succ_dx: ∀K1,L2,n1,n2. K1 ≋ⓧ*[n1,↑n2] L2 → + ∃∃K2. K1 ≋ⓧ*[0,n2] K2 & K2.ⓧ = L2 & 0 = n1. #K1 #L2 #n1 #n2 #H lapply (lveq_sym … H) -H #H elim (lveq_inv_succ_sn … H) -H /3 width=3 by lveq_sym, ex3_intro/ qed-. -fact lveq_inv_succ_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +fact lveq_inv_succ_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → ∀m1,m2. ↑m1 = n1 → ↑m2 = n2 → ⊥. #L1 #L2 #n1 #n2 * -L1 -L2 -n1 -n2 [1: #m1 #m2 #H1 #H2 destruct @@ -89,17 +89,17 @@ fact lveq_inv_succ_aux: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → ] qed-. -lemma lveq_inv_succ: ∀L1,L2,n1,n2. L1 ≋ⓧ*[↑n1, ↑n2] L2 → ⊥. +lemma lveq_inv_succ: ∀L1,L2,n1,n2. L1 ≋ⓧ*[↑n1,↑n2] L2 → ⊥. /2 width=9 by lveq_inv_succ_aux/ qed-. (* Advanced inversion lemmas ************************************************) -lemma lveq_inv_bind: ∀I1,I2,K1,K2. K1.ⓘ{I1} ≋ⓧ*[0, 0] K2.ⓘ{I2} → K1 ≋ⓧ*[0, 0] K2. +lemma lveq_inv_bind: ∀I1,I2,K1,K2. K1.ⓘ{I1} ≋ⓧ*[0,0] K2.ⓘ{I2} → K1 ≋ⓧ*[0,0] K2. #I1 #I2 #K1 #K2 #H elim (lveq_inv_zero … H) -H * [| #Z1 #Z2 #Y1 #Y2 #HY ] #H1 #H2 destruct // qed-. -lemma lveq_inv_atom_atom: ∀n1,n2. ⋆ ≋ⓧ*[n1, n2] ⋆ → ∧∧ 0 = n1 & 0 = n2. +lemma lveq_inv_atom_atom: ∀n1,n2. ⋆ ≋ⓧ*[n1,n2] ⋆ → ∧∧ 0 = n1 & 0 = n2. * [2: #n1 ] * [2,4: #n2 ] #H [ elim (lveq_inv_succ … H) | elim (lveq_inv_succ_dx … H) -H #Y #_ #H1 #H2 destruct @@ -108,8 +108,8 @@ lemma lveq_inv_atom_atom: ∀n1,n2. ⋆ ≋ⓧ*[n1, n2] ⋆ → ∧∧ 0 = n1 & ] qed-. -lemma lveq_inv_bind_atom: ∀I1,K1,n1,n2. K1.ⓘ{I1} ≋ⓧ*[n1, n2] ⋆ → - ∃∃m1. K1 ≋ⓧ*[m1, 0] ⋆ & BUnit Void = I1 & ↑m1 = n1 & 0 = n2. +lemma lveq_inv_bind_atom: ∀I1,K1,n1,n2. K1.ⓘ{I1} ≋ⓧ*[n1,n2] ⋆ → + ∃∃m1. K1 ≋ⓧ*[m1,0] ⋆ & BUnit Void = I1 & ↑m1 = n1 & 0 = n2. #I1 #K1 * [2: #n1 ] * [2,4: #n2 ] #H [ elim (lveq_inv_succ … H) | elim (lveq_inv_succ_dx … H) -H #Y #_ #H1 #H2 destruct @@ -121,16 +121,16 @@ lemma lveq_inv_bind_atom: ∀I1,K1,n1,n2. K1.ⓘ{I1} ≋ⓧ*[n1, n2] ⋆ → ] qed-. -lemma lveq_inv_atom_bind: ∀I2,K2,n1,n2. ⋆ ≋ⓧ*[n1, n2] K2.ⓘ{I2} → - ∃∃m2. ⋆ ≋ⓧ*[0, m2] K2 & BUnit Void = I2 & 0 = n1 & ↑m2 = n2. +lemma lveq_inv_atom_bind: ∀I2,K2,n1,n2. ⋆ ≋ⓧ*[n1,n2] K2.ⓘ{I2} → + ∃∃m2. ⋆ ≋ⓧ*[0,m2] K2 & BUnit Void = I2 & 0 = n1 & ↑m2 = n2. #I2 #K2 #n1 #n2 #H lapply (lveq_sym … H) -H #H elim (lveq_inv_bind_atom … H) -H /3 width=3 by lveq_sym, ex4_intro/ qed-. -lemma lveq_inv_pair_pair: ∀I1,I2,K1,K2,V1,V2,n1,n2. K1.ⓑ{I1}V1 ≋ⓧ*[n1, n2] K2.ⓑ{I2}V2 → - ∧∧ K1 ≋ⓧ*[0, 0] K2 & 0 = n1 & 0 = n2. +lemma lveq_inv_pair_pair: ∀I1,I2,K1,K2,V1,V2,n1,n2. K1.ⓑ{I1}V1 ≋ⓧ*[n1,n2] K2.ⓑ{I2}V2 → + ∧∧ K1 ≋ⓧ*[0,0] K2 & 0 = n1 & 0 = n2. #I1 #I2 #K1 #K2 #V1 #V2 * [2: #n1 ] * [2,4: #n2 ] #H [ elim (lveq_inv_succ … H) | elim (lveq_inv_succ_dx … H) -H #Y #_ #H1 #H2 destruct @@ -142,14 +142,14 @@ lemma lveq_inv_pair_pair: ∀I1,I2,K1,K2,V1,V2,n1,n2. K1.ⓑ{I1}V1 ≋ⓧ*[n1, n ] qed-. -lemma lveq_inv_void_succ_sn: ∀L1,L2,n1,n2. L1.ⓧ ≋ⓧ*[↑n1, n2] L2 → - ∧∧ L1 ≋ ⓧ*[n1, 0] L2 & 0 = n2. +lemma lveq_inv_void_succ_sn: ∀L1,L2,n1,n2. L1.ⓧ ≋ⓧ*[↑n1,n2] L2 → + ∧∧ L1 ≋ ⓧ*[n1,0] L2 & 0 = n2. #L1 #L2 #n1 #n2 #H elim (lveq_inv_succ_sn … H) -H #Y #HY #H1 #H2 destruct /2 width=1 by conj/ qed-. -lemma lveq_inv_void_succ_dx: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, ↑n2] L2.ⓧ → - ∧∧ L1 ≋ ⓧ*[0, n2] L2 & 0 = n1. +lemma lveq_inv_void_succ_dx: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,↑n2] L2.ⓧ → + ∧∧ L1 ≋ ⓧ*[0,n2] L2 & 0 = n1. #L1 #L2 #n1 #n2 #H lapply (lveq_sym … H) -H #H elim (lveq_inv_void_succ_sn … H) -H @@ -158,19 +158,19 @@ qed-. (* Advanced forward lemmas **************************************************) -lemma lveq_fwd_gen: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +lemma lveq_fwd_gen: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → ∨∨ 0 = n1 | 0 = n2. #L1 #L2 * [2: #n1 ] * [2,4: #n2 ] #H [ elim (lveq_inv_succ … H) ] /2 width=1 by or_introl, or_intror/ qed-. -lemma lveq_fwd_pair_sn: ∀I1,K1,L2,V1,n1,n2. K1.ⓑ{I1}V1 ≋ⓧ*[n1, n2] L2 → 0 = n1. +lemma lveq_fwd_pair_sn: ∀I1,K1,L2,V1,n1,n2. K1.ⓑ{I1}V1 ≋ⓧ*[n1,n2] L2 → 0 = n1. #I1 #K1 #L2 #V1 * [2: #n1 ] // * [2: #n2 ] #H [ elim (lveq_inv_succ … H) | elim (lveq_inv_succ_sn … H) -H #Y #_ #H1 #H2 destruct ] qed-. -lemma lveq_fwd_pair_dx: ∀I2,L1,K2,V2,n1,n2. L1 ≋ⓧ*[n1, n2] K2.ⓑ{I2}V2 → 0 = n2. +lemma lveq_fwd_pair_dx: ∀I2,L1,K2,V2,n1,n2. L1 ≋ⓧ*[n1,n2] K2.ⓑ{I2}V2 → 0 = n2. /3 width=6 by lveq_fwd_pair_sn, lveq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_length.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_length.ma index 104d2b8b9..8ae0a99be 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_length.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_length.ma @@ -19,7 +19,7 @@ include "static_2/syntax/lveq.ma". (* Properties with length for local environments ****************************) -lemma lveq_length_eq: ∀L1,L2. |L1| = |L2| → L1 ≋ⓧ*[0, 0] L2. +lemma lveq_length_eq: ∀L1,L2. |L1| = |L2| → L1 ≋ⓧ*[0,0] L2. #L1 elim L1 -L1 [ #Y2 #H >(length_inv_zero_sn … H) -Y2 /2 width=3 by lveq_atom, ex_intro/ | #K1 #I1 #IH #Y2 #H @@ -30,69 +30,69 @@ qed. (* Forward lemmas with length for local environments ************************) -lemma lveq_fwd_length_le_sn: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → n1 ≤ |L1|. +lemma lveq_fwd_length_le_sn: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → n1 ≤ |L1|. #L1 #L2 #n1 #n2 #H elim H -L1 -L2 -n1 -n2 normalize /2 width=1 by le_S_S/ qed-. -lemma lveq_fwd_length_le_dx: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → n2 ≤ |L2|. +lemma lveq_fwd_length_le_dx: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → n2 ≤ |L2|. #L1 #L2 #n1 #n2 #H elim H -L1 -L2 -n1 -n2 normalize /2 width=1 by le_S_S/ qed-. -lemma lveq_fwd_length: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +lemma lveq_fwd_length: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → ∧∧ |L1|-|L2| = n1 & |L2|-|L1| = n2. #L1 #L2 #n1 #n2 #H elim H -L1 -L2 -n1 -n2 /2 width=1 by conj/ #K1 #K2 #n #_ * #H1 #H2 >length_bind /3 width=1 by minus_Sn_m, conj/ qed-. -lemma lveq_length_fwd_sn: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → |L1| ≤ |L2| → 0 = n1. +lemma lveq_length_fwd_sn: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → |L1| ≤ |L2| → 0 = n1. #L1 #L2 #n1 #n2 #H #HL elim (lveq_fwd_length … H) -H >(eq_minus_O … HL) // qed-. -lemma lveq_length_fwd_dx: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → |L2| ≤ |L1| → 0 = n2. +lemma lveq_length_fwd_dx: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → |L2| ≤ |L1| → 0 = n2. #L1 #L2 #n1 #n2 #H #HL elim (lveq_fwd_length … H) -H >(eq_minus_O … HL) // qed-. -lemma lveq_inj_length: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +lemma lveq_inj_length: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → |L1| = |L2| → ∧∧ 0 = n1 & 0 = n2. #L1 #L2 #n1 #n2 #H #HL elim (lveq_fwd_length … H) -H >HL -HL /2 width=1 by conj/ qed-. -lemma lveq_fwd_length_plus: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +lemma lveq_fwd_length_plus: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → |L1| + n2 = |L2| + n1. #L1 #L2 #n1 #n2 #H elim H -L1 -L2 -n1 -n2 normalize /2 width=2 by injective_plus_r/ qed-. -lemma lveq_fwd_length_eq: ∀L1,L2. L1 ≋ⓧ*[0, 0] L2 → |L1| = |L2|. +lemma lveq_fwd_length_eq: ∀L1,L2. L1 ≋ⓧ*[0,0] L2 → |L1| = |L2|. /3 width=2 by lveq_fwd_length_plus, injective_plus_l/ qed-. -lemma lveq_fwd_length_minus: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → +lemma lveq_fwd_length_minus: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → |L1| - n1 = |L2| - n2. /3 width=3 by lveq_fwd_length_plus, lveq_fwd_length_le_dx, lveq_fwd_length_le_sn, plus_to_minus_2/ qed-. lemma lveq_fwd_abst_bind_length_le: ∀I1,I2,L1,L2,V1,n1,n2. - L1.ⓑ{I1}V1 ≋ⓧ*[n1, n2] L2.ⓘ{I2} → |L1| ≤ |L2|. + L1.ⓑ{I1}V1 ≋ⓧ*[n1,n2] L2.ⓘ{I2} → |L1| ≤ |L2|. #I1 #I2 #L1 #L2 #V1 #n1 #n2 #HL lapply (lveq_fwd_pair_sn … HL) #H destruct elim (lveq_fwd_length … HL) -HL >length_bind >length_bind // qed-. lemma lveq_fwd_bind_abst_length_le: ∀I1,I2,L1,L2,V2,n1,n2. - L1.ⓘ{I1} ≋ⓧ*[n1, n2] L2.ⓑ{I2}V2 → |L2| ≤ |L1|. + L1.ⓘ{I1} ≋ⓧ*[n1,n2] L2.ⓑ{I2}V2 → |L2| ≤ |L1|. /3 width=6 by lveq_fwd_abst_bind_length_le, lveq_sym/ qed-. (* Inversion lemmas with length for local environments **********************) -lemma lveq_inv_void_dx_length: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2.ⓧ → |L1| ≤ |L2| → - ∃∃m2. L1 ≋ ⓧ*[n1, m2] L2 & 0 = n1 & ↑m2 = n2. +lemma lveq_inv_void_dx_length: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2.ⓧ → |L1| ≤ |L2| → + ∃∃m2. L1 ≋ ⓧ*[n1,m2] L2 & 0 = n1 & ↑m2 = n2. #L1 #L2 #n1 #n2 #H #HL12 lapply (lveq_fwd_length_plus … H) normalize >plus_n_Sm #H0 lapply (plus2_inv_le_sn … H0 HL12) -H0 -HL12 #H0 @@ -100,8 +100,8 @@ elim (le_inv_S1 … H0) -H0 #m2 #_ #H0 destruct elim (lveq_inv_void_succ_dx … H) -H /2 width=3 by ex3_intro/ qed-. -lemma lveq_inv_void_sn_length: ∀L1,L2,n1,n2. L1.ⓧ ≋ⓧ*[n1, n2] L2 → |L2| ≤ |L1| → - ∃∃m1. L1 ≋ ⓧ*[m1, n2] L2 & ↑m1 = n1 & 0 = n2. +lemma lveq_inv_void_sn_length: ∀L1,L2,n1,n2. L1.ⓧ ≋ⓧ*[n1,n2] L2 → |L2| ≤ |L1| → + ∃∃m1. L1 ≋ ⓧ*[m1,n2] L2 & ↑m1 = n1 & 0 = n2. #L1 #L2 #n1 #n2 #H #HL lapply (lveq_sym … H) -H #H elim (lveq_inv_void_dx_length … H HL) -H -HL diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_lveq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_lveq.ma index 8ac40a55f..c0c8cf1ab 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_lveq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/lveq_lveq.ma @@ -18,16 +18,16 @@ include "static_2/syntax/lveq_length.ma". (* Main inversion lemmas ****************************************************) -theorem lveq_inv_bind: ∀K1,K2. K1 ≋ⓧ*[0, 0] K2 → - ∀I1,I2,m1,m2. K1.ⓘ{I1} ≋ⓧ*[m1, m2] K2.ⓘ{I2} → +theorem lveq_inv_bind: ∀K1,K2. K1 ≋ⓧ*[0,0] K2 → + ∀I1,I2,m1,m2. K1.ⓘ{I1} ≋ⓧ*[m1,m2] K2.ⓘ{I2} → ∧∧ 0 = m1 & 0 = m2. #K1 #K2 #HK #I1 #I2 #m1 #m2 #H lapply (lveq_fwd_length_eq … HK) -HK #HK elim (lveq_inj_length … H) -H normalize /3 width=1 by conj, eq_f/ qed-. -theorem lveq_inj: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1, n2] L2 → - ∀m1,m2. L1 ≋ⓧ*[m1, m2] L2 → +theorem lveq_inj: ∀L1,L2,n1,n2. L1 ≋ⓧ*[n1,n2] L2 → + ∀m1,m2. L1 ≋ⓧ*[m1,m2] L2 → ∧∧ n1 = m1 & n2 = m2. #L1 #L2 #n1 #n2 #Hn #m1 #m2 #Hm elim (lveq_fwd_length … Hn) -Hn #H1 #H2 destruct @@ -36,8 +36,8 @@ elim (lveq_fwd_length … Hm) -Hm #H1 #H2 destruct qed-. theorem lveq_inj_void_sn_ge: ∀K1,K2. |K2| ≤ |K1| → - ∀n1,n2. K1 ≋ⓧ*[n1, n2] K2 → - ∀m1,m2. K1.ⓧ ≋ⓧ*[m1, m2] K2 → + ∀n1,n2. K1 ≋ⓧ*[n1,n2] K2 → + ∀m1,m2. K1.ⓧ ≋ⓧ*[m1,m2] K2 → ∧∧ ↑n1 = m1 & 0 = m2 & 0 = n2. #L1 #L2 #HL #n1 #n2 #Hn #m1 #m2 #Hm elim (lveq_fwd_length … Hn) -Hn #H1 #H2 destruct @@ -47,7 +47,7 @@ elim (lveq_fwd_length … Hm) -Hm #H1 #H2 destruct qed-. theorem lveq_inj_void_dx_le: ∀K1,K2. |K1| ≤ |K2| → - ∀n1,n2. K1 ≋ⓧ*[n1, n2] K2 → - ∀m1,m2. K1 ≋ⓧ*[m1, m2] K2.ⓧ → + ∀n1,n2. K1 ≋ⓧ*[n1,n2] K2 → + ∀m1,m2. K1 ≋ⓧ*[m1,m2] K2.ⓧ → ∧∧ ↑n2 = m2 & 0 = m1 & 0 = n1. /3 width=5 by lveq_inj_void_sn_ge, lveq_sym/ qed-. (* auto: 2x lveq_sym *) diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/sd.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/sd.ma new file mode 100644 index 000000000..533a79e05 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/sd.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 "static_2/syntax/sh.ma". + +(* SORT DEGREE **************************************************************) + +(* sort degree specification *) +record sd: Type[0] ≝ { +(* degree of the sort *) + deg: relation nat +}. + +(* sort degree postulates *) +record sd_props (h) (o): Prop ≝ { +(* functional relation axioms *) + deg_total: ∀s. ∃d. deg o s d; + deg_mono : ∀s,d1,d2. deg o s d1 → deg o s d2 → d1 = d2; +(* compatibility condition *) + deg_next : ∀s,d. deg o s d → deg o (⫯[h]s) (↓d) +}. + +(* Notable specifications ***************************************************) + +definition deg_O: relation nat ≝ λs,d. d = 0. + +definition sd_O: sd ≝ mk_sd deg_O. + +lemma sd_O_props (h): sd_props h sd_O ≝ mk_sd_props …. +/2 width=2 by le_n_O_to_eq, le_n, ex_intro/ qed. + +(* Basic inversion lemmas ***************************************************) + +lemma deg_inv_pred (h) (o): sd_props h o → + ∀s,d. deg o (⫯[h]s) (↑d) → deg o s (↑↑d). +#h #o #Ho #s #d #H1 +elim (deg_total … Ho s) #d0 #H0 +lapply (deg_next … Ho … H0) #H2 +lapply (deg_mono … Ho … H1 H2) -H1 -H2 #H >H >S_pred +/2 width=2 by ltn_to_ltO/ +qed-. + +lemma deg_inv_prec (h) (o): sd_props h o → + ∀s,n,d. deg o ((next h)^n s) (↑d) → deg o s (↑(d+n)). +#h #o #H0 #s #n elim n -n normalize /3 width=3 by deg_inv_pred/ +qed-. + +(* Basic properties *********************************************************) + +lemma deg_iter (h) (o): sd_props h o → + ∀s,d,n. deg o s d → deg o ((next h)^n s) (d-n). +#h #o #Ho #s #d #n elim n -n normalize /3 width=1 by deg_next/ +qed. + +lemma deg_next_SO (h) (o): sd_props h o → + ∀s,d. deg o s (↑d) → deg o (next h s) d. +/2 width=1 by deg_next/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/sd_d.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/sd_d.ma new file mode 100644 index 000000000..56c80d69e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/sd_d.ma @@ -0,0 +1,99 @@ +(**************************************************************************) +(* ___ *) +(* ||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_2/pull/pull_2.ma". +include "static_2/syntax/sh_props.ma". +include "static_2/syntax/sd.ma". + +(* SORT DEGREE **************************************************************) + +(* Basic_2A1: includes: deg_SO_pos *) +inductive deg_SO (h) (s) (s0): predicate nat ≝ +| deg_SO_succ : ∀n. (next h)^n s0 = s → deg_SO h s s0 (↑n) +| deg_SO_zero: (∀n. (next h)^n s0 = s → ⊥) → deg_SO h s s0 0 +. + +fact deg_SO_inv_succ_aux (h) (s) (s0): + ∀n0. deg_SO h s s0 n0 → ∀n. n0 = ↑n → (next h)^n s0 = s. +#h #s #s0 #n0 * -n0 +[ #n #Hn #x #H destruct // +| #_ #x #H destruct +] +qed-. + +(* Basic_2A1: was: deg_SO_inv_pos *) +lemma deg_SO_inv_succ (h) (s) (s0): + ∀n. deg_SO h s s0 (↑n) → (next h)^n s0 = s. +/2 width=3 by deg_SO_inv_succ_aux/ qed-. + +lemma deg_SO_refl (h) (s): deg_SO h s s 1. +#h #s @(deg_SO_succ … 0 ?) // +qed. + +definition sd_SO (h) (s): sd ≝ mk_sd (deg_SO h s). + +lemma sd_SO_props (h) (s): sh_decidable h → sh_acyclic h → + sd_props h (sd_SO h s). +#h #s #Hhd #Hha +@mk_sd_props +[ #s0 + elim (nexts_dec … Hhd s0 s) -Hhd + [ * /3 width=2 by deg_SO_succ, ex_intro/ + | /5 width=2 by deg_SO_zero, ex_intro/ + ] +| #s0 #d1 #d2 * [ #n1 ] #H1 * [1,3: #n2 ] #H2 + [ < H2 in H1; -H2 #H + lapply (nexts_inj … Hha … H) -H #H destruct // + | elim H1 /2 width=2 by ex_intro/ + | elim H2 /2 width=2 by ex_intro/ + | // + ] +| #s0 #d * + [ #n #H destruct cases n -n normalize + [ @deg_SO_zero #n >iter_n_Sm #H + lapply (nexts_inj … Hha … (↑n) 0 H) -H #H destruct + | #n @deg_SO_succ >iter_n_Sm // + ] + | #H0 @deg_SO_zero #n >iter_n_Sm #H destruct + /2 width=2 by/ + ] +] +qed. + +rec definition sd_d (h:?) (s:?) (d:?) on d: sd ≝ + match d with + [ O ⇒ sd_O + | S d ⇒ match d with + [ O ⇒ sd_SO h s + | _ ⇒ sd_d h (next h s) d + ] + ]. + +lemma sd_d_props (h) (s) (d): sh_decidable h → sh_acyclic h → + sd_props h (sd_d h s d). +#h @pull_2 * [ // ] +#d elim d -d /2 width=1 by sd_SO_props/ +qed. + +(* Properties with sd_d *****************************************************) + +lemma sd_d_SS (h): + ∀s,d. sd_d h s (↑↑d) = sd_d h (⫯[h]s) (↑d). +// qed. + +lemma sd_d_correct (h): sh_decidable h → sh_acyclic h → + ∀s,d. deg (sd_d h s d) s d. +#h #Hhd #Hha @pull_2 #d elim d -d [ // ] +#d elim d -d /3 width=3 by deg_inv_pred, sd_d_props/ +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/sd_lt.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/sd_lt.ma new file mode 100644 index 000000000..238d1a28b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/sd_lt.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 "static_2/syntax/sh_lt.ma". +include "static_2/syntax/sd_d.ma". + +(* SORT DEGREE **************************************************************) + +(* Properties with sh_lt ****************************************************) + +lemma deg_SO_gt (h): sh_lt h → + ∀s1,s2. s1 < s2 → deg_SO h s1 s2 0. +#h #Hh #s1 #s2 #Hs12 @deg_SO_zero * normalize +[ #H destruct + elim (lt_refl_false … Hs12) +| #n #H + lapply (next_lt … Hh ((next h)^n s2)) >H -H #H + lapply (transitive_lt … H Hs12) -s1 #H1 + /3 width=5 by lt_le_false, nexts_le/ (* full auto too slow *) +] +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/sh.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/sh.ma new file mode 100644 index 000000000..bb7aacd2c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/sh.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_2/lib/arith.ma". +include "static_2/notation/functions/upspoon_2.ma". + +(* SORT HIERARCHY ***********************************************************) + +(* sort hierarchy specification *) +record sh: Type[0] ≝ { + next: nat → nat (* next sort in the hierarchy *) +}. + +interpretation "next sort (sort hierarchy)" + 'UpSpoon h s = (next h s). diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/sh_lt.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/sh_lt.ma new file mode 100644 index 000000000..494436476 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/sh_lt.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 "static_2/syntax/sh_props.ma". + +(* SORT HIERARCHY ***********************************************************) + +(* strict monotonicity condition *) +record sh_lt (h): Prop ≝ +{ + next_lt: ∀s. s < ⫯[h]s +}. + +(* Basic properties *********************************************************) + +lemma nexts_le (h): sh_lt h → ∀s,n. s ≤ (next h)^n s. +#h #Hh #s #n elim n -n [ // ] normalize #n #IH +lapply (next_lt … Hh ((next h)^n s)) #H +lapply (le_to_lt_to_lt … IH H) -IH -H /2 width=2 by lt_to_le/ +qed. + +lemma nexts_lt (h): sh_lt h → ∀s,n. s < (next h)^(↑n) s. +#h #Hh #s #n normalize +lapply (nexts_le … Hh s n) #H +@(le_to_lt_to_lt … H) /2 width=1 by next_lt/ +qed. + +axiom sh_lt_dec (h): sh_lt h → sh_decidable h. + +axiom sh_lt_acyclic (h): sh_lt h → sh_acyclic h. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/sh_props.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/sh_props.ma new file mode 100644 index 000000000..4302026d4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/sh_props.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 "static_2/syntax/sh.ma". + +(* SORT HIERARCHY ***********************************************************) + +(* acyclicity condition *) +record sh_acyclic (h): Prop ≝ +{ + nexts_inj: ∀s,n1,n2. (next h)^n1 s = (next h)^n2 s → n1 = n2 +}. + +(* decidability condition *) +record sh_decidable (h): Prop ≝ +{ + nexts_dec: ∀s1,s2. Decidable (∃n. (next h)^n s1 = s2) +}. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq.ma index 828e2ad0f..60c1e4d13 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq.ma @@ -12,125 +12,116 @@ (* *) (**************************************************************************) -include "static_2/notation/relations/stareq_4.ma". -include "static_2/syntax/item_sd.ma". +include "static_2/notation/relations/stareq_2.ma". include "static_2/syntax/term.ma". -(* DEGREE-BASED EQUIVALENCE ON TERMS ****************************************) +(* SORT-IRRELEVANT EQUIVALENCE ON TERMS *************************************) -inductive tdeq (h) (o): relation term ≝ -| tdeq_sort: ∀s1,s2,d. deg h o s1 d → deg h o s2 d → tdeq h o (⋆s1) (⋆s2) -| tdeq_lref: ∀i. tdeq h o (#i) (#i) -| tdeq_gref: ∀l. tdeq h o (§l) (§l) -| tdeq_pair: ∀I,V1,V2,T1,T2. tdeq h o V1 V2 → tdeq h o T1 T2 → tdeq h o (②{I}V1.T1) (②{I}V2.T2) +inductive tdeq: relation term ≝ +| tdeq_sort: ∀s1,s2. tdeq (⋆s1) (⋆s2) +| tdeq_lref: ∀i. tdeq (#i) (#i) +| tdeq_gref: ∀l. tdeq (§l) (§l) +| tdeq_pair: ∀I,V1,V2,T1,T2. tdeq V1 V2 → tdeq T1 T2 → tdeq (②{I}V1.T1) (②{I}V2.T2) . interpretation - "context-free degree-based equivalence (term)" - 'StarEq h o T1 T2 = (tdeq h o T1 T2). + "context-free sort-irrelevant equivalence (term)" + 'StarEq T1 T2 = (tdeq T1 T2). (* Basic properties *********************************************************) -lemma tdeq_refl: ∀h,o. reflexive … (tdeq h o). -#h #o #T elim T -T /2 width=1 by tdeq_pair/ +lemma tdeq_refl: reflexive … tdeq. +#T elim T -T /2 width=1 by tdeq_pair/ * /2 width=1 by tdeq_lref, tdeq_gref/ -#s elim (deg_total h o s) /2 width=3 by tdeq_sort/ qed. -lemma tdeq_sym: ∀h,o. symmetric … (tdeq h o). -#h #o #T1 #T2 #H elim H -T1 -T2 +lemma tdeq_sym: symmetric … tdeq. +#T1 #T2 #H elim H -T1 -T2 /2 width=3 by tdeq_sort, tdeq_lref, tdeq_gref, tdeq_pair/ qed-. (* Basic inversion lemmas ***************************************************) -fact tdeq_inv_sort1_aux: ∀h,o,X,Y. X ≛[h, o] Y → ∀s1. X = ⋆s1 → - ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2. -#h #o #X #Y * -X -Y -[ #s1 #s2 #d #Hs1 #Hs2 #s #H destruct /2 width=5 by ex3_2_intro/ +fact tdeq_inv_sort1_aux: ∀X,Y. X ≛ Y → ∀s1. X = ⋆s1 → + ∃s2. Y = ⋆s2. +#X #Y * -X -Y +[ #s1 #s2 #s #H destruct /2 width=2 by ex_intro/ | #i #s #H destruct | #l #s #H destruct | #I #V1 #V2 #T1 #T2 #_ #_ #s #H destruct ] qed-. -lemma tdeq_inv_sort1: ∀h,o,Y,s1. ⋆s1 ≛[h, o] Y → - ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2. -/2 width=3 by tdeq_inv_sort1_aux/ qed-. +lemma tdeq_inv_sort1: ∀Y,s1. ⋆s1 ≛ Y → + ∃s2. Y = ⋆s2. +/2 width=4 by tdeq_inv_sort1_aux/ qed-. -fact tdeq_inv_lref1_aux: ∀h,o,X,Y. X ≛[h, o] Y → ∀i. X = #i → Y = #i. -#h #o #X #Y * -X -Y // -[ #s1 #s2 #d #_ #_ #j #H destruct +fact tdeq_inv_lref1_aux: ∀X,Y. X ≛ Y → ∀i. X = #i → Y = #i. +#X #Y * -X -Y // +[ #s1 #s2 #j #H destruct | #I #V1 #V2 #T1 #T2 #_ #_ #j #H destruct ] qed-. -lemma tdeq_inv_lref1: ∀h,o,Y,i. #i ≛[h, o] Y → Y = #i. +lemma tdeq_inv_lref1: ∀Y,i. #i ≛ Y → Y = #i. /2 width=5 by tdeq_inv_lref1_aux/ qed-. -fact tdeq_inv_gref1_aux: ∀h,o,X,Y. X ≛[h, o] Y → ∀l. X = §l → Y = §l. -#h #o #X #Y * -X -Y // -[ #s1 #s2 #d #_ #_ #k #H destruct +fact tdeq_inv_gref1_aux: ∀X,Y. X ≛ Y → ∀l. X = §l → Y = §l. +#X #Y * -X -Y // +[ #s1 #s2 #k #H destruct | #I #V1 #V2 #T1 #T2 #_ #_ #k #H destruct ] qed-. -lemma tdeq_inv_gref1: ∀h,o,Y,l. §l ≛[h, o] Y → Y = §l. +lemma tdeq_inv_gref1: ∀Y,l. §l ≛ Y → Y = §l. /2 width=5 by tdeq_inv_gref1_aux/ qed-. -fact tdeq_inv_pair1_aux: ∀h,o,X,Y. X ≛[h, o] Y → ∀I,V1,T1. X = ②{I}V1.T1 → - ∃∃V2,T2. V1 ≛[h, o] V2 & T1 ≛[h, o] T2 & Y = ②{I}V2.T2. -#h #o #X #Y * -X -Y -[ #s1 #s2 #d #_ #_ #J #W1 #U1 #H destruct +fact tdeq_inv_pair1_aux: ∀X,Y. X ≛ Y → ∀I,V1,T1. X = ②{I}V1.T1 → + ∃∃V2,T2. V1 ≛ V2 & T1 ≛ T2 & Y = ②{I}V2.T2. +#X #Y * -X -Y +[ #s1 #s2 #J #W1 #U1 #H destruct | #i #J #W1 #U1 #H destruct | #l #J #W1 #U1 #H destruct | #I #V1 #V2 #T1 #T2 #HV #HT #J #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/ ] qed-. -lemma tdeq_inv_pair1: ∀h,o,I,V1,T1,Y. ②{I}V1.T1 ≛[h, o] Y → - ∃∃V2,T2. V1 ≛[h, o] V2 & T1 ≛[h, o] T2 & Y = ②{I}V2.T2. +lemma tdeq_inv_pair1: ∀I,V1,T1,Y. ②{I}V1.T1 ≛ Y → + ∃∃V2,T2. V1 ≛ V2 & T1 ≛ T2 & Y = ②{I}V2.T2. /2 width=3 by tdeq_inv_pair1_aux/ qed-. -lemma tdeq_inv_pair2: ∀h,o,I,X1,V2,T2. X1 ≛[h, o] ②{I}V2.T2 → - ∃∃V1,T1. V1 ≛[h, o] V2 & T1 ≛[h, o] T2 & X1 = ②{I}V1.T1. -#h #o #I #X1 #V2 #T2 #H -elim (tdeq_inv_pair1 h o I V2 T2 X1) +lemma tdeq_inv_sort2: ∀X1,s2. X1 ≛ ⋆s2 → + ∃s1. X1 = ⋆s1. +#X1 #s2 #H +elim (tdeq_inv_sort1 X1 s2) +/2 width=2 by tdeq_sym, ex_intro/ +qed-. + +lemma tdeq_inv_pair2: ∀I,X1,V2,T2. X1 ≛ ②{I}V2.T2 → + ∃∃V1,T1. V1 ≛ V2 & T1 ≛ T2 & X1 = ②{I}V1.T1. +#I #X1 #V2 #T2 #H +elim (tdeq_inv_pair1 I V2 T2 X1) [ #V1 #T1 #HV #HT #H destruct ] /3 width=5 by tdeq_sym, ex3_2_intro/ qed-. (* Advanced inversion lemmas ************************************************) -lemma tdeq_inv_sort1_deg: ∀h,o,Y,s1. ⋆s1 ≛[h, o] Y → ∀d. deg h o s1 d → - ∃∃s2. deg h o s2 d & Y = ⋆s2. -#h #o #Y #s1 #H #d #Hs1 elim (tdeq_inv_sort1 … H) -H -#s2 #x #Hx <(deg_mono h o … Hx … Hs1) -s1 -d /2 width=3 by ex2_intro/ -qed-. - -lemma tdeq_inv_sort_deg: ∀h,o,s1,s2. ⋆s1 ≛[h, o] ⋆s2 → - ∀d1,d2. deg h o s1 d1 → deg h o s2 d2 → - d1 = d2. -#h #o #s1 #y #H #d1 #d2 #Hs1 #Hy -elim (tdeq_inv_sort1_deg … H … Hs1) -s1 #s2 #Hs2 #H destruct -<(deg_mono h o … Hy … Hs2) -s2 -d1 // -qed-. - -lemma tdeq_inv_pair: ∀h,o,I1,I2,V1,V2,T1,T2. ②{I1}V1.T1 ≛[h, o] ②{I2}V2.T2 → - ∧∧ I1 = I2 & V1 ≛[h, o] V2 & T1 ≛[h, o] T2. -#h #o #I1 #I2 #V1 #V2 #T1 #T2 #H elim (tdeq_inv_pair1 … H) -H +lemma tdeq_inv_pair: ∀I1,I2,V1,V2,T1,T2. ②{I1}V1.T1 ≛ ②{I2}V2.T2 → + ∧∧ I1 = I2 & V1 ≛ V2 & T1 ≛ T2. +#I1 #I2 #V1 #V2 #T1 #T2 #H elim (tdeq_inv_pair1 … H) -H #V0 #T0 #HV #HT #H destruct /2 width=1 by and3_intro/ qed-. -lemma tdeq_inv_pair_xy_x: ∀h,o,I,V,T. ②{I}V.T ≛[h, o] V → ⊥. -#h #o #I #V elim V -V +lemma tdeq_inv_pair_xy_x: ∀I,V,T. ②{I}V.T ≛ V → ⊥. +#I #V elim V -V [ #J #T #H elim (tdeq_inv_pair1 … H) -H #X #Y #_ #_ #H destruct | #J #X #Y #IHX #_ #T #H elim (tdeq_inv_pair … H) -H #H #HY #_ destruct /2 width=2 by/ ] qed-. -lemma tdeq_inv_pair_xy_y: ∀h,o,I,T,V. ②{I}V.T ≛[h, o] T → ⊥. -#h #o #I #T elim T -T +lemma tdeq_inv_pair_xy_y: ∀I,T,V. ②{I}V.T ≛ T → ⊥. +#I #T elim T -T [ #J #V #H elim (tdeq_inv_pair1 … H) -H #X #Y #_ #_ #H destruct | #J #X #Y #_ #IHY #V #H elim (tdeq_inv_pair … H) -H #H #_ #HY destruct /2 width=2 by/ ] @@ -138,23 +129,19 @@ qed-. (* Basic forward lemmas *****************************************************) -lemma tdeq_fwd_atom1: ∀h,o,I,Y. ⓪{I} ≛[h, o] Y → ∃J. Y = ⓪{J}. -#h #o * #x #Y #H [ elim (tdeq_inv_sort1 … H) -H ] +lemma tdeq_fwd_atom1: ∀I,Y. ⓪{I} ≛ Y → ∃J. Y = ⓪{J}. +* #x #Y #H [ elim (tdeq_inv_sort1 … H) -H ] /3 width=4 by tdeq_inv_gref1, tdeq_inv_lref1, ex_intro/ qed-. (* Advanced properties ******************************************************) -lemma tdeq_dec: ∀h,o,T1,T2. Decidable (T1 ≛[h, o] T2). -#h #o #T1 elim T1 -T1 [ * #s1 | #I1 #V1 #T1 #IHV #IHT ] * [1,3,5,7: * #s2 |*: #I2 #V2 #T2 ] -[ elim (deg_total h o s1) #d1 #H1 - elim (deg_total h o s2) #d2 #H2 - elim (eq_nat_dec d1 d2) #Hd12 destruct /3 width=3 by tdeq_sort, or_introl/ - @or_intror #H - lapply (tdeq_inv_sort_deg … H … H1 H2) -H -H1 -H2 /2 width=1 by/ +lemma tdeq_dec: ∀T1,T2. Decidable (T1 ≛ T2). +#T1 elim T1 -T1 [ * #s1 | #I1 #V1 #T1 #IHV #IHT ] * [1,3,5,7: * #s2 |*: #I2 #V2 #T2 ] +[ /3 width=1 by tdeq_sort, or_introl/ |2,3,13: @or_intror #H - elim (tdeq_inv_sort1 … H) -H #x1 #x2 #_ #_ #H destruct + elim (tdeq_inv_sort1 … H) -H #x #H destruct |4,6,14: @or_intror #H lapply (tdeq_inv_lref1 … H) -H #H destruct @@ -185,13 +172,13 @@ qed-. (* Negated inversion lemmas *************************************************) -lemma tdneq_inv_pair: ∀h,o,I1,I2,V1,V2,T1,T2. - (②{I1}V1.T1 ≛[h, o] ②{I2}V2.T2 → ⊥) → +lemma tdneq_inv_pair: ∀I1,I2,V1,V2,T1,T2. + (②{I1}V1.T1 ≛ ②{I2}V2.T2 → ⊥) → ∨∨ I1 = I2 → ⊥ - | (V1 ≛[h, o] V2 → ⊥) - | (T1 ≛[h, o] T2 → ⊥). -#h #o #I1 #I2 #V1 #V2 #T1 #T2 #H12 + | (V1 ≛ V2 → ⊥) + | (T1 ≛ T2 → ⊥). +#I1 #I2 #V1 #V2 #T1 #T2 #H12 elim (eq_item2_dec I1 I2) /3 width=1 by or3_intro0/ #H destruct -elim (tdeq_dec h o V1 V2) /3 width=1 by or3_intro1/ -elim (tdeq_dec h o T1 T2) /4 width=1 by tdeq_pair, or3_intro2/ +elim (tdeq_dec V1 V2) /3 width=1 by or3_intro1/ +elim (tdeq_dec T1 T2) /4 width=1 by tdeq_pair, or3_intro2/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_ext.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_ext.ma index f13292089..09f7c5a76 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_ext.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_ext.ma @@ -12,29 +12,29 @@ (* *) (**************************************************************************) -include "static_2/notation/relations/stareq_5.ma". +include "static_2/notation/relations/stareq_3.ma". include "static_2/syntax/cext2.ma". include "static_2/syntax/tdeq.ma". -(* EXTENDED DEGREE-BASED EQUIVALENCE ****************************************) +(* EXTENDED SORT-IRRELEVANT EQUIVALENCE *************************************) -definition tdeq_ext: ∀h. sd h → relation bind ≝ - λh,o. ext2 (tdeq h o). +definition tdeq_ext: relation bind ≝ + ext2 tdeq. -definition cdeq: ∀h. sd h → relation3 lenv term term ≝ - λh,o,L. tdeq h o. +definition cdeq: relation3 lenv term term ≝ + λL. tdeq. -definition cdeq_ext: ∀h. sd h → relation3 lenv bind bind ≝ - λh,o. cext2 (cdeq h o). +definition cdeq_ext: relation3 lenv bind bind ≝ + cext2 cdeq. interpretation - "context-free degree-based equivalence (binder)" - 'StarEq h o I1 I2 = (tdeq_ext h o I1 I2). + "context-free sort-irrelevant equivalence (binder)" + 'StarEq I1 I2 = (tdeq_ext I1 I2). interpretation - "context-dependent degree-based equivalence (term)" - 'StarEq h o L T1 T2 = (cdeq h o L T1 T2). + "context-dependent sort-irrelevant equivalence (term)" + 'StarEq L T1 T2 = (cdeq L T1 T2). interpretation - "context-dependent degree-based equivalence (binder)" - 'StarEq h o L I1 I2 = (cdeq_ext h o L I1 I2). + "context-dependent sort-irrelevant equivalence (binder)" + 'StarEq L I1 I2 = (cdeq_ext L I1 I2). diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_tdeq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_tdeq.ma index a8bbec3fd..3ed01ec19 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_tdeq.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/tdeq_tdeq.ma @@ -14,14 +14,14 @@ include "static_2/syntax/tdeq.ma". -(* DEGREE-BASED EQUIVALENCE ON TERMS ****************************************) +(* SORT-IRRELEVANT EQUIVALENCE ON TERMS *************************************) (* Main properties **********************************************************) -theorem tdeq_trans: ∀h,o. Transitive … (tdeq h o). -#h #o #T1 #T #H elim H -T1 -T -[ #s1 #s #d #Hs1 #Hs #X #H - elim (tdeq_inv_sort1_deg … H … Hs) -s /2 width=3 by tdeq_sort/ +theorem tdeq_trans: Transitive … tdeq. +#T1 #T #H elim H -T1 -T +[ #s1 #s #X #H + elim (tdeq_inv_sort1 … H) -s /2 width=1 by tdeq_sort/ | #i1 #i #H <(tdeq_inv_lref1 … H) -H // | #l1 #l #H <(tdeq_inv_gref1 … H) -H // | #I #V1 #V #T1 #T #_ #_ #IHV #IHT #X #H @@ -29,22 +29,20 @@ theorem tdeq_trans: ∀h,o. Transitive … (tdeq h o). ] qed-. -theorem tdeq_canc_sn: ∀h,o. left_cancellable … (tdeq h o). +theorem tdeq_canc_sn: left_cancellable … tdeq. /3 width=3 by tdeq_trans, tdeq_sym/ qed-. -theorem tdeq_canc_dx: ∀h,o. right_cancellable … (tdeq h o). +theorem tdeq_canc_dx: right_cancellable … tdeq. /3 width=3 by tdeq_trans, tdeq_sym/ qed-. -theorem tdeq_repl: ∀h,o,T1,T2. T1 ≛[h, o] T2 → - ∀U1. T1 ≛[h, o] U1 → ∀U2. T2 ≛[h, o] U2 → U1 ≛[h, o] U2. +theorem tdeq_repl: ∀T1,T2. T1 ≛ T2 → + ∀U1. T1 ≛ U1 → ∀U2. T2 ≛ U2 → U1 ≛ U2. /3 width=3 by tdeq_canc_sn, tdeq_trans/ qed-. (* Negated main properies ***************************************************) -theorem tdeq_tdneq_trans: ∀h,o,T1,T. T1 ≛[h, o] T → ∀T2. (T ≛[h, o] T2 → ⊥) → - T1 ≛[h, o] T2 → ⊥. +theorem tdeq_tdneq_trans: ∀T1,T. T1 ≛ T → ∀T2. (T ≛ T2 → ⊥) → T1 ≛ T2 → ⊥. /3 width=3 by tdeq_canc_sn/ qed-. -theorem tdneq_tdeq_canc_dx: ∀h,o,T1,T. (T1 ≛[h, o] T → ⊥) → ∀T2. T2 ≛[h, o] T → - T1 ≛[h, o] T2 → ⊥. +theorem tdneq_tdeq_canc_dx: ∀T1,T. (T1 ≛ T → ⊥) → ∀T2. T2 ≛ T → T1 ≛ T2 → ⊥. /3 width=3 by tdeq_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/term.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/term.ma index 93cce0ffc..b0fc86df3 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/term.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/term.ma @@ -92,6 +92,13 @@ interpretation "native type annotation (term)" (* Basic properties *********************************************************) +lemma abst_dec (X): ∨∨ ∃∃p,W,T. X = ⓛ{p}W.T + | (∀p,W,T. X = ⓛ{p}W.T → ⊥). +* [ #I | * [ #p * | #I ] #V #T ] +[3: /3 width=4 by ex1_3_intro, or_introl/ ] +@or_intror #q #W #U #H destruct +qed-. + (* Basic_1: was: term_dec *) lemma eq_term_dec: ∀T1,T2:term. Decidable (T1 = T2). #T1 elim T1 -T1 #I1 [| #V1 #T1 #IHV1 #IHT1 ] * #I2 [2,4: #V2 #T2 ] diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/term_simple.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/term_simple.ma index 4bef6764d..a32b35268 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/term_simple.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/term_simple.ma @@ -12,6 +12,7 @@ (* *) (**************************************************************************) +include "ground_2/xoa/ex_1_4.ma". include "static_2/notation/relations/simple_1.ma". include "static_2/syntax/term.ma". @@ -40,3 +41,11 @@ lemma simple_inv_pair: ∀I,V,T. 𝐒⦃②{I}V.T⦄ → ∃J. I = Flat2 J. * /2 width=2 by ex_intro/ #p #I #V #T #H elim (simple_inv_bind … H) qed-. + +(* Basic properties *********************************************************) + +lemma simple_dec_ex (X): ∨∨ 𝐒⦃X⦄ | ∃∃p,I,T,U. X = ⓑ{p,I}T.U. +* [ /2 width=1 by simple_atom, or_introl/ ] +* [| /2 width=1 by simple_flat, or_introl/ ] +/3 width=5 by ex1_4_intro, or_intror/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/term_weight.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/term_weight.ma index c8d4c974d..6948a54a8 100644 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/term_weight.ma +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/term_weight.ma @@ -31,6 +31,10 @@ lemma tw_pos: ∀T. 1 ≤ ♯{T}. #T elim T -T // qed. +lemma tw_le_pair_dx (I): ∀V,T. ♯{T} < ♯{②{I}V.T}. +#I #V #T /2 width=1 by le_S_S/ +qed. + (* Basic_1: removed theorems 11: wadd_le wadd_lt wadd_O weight_le weight_eq weight_add_O weight_add_S tlt_trans tlt_head_sx tlt_head_dx tlt_wf_ind diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/theq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/theq.ma deleted file mode 100644 index 37c4af70a..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/theq.ma +++ /dev/null @@ -1,177 +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 "static_2/notation/relations/topiso_4.ma". -include "static_2/syntax/item_sd.ma". -include "static_2/syntax/term.ma". - -(* HEAD EQUIVALENCE FOR TERMS ***********************************************) - -(* Basic_2A1: includes: tsts_atom tsts_pair *) -inductive theq (h) (o): relation term ≝ -| theq_sort: ∀s1,s2,d. deg h o s1 d → deg h o s2 d → theq h o (⋆s1) (⋆s2) -| theq_lref: ∀i. theq h o (#i) (#i) -| theq_gref: ∀l. theq h o (§l) (§l) -| theq_pair: ∀I,V1,V2,T1,T2. theq h o (②{I}V1.T1) (②{I}V2.T2) -. - -interpretation "head equivalence (term)" 'TopIso h o T1 T2 = (theq h o T1 T2). - -(* Basic inversion lemmas ***************************************************) - -fact theq_inv_sort1_aux: ∀h,o,X,Y. X ⩳[h, o] Y → ∀s1. X = ⋆s1 → - ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2. -#h #o #X #Y * -X -Y -[ #s1 #s2 #d #Hs1 #Hs2 #s #H destruct /2 width=5 by ex3_2_intro/ -| #i #s #H destruct -| #l #s #H destruct -| #I #V1 #V2 #T1 #T2 #s #H destruct -] -qed-. - -(* Basic_1: was just: iso_gen_sort *) -lemma theq_inv_sort1: ∀h,o,Y,s1. ⋆s1 ⩳[h, o] Y → - ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2. -/2 width=3 by theq_inv_sort1_aux/ qed-. - -fact theq_inv_lref1_aux: ∀h,o,X,Y. X ⩳[h, o] Y → ∀i. X = #i → Y = #i. -#h #o #X #Y * -X -Y // -[ #s1 #s2 #d #_ #_ #j #H destruct -| #I #V1 #V2 #T1 #T2 #j #H destruct -] -qed-. - -(* Basic_1: was: iso_gen_lref *) -lemma theq_inv_lref1: ∀h,o,Y,i. #i ⩳[h, o] Y → Y = #i. -/2 width=5 by theq_inv_lref1_aux/ qed-. - -fact theq_inv_gref1_aux: ∀h,o,X,Y. X ⩳[h, o] Y → ∀l. X = §l → Y = §l. -#h #o #X #Y * -X -Y // -[ #s1 #s2 #d #_ #_ #k #H destruct -| #I #V1 #V2 #T1 #T2 #k #H destruct -] -qed-. - -lemma theq_inv_gref1: ∀h,o,Y,l. §l ⩳[h, o] Y → Y = §l. -/2 width=5 by theq_inv_gref1_aux/ qed-. - -fact theq_inv_pair1_aux: ∀h,o,T1,T2. T1 ⩳[h, o] T2 → - ∀J,W1,U1. T1 = ②{J}W1.U1 → - ∃∃W2,U2. T2 = ②{J}W2.U2. -#h #o #T1 #T2 * -T1 -T2 -[ #s1 #s2 #d #_ #_ #J #W1 #U1 #H destruct -| #i #J #W1 #U1 #H destruct -| #l #J #W1 #U1 #H destruct -| #I #V1 #V2 #T1 #T2 #J #W1 #U1 #H destruct /2 width=3 by ex1_2_intro/ -] -qed-. - -(* Basic_1: was: iso_gen_head *) -(* Basic_2A1: was: tsts_inv_pair1 *) -lemma theq_inv_pair1: ∀h,o,J,W1,U1,T2. ②{J}W1.U1 ⩳[h, o] T2 → - ∃∃W2,U2. T2 = ②{J}W2. U2. -/2 width=7 by theq_inv_pair1_aux/ qed-. - -fact theq_inv_pair2_aux: ∀h,o,T1,T2. T1 ⩳[h, o] T2 → - ∀J,W2,U2. T2 = ②{J}W2.U2 → - ∃∃W1,U1. T1 = ②{J}W1.U1. -#h #o #T1 #T2 * -T1 -T2 -[ #s1 #s2 #d #_ #_ #J #W2 #U2 #H destruct -| #i #J #W2 #U2 #H destruct -| #l #J #W2 #U2 #H destruct -| #I #V1 #V2 #T1 #T2 #J #W2 #U2 #H destruct /2 width=3 by ex1_2_intro/ -] -qed-. - -(* Basic_2A1: was: tsts_inv_pair2 *) -lemma theq_inv_pair2: ∀h,o,J,T1,W2,U2. T1 ⩳[h, o] ②{J}W2.U2 → - ∃∃W1,U1. T1 = ②{J}W1.U1. -/2 width=7 by theq_inv_pair2_aux/ qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma theq_inv_sort1_deg: ∀h,o,Y,s1. ⋆s1 ⩳[h, o] Y → ∀d. deg h o s1 d → - ∃∃s2. deg h o s2 d & Y = ⋆s2. -#h #o #Y #s1 #H #d #Hs1 elim (theq_inv_sort1 … H) -H -#s2 #x #Hx <(deg_mono h o … Hx … Hs1) -s1 -d /2 width=3 by ex2_intro/ -qed-. - -lemma theq_inv_sort_deg: ∀h,o,s1,s2. ⋆s1 ⩳[h, o] ⋆s2 → - ∀d1,d2. deg h o s1 d1 → deg h o s2 d2 → - d1 = d2. -#h #o #s1 #y #H #d1 #d2 #Hs1 #Hy -elim (theq_inv_sort1_deg … H … Hs1) -s1 #s2 #Hs2 #H destruct -<(deg_mono h o … Hy … Hs2) -s2 -d1 // -qed-. - -lemma theq_inv_pair: ∀h,o,I1,I2,V1,V2,T1,T2. ②{I1}V1.T1 ⩳[h, o] ②{I2}V2.T2 → - I1 = I2. -#h #o #I1 #I2 #V1 #V2 #T1 #T2 #H elim (theq_inv_pair1 … H) -H -#V0 #T0 #H destruct // -qed-. - -(* Basic properties *********************************************************) - -(* Basic_1: was: iso_refl *) -(* Basic_2A1: was: tsts_refl *) -lemma theq_refl: ∀h,o. reflexive … (theq h o). -#h #o * // -* /2 width=1 by theq_lref, theq_gref/ -#s elim (deg_total h o s) /2 width=3 by theq_sort/ -qed. - -(* Basic_2A1: was: tsts_sym *) -lemma theq_sym: ∀h,o. symmetric … (theq h o). -#h #o #T1 #T2 * -T1 -T2 /2 width=3 by theq_sort/ -qed-. - -(* Basic_2A1: was: tsts_dec *) -lemma theq_dec: ∀h,o,T1,T2. Decidable (T1 ⩳[h, o] T2). -#h #o * [ * #s1 | #I1 #V1 #T1 ] * [1,3,5,7: * #s2 |*: #I2 #V2 #T2 ] -[ elim (deg_total h o s1) #d1 #H1 - elim (deg_total h o s2) #d2 #H2 - elim (eq_nat_dec d1 d2) #Hd12 destruct /3 width=3 by theq_sort, or_introl/ - @or_intror #H - lapply (theq_inv_sort_deg … H … H1 H2) -H -H1 -H2 /2 width=1 by/ -|2,3,13: - @or_intror #H - elim (theq_inv_sort1 … H) -H #x1 #x2 #_ #_ #H destruct -|4,6,14: - @or_intror #H - lapply (theq_inv_lref1 … H) -H #H destruct -|5: - elim (eq_nat_dec s1 s2) #Hs12 destruct /2 width=1 by or_introl/ - @or_intror #H - lapply (theq_inv_lref1 … H) -H #H destruct /2 width=1 by/ -|7,8,15: - @or_intror #H - lapply (theq_inv_gref1 … H) -H #H destruct -|9: - elim (eq_nat_dec s1 s2) #Hs12 destruct /2 width=1 by or_introl/ - @or_intror #H - lapply (theq_inv_gref1 … H) -H #H destruct /2 width=1 by/ -|10,11,12: - @or_intror #H - elim (theq_inv_pair1 … H) -H #X1 #X2 #H destruct -|16: - elim (eq_item2_dec I1 I2) #HI12 destruct - [ /3 width=1 by theq_pair, or_introl/ ] - @or_intror #H - lapply (theq_inv_pair … H) -H /2 width=1 by/ -] -qed-. - -(* Basic_2A1: removed theorems 2: - tsts_inv_atom1 tsts_inv_atom2 -*) diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_simple.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/theq_simple.ma deleted file mode 100644 index 9ad5ed550..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_simple.ma +++ /dev/null @@ -1,31 +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 "static_2/syntax/term_simple.ma". -include "static_2/syntax/theq.ma". - -(* HEAD EQUIVALENCE FOR TERMS ***********************************************) - -(* Properies with simple (neutral) terms ************************************) - -(* Basic_2A1: was: simple_tsts_repl_dx *) -lemma simple_theq_repl_dx: ∀h,o,T1,T2. T1 ⩳[h, o] T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄. -#h #o #T1 #T2 * -T1 -T2 // -#I #V1 #V2 #T1 #T2 #H -elim (simple_inv_pair … H) -H #J #H destruct // -qed-. - -(* Basic_2A1: was: simple_tsts_repl_sn *) -lemma simple_theq_repl_sn: ∀h,o,T1,T2. T1 ⩳[h, o] T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄. -/3 width=5 by simple_theq_repl_dx, theq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_simple_vector.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/theq_simple_vector.ma deleted file mode 100644 index f7212ee11..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_simple_vector.ma +++ /dev/null @@ -1,31 +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 "static_2/syntax/term_vector.ma". -include "static_2/syntax/theq_simple.ma". - -(* HEAD EQUIVALENCE FOR TERMS ***********************************************) - -(* Advanced inversion lemmas with simple (neutral) terms ********************) - -(* Basic_1: was only: iso_flats_lref_bind_false iso_flats_flat_bind_false *) -(* Basic_2A1: was: tsts_inv_bind_applv_simple *) -lemma theq_inv_applv_bind_simple: ∀h,o,p,I,Vs,V2,T1,T2. ⒶVs.T1 ⩳[h, o] ⓑ{p,I}V2.T2 → - 𝐒⦃T1⦄ → ⊥. -#h #o #p #I #Vs #V2 #T1 #T2 #H elim (theq_inv_pair2 … H) -H -#V0 #T0 elim Vs -Vs normalize -[ #H destruct #H /2 width=5 by simple_inv_bind/ -| #V #Vs #_ #H destruct -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_tdeq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/theq_tdeq.ma deleted file mode 100644 index 99447dba7..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_tdeq.ma +++ /dev/null @@ -1,24 +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 "static_2/syntax/tdeq.ma". -include "static_2/syntax/theq.ma". - -(* HEAD EQUIVALENCE FOR TERMS ***********************************************) - -(* Properties with degree-based equivalence for terms ***********************) - -lemma tdeq_theq: ∀h,o,T1,T2. T1 ≛[h, o] T2 → T1 ⩳[h, o] T2. -#h #o #T1 #T2 * -T1 -T2 /2 width=3 by theq_sort, theq_pair/ -qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_theq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/theq_theq.ma deleted file mode 100644 index e9e586d00..000000000 --- a/matita/matita/contribs/lambdadelta/static_2/syntax/theq_theq.ma +++ /dev/null @@ -1,40 +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 "static_2/syntax/theq.ma". - -(* HEAD EQUIVALENCE FOR TERMS ***********************************************) - -(* Main properties **********************************************************) - -(* Basic_1: was: iso_trans *) -(* Basic_2A1: was: tsts_trans *) -theorem theq_trans: ∀h,o. Transitive … (theq h o). -#h #o #T1 #T * -T1 -T -[ #s1 #s #d #Hs1 #Hs #X #H - elim (theq_inv_sort1_deg … H … Hs) -s /2 width=3 by theq_sort/ -| #i1 #i #H <(theq_inv_lref1 … H) -H // -| #l1 #l #H <(theq_inv_gref1 … H) -H // -| #I #V1 #V #T1 #T #X #H - elim (theq_inv_pair1 … H) -H #V2 #T2 #H destruct // -] -qed-. - -(* Basic_2A1: was: tsts_canc_sn *) -theorem theq_canc_sn: ∀h,o. left_cancellable … (theq h o). -/3 width=3 by theq_trans, theq_sym/ qed-. - -(* Basic_2A1: was: tsts_canc_dx *) -theorem theq_canc_dx: ∀h,o. right_cancellable … (theq h o). -/3 width=3 by theq_trans, theq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/toeq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq.ma new file mode 100644 index 000000000..7206a1d62 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq.ma @@ -0,0 +1,159 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/notation/relations/topiso_2.ma". +include "static_2/syntax/term.ma". + +(* SORT-IRRELEVANT OUTER EQUIVALENCE FOR TERMS ******************************) + +(* Basic_2A1: includes: tsts_atom tsts_pair *) +inductive toeq: relation term ≝ +| toeq_sort: ∀s1,s2. toeq (⋆s1) (⋆s2) +| toeq_lref: ∀i. toeq (#i) (#i) +| toeq_gref: ∀l. toeq (§l) (§l) +| toeq_pair: ∀I,V1,V2,T1,T2. toeq (②{I}V1.T1) (②{I}V2.T2) +. + +interpretation + "sort-irrelevant outer equivalence (term)" + 'TopIso T1 T2 = (toeq T1 T2). + +(* Basic inversion lemmas ***************************************************) + +fact toeq_inv_sort1_aux: ∀X,Y. X ⩳ Y → ∀s1. X = ⋆s1 → + ∃s2. Y = ⋆s2. +#X #Y * -X -Y +[ #s1 #s2 #s #H destruct /2 width=2 by ex_intro/ +| #i #s #H destruct +| #l #s #H destruct +| #I #V1 #V2 #T1 #T2 #s #H destruct +] +qed-. + +(* Basic_1: was just: iso_gen_sort *) +lemma toeq_inv_sort1: ∀Y,s1. ⋆s1 ⩳ Y → + ∃s2. Y = ⋆s2. +/2 width=4 by toeq_inv_sort1_aux/ qed-. + +fact toeq_inv_lref1_aux: ∀X,Y. X ⩳ Y → ∀i. X = #i → Y = #i. +#X #Y * -X -Y // +[ #s1 #s2 #j #H destruct +| #I #V1 #V2 #T1 #T2 #j #H destruct +] +qed-. + +(* Basic_1: was: iso_gen_lref *) +lemma toeq_inv_lref1: ∀Y,i. #i ⩳ Y → Y = #i. +/2 width=5 by toeq_inv_lref1_aux/ qed-. + +fact toeq_inv_gref1_aux: ∀X,Y. X ⩳ Y → ∀l. X = §l → Y = §l. +#X #Y * -X -Y // +[ #s1 #s2 #k #H destruct +| #I #V1 #V2 #T1 #T2 #k #H destruct +] +qed-. + +lemma toeq_inv_gref1: ∀Y,l. §l ⩳ Y → Y = §l. +/2 width=5 by toeq_inv_gref1_aux/ qed-. + +fact toeq_inv_pair1_aux: ∀T1,T2. T1 ⩳ T2 → + ∀J,W1,U1. T1 = ②{J}W1.U1 → + ∃∃W2,U2. T2 = ②{J}W2.U2. +#T1 #T2 * -T1 -T2 +[ #s1 #s2 #J #W1 #U1 #H destruct +| #i #J #W1 #U1 #H destruct +| #l #J #W1 #U1 #H destruct +| #I #V1 #V2 #T1 #T2 #J #W1 #U1 #H destruct /2 width=3 by ex1_2_intro/ +] +qed-. + +(* Basic_1: was: iso_gen_head *) +(* Basic_2A1: was: tsts_inv_pair1 *) +lemma toeq_inv_pair1: ∀J,W1,U1,T2. ②{J}W1.U1 ⩳ T2 → + ∃∃W2,U2. T2 = ②{J}W2. U2. +/2 width=7 by toeq_inv_pair1_aux/ qed-. + +fact toeq_inv_pair2_aux: ∀T1,T2. T1 ⩳ T2 → + ∀J,W2,U2. T2 = ②{J}W2.U2 → + ∃∃W1,U1. T1 = ②{J}W1.U1. +#T1 #T2 * -T1 -T2 +[ #s1 #s2 #J #W2 #U2 #H destruct +| #i #J #W2 #U2 #H destruct +| #l #J #W2 #U2 #H destruct +| #I #V1 #V2 #T1 #T2 #J #W2 #U2 #H destruct /2 width=3 by ex1_2_intro/ +] +qed-. + +(* Basic_2A1: was: tsts_inv_pair2 *) +lemma toeq_inv_pair2: ∀J,T1,W2,U2. T1 ⩳ ②{J}W2.U2 → + ∃∃W1,U1. T1 = ②{J}W1.U1. +/2 width=7 by toeq_inv_pair2_aux/ qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma toeq_inv_pair: ∀I1,I2,V1,V2,T1,T2. ②{I1}V1.T1 ⩳ ②{I2}V2.T2 → + I1 = I2. +#I1 #I2 #V1 #V2 #T1 #T2 #H elim (toeq_inv_pair1 … H) -H +#V0 #T0 #H destruct // +qed-. + +(* Basic properties *********************************************************) + +(* Basic_1: was: iso_refl *) +(* Basic_2A1: was: tsts_refl *) +lemma toeq_refl: reflexive … toeq. +* // +* /2 width=1 by toeq_lref, toeq_gref/ +qed. + +(* Basic_2A1: was: tsts_sym *) +lemma toeq_sym: symmetric … toeq. +#T1 #T2 * -T1 -T2 /2 width=3 by toeq_sort/ +qed-. + +(* Basic_2A1: was: tsts_dec *) +lemma toeq_dec: ∀T1,T2. Decidable (T1 ⩳ T2). +* [ * #s1 | #I1 #V1 #T1 ] * [1,3,5,7: * #s2 |*: #I2 #V2 #T2 ] +[ /3 width=1 by toeq_sort, or_introl/ +|2,3,13: + @or_intror #H + elim (toeq_inv_sort1 … H) -H #x #H destruct +|4,6,14: + @or_intror #H + lapply (toeq_inv_lref1 … H) -H #H destruct +|5: + elim (eq_nat_dec s1 s2) #Hs12 destruct /2 width=1 by or_introl/ + @or_intror #H + lapply (toeq_inv_lref1 … H) -H #H destruct /2 width=1 by/ +|7,8,15: + @or_intror #H + lapply (toeq_inv_gref1 … H) -H #H destruct +|9: + elim (eq_nat_dec s1 s2) #Hs12 destruct /2 width=1 by or_introl/ + @or_intror #H + lapply (toeq_inv_gref1 … H) -H #H destruct /2 width=1 by/ +|10,11,12: + @or_intror #H + elim (toeq_inv_pair1 … H) -H #X1 #X2 #H destruct +|16: + elim (eq_item2_dec I1 I2) #HI12 destruct + [ /3 width=1 by toeq_pair, or_introl/ ] + @or_intror #H + lapply (toeq_inv_pair … H) -H /2 width=1 by/ +] +qed-. + +(* Basic_2A1: removed theorems 2: + tsts_inv_atom1 tsts_inv_atom2 +*) diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_simple.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_simple.ma new file mode 100644 index 000000000..00d96949c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_simple.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 "static_2/syntax/term_simple.ma". +include "static_2/syntax/toeq.ma". + +(* SORT-IRRELEVANT OUTER EQUIVALENCE FOR TERMS ******************************) + +(* Properies with simple (neutral) terms ************************************) + +(* Basic_2A1: was: simple_tsts_repl_dx *) +lemma simple_toeq_repl_dx: ∀T1,T2. T1 ⩳ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄. +#T1 #T2 * -T1 -T2 // +#I #V1 #V2 #T1 #T2 #H +elim (simple_inv_pair … H) -H #J #H destruct // +qed-. + +(* Basic_2A1: was: simple_tsts_repl_sn *) +lemma simple_toeq_repl_sn: ∀T1,T2. T1 ⩳ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄. +/3 width=3 by simple_toeq_repl_dx, toeq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_simple_vector.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_simple_vector.ma new file mode 100644 index 000000000..92e28c878 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_simple_vector.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 "static_2/syntax/term_vector.ma". +include "static_2/syntax/toeq_simple.ma". + +(* SORT-IRRELEVANT OUTER EQUIVALENCE FOR TERMS ******************************) + +(* Advanced inversion lemmas with simple (neutral) terms ********************) + +(* Basic_1: was only: iso_flats_lref_bind_false iso_flats_flat_bind_false *) +(* Basic_2A1: was: tsts_inv_bind_applv_simple *) +lemma toeq_inv_applv_bind_simple (p) (I): + ∀Vs,V2,T1,T2. ⒶVs.T1 ⩳ ⓑ{p,I}V2.T2 → 𝐒⦃T1⦄ → ⊥. +#p #I #Vs #V2 #T1 #T2 #H elim (toeq_inv_pair2 … H) -H +#V0 #T0 elim Vs -Vs normalize +[ #H destruct #H /2 width=5 by simple_inv_bind/ +| #V #Vs #_ #H destruct +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_tdeq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_tdeq.ma new file mode 100644 index 000000000..73be8f600 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_tdeq.ma @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/syntax/tdeq.ma". +include "static_2/syntax/toeq.ma". + +(* SORT-IRRELEVANT OUTER EQUIVALENCE FOR TERMS ******************************) + +(* Properties with sort-irrelevant equivalence for terms ********************) + +lemma tdeq_toeq: ∀T1,T2. T1 ≛ T2 → T1 ⩳ T2. +#T1 #T2 * -T1 -T2 /2 width=1 by toeq_sort, toeq_pair/ +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_toeq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_toeq.ma new file mode 100644 index 000000000..9b7af0a51 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/toeq_toeq.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 "static_2/syntax/toeq.ma". + +(* SORT-IRRELEVANT OUTER EQUIVALENCE FOR TERMS ******************************) + +(* Main properties **********************************************************) + +(* Basic_1: was: iso_trans *) +(* Basic_2A1: was: tsts_trans *) +theorem toeq_trans: Transitive … toeq. +#T1 #T * -T1 -T +[ #s1 #s #X #H + elim (toeq_inv_sort1 … H) -s /2 width=1 by toeq_sort/ +| #i1 #i #H <(toeq_inv_lref1 … H) -H // +| #l1 #l #H <(toeq_inv_gref1 … H) -H // +| #I #V1 #V #T1 #T #X #H + elim (toeq_inv_pair1 … H) -H #V2 #T2 #H destruct // +] +qed-. + +(* Basic_2A1: was: tsts_canc_sn *) +theorem toeq_canc_sn: left_cancellable … toeq. +/3 width=3 by toeq_trans, toeq_sym/ qed-. + +(* Basic_2A1: was: tsts_canc_dx *) +theorem toeq_canc_dx: right_cancellable … toeq. +/3 width=3 by toeq_trans, toeq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/tweq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq.ma new file mode 100644 index 000000000..91234b9ce --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq.ma @@ -0,0 +1,284 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "static_2/notation/relations/approxeq_2.ma". +include "static_2/syntax/term_weight.ma". + +(* SORT-IRRELEVANT WHD EQUIVALENCE ON TERMS *********************************) + +inductive tweq: relation term ≝ +| tweq_sort: ∀s1,s2. tweq (⋆s1) (⋆s2) +| tweq_lref: ∀i. tweq (#i) (#i) +| tweq_gref: ∀l. tweq (§l) (§l) +| tweq_abbr: ∀p,V1,V2,T1,T2. (p=Ⓣ→tweq T1 T2) → tweq (ⓓ{p}V1.T1) (ⓓ{p}V2.T2) +| tweq_abst: ∀p,V1,V2,T1,T2. tweq (ⓛ{p}V1.T1) (ⓛ{p}V2.T2) +| tweq_appl: ∀V1,V2,T1,T2. tweq T1 T2 → tweq (ⓐV1.T1) (ⓐV2.T2) +| tweq_cast: ∀V1,V2,T1,T2. tweq V1 V2 → tweq T1 T2 → tweq (ⓝV1.T1) (ⓝV2.T2) +. + +interpretation + "context-free tail sort-irrelevant equivalence (term)" + 'ApproxEq T1 T2 = (tweq T1 T2). + +(* Basic properties *********************************************************) + +lemma tweq_abbr_pos: ∀V1,V2,T1,T2. T1 ≅ T2 → +ⓓV1.T1 ≅ +ⓓV2.T2. +/3 width=1 by tweq_abbr/ qed. + +lemma tweq_abbr_neg: ∀V1,V2,T1,T2. -ⓓV1.T1 ≅ -ⓓV2.T2. +#V1 #V2 #T1 #T2 +@tweq_abbr #H destruct +qed. + +lemma tweq_refl: reflexive … tweq. +#T elim T -T * [||| #p * | * ] +/2 width=1 by tweq_sort, tweq_lref, tweq_gref, tweq_abbr, tweq_abst, tweq_appl, tweq_cast/ +qed. + +lemma tweq_sym: symmetric … tweq. +#T1 #T2 #H elim H -T1 -T2 +/3 width=3 by tweq_sort, tweq_lref, tweq_gref, tweq_abbr, tweq_abst, tweq_appl, tweq_cast/ +qed-. + +(* Left basic inversion lemmas **********************************************) + +fact tweq_inv_sort_sn_aux: + ∀X,Y. X ≅ Y → ∀s1. X = ⋆s1 → ∃s2. Y = ⋆s2. +#X #Y * -X -Y +[1 : #s1 #s2 #s #H destruct /2 width=2 by ex_intro/ +|2,3: #i #s #H destruct +|4 : #p #V1 #V2 #T1 #T2 #_ #s #H destruct +|5 : #p #V1 #V2 #T1 #T2 #s #H destruct +|6 : #V1 #V2 #T1 #T2 #_ #s #H destruct +|7 : #V1 #V2 #T1 #T2 #_ #_ #s #H destruct +] +qed-. + +lemma tweq_inv_sort_sn: + ∀Y,s1. ⋆s1 ≅ Y → ∃s2. Y = ⋆s2. +/2 width=4 by tweq_inv_sort_sn_aux/ qed-. + +fact tweq_inv_lref_sn_aux: + ∀X,Y. X ≅ Y → ∀i. X = #i → Y = #i. +#X #Y * -X -Y +[1 : #s1 #s2 #j #H destruct +|2,3: // +|4 : #p #V1 #V2 #T1 #T2 #_ #j #H destruct +|5 : #p #V1 #V2 #T1 #T2 #j #H destruct +|6 : #V1 #V2 #T1 #T2 #_ #j #H destruct +|7 : #V1 #V2 #T1 #T2 #_ #_ #j #H destruct +] +qed-. + +lemma tweq_inv_lref_sn: ∀Y,i. #i ≅ Y → Y = #i. +/2 width=5 by tweq_inv_lref_sn_aux/ qed-. + +fact tweq_inv_gref_sn_aux: + ∀X,Y. X ≅ Y → ∀l. X = §l → Y = §l. +#X #Y * -X -Y +[1 : #s1 #s2 #k #H destruct +|2,3: // +|4 : #p #V1 #V2 #T1 #T2 #_ #k #H destruct +|5 : #p #V1 #V2 #T1 #T2 #k #H destruct +|6 : #V1 #V2 #T1 #T2 #_ #k #H destruct +|7 : #V1 #V2 #T1 #T2 #_ #_ #j #H destruct +] +qed-. + +lemma tweq_inv_gref_sn: + ∀Y,l. §l ≅ Y → Y = §l. +/2 width=5 by tweq_inv_gref_sn_aux/ qed-. + +fact tweq_inv_abbr_sn_aux: + ∀X,Y. X ≅ Y → ∀p,V1,T1. X = ⓓ{p}V1.T1 → + ∃∃V2,T2. p = Ⓣ → T1 ≅ T2 & Y = ⓓ{p}V2.T2. +#X #Y * -X -Y +[1 : #s1 #s2 #q #W1 #U1 #H destruct +|2,3: #i #q #W1 #U1 #H destruct +|4 : #p #V1 #V2 #T1 #T2 #HT #q #W1 #U1 #H destruct /3 width=4 by ex2_2_intro/ +|5 : #p #V1 #V2 #T1 #T2 #q #W1 #U1 #H destruct +|6 : #V1 #V2 #T1 #T2 #_ #q #W1 #U1 #H destruct +|7 : #V1 #V2 #T1 #T2 #_ #_ #q #W1 #U1 #H destruct +] +qed-. + +lemma tweq_inv_abbr_sn: + ∀p,V1,T1,Y. ⓓ{p}V1.T1 ≅ Y → + ∃∃V2,T2. p = Ⓣ → T1 ≅ T2 & Y = ⓓ{p}V2.T2. +/2 width=4 by tweq_inv_abbr_sn_aux/ qed-. + +fact tweq_inv_abst_sn_aux: + ∀X,Y. X ≅ Y → ∀p,V1,T1. X = ⓛ{p}V1.T1 → + ∃∃V2,T2. Y = ⓛ{p}V2.T2. +#X #Y * -X -Y +[1 : #s1 #s2 #q #W1 #U1 #H destruct +|2,3: #i #q #W1 #U1 #H destruct +|4 : #p #V1 #V2 #T1 #T2 #_ #q #W1 #U1 #H destruct +|5 : #p #V1 #V2 #T1 #T2 #q #W1 #U1 #H destruct /2 width=3 by ex1_2_intro/ +|6 : #V1 #V2 #T1 #T2 #_ #q #W1 #U1 #H destruct +|7 : #V1 #V2 #T1 #T2 #_ #_ #q #W1 #U1 #H destruct +] +qed-. + +lemma tweq_inv_abst_sn: + ∀p,V1,T1,Y. ⓛ{p}V1.T1 ≅ Y → + ∃∃V2,T2. Y = ⓛ{p}V2.T2. +/2 width=5 by tweq_inv_abst_sn_aux/ qed-. + +fact tweq_inv_appl_sn_aux: + ∀X,Y. X ≅ Y → ∀V1,T1. X = ⓐV1.T1 → + ∃∃V2,T2. T1 ≅ T2 & Y = ⓐV2.T2. +#X #Y * -X -Y +[1 : #s1 #s2 #W1 #U1 #H destruct +|2,3: #i #W1 #U1 #H destruct +|4 : #p #V1 #V2 #T1 #T2 #HT #W1 #U1 #H destruct +|5 : #p #V1 #V2 #T1 #T2 #W1 #U1 #H destruct +|6 : #V1 #V2 #T1 #T2 #HT #W1 #U1 #H destruct /2 width=4 by ex2_2_intro/ +|7 : #V1 #V2 #T1 #T2 #_ #_ #W1 #U1 #H destruct +] +qed-. + +lemma tweq_inv_appl_sn: + ∀V1,T1,Y. ⓐV1.T1 ≅ Y → + ∃∃V2,T2. T1 ≅ T2 & Y = ⓐV2.T2. +/2 width=4 by tweq_inv_appl_sn_aux/ qed-. + +fact tweq_inv_cast_sn_aux: + ∀X,Y. X ≅ Y → ∀V1,T1. X = ⓝV1.T1 → + ∃∃V2,T2. V1 ≅ V2 & T1 ≅ T2 & Y = ⓝV2.T2. +#X #Y * -X -Y +[1 : #s1 #s2 #W1 #U1 #H destruct +|2,3: #i #W1 #U1 #H destruct +|4 : #p #V1 #V2 #T1 #T2 #_ #W1 #U1 #H destruct +|5 : #p #V1 #V2 #T1 #T2 #W1 #U1 #H destruct +|6 : #V1 #V2 #T1 #T2 #_ #W1 #U1 #H destruct +|7 : #V1 #V2 #T1 #T2 #HV #HT #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/ +] +qed-. + +lemma tweq_inv_cast_sn: + ∀V1,T1,Y. ⓝV1.T1 ≅ Y → + ∃∃V2,T2. V1 ≅ V2 & T1 ≅ T2 & Y = ⓝV2.T2. +/2 width=3 by tweq_inv_cast_sn_aux/ qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma tweq_inv_abbr_pos_sn: + ∀V1,T1,Y. +ⓓV1.T1 ≅ Y → ∃∃V2,T2. T1 ≅ T2 & Y = +ⓓV2.T2. +#V1 #V2 #Y #H +elim (tweq_inv_abbr_sn … H) -H #V2 #T2 +/3 width=4 by ex2_2_intro/ +qed-. + +lemma tweq_inv_abbr_neg_sn: + ∀V1,T1,Y. -ⓓV1.T1 ≅ Y → ∃∃V2,T2. Y = -ⓓV2.T2. +#V1 #V2 #Y #H +elim (tweq_inv_abbr_sn … H) -H #V2 #T2 #_ +/2 width=3 by ex1_2_intro/ +qed-. + +lemma tweq_inv_abbr_pos_bi: + ∀V1,V2,T1,T2. +ⓓV1.T1 ≅ +ⓓV2.T2 → T1 ≅ T2. +#V1 #V2 #T1 #T2 #H +elim (tweq_inv_abbr_pos_sn … H) -H #W2 #U2 #HTU #H destruct // +qed-. + +lemma tweq_inv_appl_bi: + ∀V1,V2,T1,T2. ⓐV1.T1 ≅ ⓐV2.T2 → T1 ≅ T2. +#V1 #V2 #T1 #T2 #H +elim (tweq_inv_appl_sn … H) -H #W2 #U2 #HTU #H destruct // +qed-. + +lemma tweq_inv_cast_bi: + ∀V1,V2,T1,T2. ⓝV1.T1 ≅ ⓝV2.T2 → ∧∧ V1 ≅ V2 & T1 ≅ T2. +#V1 #V2 #T1 #T2 #H +elim (tweq_inv_cast_sn … H) -H #W2 #U2 #HVW #HTU #H destruct +/2 width=1 by conj/ +qed-. + +lemma tweq_inv_cast_xy_y: ∀T,V. ⓝV.T ≅ T → ⊥. +@(f_ind … tw) #n #IH #T #Hn #V #H destruct +elim (tweq_inv_cast_sn … H) -H #X1 #X2 #_ #HX2 #H destruct -V +/2 width=4 by/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma tweq_fwd_pair_sn (I): + ∀V1,T1,X2. ②{I}V1.T1 ≅ X2 → ∃∃V2,T2. X2 = ②{I}V2.T2. +* [ #p ] * [ cases p -p ] #V1 #T1 #X2 #H +[ elim (tweq_inv_abbr_pos_sn … H) -H #V2 #T2 #_ #H +| elim (tweq_inv_abbr_neg_sn … H) -H #V2 #T2 #H +| elim (tweq_inv_abst_sn … H) -H #V2 #T2 #H +| elim (tweq_inv_appl_sn … H) -H #V2 #T2 #_ #H +| elim (tweq_inv_cast_sn … H) -H #V2 #T2 #_ #_ #H +] /2 width=3 by ex1_2_intro/ +qed-. + +lemma tweq_fwd_pair_bi (I1) (I2): + ∀V1,V2,T1,T2. ②{I1}V1.T1 ≅ ②{I2}V2.T2 → I1 = I2. +#I1 #I2 #V1 #V2 #T1 #T2 #H +elim (tweq_fwd_pair_sn … H) -H #W2 #U2 #H destruct // +qed-. + +(* Advanced properties ******************************************************) + +lemma tweq_dec: ∀T1,T2. Decidable (T1 ≅ T2). +#T1 elim T1 -T1 [ * #s1 | #I1 #V1 #T1 #IHV #IHT ] * [1,3,5,7: * #s2 |*: #I2 #V2 #T2 ] +[ /3 width=1 by tweq_sort, or_introl/ +|2,3,13: + @or_intror #H + elim (tweq_inv_sort_sn … H) -H #x #H destruct +|4,6,14: + @or_intror #H + lapply (tweq_inv_lref_sn … H) -H #H destruct +|5: + elim (eq_nat_dec s1 s2) #Hs12 destruct /2 width=1 by or_introl/ + @or_intror #H + lapply (tweq_inv_lref_sn … H) -H #H destruct /2 width=1 by/ +|7,8,15: + @or_intror #H + lapply (tweq_inv_gref_sn … H) -H #H destruct +|9: + elim (eq_nat_dec s1 s2) #Hs12 destruct /2 width=1 by or_introl/ + @or_intror #H + lapply (tweq_inv_gref_sn … H) -H #H destruct /2 width=1 by/ +|10,11,12: + @or_intror #H + elim (tweq_fwd_pair_sn … H) -H #X1 #X2 #H destruct +|16: + elim (eq_item2_dec I1 I2) #HI12 destruct + [ cases I2 -I2 [ #p ] * [ cases p -p ] + [ elim (IHT T2) -IHT #HT12 + [ /3 width=1 by tweq_abbr_pos, or_introl/ + | /4 width=3 by tweq_inv_abbr_pos_bi, or_intror/ + ] + | /3 width=1 by tweq_abbr_neg, or_introl/ + | /3 width=1 by tweq_abst, or_introl/ + | elim (IHT T2) -IHT #HT12 + [ /3 width=1 by tweq_appl, or_introl/ + | /4 width=3 by tweq_inv_appl_bi, or_intror/ + ] + | elim (IHV V2) -IHV #HV12 + elim (IHT T2) -IHT #HT12 + [1: /3 width=1 by tweq_cast, or_introl/ + |*: @or_intror #H + elim (tweq_inv_cast_bi … H) -H #HV12 #HT12 + /2 width=1 by/ + ] + ] + | /4 width=5 by tweq_fwd_pair_bi, or_intror/ + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_simple.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_simple.ma new file mode 100644 index 000000000..4077d0568 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_simple.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 "static_2/syntax/term_simple.ma". +include "static_2/syntax/tweq.ma". + +(* SORT-IRRELEVANT WHD EQUIVALENCE ON TERMS *********************************) + +(* Properties with simple terms *********************************************) + +lemma tweq_simple_trans: + ∀T1,T2. T1 ≅ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄. +#T1 #T2 * -T1 -T2 +[4,5: #p #V1 #V2 #T1 #T2 [ #_ ] #H + elim (simple_inv_bind … H) +|* : /1 width=1 by simple_atom, simple_flat/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_tdeq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_tdeq.ma new file mode 100644 index 000000000..fb8d7e704 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_tdeq.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 "static_2/syntax/tdeq.ma". +include "static_2/syntax/tweq.ma". + +(* SORT-IRRELEVANT WHD EQUIVALENCE ON TERMS *********************************) + +(* Properties with sort-irrelevant equivalence for terms ********************) + +lemma tdeq_tweq: ∀T1,T2. T1 ≛ T2 → T1 ≅ T2. +#T1 #T2 #H elim H -T1 -T2 [||| * [ #p ] * #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT ] +[ /1 width=1 by tweq_sort/ +| /1 width=1 by tweq_lref/ +| /1 width=1 by tweq_gref/ +| cases p -p /2 width=1 by tweq_abbr_pos, tweq_abbr_neg/ +| /1 width=1 by tweq_abst/ +| /2 width=1 by tweq_appl/ +| /2 width=1 by tweq_cast/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_tweq.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_tweq.ma new file mode 100644 index 000000000..afa33ccfb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/static_2/syntax/tweq_tweq.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 "static_2/syntax/tweq.ma". + +(* SORT-IRRELEVANT WHD EQUIVALENCE ON TERMS *********************************) + +(* Main properties **********************************************************) + +theorem tweq_trans: Transitive … tweq. +#T1 #T #H elim H -T1 -T +[ #s1 #s #X #H + elim (tweq_inv_sort_sn … H) -s #s2 destruct + /2 width=1 by tweq_sort/ +| #i1 #i #H // +| #l1 #l #H // +| #p #V1 #V #T1 #T #_ #IHT #X #H + elim (tweq_inv_abbr_sn … H) -H #V2 #T2 #HT #H destruct + /4 width=1 by tweq_abbr/ +| #p #V1 #V #T1 #T #X #H + elim (tweq_inv_abst_sn … H) -H #V2 #T2 #H destruct + /2 width=1 by tweq_abst/ +| #V1 #V #T1 #T #_ #IHT #X #H + elim (tweq_inv_appl_sn … H) -H #V2 #T2 #HT #H destruct + /3 width=1 by tweq_appl/ +| #V1 #V #T1 #T #_ #_ #IHV #IHT #X #H + elim (tweq_inv_cast_sn … H) -H #V2 #T2 #HV #HT #H destruct + /3 width=1 by tweq_cast/ +] +qed-. + +theorem tweq_canc_sn: left_cancellable … tweq. +/3 width=3 by tweq_trans, tweq_sym/ qed-. + +theorem tweq_canc_dx: right_cancellable … tweq. +/3 width=3 by tweq_trans, tweq_sym/ qed-. + +theorem tweq_repl: + ∀T1,T2. T1 ≅ T2 → ∀U1. T1 ≅ U1 → ∀U2. T2 ≅ U2 → U1 ≅ U2. +/3 width=3 by tweq_canc_sn, tweq_trans/ qed-. diff --git a/matita/matita/contribs/lambdadelta/static_2/web/static_2_src.tbl b/matita/matita/contribs/lambdadelta/static_2/web/static_2_src.tbl index 4dcb17989..0a962c3f8 100644 --- a/matita/matita/contribs/lambdadelta/static_2/web/static_2_src.tbl +++ b/matita/matita/contribs/lambdadelta/static_2/web/static_2_src.tbl @@ -27,12 +27,12 @@ table { ] [ { "atomic arity assignment" * } { [ [ "restricted refinement for lenvs" ] "lsuba" + "( ? ⊢ ? ⫃⁝ ? )" "lsuba_drops" + "lsuba_lsubr" + "lsuba_aaa" + "lsuba_lsuba" * ] - [ [ "for terms" ] "aaa" + "( ⦃?,?⦄ ⊢ ? ⁝ ? )" "aaa_drops" + "aaa_fqus" + "aaa_rdeq" + "aaa_fdeq" + "aaa_aaa" * ] + [ [ "for terms" ] "aaa" + "( ⦃?,?⦄ ⊢ ? ⁝ ? )" "aaa_drops" + "aaa_fqus" + "aaa_rdeq" + "aaa_fdeq" + "aaa_aaa" + "aaa_dec" * ] } ] [ { "degree-based equivalence" * } { - [ [ "for closures on referred entries" ] "fdeq" + "( ⦃?,?,?⦄ ≛[?,?] ⦃?,?,?⦄ )" "fdeq_fqup" + "fdeq_fqus" + "fdeq_req" + "fdeq_fdeq" * ] - [ [ "for lenvs on referred entries" ] "rdeq" + "( ? ≛[?,?,?] ? )" "rdeq_length" + "rdeq_drops" + "rdeq_fqup" + "rdeq_fqus" + "rdeq_req" + "rdeq_rdeq" * ] + [ [ "for closures on referred entries" ] "fdeq" + "( ⦃?,?,?⦄ ≛ ⦃?,?,?⦄ )" "fdeq_fqup" + "fdeq_fqus" + "fdeq_req" + "fdeq_fdeq" * ] + [ [ "for lenvs on referred entries" ] "rdeq" + "( ? ≛[?] ? )" "rdeq_length" + "rdeq_drops" + "rdeq_fqup" + "rdeq_fqus" + "rdeq_req" + "rdeq_rdeq" * ] } ] [ { "syntactic equivalence" * } { @@ -45,8 +45,8 @@ table { ] [ { "context-sensitive free variables" * } { [ [ "inclusion for restricted closures" ] "fsle" + "( ⦃?,?⦄ ⊆ ⦃?,?⦄ )" "fsle_length" + "fsle_drops" + "fsle_fqup" + "fsle_fsle" * ] - [ [ "restricted refinement for lenvs" ] "lsubf" + "( ⦃?,?⦄ ⫃𝐅* ⦃?,?⦄ )" "lsubf_lsubr" + "lsubf_frees" + "lsubf_lsubf" * ] - [ [ "for terms" ] "frees" + "( ? ⊢ 𝐅*⦃?⦄ ≘ ? )" "frees_append" + "frees_drops" + "frees_fqup" + "frees_frees" * ] + [ [ "restricted refinement for lenvs" ] "lsubf" + "( ⦃?,?⦄ ⫃𝐅+ ⦃?,?⦄ )" "lsubf_lsubr" + "lsubf_frees" + "lsubf_lsubf" * ] + [ [ "for terms" ] "frees" + "( ? ⊢ 𝐅+⦃?⦄ ≘ ? )" "frees_append" + "frees_drops" + "frees_fqup" + "frees_frees" * ] } ] [ { "local environments" * } { @@ -58,8 +58,8 @@ table { class "grass" [ { "s-computation" * } { [ { "iterated structural successor" * } { - [ [ "for closures" ] "fqus" + "( ⦃?,?,?⦄ ⊐*[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⊐* ⦃?,?,?⦄ )" "fqus_weight" + "fqus_drops" + "fqus_fqup" + "fqus_fqus" * ] - [ [ "proper for closures" ] "fqup" + "( ⦃?,?,?⦄ ⊐+[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⊐+ ⦃?,?,?⦄ )" "fqup_weight" + "fqup_drops" + "fqup_fqup" * ] + [ [ "for closures" ] "fqus" + "( ⦃?,?,?⦄ ⬂*[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⬂* ⦃?,?,?⦄ )" "fqus_weight" + "fqus_drops" + "fqus_fqup" + "fqus_fqus" * ] + [ [ "proper for closures" ] "fqup" + "( ⦃?,?,?⦄ ⬂+[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⬂+ ⦃?,?,?⦄ )" "fqup_weight" + "fqup_drops" + "fqup_fqup" * ] } ] } @@ -67,22 +67,26 @@ table { class "yellow" [ { "s-transition" * } { [ { "structural successor" * } { - [ [ "for closures" ] "fquq" + "( ⦃?,?,?⦄ ⊐⸮[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⊐⸮ ⦃?,?,?⦄ )" "fquq_length" + "fquq_weight" * ] - [ [ "proper for closures" ] "fqu" + "( ⦃?,?,?⦄ ⊐[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⊐ ⦃?,?,?⦄ )" "fqu_length" + "fqu_weight" + "fqu_tdeq" * ] + [ [ "for closures" ] "fquq" + "( ⦃?,?,?⦄ ⬂⸮[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⬂⸮ ⦃?,?,?⦄ )" "fquq_length" + "fquq_weight" * ] + [ [ "proper for closures" ] "fqu" + "( ⦃?,?,?⦄ ⬂[?] ⦃?,?,?⦄ )" + "( ⦃?,?,?⦄ ⬂ ⦃?,?,?⦄ )" "fqu_length" + "fqu_weight" + "fqu_tdeq" * ] } ] } ] class "orange" [ { "relocation" * } { - [ { "generic slicing" * } { + [ { "generic and uniform slicing" * } { [ [ "for lenvs" ] "drops" + "( ⬇*[?,?] ? ≘ ? )" + "( ⬇*[?] ? ≘ ? )" "drops_ctc" + "drops_ltc" + "drops_weight" + "drops_length" + "drops_cext2" + "drops_sex" + "drops_lex" + "drops_seq" + "drops_drops" + "drops_vector" * ] } ] - [ { "generic relocation" * } { + [ { "basic relocation" * } { + [ [ "for terms" ] "lifts_basic" + "( ⬆[?,?] ? ≘ ? )" * ] + } + ] + [ { "generic and uniform relocation" * } { [ [ "for binders" ] "lifts_bind" + "( ⬆*[?] ? ≘ ? )" "lifts_weight_bind" + "lifts_lifts_bind" * ] [ [ "for term vectors" ] "lifts_vector" + "( ⬆*[?] ? ≘ ? )" "lifts_lifts_vector" * ] - [ [ "for terms" ] "lifts" + "( ⬆*[?] ? ≘ ? )" "lifts_simple" + "lifts_weight" + "lifts_tdeq" + "lifts_lifts" * ] + [ [ "for terms" ] "lifts" + "( ⬆*[?] ? ≘ ? )" "lifts_simple" + "lifts_weight" + "lifts_tdeq" + "lifts_tweq" + "lifts_toeq" + "lifts_lifts" * ] } ] [ { "syntactic equivalence" * } { @@ -98,6 +102,11 @@ table { ] class "red" [ { "syntax" * } { + [ { "applicability condition" * } { + [ [ "preorder" ] "acle" + "( ? ⊆ ? )" "acle_acle" * ] + [ [ "properties" ] "ac" + "( 𝟏 )" + "( 𝟐 )" + "( 𝛚 )" * ] + } + ] [ { "equivalence up to exclusion binders" * } { [ [ "for lenvs" ] "lveq" + "( ? ≋ⓧ*[?,?] ? )" "lveq_length" + "lveq_lveq" * ] } @@ -107,13 +116,17 @@ table { [ [ "for lenvs" ] "append" + "( ? + ? )" "append_length" * ] } ] - [ { "head equivalence" * } { - [ [ "for terms" ] "theq" + "( ? ⩳[?,?] ? )" "theq_simple" + "theq_tdeq" + "theq_theq" + "theq_simple_vector" * ] + [ { "sort-irrelevant outer equivalence" * } { + [ [ "for terms" ] "toeq" + "( ? ⩳ ? )" "toeq_simple" + "toeq_tdeq" + "toeq_toeq" + "toeq_simple_vector" * ] } ] - [ { "degree-based equivalence" * } { - [ [ "" ] "tdeq_ext" + "( ? ≛[?,?] ? )" + "( ? ⊢ ? ≛[?,?] ? )" * ] - [ [ "" ] "tdeq" + "( ? ≛[?,?] ? )" "tdeq_tdeq" * ] + [ { "sort-irrelevant whd equivalence" * } { + [ [ "for terms" ] "tweq" + "( ? ≅ ? )" "tweq_simple" + "tweq_tdeq" + "tweq_tueq" * ] + } + ] + [ { "sort-irrelevant equivalence" * } { + [ [ "" ] "tdeq_ext" + "( ? ≛ ? )" + "( ? ⊢ ? ≛ ? )" * ] + [ [ "" ] "tdeq" + "( ? ≛ ? )" "tdeq_tdeq" * ] } ] [ { "closures" * } { @@ -148,11 +161,14 @@ table { } ] [ { "items" * } { - [ [ "" ] "item_sd" * ] - [ [ "" ] "item_sh" * ] [ [ "" ] "item" * ] } ] + [ { "sorts" * } { + [ [ "degree" ] "sd" "sd_d" + "sd_lt" * ] + [ [ "hierarchy" ] "sh" + "( ⫯[?]? )" "sh_props" + "sh_lt" * ] + } + ] [ { "atomic arities" * } { [ [ "" ] "aarity" * ] } diff --git a/matita/matita/dist/ChangeLog b/matita/matita/dist/ChangeLog index 3185e857c..1f9cd6951 100644 --- a/matita/matita/dist/ChangeLog +++ b/matita/matita/dist/ChangeLog @@ -1,13 +1,20 @@ +0.99.4 - 26/12/2018 - beta version for the 1.x series + * ported to lablgkt3, ulex-camlp5 1.2, ocaml 4.07 + * bug fix: aliases were no longer added automatically to the script + 0.99.3 - 06/05/2016 - beta version for the 1.x series - * cyclic sort hierarchies are now allowed through the "cyclic" keyword - * new syntax for let rec/corec with flavor specifier - * optional parameters added to the syntax of definitions - * new attribute "Implied" put beside "Generated" and "Provided"; - it denotes an object provided not as defined by the user, but as generated by another ITP - * the command "defined" is added as a presentational alternative to "qed" for definitions - * improved standard library and contributions - * improved binaries using matita components - * source code updated for the latest version of OCaml and related tools + * cyclic sort hierarchies are now allowed through the "cyclic" keyword + * new syntax for let rec/corec with flavor specifier + * optional parameters added to the syntax of definitions + * new attribute "Implied" put beside "Generated" and "Provided"; + it denotes an object provided not as defined by the user, but as + generated by another ITP + * the command "defined" is added as a presentational alternative to + "qed" for definitions + * improved standard library and contributions + * improved binaries using matita components + * source code updated for the latest version of OCaml and related + tools * several bug fixes 0.99.1 - 17/11/2011 - alpha version for the 1.x series diff --git a/matita/matita/lablGraphviz.ml b/matita/matita/lablGraphviz.ml index ab817e294..7a30256e3 100644 --- a/matita/matita/lablGraphviz.ml +++ b/matita/matita/lablGraphviz.ml @@ -74,17 +74,22 @@ class graphviz_impl ?packing () = method load_graph_from_file ?(gviz_cmd = "dot") fname = let tmp_png = tempfile () in let rc = Sys.command (mk_gviz_cmd gviz_cmd png_flags fname tmp_png) in - if rc <> 0 then + if rc <> 0 || (Unix.stat tmp_png).Unix.st_size = 0 then begin eprintf ("Graphviz command failed (exit code: %d) on the following graph:\n" ^^ "%s\n%!") rc (HExtlib.input_file fname); - image#set_file tmp_png; - HExtlib.safe_remove tmp_png; - let tmp_map = tempfile () in - ignore (Sys.command (mk_gviz_cmd gviz_cmd map_flags fname tmp_map)); - self#load_map tmp_map; - HExtlib.safe_remove tmp_map + (* CSC: it would be better to show something explaining that the + graph is empty *) + image#clear () + end else begin + image#set_file tmp_png; + HExtlib.safe_remove tmp_png; + let tmp_map = tempfile () in + ignore (Sys.command (mk_gviz_cmd gviz_cmd map_flags fname tmp_map)); + self#load_map tmp_map; + HExtlib.safe_remove tmp_map + end method private load_map fname = let areas = ref [] in diff --git a/matita/matita/lib/basics/core_notation.ma b/matita/matita/lib/basics/core_notation.ma index a0ad502b9..4d1e355a3 100644 --- a/matita/matita/lib/basics/core_notation.ma +++ b/matita/matita/lib/basics/core_notation.ma @@ -272,9 +272,6 @@ for @{ 'notmem $a $b }. notation "hvbox(a break ≬ b)" non associative with precedence 45 for @{ 'overlaps $a $b }. (* \between *) -notation "hvbox(a break ⊆ b)" non associative with precedence 45 -for @{ 'subseteq $a $b }. (* \subseteq *) - notation "hvbox(a break ∩ b)" left associative with precedence 60 for @{ 'intersects $a $b }. (* \cap *) @@ -283,12 +280,6 @@ for @{ 'union $a $b }. (* \cup *) (* other notations **********************************************************) -notation "hvbox(a break \approx b)" non associative with precedence 45 - for @{ 'napart $a $b}. - -notation "hvbox(a break # b)" non associative with precedence 45 - for @{ 'apart $a $b}. - notation < "term 76 a \sup term 90 b" non associative with precedence 75 for @{ 'exp $a $b}. notation > "a \sup term 90 b" non associative with precedence 75 for @{ 'exp $a $b}. notation > "a ^ term 90 b" non associative with precedence 75 for @{ 'exp $a $b}. diff --git a/matita/matita/lib/basics/core_notation/apart_2.ma b/matita/matita/lib/basics/core_notation/apart_2.ma new file mode 100644 index 000000000..04c81ec27 --- /dev/null +++ b/matita/matita/lib/basics/core_notation/apart_2.ma @@ -0,0 +1,15 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department of the University of Bologna, Italy. + ||I|| + ||T|| + ||A|| This file is distributed under the terms of the + \ / GNU General Public License Version 2 + \ / + V_______________________________________________________________ *) + +(* Core notation *******************************************************) + +notation "hvbox(a break # b)" non associative with precedence 45 + for @{ 'apart $a $b}. diff --git a/matita/matita/lib/basics/core_notation/napart_2.ma b/matita/matita/lib/basics/core_notation/napart_2.ma new file mode 100644 index 000000000..a3817876b --- /dev/null +++ b/matita/matita/lib/basics/core_notation/napart_2.ma @@ -0,0 +1,15 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department of the University of Bologna, Italy. + ||I|| + ||T|| + ||A|| This file is distributed under the terms of the + \ / GNU General Public License Version 2 + \ / + V_______________________________________________________________ *) + +(* Core notation *******************************************************) + +notation "hvbox(a break \approx b)" non associative with precedence 45 + for @{ 'napart $a $b}. diff --git a/matita/matita/lib/basics/core_notation/subseteq_2.ma b/matita/matita/lib/basics/core_notation/subseteq_2.ma new file mode 100644 index 000000000..bbfe6f527 --- /dev/null +++ b/matita/matita/lib/basics/core_notation/subseteq_2.ma @@ -0,0 +1,15 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department of the University of Bologna, Italy. + ||I|| + ||T|| + ||A|| This file is distributed under the terms of the + \ / GNU General Public License Version 2 + \ / + V_______________________________________________________________ *) + +(* Core notation *******************************************************) + +notation "hvbox(a break ⊆ b)" non associative with precedence 45 +for @{ 'subseteq $a $b }. (* \subseteq *) diff --git a/matita/matita/lib/basics/deqlist.ma b/matita/matita/lib/basics/deqlist.ma new file mode 100644 index 000000000..c559448ba --- /dev/null +++ b/matita/matita/lib/basics/deqlist.ma @@ -0,0 +1,63 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department of the University of Bologna, Italy. + ||I|| + ||T|| + ||A|| + \ / This file is distributed under the terms of the + \ / GNU General Public License Version 2 + V_______________________________________________________________ *) + +include "basics/deqsets.ma". +include "basics/lists/listb.ma". + +(* + +record DeqSet : Type[1] ≝ { + carr :> Type[0]; + eqb: carr → carr → bool; + eqb_true: ∀x,y. (eqb x y = true) ↔ (x = y) +}. *) + + +(* list *) + +let rec eq_list (A:DeqSet) (l1,l2:list A) on l1 ≝ + match l1 with + [ nil ⇒ match l2 with [nil ⇒ true | _ ⇒ false] + | cons a1 tl1 ⇒ + match l2 with [nil ⇒ false | cons a2 tl2 ⇒ a1 ==a2 ∧ eq_list A tl1 tl2]]. + +lemma eq_list_true: ∀A:DeqSet.∀l1,l2:list A. + eq_list A l1 l2 = true ↔ l1 = l2. +#A #l1 elim l1 + [* [% // |#a #tl % normalize #H destruct ] + |#a1 #tl1 #Hind * + [normalize % #H destruct + |#a2 #tl2 normalize % + [cases (true_or_false (a1==a2)) #Heq >Heq normalize + [#Htl >(\P Heq) >(proj1 … (Hind tl2) Htl) // | #H destruct ] + |#H destruct >(\b (refl … )) >(proj2 … (Hind tl2) (refl …)) // + ] + ] + ] +qed. + +definition DeqList ≝ λA:DeqSet. + mk_DeqSet (list A) (eq_list A) (eq_list_true A). + +unification hint 0 ≔ C; + T ≟ carr C, + X ≟ DeqList C +(* ---------------------------------------- *) ⊢ + list T ≡ carr X. + +alias id "eqb" = "cic:/matita/basics/deqsets/eqb#fix:0:0:3". +alias symbol "hint_decl" (instance 1) = "hint_decl_Type0". +unification hint 0 ≔ T,a1,a2; + X ≟ DeqList T +(* ---------------------------------------- *) ⊢ + eq_list T a1 a2 ≡ eqb X a1 a2. + + diff --git a/matita/matita/lib/basics/finset.ma b/matita/matita/lib/basics/finset.ma index df8d0a87c..24a5e16ce 100644 --- a/matita/matita/lib/basics/finset.ma +++ b/matita/matita/lib/basics/finset.ma @@ -9,7 +9,7 @@ \ / GNU General Public License Version 2 V_______________________________________________________________ *) -include "basics/lists/listb.ma". +include "basics/deqlist.ma". (****** DeqSet: a set with a decidable equality ******) @@ -270,3 +270,184 @@ f a = b → memb ? 〈a,b〉 (graph_enum A B f) = true. #A #B #f #a #b #eqf @memb_filter_l [@(\b eqf)] @enum_prod_complete // qed. + +(* FinFun *) + +definition enum_fun_raw: ∀A,B:DeqSet.list A → list B → list (list (DeqProd A B)) ≝ + λA,B,lA,lB.foldr A (list (list (DeqProd A B))) + (λa.compose ??? (λb. cons ? 〈a,b〉) lB) [[]] lA. + +lemma enum_fun_raw_cons: ∀A,B,a,lA,lB. + enum_fun_raw A B (a::lA) lB = + compose ??? (λb. cons ? 〈a,b〉) lB (enum_fun_raw A B lA lB). +// +qed. + +definition is_functional ≝ λA,B:DeqSet.λlA:list A.λl: list (DeqProd A B). + map ?? (fst A B) l = lA. + +definition carr_fun ≝ λA,B:FinSet. + DeqSig (DeqList (DeqProd A B)) (is_functional A B (enum A)). + +definition carr_fun_l ≝ λA,B:DeqSet.λl. + DeqSig (DeqList (DeqProd A B)) (is_functional A B l). + +lemma compose_spec1 : ∀A,B,C:DeqSet.∀f:A→B→C.∀a:A.∀b:B.∀lA:list A.∀lB:list B. + a ∈ lA = true → b ∈ lB = true → ((f a b) ∈ (compose A B C f lA lB)) = true. +#A #B #C #f #a #b #lA elim lA + [normalize #lB #H destruct + |#a1 #tl #Hind #lB #Ha #Hb cases (orb_true_l ?? Ha) #Hcase + [>(\P Hcase) normalize @memb_append_l1 @memb_map // + |@memb_append_l2 @Hind // + ] + ] +qed. + +lemma compose_cons: ∀A,B,C.∀f:A→B→C.∀l1,l2,a. + compose A B C f (a::l1) l2 = + (map ?? (f a) l2)@(compose A B C f l1 l2). +// qed. + +lemma compose_spec2 : ∀A,B,C:DeqSet.∀f:A→B→C.∀c:C.∀lA:list A.∀lB:list B. + c ∈ (compose A B C f lA lB) = true → + ∃a,b.a ∈ lA = true ∧ b ∈ lB = true ∧ c = f a b. +#A #B #C #f #c #lA elim lA + [normalize #lB #H destruct + |#a1 #tl #Hind #lB >compose_cons #Hc cases (memb_append … Hc) #Hcase + [lapply(memb_map_to_exists … Hcase) * #b * #Hb #Hf + %{a1} %{b} /3/ + |lapply(Hind ? Hcase) * #a2 * #b * * #Ha #Hb #Hf %{a2} %{b} % // % // + @orb_true_r2 // + ] + ] +qed. + +definition compose2 ≝ + λA,B:DeqSet.λa:A.λl. compose B (carr_fun_l A B l) (carr_fun_l A B (a::l)) + (λb,tl. mk_Sig ?? (〈a,b〉::(pi1 … tl)) ?). +normalize @eq_f @(pi2 … tl) +qed. + +let rec Dfoldr (A:Type[0]) (B:list A → Type[0]) + (f:∀a:A.∀l.B l → B (a::l)) (b:B [ ]) (l:list A) on l : B l ≝ + match l with [ nil ⇒ b | cons a l ⇒ f a l (Dfoldr A B f b l)]. + +definition empty_graph: ∀A,B:DeqSet. carr_fun_l A B []. +#A #B %{[]} // qed. + +definition enum_fun: ∀A,B:DeqSet.∀lA:list A.list B → list (carr_fun_l A B lA) ≝ + λA,B,lA,lB.Dfoldr A (λl.list (carr_fun_l A B l)) + (λa,l.compose2 ?? a l lB) [empty_graph A B] lA. + +lemma mem_enum_fun: ∀A,B:DeqSet.∀lA,lB.∀x:carr_fun_l A B lA. + pi1 … x ∈ map ?? (pi1 … ) (enum_fun A B lA lB) = true → + x ∈ enum_fun A B lA lB = true . +#A #B #lA #lB #x @(memb_map_inj + (DeqSig (DeqList (DeqProd A B)) + (λx0:DeqList (DeqProd A B).is_functional A B lA x0)) + (DeqList (DeqProd A B)) (pi1 …)) +* #l1 #H1 * #l2 #H2 #Heq lapply H1 lapply H2 >Heq // +qed. + +lemma enum_fun_cons: ∀A,B,a,lA,lB. + enum_fun A B (a::lA) lB = + compose ??? (λb,tl. mk_Sig ?? (〈a,b〉::(pi1 … tl)) ?) lB (enum_fun A B lA lB). +// +qed. + +lemma map_map: ∀A,B,C.∀f:A→B.∀g:B→C.∀l. + map ?? g (map ?? f l) = map ?? (g ∘ f) l. +#A #B #C #f #g #l elim l [//] +#a #tl #Hind normalize @eq_f @Hind +qed. + +lemma map_compose: ∀A,B,C,D.∀f:A→B→C.∀g:C→D.∀l1,l2. + map ?? g (compose A B C f l1 l2) = compose A B D (λa,b. g (f a b)) l1 l2. +#A #B #C #D #f #g #l1 elim l1 [//] +#a #tl #Hind #l2 >compose_cons >compose_cons (enum_fun_cons A B a tl lB) >enum_fun_raw_cons >map_compose +cut (∀lB2. compose B (Σx:DeqList (DeqProd A B).is_functional A B tl x) + (DeqList (DeqProd A B)) + (λa0:B + .λb:Σx:DeqList (DeqProd A B).is_functional A B tl x + .〈a,a0〉 + ::pi1 (list (A×B)) (λx:DeqList (DeqProd A B).is_functional A B tl x) b) lB + (enum_fun A B tl lB2) + =compose B (list (A×B)) (list (A×B)) (λb:B.cons (A×B) 〈a,b〉) lB + (enum_fun_raw A B tl lB2)) + [#lB2 elim lB + [normalize // + |#b #tlb #Hindb >compose_cons in ⊢ (???%); >compose_cons + @eq_f2 [map_map // |@Hindb]]] +#Hcut @Hcut +qed. + +lemma uniqueb_compose: ∀A,B,C:DeqSet.∀f,l1,l2. + (∀a1,a2,b1,b2. f a1 b1 = f a2 b2 → a1 = a2 ∧ b1 = b2) → + uniqueb ? l1 = true → uniqueb ? l2 = true → + uniqueb ? (compose A B C f l1 l2) = true. +#A #B #C #f #l1 #l2 #Hinj elim l1 // +#a #tl #Hind #HuA #HuB >compose_cons @uniqueb_append + [@(unique_map_inj … HuB) #b1 #b2 #Hb1b2 @(proj2 … (Hinj … Hb1b2)) + |@Hind // @(andb_true_r … HuA) + |#c #Hc lapply(memb_map_to_exists … Hc) * #b * #Hb2 #Hfab % #Hc + lapply(compose_spec2 … Hc) * #a1 * #b1 * * #Ha1 #Hb1 H + normalize #H1 destruct (H1) + ] + ] +qed. + +lemma enum_fun_unique: ∀A,B:DeqSet.∀lA,lB. + uniqueb ? lA = true → uniqueb ? lB = true → + uniqueb ? (enum_fun A B lA lB) = true. +#A #B #lA elim lA + [#lB #_ #ulB // + |#a #tlA #Hind #lB #uA #uB lapply (enum_fun_cons A B a tlA lB) #H >H + @(uniqueb_compose B (carr_fun_l A B tlA) (carr_fun_l A B (a::tlA))) + [#b1 #b2 * #l1 #funl1 * #l2 #funl2 #H1 destruct (H1) /2/ + |// + |@(Hind … uB) @(andb_true_r … uA) + ] + ] +qed. + +lemma enum_fun_complete: ∀A,B:FinSet.∀l1,l2. + (∀x:A. memb A x l1 = true) → + (∀x:B. memb B x l2 = true) → + ∀x:carr_fun_l A B l1. memb ? x (enum_fun A B l1 l2) = true. +#A #B #l1 #l2 #H1 #H2 * #g #H @mem_enum_fun >enum_fun_graphs +lapply H -H lapply g -g elim l1 + [* // #p #tlg normalize #H destruct (H) + |#a #tl #Hind #g cases g + [normalize in ⊢ (%→?); #H destruct (H) + |* #a1 #b #tl1 normalize in ⊢ (%→?); #H + cut (is_functional A B tl tl1) [destruct (H) //] #Hfun + >(cons_injective_l ????? H) + >(enum_fun_raw_cons … ) @(compose_spec1 … (λb. cons ? 〈a,b〉)) + [@H2 |@Hind @Hfun] + ] + ] +qed. + +definition FinFun ≝ +λA,B:FinSet.mk_FinSet (carr_fun A B) + (enum_fun A B (enum A) (enum B)) + (enum_fun_unique A B … (enum_unique A) (enum_unique B)) + (enum_fun_complete A B … (enum_complete A) (enum_complete B)). + +(* +unification hint 0 ≔ C1,C2; + T1 ≟ FinSetcarr C1, + T2 ≟ FinSetcarr C2, + X ≟ FinProd C1 C2 +(* ---------------------------------------- *) ⊢ + T1×T2 ≡ FinSetcarr X. *) \ No newline at end of file diff --git a/matita/matita/lib/basics/relations.ma b/matita/matita/lib/basics/relations.ma index 24b2c9a9e..3133682db 100644 --- a/matita/matita/lib/basics/relations.ma +++ b/matita/matita/lib/basics/relations.ma @@ -11,6 +11,7 @@ include "basics/logic.ma". include "basics/core_notation/compose_2.ma". +include "basics/core_notation/subseteq_2.ma". (********** predicates *********) diff --git a/matita/matita/lib/basics/sets.ma b/matita/matita/lib/basics/sets.ma index 2f570c18f..8e40b666b 100644 --- a/matita/matita/lib/basics/sets.ma +++ b/matita/matita/lib/basics/sets.ma @@ -11,6 +11,7 @@ include "basics/logic.ma". include "basics/core_notation/singl_1.ma". +include "basics/core_notation/subseteq_2.ma". (**** a subset of A is just an object of type A→Prop ****) diff --git a/matita/matita/lib/binding/db.ma b/matita/matita/lib/binding/db.ma deleted file mode 100644 index 534874f21..000000000 --- a/matita/matita/lib/binding/db.ma +++ /dev/null @@ -1,110 +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 "basics/lists/list.ma". - -axiom alpha : Type[0]. -notation "𝔸" non associative with precedence 90 for @{'alphabet}. -interpretation "set of names" 'alphabet = alpha. - -inductive tp : Type[0] ≝ -| top : tp -| arr : tp → tp → tp. -inductive tm : Type[0] ≝ -| var : nat → tm -| par : 𝔸 → tm -| abs : tp → tm → tm -| app : tm → tm → tm. - -let rec Nth T n (l:list T) on n ≝ - match l with - [ nil ⇒ None ? - | cons hd tl ⇒ match n with - [ O ⇒ Some ? hd - | S n0 ⇒ Nth T n0 tl ] ]. - -inductive judg : list tp → tm → tp → Prop ≝ -| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t -| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u -| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u). - -definition Env := list (𝔸 × tp). - -axiom vclose_env : Env → list tp. -axiom vclose_tm : Env → tm → tm. -axiom Lam : 𝔸 → tp → tm → tm. -definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T. -definition dom ≝ λG:Env.map ?? (fst ??) G. - -definition sctx ≝ 𝔸 × tm. -axiom swap_tm : 𝔸 → 𝔸 → tm → tm. -definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M. - -axiom in_list : ∀A:Type[0].A → list A → Prop. -interpretation "list membership" 'mem x l = (in_list ? x l). -interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)). - -axiom in_Env : 𝔸 × tp → Env → Prop. -notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. -interpretation "Env membership" 'lefttriangle x l = (in_Env x l). - -let rec FV M ≝ match M with - [ par X ⇒ [X] - | app M1 M2 ⇒ FV M1@FV M2 - | abs T M0 ⇒ FV M0 - | _ ⇒ [ ] ]. - -(* axiom Lookup : 𝔸 → Env → option tp. *) - -(* forma alto livello del judgment - t_abs* : ∀G,T,X,M,U. - (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) → - Judg G (Lam X T (M[X])) (arr T U) *) - -(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *) - -axiom Judg_ind : ∀P:Env → tm → tp → Prop. - (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) → - (∀G,M,N,T,U. - Judg G M (arr T U) → Judg G N T → - P G M (arr T U) → P G N T → P G (app M N) U) → - (∀G,T1,T2,X,M1. - (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) → - (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) → - P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) → - ∀G,M,T.Judg G M T → P G M T. - -axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T. -axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U. -axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U). - -definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2. -interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2). - -axiom daemon : ∀P:Prop.P. - -theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T. -#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?) -@(Judg_ind … HJ) -[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub // -| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2 - [| @IH1 // | @IH2 // ] -| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH - [ (* trivial property of Lam *) @daemon - | (* trivial property of subenv *) @daemon ] -] -qed. - -(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e - ricorsione *) \ No newline at end of file diff --git a/matita/matita/lib/binding/fp.ma b/matita/matita/lib/binding/fp.ma deleted file mode 100644 index 14ba2f774..000000000 --- a/matita/matita/lib/binding/fp.ma +++ /dev/null @@ -1,296 +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 "binding/names.ma". - -(* permutations *) -definition finite_perm : ∀X:Nset.(X → X) → Prop ≝ - λX,f.injective X X f ∧ surjective X X f ∧ ∃l.∀x.x ∉ l → f x = x. - -(* maps a permutation to a list of parameters *) -definition Pi_list : ∀X:Nset.(X → X) → list X → list X ≝ - λX,p,xl.map ?? (λx.p x) xl. - -interpretation "permutation of X list" 'middot p x = (Pi_list p x). - -definition swap : ∀N:Nset.N → N → N → N ≝ - λN,u,v,x.match (x == u) with - [true ⇒ v - |false ⇒ match (x == v) with - [true ⇒ u - |false ⇒ x]]. - -axiom swap_right : ∀N,x,y.swap N x y y = x. -(* -#N x y;nnormalize;nrewrite > (p_eqb3 ? y y …);//; -nlapply (refl ? (y ≟ x));ncases (y ≟ x) in ⊢ (???% → %);nnormalize;//; -#H1;napply p_eqb1;//; -nqed. -*) - -axiom swap_left : ∀N,x,y.swap N x y x = y. -(* -#N x y;nnormalize;nrewrite > (p_eqb3 ? x x …);//; -nqed. -*) - -axiom swap_other : ∀N,x,y,z.x ≠ z → y ≠ z → swap N x y z = z. -(* -#N x y z H1 H2;nnormalize;nrewrite > (p_eqb4 …); -##[nrewrite > (p_eqb4 …);//;@;ncases H2;/2/; -##|@;ncases H1;/2/ -##] -nqed. -*) - -axiom swap_inv : ∀N,x,y,z.swap N x y (swap N x y z) = z. -(* -#N x y z;nlapply (refl ? (x ≟ z));ncases (x ≟ z) in ⊢ (???% → ?);#H1 -##[nrewrite > (p_eqb1 … H1);nrewrite > (swap_left …);//; -##|nlapply (refl ? (y ≟ z));ncases (y ≟ z) in ⊢ (???% → ?);#H2 - ##[nrewrite > (p_eqb1 … H2);nrewrite > (swap_right …);//; - ##|nrewrite > (swap_other …) in ⊢ (??(????%)?);/2/; - nrewrite > (swap_other …);/2/; - ##] -##] -nqed. -*) - -axiom swap_fp : ∀N,x1,x2.finite_perm ? (swap N x1 x2). -(* -#N x1 x2;@ -##[@ - ##[nwhd;#xa xb;nnormalize;nlapply (refl ? (xa ≟ x1)); - ncases (xa ≟ x1) in ⊢ (???% → %);#H1 - ##[nrewrite > (p_eqb1 … H1);nlapply (refl ? (xb ≟ x1)); - ncases (xb ≟ x1) in ⊢ (???% → %);#H2 - ##[nrewrite > (p_eqb1 … H2);// - ##|nlapply (refl ? (xb ≟ x2)); - ncases (xb ≟ x2) in ⊢ (???% → %);#H3 - ##[nnormalize;#H4;nrewrite > H4 in H3; - #H3;nrewrite > H3 in H2;#H2;ndestruct (H2) - ##|nnormalize;#H4;nrewrite > H4 in H3; - nrewrite > (p_eqb3 …);//;#H5;ndestruct (H5) - ##] - ##] - ##|nlapply (refl ? (xa ≟ x2)); - ncases (xa ≟ x2) in ⊢ (???% → %);#H2 - ##[nrewrite > (p_eqb1 … H2);nlapply (refl ? (xb ≟ x1)); - ncases (xb ≟ x1) in ⊢ (???% → %);#H3 - ##[nnormalize;#H4;nrewrite > H4 in H3; - #H3;nrewrite > (p_eqb1 … H3);@ - ##|nnormalize;nlapply (refl ? (xb ≟ x2)); - ncases (xb ≟ x2) in ⊢ (???% → %);#H4 - ##[nrewrite > (p_eqb1 … H4);// - ##|nnormalize;#H5;nrewrite > H5 in H3; - nrewrite > (p_eqb3 …);//;#H6;ndestruct (H6); - ##] - ##] - ##|nnormalize;nlapply (refl ? (xb ≟ x1)); - ncases (xb ≟ x1) in ⊢ (???% → %);#H3 - ##[nnormalize;#H4;nrewrite > H4 in H2;nrewrite > (p_eqb3 …);//; - #H5;ndestruct (H5) - ##|nlapply (refl ? (xb ≟ x2)); - ncases (xb ≟ x2) in ⊢ (???% → %);#H4 - ##[nnormalize;#H5;nrewrite > H5 in H1;nrewrite > (p_eqb3 …);//; - #H6;ndestruct (H6) - ##|nnormalize;// - ##] - ##] - ##] - ##] - ##|nwhd;#z;nnormalize;nlapply (refl ? (z ≟ x1)); - ncases (z ≟ x1) in ⊢ (???% → %);#H1 - ##[nlapply (refl ? (z ≟ x2)); - ncases (z ≟ x2) in ⊢ (???% → %);#H2 - ##[@ z;nrewrite > H1;nrewrite > H2;napply p_eqb1;// - ##|@ x2;nrewrite > (p_eqb4 …); - ##[nrewrite > (p_eqb3 …);//; - nnormalize;napply p_eqb1;// - ##|nrewrite < (p_eqb1 … H1);@;#H3;nrewrite > H3 in H2; - nrewrite > (p_eqb3 …);//;#H2;ndestruct (H2) - ##] - ##] - ##|nlapply (refl ? (z ≟ x2)); - ncases (z ≟ x2) in ⊢ (???% → %);#H2 - ##[@ x1;nrewrite > (p_eqb3 …);//; - napply p_eqb1;nnormalize;// - ##|@ z;nrewrite > H1;nrewrite > H2;@; - ##] - ##] - ##] -##|@ [x1;x2];#x0 H1;nrewrite > (swap_other …) - ##[@ - ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;/2/; - ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;//; - ##] -##] -nqed. -*) - -axiom inj_swap : ∀N,u,v.injective ?? (swap N u v). -(* -#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//; -nqed. -*) - -axiom surj_swap : ∀N,u,v.surjective ?? (swap N u v). -(* -#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//; -nqed. -*) - -axiom finite_swap : ∀N,u,v.∃l.∀x.x ∉ l → swap N u v x = x. -(* -#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//; -nqed. -*) - -(* swaps two lists of parameters -definition Pi_swap_list : ∀xl,xl':list X.X → X ≝ - λxl,xl',x.foldr2 ??? (λu,v,r.swap ? u v r) x xl xl'. - -nlemma fp_swap_list : - ∀xl,xl'.finite_perm ? (Pi_swap_list xl xl'). -#xl xl';@ -##[@; - ##[ngeneralize in match xl';nelim xl - ##[nnormalize;//; - ##|#x0 xl0;#IH xl'';nelim xl'' - ##[nnormalize;// - ##|#x1 xl1 IH1 y0 y1;nchange in ⊢ (??%% → ?) with (swap ????); - #H1;nlapply (inj_swap … H1);#H2; - nlapply (IH … H2);// - ##] - ##] - ##|ngeneralize in match xl';nelim xl - ##[nnormalize;#_;#z;@z;@ - ##|#x' xl0 IH xl'';nelim xl'' - ##[nnormalize;#z;@z;@ - ##|#x1 xl1 IH1 z; - nchange in ⊢ (??(λ_.???%)) with (swap ????); - ncases (surj_swap X x' x1 z);#x2 H1; - ncases (IH xl1 x2);#x3 H2;@ x3; - nrewrite < H2;napply H1 - ##] - ##] - ##] -##|ngeneralize in match xl';nelim xl - ##[#;@ [];#;@ - ##|#x0 xl0 IH xl'';ncases xl'' - ##[@ [];#;@ - ##|#x1 xl1;ncases (IH xl1);#xl2 H1; - ncases (finite_swap X x0 x1);#xl3 H2; - @ (xl2@xl3);#x2 H3; - nchange in ⊢ (??%?) with (swap ????); - nrewrite > (H1 …); - ##[nrewrite > (H2 …);//;@;#H4;ncases H3;#H5;napply H5; - napply in_list_to_in_list_append_r;// - ##|@;#H4;ncases H3;#H5;napply H5; - napply in_list_to_in_list_append_l;// - ##] - ##] - ##] -##] -nqed. - -(* the 'reverse' swap of lists of parameters - composing Pi_swap_list and Pi_swap_list_r yields the identity function - (see the Pi_swap_list_inv lemma) *) -ndefinition Pi_swap_list_r : ∀xl,xl':list X. Pi ≝ - λxl,xl',x.foldl2 ??? (λr,u,v.swap ? u v r ) x xl xl'. - -nlemma fp_swap_list_r : - ∀xl,xl'.finite_perm ? (Pi_swap_list_r xl xl'). -#xl xl';@ -##[@; - ##[ngeneralize in match xl';nelim xl - ##[nnormalize;//; - ##|#x0 xl0;#IH xl'';nelim xl'' - ##[nnormalize;// - ##|#x1 xl1 IH1 y0 y1;nwhd in ⊢ (??%% → ?); - #H1;nlapply (IH … H1);#H2; - napply (inj_swap … H2); - ##] - ##] - ##|ngeneralize in match xl';nelim xl - ##[nnormalize;#_;#z;@z;@ - ##|#x' xl0 IH xl'';nelim xl'' - ##[nnormalize;#z;@z;@ - ##|#x1 xl1 IH1 z;nwhd in ⊢ (??(λ_.???%)); - ncases (IH xl1 z);#x2 H1; - ncases (surj_swap X x' x1 x2);#x3 H2; - @ x3;nrewrite < H2;napply H1; - ##] - ##] - ##] -##|ngeneralize in match xl';nelim xl - ##[#;@ [];#;@ - ##|#x0 xl0 IH xl'';ncases xl'' - ##[@ [];#;@ - ##|#x1 xl1; - ncases (IH xl1);#xl2 H1; - ncases (finite_swap X x0 x1);#xl3 H2; - @ (xl2@xl3);#x2 H3;nwhd in ⊢ (??%?); - nrewrite > (H2 …); - ##[nrewrite > (H1 …);//;@;#H4;ncases H3;#H5;napply H5; - napply in_list_to_in_list_append_l;// - ##|@;#H4;ncases H3;#H5;napply H5; - napply in_list_to_in_list_append_r;// - ##] - ##] - ##] -##] -nqed. - -nlemma Pi_swap_list_inv : - ∀xl1,xl2,x. - Pi_swap_list xl1 xl2 (Pi_swap_list_r xl1 xl2 x) = x. -#xl;nelim xl -##[#;@ -##|#x1 xl1 IH xl';ncases xl' - ##[#;@ - ##|#x2 xl2;#x; - nchange in ⊢ (??%?) with - (swap ??? (Pi_swap_list ?? - (Pi_swap_list_r ?? (swap ????)))); - nrewrite > (IH xl2 ?);napply swap_inv; - ##] -##] -nqed. - -nlemma Pi_swap_list_fresh : - ∀x,xl1,xl2.x ∉ xl1 → x ∉ xl2 → Pi_swap_list xl1 xl2 x = x. -#x xl1;nelim xl1 -##[#;@ -##|#x3 xl3 IH xl2' H1;ncases xl2' - ##[#;@ - ##|#x4 xl4 H2;ncut (x ∉ xl3 ∧ x ∉ xl4); - ##[@ - ##[@;#H3;ncases H1;#H4;napply H4;/2/; - ##|@;#H3;ncases H2;#H4;napply H4;/2/ - ##] - ##] *; #H1' H2'; - nchange in ⊢ (??%?) with (swap ????); - nrewrite > (swap_other …) - ##[napply IH;//; - ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???); - nrewrite > (IH …);//;@;#H3;ncases H2;#H4;napply H4;//; - ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???); - nrewrite > (IH …);//;@;#H3;ncases H1;#H4;napply H4;// - ##] - ##] -##] -nqed. -*) \ No newline at end of file diff --git a/matita/matita/lib/binding/ln.ma b/matita/matita/lib/binding/ln.ma deleted file mode 100644 index ca7f574ed..000000000 --- a/matita/matita/lib/binding/ln.ma +++ /dev/null @@ -1,716 +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 "basics/lists/list.ma". -include "basics/deqsets.ma". -include "binding/names.ma". -include "binding/fp.ma". - -axiom alpha : Nset. -notation "𝔸" non associative with precedence 90 for @{'alphabet}. -interpretation "set of names" 'alphabet = alpha. - -inductive tp : Type[0] ≝ -| top : tp -| arr : tp → tp → tp. -inductive pretm : Type[0] ≝ -| var : nat → pretm -| par : 𝔸 → pretm -| abs : tp → pretm → pretm -| app : pretm → pretm → pretm. - -let rec Nth T n (l:list T) on n ≝ - match l with - [ nil ⇒ None ? - | cons hd tl ⇒ match n with - [ O ⇒ Some ? hd - | S n0 ⇒ Nth T n0 tl ] ]. - -let rec vclose_tm_aux u x k ≝ match u with - [ var n ⇒ if (leb k n) then var (S n) else u - | par x0 ⇒ if (x0 == x) then (var k) else u - | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k) - | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ]. -definition vclose_tm ≝ λu,x.vclose_tm_aux u x O. - -definition vopen_var ≝ λn,x,k.match eqb n k with - [ true ⇒ par x - | false ⇒ match leb n k with - [ true ⇒ var n - | false ⇒ var (pred n) ] ]. - -let rec vopen_tm_aux u x k ≝ match u with - [ var n ⇒ vopen_var n x k - | par x0 ⇒ u - | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k) - | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ]. -definition vopen_tm ≝ λu,x.vopen_tm_aux u x O. - -let rec FV u ≝ match u with - [ par x ⇒ [x] - | app v1 v2 ⇒ FV v1@FV v2 - | abs s v ⇒ FV v - | _ ⇒ [ ] ]. - -definition lam ≝ λx,s,u.abs s (vclose_tm u x). - -let rec Pi_map_tm p u on u ≝ match u with -[ par x ⇒ par (p x) -| var _ ⇒ u -| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2) -| abs s v ⇒ abs s (Pi_map_tm p v) ]. - -interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x). - -notation "hvbox(u⌈x⌉)" - with precedence 45 - for @{ 'open $u $x }. - -(* -notation "hvbox(u⌈x⌉)" - with precedence 45 - for @{ 'open $u $x }. -notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }. -*) -interpretation "ln term variable open" 'open u x = (vopen_tm u x). -notation < "hvbox(ν x break . u)" - with precedence 20 -for @{'nu $x $u }. -notation > "ν list1 x sep , . term 19 u" with precedence 20 - for ${ fold right @{$u} rec acc @{'nu $x $acc)} }. -interpretation "ln term variable close" 'nu x u = (vclose_tm u x). - -let rec tm_height u ≝ match u with -[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2)) -| abs s v ⇒ S (tm_height v) -| _ ⇒ O ]. - -theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n. -#n (cases n) // #a #abs cases (?:False) /2/ qed. - -theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0]. -(∀m.(∀p. p < m → P p) → P m) → P n. -#n #P #H -cut (∀q:nat. q ≤ n → P q) /2/ -(elim n) - [#q #HleO (* applica male *) - @(le_n_O_rect_Type0 ? HleO) - @H #p #ltpO cases (?:False) /2/ (* 3 *) - |#p #Hind #q #HleS - @H #a #lta @Hind @le_S_S_to_le /2/ - ] -qed. - -lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n. -#n elim n -[ #m normalize #H destruct(H) -| #n0 #IH * // #m normalize #H @le_S_S @IH // ] -qed. - -lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u. -#x #u elim u -[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk - [ >Hnk >eqb_n_n normalize >(\b ?) // - | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb - [ >Hleb normalize >(?:leb k n = false) // - @lt_to_leb_false @not_eq_to_le_to_lt /2/ - | >Hleb normalize >(?:leb k (pred n) = true) normalize - [ cases (leb_false_to_lt … Hleb) // - | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ] -| #y normalize #Hy >(\bf ?) // @(not_to_not … Hy) // -| #s #v #IH normalize #Hv #k >IH // @Hv -| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k - >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ] - @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ] -qed. - -corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u. -#x #u #Hu @nominal_eta_aux // -qed. - -lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v. -#v #x elim v -[ #n #k normalize cases (eqb n k) // cases (leb n k) // -| #u #k % -| #s #u #IH #k normalize >IH % -| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ] -qed. - -corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v. -#v #x @eq_height_vopen_aux -qed. - -theorem pretm_ind_plus_aux : - ∀P:pretm → Type[0]. - (∀x:𝔸.P (par x)) → - (∀n:ℕ.P (var n)) → - (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → - ∀C:list 𝔸. - (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → - ∀n,u.tm_height u ≤ n → P u. -#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??) -#m cases m -[ #_ * /2/ - [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/ - | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (max ??)) - [ #H @H @Hfalse|*:skip] ] ] --m #m #IH * /2/ -[ #s #v whd in ⊢ (?%?→?); #Hv - lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy - >(?:abs s v = lam y s (v⌈y⌉)) - [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ] - @Hlam - [ @(not_to_not … Hy) @in_list_to_in_list_append_r - | @(not_to_not … Hy) @in_list_to_in_list_append_l ] - @IH [| @Hv | >eq_height_vopen % ] -| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ - [ @IH [| @Hv | @le_max_1 ] | @IH [| @Hv | @le_max_2 ] ] ] -qed. - -corollary pretm_ind_plus : - ∀P:pretm → Type[0]. - (∀x:𝔸.P (par x)) → - (∀n:ℕ.P (var n)) → - (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → - ∀C:list 𝔸. - (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → - ∀u.P u. -#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/ -qed. - -(* maps a permutation to a list of terms *) -definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 . - -(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*) - -(* -inductive tm : pretm → Prop ≝ -| tm_par : ∀x:𝔸.tm (par x) -| tm_app : ∀u,v.tm u → tm v → tm (app u v) -| tm_lam : ∀x,s,u.tm u → tm (lam x s u). - -inductive ctx_aux : nat → pretm → Prop ≝ -| ctx_var : ∀n,k.n < k → ctx_aux k (var n) -| ctx_par : ∀x,k.ctx_aux k (par x) -| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v) -(* è sostituibile da ctx_lam ? *) -| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u). -*) - -inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝ -| toc_var : ∀n.n < k → tm_or_ctx k (var n) -| toc_par : ∀x.tm_or_ctx k (par x) -| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v) -| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u). - -definition tm ≝ λt.tm_or_ctx O t. -definition ctx ≝ λt.tm_or_ctx 1 t. - -definition check_tm ≝ λu,k. - pretm_ind_plus ? - (λ_.true) - (λn.leb (S n) k) - (λv1,v2,rv1,rv2.rv1 ∧ rv2) - [] (λx,s,v,px,pC,rv.rv) - u. - -axiom pretm_ind_plus_app : ∀P,u,v,C,H1,H2,H3,H4. - pretm_ind_plus P H1 H2 H3 C H4 (app u v) = - H3 u v (pretm_ind_plus P H1 H2 H3 C H4 u) (pretm_ind_plus P H1 H2 H3 C H4 v). - -axiom pretm_ind_plus_lam : ∀P,x,s,u,C,px,pC,H1,H2,H3,H4. - pretm_ind_plus P H1 H2 H3 C H4 (lam x s (u⌈x⌉)) = - H4 x s u px pC (pretm_ind_plus P H1 H2 H3 C H4 (u⌈x⌉)). - -record TM : Type[0] ≝ { - pretm_of_TM :> pretm; - tm_of_TM : check_tm pretm_of_TM O = true -}. - -record CTX : Type[0] ≝ { - pretm_of_CTX :> pretm; - ctx_of_CTX : check_tm pretm_of_CTX 1 = true -}. - -inductive tm2 : pretm → Type[0] ≝ -| tm_par : ∀x.tm2 (par x) -| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v) -| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)). - -(* -inductive tm' : pretm → Prop ≝ -| tm_par : ∀x.tm' (par x) -| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v) -| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)). -*) - -lemma pi_vclose_tm : - ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u). -#z1 #z2 #x #u -change with (vclose_tm_aux ???) in match (vclose_tm ??); -change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u normalize // -[ #n #k cases (leb k n) normalize % -| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 normalize - [ cases (true_or_false (x0==x)) #H2 >H2 normalize - [ <(\P H2) >H1 normalize >(\b (refl ? z2)) % - | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize - [ >(\P H3) in H2; >H1 #Hfalse destruct (Hfalse) - | cases (true_or_false (x==z2)) #H4 >H4 normalize - [ cases (true_or_false (z2==z1)) #H5 >H5 normalize // - >(\P H5) in H4; >H3 #Hfalse destruct (Hfalse) - | >(\bf ?) // @sym_not_eq @(\Pf H4) ] - ] - ] - | cases (true_or_false (x0==x)) #H2 >H2 normalize - [ <(\P H2) >H1 normalize >(\b (refl ??)) % - | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize - [ cases (true_or_false (x0==z2)) #H4 >H4 normalize - [ cases (true_or_false (z1==z2)) #H5 >H5 normalize // - <(\P H5) in H4; <(\P H3) >H2 #Hfalse destruct (Hfalse) - | >H4 % ] - | cases (true_or_false (x0==z2)) #H4 >H4 normalize - [ cases (true_or_false (x==z2)) #H5 >H5 normalize - [ <(\P H5) in H4; >H2 #Hfalse destruct (Hfalse) - | >(\bf ?) // @sym_not_eq @(\Pf H3) ] - | cases (true_or_false (x==z2)) #H5 >H5 normalize - [ >H1 % - | >H2 % ] - ] - ] - ] - ] -] -qed. - -lemma pi_vopen_tm : - ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉). -#z1 #z2 #x #u -change with (vopen_tm_aux ???) in match (vopen_tm ??); -change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u normalize // -#n #k cases (true_or_false (eqb n k)) #H1 >H1 normalize // -cases (true_or_false (leb n k)) #H2 >H2 normalize // -qed. - -lemma pi_lam : - ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u). -#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) % -qed. - -lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u). -#z1 #z2 #u elim u // -[ #s #v normalize // -| #v1 #v2 normalize /2/ ] -qed. - -lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u. -#z1 #z2 #u elim u [1,3,4:normalize //] -#x whd in ⊢ (??%?); >swap_inv % -qed. - -lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l. -#x #l #z1 #z2 #Hin elim Hin -[ #x0 #l0 % -| #x1 #x2 #l0 #Hin #IH %2 @IH ] -qed. - -lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u). -#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/ -#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3 -[ @(not_to_not … Hx) -Hx #Hx - <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list // -| #y #Hy <(swap_inv ? z1 z2 y) - eqv_FV @eqv_in_list // -] -qed. - -lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u. -#x #u elim u normalize // -[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?); - [ cases (true_or_false (eqb (S n) k)) #H1 >H1 - [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H - cases (le_to_not_lt … H) -H #H cases (H ?) % - | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ] - | cases (true_or_false (eqb n k)) #H1 >H1 normalize - [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H - * #H cases (H ?) % - | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H; - [ #H destruct (H) | /2/ ] - ] - ] -| #x0 #k cases (true_or_false (x0==x)) #H1 >H1 normalize // >(\P H1) >eqb_n_n % ] -qed. - -lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux -qed. - -(* -theorem tm_to_tm : ∀t.tm' t → tm t. -#t #H elim H -*) - -lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2. -#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/ -qed. - -lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k). -#u #x elim u // -[ #n #k normalize cases (leb k n) normalize // -| #x0 #k normalize cases (true_or_false (x0==x)) #H >H normalize // - lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) % -| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) /2/ ] -qed. - -lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). // -qed. - -lemma check_tm_true_to_toc : ∀u,k.check_tm u k = true → tm_or_ctx k u. -#u @(pretm_ind_plus ???? [ ] ? u) -[ #x #k #_ %2 -| #n #k change with (leb (S n) k) in ⊢ (??%?→?); #H % @leb_true_to_le // -| #v1 #v2 #rv1 #rv2 #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?); - >pretm_ind_plus_app #H cases (andb_true ?? H) -H #Hv1 #Hv2 %3 - [ @rv1 @Hv1 | @rv2 @Hv2 ] -| #x #s #v #Hx #_ #rv #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?); - >pretm_ind_plus_lam // #Hv %4 @rv @Hv ] -qed. - -lemma toc_to_check_tm_true : ∀u,k.tm_or_ctx k u → check_tm u k = true. -#u #k #Hu elim Hu // -[ #n #Hn change with (leb (S n) k) in ⊢ (??%?); @le_to_leb_true @Hn -| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 change with (pretm_ind_plus ???????) in ⊢ (??%?); - >pretm_ind_plus_app change with (check_tm v1 k ∧ check_tm v2 k) in ⊢ (??%?); /2/ -| #x #s #v #Hv #IH <(vclose_vopen x v) change with (pretm_ind_plus ???????) in ⊢ (??%?); - >pretm_ind_plus_lam [| // | @fresh_vclose_tm ] >(vclose_vopen x v) @IH ] -qed. - -lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u. -#z1 #z2 #u elim u -[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other // - [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] // -|1: // -| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1] -| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2 - >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ] - >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ] -] -qed. - -theorem tm_to_tm2 : ∀u.tm u → tm2 u. -#t #Ht elim Ht -[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn) -| @tm_par -| #u #v #Hu #Hv @tm_app -| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam - [ @fresh_vclose_tm - | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ] -] -qed. - -theorem tm2_to_tm : ∀u.tm2 u → tm u. -#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH // -qed. - -(* define PAR APP LAM *) -definition PAR ≝ λx.mk_TM (par x) ?. // qed. -definition APP ≝ λu,v:TM.mk_TM (app u v) ?. -change with (pretm_ind_plus ???????) in match (check_tm ??); >pretm_ind_plus_app -change with (check_tm ??) in match (pretm_ind_plus ???????); change with (check_tm ??) in match (pretm_ind_plus ???????) in ⊢ (??(??%)?); -@andb_elim >(tm_of_TM u) >(tm_of_TM v) % qed. -definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?. -change with (pretm_ind_plus ???????) in match (check_tm ??); <(vclose_vopen x u) ->pretm_ind_plus_lam [| // | @fresh_vclose_tm ] -change with (check_tm ??) in match (pretm_ind_plus ???????); >vclose_vopen -@(tm_of_TM u) qed. - -axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉). -(* needs true_plus_false - -#u #x #k #Hu elim Hu -[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2] - normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ] - normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ] - #n0 #_ #Hn0 % @le_S_S_to_le // -| #x0 %2 -| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 // -| #x0 #s #v #Hv #IH normalize @daemon -] -qed. -*) - -definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) ?. -@toc_to_check_tm_true @vopen_tm_down @check_tm_true_to_toc @ctx_of_CTX qed. - -axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u). - -definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) ?. -@toc_to_check_tm_true @vclose_tm_up @check_tm_true_to_toc @tm_of_TM qed. - -interpretation "ln wf term variable open" 'open u x = (vopen_TM u x). -interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x). - -theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉). -#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta // -qed. - -lemma TM_to_tm2 : ∀u:TM.tm2 u. -#u @tm_to_tm2 @check_tm_true_to_toc @tm_of_TM qed. - -theorem TM_ind_plus_weak : - ∀P:pretm → Type[0]. - (∀x:𝔸.P (PAR x)) → - (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) → - ∀C:list 𝔸. - (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C → - (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) → - ∀u:TM.P u. -#P #Hpar #Happ #C #Hlam #u elim (TM_to_tm2 u) // -[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2) - @toc_to_check_tm_true @tm2_to_tm // -| #x #s #v #Hx #pv #IH - lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0 - >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉)) - [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ] - @(Hlam x0 s (mk_CTX v ?) ??) - [ <(nominal_eta … Hx) @toc_to_check_tm_true @vclose_tm_up @tm2_to_tm @pv // - | @(not_to_not … Hx0) @in_list_to_in_list_append_r - | @(not_to_not … Hx0) @in_list_to_in_list_append_l - | @IH ] -] -qed. - -lemma eq_mk_TM : ∀u,v.u = v → ∀pu,pv.mk_TM u pu = mk_TM v pv. -#u #v #Heq >Heq #pu #pv % -qed. - -lemma eq_P : ∀T:Type[0].∀t1,t2:T.t1 = t2 → ∀P:T → Type[0].P t1 → P t2. // qed. - -theorem TM_ind_plus : - ∀P:TM → Type[0]. - (∀x:𝔸.P (PAR x)) → - (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) → - ∀C:list 𝔸. - (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C → - (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) → - ∀u:TM.P u. -#P #Hpar #Happ #C #Hlam * #u #pu ->(?:mk_TM u pu = - mk_TM u (toc_to_check_tm_true … (tm2_to_tm … (tm_to_tm2 … (check_tm_true_to_toc … pu))))) [|%] -elim (tm_to_tm2 u ?) // -[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2) -| #x #s #v #Hx #pv #IH - lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0 - lapply (Hlam x0 s (mk_CTX v ?) ???) - [2: @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 - |4: @toc_to_check_tm_true <(nominal_eta x v) // @vclose_tm_up @tm2_to_tm @pv // - | #y #Hy whd in match (vopen_TM ??); - >(?:mk_TM (v⌈y⌉) ? = mk_TM (v⌈y⌉) (toc_to_check_tm_true (v⌈y⌉) O (tm2_to_tm (v⌈y⌉) (pv y Hy)))) - [@IH|%] - | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0 - | @eq_P @eq_mk_TM whd in match (vopen_TM ??); @tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ] -] -qed. - -notation -"hvbox('nominal' u 'return' out 'with' - [ 'xpar' ident x ⇒ f1 - | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2 - | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])" -with precedence 48 -for @{ TM_ind_plus $out (λ${ident x}:?.$f1) - (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2) - $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3) - $u }. - -(* include "basics/jmeq.ma".*) - -definition subst ≝ (λu:TM.λx,v. - nominal u return (λ_.TM) with - [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ] (* u instead of PAR x0 does not work, u stays the same at every rec call! *) - | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2 - | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]). - -lemma subst_def : ∀u,x,v.subst u x v = - nominal u return (λ_.TM) with - [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ] - | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2 - | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]. // -qed. - -axiom TM_ind_plus_LAM : - ∀x,s,u,out,f1,f2,C,f3,Hx1,Hx2. - TM_ind_plus out f1 f2 C f3 (LAM x s (u⌈x⌉)) = - f3 x s u Hx1 Hx2 (λy,Hy.TM_ind_plus ? f1 f2 C f3 ?). - -axiom TM_ind_plus_APP : - ∀u1,u2,out,f1,f2,C,f3. - TM_ind_plus out f1 f2 C f3 (APP u1 u2) = - f2 u1 u2 (TM_ind_plus out f1 f2 C f3 ?) (TM_ind_plus out f1 f2 C f3 ?). - -lemma eq_mk_CTX : ∀u,v.u = v → ∀pu,pv.mk_CTX u pu = mk_CTX v pv. -#u #v #Heq >Heq #pu #pv % -qed. - -lemma vclose_vopen_TM : ∀x.∀u:TM.((νx.u)⌈x⌉) = u. -#x * #u #pu @eq_mk_TM @vclose_vopen qed. - -lemma nominal_eta_CTX : ∀x.∀u:CTX.x ∉ FV u → (νx.(u⌈x⌉)) = u. -#x * #u #pu #Hx @eq_mk_CTX @nominal_eta // qed. - -theorem TM_alpha : ∀x,y,s.∀u:CTX.x ∉ FV u → y ∉ FV u → LAM x s (u⌈x⌉) = LAM y s (u⌈y⌉). -#x #y #s #u #Hx #Hy @eq_mk_TM @tm_alpha // qed. - -axiom in_vopen_CTX : ∀x,y.∀v:CTX.x ∈ FV (v⌈y⌉) → x = y ∨ x ∈ FV v. - -theorem subst_fresh : ∀u,v:TM.∀x.x ∉ FV u → subst u x v = u. -#u #v #x @(TM_ind_plus … (x::FV v) … u) -[ #x0 normalize in ⊢ (%→?); #Hx normalize in ⊢ (??%?); - >(\bf ?) [| @(not_to_not … Hx) #Heq >Heq % ] % -| #u1 #u2 #IH1 #IH2 normalize in ⊢ (%→?); #Hx - >subst_def >TM_ind_plus_APP @eq_mk_TM @eq_f2 @eq_f - [ subst_def >TM_ind_plus_LAM [|@HC|@Hx0] - @eq_f nominal_eta_CTX // - cases (in_vopen_CTX … Hx) // #Heq >Heq in HC; * #HC @False_ind @HC % -] -qed. - -example subst_LAM_same : ∀x,s,u,v. subst (LAM x s u) x v = LAM x s u. -#x #s #u #v >subst_def <(vclose_vopen_TM x u) -lapply (p_fresh … (FV (νx.u)@x::FV v)) letin x0 ≝ (N_fresh … (FV (νx.u)@x::FV v)) #Hx0 ->(TM_alpha x x0) -[| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 | @fresh_vclose_tm ] ->TM_ind_plus_LAM [| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0 | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 ] -@eq_f change with (subst ((νx.u)⌈x0⌉) x v) in ⊢ (??%?); @subst_fresh -@(not_to_not … Hx0) #Hx0' cases (in_vopen_CTX … Hx0') -[ #Heq >Heq @in_list_to_in_list_append_r % -| #Hfalse @False_ind cases (fresh_vclose_tm u x) #H @H @Hfalse ] -qed. - -(* -notation > "Λ ident x. ident T [ident x] ↦ P" - with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}. - -notation < "Λ ident x. ident T [ident x] ↦ P" - with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}. -*) - -(* -notation -"hvbox('nominal' u 'with' - [ 'xpar' ident x ⇒ f1 - | 'xapp' ident v1 ident v2 ⇒ f2 - | 'xlam' ident x # C s w ⇒ f3 ])" -with precedence 48 -for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) - (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) - $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. -*) - -(* -notation -"hvbox('nominal' u 'with' - [ 'xpar' ident x ^ f1 - | 'xapp' ident v1 ident v2 ^ f2 ])" -(* | 'xlam' ident x # C s w ^ f3 ]) *) -with precedence 48 -for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) - (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) - $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. -*) -notation -"hvbox('nominal' u 'with' - [ 'xpar' ident x ^ f1 - | 'xapp' ident v1 ident v2 ^ f2 ])" -with precedence 48 -for @{ tm2_ind_plus ? (λ${ident x}:?.$f1) - (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) - $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. - -axiom in_Env : 𝔸 × tp → Env → Prop. -notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. -interpretation "Env membership" 'lefttriangle x l = (in_Env x l). - - - -inductive judg : list tp → tm → tp → Prop ≝ -| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t -| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u -| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u). - -definition Env := list (𝔸 × tp). - -axiom vclose_env : Env → list tp. -axiom vclose_tm : Env → tm → tm. -axiom Lam : 𝔸 → tp → tm → tm. -definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T. -definition dom ≝ λG:Env.map ?? (fst ??) G. - -definition sctx ≝ 𝔸 × tm. -axiom swap_tm : 𝔸 → 𝔸 → tm → tm. -definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M. - -axiom in_list : ∀A:Type[0].A → list A → Prop. -interpretation "list membership" 'mem x l = (in_list ? x l). -interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)). - -axiom in_Env : 𝔸 × tp → Env → Prop. -notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. -interpretation "Env membership" 'lefttriangle x l = (in_Env x l). - -(* axiom Lookup : 𝔸 → Env → option tp. *) - -(* forma alto livello del judgment - t_abs* : ∀G,T,X,M,U. - (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) → - Judg G (Lam X T (M[X])) (arr T U) *) - -(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *) - -axiom Judg_ind : ∀P:Env → tm → tp → Prop. - (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) → - (∀G,M,N,T,U. - Judg G M (arr T U) → Judg G N T → - P G M (arr T U) → P G N T → P G (app M N) U) → - (∀G,T1,T2,X,M1. - (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) → - (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) → - P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) → - ∀G,M,T.Judg G M T → P G M T. - -axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T. -axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U. -axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U). - -definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2. -interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2). - -axiom daemon : ∀P:Prop.P. - -theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T. -#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?) -@(Judg_ind … HJ) -[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub // -| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2 - [| @IH1 // | @IH2 // ] -| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH - [ (* trivial property of Lam *) @daemon - | (* trivial property of subenv *) @daemon ] -] -qed. - -(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e - ricorsione *) \ No newline at end of file diff --git a/matita/matita/lib/binding/ln_concrete.ma b/matita/matita/lib/binding/ln_concrete.ma deleted file mode 100644 index bdafdb1a0..000000000 --- a/matita/matita/lib/binding/ln_concrete.ma +++ /dev/null @@ -1,683 +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 "basics/lists/list.ma". -include "basics/deqsets.ma". -include "binding/names.ma". -include "binding/fp.ma". - -definition alpha : Nset ≝ X. check alpha -notation "𝔸" non associative with precedence 90 for @{'alphabet}. -interpretation "set of names" 'alphabet = alpha. - -inductive tp : Type[0] ≝ -| top : tp -| arr : tp → tp → tp. -inductive pretm : Type[0] ≝ -| var : nat → pretm -| par : 𝔸 → pretm -| abs : tp → pretm → pretm -| app : pretm → pretm → pretm. - -let rec Nth T n (l:list T) on n ≝ - match l with - [ nil ⇒ None ? - | cons hd tl ⇒ match n with - [ O ⇒ Some ? hd - | S n0 ⇒ Nth T n0 tl ] ]. - -let rec vclose_tm_aux u x k ≝ match u with - [ var n ⇒ if (leb k n) then var (S n) else u - | par x0 ⇒ if (x0 == x) then (var k) else u - | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k) - | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ]. -definition vclose_tm ≝ λu,x.vclose_tm_aux u x O. - -definition vopen_var ≝ λn,x,k.match eqb n k with - [ true ⇒ par x - | false ⇒ match leb n k with - [ true ⇒ var n - | false ⇒ var (pred n) ] ]. - -let rec vopen_tm_aux u x k ≝ match u with - [ var n ⇒ vopen_var n x k - | par x0 ⇒ u - | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k) - | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ]. -definition vopen_tm ≝ λu,x.vopen_tm_aux u x O. - -let rec FV u ≝ match u with - [ par x ⇒ [x] - | app v1 v2 ⇒ FV v1@FV v2 - | abs s v ⇒ FV v - | _ ⇒ [ ] ]. - -definition lam ≝ λx,s,u.abs s (vclose_tm u x). - -let rec Pi_map_tm p u on u ≝ match u with -[ par x ⇒ par (p x) -| var _ ⇒ u -| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2) -| abs s v ⇒ abs s (Pi_map_tm p v) ]. - -interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x). - -notation "hvbox(u⌈x⌉)" - with precedence 45 - for @{ 'open $u $x }. - -(* -notation "hvbox(u⌈x⌉)" - with precedence 45 - for @{ 'open $u $x }. -notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }. -*) -interpretation "ln term variable open" 'open u x = (vopen_tm u x). -notation < "hvbox(ν x break . u)" - with precedence 20 -for @{'nu $x $u }. -notation > "ν list1 x sep , . term 19 u" with precedence 20 - for ${ fold right @{$u} rec acc @{'nu $x $acc)} }. -interpretation "ln term variable close" 'nu x u = (vclose_tm u x). - -let rec tm_height u ≝ match u with -[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2)) -| abs s v ⇒ S (tm_height v) -| _ ⇒ O ]. - -theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n. -#n (cases n) // #a #abs cases (?:False) /2/ qed. - -theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0]. -(∀m.(∀p. p < m → P p) → P m) → P n. -#n #P #H -cut (∀q:nat. q ≤ n → P q) /2/ -(elim n) - [#q #HleO (* applica male *) - @(le_n_O_rect_Type0 ? HleO) - @H #p #ltpO cases (?:False) /2/ (* 3 *) - |#p #Hind #q #HleS - @H #a #lta @Hind @le_S_S_to_le /2/ - ] -qed. - -lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n. -#n elim n -[ #m normalize #H destruct(H) -| #n0 #IH * // #m normalize #H @le_S_S @IH // ] -qed. - -lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u. -#x #u elim u -[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk - [ >Hnk >eqb_n_n whd in ⊢ (??%?); >(\b ?) // - | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb - [ >Hleb normalize >(?:leb k n = false) // - @lt_to_leb_false @not_eq_to_le_to_lt /2/ - | >Hleb normalize >(?:leb k (pred n) = true) normalize - [ cases (leb_false_to_lt … Hleb) // - | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ] -| #y normalize in ⊢ (%→?→?); #Hy whd in ⊢ (?→??%?); >(\bf ?) // @(not_to_not … Hy) // -| #s #v #IH normalize #Hv #k >IH // @Hv -| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k - >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ] - @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ] -qed. - -corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u. -#x #u #Hu @nominal_eta_aux // -qed. - -lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v. -#v #x elim v -[ #n #k normalize cases (eqb n k) // cases (leb n k) // -| #u #k % -| #s #u #IH #k normalize >IH % -| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ] -qed. - -corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v. -#v #x @eq_height_vopen_aux -qed. - -theorem pretm_ind_plus_aux : - ∀P:pretm → Type[0]. - (∀x:𝔸.P (par x)) → - (∀n:ℕ.P (var n)) → - (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → - ∀C:list 𝔸. - (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → - ∀n,u.tm_height u ≤ n → P u. -#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??) -#m cases m -[ #_ * /2/ - [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/ - | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (S (max ??))) /2/ ] ] --m #m #IH * /2/ -[ #s #v whd in ⊢ (?%?→?); #Hv - lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy - >(?:abs s v = lam y s (v⌈y⌉)) - [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ] - @Hlam - [ @(not_to_not … Hy) @in_list_to_in_list_append_r - | @(not_to_not … Hy) @in_list_to_in_list_append_l ] - @IH [| @Hv | >eq_height_vopen % ] -| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ - [ @IH [| @Hv | // ] | @IH [| @Hv | // ] ] ] -qed. - -corollary pretm_ind_plus : - ∀P:pretm → Type[0]. - (∀x:𝔸.P (par x)) → - (∀n:ℕ.P (var n)) → - (∀v1,v2. P v1 → P v2 → P (app v1 v2)) → - ∀C:list 𝔸. - (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) → - ∀u.P u. -#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/ -qed. - -(* maps a permutation to a list of terms *) -definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 . - -(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*) - -(* -inductive tm : pretm → Prop ≝ -| tm_par : ∀x:𝔸.tm (par x) -| tm_app : ∀u,v.tm u → tm v → tm (app u v) -| tm_lam : ∀x,s,u.tm u → tm (lam x s u). - -inductive ctx_aux : nat → pretm → Prop ≝ -| ctx_var : ∀n,k.n < k → ctx_aux k (var n) -| ctx_par : ∀x,k.ctx_aux k (par x) -| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v) -(* è sostituibile da ctx_lam ? *) -| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u). -*) - -inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝ -| toc_var : ∀n.n < k → tm_or_ctx k (var n) -| toc_par : ∀x.tm_or_ctx k (par x) -| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v) -| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u). - -definition tm ≝ λt.tm_or_ctx O t. -definition ctx ≝ λt.tm_or_ctx 1 t. - -record TM : Type[0] ≝ { - pretm_of_TM :> pretm; - tm_of_TM : tm pretm_of_TM -}. - -record CTX : Type[0] ≝ { - pretm_of_CTX :> pretm; - ctx_of_CTX : ctx pretm_of_CTX -}. - -inductive tm2 : pretm → Type[0] ≝ -| tm_par : ∀x.tm2 (par x) -| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v) -| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)). - -(* -inductive tm' : pretm → Prop ≝ -| tm_par : ∀x.tm' (par x) -| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v) -| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)). -*) - -axiom swap_inj : ∀N.∀z1,z2,x,y.swap N z1 z2 x = swap N z1 z2 y → x = y. - -lemma pi_vclose_tm : - ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u). -#z1 #z2 #x #u -change with (vclose_tm_aux ???) in match (vclose_tm ??); -change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u -[3:whd in ⊢ (?→?→(?→ ??%%)→?→??%%); // -|4:whd in ⊢ (?→?→(?→??%%)→(?→??%%)→?→??%%); // -| #n #k whd in ⊢ (??(??%)%); cases (leb k n) normalize % -| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 whd in ⊢ (??%%); - [ cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%); - [ <(\P H2) >H1 whd in ⊢ (??(??%)%); >(\b ?) // >(\b ?) // - | >H2 whd in match (swap ????); >H1 - whd in match (if false then var k else ?); - whd in match (if true then z2 else ?); >(\bf ?) - [ >(\P H1) >swap_left % - | <(swap_inv ? z1 z2 z2) in ⊢ (?(??%?)); % #H3 - lapply (swap_inj … H3) >swap_right #H4

H1 #H destruct (H) ] - ] - | >(?:(swap ? z1 z2 x0 == swap ? z1 z2 x) = (x0 == x)) - [| cases (true_or_false (x0==x)) #H2 >H2 - [ >(\P H2) @(\b ?) % - | @(\bf ?) % #H >(swap_inj … H) in H2; >(\b ?) // #H0 destruct (H0) ] ] - cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%); - [ <(\P H2) >H1 >(\b (refl ??)) % - | >H1 >H2 % ] - ] - ] -qed. - -lemma pi_vopen_tm : - ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉). -#z1 #z2 #x #u -change with (vopen_tm_aux ???) in match (vopen_tm ??); -change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u // -[2: #s #v whd in ⊢ ((?→??%%)→?→??%%); // -|3: #v1 #v2 whd in ⊢ ((?→??%%)→(?→??%%)→?→??%%); /2/ ] -#n #k whd in ⊢ (??(??%)%); cases (true_or_false (eqb n k)) #H1 >H1 // -cases (true_or_false (leb n k)) #H2 >H2 normalize // -qed. - -lemma pi_lam : - ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u). -#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) % -qed. - -lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u). -#z1 #z2 #u elim u // -[ #s #v #H @H -| #v1 #v2 whd in ⊢ (??%%→??%%→??%%); #H1 #H2 >H1 >H2 - whd in ⊢ (???(????%)); /2/ ] -qed. - -lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u. -#z1 #z2 #u elim u -[1: #n % -|3: #s #v whd in ⊢ (?→??%%); // -|4: #v1 #v2 #Hv1 #Hv2 whd in ⊢ (??%%); // ] -#x whd in ⊢ (??%?); >swap_inv % -qed. - -lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l. -#x #l #z1 #z2 #Hin elim Hin -[ #x0 #l0 % -| #x1 #x2 #l0 #Hin #IH %2 @IH ] -qed. - -lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u). -#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/ -#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3 -[ @(not_to_not … Hx) -Hx #Hx - <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list // -| #y #Hy <(swap_inv ? z1 z2 y) - eqv_FV @eqv_in_list // -] -qed. - -lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u. -#x #u elim u [1,3,4:normalize //] -[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?); - [ cases (true_or_false (eqb (S n) k)) #H1 >H1 - [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H - cases (le_to_not_lt … H) -H #H cases (H ?) % - | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ] - | cases (true_or_false (eqb n k)) #H1 >H1 normalize - [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H - * #H cases (H ?) % - | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H; - [ #H destruct (H) | /2/ ] - ] - ] -| #x0 #k whd in ⊢ (??(?%??)?); cases (true_or_false (x0==x)) - #H1 >H1 normalize // >(\P H1) >eqb_n_n % ] -qed. - -lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux -qed. - -(* -theorem tm_to_tm : ∀t.tm' t → tm t. -#t #H elim H -*) - -lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2. -#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/ -qed. - -lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k). -#u #x elim u // -[ #n #k normalize cases (leb k n) normalize // -| #x0 #k whd in ⊢ (?(???(?%))); cases (true_or_false (x0==x)) #H >H normalize // - lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) % -| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) -Hin #Hin - [ cases (IH1 k) -IH1 #IH1 @IH1 @Hin | cases (IH2 k) -IH2 #IH2 @IH2 @Hin ] -qed. - -lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). // -qed. - -lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u. -#z1 #z2 #u elim u -[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other // - [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] // -|1: // -| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1] -| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2 - >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ] - >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ] -] -qed. - -theorem tm_to_tm2 : ∀u.tm u → tm2 u. -#t #Ht elim Ht -[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn) -| @tm_par -| #u #v #Hu #Hv @tm_app -| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam - [ @fresh_vclose_tm - | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ] -] -qed. - -theorem tm2_to_tm : ∀u.tm2 u → tm u. -#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH // -qed. - -definition PAR ≝ λx.mk_TM (par x) ?. // qed. -definition APP ≝ λu,v:TM.mk_TM (app u v) ?./2/ qed. -definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?./2/ qed. - -axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉). -(* needs true_plus_false - -#u #x #k #Hu elim Hu -[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2] - normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ] - normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ] - #n0 #_ #Hn0 % @le_S_S_to_le // -| #x0 %2 -| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 // -| #x0 #s #v #Hv #IH normalize @daemon -] -qed. -*) - -definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) (vopen_tm_down …). @ctx_of_CTX qed. - -axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u). - -definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) (vclose_tm_up …). @tm_of_TM qed. - -interpretation "ln wf term variable open" 'open u x = (vopen_TM u x). -interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x). - -theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉). -#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta // -qed. - -theorem TM_ind_plus : -(* non si può dare il principio in modo dipendente (almeno utilizzando tm2) - la "prova" purtroppo è in Type e non si può garantire che sia esattamente - quella che ci aspetteremmo - *) - ∀P:pretm → Type[0]. - (∀x:𝔸.P (PAR x)) → - (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) → - ∀C:list 𝔸. - (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C → - (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) → - ∀u:TM.P u. -#P #Hpar #Happ #C #Hlam * #u #pu elim (tm_to_tm2 u pu) // -[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …)) /2/ -| #x #s #v #Hx #pv #IH - lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0 - >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉)) - [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ] - @(Hlam x0 s (mk_CTX v ?) ??) - [ <(nominal_eta … Hx) @vclose_tm_up @tm2_to_tm @pv // - | @(not_to_not … Hx0) @in_list_to_in_list_append_r - | @(not_to_not … Hx0) @in_list_to_in_list_append_l - | @IH ] -] -qed. - -notation -"hvbox('nominal' u 'return' out 'with' - [ 'xpar' ident x ⇒ f1 - | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2 - | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])" -with precedence 48 -for @{ TM_ind_plus $out (λ${ident x}:?.$f1) - (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2) - $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3) - $u }. - -(* include "basics/jmeq.ma".*) - -definition subst ≝ (λu:TM.λx,v. - nominal u return (λ_.TM) with - [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ] - | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2 - | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]). - -lemma fasfd : ∀s,v. pretm_of_TM (subst (LAM O s (PAR 1)) O v) = pretm_of_TM (LAM O s (PAR 1)). -#s #v normalize in ⊢ (??%?); - - -theorem tm2_ind_plus : -(* non si può dare il principio in modo dipendente (almeno utilizzando tm2) *) - ∀P:pretm → Type[0]. - (∀x:𝔸.P (par x)) → - (∀v1,v2.tm2 v1 → tm2 v2 → P v1 → P v2 → P (app v1 v2)) → - ∀C:list 𝔸. - (∀x,s,v.x ∉ FV v → x ∉ C → (∀y.y ∉ FV v → tm2 (v⌈y⌉)) → - (∀y.y ∉ FV v → P (v⌈y⌉)) → P (lam x s (v⌈x⌉))) → - ∀u.tm2 u → P u. -#P #Hpar #Happ #C #Hlam #u #pu elim pu /2/ -#x #s #v #px #pv #IH -lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy ->(?:lam x s (v⌈x⌉) = lam y s (v⌈y⌉)) [| @tm_alpha // @(not_to_not … Hy) @in_list_to_in_list_append_r ] -@Hlam /2/ lapply Hy -Hy @not_to_not #Hy -[ @in_list_to_in_list_append_r @Hy | @in_list_to_in_list_append_l @Hy ] -qed. - -definition check_tm ≝ - λu.pretm_ind_plus ? (λ_.true) (λ_.false) - (λv1,v2,r1,r2.r1 ∧ r2) [ ] (λx,s,v,pv1,pv2,rv.rv) u. - -(* -lemma check_tm_complete : ∀u.tm u → check_tm u = true. -#u #pu @(tm2_ind_plus … [ ] … (tm_to_tm2 ? pu)) // -[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 -| #x #s #v #Hx1 #Hx2 #Hv #IH -*) - -notation -"hvbox('nominal' u 'return' out 'with' - [ 'xpar' ident x ⇒ f1 - | 'xapp' ident v1 ident v2 ident pv1 ident pv2 ident recv1 ident recv2 ⇒ f2 - | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident pw ident recw ⇒ f3 ])" -with precedence 48 -for @{ tm2_ind_plus $out (λ${ident x}:?.$f1) - (λ${ident v1}:?.λ${ident v2}:?.λ${ident pv1}:?.λ${ident pv2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2) - $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident pw}:?.λ${ident recw}:?.$f3) - ? (tm_to_tm2 ? $u) }. -(* notation -"hvbox('nominal' u 'with' - [ 'xlam' ident x # C ident s ident w ⇒ f3 ])" -with precedence 48 -for @{ tm2_ind_plus ??? - $C (λ${ident x}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?. - λ${ident pw}:?.λ${ident recw}:?.$f3) $u (tm_to_tm2 ??) }. -*) - - -definition subst ≝ (λu.λpu:tm u.λx,v. - nominal pu return (λ_.pretm) with - [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ] - | xapp v1 v2 pv1 pv2 recv1 recv2 ⇒ app recv1 recv2 - | xlam ❨y # x::FV v❩ s w py1 py2 pw recw ⇒ lam y s (recw y py1) ]). - -lemma fasfd : ∀x,s,u,p1,v. subst (lam x s u) p1 x v = lam x s u. -#x #s #u #p1 #v - - -definition subst ≝ λu.λpu:tm u.λx,y. - tm2_ind_plus ? - (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ]) - (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2) - (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1)) - u (tm_to_tm2 … pu). -check subst -definition subst ≝ λu.λpu:tm u.λx,v. - nominal u with - [ xlam y # (x::FV v) s w ^ ? ]. - -(* -notation > "Λ ident x. ident T [ident x] ↦ P" - with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}. - -notation < "Λ ident x. ident T [ident x] ↦ P" - with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}. -*) - -(* -notation -"hvbox('nominal' u 'with' - [ 'xpar' ident x ⇒ f1 - | 'xapp' ident v1 ident v2 ⇒ f2 - | 'xlam' ident x # C s w ⇒ f3 ])" -with precedence 48 -for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) - (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) - $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. -*) - -(* -notation -"hvbox('nominal' u 'with' - [ 'xpar' ident x ^ f1 - | 'xapp' ident v1 ident v2 ^ f2 ])" -(* | 'xlam' ident x # C s w ^ f3 ]) *) -with precedence 48 -for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1) - (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) - $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. -*) -notation -"hvbox('nominal' u 'with' - [ 'xpar' ident x ^ f1 - | 'xapp' ident v1 ident v2 ^ f2 ])" -with precedence 48 -for @{ tm2_ind_plus ? (λ${ident x}:?.$f1) - (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2) - $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }. - - -definition subst ≝ λu.λpu:tm u.λx,v. - nominal u with - [ xpar x0 ^ match x == x0 with [ true ⇒ v | false ⇒ u ] - | xapp v1 v2 ^ ? ]. - | xlam y # (x::FV v) s w ^ ? ]. - - - (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ]) - (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2) - (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1)) - u (tm_to_tm2 … pu). - - -*) -definition subst ≝ λu.λpu:tm u.λx,v. - tm2_ind_plus ? - (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ]) - (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2) - (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1)) - u (tm_to_tm2 … pu). - -check subst - - -axiom in_Env : 𝔸 × tp → Env → Prop. -notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. -interpretation "Env membership" 'lefttriangle x l = (in_Env x l). - - - -inductive judg : list tp → tm → tp → Prop ≝ -| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t -| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u -| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u). - -definition Env := list (𝔸 × tp). - -axiom vclose_env : Env → list tp. -axiom vclose_tm : Env → tm → tm. -axiom Lam : 𝔸 → tp → tm → tm. -definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T. -definition dom ≝ λG:Env.map ?? (fst ??) G. - -definition sctx ≝ 𝔸 × tm. -axiom swap_tm : 𝔸 → 𝔸 → tm → tm. -definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M. - -axiom in_list : ∀A:Type[0].A → list A → Prop. -interpretation "list membership" 'mem x l = (in_list ? x l). -interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)). - -axiom in_Env : 𝔸 × tp → Env → Prop. -notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}. -interpretation "Env membership" 'lefttriangle x l = (in_Env x l). - -let rec FV M ≝ match M with - [ par X ⇒ [X] - | app M1 M2 ⇒ FV M1@FV M2 - | abs T M0 ⇒ FV M0 - | _ ⇒ [ ] ]. - -(* axiom Lookup : 𝔸 → Env → option tp. *) - -(* forma alto livello del judgment - t_abs* : ∀G,T,X,M,U. - (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) → - Judg G (Lam X T (M[X])) (arr T U) *) - -(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *) - -axiom Judg_ind : ∀P:Env → tm → tp → Prop. - (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) → - (∀G,M,N,T,U. - Judg G M (arr T U) → Judg G N T → - P G M (arr T U) → P G N T → P G (app M N) U) → - (∀G,T1,T2,X,M1. - (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) → - (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) → - P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) → - ∀G,M,T.Judg G M T → P G M T. - -axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T. -axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U. -axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U). - -definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2. -interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2). - -axiom daemon : ∀P:Prop.P. - -theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T. -#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?) -@(Judg_ind … HJ) -[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub // -| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2 - [| @IH1 // | @IH2 // ] -| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH - [ (* trivial property of Lam *) @daemon - | (* trivial property of subenv *) @daemon ] -] -qed. - -(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e - ricorsione *) \ No newline at end of file diff --git a/matita/matita/lib/binding/names.ma b/matita/matita/lib/binding/names.ma deleted file mode 100644 index bc5f07d43..000000000 --- a/matita/matita/lib/binding/names.ma +++ /dev/null @@ -1,78 +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 "basics/logic.ma". -include "basics/lists/in.ma". -include "basics/types.ma". - -(*interpretation "list membership" 'mem x l = (in_list ? x l).*) - -record Nset : Type[1] ≝ -{ - (* carrier is specified as a coercion: when an object X of type Nset is - given, but something of type Type is expected, Matita will insert a - hidden coercion: the user sees "X", but really means "carrier X" *) - carrier :> DeqSet; - N_fresh : list carrier → carrier; - p_fresh : ∀l.N_fresh l ∉ l -}. - -definition maxlist ≝ - λl.foldr ?? (λx,acc.max x acc) 0 l. - -definition natfresh ≝ λl.S (maxlist l). - -lemma le_max_1 : ∀x,y.x ≤ max x y. /2/ -qed. - -lemma le_max_2 : ∀x,y.y ≤ max x y. /2/ -qed. - -lemma le_maxlist : ∀l,x.x ∈ l → x ≤ maxlist l. -#l elim l -[#x #Hx @False_ind cases (not_in_list_nil ? x) #H1 /2/ -|#y #tl #IH #x #H1 change with (max ??) in ⊢ (??%); - cases (in_list_cons_case ???? H1);#H2; - [ >H2 @le_max_1 - | whd in ⊢ (??%); lapply (refl ? (leb y (maxlist tl))); - cases (leb y (maxlist tl)) in ⊢ (???% → %);#H3 - [ @IH // - | lapply (IH ? H2) #H4 - lapply (leb_false_to_not_le … H3) #H5 - lapply (not_le_to_lt … H5) #H6 - @(transitive_le … H4) - @(transitive_le … H6) %2 % - ] - ] -] -qed. - -(* prove freshness for nat *) -lemma lt_l_natfresh_l : ∀l,x.x ∈ l → x < natfresh l. -#l #x #H1 @le_S_S /2/ -qed. - -(*naxiom p_Xfresh : ∀l.∀x:Xcarr.x ∈ l → x ≠ ntm (Xfresh l) ∧ x ≠ ntp (Xfresh l).*) -lemma p_natfresh : ∀l.natfresh l ∉ l. -#l % #H1 lapply (lt_l_natfresh_l … H1) #H2 -cases (lt_to_not_eq … H2) #H3 @H3 % -qed. - -include "basics/finset.ma". - -definition X : Nset ≝ mk_Nset DeqNat …. -[ @natfresh -| @p_natfresh -] -qed. \ No newline at end of file diff --git a/matita/matita/lib/fail.txt b/matita/matita/lib/fail.txt index 6da43596d..018bed897 100644 --- a/matita/matita/lib/fail.txt +++ b/matita/matita/lib/fail.txt @@ -1,7 +1,10 @@ +FAILING FILES 2018-12-17 + matitac.opt binding/fp.ma matitac.opt binding/ln_concrete.ma matitac.opt binding/ln.ma matitac.opt binding/names.ma +matitac.opt extraction.ma matitac.opt finite_lambda/confluence.ma matitac.opt finite_lambda/reduction.ma matitac.opt finite_lambda/terms_and_types.ma diff --git a/matita/matita/lib/pts_dummy/rc_eval.ma b/matita/matita/lib/pts_dummy/rc_eval.ma index 87cfd11dc..439160a7d 100644 --- a/matita/matita/lib/pts_dummy/rc_eval.ma +++ b/matita/matita/lib/pts_dummy/rc_eval.ma @@ -13,6 +13,7 @@ (**************************************************************************) include "pts_dummy/rc_hsat.ma". +include "basics/core_notation/napart_2.ma". (* (* THE EVALUATION *************************************************************) diff --git a/matita/matita/lib/pts_dummy_new/rc_eval.ma b/matita/matita/lib/pts_dummy_new/rc_eval.ma index 7b7ce54d9..c11eca57a 100644 --- a/matita/matita/lib/pts_dummy_new/rc_eval.ma +++ b/matita/matita/lib/pts_dummy_new/rc_eval.ma @@ -13,6 +13,7 @@ (**************************************************************************) include "pts_dummy/rc_hsat.ma". +include "basics/core_notation/napart_2.ma". (* (* THE EVALUATION *************************************************************) diff --git a/matita/matita/lib/reverse_complexity/almost.ma b/matita/matita/lib/reverse_complexity/almost.ma new file mode 100644 index 000000000..75578d0f9 --- /dev/null +++ b/matita/matita/lib/reverse_complexity/almost.ma @@ -0,0 +1,24 @@ +include "reverse_complexity/speedup.ma". + +definition aes : (nat → nat) → (nat → nat) → Prop ≝ λf,g. + ∃n.∀m. n ≤ m → f m = g m. + +lemma CF_almost: ∀f,g,s. CF s g → aes g f → CF s f. +#f #g #s #CFg * #n lapply CFg -CFg lapply g -g +elim n + [#g #CFg #H @(ext_CF … g) [#m @H // |//] + |#i #Hind #g #CFg #H + @(Hind (λx. if eqb i x then f i else g x)) + [@CF_if + [@(O_to_CF … MSC) [@le_to_O @(MSC_in … CFg)] @CF_eqb // + |@(O_to_CF … MSC) [@le_to_O @(MSC_in … CFg)] @CF_const + |@CFg + ] + |#m #leim cases (le_to_or_lt_eq … leim) + [#ltim lapply (lt_to_not_eq … ltim) #noteqim + >(not_eq_to_eqb_false … noteqim) @H @ltim + |#eqim >eqim >eqb_n_n // + ] + ] + ] +qed. \ No newline at end of file diff --git a/matita/matita/lib/reverse_complexity/basics.ma b/matita/matita/lib/reverse_complexity/basics.ma new file mode 100644 index 000000000..de383d1d0 --- /dev/null +++ b/matita/matita/lib/reverse_complexity/basics.ma @@ -0,0 +1,106 @@ +include "basics/types.ma". +include "arithmetics/nat.ma". + +(********************************** pairing ***********************************) +axiom pair: nat → nat → nat. +axiom fst : nat → nat. +axiom snd : nat → nat. + +interpretation "abstract pair" 'pair f g = (pair f g). + +axiom fst_pair: ∀a,b. fst 〈a,b〉 = a. +axiom snd_pair: ∀a,b. snd 〈a,b〉 = b. +axiom surj_pair: ∀x. ∃a,b. x = 〈a,b〉. + +axiom le_fst : ∀p. fst p ≤ p. +axiom le_snd : ∀p. snd p ≤ p. +axiom le_pair: ∀a,a1,b,b1. a ≤ a1 → b ≤ b1 → 〈a,b〉 ≤ 〈a1,b1〉. + +lemma expand_pair: ∀x. x = 〈fst x, snd x〉. +#x lapply (surj_pair x) * #a * #b #Hx >Hx >fst_pair >snd_pair // +qed. + +(************************************* U **************************************) +axiom U: nat → nat →nat → option nat. + +axiom monotonic_U: ∀i,x,n,m,y.n ≤m → + U i x n = Some ? y → U i x m = Some ? y. + +lemma unique_U: ∀i,x,n,m,yn,ym. + U i x n = Some ? yn → U i x m = Some ? ym → yn = ym. +#i #x #n #m #yn #ym #Hn #Hm cases (decidable_le n m) + [#lenm lapply (monotonic_U … lenm Hn) >Hm #HS destruct (HS) // + |#ltmn lapply (monotonic_U … n … Hm) [@lt_to_le @not_le_to_lt //] + >Hn #HS destruct (HS) // + ] +qed. + +definition code_for ≝ λf,i.∀x. + ∃n.∀m. n ≤ m → U i x m = f x. + +definition terminate ≝ λi,x,r. ∃y. U i x r = Some ? y. + +notation "{i ⊙ x} ↓ r" with precedence 60 for @{terminate $i $x $r}. + +lemma terminate_dec: ∀i,x,n. {i ⊙ x} ↓ n ∨ ¬ {i ⊙ x} ↓ n. +#i #x #n normalize cases (U i x n) + [%2 % * #y #H destruct|#y %1 %{y} //] +qed. + +lemma monotonic_terminate: ∀i,x,n,m. + n ≤ m → {i ⊙ x} ↓ n → {i ⊙ x} ↓ m. +#i #x #n #m #lenm * #z #H %{z} @(monotonic_U … H) // +qed. + +definition termb ≝ λi,x,t. + match U i x t with [None ⇒ false |Some y ⇒ true]. + +lemma termb_true_to_term: ∀i,x,t. termb i x t = true → {i ⊙ x} ↓ t. +#i #x #t normalize cases (U i x t) normalize [#H destruct | #y #_ %{y} //] +qed. + +lemma term_to_termb_true: ∀i,x,t. {i ⊙ x} ↓ t → termb i x t = true. +#i #x #t * #y #H normalize >H // +qed. + +definition out ≝ λi,x,r. + match U i x r with [ None ⇒ 0 | Some z ⇒ z]. + +definition bool_to_nat: bool → nat ≝ + λb. match b with [true ⇒ 1 | false ⇒ 0]. + +coercion bool_to_nat. + +definition pU : nat → nat → nat → nat ≝ λi,x,r.〈termb i x r,out i x r〉. + +lemma pU_vs_U_Some : ∀i,x,r,y. pU i x r = 〈1,y〉 ↔ U i x r = Some ? y. +#i #x #r #y % normalize + [cases (U i x r) normalize + [#H cut (0=1) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H @H] + #H1 destruct + |#a #H cut (a=y) [lapply (eq_f … snd … H) >snd_pair >snd_pair #H1 @H1] + #H1 // + ] + |#H >H //] +qed. + +lemma pU_vs_U_None : ∀i,x,r. pU i x r = 〈0,0〉 ↔ U i x r = None ?. +#i #x #r % normalize + [cases (U i x r) normalize // + #a #H cut (1=0) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H1 @H1] + #H1 destruct + |#H >H //] +qed. + +lemma fst_pU: ∀i,x,r. fst (pU i x r) = termb i x r. +#i #x #r normalize cases (U i x r) normalize >fst_pair // +qed. + +lemma snd_pU: ∀i,x,r. snd (pU i x r) = out i x r. +#i #x #r normalize cases (U i x r) normalize >snd_pair // +qed. + + +definition total ≝ λf.λx:nat. Some nat (f x). + + diff --git a/matita/matita/lib/reverse_complexity/bigops_compl.ma b/matita/matita/lib/reverse_complexity/bigops_compl.ma new file mode 100644 index 000000000..032174a0c --- /dev/null +++ b/matita/matita/lib/reverse_complexity/bigops_compl.ma @@ -0,0 +1,607 @@ +include "reverse_complexity/complexity.ma". +include "reverse_complexity/sigma_diseq.ma". + +include alias "reverse_complexity/basics.ma". + +lemma bigop_prim_rec: ∀a,b,c,p,f,x. + bigop (b x-a x) (λi:ℕ.p 〈i+a x,x〉) ? (c 〈a x,x〉) plus (λi:ℕ.f 〈i+a x,x〉) = + prim_rec c + (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + then plus (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (b x-a x) 〈a x ,x〉. +#a #b #c #p #f #x normalize elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma bigop_prim_rec_dec: ∀a,b,c,p,f,x. + bigop (b x-a x) (λi:ℕ.p 〈b x -i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x-i,x〉) = + prim_rec c + (λi.if p 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉 + then plus (f 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (b x-a x) 〈b x ,x〉. +#a #b #c #p #f #x normalize elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma bigop_prim_rec_dec1: ∀a,b,c,p,f,x. + bigop (S(b x)-a x) (λi:ℕ.p 〈b x - i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x- i,x〉) = + prim_rec c + (λi.if p 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉 + then plus (f 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (S(b x)-a x) 〈b x,x〉. +#a #b #c #p #f #x elim (S(b x)-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma sum_prim_rec1: ∀a,b,p,f,x. + ∑_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + then f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + fst (snd i) + else fst (snd i)) (b x-a x) 〈a x ,x〉. +#a #b #p #f #x elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma bigop_plus_c: ∀k,p,f,c. + c k + bigop k (λi.p i) ? 0 plus (λi.f i) = + bigop k (λi.p i) ? (c k) plus (λi.f i). +#k #p #f elim k [normalize //] +#i #Hind #c cases (true_or_false (p i)) #Hcase +[>bigop_Strue // >bigop_Strue // (commutative_plus ? (f i)) + >associative_plus @eq_f @Hind +|>bigop_Sfalse // >bigop_Sfalse // +] +qed. + + +(*********************************** maximum **********************************) + +lemma max_gen: ∀a,b,p,f,x. a ≤b → + max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) = max_{i < b | leb a i ∧ p 〈i,x〉 }(f 〈i,x〉). +#a #b #p #f #x @(bigop_I_gen ????? MaxA) +qed. + +lemma max_prim_rec_base: ∀a,b,p,f,x. a ≤b → + max_{i < b| p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x. +#a #b #p #f #x #leab >max_gen // elim b + [normalize // + |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma max_prim_rec: ∀a,b,p,f,x. a ≤b → + max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if leb a (fst i) ∧ p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x. +#a #b #p #f #x #leab >max_gen // elim b + [normalize // + |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair + cases (true_or_false (leb a i ∧ p 〈i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma max_prim_rec1: ∀a,b,p,f,x. + max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + then max (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (b x-a x) 〈a x ,x〉. +#a #b #p #f #x elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +(* the argument is 〈b-a,〈a,x〉〉 *) + +definition max_unary_pr ≝ λp,f.unary_pr (λx.0) + (λi. + let k ≝ fst i in + let r ≝ fst (snd i) in + let a ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + if p 〈k + a,x〉 then max (f 〈k+a,x〉) r else r). + +lemma max_unary_pr1: ∀a,b,p,f,x. + max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) = + ((max_unary_pr p f) ∘ (λx.〈b x - a x,〈a x,x〉〉)) x. +#a #b #p #f #x normalize >fst_pair >snd_pair @max_prim_rec1 +qed. + +definition aux_compl ≝ λhp,hf.λi. + let k ≝ fst i in  + let r ≝ fst (snd i) in  + let a ≝ fst (snd (snd i)) in  + let x ≝ snd (snd (snd i)) in  + hp 〈k+a,x〉 + hf 〈k+a,x〉 + (* was MSC r*) MSC i . + +definition aux_compl1 ≝ λhp,hf.λi. + let k ≝ fst i in  + let r ≝ fst (snd i) in  + let a ≝ fst (snd (snd i)) in  + let x ≝ snd (snd (snd i)) in  + hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r. + +lemma aux_compl1_def: ∀k,r,m,hp,hf. + aux_compl1 hp hf 〈k,〈r,m〉〉 = + let a ≝ fst m in  + let x ≝ snd m in  + hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r. +#k #r #m #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair // +qed. + +lemma aux_compl1_def1: ∀k,r,a,x,hp,hf. + aux_compl1 hp hf 〈k,〈r,〈a,x〉〉〉 = hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r. +#k #r #a #x #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair +>fst_pair >snd_pair // +qed. + +axiom Oaux_compl: ∀hp,hf. O (aux_compl1 hp hf) (aux_compl hp hf). + +lemma MSC_max: ∀f,h,x. CF h f → MSC (max_{i < x}(f i)) ≤ max_{i < x}(h i). +#f #h #x #hf elim x // #i #Hind >bigop_Strue [|//] >bigop_Strue [|//] +whd in match (max ??); +cases (true_or_false (leb (f i) (bigop i (λi0:ℕ.true) ? 0 max(λi0:ℕ.f i0)))) +#Hcase >Hcase + [@(transitive_le … Hind) @le_maxr // + |@(transitive_le … (MSC_out … hf i)) @le_maxl // + ] +qed. + +lemma CF_max: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s. + CF ha a → CF hb b → CF hp p → CF hf f → + O s (λx.ha x + hb x + + (∑_{i ∈[a x ,b x[ } + (hp 〈i,x〉 + hf 〈i,x〉 + max_{i ∈ [a x, b x [ }(hf 〈i,x〉)))) → + CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)). +#a #b #p #f #ha #hb #hp #hf #s #CFa #CFb #CFp #CFf #HO +@ext_CF1 [|#x @max_unary_pr1] +@(CF_comp ??? (λx.ha x + hb x)) + [|@CF_comp_pair + [@CF_minus [@(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //] + |@CF_comp_pair + [@(O_to_CF … CFa) @O_plus_l // + | @(O_to_CF … CF_id) @O_plus_r @le_to_O @(MSC_in … CFb) + ] + ] + |@(CF_prim_rec … MSC … (aux_compl1 hp hf)) + [@CF_const + |@(O_to_CF … (Oaux_compl … )) + @CF_if + [@(CF_comp p … MSC … CFp) + [@CF_comp_pair + [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd] + |@CF_comp_snd @CF_comp_snd @CF_snd] + |@le_to_O #x normalize >commutative_plus >associative_plus @le_plus // + ] + |@CF_max1 + [@(CF_comp f … MSC … CFf) + [@CF_comp_pair + [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd] + |@CF_comp_snd @CF_comp_snd @CF_snd] + |@le_to_O #x normalize >commutative_plus // + ] + |@CF_comp_fst @(monotonic_CF … CF_snd) normalize // + ] + |@CF_comp_fst @(monotonic_CF … CF_snd) normalize // + ] + |@O_refl + ] + |@(O_trans … HO) -HO + @(O_trans ? (λx:ℕ + .ha x+hb x + +bigop (b x-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus + (λi:ℕ + .(λi0:ℕ + .hp 〈i0,x〉+hf 〈i0,x〉 + +bigop (b x-a x) (λi1:ℕ.true) ? 0 max + (λi1:ℕ.(λi2:ℕ.hf 〈i2,x〉) (i1+a x))) (i+a x)))) + [ + @le_to_O #n @le_plus // whd in match (unary_pr ???); + >fst_pair >snd_pair >bigop_prim_rec elim (b n - a n) + [normalize // + |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >aux_compl1_def1 + >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair + >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus + [-Hind @le_plus // normalize >fst_pair >snd_pair + @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 ) + (λi1:ℕ.hf 〈i1+a n,n〉))) + [elim x [normalize @MSC_le] + #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair + >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize + [cases (true_or_false (leb (f 〈x0+a n,n〉) + (prim_rec (λx00:ℕ.O) + (λi:ℕ + .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉  + then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉) + (fst (snd i))  + then fst (snd i)  + else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉   + else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize + [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + |@(transitive_le … (MSC_out … CFf …)) @(le_maxl … (le_n …)) + ] + |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + ] + |@(le_maxr … (le_n …)) + ] + |@(transitive_le … Hind) -Hind + generalize in match (bigop x (λi:ℕ.true) ? 0 max + (λi1:ℕ.(λi2:ℕ.hf 〈i2,n〉) (i1+a n))); #c + generalize in match (hf 〈x+a n,n〉); #c1 + elim x [//] #x0 #Hind + >prim_rec_S >prim_rec_S normalize >fst_pair >fst_pair >snd_pair + >snd_pair >snd_pair >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair + >fst_pair @le_plus + [@le_plus // cases (true_or_false (leb c1 c)) #Hcase + >Hcase normalize // @lt_to_le @not_le_to_lt @(leb_false_to_not_le ?? Hcase) + |@Hind + ] + ] + ] + |@O_plus [@O_plus_l //] @le_to_O #x + Hind +cases (true_or_false (eqb a (a+i))) #Hcase >Hcase normalize // +<(eqb_true_to_eq … Hcase) >H // +qed. + +lemma my_minim_nfa : ∀a,f,x,k. f〈a,x〉 = false → +my_minim a f x (S k) = my_minim (S a) f x k. +#a #f #x #k #H elim k + [normalize H >eq_to_eqb_true // + |#i #Hind >my_minim_S >Hind >my_minim_S Hcase + [>(my_minim_fa … Hcase) // | >Hind @sym_eq @(my_minim_nfa … Hcase) ] +qed. + +(* cambiare qui: togliere S *) + + +definition minim_unary_pr ≝ λf.unary_pr (λx.S(fst x)) + (λi. + let k ≝ fst i in + let r ≝ fst (snd i) in + let b ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + if f 〈b-k,x〉 then b-k else r). + +definition compl_minim_unary ≝ λhf:nat → nat.λi. + let k ≝ fst i in + let b ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉. + +definition compl_minim_unary_aux ≝ λhf,i. + let k ≝ fst i in + let r ≝ fst (snd i) in + let b ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + hf 〈b-k,x〉 + MSC i. + +lemma compl_minim_unary_aux_def : ∀hf,k,r,b,x. + compl_minim_unary_aux hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈r,〈b,x〉〉〉. +#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair // +qed. + +lemma compl_minim_unary_def : ∀hf,k,r,b,x. + compl_minim_unary hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉. +#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair // +qed. + +lemma compl_minim_unary_aux_def2 : ∀hf,k,r,x. + compl_minim_unary_aux hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈r,x〉〉. +#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair // +qed. + +lemma compl_minim_unary_def2 : ∀hf,k,r,x. + compl_minim_unary hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈S(fst x),snd x〉〉. +#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair // +qed. + +lemma min_aux: ∀a,f,x,k. min (S k) (a x) (λi:ℕ.f 〈i,x〉) = + ((minim_unary_pr f) ∘ (λx.〈S k,〈a x + k,x〉〉)) x. +#a #f #x #k whd in ⊢ (???%); >fst_pair >snd_pair +lapply a -a (* @max_prim_rec1 *) +elim k + [normalize #a >fst_pair >snd_pair >fst_pair >snd_pair >snd_pair >fst_pair + fst_pair // + |#i #Hind #a normalize in ⊢ (??%?); >prim_rec_S >fst_pair >snd_pair + >fst_pair >snd_pair >snd_pair >fst_pair minus_S_S <(minus_plus_m_m (a x) i) // +qed. + +lemma minim_unary_pr1: ∀a,b,f,x. + μ_{i ∈[a x,b x]}(f 〈i,x〉) = + if leb (a x) (b x) then ((minim_unary_pr f) ∘ (λx.〈S (b x) - a x,〈b x,x〉〉)) x + else (a x). +#a #b #f #x cases (true_or_false (leb (a x) (b x))) #Hcase >Hcase + [cut (b x = a x + (b x - a x)) + [>commutative_plus minus_Sn_m [|@leb_true_to_le //] + >min_aux whd in ⊢ (??%?); eq_minus_O // @not_le_to_lt @leb_false_to_not_le // + ] +qed. + +axiom sum_inv: ∀a,b,f.∑_{i ∈ [a,S b[ }(f i) = ∑_{i ∈ [a,S b[ }(f (a + b - i)). + +(* +#a #b #f @(bigop_iso … plusAC) whd %{(λi.b - a - i)} %{(λi.b - a -i)} % + [%[#i #lti #_ normalize @eq_f >commutative_plus commutative_plus // + ] + |@(O_to_CF … MSC) + [@le_to_O #x normalize // + |@CF_minus + [@CF_comp_fst @CF_comp_snd @CF_snd |@CF_fst] + ] + |@CF_comp_fst @(monotonic_CF … CF_snd) normalize // + ] + |@O_plus + [@O_plus_l @O_refl + |@O_plus_r @O_ext2 [||#x >compl_minim_unary_aux_def2 @refl] + @O_trans [||@le_to_O #x >compl_minim_unary_def2 @le_n] + @O_plus [@O_plus_l //] + @O_plus_r + @O_trans [|@le_to_O #x @MSC_pair] @O_plus + [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_fst …)) + >fst_pair @le_n] + @O_trans [|@le_to_O #x @MSC_pair] @O_plus + [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …)) + >snd_pair @(transitive_le ???? (le_fst …)) >fst_pair + normalize >snd_pair >fst_pair lapply (surj_pair x) + * #x1 * #x2 #Hx >Hx >fst_pair >snd_pair elim x1 // + #i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair + cases (f ?) [@le_S // | //]] + @le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …)) >snd_pair + >(expand_pair (snd (snd x))) in ⊢ (?%?); @le_pair // + ] + ] + |cut (O s (λx.ha x + hb x + + ∑_{i ∈[a x ,S(b x)[ }(hf 〈a x+b x-i,x〉 + MSC 〈b x -(a x+b x-i),〈S(b x),x〉〉))) + [@(O_ext2 … HO) #x @eq_f @sum_inv] -HO #HO + @(O_trans … HO) -HO + @(O_trans ? (λx:ℕ.ha x+hb x + +bigop (S(b x)-a x) (λi:ℕ.true) ? + (MSC 〈b x,x〉) plus (λi:ℕ.(λj.hf j + MSC 〈b x - fst j,〈S(b (snd j)),snd j〉〉) 〈b x- i,x〉))) + [@le_to_O #n @le_plus // whd in match (unary_pr ???); + >fst_pair >snd_pair >(bigop_prim_rec_dec1 a b ? (λi.true)) + (* it is crucial to recall that the index is bound by S(b x) *) + cut (S (b n) - a n ≤ S (b n)) [//] + elim (S(b n) - a n) + [normalize // + |#x #Hind #lex >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair + >compl_minim_unary_def >prim_rec_S >fst_pair >snd_pair >fst_pair + >snd_pair >fst_pair >snd_pair >fst_pair whd in ⊢ (??%); >commutative_plus + @le_plus [2:@Hind @le_S @le_S_S_to_le @lex] -Hind >snd_pair + >minus_minus_associative // @le_S_S_to_le // + ] + |@O_plus [@O_plus_l //] @O_ext2 [||#x @bigop_plus_c] + @O_plus + [@O_plus_l @O_trans [|@le_to_O #x @MSC_pair] + @O_plus + [@O_plus_r @le_to_O @(MSC_out … CFb) + |@O_plus_r @le_to_O @(MSC_in … CFb) + ] + |@O_plus_r @(O_ext2 … (O_refl …)) #x @same_bigop + [//|#i #H #_ @eq_f2 [@eq_f @eq_f2 //|>fst_pair @eq_f @eq_f2 //] + ] + ] + ] + ] + |@(O_to_CF … CFa) @(O_trans … HO) @O_plus_l @O_plus_l @O_refl + ] + +qed. + +lemma CF_mu2: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s. + CF sa a → CF sb b → CF sf f → + O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉 + MSC〈S(b x),x〉)) → + CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)). +#a #b #f #sa #sb #sf #s #CFa #CFb #CFf #HO +@(O_to_CF … HO (CF_mu … CFa CFb CFf ?)) @O_plus [@O_plus_l @O_refl] +@O_plus_r @O_ext2 [|| #x @(bigop_op … plusAC)] +@O_plus [@le_to_O #x @le_sigma //] +@(O_trans ? (λx.∑_{i ∈[a x ,S(b x)[ }(MSC(b x -i)+MSC 〈S(b x),x〉))) + [@le_to_O #x @le_sigma //] +@O_ext2 [|| #x @(bigop_op … plusAC)] @O_plus + [@le_to_O #x @le_sigma // #i #lti #_ @(transitive_le … (MSC 〈S (b x),x〉)) // + @monotonic_MSC @(transitive_le … (S(b x))) // @le_S // + |@le_to_O #x @le_sigma // + ] +qed. + +(* uses MSC_S *) + +lemma CF_mu3: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s. (∀x.sf x > 0) → + CF sa a → CF sb b → CF sf f → + O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉 + MSC〈b x,x〉)) → + CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)). +#a #b #f #sa #sb #sf #s #sfpos #CFa #CFb #CFf #HO +@(O_to_CF … HO (CF_mu2 … CFa CFb CFf ?)) @O_plus [@O_plus_l @O_refl] +@O_plus_r @O_ext2 [|| #x @(bigop_op … plusAC)] +@O_plus [@le_to_O #x @le_sigma //] +@le_to_O #x @le_sigma // #x #lti #_ >MSC_pair_eq >MSC_pair_eq 0) → + CF sa a → CF sb b → CF sf f → + O s (λx.sa x + sb x + (S(b x) - a x)*Max_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉)) → + CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)). +#a #b #f #sa #sb #sf #s #sfpos #CFa #CFb #CFf #HO +@(O_to_CF … HO (CF_mu3 … sfpos CFa CFb CFf ?)) @O_plus [@O_plus_l @O_refl] +@O_ext2 [|| #x @(bigop_op … plusAC)] @O_plus_r @O_plus + [@le_to_O #x @sigma_to_Max + |lapply (MSC_in … CFf) #Hle + %{1} %{0} #n #_ @(transitive_le … (sigma_const …)) + >(commutative_times 1) (eq_minus_O … H) // + |lapply (le_S_S_to_le … (not_le_to_lt … H)) -H #H + @le_times // @(transitive_le … (Hle … )) + cut (b n = b n - a n + a n) [Hcut in ⊢ (?%?); @(le_Max (λi.sf 〈i+a n,n〉)) /2/ + ] + ] +qed. + +(* +axiom CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s. + CF sa a → CF sb b → CF sf f → + O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉)) → + CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)). *) + + + \ No newline at end of file diff --git a/matita/matita/lib/reverse_complexity/complexity.ma b/matita/matita/lib/reverse_complexity/complexity.ma new file mode 100644 index 000000000..ae7baceca --- /dev/null +++ b/matita/matita/lib/reverse_complexity/complexity.ma @@ -0,0 +1,290 @@ +include "reverse_complexity/basics.ma". +include "reverse_complexity/big_O.ma". + +(********************************* complexity *********************************) + +(* We assume operations have a minimal structural complexity MSC. +For instance, for time complexity, MSC is equal to the size of input. +For space complexity, MSC is typically 0, since we only measure the space +required in addition to dimension of the input. *) + +axiom MSC : nat → nat. +axiom MSC_sublinear : ∀n. MSC (S n) ≤ S (MSC n). +(* axiom MSC_S: O MSC (λx.MSC (S x)) . *) +axiom MSC_le: ∀n. MSC n ≤ n. + +axiom monotonic_MSC: monotonic ? le MSC. +axiom MSC_pair_eq: ∀a,b. MSC 〈a,b〉 = MSC a + MSC b. + + +lemma MSC_pair: ∀a,b. MSC 〈a,b〉 ≤ MSC a + MSC b. // qed. + +(* C s i means i is running in O(s) *) + +definition C ≝ λs,i.∃c.∃a.∀x.a ≤ x → ∃y. + U i x (c*(s x)) = Some ? y. + +(* C f s means f ∈ O(s) where MSC ∈O(s) *) +definition CF ≝ λs,f.∃i.code_for (total f) i ∧ C s i. + +axiom MSC_in: ∀f,h. CF h f → ∀x. MSC x ≤ h x. +axiom MSC_out: ∀f,h. CF h f → ∀x. MSC (f x) ≤ h x. + + +lemma ext_CF : ∀f,g,s. (∀n. f n = g n) → CF s f → CF s g. +#f #g #s #Hext * #i * #Hcode #HC %{i} % + [#x cases (Hcode x) #a #H %{a} whd in match (total ??); Hext @H | //] +qed. + +lemma monotonic_CF: ∀s1,s2,f.(∀x. s1 x ≤ s2 x) → CF s1 f → CF s2 f. +#s1 #s2 #f #H * #i * #Hcode #Hs1 +%{i} % [//] cases Hs1 #c * #a -Hs1 #Hs1 %{c} %{a} #n #lean +cases(Hs1 n lean) #y #Hy %{y} @(monotonic_U …Hy) @le_times // +qed. + +lemma O_to_CF: ∀s1,s2,f.O s2 s1 → CF s1 f → CF s2 f. +#s1 #s2 #f #H * #i * #Hcode #Hs1 +%{i} % [//] cases Hs1 #c * #a -Hs1 #Hs1 +cases H #c1 * #a1 #Ha1 %{(c*c1)} %{(a+a1)} #n #lean +cases(Hs1 n ?) [2:@(transitive_le … lean) //] #y #Hy %{y} @(monotonic_U …Hy) +>associative_times @le_times // @Ha1 @(transitive_le … lean) // +qed. + +lemma timesc_CF: ∀s,f,c.CF (λx.c*s x) f → CF s f. +#s #f #c @O_to_CF @O_times_c +qed. + +(********************************* composition ********************************) +axiom CF_comp: ∀f,g,sf,sg,sh. CF sg g → CF sf f → + O sh (λx. sg x + sf (g x)) → CF sh (f ∘ g). + +lemma CF_comp_ext: ∀f,g,h,sh,sf,sg. CF sg g → CF sf f → + (∀x.f(g x) = h x) → O sh (λx. sg x + sf (g x)) → CF sh h. +#f #g #h #sh #sf #sg #Hg #Hf #Heq #H @(ext_CF (f ∘ g)) + [#n normalize @Heq | @(CF_comp … H) //] +qed. + +(************************************* smn ************************************) +axiom smn: ∀f,s. CF s f → ∀x. CF (λy.s 〈x,y〉) (λy.f 〈x,y〉). + +(****************************** constructibility ******************************) + +definition constructible ≝ λs. CF s s. + +lemma constr_comp : ∀s1,s2. constructible s1 → constructible s2 → + (∀x. x ≤ s2 x) → constructible (s2 ∘ s1). +#s1 #s2 #Hs1 #Hs2 #Hle @(CF_comp … Hs1 Hs2) @O_plus @le_to_O #x [@Hle | //] +qed. + +lemma ext_constr: ∀s1,s2. (∀x.s1 x = s2 x) → + constructible s1 → constructible s2. +#s1 #s2 #Hext #Hs1 @(ext_CF … Hext) @(monotonic_CF … Hs1) #x >Hext // +qed. + + +(***************************** primitive recursion ****************************) + +(* no arguments *) + +let rec prim_rec0 (k:nat) (h:nat →nat) n on n ≝ + match n with + [ O ⇒ k + | S a ⇒ h 〈a, prim_rec0 k h a〉]. + +lemma prim_rec0_S: ∀k,h,n. + prim_rec0 k h (S n) = h 〈n, prim_rec0 k h n〉. +// qed. + +let rec prim_rec0_compl (k,sk:nat) (h,sh:nat →nat) n on n ≝ + match n with + [ O ⇒ sk + | S a ⇒ prim_rec0_compl k sk h sh a + sh (prim_rec0 k h a)]. + +axiom CF_prim_rec0_gen: ∀k,h,sk,sh,sh1,sf. CF sh h → + O sh1 (λx.snd x + sh 〈fst x,prim_rec0 k h (fst x)〉) → + O sf (prim_rec0 sk sh1) → + CF sf (prim_rec0 k h). + +lemma CF_prim_rec0: ∀k,h,sk,sh,sf. CF sh h → + O sf (prim_rec0 sk (λx. snd x + sh 〈fst x,prim_rec0 k h (fst x)〉)) + → CF sf (prim_rec0 k h). +#k #h #sk #sh #sf #Hh #HO @(CF_prim_rec0_gen … Hh … HO) @O_refl +qed. + +(* with arguments. m is a vector of arguments *) +let rec prim_rec (k,h:nat →nat) n m on n ≝ + match n with + [ O ⇒ k m + | S a ⇒ h 〈a,〈prim_rec k h a m, m〉〉]. + +lemma prim_rec_S: ∀k,h,n,m. + prim_rec k h (S n) m = h 〈n,〈prim_rec k h n m, m〉〉. +// qed. + +lemma prim_rec_le: ∀k1,k2,h1,h2. (∀x.k1 x ≤ k2 x) → +(∀x,y.x ≤y → h1 x ≤ h2 y) → + ∀x,m. prim_rec k1 h1 x m ≤ prim_rec k2 h2 x m. +#k1 #k2 #h1 #h2 #lek #leh #x #m elim x // +#n #Hind normalize @leh @le_pair // @le_pair // +qed. + +definition unary_pr ≝ λk,h,x. prim_rec k h (fst x) (snd x). + +lemma prim_rec_unary: ∀k,h,a,b. + prim_rec k h a b = unary_pr k h 〈a,b〉. +#k #h #a #b normalize >fst_pair >snd_pair // +qed. + +let rec prim_rec_compl (k,h,sk,sh:nat →nat) n m on n ≝ + match n with + [ O ⇒ sk m + | S a ⇒ prim_rec_compl k h sk sh a m + sh 〈a,〈prim_rec k h a m,m〉〉]. + +axiom CF_prim_rec_gen: ∀k,h,sk,sh,sh1. CF sk k → CF sh h → + O sh1 (λx. fst (snd x) + + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉) → + CF (unary_pr sk sh1) (unary_pr k h). + +lemma CF_prim_rec: ∀k,h,sk,sh,sf. CF sk k → CF sh h → + O sf (unary_pr sk + (λx. fst (snd x) + + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉)) + → CF sf (unary_pr k h). +#k #h #sk #sh #sf #Hk #Hh #Osf @(O_to_CF … Osf) @(CF_prim_rec_gen … Hk Hh) +@O_refl +qed. + +lemma constr_prim_rec: ∀s1,s2. constructible s1 → constructible s2 → + (∀n,r,m. 2 * r ≤ s2 〈n,〈r,m〉〉) → constructible (unary_pr s1 s2). +#s1 #s2 #Hs1 #Hs2 #Hincr @(CF_prim_rec … Hs1 Hs2) whd %{2} %{0} +#x #_ lapply (surj_pair x) * #a * #b #eqx >eqx whd in match (unary_pr ???); +>fst_pair >snd_pair +whd in match (unary_pr ???); >fst_pair >snd_pair elim a + [normalize // + |#n #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair + >prim_rec_S @transitive_le [| @(monotonic_le_plus_l … Hind)] + @transitive_le [| @(monotonic_le_plus_l … (Hincr n ? b))] + whd in match (unary_pr ???); >fst_pair >snd_pair // + ] +qed. + +(**************************** primitive operations*****************************) + +definition id ≝ λx:nat.x. + +axiom CF_id: CF MSC id. +axiom CF_const: ∀k.CF MSC (λx.k). +axiom CF_comp_fst: ∀h,f. CF h f → CF h (fst ∘ f). +axiom CF_comp_snd: ∀h,f. CF h f → CF h (snd ∘ f). +axiom CF_comp_pair: ∀h,f,g. CF h f → CF h g → CF h (λx. 〈f x,g x〉). + +lemma CF_fst: CF MSC fst. +@(ext_CF (fst ∘ id)) [#n //] @(CF_comp_fst … CF_id) +qed. + +lemma CF_snd: CF MSC snd. +@(ext_CF (snd ∘ id)) [#n //] @(CF_comp_snd … CF_id) +qed. + +(**************************** arithmetic operations ***************************) + +axiom CF_compS: ∀h,f. CF h f → CF h (S ∘ f). +axiom CF_le: ∀h,f,g. CF h f → CF h g → CF h (λx. leb (f x) (g x)). +axiom CF_eqb: ∀h,f,g. CF h f → CF h g → CF h (λx.eqb (f x) (g x)). +axiom CF_max1: ∀h,f,g. CF h f → CF h g → CF h (λx. max (f x) (g x)). +axiom CF_plus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x + g x). +axiom CF_minus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x - g x). + +(******************************** if then else ********************************) + +lemma if_prim_rec: ∀b:nat → bool. ∀f,g:nat → nat.∀x:nat. + if b x then f x else g x = prim_rec g (f ∘ snd ∘ snd) (b x) x. +#b #f #g #x cases (b x) normalize // +qed. + +lemma CF_if: ∀b:nat → bool. ∀f,g,s. CF s b → CF s f → CF s g → + CF s (λx. if b x then f x else g x). +#b #f #g #s #CFb #CFf #CFg @(ext_CF (λx.unary_pr g (f ∘ snd ∘ snd) 〈b x,x〉)) + [#n @sym_eq normalize >fst_pair >snd_pair @if_prim_rec + |@(CF_comp ??? s) + [|@CF_comp_pair // @(O_to_CF … CF_id) @le_to_O @MSC_in // + |@(CF_prim_rec_gen ??? (λx.MSC x + s(snd (snd x))) … CFg) [3:@O_refl|] + @(CF_comp … (λx.MSC x + s(snd x)) … CF_snd) + [@(CF_comp … s … CF_snd CFf) @O_refl + |@O_plus + [@O_plus_l @O_refl + |@O_plus + [@O_plus_l @le_to_O #x @monotonic_MSC // + |@O_plus_r @O_refl + ] + ] + ] + |%{6} %{0} #n #_ normalize in ⊢ (??%); snd_pair >fst_pair normalize + [@le_plus [//] >fst_pair >fst_pair >snd_pair >fst_pair + @le_plus [//] >snd_pair >snd_pair >snd_pair >snd_pair + associative_plus @le_plus + [@(transitive_le ???? (MSC_in … CFf n)) @monotonic_MSC // + |@(transitive_le … (MSC_pair …)) @le_plus [|@(MSC_in … CFf)] + normalize @MSC_out @CFg + ] + |@le_plus // + ] + ] + ] +qed. + +(********************************* simulation *********************************) + +definition pU_unary ≝ λp. pU (fst p) (fst (snd p)) (snd (snd p)). + +axiom sU : nat → nat. +axiom CF_U : CF sU pU_unary. + +axiom monotonic_sU: ∀i1,i2,x1,x2,s1,s2. i1 ≤ i2 → x1 ≤ x2 → s1 ≤ s2 → + sU 〈i1,〈x1,s1〉〉 ≤ sU 〈i2,〈x2,s2〉〉. + +lemma monotonic_sU_aux : ∀x1,x2. fst x1 ≤ fst x2 → fst (snd x1) ≤ fst (snd x2) → +snd (snd x1) ≤ snd (snd x2) → sU x1 ≤ sU x2. +#x1 #x2 cases (surj_pair x1) #a1 * #y #eqx1 >eqx1 -eqx1 cases (surj_pair y) +#b1 * #c1 #eqy >eqy -eqy +cases (surj_pair x2) #a2 * #y2 #eqx2 >eqx2 -eqx2 cases (surj_pair y2) +#b2 * #c2 #eqy2 >eqy2 -eqy2 >fst_pair >snd_pair >fst_pair >snd_pair +>fst_pair >snd_pair >fst_pair >snd_pair @monotonic_sU +qed. + +axiom sU_pos: ∀x. 0 < sU x. + +axiom sU_le: ∀i,x,s. s ≤ sU 〈i,〈x,s〉〉. + +lemma sU_le_i: ∀i,x,s. MSC i ≤ sU 〈i,〈x,s〉〉. +#i #x #s @(transitive_le ???? (MSC_in … CF_U 〈i,〈x,s〉〉)) @monotonic_MSC // +qed. + +lemma sU_le_x: ∀i,x,s. MSC x ≤ sU 〈i,〈x,s〉〉. +#i #x #s @(transitive_le ???? (MSC_in … CF_U 〈i,〈x,s〉〉)) @monotonic_MSC +@(transitive_le … 〈x,s〉) // +qed. + + + + +definition termb_unary ≝ λx:ℕ.termb (fst x) (fst (snd x)) (snd (snd x)). +definition out_unary ≝ λx:ℕ.out (fst x) (fst (snd x)) (snd (snd x)). + +lemma CF_termb: CF sU termb_unary. +@(ext_CF (fst ∘ pU_unary)) [2: @CF_comp_fst @CF_U] +#n whd in ⊢ (??%?); whd in ⊢ (??(?%)?); >fst_pair % +qed. + +lemma CF_out: CF sU out_unary. +@(ext_CF (snd ∘ pU_unary)) [2: @CF_comp_snd @CF_U] +#n whd in ⊢ (??%?); whd in ⊢ (??(?%)?); >snd_pair % +qed. + diff --git a/matita/matita/lib/reverse_complexity/hierarchy.ma b/matita/matita/lib/reverse_complexity/hierarchy.ma index a621b55a5..d833a5164 100644 --- a/matita/matita/lib/reverse_complexity/hierarchy.ma +++ b/matita/matita/lib/reverse_complexity/hierarchy.ma @@ -1,10 +1,9 @@ include "arithmetics/nat.ma". -include "arithmetics/log.ma". -(* include "arithmetics/ord.ma". *) +include "arithmetics/log.ma". include "arithmetics/bigops.ma". include "arithmetics/bounded_quantifiers.ma". -include "arithmetics/pidgeon_hole.ma". +include "arithmetics/pidgeon_hole.ma". include "basics/sets.ma". include "basics/types.ma". @@ -46,6 +45,8 @@ lemma Max0r : ∀n. max n 0 = n. #n >commutative_max // qed. +alias id "max" = "cic:/matita/arithmetics/nat/max#def:2". +alias id "mk_Aop" = "cic:/matita/arithmetics/bigops/Aop#con:0:1:2". definition MaxA ≝ mk_Aop nat 0 max Max0 Max0r (λa,b,c.sym_eq … (Max_assoc a b c)). @@ -116,21 +117,12 @@ lemma O_absorbr: ∀f,g,s. O s f → O f g → O s (f+g). #f #g #s #Osf #Ofg @(O_plus … Osf) @(O_trans … Osf) // qed. -(* -lemma O_ff: ∀f,s. O s f → O s (f+f). -#f #s #Osf /2/ -qed. *) - lemma O_ext2: ∀f,g,s. O s f → (∀x.f x = g x) → O s g. #f #g #s * #c * #a #Osf #eqfg %{c} %{a} #n #lean H normalize #H1 destruct //] -qed. - -lemma Some_to_halt: ∀n,i,y. U i n = Some ? y → u y = None ? . -#n elim n - [#i #y normalize #H destruct (H) - |#m #Hind #i #y normalize - cut (u i = None ? ∨ ∃c. u i = Some ? c) - [cases (u i) [/2/ | #c %2 /2/ ]] - *[#H >H normalize #H1 destruct (H1) // |* #c #H >H normalize @Hind ] - ] -qed. *) - axiom U: nat → nat → nat → option nat. -(* -lemma monotonici_U: ∀y,n,m,i. - U i m = Some ? y → U i (n+m) = Some ? y. -#y #n #m elim m - [#i normalize #H destruct - |#p #Hind #i H1 normalize // |* #c #H >H normalize #H1 @Hind //] - ] -qed. *) axiom monotonic_U: ∀i,x,n,m,y.n ≤m → U i x n = Some ? y → U i x m = Some ? y. -(* #i #n #m #y #lenm #H >(plus_minus_m_m m n) // @monotonici_U // -qed. *) - -(* axiom U: nat → nat → option nat. *) -(* axiom monotonic_U: ∀i,n,m,y.n ≤m → - U i n = Some ? y → U i m = Some ? y. *) lemma unique_U: ∀i,x,n,m,yn,ym. U i x n = Some ? yn → U i x m = Some ? ym → yn = ym. @@ -226,7 +172,7 @@ definition code_for ≝ λf,i.∀x. ∃n.∀m. n ≤ m → U i x m = f x. definition terminate ≝ λi,x,r. ∃y. U i x r = Some ? y. -notation "[i,x] ↓ r" with precedence 60 for @{terminate $i $x $r}. +notation "{i ⊙ x} ↓ r" with precedence 60 for @{terminate $i $x $r}. definition lang ≝ λi,x.∃r,y. U i x r = Some ? y ∧ 0 < y. @@ -260,11 +206,6 @@ lemma size_f_def: ∀f,n. size_f f n = Max_{i < S (of_size n) | eqb (|i|) n}|(f i)|. // qed. -(* -definition Max_const : ∀f,p,n,a. a < n → p a → - ∀n. f n = g n → - Max_{i < n | p n}(f n) = *) - lemma size_f_size : ∀f,n. size_f (f ∘ size) n = |(f n)|. #f #n @le_to_le_to_eq [@Max_le #a #lta #Ha normalize >(eqb_true_to_eq … Ha) // @@ -287,12 +228,9 @@ lemma size_f_fst : ∀n. size_f fst n ≤ n. #n @Max_le #a #lta #Ha <(eqb_true_to_eq … Ha) // qed. -(* definition def ≝ λf:nat → option nat.λx.∃y. f x = Some ? y.*) - (* C s i means that the complexity of i is O(s) *) -definition C ≝ λs,i.∃c.∃a.∀x.a ≤ |x| → ∃y. - U i x (c*(s(|x|))) = Some ? y. +definition C ≝ λs,i.∃c.∃a.∀x.a ≤ |x| → {i ⊙ x} ↓ (c*(s(|x|))). definition CF ≝ λs,f.∃i.code_for f i ∧ C s i. @@ -308,6 +246,18 @@ cases HCs1 #c2 * #b #H2 %{(c2*c1)} %{(max a b)} %{y} @(monotonic_U …Hy) >associative_times @le_times // @H @(le_maxl … Hmax) qed. +(*********************** The hierachy theorem (left) **************************) + +theorem hierarchy_theorem_left: ∀s1,s2:nat→nat. + O(s1) ⊆ O(s2) → CF s1 ⊆ CF s2. +#s1 #s2 #HO #f * #i * #Hcode * #c * #a #Hs1_i %{i} % // +cases (sub_O_to_O … HO) -HO #c1 * #b #Hs1s2 +%{(c*c1)} %{(max a b)} #x #lemax +cases (Hs1_i x ?) [2: @(le_maxl …lemax)] +#y #Hy %{y} @(monotonic_U … Hy) >associative_times +@le_times // @Hs1s2 @(le_maxr … lemax) +qed. + (************************** The diagonal language *****************************) (* the diagonal language used for the hierarchy theorem *) @@ -316,7 +266,7 @@ definition diag ≝ λs,i. U (fst i) i (s (|i|)) = Some ? 0. lemma equiv_diag: ∀s,i. - diag s i ↔ [fst i,i] ↓ s (|i|) ∧ ¬lang (fst i) i. + diag s i ↔ {fst i ⊙ i} ↓ s(|i|) ∧ ¬lang (fst i) i. #s #i % [whd in ⊢ (%→?); #H % [%{0} //] % * #x * #y * #H1 #Hy cut (0 = y) [@(unique_U … H H1)] #eqy /2/ @@ -358,7 +308,39 @@ lemma absurd1: ∀P. iff P (¬ P) →False. #H3 @(absurd ?? H3) @H2 @H3 qed. -(* axiom weak_pad : ∀a,∃a0.∀n. a0 < n → ∃b. |〈a,b〉| = n. *) +let rec f_img (f:nat →nat) n on n ≝ + match n with + [O ⇒ [ ] + |S m ⇒ f m::f_img f m + ]. + +(* a few lemma to prove injective_to_exists. This is a general result; a nice +example of the pidgeon hole pricniple *) + +lemma f_img_to_exists: + ∀f.∀n,a. a ∈ f_img f n → ∃b. b < n ∧ f b = a. +#f #n #a elim n normalize [@False_ind] +#m #Hind * + [#Ha %{m} /2/ |#H cases(Hind H) #b * #Hb #Ha %{b} % // @le_S //] +qed. + +lemma length_f_img: ∀f,n. |f_img f n| = n. +#f #n elim n // normalize // +qed. + +lemma unique_f_img: ∀f,n. injective … f → unique ? (f_img f n). +#f #n #Hinj elim n normalize // +#m #Hind % // % #H lapply(f_img_to_exists …H) * #b * #ltbm +#eqbm @(absurd … ltbm) @le_to_not_lt >(Hinj… eqbm) // +qed. + +lemma injective_to_exists: ∀f. injective nat nat f → + ∀n.(∀i.i < n → f i < n) → ∀a. a < n → ∃b. bcommutative_times size_f_size >size_of_size // ] -qed. - -(* -lemma diag_s: ∀s. minimal s → constructible s → - CF (λx.s x + sU x x (s x)) (diag_cf s). -#s * #Hs_id #Hs_c #Hs_constr -@ext_CF [2: #n @sym_eq @diag_cf_def | skip] -@IF_CF_new [2,3:@(monotonic_CF … (Hs_c ?)) @O_plus_l //] -@CFU_new - [@CF_fst @(monotonic_CF … Hs_id) @O_plus_l // - |@(monotonic_CF … Hs_id) @O_plus_l // - |@(monotonic_CF … Hs_constr) @O_plus_l // - |@O_plus_r %{1} %{0} #n #_ >commutative_times size_f_size >size_of_size // - ] -qed. *) - -(* proof with old axioms -lemma diag_s: ∀s. minimal s → constructible s → - CF (λx.s x + sU x x (s x)) (diag_cf s). -#s * #Hs_id #Hs_c #Hs_constr -@ext_CF [2: #n @sym_eq @diag_cf_def | skip] -@(monotonic_CF ???? (IF_CF (λi:ℕ.U (pair (fst i) i) (|of_size (s (|i|))|)) - … (λi.s i + s i + s i + (sU (size_f fst i) (size_f (λi.i) i) (size_f (λi.of_size (s (|i|))) i))) … (Hs_c 1) (Hs_c 0) … )) - [2: @CFU [@CF_fst // | // |@Hs_constr] - |@(O_ext2 (λn:ℕ.s n+sU (size_f fst n) n (s n) + (s n+s n+s n+s n))) - [2: #i >size_f_size >size_of_size >size_f_id //] - @O_absorbr - [%{1} %{0} #n #_ >commutative_times associative_times -@le_times // @Hs1s2 @(le_maxr … lemax) -qed. - +qed. \ No newline at end of file diff --git a/matita/matita/lib/reverse_complexity/sigma_diseq.ma b/matita/matita/lib/reverse_complexity/sigma_diseq.ma new file mode 100644 index 000000000..4356cd24e --- /dev/null +++ b/matita/matita/lib/reverse_complexity/sigma_diseq.ma @@ -0,0 +1,153 @@ +include "arithmetics/sigma_pi.ma". + +(************************* notation for minimization **************************) +notation "μ_{ ident i < n } p" + with precedence 80 for @{min $n 0 (λ${ident i}.$p)}. + +notation "μ_{ ident i ≤ n } p" + with precedence 80 for @{min (S $n) 0 (λ${ident i}.$p)}. + +notation "μ_{ ident i ∈ [a,b[ } p" + with precedence 80 for @{min ($b-$a) $a (λ${ident i}.$p)}. + +notation "μ_{ ident i ∈ [a,b] } p" + with precedence 80 for @{min (S $b-$a) $a (λ${ident i}.$p)}. + +(************************************ MAX *************************************) +notation "Max_{ ident i < n | p } f" + with precedence 80 +for @{'bigop $n max 0 (λ${ident i}. $p) (λ${ident i}. $f)}. + +notation "Max_{ ident i < n } f" + with precedence 80 +for @{'bigop $n max 0 (λ${ident i}.true) (λ${ident i}. $f)}. + +notation "Max_{ ident j ∈ [a,b[ } f" + with precedence 80 +for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.true) (${ident j}+$a))) + (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}. + +notation "Max_{ ident j ∈ [a,b[ | p } f" + with precedence 80 +for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.$p) (${ident j}+$a))) + (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}. + +lemma Max_assoc: ∀a,b,c. max (max a b) c = max a (max b c). +#a #b #c normalize cases (true_or_false (leb a b)) #leab >leab normalize + [cases (true_or_false (leb b c )) #lebc >lebc normalize + [>(le_to_leb_true a c) // @(transitive_le ? b) @leb_true_to_le // + |>leab // + ] + |cases (true_or_false (leb b c )) #lebc >lebc normalize // + >leab normalize >(not_le_to_leb_false a c) // @lt_to_not_le + @(transitive_lt ? b) @not_le_to_lt @leb_false_to_not_le // + ] +qed. + +lemma Max0 : ∀n. max 0 n = n. +// qed. + +lemma Max0r : ∀n. max n 0 = n. +#n >commutative_max // +qed. + +definition MaxA ≝ + mk_Aop nat 0 max Max0 Max0r (λa,b,c.sym_eq … (Max_assoc a b c)). + +definition MaxAC ≝ mk_ACop nat 0 MaxA commutative_max. + +lemma le_Max: ∀f,p,n,a. a < n → p a = true → + f a ≤ Max_{i < n | p i}(f i). +#f #p #n #a #ltan #pa +>(bigop_diff p ? 0 MaxAC f a n) // @(le_maxl … (le_n ?)) +qed. + +lemma le_MaxI: ∀f,p,n,m,a. m ≤ a → a < n → p a = true → + f a ≤ Max_{i ∈ [m,n[ | p i}(f i). +#f #p #n #m #a #lema #ltan #pa +>(bigop_diff ? ? 0 MaxAC (λi.f (i+m)) (a-m) (n-m)) + [bigop_Strue [2:@Hb] @to_max [@H1 // | @H #a #ltab #pa @H1 // @le_S //] + |>bigop_Sfalse [2:@Hb] @H #a #ltab #pa @H1 // @le_S // + ] +qed. + + +(************************* a couple of technical lemmas ***********************) +lemma minus_to_0: ∀a,b. a ≤ b → minus a b = 0. +#a elim a // #n #Hind * + [#H @False_ind /2 by absurd/ | #b normalize #H @Hind @le_S_S_to_le /2/] +qed. + +lemma sigma_const: ∀c,a,b. + ∑_{i ∈ [a,b[ }c ≤ (b-a)*c. +#c #a #b elim (b-a) // #n #Hind normalize @le_plus // +qed. + +lemma sigma_to_Max: ∀h,a,b. + ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*Max_{i ∈ [a,b[ }(h i). +#h #a #b elim (b-a) + [// + |#n #Hind >bigop_Strue [2://] whd in ⊢ (??%); + @le_plus + [>bigop_Strue // @(le_maxl … (le_n …)) + |@(transitive_le … Hind) @le_times // >bigop_Strue // + @(le_maxr … (le_n …)) + ] + ] +qed. + +lemma sigma_bound1: ∀h,a,b. monotonic nat le h → + ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*h b. +#h #a #b #H +@(transitive_le … (sigma_to_Max …)) @le_times // +@Max_le #i #lti #_ @H @lt_to_le @lt_minus_to_plus_r // +qed. + +lemma sigma_bound_decr1: ∀h,a,b. (∀a1,a2. a1 ≤ a2 → a2 < b → h a2 ≤ h a1) → + ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*h a. +#h #a #b #H +@(transitive_le … (sigma_to_Max …)) @le_times // +@Max_le #i #lti #_ @H // @lt_minus_to_plus_r // +qed. + +lemma sigma_bound: ∀h,a,b. monotonic nat le h → + ∑_{i ∈ [a,S b[ }(h i) ≤ (S b-a)*h b. +#h #a #b #H cases (decidable_le a b) + [#leab cut (b = pred (S b - a + a)) + [Hb in match (h b); + generalize in match (S b -a); + #n elim n + [// + |#m #Hind >bigop_Strue [2://] @le_plus + [@H @le_n |@(transitive_le … Hind) @le_times [//] @H //] + ] + |#ltba lapply (not_le_to_lt … ltba) -ltba #ltba + cut (S b -a = 0) [@minus_to_0 //] #Hcut >Hcut // + ] +qed. + +lemma sigma_bound_decr: ∀h,a,b. (∀a1,a2. a1 ≤ a2 → a2 < b → h a2 ≤ h a1) → + ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*h a. +#h #a #b #H cases (decidable_le a b) + [#leab cut ((b -a) +a ≤ b) [/2 by le_minus_to_plus_r/] generalize in match (b -a); + #n elim n + [// + |#m #Hind >bigop_Strue [2://] #Hm + cut (m+a ≤ b) [@(transitive_le … Hm) //] #Hm1 + @le_plus [@H // |@(transitive_le … (Hind Hm1)) //] + ] + |#ltba lapply (not_le_to_lt … ltba) -ltba #ltba + cut (b -a = 0) [@minus_to_0 @lt_to_le @ltba] #Hcut >Hcut // + ] +qed. + \ No newline at end of file diff --git a/matita/matita/lib/reverse_complexity/speed_clean.ma b/matita/matita/lib/reverse_complexity/speed_clean.ma index 9b9fecf94..bfd3d34b1 100644 --- a/matita/matita/lib/reverse_complexity/speed_clean.ma +++ b/matita/matita/lib/reverse_complexity/speed_clean.ma @@ -4,6 +4,7 @@ include "arithmetics/bigops.ma". include "arithmetics/sigma_pi.ma". include "arithmetics/bounded_quantifiers.ma". include "reverse_complexity/big_O.ma". +include "basics/core_notation/napart_2.ma". (************************* notation for minimization *****************************) notation "μ_{ ident i < n } p" @@ -1064,4 +1065,4 @@ lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg @Hmono @(mono_h_of2 … Hr Hmono … ltin) ] qed. - \ No newline at end of file + diff --git a/matita/matita/lib/reverse_complexity/speed_def.ma b/matita/matita/lib/reverse_complexity/speed_def.ma index 6a0ec4a57..9812cfb08 100644 --- a/matita/matita/lib/reverse_complexity/speed_def.ma +++ b/matita/matita/lib/reverse_complexity/speed_def.ma @@ -4,6 +4,7 @@ include "arithmetics/bigops.ma". include "arithmetics/sigma_pi.ma". include "arithmetics/bounded_quantifiers.ma". include "reverse_complexity/big_O.ma". +include "basics/core_notation/napart_2.ma". (************************* notation for minimization *****************************) notation "μ_{ ident i < n } p" @@ -918,4 +919,4 @@ lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg @Hmono @(mono_h_of2 … Hr Hmono … ltin) ] qed. - \ No newline at end of file + diff --git a/matita/matita/lib/reverse_complexity/speed_new.ma b/matita/matita/lib/reverse_complexity/speed_new.ma index 6a0ec4a57..9812cfb08 100644 --- a/matita/matita/lib/reverse_complexity/speed_new.ma +++ b/matita/matita/lib/reverse_complexity/speed_new.ma @@ -4,6 +4,7 @@ include "arithmetics/bigops.ma". include "arithmetics/sigma_pi.ma". include "arithmetics/bounded_quantifiers.ma". include "reverse_complexity/big_O.ma". +include "basics/core_notation/napart_2.ma". (************************* notation for minimization *****************************) notation "μ_{ ident i < n } p" @@ -918,4 +919,4 @@ lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg @Hmono @(mono_h_of2 … Hr Hmono … ltin) ] qed. - \ No newline at end of file + diff --git a/matita/matita/lib/reverse_complexity/speedup.ma b/matita/matita/lib/reverse_complexity/speedup.ma new file mode 100644 index 000000000..12605c9e4 --- /dev/null +++ b/matita/matita/lib/reverse_complexity/speedup.ma @@ -0,0 +1,760 @@ +(* +<<<<<<< HEAD:matita/matita/broken_lib/reverse_complexity/toolkit.ma +include "basics/types.ma". +include "arithmetics/minimization.ma". +include "arithmetics/bigops.ma". +include "arithmetics/sigma_pi.ma". +include "arithmetics/bounded_quantifiers.ma". +include "reverse_complexity/big_O.ma". +include "basics/core_notation/napart_2.ma". + +(************************* notation for minimization *****************************) +notation "μ_{ ident i < n } p" + with precedence 80 for @{min $n 0 (λ${ident i}.$p)}. + +notation "μ_{ ident i ≤ n } p" + with precedence 80 for @{min (S $n) 0 (λ${ident i}.$p)}. + +notation "μ_{ ident i ∈ [a,b[ } p" + with precedence 80 for @{min ($b-$a) $a (λ${ident i}.$p)}. + +notation "μ_{ ident i ∈ [a,b] } p" + with precedence 80 for @{min (S $b-$a) $a (λ${ident i}.$p)}. + +(************************************ MAX *************************************) +notation "Max_{ ident i < n | p } f" + with precedence 80 +for @{'bigop $n max 0 (λ${ident i}. $p) (λ${ident i}. $f)}. + +notation "Max_{ ident i < n } f" + with precedence 80 +for @{'bigop $n max 0 (λ${ident i}.true) (λ${ident i}. $f)}. + +notation "Max_{ ident j ∈ [a,b[ } f" + with precedence 80 +for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.true) (${ident j}+$a))) + (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}. + +notation "Max_{ ident j ∈ [a,b[ | p } f" + with precedence 80 +for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.$p) (${ident j}+$a))) + (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}. + +lemma Max_assoc: ∀a,b,c. max (max a b) c = max a (max b c). +#a #b #c normalize cases (true_or_false (leb a b)) #leab >leab normalize + [cases (true_or_false (leb b c )) #lebc >lebc normalize + [>(le_to_leb_true a c) // @(transitive_le ? b) @leb_true_to_le // + |>leab // + ] + |cases (true_or_false (leb b c )) #lebc >lebc normalize // + >leab normalize >(not_le_to_leb_false a c) // @lt_to_not_le + @(transitive_lt ? b) @not_le_to_lt @leb_false_to_not_le // + ] +qed. + +lemma Max0 : ∀n. max 0 n = n. +// qed. + +lemma Max0r : ∀n. max n 0 = n. +#n >commutative_max // +qed. + +definition MaxA ≝ + mk_Aop nat 0 max Max0 Max0r (λa,b,c.sym_eq … (Max_assoc a b c)). + +definition MaxAC ≝ mk_ACop nat 0 MaxA commutative_max. + +lemma le_Max: ∀f,p,n,a. a < n → p a = true → + f a ≤ Max_{i < n | p i}(f i). +#f #p #n #a #ltan #pa +>(bigop_diff p ? 0 MaxAC f a n) // @(le_maxl … (le_n ?)) +qed. + +lemma le_MaxI: ∀f,p,n,m,a. m ≤ a → a < n → p a = true → + f a ≤ Max_{i ∈ [m,n[ | p i}(f i). +#f #p #n #m #a #lema #ltan #pa +>(bigop_diff ? ? 0 MaxAC (λi.f (i+m)) (a-m) (n-m)) + [bigop_Strue [2:@Hb] @to_max [@H1 // | @H #a #ltab #pa @H1 // @le_S //] + |>bigop_Sfalse [2:@Hb] @H #a #ltab #pa @H1 // @le_S // + ] +qed. + +(********************************** pairing ***********************************) +axiom pair: nat → nat → nat. +axiom fst : nat → nat. +axiom snd : nat → nat. + +interpretation "abstract pair" 'pair f g = (pair f g). + +axiom fst_pair: ∀a,b. fst 〈a,b〉 = a. +axiom snd_pair: ∀a,b. snd 〈a,b〉 = b. +axiom surj_pair: ∀x. ∃a,b. x = 〈a,b〉. + +axiom le_fst : ∀p. fst p ≤ p. +axiom le_snd : ∀p. snd p ≤ p. +axiom le_pair: ∀a,a1,b,b1. a ≤ a1 → b ≤ b1 → 〈a,b〉 ≤ 〈a1,b1〉. + +(************************************* U **************************************) +axiom U: nat → nat →nat → option nat. + +axiom monotonic_U: ∀i,x,n,m,y.n ≤m → + U i x n = Some ? y → U i x m = Some ? y. + +lemma unique_U: ∀i,x,n,m,yn,ym. + U i x n = Some ? yn → U i x m = Some ? ym → yn = ym. +#i #x #n #m #yn #ym #Hn #Hm cases (decidable_le n m) + [#lenm lapply (monotonic_U … lenm Hn) >Hm #HS destruct (HS) // + |#ltmn lapply (monotonic_U … n … Hm) [@lt_to_le @not_le_to_lt //] + >Hn #HS destruct (HS) // + ] +qed. + +definition code_for ≝ λf,i.∀x. + ∃n.∀m. n ≤ m → U i x m = f x. + +definition terminate ≝ λi,x,r. ∃y. U i x r = Some ? y. + +notation "{i ⊙ x} ↓ r" with precedence 60 for @{terminate $i $x $r}. + +lemma terminate_dec: ∀i,x,n. {i ⊙ x} ↓ n ∨ ¬ {i ⊙ x} ↓ n. +#i #x #n normalize cases (U i x n) + [%2 % * #y #H destruct|#y %1 %{y} //] +qed. + +lemma monotonic_terminate: ∀i,x,n,m. + n ≤ m → {i ⊙ x} ↓ n → {i ⊙ x} ↓ m. +#i #x #n #m #lenm * #z #H %{z} @(monotonic_U … H) // +qed. + +definition termb ≝ λi,x,t. + match U i x t with [None ⇒ false |Some y ⇒ true]. + +lemma termb_true_to_term: ∀i,x,t. termb i x t = true → {i ⊙ x} ↓ t. +#i #x #t normalize cases (U i x t) normalize [#H destruct | #y #_ %{y} //] +qed. + +lemma term_to_termb_true: ∀i,x,t. {i ⊙ x} ↓ t → termb i x t = true. +#i #x #t * #y #H normalize >H // +qed. + +definition out ≝ λi,x,r. + match U i x r with [ None ⇒ 0 | Some z ⇒ z]. + +definition bool_to_nat: bool → nat ≝ + λb. match b with [true ⇒ 1 | false ⇒ 0]. + +coercion bool_to_nat. + +definition pU : nat → nat → nat → nat ≝ λi,x,r.〈termb i x r,out i x r〉. + +lemma pU_vs_U_Some : ∀i,x,r,y. pU i x r = 〈1,y〉 ↔ U i x r = Some ? y. +#i #x #r #y % normalize + [cases (U i x r) normalize + [#H cut (0=1) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H @H] + #H1 destruct + |#a #H cut (a=y) [lapply (eq_f … snd … H) >snd_pair >snd_pair #H1 @H1] + #H1 // + ] + |#H >H //] +qed. + +lemma pU_vs_U_None : ∀i,x,r. pU i x r = 〈0,0〉 ↔ U i x r = None ?. +#i #x #r % normalize + [cases (U i x r) normalize // + #a #H cut (1=0) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H1 @H1] + #H1 destruct + |#H >H //] +qed. + +lemma fst_pU: ∀i,x,r. fst (pU i x r) = termb i x r. +#i #x #r normalize cases (U i x r) normalize >fst_pair // +qed. + +lemma snd_pU: ∀i,x,r. snd (pU i x r) = out i x r. +#i #x #r normalize cases (U i x r) normalize >snd_pair // +qed. +======= +include "reverse_complexity/bigops_compl.ma". +>>>>>>> reverse_complexity lib restored:matita/matita/lib/reverse_complexity/speedup.ma +*) + +(********************************* the speedup ********************************) + +definition min_input ≝ λh,i,x. μ_{y ∈ [S i,x] } (termb i y (h (S i) y)). + +lemma min_input_def : ∀h,i,x. + min_input h i x = min (x -i) (S i) (λy.termb i y (h (S i) y)). +// qed. + +lemma min_input_i: ∀h,i,x. x ≤ i → min_input h i x = S i. +#h #i #x #lexi >min_input_def +cut (x - i = 0) [@sym_eq /2 by eq_minus_O/] #Hcut // +qed. + +lemma min_input_to_terminate: ∀h,i,x. + min_input h i x = x → {i ⊙ x} ↓ (h (S i) x). +#h #i #x #Hminx +cases (decidable_le (S i) x) #Hix + [cases (true_or_false (termb i x (h (S i) x))) #Hcase + [@termb_true_to_term // + |min_input_def in Hminx; #Hminx >Hminx in ⊢ (%→?); + min_input_i in Hminx; + [#eqix >eqix in Hix; * /2/ | @le_S_S_to_le @not_le_to_lt //] + ] +qed. + +lemma min_input_to_lt: ∀h,i,x. + min_input h i x = x → i < x. +#h #i #x #Hminx cases (decidable_le (S i) x) // +#ltxi @False_ind >min_input_i in Hminx; + [#eqix >eqix in ltxi; * /2/ | @le_S_S_to_le @not_le_to_lt //] +qed. + +lemma le_to_min_input: ∀h,i,x,x1. x ≤ x1 → + min_input h i x = x → min_input h i x1 = x. +#h #i #x #x1 #lex #Hminx @(min_exists … (le_S_S … lex)) + [@(fmin_true … (sym_eq … Hminx)) // + |@(min_input_to_lt … Hminx) + |#j #H1 g_def cut (x-u = 0) [/2 by minus_le_minus_minus_comm/] +#eq0 >eq0 normalize // qed. + +lemma g_lt : ∀h,i,x. min_input h i x = x → + out i x (h (S i) x) < g h 0 x. +#h #i #x #H @le_S_S @(le_MaxI … i) /2 by min_input_to_lt/ +qed. + +lemma max_neq0 : ∀a,b. max a b ≠ 0 → a ≠ 0 ∨ b ≠ 0. +#a #b whd in match (max a b); cases (true_or_false (leb a b)) #Hcase >Hcase + [#H %2 @H | #H %1 @H] +qed. + +definition almost_equal ≝ λf,g:nat → nat. ¬ ∀nu.∃x. nu < x ∧ f x ≠ g x. +interpretation "almost equal" 'napart f g = (almost_equal f g). + +lemma eventually_cancelled: ∀h,u.¬∀nu.∃x. nu < x ∧ + max_{i ∈ [0,u[ | eqb (min_input h i x) x} (out i x (h (S i) x)) ≠ 0. +#h #u elim u + [normalize % #H cases (H u) #x * #_ * #H1 @H1 // + |#u0 @not_to_not #Hind #nu cases (Hind nu) #x * #ltx + cases (true_or_false (eqb (min_input h (u0+O) x) x)) #Hcase + [>bigop_Strue [2:@Hcase] #Hmax cases (max_neq0 … Hmax) -Hmax + [2: #H %{x} % // bigop_Sfalse + [#H %{x1} % [@transitive_lt //| (le_to_min_input … (eqb_true_to_eq … Hcase)) + [@lt_to_not_eq @ltx1 | @lt_to_le @ltx1] + ] + |>bigop_Sfalse [2:@Hcase] #H %{x} % // (bigop_sumI 0 u x (λi:ℕ.eqb (min_input h i x) x) nat 0 MaxA) + [>H // |@lt_to_le @(le_to_lt_to_lt …ltx) /2 by le_maxr/ |//] +qed. + +(******************************** Condition 2 *********************************) + +lemma exists_to_exists_min: ∀h,i. (∃x. i < x ∧ {i ⊙ x} ↓ h (S i) x) → ∃y. min_input h i y = y. +#h #i * #x * #ltix #Hx %{(min_input h i x)} @min_spec_to_min @found // + [@(f_min_true (λy:ℕ.termb i y (h (S i) y))) %{x} % [% // | @term_to_termb_true //] + |#y #leiy #lty @(lt_min_to_false ????? lty) // + ] +qed. + +lemma condition_2: ∀h,i. code_for (total (g h 0)) i → ¬∃x. itermy >Hr +#H @(absurd ? H) @le_to_not_lt @le_n +qed. + +(**************************** complexity of g *********************************) + +definition unary_g ≝ λh.λux. g h (fst ux) (snd ux). +definition auxg ≝ + λh,ux. max_{i ∈[fst ux,snd ux[ | eqb (min_input h i (snd ux)) (snd ux)} + (out i (snd ux) (h (S i) (snd ux))). + +lemma compl_g1 : ∀h,s. CF s (auxg h) → CF s (unary_g h). +#h #s #H1 @(CF_compS ? (auxg h) H1) +qed. + +definition aux1g ≝ + λh,ux. max_{i ∈[fst ux,snd ux[ | (λp. eqb (min_input h (fst p) (snd (snd p))) (snd (snd p))) 〈i,ux〉} + ((λp.out (fst p) (snd (snd p)) (h (S (fst p)) (snd (snd p)))) 〈i,ux〉). + +lemma eq_aux : ∀h,x.aux1g h x = auxg h x. +#h #x @same_bigop + [#n #_ >fst_pair >snd_pair // |#n #_ #_ >fst_pair >snd_pair //] +qed. + +lemma compl_g2 : ∀h,s1,s2,s. + CF s1 + (λp:ℕ.eqb (min_input h (fst p) (snd (snd p))) (snd (snd p))) → + CF s2 + (λp:ℕ.out (fst p) (snd (snd p)) (h (S (fst p)) (snd (snd p)))) → + O s (λx.MSC x + (snd x - fst x)*Max_{i ∈[fst x ,snd x[ }(s1 〈i,x〉+s2 〈i,x〉)) → + CF s (auxg h). +#h #s1 #s2 #s #Hs1 #Hs2 #HO @(ext_CF (aux1g h)) + [#n whd in ⊢ (??%%); @eq_aux] +@(CF_max2 … CF_fst CF_snd Hs1 Hs2 …) @(O_trans … HO) +@O_plus [@O_plus @O_plus_l // | @O_plus_r //] +qed. + +lemma compl_g3 : ∀h,s. + CF s (λp:ℕ.min_input h (fst p) (snd (snd p))) → + CF s (λp:ℕ.eqb (min_input h (fst p) (snd (snd p))) (snd (snd p))). +#h #s #H @(CF_eqb … H) @(CF_comp … CF_snd CF_snd) @(O_trans … (le_to_O … (MSC_in … H))) +@O_plus // %{1} %{0} #n #_ >commutative_times min_input_def whd in ⊢ (??%?); >minus_S_S @min_f_g #i #_ #_ +whd in ⊢ (??%%); >fst_pair >snd_pair // +qed. + +definition termb_aux ≝ λh. + termb_unary ∘ λp.〈fst (snd p),〈fst p,h (S (fst (snd p))) (fst p)〉〉. + +lemma compl_g4 : ∀h,s1,s. (∀x. 0 < s1 x) → + (CF s1 + (λp.termb (fst (snd p)) (fst p) (h (S (fst (snd p))) (fst p)))) → + (O s (λx.MSC x + ((snd(snd x) - (fst x)))*Max_{i ∈[S(fst x) ,S(snd (snd x))[ }(s1 〈i,x〉))) → + CF s (λp:ℕ.min_input h (fst p) (snd (snd p))). +#h #s1 #s #pos_s1 #Hs1 #HO @(ext_CF (min_input_aux h)) + [#n whd in ⊢ (??%%); @min_input_eq] +@(CF_mu4 … MSC MSC … pos_s1 … Hs1) + [@CF_compS @CF_fst + |@CF_comp_snd @CF_snd + |@(O_trans … HO) @O_plus [@O_plus @O_plus_l // | @O_plus_r //] +qed. + +(* ??? *) + +lemma coroll: ∀s1:nat→nat. (∀n. monotonic ℕ le (λa:ℕ.s1 〈a,n〉)) → +O (λx.(snd (snd x)-fst x)*(s1 〈snd (snd x),x〉)) + (λx.∑_{i ∈[S(fst x) ,S(snd (snd x))[ }(s1 〈i,x〉)). +#s1 #Hs1 %{1} %{0} #n #_ >commutative_times minus_S_S //] +qed. + +lemma coroll2: ∀s1:nat→nat. (∀n,a,b. a ≤ b → b < snd n → s1 〈b,n〉 ≤ s1 〈a,n〉) → +O (λx.(snd x - fst x)*s1 〈fst x,x〉) (λx.∑_{i ∈[fst x,snd x[ }(s1 〈i,x〉)). +#s1 #Hs1 %{1} %{0} #n #_ >commutative_times fst_pair >snd_pair >fst_pair >snd_pair // ] +@(CF_comp … (λx.MSC x + h (S (fst (snd x))) (fst x)) … CF_termb) + [@CF_comp_pair + [@CF_comp_fst @(monotonic_CF … CF_snd) #x // + |@CF_comp_pair + [@(monotonic_CF … CF_fst) #x // + |@(ext_CF ((λx.h (fst x) (snd x))∘(λx.〈S (fst (snd x)),fst x〉))) + [#n normalize >fst_pair >snd_pair %] + @(CF_comp … MSC …hconstr) + [@CF_comp_pair [@CF_compS @CF_comp_fst // |//] + |@O_plus @le_to_O [//|#n >fst_pair >snd_pair //] + ] + ] + ] + |@O_plus + [@O_plus + [@(O_trans … (λx.MSC (fst x) + MSC (max (fst (snd x)) (snd (snd x))))) + [%{2} %{0} #x #_ cases (surj_pair x) #a * #b #eqx >eqx + >fst_pair >snd_pair @(transitive_le … (MSC_pair …)) + >distributive_times_plus @le_plus [//] + cases (surj_pair b) #c * #d #eqb >eqb + >fst_pair >snd_pair @(transitive_le … (MSC_pair …)) + whd in ⊢ (??%); @le_plus + [@monotonic_MSC @(le_maxl … (le_n …)) + |>commutative_times fst_pair >snd_pair // qed. + +lemma le_big : ∀x. x ≤ big x. +#x cases (surj_pair x) #a * #b #eqx >eqx @le_pair >fst_pair >snd_pair +[@(le_maxl … (le_n …)) | @(le_maxr … (le_n …))] +qed. + +definition faux2 ≝ λh. + (λx.MSC x + (snd (snd x)-fst x)* + (λx.sU 〈max (fst(snd x)) (snd(snd x)),〈fst x,h (S (fst (snd x))) (fst x)〉〉) 〈snd (snd x),x〉). + +lemma compl_g7: ∀h. + constructible (λx. h (fst x) (snd x)) → + (∀n. monotonic ? le (h n)) → + CF (λx.MSC x + (snd (snd x)-fst x)*sU 〈max (fst x) (snd x),〈snd (snd x),h (S (fst x)) (snd (snd x))〉〉) + (λp:ℕ.min_input h (fst p) (snd (snd p))). +#h #hcostr #hmono @(monotonic_CF … (faux2 h)) + [#n normalize >fst_pair >snd_pair //] +@compl_g5 [#n @sU_pos | 3:@(compl_g6 h hcostr)] #n #x #y #lexy >fst_pair >snd_pair +>fst_pair >snd_pair @monotonic_sU // @hmono @lexy +qed. + +lemma compl_g71: ∀h. + constructible (λx. h (fst x) (snd x)) → + (∀n. monotonic ? le (h n)) → + CF (λx.MSC (big x) + (snd (snd x)-fst x)*sU 〈max (fst x) (snd x),〈snd (snd x),h (S (fst x)) (snd (snd x))〉〉) + (λp:ℕ.min_input h (fst p) (snd (snd p))). +#h #hcostr #hmono @(monotonic_CF … (compl_g7 h hcostr hmono)) #x +@le_plus [@monotonic_MSC //] +cases (decidable_le (fst x) (snd(snd x))) + [#Hle @le_times // @monotonic_sU + |#Hlt >(minus_to_0 … (lt_to_le … )) [// | @not_le_to_lt @Hlt] + ] +qed. + +definition out_aux ≝ λh. + out_unary ∘ λp.〈fst p,〈snd(snd p),h (S (fst p)) (snd (snd p))〉〉. + +lemma compl_g8: ∀h. + constructible (λx. h (fst x) (snd x)) → + (CF (λx. sU 〈max (fst x) (snd x),〈snd(snd x),h (S (fst x)) (snd(snd x))〉〉) + (λp.out (fst p) (snd (snd p)) (h (S (fst p)) (snd (snd p))))). +#h #hconstr @(ext_CF (out_aux h)) + [#n normalize >fst_pair >snd_pair >fst_pair >snd_pair // ] +@(CF_comp … (λx.h (S (fst x)) (snd(snd x)) + MSC x) … CF_out) + [@CF_comp_pair + [@(monotonic_CF … CF_fst) #x // + |@CF_comp_pair + [@CF_comp_snd @(monotonic_CF … CF_snd) #x // + |@(ext_CF ((λx.h (fst x) (snd x))∘(λx.〈S (fst x),snd(snd x)〉))) + [#n normalize >fst_pair >snd_pair %] + @(CF_comp … MSC …hconstr) + [@CF_comp_pair [@CF_compS // | @CF_comp_snd // ] + |@O_plus @le_to_O [//|#n >fst_pair >snd_pair //] + ] + ] + ] + |@O_plus + [@O_plus + [@le_to_O #n @sU_le + |@(O_trans … (λx.MSC (max (fst x) (snd x)))) + [%{2} %{0} #x #_ cases (surj_pair x) #a * #b #eqx >eqx + >fst_pair >snd_pair @(transitive_le … (MSC_pair …)) + whd in ⊢ (??%); @le_plus + [@monotonic_MSC @(le_maxl … (le_n …)) + |>commutative_times (times_n_1 (MSC x)) >commutative_times @le_times + [// | @monotonic_MSC // ]] +@(O_trans … (coroll3 ??)) + [#n #a #b #leab #ltb >fst_pair >fst_pair >snd_pair >snd_pair + cut (b ≤ n) [@(transitive_le … (le_snd …)) @lt_to_le //] #lebn + cut (max a n = n) + [normalize >le_to_leb_true [//|@(transitive_le … leab lebn)]] #maxa + cut (max b n = n) [normalize >le_to_leb_true //] #maxb + @le_plus + [@le_plus [>big_def >big_def >maxa >maxb //] + @le_times + [/2 by monotonic_le_minus_r/ + |@monotonic_sU // @hantimono [@le_S_S // |@ltb] + ] + |@monotonic_sU // @hantimono [@le_S_S // |@ltb] + ] + |@le_to_O #n >fst_pair >snd_pair + cut (max (fst n) n = n) [normalize >le_to_leb_true //] #Hmax >Hmax + >associative_plus >distributive_times_plus + @le_plus [@le_times [@le_S // |>big_def >Hmax //] |//] + ] +qed. + +definition c ≝ λx.(S (snd x-fst x))*MSC 〈x,x〉. + +definition sg ≝ λh,x. + let a ≝ fst x in + let b ≝ snd x in + c x + (b-a)*(S(b-a))*sU 〈x,〈snd x,h (S a) b〉〉. + +lemma sg_def1 : ∀h,a,b. + sg h 〈a,b〉 = c 〈a,b〉 + + (b-a)*(S(b-a))*sU 〈〈a,b〉,〈b,h (S a) b〉〉. +#h #a #b whd in ⊢ (??%?); >fst_pair >snd_pair // +qed. + +lemma sg_def : ∀h,a,b. + sg h 〈a,b〉 = + S (b-a)*MSC 〈〈a,b〉,〈a,b〉〉 + (b-a)*(S(b-a))*sU 〈〈a,b〉,〈b,h (S a) b〉〉. +#h #a #b normalize >fst_pair >snd_pair // +qed. + +lemma compl_g11 : ∀h. + constructible (λx. h (fst x) (snd x)) → + (∀n. monotonic ? le (h n)) → + (∀n,a,b. a ≤ b → b ≤ n → h b n ≤ h a n) → + CF (sg h) (unary_g h). +#h #hconstr #Hm #Ham @compl_g1 @(compl_g9 h hconstr Hm Ham) +qed. + +(**************************** closing the argument ****************************) + +let rec h_of_aux (r:nat →nat) (c,d,b:nat) on d : nat ≝ + match d with + [ O ⇒ c + | S d1 ⇒ (S d)*(MSC 〈〈b-d,b〉,〈b-d,b〉〉) + + d*(S d)*sU 〈〈b-d,b〉,〈b,r (h_of_aux r c d1 b)〉〉]. + +lemma h_of_aux_O: ∀r,c,b. + h_of_aux r c O b = c. +// qed. + +lemma h_of_aux_S : ∀r,c,d,b. + h_of_aux r c (S d) b = + (S (S d))*(MSC 〈〈b-(S d),b〉,〈b-(S d),b〉〉) + + (S d)*(S (S d))*sU 〈〈b-(S d),b〉,〈b,r(h_of_aux r c d b)〉〉. +// qed. + +definition h_of ≝ λr,p. + let m ≝ max (fst p) (snd p) in + h_of_aux r (MSC 〈〈m,m〉,〈m,m〉〉) (snd p - fst p) (snd p). + +lemma h_of_O: ∀r,a,b. b ≤ a → + h_of r 〈a,b〉 = let m ≝ max a b in MSC 〈〈m,m〉,〈m,m〉〉. +#r #a #b #Hle normalize >fst_pair >snd_pair >(minus_to_0 … Hle) // +qed. + +lemma h_of_def: ∀r,a,b.h_of r 〈a,b〉 = + let m ≝ max a b in + h_of_aux r (MSC 〈〈m,m〉,〈m,m〉〉) (b - a) b. +#r #a #b normalize >fst_pair >snd_pair // +qed. + +lemma mono_h_of_aux: ∀r.(∀x. x ≤ r x) → monotonic ? le r → + ∀d,d1,c,c1,b,b1.c ≤ c1 → d ≤ d1 → b ≤ b1 → + h_of_aux r c d b ≤ h_of_aux r c1 d1 b1. +#r #Hr #monor #d #d1 lapply d -d elim d1 + [#d #c #c1 #b #b1 #Hc #Hd @(le_n_O_elim ? Hd) #leb + >h_of_aux_O >h_of_aux_O // + |#m #Hind #d #c #c1 #b #b1 #lec #led #leb cases (le_to_or_lt_eq … led) + [#ltd @(transitive_le … (Hind … lec ? leb)) [@le_S_S_to_le @ltd] + >h_of_aux_S @(transitive_le ???? (le_plus_n …)) + >(times_n_1 (h_of_aux r c1 m b1)) in ⊢ (?%?); + >commutative_times @le_times [//|@(transitive_le … (Hr ?)) @sU_le] + |#Hd >Hd >h_of_aux_S >h_of_aux_S + cut (b-S m ≤ b1 - S m) [/2 by monotonic_le_minus_l/] #Hb1 + @le_plus [@le_times //] + [@monotonic_MSC @le_pair @le_pair // + |@le_times [//] @monotonic_sU + [@le_pair // |// |@monor @Hind //] + ] + ] + ] +qed. + +lemma mono_h_of2: ∀r.(∀x. x ≤ r x) → monotonic ? le r → + ∀i,b,b1. b ≤ b1 → h_of r 〈i,b〉 ≤ h_of r 〈i,b1〉. +#r #Hr #Hmono #i #a #b #leab >h_of_def >h_of_def +cut (max i a ≤ max i b) + [@to_max + [@(le_maxl … (le_n …))|@(transitive_le … leab) @(le_maxr … (le_n …))]] +#Hmax @(mono_h_of_aux r Hr Hmono) + [@monotonic_MSC @le_pair @le_pair @Hmax |/2 by monotonic_le_minus_l/ |@leab] +qed. + +axiom h_of_constr : ∀r:nat →nat. + (∀x. x ≤ r x) → monotonic ? le r → constructible r → + constructible (h_of r). + +lemma speed_compl: ∀r:nat →nat. + (∀x. x ≤ r x) → monotonic ? le r → constructible r → + CF (h_of r) (unary_g (λi,x. r(h_of r 〈i,x〉))). +#r #Hr #Hmono #Hconstr @(monotonic_CF … (compl_g11 …)) + [#x cases (surj_pair x) #a * #b #eqx >eqx + >sg_def cases (decidable_le b a) + [#leba >(minus_to_0 … leba) normalize in ⊢ (?%?); + h_of_def + cut (max a b = a) + [normalize cases (le_to_or_lt_eq … leba) + [#ltba >(lt_to_leb_false … ltba) % + |#eqba (le_to_leb_true … (le_n ?)) % ]] + #Hmax >Hmax normalize >(minus_to_0 … leba) normalize + @monotonic_MSC @le_pair @le_pair // + |#ltab >h_of_def >h_of_def + cut (max a b = b) + [normalize >(le_to_leb_true … ) [%] @lt_to_le @not_le_to_lt @ltab] + #Hmax >Hmax + cut (max (S a) b = b) + [whd in ⊢ (??%?); >(le_to_leb_true … ) [%] @not_le_to_lt @ltab] + #Hmax1 >Hmax1 + cut (∃d.b - a = S d) + [%{(pred(b-a))} >S_pred [//] @lt_plus_to_minus_r @not_le_to_lt @ltab] + * #d #eqd >eqd + cut (b-S a = d) [//] #eqd1 >eqd1 >h_of_aux_S >eqd1 + cut (b - S d = a) + [@plus_to_minus >commutative_plus @minus_to_plus + [@lt_to_le @not_le_to_lt // | //]] #eqd2 >eqd2 + normalize // + ] + |#n #a #b #leab #lebn >h_of_def >h_of_def + cut (max a n = n) + [normalize >le_to_leb_true [%|@(transitive_le … leab lebn)]] #Hmaxa + cut (max b n = n) + [normalize >(le_to_leb_true … lebn) %] #Hmaxb + >Hmaxa >Hmaxb @Hmono @(mono_h_of_aux r … Hr Hmono) // /2 by monotonic_le_minus_r/ + |#n #a #b #leab @Hmono @(mono_h_of2 … Hr Hmono … leab) + |@(constr_comp … Hconstr Hr) @(ext_constr (h_of r)) + [#x cases (surj_pair x) #a * #b #eqx >eqx >fst_pair >snd_pair //] + @(h_of_constr r Hr Hmono Hconstr) + ] +qed. + +lemma speed_compl_i: ∀r:nat →nat. + (∀x. x ≤ r x) → monotonic ? le r → constructible r → + ∀i. CF (λx.h_of r 〈i,x〉) (λx.g (λi,x. r(h_of r 〈i,x〉)) i x). +#r #Hr #Hmono #Hconstr #i +@(ext_CF (λx.unary_g (λi,x. r(h_of r 〈i,x〉)) 〈i,x〉)) + [#n whd in ⊢ (??%%); @eq_f @sym_eq >fst_pair >snd_pair %] +@smn @(ext_CF … (speed_compl r Hr Hmono Hconstr)) #n // +qed. + +(**************************** the speedup theorem *****************************) +theorem pseudo_speedup: + ∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r → + ∃f.∀sf. CF sf f → ∃g,sg. f ≈ g ∧ CF sg g ∧ O sf (r ∘ sg). +(* ∃m,a.∀n. a≤n → r(sg a) < m * sf n. *) +#r #Hr #Hmono #Hconstr +(* f is (g (λi,x. r(h_of r 〈i,x〉)) 0) *) +%{(g (λi,x. r(h_of r 〈i,x〉)) 0)} #sf * #i * +#Hcodei #HCi +(* g is (g (λi,x. r(h_of r 〈i,x〉)) (S i)) *) +%{(g (λi,x. r(h_of r 〈i,x〉)) (S i))} +(* sg is (λx.h_of r 〈i,x〉) *) +%{(λx. h_of r 〈S i,x〉)} +lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg +%[%[@condition_1 |@Hg] + |cases Hg #H1 * #j * #Hcodej #HCj + lapply (condition_2 … Hcodei) #Hcond2 (* @not_to_not *) + cases HCi #m * #a #Ha %{m} %{(max (S i) a)} #n #ltin @lt_to_le @not_le_to_lt + @(not_to_not … Hcond2) -Hcond2 #Hlesf %{n} % + [@(transitive_le … ltin) @(le_maxl … (le_n …))] + cases (Ha n ?) [2: @(transitive_le … ltin) @(le_maxr … (le_n …))] + #y #Uy %{y} @(monotonic_U … Uy) @(transitive_le … Hlesf) // + ] +qed. + +theorem pseudo_speedup': + ∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r → + ∃f.∀sf. CF sf f → ∃g,sg. f ≈ g ∧ CF sg g ∧ + (* ¬ O (r ∘ sg) sf. *) + ∃m,a.∀n. a≤n → r(sg a) < m * sf n. +#r #Hr #Hmono #Hconstr +(* f is (g (λi,x. r(h_of r 〈i,x〉)) 0) *) +%{(g (λi,x. r(h_of r 〈i,x〉)) 0)} #sf * #i * +#Hcodei #HCi +(* g is (g (λi,x. r(h_of r 〈i,x〉)) (S i)) *) +%{(g (λi,x. r(h_of r 〈i,x〉)) (S i))} +(* sg is (λx.h_of r 〈S i,x〉) *) +%{(λx. h_of r 〈S i,x〉)} +lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg +%[%[@condition_1 |@Hg] + |cases Hg #H1 * #j * #Hcodej #HCj + lapply (condition_2 … Hcodei) #Hcond2 (* @not_to_not *) + cases HCi #m * #a #Ha + %{m} %{(max (S i) a)} #n #ltin @not_le_to_lt @(not_to_not … Hcond2) -Hcond2 + #Hlesf %{n} % [@(transitive_le … ltin) @(le_maxl … (le_n …))] + cases (Ha n ?) [2: @(transitive_le … ltin) @(le_maxr … (le_n …))] + #y #Uy %{y} @(monotonic_U … Uy) @(transitive_le … Hlesf) + @Hmono @(mono_h_of2 … Hr Hmono … ltin) + ] +qed. + diff --git a/matita/matita/lib/reverse_complexity/toolkit.ma b/matita/matita/lib/reverse_complexity/toolkit.ma index 11f988c79..16f079f48 100644 --- a/matita/matita/lib/reverse_complexity/toolkit.ma +++ b/matita/matita/lib/reverse_complexity/toolkit.ma @@ -5,7 +5,7 @@ include "arithmetics/sigma_pi.ma". include "arithmetics/bounded_quantifiers.ma". include "reverse_complexity/big_O.ma". -(************************* notation for minimization *****************************) +(************************* notation for minimization **************************) notation "μ_{ ident i < n } p" with precedence 80 for @{min $n 0 (λ${ident i}.$p)}. @@ -101,6 +101,10 @@ axiom le_fst : ∀p. fst p ≤ p. axiom le_snd : ∀p. snd p ≤ p. axiom le_pair: ∀a,a1,b,b1. a ≤ a1 → b ≤ b1 → 〈a,b〉 ≤ 〈a1,b1〉. +lemma expand_pair: ∀x. x = 〈fst x, snd x〉. +#x lapply (surj_pair x) * #a * #b #Hx >Hx >fst_pair >snd_pair // +qed. + (************************************* U **************************************) axiom U: nat → nat →nat → option nat. @@ -149,7 +153,7 @@ definition out ≝ λi,x,r. definition bool_to_nat: bool → nat ≝ λb. match b with [true ⇒ 1 | false ⇒ 0]. - + coercion bool_to_nat. definition pU : nat → nat → nat → nat ≝ λi,x,r.〈termb i x r,out i x r〉. @@ -181,124 +185,8 @@ lemma snd_pU: ∀i,x,r. snd (pU i x r) = out i x r. #i #x #r normalize cases (U i x r) normalize >snd_pair // qed. -(********************************* the speedup ********************************) - -definition min_input ≝ λh,i,x. μ_{y ∈ [S i,x] } (termb i y (h (S i) y)). - -lemma min_input_def : ∀h,i,x. - min_input h i x = min (x -i) (S i) (λy.termb i y (h (S i) y)). -// qed. - -lemma min_input_i: ∀h,i,x. x ≤ i → min_input h i x = S i. -#h #i #x #lexi >min_input_def -cut (x - i = 0) [@sym_eq /2 by eq_minus_O/] #Hcut // -qed. -lemma min_input_to_terminate: ∀h,i,x. - min_input h i x = x → {i ⊙ x} ↓ (h (S i) x). -#h #i #x #Hminx -cases (decidable_le (S i) x) #Hix - [cases (true_or_false (termb i x (h (S i) x))) #Hcase - [@termb_true_to_term // - |min_input_def in Hminx; #Hminx >Hminx in ⊢ (%→?); - min_input_i in Hminx; - [#eqix >eqix in Hix; * /2/ | @le_S_S_to_le @not_le_to_lt //] - ] -qed. - -lemma min_input_to_lt: ∀h,i,x. - min_input h i x = x → i < x. -#h #i #x #Hminx cases (decidable_le (S i) x) // -#ltxi @False_ind >min_input_i in Hminx; - [#eqix >eqix in ltxi; * /2/ | @le_S_S_to_le @not_le_to_lt //] -qed. - -lemma le_to_min_input: ∀h,i,x,x1. x ≤ x1 → - min_input h i x = x → min_input h i x1 = x. -#h #i #x #x1 #lex #Hminx @(min_exists … (le_S_S … lex)) - [@(fmin_true … (sym_eq … Hminx)) // - |@(min_input_to_lt … Hminx) - |#j #H1 g_def cut (x-u = 0) [/2 by minus_le_minus_minus_comm/] -#eq0 >eq0 normalize // qed. - -lemma g_lt : ∀h,i,x. min_input h i x = x → - out i x (h (S i) x) < g h 0 x. -#h #i #x #H @le_S_S @(le_MaxI … i) /2 by min_input_to_lt/ -qed. - -lemma max_neq0 : ∀a,b. max a b ≠ 0 → a ≠ 0 ∨ b ≠ 0. -#a #b whd in match (max a b); cases (true_or_false (leb a b)) #Hcase >Hcase - [#H %2 @H | #H %1 @H] -qed. - -definition almost_equal ≝ λf,g:nat → nat. ¬ ∀nu.∃x. nu < x ∧ f x ≠ g x. -interpretation "almost equal" 'napart f g = (almost_equal f g). - -lemma eventually_cancelled: ∀h,u.¬∀nu.∃x. nu < x ∧ - max_{i ∈ [0,u[ | eqb (min_input h i x) x} (out i x (h (S i) x)) ≠ 0. -#h #u elim u - [normalize % #H cases (H u) #x * #_ * #H1 @H1 // - |#u0 @not_to_not #Hind #nu cases (Hind nu) #x * #ltx - cases (true_or_false (eqb (min_input h (u0+O) x) x)) #Hcase - [>bigop_Strue [2:@Hcase] #Hmax cases (max_neq0 … Hmax) -Hmax - [2: #H %{x} % // bigop_Sfalse - [#H %{x1} % [@transitive_lt //| (le_to_min_input … (eqb_true_to_eq … Hcase)) - [@lt_to_not_eq @ltx1 | @lt_to_le @ltx1] - ] - |>bigop_Sfalse [2:@Hcase] #H %{x} % // (bigop_sumI 0 u x (λi:ℕ.eqb (min_input h i x) x) nat 0 MaxA) - [>H // |@lt_to_le @(le_to_lt_to_lt …ltx) /2 by le_maxr/ |//] -qed. - -(******************************** Condition 2 *********************************) definition total ≝ λf.λx:nat. Some nat (f x). - -lemma exists_to_exists_min: ∀h,i. (∃x. i < x ∧ {i ⊙ x} ↓ h (S i) x) → ∃y. min_input h i y = y. -#h #i * #x * #ltix #Hx %{(min_input h i x)} @min_spec_to_min @found // - [@(f_min_true (λy:ℕ.termb i y (h (S i) y))) %{x} % [% // | @term_to_termb_true //] - |#y #leiy #lty @(lt_min_to_false ????? lty) // - ] -qed. - -lemma condition_2: ∀h,i. code_for (total (g h 0)) i → ¬∃x. itermy >Hr -#H @(absurd ? H) @le_to_not_lt @le_n -qed. (********************************* complexity *********************************) @@ -326,6 +214,11 @@ lemma ext_CF : ∀f,g,s. (∀n. f n = g n) → CF s f → CF s g. [#x cases (Hcode x) #a #H %{a} whd in match (total ??); Hext @H | //] +qed. + lemma monotonic_CF: ∀s1,s2,f.(∀x. s1 x ≤ s2 x) → CF s1 f → CF s2 f. #s1 #s2 #f #H * #HO * #i * #Hcode #Hs1 % [cases HO #c * #a -HO #HO %{c} %{a} #n #lean @(transitive_le … (HO n lean)) @@ -361,6 +254,34 @@ qed. (* primitve recursion *) +(* no arguments *) + +let rec prim_rec0 (k:nat) (h:nat →nat) n on n ≝ + match n with + [ O ⇒ k + | S a ⇒ h 〈a, prim_rec0 k h a〉]. + +lemma prim_rec0_S: ∀k,h,n. + prim_rec0 k h (S n) = h 〈n, prim_rec0 k h n〉. +// qed. + +let rec prim_rec0_compl (k,sk:nat) (h,sh:nat →nat) n on n ≝ + match n with + [ O ⇒ sk + | S a ⇒ prim_rec0_compl k sk h sh a + sh (prim_rec0 k h a)]. + +axiom CF_prim_rec0_gen: ∀k,h,sk,sh,sh1,sf. CF sh h → + O sh1 (λx.snd x + sh 〈fst x,prim_rec0 k h (fst x)〉) → + O sf (prim_rec0 sk sh1) → + CF sf (prim_rec0 k h). + +lemma CF_prim_rec0: ∀k,h,sk,sh,sf. CF sh h → + O sf (prim_rec0 sk (λx. snd x + sh 〈fst x,prim_rec0 k h (fst x)〉)) + → CF sf (prim_rec0 k h). +#k #h #sk #sh #sf #Hh #HO @(CF_prim_rec0_gen … Hh … HO) @O_refl +qed. + +(* with argument(s) m *) let rec prim_rec (k,h:nat →nat) n m on n ≝ match n with [ O ⇒ k m @@ -370,28 +291,42 @@ lemma prim_rec_S: ∀k,h,n,m. prim_rec k h (S n) m = h 〈n,〈prim_rec k h n m, m〉〉. // qed. +lemma prim_rec_le: ∀k1,k2,h1,h2. (∀x.k1 x ≤ k2 x) → +(∀x,y.x ≤y → h1 x ≤ h2 y) → + ∀x,m. prim_rec k1 h1 x m ≤ prim_rec k2 h2 x m. +#k1 #k2 #h1 #h2 #lek #leh #x #m elim x // +#n #Hind normalize @leh @le_pair // @le_pair // +qed. + definition unary_pr ≝ λk,h,x. prim_rec k h (fst x) (snd x). +lemma prim_rec_unary: ∀k,h,a,b. + prim_rec k h a b = unary_pr k h 〈a,b〉. +#k #h #a #b normalize >fst_pair >snd_pair // +qed. + + let rec prim_rec_compl (k,h,sk,sh:nat →nat) n m on n ≝ match n with [ O ⇒ sk m | S a ⇒ prim_rec_compl k h sk sh a m + sh (prim_rec k h a m)]. - -axiom CF_prim_rec: ∀k,h,sk,sh,sf. CF sk k → CF sh h → - O sf (unary_pr sk (λx. fst (snd x) + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉)) - → CF sf (unary_pr k h). -(* falso ???? -lemma prim_rec_O: ∀k1,h1,k2,h2. O k1 k2 → O h1 h2 → - O (unary_pr k1 h1) (unary_pr k2 h2). -#k1 #h1 #k2 #h2 #HO1 #HO2 whd *) +axiom CF_prim_rec_gen: ∀k,h,sk,sh,sh1. CF sk k → CF sh h → + O sh1 (λx. fst (snd x) + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉) → + CF (unary_pr sk sh1) (unary_pr k h). +lemma CF_prim_rec: ∀k,h,sk,sh,sf. CF sk k → CF sh h → + O sf (unary_pr sk (λx. fst (snd x) + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉)) + → CF sf (unary_pr k h). +#k #h #sk #sh #sf #Hk #Hh #Osf @(O_to_CF … Osf) @(CF_prim_rec_gen … Hk Hh) @O_refl +qed. (**************************** primitive operations*****************************) definition id ≝ λx:nat.x. axiom CF_id: CF MSC id. +axiom CF_const: ∀k.CF MSC (λx.k). axiom CF_compS: ∀h,f. CF h f → CF h (S ∘ f). axiom CF_comp_fst: ∀h,f. CF h f → CF h (fst ∘ f). axiom CF_comp_snd: ∀h,f. CF h f → CF h (snd ∘ f). @@ -403,7 +338,7 @@ qed. lemma CF_snd: CF MSC snd. @(ext_CF (snd ∘ id)) [#n //] @(CF_comp_snd … CF_id) -qed. +qed. (************************************** eqb ***********************************) @@ -412,17 +347,771 @@ axiom CF_eqb: ∀h,f,g. (*********************************** maximum **********************************) +alias symbol "pair" (instance 13) = "abstract pair". +alias symbol "pair" (instance 12) = "abstract pair". +alias symbol "and" (instance 11) = "boolean and". +alias symbol "plus" (instance 8) = "natural plus". +alias symbol "pair" (instance 7) = "abstract pair". +alias symbol "plus" (instance 6) = "natural plus". +alias symbol "pair" (instance 5) = "abstract pair". +alias id "max" = "cic:/matita/arithmetics/nat/max#def:2". +alias symbol "minus" (instance 3) = "natural minus". +lemma max_gen: ∀a,b,p,f,x. a ≤b → + max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) = max_{i < b | leb a i ∧ p 〈i,x〉 }(f 〈i,x〉). +#a #b #p #f #x @(bigop_I_gen ????? MaxA) +qed. + +lemma max_prim_rec_base: ∀a,b,p,f,x. a ≤b → + max_{i < b| p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x. +#a #b #p #f #x #leab >max_gen // elim b + [normalize // + |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma max_prim_rec: ∀a,b,p,f,x. a ≤b → + max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if leb a (fst i) ∧ p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x. +#a #b #p #f #x #leab >max_gen // elim b + [normalize // + |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair + cases (true_or_false (leb a i ∧ p 〈i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *) +alias symbol "pair" (instance 15) = "abstract pair". +alias symbol "minus" (instance 14) = "natural minus". +alias symbol "plus" (instance 11) = "natural plus". +alias symbol "pair" (instance 10) = "abstract pair". +alias symbol "plus" (instance 13) = "natural plus". +alias symbol "pair" (instance 12) = "abstract pair". +alias symbol "plus" (instance 8) = "natural plus". +alias symbol "pair" (instance 7) = "abstract pair". +alias symbol "plus" (instance 6) = "natural plus". +alias symbol "pair" (instance 5) = "abstract pair". +alias id "max" = "cic:/matita/arithmetics/nat/max#def:2". +alias symbol "minus" (instance 3) = "natural minus". +lemma max_prim_rec1: ∀a,b,p,f,x. + max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + then max (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (b x-a x) 〈a x ,x〉. +#a #b #p #f #x elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma sum_prim_rec1: ∀a,b,p,f,x. + ∑_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + then plus (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (b x-a x) 〈a x ,x〉. +#a #b #p #f #x elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *) +alias symbol "pair" (instance 15) = "abstract pair". +alias symbol "minus" (instance 14) = "natural minus". +alias symbol "plus" (instance 11) = "natural plus". +alias symbol "pair" (instance 10) = "abstract pair". +alias symbol "plus" (instance 13) = "natural plus". +alias symbol "pair" (instance 12) = "abstract pair". +alias symbol "plus" (instance 8) = "natural plus". +alias symbol "pair" (instance 7) = "abstract pair". +alias symbol "pair" (instance 6) = "abstract pair". +alias symbol "plus" (instance 4) = "natural plus". +alias symbol "pair" (instance 3) = "abstract pair". +alias symbol "minus" (instance 2) = "natural minus". +lemma bigop_prim_rec: ∀a,b,c,p,f,x. + bigop (b x-a x) (λi:ℕ.p 〈i+a x,x〉) ? (c 〈a x,x〉) plus (λi:ℕ.f 〈i+a x,x〉) = + prim_rec c + (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + then plus (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (b x-a x) 〈a x ,x〉. +#a #b #c #p #f #x normalize elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *) +alias symbol "pair" (instance 15) = "abstract pair". +alias symbol "minus" (instance 14) = "natural minus". +alias symbol "minus" (instance 11) = "natural minus". +alias symbol "pair" (instance 10) = "abstract pair". +alias symbol "minus" (instance 13) = "natural minus". +alias symbol "pair" (instance 12) = "abstract pair". +alias symbol "minus" (instance 8) = "natural minus". +alias symbol "pair" (instance 7) = "abstract pair". +alias symbol "pair" (instance 6) = "abstract pair". +alias symbol "minus" (instance 4) = "natural minus". +alias symbol "pair" (instance 3) = "abstract pair". +alias symbol "minus" (instance 2) = "natural minus". +lemma bigop_prim_rec_dec: ∀a,b,c,p,f,x. + bigop (b x-a x) (λi:ℕ.p 〈b x -i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x-i,x〉) = + prim_rec c + (λi.if p 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉 + then plus (f 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (b x-a x) 〈b x ,x〉. +#a #b #c #p #f #x normalize elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +lemma bigop_prim_rec_dec1: ∀a,b,c,p,f,x. + bigop (S(b x)-a x) (λi:ℕ.p 〈b x - i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x- i,x〉) = + prim_rec c + (λi.if p 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉 + then plus (f 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉) (fst (snd i)) + else fst (snd i)) (S(b x)-a x) 〈b x,x〉. +#a #b #c #p #f #x elim (S(b x)-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase + [bigop_Strue // |bigop_Sfalse // ] + ] +qed. + +(* +lemma bigop_aux_1: ∀k,c,f. + bigop (S k) (λi:ℕ.true) ? c plus (λi:ℕ.f i) = + f 0 + bigop k (λi:ℕ.true) ? c plus (λi:ℕ.f (S i)). +#k #c #f elim k [normalize //] #i #Hind >bigop_Strue // + +lemma bigop_prim_rec_dec: ∀a,b,c,f,x. + bigop (b x-a x) (λi:ℕ.true) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈i+a x,x〉) = + prim_rec c + (λi. plus (f 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉) (fst (snd i))) + (b x-a x) 〈b x ,x〉. +#a #b #c #f #x normalize elim (b x-a x) + [normalize // + |#i #Hind >prim_rec_S + >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair + bigop_Strue // |bigop_Sfalse // ] + ] +qed. *) + +lemma bigop_plus_c: ∀k,p,f,c. + c k + bigop k (λi.p i) ? 0 plus (λi.f i) = + bigop k (λi.p i) ? (c k) plus (λi.f i). +#k #p #f elim k [normalize //] +#i #Hind #c cases (true_or_false (p i)) #Hcase +[>bigop_Strue // >bigop_Strue // (commutative_plus ? (f i)) + >associative_plus @eq_f @Hind +|>bigop_Sfalse // >bigop_Sfalse // +] +qed. + +(* the argument is 〈b-a,〈a,x〉〉 *) + +(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *) +alias symbol "plus" (instance 3) = "natural plus". +alias symbol "pair" (instance 2) = "abstract pair". +alias id "max" = "cic:/matita/arithmetics/nat/max#def:2". +alias symbol "plus" (instance 5) = "natural plus". +alias symbol "pair" (instance 4) = "abstract pair". +definition max_unary_pr ≝ λp,f.unary_pr (λx.0) + (λi. + let k ≝ fst i in + let r ≝ fst (snd i) in + let a ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + if p 〈k + a,x〉 then max (f 〈k+a,x〉) r else r). + +lemma max_unary_pr1: ∀a,b,p,f,x. + max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) = + ((max_unary_pr p f) ∘ (λx.〈b x - a x,〈a x,x〉〉)) x. +#a #b #p #f #x normalize >fst_pair >snd_pair @max_prim_rec1 +qed. + +(* +lemma max_unary_pr: ∀a,b,p,f,x. + max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) = + prim_rec (λi.0) + (λi.if p 〈fst i +a,x〉 then max (f 〈fst i +a ,snd (snd i)〉) (fst (snd i)) else fst (snd i)) (b-a) x. +*) + +(* +definition unary_compl ≝ λp,f,hf. + unary_pr MSC + (λx:ℕ + .fst (snd x) + +hf + 〈fst x, + 〈unary_pr (λx0:ℕ.O) + (λi:ℕ + .(let (k:ℕ) ≝fst i in  + let (r:ℕ) ≝fst (snd i) in  + let (a:ℕ) ≝fst (snd (snd i)) in  + let (x:ℕ) ≝snd (snd (snd i)) in  + if p 〈k+a,x〉 then max (f 〈k+a,x〉) r else r )) 〈fst x,snd (snd x)〉, + snd (snd x)〉〉). *) + +(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *) +alias symbol "plus" (instance 6) = "natural plus". +alias symbol "pair" (instance 5) = "abstract pair". +alias symbol "plus" (instance 4) = "natural plus". +alias symbol "pair" (instance 3) = "abstract pair". +alias symbol "plus" (instance 2) = "natural plus". +alias symbol "plus" (instance 1) = "natural plus". +definition aux_compl ≝ λhp,hf.λi. + let k ≝ fst i in  + let r ≝ fst (snd i) in  + let a ≝ fst (snd (snd i)) in  + let x ≝ snd (snd (snd i)) in  + hp 〈k+a,x〉 + hf 〈k+a,x〉 + (* was MSC r*) MSC i . + +definition aux_compl1 ≝ λhp,hf.λi. + let k ≝ fst i in  + let r ≝ fst (snd i) in  + let a ≝ fst (snd (snd i)) in  + let x ≝ snd (snd (snd i)) in  + hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r. + +lemma aux_compl1_def: ∀k,r,m,hp,hf. + aux_compl1 hp hf 〈k,〈r,m〉〉 = + let a ≝ fst m in  + let x ≝ snd m in  + hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r. +#k #r #m #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair // +qed. + +lemma aux_compl1_def1: ∀k,r,a,x,hp,hf. + aux_compl1 hp hf 〈k,〈r,〈a,x〉〉〉 = hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r. +#k #r #a #x #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair +>fst_pair >snd_pair // +qed. + + +axiom Oaux_compl: ∀hp,hf. O (aux_compl1 hp hf) (aux_compl hp hf). + +(* +definition IF ≝ λb,f,g:nat →option nat. λx. + match b x with + [None ⇒ None ? + |Some n ⇒ if (eqb n 0) then f x else g x]. +*) + +axiom CF_if: ∀b:nat → bool. ∀f,g,s. CF s b → CF s f → CF s g → + CF s (λx. if b x then f x else g x). + +(* +lemma IF_CF: ∀b,f,g,sb,sf,sg. CF sb b → CF sf f → CF sg g → + CF (λn. sb n + sf n + sg n) (IF b f g). +#b #f #g #sb #sf #sg #Hb #Hf #Hg @IF_CF_new + [@(monotonic_CF … Hb) @O_plus_l @O_plus_l // + |@(monotonic_CF … Hf) @O_plus_l @O_plus_r // + |@(monotonic_CF … Hg) @O_plus_r // + ] +qed. +*) + +axiom CF_le: ∀h,f,g. CF h f → CF h g → CF h (λx. leb (f x) (g x)). +axiom CF_max1: ∀h,f,g. CF h f → CF h g → CF h (λx. max (f x) (g x)). +axiom CF_plus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x + g x). +axiom CF_minus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x - g x). + +axiom MSC_prop: ∀f,h. CF h f → ∀x. MSC (f x) ≤ h x. + +lemma MSC_max: ∀f,h,x. CF h f → MSC (max_{i < x}(f i)) ≤ max_{i < x}(h i). +#f #h #x #hf elim x // #i #Hind >bigop_Strue [|//] >bigop_Strue [|//] +whd in match (max ??); +cases (true_or_false (leb (f i) (bigop i (λi0:ℕ.true) ? 0 max(λi0:ℕ.f i0)))) +#Hcase >Hcase + [@(transitive_le … Hind) @le_maxr // + |@(transitive_le … (MSC_prop … hf i)) @le_maxl // + ] +qed. + +lemma CF_max: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s. + CF ha a → CF hb b → CF hp p → CF hf f → + O s (λx.ha x + hb x + + (∑_{i ∈[a x ,b x[ } + (hp 〈i,x〉 + hf 〈i,x〉 + max_{i ∈ [a x, b x [ }(hf 〈i,x〉)))) → + CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)). +#a #b #p #f #ha #hb #hp #hf #s #CFa #CFb #CFp #CFf #HO +@ext_CF1 [|#x @max_unary_pr1] +@(CF_comp ??? (λx.ha x + hb x)) + [|@CF_comp_pair + [@CF_minus [@(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //] + |@CF_comp_pair + [@(O_to_CF … CFa) @O_plus_l // + | @(O_to_CF … CF_id) @O_plus_r @(proj1 … CFb) + ] + ] + |@(CF_prim_rec … MSC … (aux_compl1 hp hf)) + [@CF_const + |@(O_to_CF … (Oaux_compl … )) + @CF_if + [@(CF_comp p … MSC … CFp) + [@CF_comp_pair + [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd] + |@CF_comp_snd @CF_comp_snd @CF_snd] + |@le_to_O #x normalize >commutative_plus >associative_plus @le_plus // + ] + |@CF_max1 + [@(CF_comp f … MSC … CFf) + [@CF_comp_pair + [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd] + |@CF_comp_snd @CF_comp_snd @CF_snd] + |@le_to_O #x normalize >commutative_plus // + ] + |@CF_comp_fst @(monotonic_CF … CF_snd) normalize // + ] + |@CF_comp_fst @(monotonic_CF … CF_snd) normalize // + ] + |@O_refl + ] + |@(O_trans … HO) -HO + @(O_trans ? (λx:ℕ + .ha x+hb x + +bigop (b x-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus + (λi:ℕ + .(λi0:ℕ + .hp 〈i0,x〉+hf 〈i0,x〉 + +bigop (b x-a x) (λi1:ℕ.true) ? 0 max + (λi1:ℕ.(λi2:ℕ.hf 〈i2,x〉) (i1+a x))) (i+a x)))) + [ + @le_to_O #n @le_plus // whd in match (unary_pr ???); + >fst_pair >snd_pair >bigop_prim_rec elim (b n - a n) + [normalize // + |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >aux_compl1_def1 + >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair + >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus + [-Hind @le_plus // normalize >fst_pair >snd_pair + @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 ) + (λi1:ℕ.hf 〈i1+a n,n〉))) + [elim x [normalize @MSC_le] + #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair + >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize + [cases (true_or_false (leb (f 〈x0+a n,n〉) + (prim_rec (λx00:ℕ.O) + (λi:ℕ + .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉  + then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉) + (fst (snd i))  + then fst (snd i)  + else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉   + else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize + [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + |@(transitive_le … (MSC_prop … CFf …)) @(le_maxl … (le_n …)) + ] + |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + ] + |@(le_maxr … (le_n …)) + ] + |@(transitive_le … Hind) -Hind + generalize in match (bigop x (λi:ℕ.true) ? 0 max + (λi1:ℕ.(λi2:ℕ.hf 〈i2,n〉) (i1+a n))); #c + generalize in match (hf 〈x+a n,n〉); #c1 + elim x [//] #x0 #Hind + >prim_rec_S >prim_rec_S normalize >fst_pair >fst_pair >snd_pair + >snd_pair >snd_pair >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair + >fst_pair @le_plus + [@le_plus // cases (true_or_false (leb c1 c)) #Hcase + >Hcase normalize // @lt_to_le @not_le_to_lt @(leb_false_to_not_le ?? Hcase) + |@Hind + ] + ] + ] + |@O_plus [@O_plus_l //] @le_to_O #x + Hind +cases (true_or_false (eqb a (a+i))) #Hcase >Hcase normalize // +<(eqb_true_to_eq … Hcase) >H // +qed. + +lemma my_minim_nfa : ∀a,f,x,k. f〈a,x〉 = false → +my_minim a f x (S k) = my_minim (S a) f x k. +#a #f #x #k #H elim k + [normalize H >eq_to_eqb_true // + |#i #Hind >my_minim_S >Hind >my_minim_S Hcase + [>(my_minim_fa … Hcase) // | >Hind @sym_eq @(my_minim_nfa … Hcase) ] +qed. + +(* cambiare qui: togliere S *) + +(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *) +alias symbol "minus" (instance 1) = "natural minus". +alias symbol "minus" (instance 3) = "natural minus". +alias symbol "pair" (instance 2) = "abstract pair". +definition minim_unary_pr ≝ λf.unary_pr (λx.S(fst x)) + (λi. + let k ≝ fst i in + let r ≝ fst (snd i) in + let b ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + if f 〈b-k,x〉 then b-k else r). + +definition compl_minim_unary ≝ λhf:nat → nat.λi. + let k ≝ fst i in + let b ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉. + +definition compl_minim_unary_aux ≝ λhf,i. + let k ≝ fst i in + let r ≝ fst (snd i) in + let b ≝ fst (snd (snd i)) in + let x ≝ snd (snd (snd i)) in + hf 〈b-k,x〉 + MSC i. + +lemma compl_minim_unary_aux_def : ∀hf,k,r,b,x. + compl_minim_unary_aux hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈r,〈b,x〉〉〉. +#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair // +qed. + +lemma compl_minim_unary_def : ∀hf,k,r,b,x. + compl_minim_unary hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉. +#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair // +qed. + +lemma compl_minim_unary_aux_def2 : ∀hf,k,r,x. + compl_minim_unary_aux hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈r,x〉〉. +#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair // +qed. + +lemma compl_minim_unary_def2 : ∀hf,k,r,x. + compl_minim_unary hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈S(fst x),snd x〉〉. +#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair // +qed. + +lemma min_aux: ∀a,f,x,k. min (S k) (a x) (λi:ℕ.f 〈i,x〉) = + ((minim_unary_pr f) ∘ (λx.〈S k,〈a x + k,x〉〉)) x. +#a #f #x #k whd in ⊢ (???%); >fst_pair >snd_pair +lapply a -a (* @max_prim_rec1 *) +elim k + [normalize #a >fst_pair >snd_pair >fst_pair >snd_pair >snd_pair >fst_pair + fst_pair // + |#i #Hind #a normalize in ⊢ (??%?); >prim_rec_S >fst_pair >snd_pair + >fst_pair >snd_pair >snd_pair >fst_pair minus_S_S <(minus_plus_m_m (a x) i) // +qed. + +lemma minim_unary_pr1: ∀a,b,f,x. + μ_{i ∈[a x,b x]}(f 〈i,x〉) = + if leb (a x) (b x) then ((minim_unary_pr f) ∘ (λx.〈S (b x) - a x,〈b x,x〉〉)) x + else (a x). +#a #b #f #x cases (true_or_false (leb (a x) (b x))) #Hcase >Hcase + [cut (b x = a x + (b x - a x)) + [>commutative_plus minus_Sn_m [|@leb_true_to_le //] + >min_aux whd in ⊢ (??%?); eq_minus_O // @not_le_to_lt @leb_false_to_not_le // + ] +qed. + +axiom sum_inv: ∀a,b,f.∑_{i ∈ [a,S b[ }(f i) = ∑_{i ∈ [a,S b[ }(f (a + b - i)). + +(* +#a #b #f @(bigop_iso … plusAC) whd %{(λi.b - a - i)} %{(λi.b - a -i)} % + [%[#i #lti #_ normalize @eq_f >commutative_plus commutative_plus // + ] + |@(O_to_CF … MSC) + [@le_to_O #x normalize // + |@CF_minus + [@CF_comp_fst @CF_comp_snd @CF_snd |@CF_fst] + ] + |@CF_comp_fst @(monotonic_CF … CF_snd) normalize // + ] + |@O_plus + [@O_plus_l @O_refl + |@O_plus_r @O_ext2 [||#x >compl_minim_unary_aux_def2 @refl] + @O_trans [||@le_to_O #x >compl_minim_unary_def2 @le_n] + @O_plus [@O_plus_l //] + @O_plus_r + @O_trans [|@le_to_O #x @MSC_pair] @O_plus + [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_fst …)) + >fst_pair @le_n] + @O_trans [|@le_to_O #x @MSC_pair] @O_plus + [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …)) + >snd_pair @(transitive_le ???? (le_fst …)) >fst_pair + normalize >snd_pair >fst_pair lapply (surj_pair x) + * #x1 * #x2 #Hx >Hx >fst_pair >snd_pair elim x1 // + #i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair + cases (f ?) [@le_S // | //]] + @le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …)) >snd_pair + >(expand_pair (snd (snd x))) in ⊢ (?%?); @le_pair // + ] + ] + |cut (O s (λx.ha x + hb x + + ∑_{i ∈[a x ,S(b x)[ }(hf 〈a x+b x-i,x〉 + MSC 〈b x -(a x+b x-i),〈S(b x),x〉〉))) + [@(O_ext2 … HO) #x @eq_f @sum_inv] -HO #HO + @(O_trans … HO) -HO + @(O_trans ? (λx:ℕ.ha x+hb x + +bigop (S(b x)-a x) (λi:ℕ.true) ? + (MSC 〈b x,x〉) plus (λi:ℕ.(λj.hf j + MSC 〈b x - fst j,〈S(b (snd j)),snd j〉〉) 〈b x- i,x〉))) + [@le_to_O #n @le_plus // whd in match (unary_pr ???); + >fst_pair >snd_pair >(bigop_prim_rec_dec1 a b ? (λi.true)) + (* it is crucial to recall that the index is bound by S(b x) *) + cut (S (b n) - a n ≤ S (b n)) [//] + elim (S(b n) - a n) + [normalize // + |#x #Hind #lex >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair + >compl_minim_unary_def >prim_rec_S >fst_pair >snd_pair >fst_pair + >snd_pair >fst_pair >snd_pair >fst_pair whd in ⊢ (??%); >commutative_plus + @le_plus [2:@Hind @le_S @le_S_S_to_le @lex] -Hind >snd_pair + >minus_minus_associative // @le_S_S_to_le // + ] + |@O_plus [@O_plus_l //] @O_ext2 [||#x @bigop_plus_c] + @O_plus + [@O_plus_l @O_trans [|@le_to_O #x @MSC_pair] + @O_plus [@O_plus_r @le_to_O @(MSC_prop … CFb)|@O_plus_r @(proj1 … CFb)] + |@O_plus_r @(O_ext2 … (O_refl …)) #x @same_bigop + [//|#i #H #_ @eq_f2 [@eq_f @eq_f2 //|>fst_pair @eq_f @eq_f2 //] + ] + ] + ] + ] + |@(O_to_CF … CFa) @(O_trans … HO) @O_plus_l @O_plus_l @O_refl + ] +qed. + +(* +lemma CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s. CF sa a → CF sb b → CF sf f → O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉)) → CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)). +#a #b #f #ha #hb #hf #s #CFa #CFb #CFf #HO +@ext_CF1 [|#x @minim_unary_pr1] +@(CF_comp ??? (λx.ha x + hb x)) + [|@CF_comp_pair + [@CF_minus [@CF_compS @(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //] + |@CF_comp_pair + [@CF_max1 [@(O_to_CF … CFa) @O_plus_l // | @CF_compS @(O_to_CF … CFb) @O_plus_r //] + | @(O_to_CF … CF_id) @O_plus_r @(proj1 … CFb) + ] + ] + |@(CF_prim_rec … MSC … (compl_minim_unary_aux hf)) + [@CF_fst + |@CF_if + [@(CF_comp f … MSC … CFf) + [@CF_comp_pair + [@CF_minus [@CF_comp_fst @CF_comp_snd @CF_snd|@CF_compS @CF_fst] + |@CF_comp_snd @CF_comp_snd @CF_snd] + |@le_to_O #x normalize >commutative_plus // + ] + |@(O_to_CF … MSC) + [@le_to_O #x normalize // + |@CF_minus + [@CF_comp_fst @CF_comp_snd @CF_snd |@CF_compS @CF_fst] + ] + |@CF_comp_fst @(monotonic_CF … CF_snd) normalize // + ] + |@O_refl + ] + |@(O_trans … HO) -HO + @(O_trans ? (λx:ℕ + .ha x+hb x + +bigop (S(b x)-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus (λi:ℕ.hf 〈i+a x,x〉))) + [@le_to_O #n @le_plus // whd in match (unary_pr ???); + >fst_pair >snd_pair >(bigop_prim_rec ? (λn.S(b n)) ? (λi.true)) elim (S(b n) - a n) + [normalize @monotonic_MSC @le_pair + |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >compl_minim_unary_def + >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair + >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus + [-Hind @le_plus // normalize >fst_pair >snd_pair + @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 ) + (λi1:ℕ.hf 〈i1+a n,n〉))) + [elim x [normalize @MSC_le] + #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair + >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize + [cases (true_or_false (leb (f 〈x0+a n,n〉) + (prim_rec (λx00:ℕ.O) + (λi:ℕ + .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉  + then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉) + (fst (snd i))  + then fst (snd i)  + else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉   + else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize + [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + |@(transitive_le … (MSC_prop … CFf …)) @(le_maxl … (le_n …)) + ] + |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + ] + |@(le_maxr … (le_n …)) + ] + + + @(O_trans ? (λx:ℕ + .ha x+hb x + +bigop (b x-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus + (λi:ℕ + .(λi0:ℕ + .hp 〈i0,x〉+hf 〈i0,x〉 + +bigop (b x-a x) (λi1:ℕ.true) ? 0 max + (λi1:ℕ.(λi2:ℕ.hf 〈i2,x〉) (i1+a x))) (i+a x)))) + [ + @le_to_O #n @le_plus // whd in match (unary_pr ???); + >fst_pair >snd_pair >bigop_prim_rec elim (b n - a n) + [normalize // + |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >aux_compl1_def1 + >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair + >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus + [-Hind @le_plus // normalize >fst_pair >snd_pair + @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 ) + (λi1:ℕ.hf 〈i1+a n,n〉))) + [elim x [normalize @MSC_le] + #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair + >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize + [cases (true_or_false (leb (f 〈x0+a n,n〉) + (prim_rec (λx00:ℕ.O) + (λi:ℕ + .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉  + then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉) + (fst (snd i))  + then fst (snd i)  + else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉   + else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize + [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + |@(transitive_le … (MSC_prop … CFf …)) @(le_maxl … (le_n …)) + ] + |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …)) + ] + |@(le_maxr … (le_n …)) + ] + |@(transitive_le … Hind) -Hind + generalize in match (bigop x (λi:ℕ.true) ? 0 max + (λi1:ℕ.(λi2:ℕ.hf 〈i2,n〉) (i1+a n))); #c + generalize in match (hf 〈x+a n,n〉); #c1 + elim x [//] #x0 #Hind + >prim_rec_S >prim_rec_S normalize >fst_pair >fst_pair >snd_pair + >snd_pair >snd_pair >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair + >fst_pair @le_plus + [@le_plus // cases (true_or_false (leb c1 c)) #Hcase + >Hcase normalize // @lt_to_le @not_le_to_lt @(leb_false_to_not_le ?? Hcase) + |@Hind + ] + ] + ] + |@O_plus [@O_plus_l //] @le_to_O #x + (minus_to_0 … (lt_to_le … )) [// | @not_le_to_lt @Hlt] ] -qed. +qed.*) definition out_aux ≝ λh. out_unary ∘ λp.〈fst p,〈snd(snd p),h (S (fst p)) (snd (snd p))〉〉. @@ -738,7 +1427,7 @@ lemma compl_g8: ∀h. ] qed. -lemma compl_g9 : ∀h. +(*lemma compl_g9 : ∀h. constructible (λx. h (fst x) (snd x)) → (∀n. monotonic ? le (h n)) → (∀n,a,b. a ≤ b → b ≤ n → h b n ≤ h a n) → @@ -769,7 +1458,7 @@ lemma compl_g9 : ∀h. >associative_plus >distributive_times_plus @le_plus [@le_times [@le_S // |>big_def >Hmax //] |//] ] -qed. +qed.*) definition sg ≝ λh,x. (S (snd x-fst x))*MSC 〈x,x〉 + (snd x-fst x)*(S(snd x-fst x))*sU 〈x,〈snd x,h (S (fst x)) (snd x)〉〉. @@ -780,13 +1469,13 @@ lemma sg_def : ∀h,a,b. #h #a #b whd in ⊢ (??%?); >fst_pair >snd_pair // qed. -lemma compl_g11 : ∀h. +(*lemma compl_g11 : ∀h. constructible (λx. h (fst x) (snd x)) → (∀n. monotonic ? le (h n)) → (∀n,a,b. a ≤ b → b ≤ n → h b n ≤ h a n) → CF (sg h) (unary_g h). #h #hconstr #Hm #Ham @compl_g1 @(compl_g9 h hconstr Hm Ham) -qed. +qed.*) (**************************** closing the argument ****************************) @@ -819,6 +1508,7 @@ lemma h_of_aux_prim_rec : ∀r,c,n,b. h_of_aux r c n b = ] qed. +(* lemma h_of_aux_constr : ∀r,c. constructible (λx.h_of_aux r c (fst x) (snd x)). #r #c @@ -829,7 +1519,7 @@ lemma h_of_aux_constr : (S d)*(MSC 〈〈b-d,b〉,〈b-d,b〉〉) + d*(S d)*sU 〈〈b-d,b〉,〈b,r (fst (snd x))〉〉))) [#n @sym_eq whd in match (unary_pr ???); @h_of_aux_prim_rec - |@constr_prim_rec + |@constr_prim_rec*) definition h_of ≝ λr,p. let m ≝ max (fst p) (snd p) in @@ -882,7 +1572,7 @@ axiom h_of_constr : ∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r → constructible (h_of r). -lemma speed_compl: ∀r:nat →nat. +(*lemma speed_compl: ∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r → CF (h_of r) (unary_g (λi,x. r(h_of r 〈i,x〉))). #r #Hr #Hmono #Hconstr @(monotonic_CF … (compl_g11 …)) @@ -932,10 +1622,10 @@ lemma speed_compl_i: ∀r:nat →nat. @(ext_CF (λx.unary_g (λi,x. r(h_of r 〈i,x〉)) 〈i,x〉)) [#n whd in ⊢ (??%%); @eq_f @sym_eq >fst_pair >snd_pair %] @smn @(ext_CF … (speed_compl r Hr Hmono Hconstr)) #n // -qed. +qed.*) (**************************** the speedup theorem *****************************) -theorem pseudo_speedup: +(*theorem pseudo_speedup: ∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r → ∃f.∀sf. CF sf f → ∃g,sg. f ≈ g ∧ CF sg g ∧ O sf (r ∘ sg). (* ∃m,a.∀n. a≤n → r(sg a) < m * sf n. *) @@ -983,5 +1673,5 @@ lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg #y #Uy %{y} @(monotonic_U … Uy) @(transitive_le … Hlesf) @Hmono @(mono_h_of2 … Hr Hmono … ltin) ] -qed. +qed.*) \ No newline at end of file diff --git a/matita/matita/lib/turing/multi_to_mono/multi_to_mono.ma b/matita/matita/lib/turing/multi_to_mono/multi_to_mono.ma deleted file mode 100644 index 0e9bce53e..000000000 --- a/matita/matita/lib/turing/multi_to_mono/multi_to_mono.ma +++ /dev/null @@ -1,397 +0,0 @@ -include "turing/auxiliary_machines1.ma". -include "turing/multi_to_mono/shift_trace_machines.ma". - -(******************************************************************************) -(* mtiL: complete move L for tape i. We reaching the left border of trace i, *) -(* add a blank if there is no more tape, then move the i-trace and finally *) -(* come back to the head position. *) -(******************************************************************************) - -(* we say that a tape is regular if for any trace after the first blank we - only have other blanks *) - -definition all_blanks_in ≝ λsig,l. - ∀x. mem ? x l → x = blank sig. - -definition regular_i ≝ λsig,n.λl:list (multi_sig sig n).λi. - all_blanks_in ? (after_blank ? (trace sig n i l)). - -definition regular_trace ≝ λsig,n,a.λls,rs:list (multi_sig sig n).λi. - Or (And (regular_i sig n (a::ls) i) (regular_i sig n rs i)) - (And (regular_i sig n ls i) (regular_i sig n (a::rs) i)). - -axiom regular_tail: ∀sig,n,l,i. - regular_i sig n l i → regular_i sig n (tail ? l) i. - -axiom regular_extend: ∀sig,n,l,i. - regular_i sig n l i → regular_i sig n (l@[all_blank sig n]) i. - -axiom all_blank_after_blank: ∀sig,n,l1,b,l2,i. - nth i ? (vec … b) (blank ?) = blank ? → - regular_i sig n (l1@b::l2) i → all_blanks_in ? (trace sig n i l2). - -lemma regular_trace_extl: ∀sig,n,a,ls,rs,i. - regular_trace sig n a ls rs i → - regular_trace sig n a (ls@[all_blank sig n]) rs i. -#sig #n #a #ls #rs #i * - [* #H1 #H2 % % // @(regular_extend … H1) - |* #H1 #H2 %2 % // @(regular_extend … H1) - ] -qed. - -lemma regular_cons_hd_rs: ∀sig,n.∀a:multi_sig sig n.∀ls,rs1,rs2,i. - regular_trace sig n a ls (rs1@rs2) i → - regular_trace sig n a ls (rs1@((hd ? rs2 (all_blank …))::(tail ? rs2))) i. -#sig #n #a #ls #rs1 #rs2 #i cases rs2 [2: #b #tl #H @H] -*[* #H1 >append_nil #H2 %1 % - [@H1 | whd in match (hd ???); @(regular_extend … rs1) //] - |* #H1 >append_nil #H2 %2 % - [@H1 | whd in match (hd ???); @(regular_extend … (a::rs1)) //] - ] -qed. - -lemma eq_trace_to_regular : ∀sig,n.∀a1,a2:multi_sig sig n.∀ls1,ls2,rs1,rs2,i. - nth i ? (vec … a1) (blank ?) = nth i ? (vec … a2) (blank ?) → - trace sig n i ls1 = trace sig n i ls2 → - trace sig n i rs1 = trace sig n i rs2 → - regular_trace sig n a1 ls1 rs1 i → - regular_trace sig n a2 ls2 rs2 i. -#sig #n #a1 #a2 #ls1 #ls2 #rs1 #rs2 #i #H1 #H2 #H3 #H4 -whd in match (regular_trace ??????); whd in match (regular_i ????); -whd in match (regular_i ?? rs2 ?); whd in match (regular_i ?? ls2 ?); -whd in match (regular_i ?? (a2::rs2) ?); whd in match (trace ????); -(Ht1a Hcur) in Ht2a; /2 by / - |#ls #a #rs #Htin #Hreg #Hreg2 -Ht1a cases (Ht1b … Htin) - [* #Hnb #Ht1 -Ht1b -Ht2a >Ht1 in Ht2b; >Htin #H - %{a} %{[ ]} %{ls} - %[%[%[%[%[@Hreg|@Hreg2]|@Hnb]|//]|//]|@H normalize % #H1 destruct (H1)] - |* - [(* we find the blank *) - * #ls1 * #b * #ls2 * * * #H1 #H2 #H3 #Ht1 - >Ht1 in Ht2b; #Hout -Ht1b - %{b} %{(a::ls1)} %{ls2} - %[%[%[%[%[>H1 in Hreg; #H @H - |#j #jneqi whd in match (hd ???); whd in match (tail ??); -

H1 //] - |@Hout normalize % normalize #H destruct (H) - ] - |* #b * #lss * * #H1 #H2 #Ht1 -Ht1b >Ht1 in Ht2a; - whd in match (left ??); whd in match (right ??); #Hout - %{(all_blank …)} %{(lss@[b])} %{[]} - %[%[%[%[%[

blank_all_blank //] - |

reverse_append >reverse_single @Hout normalize // - ] - ] - ] -qed. - -(******************************************************************************) - -definition shift_i_L ≝ λsig,n,i. - ncombf_r (multi_sig …) (shift_i sig n i) (all_blank sig n) · - mti sig n i · - extend ? (all_blank sig n). - -definition R_shift_i_L ≝ λsig,n,i,t1,t2. - (∀a,ls,rs. - t1 = midtape ? ls a rs → - ((∃rs1,b,rs2,a1,rss. - rs = rs1@b::rs2 ∧ - nth i ? (vec … b) (blank ?) = (blank ?) ∧ - (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧ - shift_l sig n i (a::rs1) (a1::rss) ∧ - t2 = midtape (multi_sig sig n) ((reverse ? (a1::rss))@ls) b rs2) ∨ - (∃b,rss. - (∀x. mem ? x rs → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧ - shift_l sig n i (a::rs) (rss@[b]) ∧ - t2 = midtape (multi_sig sig n) - ((reverse ? (rss@[b]))@ls) (all_blank sig n) [ ]))). - -definition R_shift_i_L_new ≝ λsig,n,i,t1,t2. - (∀a,ls,rs. - t1 = midtape ? ls a rs → - ∃rs1,b,rs2,rss. - b = hd ? rs2 (all_blank sig n) ∧ - nth i ? (vec … b) (blank ?) = (blank ?) ∧ - rs = rs1@rs2 ∧ - (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧ - shift_l sig n i (a::rs1) rss ∧ - t2 = midtape (multi_sig sig n) ((reverse ? rss)@ls) b (tail ? rs2)). - -theorem sem_shift_i_L: ∀sig,n,i. shift_i_L sig n i ⊨ R_shift_i_L sig n i. -#sig #n #i -@(sem_seq_app ?????? - (sem_ncombf_r (multi_sig sig n) (shift_i sig n i)(all_blank sig n)) - (sem_seq ????? (ssem_mti sig n i) - (sem_extend ? (all_blank sig n)))) -#tin #tout * #t1 * * #Ht1a #Ht1b * #t2 * * #Ht2a #Ht2b * #Htout1 #Htout2 -#a #ls #rs cases rs - [#Htin %2 %{(shift_i sig n i a (all_blank sig n))} %{[ ]} - %[%[#x @False_ind | @daemon] - |lapply (Ht1a … Htin) -Ht1a -Ht1b #Ht1 - lapply (Ht2a … Ht1) -Ht2a -Ht2b #Ht2 >Ht2 in Htout1; - >Ht1 whd in match (left ??); whd in match (right ??); #Htout @Htout // - ] - |#a1 #rs1 #Htin - lapply (Ht1b … Htin) -Ht1a -Ht1b #Ht1 - lapply (Ht2b … Ht1) -Ht2a -Ht2b * - [(* a1 is blank *) * #H1 #H2 %1 - %{[ ]} %{a1} %{rs1} %{(shift_i sig n i a a1)} %{[ ]} - %[%[%[%[// |//] |#x @False_ind] | @daemon] - |>Htout2 [>H2 >reverse_single @Ht1 |>H2 >Ht1 normalize % #H destruct (H)] - ] - |* - [* #rs10 * #b * #rs2 * #rss * * * * #H1 #H2 #H3 #H4 - #Ht2 %1 - %{(a1::rs10)} %{b} %{rs2} %{(shift_i sig n i a a1)} %{rss} - %[%[%[%[>H1 //|//] |@H3] |@daemon ] - |>reverse_cons >associative_append - >H2 in Htout2; #Htout >Htout [@Ht2| >Ht2 normalize % #H destruct (H)] - ] - |* #b * #rss * * #H1 #H2 - #Ht2 %2 - %{(shift_i sig n i b (all_blank sig n))} %{(shift_i sig n i a a1::rss)} - %[%[@H1 |@daemon ] - |>Ht2 in Htout1; #Htout >Htout // - whd in match (left ??); whd in match (right ??); - >reverse_append >reverse_single >associative_append >reverse_cons - >associative_append // - ] - ] - ] - ] -qed. - -theorem sem_shift_i_L_new: ∀sig,n,i. - shift_i_L sig n i ⊨ R_shift_i_L_new sig n i. -#sig #n #i -@(Realize_to_Realize … (sem_shift_i_L sig n i)) -#t1 #t2 #H #a #ls #rs #Ht1 lapply (H a ls rs Ht1) * - [* #rs1 * #b * #rs2 * #a1 * #rss * * * * #H1 #H2 #H3 #H4 #Ht2 - %{rs1} %{b} %{(b::rs2)} %{(a1::rss)} - %[%[%[%[%[//|@H2]|@H1]|@H3]|@H4] | whd in match (tail ??); @Ht2] - |* #b * #rss * * #H1 #H2 #Ht2 - %{rs} %{(all_blank sig n)} %{[]} %{(rss@[b])} - %[%[%[%[%[//|@blank_all_blank]|//]|@H1]|@H2] | whd in match (tail ??); @Ht2] - ] -qed. - - -(******************************************************************************* -The following machine implements a full move of for a trace: we reach the left -border, shift the i-th trace and come back to the head position. *) - -(* this exclude the possibility that traces do not overlap: the head must -remain inside all traces *) - -definition mtiL ≝ λsig,n,i. - move_to_blank_L sig n i · - shift_i_L sig n i · - move_until ? L (no_head sig n). - -definition Rmtil ≝ λsig,n,i,t1,t2. - ∀ls,a,rs. - t1 = midtape (multi_sig sig n) ls a rs → - nth n ? (vec … a) (blank ?) = head ? → - (∀i.regular_trace sig n a ls rs i) → - (* next: we cannot be on rightof on trace i *) - (nth i ? (vec … a) (blank ?) = (blank ?) - → nth i ? (vec … (hd ? rs (all_blank …))) (blank ?) ≠ (blank ?)) → - no_head_in … ls → - no_head_in … rs → - (∃ls1,a1,rs1. - t2 = midtape (multi_sig …) ls1 a1 rs1 ∧ - (∀i.regular_trace … a1 ls1 rs1 i) ∧ - (∀j. j ≤ n → j ≠ i → to_blank_i ? n j (a1::ls1) = to_blank_i ? n j (a::ls)) ∧ - (∀j. j ≤ n → j ≠ i → to_blank_i ? n j rs1 = to_blank_i ? n j rs) ∧ - (to_blank_i ? n i ls1 = to_blank_i ? n i (a::ls)) ∧ - (to_blank_i ? n i (a1::rs1)) = to_blank_i ? n i rs). - -theorem sem_Rmtil: ∀sig,n,i. i < n → mtiL sig n i ⊨ Rmtil sig n i. -#sig #n #i #lt_in -@(sem_seq_app ?????? - (sem_move_to_blank_L … ) - (sem_seq ????? (sem_shift_i_L_new …) - (ssem_move_until_L ? (no_head sig n)))) -#tin #tout * #t1 * * #_ #Ht1 * #t2 * #Ht2 * #_ #Htout -(* we start looking into Rmitl *) -#ls #a #rs #Htin (* tin is a midtape *) -#Hhead #Hreg #no_rightof #Hnohead_ls #Hnohead_rs -cut (regular_i sig n (a::ls) i) - [cases (Hreg i) * // - cases (true_or_false (nth i ? (vec … a) (blank ?) == (blank ?))) #Htest - [#_ @daemon (* absurd, since hd rs non e' blank *) - |#H #_ @daemon]] #Hreg1 -lapply (Ht1 … Htin Hreg1 ?) [#j #_ @Hreg] -Ht1 -Htin -* #b * #ls1 * #ls2 * * * * * #reg_ls1_i #reg_ls1_j #Hno_blankb #Hhead #Hls1 #Ht1 -lapply (Ht2 … Ht1) -Ht2 -Ht1 -* #rs1 * #b0 * #rs2 * #rss * * * * * #Hb0 #Hb0blank #Hrs1 #Hrs1b #Hrss #Ht2 -(* we need to recover the position of the head of the emulated machine - that is the head of ls1. This is somewhere inside rs1 *) -cut (∃rs11. rs1 = (reverse ? ls1)@rs11) - [cut (ls1 = [ ] ∨ ∃aa,tlls1. ls1 = aa::tlls1) - [cases ls1 [%1 // | #aa #tlls1 %2 %{aa} %{tlls1} //]] * - [#H1ls1 %{rs1} >H1ls1 // - |* #aa * #tlls1 #H1ls1 >H1ls1 in Hrs1; - cut (aa = a) [>H1ls1 in Hls1; #H @(to_blank_hd … H)] #eqaa >eqaa - #Hrs1_aux cases (compare_append … (sym_eq … Hrs1_aux)) #l * - [* #H1 #H2 %{l} @H1 - |(* this is absurd : if l is empty, the case is as before. - if l is not empty then it must start with a blank, since it is the - first character in rs2. But in this case we would have a blank - inside ls1=a::tls1 that is absurd *) - @daemon - ]]] - * #rs11 #H1 -cut (rs = rs11@rs2) - [@(injective_append_l … (reverse … ls1)) >Hrs1 H2 >trace_append @mem_append_l2 - lapply Hb0 cases rs2 - [whd in match (hd ???); #H >H in H3; whd in match (no_head ???); - >all_blank_n normalize -H #H destruct (H); @False_ind - |#c #r #H4 %1 >H4 // - ] - |* - [(* we reach the head position *) - (* cut (trace sig n j (a1::ls20)=trace sig n j (ls1@b::ls2)) *) - * #ls10 * #a1 * #ls20 * * * #Hls20 #Ha1 #Hnh #Htout - cut (∀j.j ≠ i → - trace sig n j (reverse (multi_sig sig n) rs1@b::ls2) = - trace sig n j (ls10@a1::ls20)) - [#j #ineqj >append_cons trace_def reverse_map >map_append @eq_f @Hls20 ] - #Htracej - cut (trace sig n i (reverse (multi_sig sig n) (rs1@[b0])@ls2) = - trace sig n i (ls10@a1::ls20)) - [>trace_def Hcut - lapply (trace_shift … lt_in … Hrss) [//] whd in match (tail ??); #Htr reverse_map >map_append trace_def in ⊢ (%→?); trace_def in ⊢ (%→?); H1 in Htracei; >reverse_append >reverse_single >reverse_append - >reverse_reverse >associative_append >associative_append - @daemon - ] #H3 - cut (∀j. j ≠ i → - trace sig n j (reverse (multi_sig sig n) ls10@rs2) = trace sig n j rs) - [#j #jneqi @(injective_append_l … (trace sig n j (reverse ? ls1))) - >map_append >map_append >Hrs1 >H1 >associative_append - eqji (* by cases wether a1 is blank *) - @daemon - |#jneqi lapply (reg_ls1_j … jneqi) #H4 - >reverse_cons >associative_append >Hb0 @regular_cons_hd_rs - @(eq_trace_to_regular … H4) - [(proj2 … (H2 … jneqi)) >hd_trace % - |(proj2 … (H2 … jneqi)) >tail_trace % - |@sym_eq @Hrs_j // - ] - ]] - |#j #lejn #jneqi <(Hls1 … lejn) - >to_blank_i_def >to_blank_i_def @eq_f @sym_eq @(proj2 … (H2 j jneqi))] - |#j #lejn #jneqi >reverse_cons >associative_append >Hb0 - to_blank_i_def >to_blank_i_def @eq_f @Hrs_j //] - |<(Hls1 i) [2:@lt_to_le //] - lapply (all_blank_after_blank … reg_ls1_i) - [@(\P ?) @daemon] #allb_ls2 - whd in match (to_blank_i ????); <(proj2 … H3) - @daemon ] - |>reverse_cons >associative_append - cut (to_blank_i sig n i rs = to_blank_i sig n i (rs11@[b0])) [@daemon] - #Hcut >Hcut >(to_blank_i_chop … b0 (a1::reverse …ls10)) [2: @Hb0blank] - >to_blank_i_def >to_blank_i_def @eq_f - >trace_def >trace_def @injective_reverse >reverse_map >reverse_cons - >reverse_reverse >reverse_map >reverse_append >reverse_single @sym_eq - @(proj1 … H3) - ] - |(*we do not find the head: this is absurd *) - * #b1 * #lss * * #H2 @False_ind - cut (∀x0. mem ? x0 (trace sig n n (b0::reverse ? rss@ls2)) → x0 ≠ head ?) - [@daemon] -H2 #H2 - lapply (trace_shift_neq sig n i n … lt_in … Hrss) - [@lt_to_not_eq @lt_in | // ] - #H3 @(absurd - (nth n ? (vec … (hd ? (ls1@[b]) (all_blank sig n))) (blank ?) = head ?)) - [>Hhead // - |@H2 >trace_def %2 H3 >H1 >trace_def >reverse_map >reverse_cons >reverse_append - >reverse_reverse >associative_append - - - - - 500 - 480 - True - Cic browser - center-on-parent - 500 - 480 - True - - - True - - - True - vertical - - - True - - - True - _File - True - - - - - gtk-new - True - True - True - - - - - True - Open _Location ... - True - - - - - - True - - - - - gtk-close - True - True - True - - - - - - - - - True - _Edit - True - - - - - gtk-copy - True - True - True - - - - - - - - - False - False - 0 - - - - - True - 0 - 0 - none - - - True - - - True - True - False - none - - - True - gtk-new - - - - - False - False - 0 - - - - - True - True - False - none - - - True - gtk-go-back - - - - - False - False - 1 - - - - - True - True - False - none - - - True - gtk-go-forward - - - - - False - False - 2 - - - - - True - True - True - False - refresh - none - - - True - gtk-refresh - - - - - False - False - 3 - - - - - True - True - True - False - home - none - - - True - gtk-home - - - - - False - False - 4 - - - - - True - gtk-jump-to - 2 - - - False - False - 3 - 5 - - - - - True - - - True - True - True - - - - 0 - - - - - 6 - - - - - - - False - 1 - - - - - True - True - - - True - True - automatic - automatic - - - - - - - - True - MathView - - - False - tab - - - - - True - True - automatic - automatic - in - - - True - True - False - - - - - 1 - - - - - True - WhelpResult - - - 1 - False - tab - - - - - True - True - automatic - automatic - - - True - none - - - True - gtk-missing-image - - - - - - - 2 - - - - - True - WhelpEasterEgg - - - 2 - False - tab - - - - - True - True - automatic - automatic - - - - - - 3 - - - - - True - Graph - - - 3 - False - tab - - - - - True - vertical - - - True - True - 3 - automatic - automatic - in - - - - - - 0 - - - - - True - 4 - 4 - - - True - vertical - - - - - - - - - 0 - - - - - True - True - True - - - 1 - - - - - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-find - - - False - False - 0 - - - - - True - Search - True - - - False - False - 1 - - - - - - - - - False - False - 2 - - - - - False - 1 - - - - - 4 - - - - - True - SearchText - - - 4 - False - tab - - - - - 3 - - - - - - - - - DUMMY - False - True - center - dialog - - - True - vertical - - - True - DUMMY - center - - - False - False - 2 - - - - - True - end - - - gtk-cancel - -6 - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - -5 - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - - True - DUMMY - dialog - - - True - vertical - - - True - DUMMY - - - False - False - 2 - - - - - - - - True - end - - - gtk-cancel - -6 - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - -5 - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - - 10 - Select File - True - center - dialog - - - True - True - True - False - - - - - True - True - True - False - - - - - Matita - - - True - - - True - vertical - - - True - - - True - - - True - _File - True - - - - - gtk-new - True - True - True - - - - - - gtk-open - True - True - True - - - - - - gtk-save - True - True - True - - - - - - gtk-save-as - True - True - True - - - - - - True - - - - - gtk-close - True - True - True - - - - - - gtk-quit - True - True - True - - - - - - - - - - True - _Edit - True - - - - - gtk-undo - True - False - True - True - - - - - - gtk-redo - True - False - True - True - - - - - - True - - - - - gtk-cut - True - True - True - - - - - - gtk-copy - True - True - True - - - - - - gtk-paste - True - True - True - - - - - - True - Paste as pattern - True - - - - - True - Paste Unicode as TeX - True - - - - - True - Automatically expands TeX macros to their corresponding UTF-8 symbol - Auto-expand TeX Macros - True - True - - - - - gtk-delete - True - True - True - - - - - True - - - - - True - Select _All - True - - - - - True - - - - - gtk-find-and-replace - True - True - True - - - - - - True - - - - - True - Next ligature - True - - - - - - True - Edit with e_xternal editor - True - - - - - - - - - True - _Script - True - - - - - gtk-go-down - True - True - True - - - - - - gtk-go-up - True - True - True - - - - - - True - - - - - gtk-goto-bottom - True - True - True - - - - - - gtk-goto-top - True - True - True - - - - - - True - - - - - gtk-jump-to - True - True - True - - - - - - - - - - True - _View - True - - - - - True - New CIC _browser - True - - - - - - True - - - - - True - _Fullscreen - True - - - - - - True - Shows a palette with natural deduction rules - Natural deduction palette - True - - - - - - True - - - - - gtk-zoom-in - True - True - True - - - - - - gtk-zoom-out - True - True - True - - - - - - gtk-zoom-100 - True - True - True - - - - - - True - - - - - True - Pretty print notation - True - True - - - - - True - Hide coercions - True - True - - - - - True - - - - - True - Displays the graph of coercions - Coercions Graph - True - - - - - True - Displays the database of hints - Hints database - True - - - - - True - Displays the terms grammar as extended by the user - Terms grammar - True - - - - - True - Show the conversion table from TeX like sequences to UTF-8 - TeX/UTF-8 table - True - - - - - - - - - True - _Debug - True - - - - - True - - - - - - - - - True - _Help - True - - - - - gtk-help - True - True - True - - - - - - gtk-about - True - True - True - - - - - - - - - - - False - False - 0 - - - - - True - - - True - True - - - True - 2 - - - True - top - - - True - vertical - - - True - True - - - True - vertical - - - True - True - True - - - True - Implication (⇒<sub>i</sub>) - True - - - - - 0 - - - - - True - True - True - - - True - Conjunction (∧<sub>i</sub>) - True - - - - - 1 - - - - - True - True - True - - - True - Disjunction left (∨<sub>i-l</sub>) - True - - - - - 2 - - - - - True - True - True - - - True - Disjunction right (∨<sub>i-r</sub>) - True - - - - - 3 - - - - - True - True - True - - - True - Negation (¬<sub>i</sub>) - True - - - - - 4 - - - - - True - True - True - - - True - Top (⊤<sub>i</sub>) - True - - - - - 5 - - - - - True - True - True - - - True - Universal (∀<sub>i</sub>) - True - - - - - 6 - - - - - True - True - True - - - True - Existential (∃<sub>i</sub>) - True - - - - - 7 - - - - - - - True - Introduction rules - - - label_item - - - - - False - 0 - - - - - True - True - - - True - vertical - - - True - True - True - - - True - Implication (⇒<sub>e</sub>) - True - - - - - 0 - - - - - True - True - True - - - True - Conjunction left (∧<sub>e-l</sub>) - True - - - - - 1 - - - - - True - True - True - - - True - Conjunction right (∧<sub>e-r</sub>) - True - - - - - 2 - - - - - True - True - True - - - True - Disjunction (∨<sub>e</sub>) - True - - - - - 3 - - - - - True - True - True - - - True - Negation (¬<sub>e</sub>) - True - - - - - 4 - - - - - True - True - True - - - True - Bottom (⊥<sub>e</sub>) - True - - - - - 5 - - - - - True - True - True - - - True - Universal (∀<sub>e</sub>) - True - - - - - 6 - - - - - True - True - True - - - True - Existential (∃<sub>e</sub>) - True - - - - - 7 - - - - - - - True - Elimination rules - - - label_item - - - - - False - 1 - - - - - True - True - - - True - vertical - - - Reduction to Absurdity (RAA) - True - True - True - - - 0 - - - - - Use lemma (lem) - True - True - True - - - 1 - - - - - Discharge (discharge) - True - True - True - - - 2 - - - - - - - True - Misc rules - - - label_item - - - - - False - 2 - - - - - - - False - 0 - - - - - 400 - True - vertical - - - True - - - True - both - - - True - - - True - True - False - Restart - none - - - True - gtk-goto-top - - - - - - - False - - - - - True - - - True - True - False - Retract 1 phrase - none - - - True - gtk-go-up - - - - - - - False - - - - - True - - - True - True - False - Execute until point - none - - - True - gtk-jump-to - - - - - - - False - - - - - True - - - True - True - False - Execute 1 phrase - none - - - True - gtk-go-down - - - - - - - False - - - - - True - - - True - True - False - Execute all - none - - - True - gtk-goto-bottom - - - - - - - False - - - - - 0 - - - - - True - vertical - both - - - True - - - True - True - False - none - - - True - gtk-stop - - - - - - - False - - - - - False - 1 - - - - - False - False - 0 - - - - - True - True - True - - - - - - - tab - - - - - - - - - tab - - - - - 1 - - - - - 1 - - - - - False - True - - - - - 250 - 500 - True - True - 380 - - - True - True - True - - - False - True - - - - - True - - - True - True - never - in - - - True - True - False - char - False - - - - - 0 - - - - - True - True - - - - - True - True - - - - - 0 - - - - - 1 - - - - - True - - - True - False - - - 0 - - - - - True - False - - - True - gtk-missing-image - - - - - True - label14 - - - False - tab - - - - - True - gtk-missing-image - - - 1 - - - - - True - label15 - - - 1 - False - tab - - - - - True - gtk-missing-image - - - 2 - - - - - True - label16 - - - 2 - False - tab - - - - - False - 1 - - - - - False - False - 2 - - - - - - - - - DUMMY - dialog - - - True - vertical - - - True - DUMMY - - - False - False - 2 - - - - - True - True - automatic - automatic - in - - - True - True - - - - - 3 - - - - - True - end - - - gtk-cancel - -6 - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - -5 - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - - 280 - Uri choice - True - center - dialog - - - True - vertical - 4 - - - True - vertical - 3 - - - True - some informative message here ... - - - False - False - 0 - - - - - 400 - True - True - automatic - automatic - - - True - True - False - - - - - 1 - - - - - True - - - True - URI: - - - False - False - 0 - - - - - True - True - - - 1 - - - - - False - 2 - - - - - 2 - - - - - True - end - - - gtk-cancel - -6 - True - True - True - False - True - - - False - False - 0 - - - - - True - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-index - - - False - False - 0 - - - - - True - Try _Selected - True - - - False - False - 1 - - - - - - - - - False - False - 1 - - - - - Try Constants - True - False - True - True - False - True - - - False - False - 2 - - - - - gtk-copy - True - True - False - True - - - False - False - 3 - - - - - True - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-ok - - - False - False - 0 - - - - - True - bla bla bla - True - - - False - False - 1 - - - - - - - - - False - False - 4 - - - - - gtk-go-forward - True - True - True - False - True - - - False - False - 5 - - - - - False - end - 0 - - - - - - - 5 - Find & Replace - False - mouse - dialog - - - True - 3 - 2 - 5 - - - True - 0 - Find: - - - - - - - - - True - 0 - Replace with: - - - 1 - 2 - - - - - - - True - True - True - True - True - - - 1 - 2 - - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - - - True - 5 - - - True - vertical - - - - - - - - - 0 - - - - - gtk-find - True - True - False - True - - - False - False - 1 - - - - - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-find-and-replace - - - False - False - 0 - - - - - True - _Replace - True - - - False - False - 1 - - - - - - - - - False - False - 2 - - - - - gtk-cancel - True - True - False - True - - - False - False - 3 - - - - - 2 - 2 - 3 - 5 - - - - - - - 450 - 400 - title - True - dialog - - - True - vertical - - - True - vertical - - - True - some informative message here ... - - - False - False - 0 - - - - - True - True - automatic - automatic - in - - - True - True - False - - - - - 1 - - - - - 2 - - - - - True - end - - - gtk-help - -11 - True - True - True - False - True - - - False - False - 0 - - - - - -6 - True - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-zoom-in - - - False - False - 0 - - - - - True - More - True - - - False - False - 1 - - - - - - - - - False - False - 1 - - - - - gtk-cancel - -6 - True - True - True - True - False - True - - - False - False - 2 - - - - - gtk-ok - -5 - True - True - True - False - True - - - False - False - 3 - - - - - False - end - 0 - - - - - - - 600 - 400 - True - Auto - dialog - south-east - - - True - vertical - - - True - 2 - - - True - True - automatic - in - - - True - - - True - 3 - 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - True - vertical - - - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-go-up - - - False - False - 0 - - - - - True - True - - - False - False - 1 - - - - - - - - - 0 - - - - - True - True - False - - - True - gtk-go-down - - - - - 1 - - - - - False - False - 1 - - - - - 0 - - - - - True - - - False - 3 - 1 - - - - - True - - - True - 0 - Last: - - - 0 - - - - - True - 4 - 4 - end - - - gtk-media-pause - True - True - True - False - True - - - False - False - 0 - - - - - gtk-media-play - True - True - True - False - True - - - False - False - 1 - - - - - gtk-media-next - True - True - True - False - True - - - False - False - 2 - - - - - gtk-close - True - True - True - False - True - - - False - False - 3 - - - - - 1 - - - - - False - 2 - - - - - - diff --git a/matita/matita/matita.ml b/matita/matita/matita.ml index 2bbe85225..2731a5ac7 100644 --- a/matita/matita/matita.ml +++ b/matita/matita/matita.ml @@ -25,11 +25,6 @@ (* $Id$ *) -open Printf - -open MatitaGtkMisc -open GrafiteTypes - (** {2 Initialization} *) let _ = diff --git a/matita/matita/matita.ui b/matita/matita/matita.ui new file mode 100644 index 000000000..adc72164d --- /dev/null +++ b/matita/matita/matita.ui @@ -0,0 +1,2625 @@ + + + + + + 600 + 400 + True + False + Auto + dialog + south-east + + + True + False + vertical + + + True + False + 2 + + + True + True + in + + + True + False + + + True + False + + + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + False + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-go-up + + + False + False + 0 + + + + + True + False + True + + + False + False + 1 + + + + + + + + + True + True + 0 + + + + + True + True + False + + + True + False + gtk-go-down + + + + + True + True + 1 + + + + + False + False + 1 + + + + + True + True + 0 + + + + + True + False + + + False + True + 3 + 1 + + + + + True + False + + + True + False + Last: + 0 + + + True + True + 0 + + + + + True + False + 4 + 4 + end + + + gtk-media-pause + True + True + True + False + True + + + False + False + 0 + + + + + gtk-media-play + True + True + True + False + True + + + False + False + 1 + + + + + gtk-media-next + True + True + True + False + True + + + False + False + 2 + + + + + gtk-close + True + True + True + False + True + + + False + False + 3 + + + + + True + True + 1 + + + + + False + True + 2 + + + + + + + 500 + 480 + True + False + Cic browser + center-on-parent + 500 + 480 + True + + + True + False + + + True + False + vertical + + + True + False + + + True + False + _File + True + + + False + + + True + False + _New + True + + + + + True + False + Open _Location ... + True + + + + + + True + False + + + + + True + False + _Quit + True + + + + + + + + + True + False + _Edit + True + + + False + + + True + False + _Copy + True + + + + + + + + + False + False + 0 + + + + + True + False + 0 + 0 + none + + + True + False + + + True + True + False + none + + + True + False + gtk-new + + + + + False + False + 0 + + + + + True + True + False + none + + + True + False + gtk-go-back + + + + + False + False + 1 + + + + + True + True + False + none + + + True + False + gtk-go-forward + + + + + False + False + 2 + + + + + True + True + True + False + refresh + none + + + True + False + gtk-refresh + + + + + False + False + 3 + + + + + True + True + True + False + home + none + + + True + False + gtk-home + + + + + False + False + 4 + + + + + True + False + gtk-jump-to + 2 + + + False + False + 3 + 5 + + + + + True + False + + + True + True + True + ● + + + True + True + 0 + + + + + True + True + 6 + + + + + + + False + True + 1 + + + + + True + True + + + True + True + + + + + True + False + MathView + + + False + + + + + True + True + in + + + True + True + False + + + + + + + + 1 + + + + + True + False + WhelpResult + + + 1 + False + + + + + True + True + + + True + False + none + + + True + False + gtk-missing-image + + + + + + + 2 + + + + + True + False + WhelpEasterEgg + + + 2 + False + + + + + True + True + + + 3 + + + + + True + False + Graph + + + 3 + False + + + + + True + False + vertical + + + True + True + 3 + in + + + True + True + 0 + + + + + True + False + 4 + 4 + + + True + False + vertical + + + True + True + 0 + + + + + True + True + True + + + True + True + 1 + + + + + True + True + False + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-find + + + False + False + 0 + + + + + True + False + Search + True + + + False + False + 1 + + + + + + + + + False + False + 2 + + + + + False + True + 1 + + + + + 4 + + + + + True + False + SearchText + + + 4 + False + + + + + True + True + 3 + + + + + + + + + 450 + 400 + False + title + True + dialog + + + True + False + vertical + + + True + False + spread + + + False + False + end + 0 + + + + + True + False + vertical + + + True + False + some informative message here ... + + + False + False + 0 + + + + + True + True + True + in + + + 717 + True + True + False + + + + + + + + True + True + 1 + + + + + False + True + 2 + + + + + + + False + 5 + Find & Replace + False + mouse + dialog + + + True + False + 9 + + + True + False + Find: + 0 + + + 0 + 0 + + + + + True + False + Replace with: + 0 + + + 0 + 1 + + + + + True + True + True + True + + + 1 + 0 + + + + + True + True + + + 1 + 1 + + + + + True + False + 5 + True + + + gtk-find + True + True + False + True + + + False + False + 1 + + + + + True + True + False + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-find-and-replace + + + False + False + 0 + + + + + True + False + _Replace + True + + + False + False + 1 + + + + + + + + + False + False + 2 + + + + + gtk-cancel + True + True + False + True + + + False + False + 3 + + + + + 0 + 2 + 2 + + + + + + + False + Matita + + + True + False + + + True + False + vertical + + + True + False + + + True + False + _File + True + + + False + + + True + False + _New + True + + + + + + True + False + _Open... + True + + + + + + True + False + _Save + True + + + + + + True + False + _Save as... + True + + + + + + True + False + + + + + True + False + _Close + True + + + + + + True + False + _Quit + True + + + + + + + + + + True + False + _Edit + True + + + False + + + True + False + False + _Undo + True + + + + + + True + False + False + _Redo + True + + + + + + True + False + + + + + True + False + Cut + True + + + + + + True + False + Copy + True + + + + + + True + False + Paste + True + + + + + + True + False + Paste as pattern + True + + + + + True + False + Paste Unicode as TeX + True + + + + + True + False + Auto-expand TeX Macros + True + True + + + + + True + False + Delete + True + + + + + True + False + + + + + True + False + Select _All + True + + + + + True + False + + + + + True + False + Find and replace... + True + + + + + + True + False + + + + + True + False + Next ligature + True + + + + + + True + False + Edit with e_xternal editor + True + + + + + + + + + True + False + _Script + True + + + False + + + True + False + Execute 1 phrase + True + + + + + + True + False + Retract 1 phrase + True + + + + + + True + False + + + + + True + False + Execute all + True + + + + + + True + False + Retract all + True + + + + + + True + False + + + + + True + False + Execute until cursor + True + + + + + + + + + + True + False + _View + True + + + False + + + True + False + New CIC _browser + True + + + + + + True + False + + + + + True + False + _Fullscreen + True + + + + + + True + False + Natural deduction palette + True + + + + + + True + False + + + + + True + False + Zoom in + True + + + + + + True + False + Zoom out + True + + + + + + True + False + Normal size + True + + + + + + True + False + + + + + True + False + Pretty print notation + True + True + + + + + True + False + Hide coercions + True + True + + + + + True + False + + + + + True + False + Coercions Graph + True + + + + + True + False + Hints database + True + + + + + True + False + Terms grammar + True + + + + + True + False + TeX/UTF-8 table + True + + + + + + + + + True + False + _Debug + True + + + False + + + True + False + + + + + + + + + True + False + _Help + True + + + False + + + True + False + Contents + True + + + + + + True + False + About + True + + + + + + + + + False + False + 0 + + + + + True + False + + + True + True + + + True + False + 2 + + + True + False + + + True + False + vertical + + + True + True + + + True + False + vertical + + + True + True + True + + + True + False + Implication (⇒<sub>i</sub>) + True + + + + + True + True + 0 + + + + + True + True + True + + + True + False + Conjunction (∧<sub>i</sub>) + True + + + + + True + True + 1 + + + + + True + True + True + + + True + False + Disjunction left (∨<sub>i-l</sub>) + True + + + + + True + True + 2 + + + + + True + True + True + + + True + False + Disjunction right (∨<sub>i-r</sub>) + True + + + + + True + True + 3 + + + + + True + True + True + + + True + False + Negation (¬<sub>i</sub>) + True + + + + + True + True + 4 + + + + + True + True + True + + + True + False + Top (⊤<sub>i</sub>) + True + + + + + True + True + 5 + + + + + True + True + True + + + True + False + Universal (∀<sub>i</sub>) + True + + + + + True + True + 6 + + + + + True + True + True + + + True + False + Existential (∃<sub>i</sub>) + True + + + + + True + True + 7 + + + + + + + True + False + Introduction rules + + + + + False + True + 0 + + + + + True + True + + + True + False + vertical + + + True + True + True + + + True + False + Implication (⇒<sub>e</sub>) + True + + + + + True + True + 0 + + + + + True + True + True + + + True + False + Conjunction left (∧<sub>e-l</sub>) + True + + + + + True + True + 1 + + + + + True + True + True + + + True + False + Conjunction right (∧<sub>e-r</sub>) + True + + + + + True + True + 2 + + + + + True + True + True + + + True + False + Disjunction (∨<sub>e</sub>) + True + + + + + True + True + 3 + + + + + True + True + True + + + True + False + Negation (¬<sub>e</sub>) + True + + + + + True + True + 4 + + + + + True + True + True + + + True + False + Bottom (⊥<sub>e</sub>) + True + + + + + True + True + 5 + + + + + True + True + True + + + True + False + Universal (∀<sub>e</sub>) + True + + + + + True + True + 6 + + + + + True + True + True + + + True + False + Existential (∃<sub>e</sub>) + True + + + + + True + True + 7 + + + + + + + True + False + Elimination rules + + + + + False + True + 1 + + + + + True + True + + + True + False + vertical + + + Reduction to Absurdity (RAA) + True + True + True + + + True + True + 0 + + + + + Use lemma (lem) + True + True + True + + + True + True + 1 + + + + + Discharge (discharge) + True + True + True + + + True + True + 2 + + + + + + + True + False + Misc rules + + + + + False + True + 2 + + + + + False + True + 0 + + + + + False + True + 0 + + + + + 400 + True + False + vertical + + + True + False + + + True + False + both + + + True + False + + + True + True + False + Retract all + none + + + True + False + gtk-goto-top + + + + + + + False + False + + + + + True + False + + + True + True + False + Retract 1 phrase + none + + + True + False + gtk-go-up + + + + + + + False + False + + + + + True + False + + + True + True + False + Execute until cursor + none + + + True + False + gtk-jump-to + + + + + + + False + False + + + + + True + False + + + True + True + False + Execute 1 phrase + none + + + True + False + gtk-go-down + + + + + + + False + False + + + + + True + False + + + True + True + False + Execute all + none + + + True + False + gtk-goto-bottom + + + + + + + False + False + + + + + True + True + 0 + + + + + True + False + vertical + both + + + True + False + + + True + True + False + none + + + True + False + gtk-stop + + + + + + + False + False + + + + + False + True + 1 + + + + + False + False + 0 + + + + + True + True + True + + + True + True + 1 + + + + + True + True + 1 + + + + + False + True + + + + + 250 + 500 + True + True + vertical + 380 + + + True + True + True + + + False + True + + + + + True + False + + + True + True + never + in + + + True + True + False + char + False + + + + + True + True + 0 + + + + + True + True + + + + + True + True + + + + + True + True + 0 + + + + + True + True + 1 + + + + + True + False + + + True + False + + + True + True + 0 + + + + + True + False + False + + + True + False + gtk-missing-image + + + + + True + False + label14 + + + False + + + + + True + False + gtk-missing-image + + + 1 + + + + + True + False + label15 + + + 1 + False + + + + + True + False + gtk-missing-image + + + 2 + + + + + True + False + label16 + + + 2 + False + + + + + False + True + 1 + + + + + False + False + 2 + + + + + + + + + 280 + False + Uri choice + True + center + dialog + + + True + False + vertical + 4 + + + True + False + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + True + True + True + False + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-index + + + False + False + 0 + + + + + True + False + Try _Selected + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + Try Constants + True + False + True + True + False + True + + + False + False + 2 + + + + + gtk-copy + True + True + False + True + + + False + False + 3 + + + + + True + True + True + False + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-ok + + + False + False + 0 + + + + + True + False + bla bla bla + True + + + False + False + 1 + + + + + + + + + False + False + 4 + + + + + gtk-go-forward + True + True + True + False + True + + + False + False + 5 + + + + + False + False + end + 0 + + + + + True + False + vertical + 3 + + + True + False + some informative message here ... + + + False + False + 0 + + + + + 400 + True + True + True + + + True + True + False + + + + + + + + True + True + 1 + + + + + True + False + True + + + True + False + URI: + + + False + False + 0 + + + + + True + True + + + True + True + 1 + + + + + True + True + 2 + + + + + False + True + 2 + + + + + + UriChoiceAbortButton + + + diff --git a/matita/matita/matitaEngine.ml b/matita/matita/matitaEngine.ml index cfd8c107a..fea7161c1 100644 --- a/matita/matita/matitaEngine.ml +++ b/matita/matita/matitaEngine.ml @@ -26,7 +26,6 @@ (* $Id$ *) module G = GrafiteAst -open GrafiteTypes open Printf class status baseuri = @@ -51,7 +50,7 @@ let first_line = ref true ;; let cases_or_induction_context stack = match stack with [] -> false - | (g,t,k,tag,p)::tl -> try + | (_g,_t,_k,_tag,p)::_tl -> try let s = List.assoc "context" p in s = "cases" || s = "induction" with @@ -61,10 +60,10 @@ let cases_or_induction_context stack = let has_focused_goal stack = match stack with [] -> false - | (g,t,k,tag,p)::tl -> (List.length g) > 0 + | (g,_t,_k,_tag,_p)::_tl -> (List.length g) > 0 ;; -let get_indentation status statement = +let get_indentation status _statement = let base_ind = match status#stack with [] -> 0 @@ -105,7 +104,7 @@ let write_ast_to_file status fname statement = | G.NObj (_,obj,_) -> ( match obj with - Theorem _ -> "\n" ^ GrafiteAstPp.pp_statement status statement + NotationPt.Theorem _ -> "\n" ^ GrafiteAstPp.pp_statement status statement ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") | _ -> "" ) @@ -252,17 +251,17 @@ let baseuri_of_script ~include_paths fname = (* given a path to a ma file inside the include_paths, returns the new include_paths associated to that file *) -let read_include_paths ~include_paths file = - try - let root, _buri, _fname, _tgt = - Librarian.baseuri_of_script ~include_paths:[] file in - let includes = - try - Str.split (Str.regexp " ") - (List.assoc "include_paths" (Librarian.load_root_file (root^"/root"))) - with Not_found -> [] - in - let rc = root :: includes in +let read_include_paths ~include_paths:_ file = + try + let root, _buri, _fname, _tgt = + Librarian.baseuri_of_script ~include_paths:[] file in + let includes = + try + Str.split (Str.regexp " ") + (List.assoc "include_paths" (Librarian.load_root_file (root^"/root"))) + with Not_found -> [] + in + let rc = root :: includes in List.iter (HLog.debug) rc; rc with Librarian.NoRootFor _ | Librarian.FileNotFound _ -> [] diff --git a/matita/matita/matitaExcPp.ml b/matita/matita/matitaExcPp.ml index 5117b091f..b0a5c7f12 100644 --- a/matita/matita/matitaExcPp.ml +++ b/matita/matita/matitaExcPp.ml @@ -124,7 +124,7 @@ let rec to_string exn = | GrafiteTypes.Command_error msg -> None, "Error: " ^ msg | CicNotationParser.Parse_error err -> None, sprintf "Parse error: %s" err - | Unix.Unix_error (code, api, param) -> + | Unix.Unix_error (code, api, _param) -> let err = Unix.error_message code in None, "Unix Error (" ^ api ^ "): " ^ err | HMarshal.Corrupt_file fname -> None, sprintf "file '%s' is corrupt" fname diff --git a/matita/matita/matitaGtkMisc.ml b/matita/matita/matitaGtkMisc.ml index aaf297da2..1f3caa9c7 100644 --- a/matita/matita/matitaGtkMisc.ml +++ b/matita/matita/matitaGtkMisc.ml @@ -25,7 +25,6 @@ (* $Id$ *) -exception PopupClosed open Printf let wrap_callback0 f = fun _ -> try f () with Not_found -> assert false @@ -99,7 +98,7 @@ class multiStringListModel ~cols (tree_view: GTree.view) = (fun renderer -> GTree.view_column ~renderer ()) renderers in - object (self) + object val text_columns = text_columns initializer @@ -174,7 +173,7 @@ class taggedStringListModel ~(tags:(string * GdkPixbuf.pixbuf) list) let lookup_pixbuf tag = try List.assoc tag tags with Not_found -> assert false in - object (self) + object initializer tree_view#set_model (Some (list_store :> GTree.model)); ignore (tree_view#append_column tag_vcolumn); @@ -228,7 +227,7 @@ class recordModel (tree_view:GTree.view) = ]) in let toggle_vcol = GTree.view_column ~renderer:toggle_rend () in - object (self) + object initializer tree_view#set_model (Some (list_store :> GTree.model)); ignore (tree_view#append_column text_vcol); @@ -247,46 +246,38 @@ class recordModel (tree_view:GTree.view) = class type gui = object method newUriDialog: unit -> MatitaGeneratedGui.uriChoiceDialog - method newConfirmationDialog: unit -> MatitaGeneratedGui.confirmationDialog - method newEmptyDialog: unit -> MatitaGeneratedGui.emptyDialog end let popup_message - ~title ~message ~buttons ~callback + ~title ~message ~buttons ?(message_type=`QUESTION) ?parent ?(use_markup=true) - ?(destroy_with_parent=true) ?(allow_grow=false) ?(allow_shrink=false) - ?icon ?(modal=true) ?(resizable=false) ?screen ?type_hint - ?(position=`CENTER_ON_PARENT) ?wm_name ?wm_class ?border_width ?width + ?(destroy_with_parent=true) ?icon ?(modal=true) ?(resizable=false) + ?screen ?type_hint + ?(position=`CENTER_ON_PARENT) ?wmclass ?border_width ?width ?height ?(show=true) () = let m = GWindow.message_dialog ~message ~use_markup ~message_type ~buttons ?parent ~destroy_with_parent - ~title ~allow_grow ~allow_shrink ?icon ~modal ~resizable ?screen - ?type_hint ~position ?wm_name ?wm_class ?border_width ?width ?height + ~title ?icon ~modal ~resizable ?screen + ?type_hint ~position ?wmclass ?border_width ?width ?height ~show () in - ignore(m#connect#response - ~callback:(fun a -> GMain.Main.quit ();callback a)); - ignore(m#connect#close - ~callback:(fun _ -> GMain.Main.quit ();raise PopupClosed)); - GtkThread.main (); + ignore(m#run ()) ; m#destroy () let popup_message_lowlevel - ~title ~message ?(no_separator=true) ~callback ~message_type ~buttons - ?parent ?(destroy_with_parent=true) ?(allow_grow=false) ?(allow_shrink=false) - ?icon ?(modal=true) ?(resizable=false) ?screen ?type_hint - ?(position=`CENTER_ON_PARENT) ?wm_name ?wm_class ?border_width ?width - ?height ?(show=true) () + ~title ~message ?no_separator:(_=true) ~message_type ~buttons + ?parent ?(destroy_with_parent=true) + ?icon ?modal:(_=true) ?(resizable=false) ?screen ?type_hint + ?(position=`CENTER_ON_PARENT) ?wmclass ?border_width ?width + ?height () = let m = GWindow.dialog - ~no_separator - ?parent ~destroy_with_parent - ~title ~allow_grow ~allow_shrink ?icon ~modal ~resizable ?screen - ?type_hint ~position ?wm_name ?wm_class ?border_width ?width ?height - ~show:false () + ?parent ~destroy_with_parent + ~title ?icon ~resizable ?screen + ?type_hint ~position ?wmclass ?border_width ?width ?height () in let stock = match message_type with @@ -304,88 +295,23 @@ let popup_message_lowlevel m#vbox#pack ~from:`START ~padding:20 ~expand:true ~fill:true (hbox:>GObj.widget); List.iter (fun (x, y) -> - m#add_button_stock x y; - if y = `CANCEL then - m#set_default_response y + m#add_button_stock x y ) buttons; - ignore(m#connect#response - ~callback:(fun a -> GMain.Main.quit ();callback a)); - ignore(m#connect#close - ~callback:(fun _ -> GMain.Main.quit ();callback `POPUPCLOSED)); - if show = true then - m#show (); - GtkThread.main (); - m#destroy () + let res = m#run () in + m#destroy () ; + res let ask_confirmation ~title ~message ?parent () = - let rc = ref `YES in - let callback = - function - | `YES -> rc := `YES - | `NO -> rc := `NO - | `CANCEL -> rc := `CANCEL - | `DELETE_EVENT -> rc := `CANCEL - | `POPUPCLOSED -> rc := `CANCEL - in - let buttons = [`YES,`YES ; `NO,`NO ; `CANCEL,`CANCEL] in - popup_message_lowlevel - ~title ~message ~message_type:`WARNING ~callback ~buttons ?parent (); - !rc + GtkThread.sync (fun _ -> + let buttons = [`YES,`YES ; `NO,`NO ; `CANCEL,`DELETE_EVENT] in + popup_message_lowlevel + ~title ~message ~message_type:`WARNING ~buttons ?parent () + ) () let report_error ~title ~message ?parent () = - let callback _ = () in - let buttons = GWindow.Buttons.ok in - try - popup_message - ~title ~message ~message_type:`ERROR ~callback ~buttons ?parent () - with - | PopupClosed -> () - - -let ask_text ~(gui:#gui) ?(title = "") ?(message = "") ?(multiline = false) - ?default () -= - let dialog = gui#newEmptyDialog () in - dialog#emptyDialog#set_title title; - dialog#emptyDialogLabel#set_label message; - let result = ref None in - let return r = - result := r; - dialog#emptyDialog#destroy (); - GMain.Main.quit () - in - ignore (dialog#emptyDialog#event#connect#delete (fun _ -> true)); - if multiline then begin (* multiline input required: use a TextView widget *) - let win = - GBin.scrolled_window ~width:400 ~height:150 ~hpolicy:`NEVER - ~vpolicy:`ALWAYS ~packing:dialog#emptyDialogVBox#add () - in - let view = GText.view ~wrap_mode:`CHAR ~packing:win#add () in - let buffer = view#buffer in - (match default with - | None -> () - | Some text -> - buffer#set_text text; - buffer#select_range buffer#start_iter buffer#end_iter); - view#misc#grab_focus (); - connect_button dialog#emptyDialogOkButton (fun _ -> - return (Some (buffer#get_text ()))) - end else begin (* monoline input required: use a TextEntry widget *) - let entry = GEdit.entry ~packing:dialog#emptyDialogVBox#add () in - (match default with - | None -> () - | Some text -> - entry#set_text text; - entry#select_region ~start:0 ~stop:max_int); - entry#misc#grab_focus (); - connect_button dialog#emptyDialogOkButton (fun _ -> - return (Some entry#text)) - end; - connect_button dialog#emptyDialogCancelButton (fun _ ->return None); - dialog#emptyDialog#show (); - GtkThread.main (); - (match !result with None -> raise MatitaTypes.Cancel | Some r -> r) + let buttons = GWindow.Buttons.ok in + popup_message ~title ~message ~message_type:`ERROR ~buttons ?parent () let utf8_parsed_text s floc = let start, stop = HExtlib.loc_of_floc floc in @@ -415,7 +341,7 @@ let escape_pango_markup text = let matita_lang = let source_language_manager = - GSourceView2.source_language_manager ~default:true in + GSourceView3.source_language_manager ~default:true in source_language_manager#set_search_path (BuildTimeConf.runtime_base_dir :: source_language_manager#search_path); diff --git a/matita/matita/matitaGtkMisc.mli b/matita/matita/matitaGtkMisc.mli index 05a724136..04a531216 100644 --- a/matita/matita/matitaGtkMisc.mli +++ b/matita/matita/matitaGtkMisc.mli @@ -111,8 +111,6 @@ class taggedStringListModel: class type gui = object (* minimal gui object requirements *) method newUriDialog: unit -> MatitaGeneratedGui.uriChoiceDialog - method newConfirmationDialog: unit -> MatitaGeneratedGui.confirmationDialog - method newEmptyDialog: unit -> MatitaGeneratedGui.emptyDialog end (** {3 Dialogs} @@ -124,17 +122,7 @@ class type gui = val ask_confirmation: title:string -> message:string -> ?parent:#GWindow.window_skel -> - unit -> - [`YES | `NO | `CANCEL] - - (** @param multiline (default: false) if true a TextView widget will be used - * for prompting the user otherwise a TextEntry widget will be - * @return the string given by the user *) -val ask_text: - gui:#gui -> - ?title:string -> ?message:string -> - ?multiline:bool -> ?default:string -> unit -> - string + unit -> [`YES | `NO | `DELETE_EVENT ] val report_error: title:string -> message:string -> @@ -151,4 +139,4 @@ val utf8_string_length: string -> int val escape_pango_markup: string -> string -val matita_lang: GSourceView2.source_language +val matita_lang: GSourceView3.source_language diff --git a/matita/matita/matitaGui.ml b/matita/matita/matitaGui.ml index ce3dcc6fe..5b7352d74 100644 --- a/matita/matita/matitaGui.ml +++ b/matita/matita/matitaGui.ml @@ -31,8 +31,6 @@ open MatitaGeneratedGui open MatitaGtkMisc open MatitaMisc -exception Found of int - let all_disambiguation_passes = ref false (* this is a shit and should be changed :-{ *) @@ -41,7 +39,7 @@ let interactive_uri_choice ?(msg = "") ?(nonvars_button = false) ?(hide_uri_entry=false) ?(hide_try=false) ?(ok_label="_Auto") ?(ok_action:[`SELECT|`AUTO] = `AUTO) ?copy_cb () - ~id uris + ~id:_ uris = if (selection_mode <> `SINGLE) && (Helm_registry.get_opt_default Helm_registry.get_bool ~default:true "matita.auto_disambiguation") @@ -97,6 +95,8 @@ let interactive_uri_choice | uris -> return (Some (List.map NReference.reference_of_string uris))); connect_button dialog#uriChoiceAbortButton (fun _ -> return None); dialog#uriChoiceDialog#show (); + (* CSC: old Gtk2 code. Use #run instead. Look for similar code handling + other dialogs *) GtkThread.main (); (match !choices with | None -> raise MatitaTypes.Cancel @@ -178,7 +178,7 @@ class interpErrorModel = (let loc_row = tree_store#append () in begin match lll with - [passes,envs_and_diffs,_,_] -> + [passes,_envs_and_diffs,_,_] -> tree_store#set ~row:loc_row ~column:id_col ("Error location " ^ string_of_int (!idx1+1) ^ ", error message " ^ string_of_int (!idx1+1) ^ ".1" ^ @@ -255,7 +255,7 @@ class interpErrorModel = exception UseLibrary;; let interactive_error_interp ~all_passes - (source_buffer:GSourceView2.source_buffer) notify_exn offset errorll filename + (source_buffer:GSourceView3.source_buffer) notify_exn offset errorll filename = (* hook to save a script for each disambiguation error *) if false then @@ -318,9 +318,12 @@ let interactive_error_interp ~all_passes (MultiPassDisambiguator.DisambiguationError (offset,[[env,diff,lazy (loffset,Lazy.force msg),significant]])); | _::_ -> + GtkThread.sync (fun _ -> let dialog = new disambiguationErrors () in - if all_passes then - dialog#disambiguationErrorsMoreErrors#misc#set_sensitive false; + dialog#toplevel#add_button "Fix this interpretation" `OK; + dialog#toplevel#add_button "Close" `DELETE_EVENT; + if not all_passes then + dialog#toplevel#add_button "More errors" `HELP; (* HELP means MORE *) let model = new interpErrorModel dialog#treeview choices in dialog#disambiguationErrors#set_title "Disambiguation error"; dialog#disambiguationErrorsLabel#set_label @@ -352,64 +355,56 @@ let interactive_error_interp ~all_passes (MultiPassDisambiguator.DisambiguationError (offset,[[env,diff,lazy(loffset,Lazy.force msg),significant]])) )); - let return _ = - dialog#disambiguationErrors#destroy (); - GMain.Main.quit () + (match GtkThread.sync dialog#toplevel#run () with + | `OK -> + let tree_path = + match fst (dialog#treeview#get_cursor ()) with + None -> assert false + | Some tp -> tp in + let idx1,idx2,idx3 = model#get_interp_no tree_path in + let diff = + match idx2,idx3 with + Some idx2, Some idx3 -> + let _,lll = List.nth choices idx1 in + let _,envs_and_diffs,_,_ = List.nth lll idx2 in + let _,_,diff = List.nth envs_and_diffs idx3 in + diff + | _,_ -> assert false in - let fail _ = return () in - ignore(dialog#disambiguationErrors#event#connect#delete (fun _ -> true)); - connect_button dialog#disambiguationErrorsOkButton - (fun _ -> - let tree_path = - match fst (dialog#treeview#get_cursor ()) with - None -> assert false - | Some tp -> tp in - let idx1,idx2,idx3 = model#get_interp_no tree_path in - let diff = - match idx2,idx3 with - Some idx2, Some idx3 -> - let _,lll = List.nth choices idx1 in - let _,envs_and_diffs,_,_ = List.nth lll idx2 in - let _,_,diff = List.nth envs_and_diffs idx3 in - diff - | _,_ -> assert false - in - let newtxt = - String.concat "\n" - ("" :: - List.map - (fun k,desc -> - let alias = - match k with - | DisambiguateTypes.Id id -> - GrafiteAst.Ident_alias (id, desc) - | DisambiguateTypes.Symbol (symb, i)-> - GrafiteAst.Symbol_alias (symb, i, desc) - | DisambiguateTypes.Num i -> - GrafiteAst.Number_alias (i, desc) - in - GrafiteAstPp.pp_alias alias) - diff) ^ "\n" - in - source_buffer#insert - ~iter: - (source_buffer#get_iter_at_mark - (`NAME "beginning_of_statement")) newtxt ; - return () - ); - connect_button dialog#disambiguationErrorsMoreErrors - (fun _ -> return () ; raise UseLibrary); - connect_button dialog#disambiguationErrorsCancelButton fail; - dialog#disambiguationErrors#show (); - GtkThread.main () - + let newtxt = + String.concat "\n" + ("" :: + List.map + (fun k,desc -> + let alias = + match k with + | DisambiguateTypes.Id id -> + GrafiteAst.Ident_alias (id, desc) + | DisambiguateTypes.Symbol (symb, i)-> + GrafiteAst.Symbol_alias (symb, i, desc) + | DisambiguateTypes.Num i -> + GrafiteAst.Number_alias (i, desc) + in + GrafiteAstPp.pp_alias alias) + diff) ^ "\n" + in + source_buffer#insert + ~iter: + (source_buffer#get_iter_at_mark + (`NAME "beginning_of_statement")) newtxt + | `HELP (* HELP MEANS MORE *) -> + dialog#toplevel#destroy () ; + raise UseLibrary + | `DELETE_EVENT -> () + | _ -> assert false) ; + dialog#toplevel#destroy () + ) () class gui () = (* creation order _is_ relevant for windows placement *) let main = new mainWin () in let sequents_viewer = MatitaMathView.sequentsViewer_instance main#sequentsNotebook in - let fileSel = new fileSelectionWin () in let findRepl = new findReplWin () in let keyBindingBoxes = (* event boxes which should receive global key events *) [ main#mainWinEventBox ] @@ -462,6 +457,7 @@ class gui () = ~website:"http://matita.cs.unibo.it" () in + ignore(about_dialog#event#connect#delete (fun _ -> true)); ignore(about_dialog#connect#response (fun _ ->about_dialog#misc#hide ())); connect_menu_item main#contentsMenuItem (fun () -> if 0 = Sys.command "which gnome-help" then @@ -517,16 +513,10 @@ class gui () = ~callback:(fun _ -> hide_find_Repl ();true)); connect_menu_item main#undoMenuItem (fun () -> (MatitaScript.current ())#safe_undo); -(*CSC: XXX - ignore(source_view#source_buffer#connect#can_undo - ~callback:main#undoMenuItem#misc#set_sensitive); -*) main#undoMenuItem#misc#set_sensitive true; + main#undoMenuItem#misc#set_sensitive false; connect_menu_item main#redoMenuItem (fun () -> (MatitaScript.current ())#safe_redo); -(*CSC: XXX - ignore(source_view#source_buffer#connect#can_redo - ~callback:main#redoMenuItem#misc#set_sensitive); -*) main#redoMenuItem#misc#set_sensitive true; + main#redoMenuItem#misc#set_sensitive false; connect_menu_item main#editMenu (fun () -> main#copyMenuItem#misc#set_sensitive (MatitaScript.current ())#canCopy; @@ -573,7 +563,7 @@ class gui () = GtkThread.sync (fun () -> ()) () in let worker_thread = ref None in - let notify_exn (source_view : GSourceView2.source_view) exn = + let notify_exn (source_view : GSourceView3.source_view) exn = let floc, msg = MatitaExcPp.to_string exn in begin match floc with @@ -672,32 +662,6 @@ class gui () = with exc -> script#source_view#misc#grab_focus (); raise exc in - (* file selection win *) - ignore (fileSel#fileSelectionWin#event#connect#delete (fun _ -> true)); - ignore (fileSel#fileSelectionWin#connect#response (fun event -> - let return r = - chosen_file <- r; - fileSel#fileSelectionWin#misc#hide (); - GMain.Main.quit () - in - match event with - | `OK -> - let fname = fileSel#fileSelectionWin#filename in - if Sys.file_exists fname then - begin - if HExtlib.is_regular fname && not (_only_directory) then - return (Some fname) - else if _only_directory && HExtlib.is_dir fname then - return (Some fname) - end - else - begin - if _ok_not_exists then - return (Some fname) - end - | `CANCEL -> return None - | `HELP -> () - | `DELETE_EVENT -> return None)); (* menus *) List.iter (fun w -> w#misc#set_sensitive false) [ main#saveMenuItem ]; (* console *) @@ -881,6 +845,10 @@ class gui () = current_page <- page; let script = MatitaScript.at_page page in script#activate; + main#undoMenuItem#misc#set_sensitive + script#source_view#source_buffer#can_undo ; + main#redoMenuItem#misc#set_sensitive + script#source_view#source_buffer#can_redo ; main#saveMenuItem#misc#set_sensitive script#has_name)) method private externalEditor () = @@ -967,7 +935,7 @@ class gui () = save_moo script#status; true | `NO -> true - | `CANCEL -> false + | `DELETE_EVENT -> false else (save_moo script#status; true) @@ -1047,11 +1015,10 @@ class gui () = console#message ("'"^file^"' loaded."); self#_enableSaveTo file - method private _enableSaveTo file = + method private _enableSaveTo _file = self#main#saveMenuItem#misc#set_sensitive true method private console = console - method private fileSel = fileSel method private findRepl = findRepl method main = main @@ -1066,20 +1033,46 @@ class gui () = (fun _ -> callback ();true)); self#addKeyBinding GdkKeysyms._q callback + method private chooseFileOrDir ok_not_exists only_directory = + let fileSel = GWindow.file_chooser_dialog + ~action:`OPEN + ~title:"Select file" + ~modal:true + ~type_hint:`DIALOG + ~position:`CENTER + () in + fileSel#add_select_button_stock `OPEN `OK; + fileSel#add_button_stock `CANCEL `CANCEL; + ignore (fileSel#set_current_folder(Sys.getcwd ())) ; + let res = + let rec aux () = + match fileSel#run () with + | `OK -> + (match fileSel#filename with + None -> aux () + | Some fname -> + if Sys.file_exists fname then + begin + if HExtlib.is_regular fname && not (only_directory) then + Some fname + else if only_directory && HExtlib.is_dir fname then + Some fname + else + aux () + end + else if ok_not_exists then Some fname else aux ()) + | `CANCEL -> None + | `DELETE_EVENT -> None in + aux () in + fileSel#destroy () ; + res + method private chooseFile ?(ok_not_exists = false) () = - _ok_not_exists <- ok_not_exists; - _only_directory <- false; - fileSel#fileSelectionWin#show (); - GtkThread.main (); - chosen_file + self#chooseFileOrDir ok_not_exists false method private chooseDir ?(ok_not_exists = false) () = - _ok_not_exists <- ok_not_exists; - _only_directory <- true; - fileSel#fileSelectionWin#show (); - GtkThread.main (); (* we should check that this is a directory *) - chosen_file + self#chooseFileOrDir ok_not_exists true end @@ -1144,8 +1137,9 @@ class interpModel = let interactive_string_choice - text prefix_len ?(title = "") ?(msg = "") () ~id locs uris + text prefix_len ?(title = "") ?msg:(_ = "") () ~id:_ locs uris = + GtkThread.sync (fun _ -> let dialog = new uriChoiceDialog () in dialog#uriEntryHBox#misc#hide (); dialog#uriChoiceSelectedButton#misc#hide (); @@ -1154,7 +1148,7 @@ let interactive_string_choice dialog#uriChoiceTreeView#selection#set_mode (`SINGLE :> Gtk.Tags.selection_mode); let model = new stringListModel dialog#uriChoiceTreeView in - let choices = ref None in + let choices = ref [] in dialog#uriChoiceDialog#set_title title; let hack_len = MatitaGtkMisc.utf8_string_length text in let rec colorize acc_len = function @@ -1189,22 +1183,19 @@ let interactive_string_choice in dialog#uriChoiceLabel#set_label txt; List.iter model#easy_append uris; - let return v = - choices := v; - dialog#uriChoiceDialog#destroy (); - GMain.Main.quit () - in - ignore (dialog#uriChoiceDialog#event#connect#delete (fun _ -> true)); connect_button dialog#uriChoiceForwardButton (fun _ -> match model#easy_selection () with | [] -> () - | uris -> return (Some uris)); - connect_button dialog#uriChoiceAbortButton (fun _ -> return None); + | uris -> choices := uris; dialog#toplevel#response `OK); + connect_button dialog#uriChoiceAbortButton (fun _ -> dialog#toplevel#response `DELETE_EVENT); dialog#uriChoiceDialog#show (); - GtkThread.main (); - (match !choices with - | None -> raise MatitaTypes.Cancel - | Some uris -> uris) + let res = + match dialog#toplevel#run () with + | `DELETE_EVENT -> dialog#toplevel#destroy() ; raise MatitaTypes.Cancel + | `OK -> !choices + | _ -> assert false in + dialog#toplevel#destroy () ; + res) () let interactive_interp_choice () text prefix_len choices = (*List.iter (fun l -> prerr_endline "==="; List.iter (fun (_,id,dsc) -> prerr_endline (id ^ " = " ^ dsc)) l) choices;*) @@ -1271,10 +1262,8 @@ let interactive_interp_choice () text prefix_len choices = let _ = (* disambiguator callbacks *) Disambiguate.set_choose_uris_callback - (fun ~selection_mode ?ok ?(enable_button_for_non_vars=false) ~title ~msg -> + (fun ~selection_mode ?ok ?enable_button_for_non_vars:(_=false) ~title ~msg -> interactive_uri_choice ~selection_mode ?ok_label:ok ~title ~msg ()); Disambiguate.set_choose_interp_callback (interactive_interp_choice ()); (* gtk initialization *) - GtkMain.Rc.add_default_file BuildTimeConf.gtkrc_file; (* loads gtk rc *) - ignore (GMain.Main.init ()) - + GtkMain.Rc.add_default_file BuildTimeConf.gtkrc_file (* loads gtk rc *) diff --git a/matita/matita/matitaGuiInit.ml b/matita/matita/matitaGuiInit.ml new file mode 100644 index 000000000..be9d65abf --- /dev/null +++ b/matita/matita/matitaGuiInit.ml @@ -0,0 +1 @@ +ignore (GMain.Main.init ()) diff --git a/matita/matita/matitaMathView.ml b/matita/matita/matitaMathView.ml index ea9683e18..271a7b19a 100644 --- a/matita/matita/matitaMathView.ml +++ b/matita/matita/matitaMathView.ml @@ -27,9 +27,7 @@ open Printf -open GrafiteTypes open MatitaGtkMisc -open MatitaGuiTypes open CicMathView module Stack = Continuationals.Stack @@ -91,7 +89,7 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = GtkSignal.disconnect notebook#as_widget id; switch_page_callback <- None | None -> ()); - for i = 0 to pages do notebook#remove_page 0 done; + for _i = 0 to pages do notebook#remove_page 0 done; notebook#set_show_tabs true; pages <- 0; page2goal <- []; @@ -112,12 +110,8 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = scrolledWin <- Some w; (match cicMathView#misc#parent with | None -> () - | Some parent -> - let parent = - match cicMathView#misc#parent with - None -> assert false - | Some p -> GContainer.cast_container p - in + | Some p -> + let parent = GContainer.cast_container p in parent#remove cicMathView#coerce); w#add cicMathView#coerce in @@ -128,8 +122,8 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = let stack_goals = Stack.open_goals status#stack in let proof_goals = List.map fst metasenv in if - HExtlib.list_uniq (List.sort Pervasives.compare stack_goals) - <> List.sort Pervasives.compare proof_goals + HExtlib.list_uniq (List.sort compare stack_goals) + <> List.sort compare proof_goals then begin prerr_endline ("STACK GOALS = " ^ String.concat " " (List.map string_of_int stack_goals)); prerr_endline ("PROOF GOALS = " ^ String.concat " " (List.map string_of_int proof_goals)); @@ -158,7 +152,7 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = in let add_switch _ _ (_, sw) = add_tab (render_switch sw) sw in Stack.iter (** populate notebook with tabs *) - ~env:(fun depth tag (pos, sw) -> + ~env:(fun depth _tag (pos, sw) -> let markup = match depth, pos with | 0, 0 -> `Current (render_switch sw) @@ -180,12 +174,12 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = method private render_page: 'status. #ApplyTransformation.status as 'status -> page:int -> goal_switch:Stack.switch -> unit - = fun status ~page ~goal_switch -> + = fun status ~page:_ ~goal_switch -> (match goal_switch with | Stack.Open goal -> let menv,subst = _metasenv in cicMathView#nload_sequent status menv subst goal - | Stack.Closed goal -> + | Stack.Closed _goal -> let root = Lazy.force closed_goal_mathml in cicMathView#load_root ~root); (try @@ -242,12 +236,12 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history) let dir_RE = Pcre.regexp "^cic:((/([^/]+/)*[^/]+(/)?)|/|)$" in let is_uri txt = Pcre.pmatch ~rex:uri_RE txt in let is_dir txt = Pcre.pmatch ~rex:dir_RE txt in - let gui = MatitaMisc.get_gui () in + let _gui = MatitaMisc.get_gui () in let win = new MatitaGeneratedGui.browserWin () in let _ = win#browserUri#misc#grab_focus () in let gviz = LablGraphviz.graphviz ~packing:win#graphScrolledWin#add () in let searchText = - GSourceView2.source_view ~auto_indent:false ~editable:false () + GSourceView3.source_view ~auto_indent:false ~editable:false () in let _ = win#scrolledwinContent#add (searchText :> GObj.widget); @@ -326,10 +320,14 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history) close_out oc; if tred then gviz#load_graph_from_file - ~gviz_cmd:"dot -Txdot | tred |gvpack -gv | dot" filename + (* gvpack can no longer read the output of -Txdot :-( *) + (*~gviz_cmd:"dot -Txdot | tred |gvpack -gv | dot" filename*) + ~gviz_cmd:"dot -Txdot | tred | dot" filename else gviz#load_graph_from_file - ~gviz_cmd:"dot -Txdot | gvpack -gv | dot" filename; + (* gvpack can no longer read the output of -Txdot :-( *) + (*~gviz_cmd:"dot -Txdot | gvpack -gv | dot" filename;*) + ~gviz_cmd:"dot -Txdot | dot" filename; HExtlib.safe_remove filename in object (self) @@ -475,7 +473,7 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history) self#_showMath; mathView#load_root (Lazy.force empty_mathml) - method private _loadCheck term = + method private _loadCheck _term = failwith "not implemented _loadCheck"; (* self#_showMath *) @@ -486,8 +484,8 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history) method private redraw_gviz ?center_on () = if Sys.command "which dot" = 0 then let tmpfile, oc = Filename.open_temp_file "matita" ".dot" in - let fmt = Format.formatter_of_out_channel oc in - (* MATITA 1.0 MetadataDeps.DepGraph.render fmt gviz_graph;*) + (* MATITA 1.0 let fmt = Format.formatter_of_out_channel oc in + MetadataDeps.DepGraph.render fmt gviz_graph;*) close_out oc; gviz#load_graph_from_file ~gviz_cmd:"tred | dot" tmpfile; (match center_on with @@ -500,7 +498,7 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history) "the graph of dependencies amoung objects. Please install it.") ~parent:win#toplevel () - method private dependencies direction uri () = + method private dependencies _direction _uri () = assert false (* MATITA 1.0 let dbd = LibraryDb.instance () in let graph = @@ -575,7 +573,7 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history) let content = Http_getter.ls ~local:false dir in let l = List.fast_sort - Pervasives.compare + compare (List.map (function | Http_getter_types.Ls_section s -> "dir", s @@ -724,7 +722,7 @@ let find_selection_owner () = | mv :: tl -> (match mv#get_selections with | [] -> aux tl - | sel :: _ -> mv) + | _sel :: _ -> mv) in aux (get_math_views ()) diff --git a/matita/matita/matitaMisc.ml b/matita/matita/matitaMisc.ml index fe6fd3557..53d1d1f67 100644 --- a/matita/matita/matitaMisc.ml +++ b/matita/matita/matitaMisc.ml @@ -38,8 +38,8 @@ let strip_suffix ~suffix s = let absolute_path file = if file.[0] = '/' then file else Unix.getcwd () ^ "/" ^ file -let is_proof_script fname = true (** TODO Zack *) -let is_proof_object fname = true (** TODO Zack *) +let is_proof_script _fname = true (** TODO Zack *) +let is_proof_object _fname = true (** TODO Zack *) let append_phrase_sep s = if not (Pcre.pmatch ~pat:(sprintf "%s$" BuildTimeConf.phrase_sep) s) then @@ -77,8 +77,8 @@ class shell_history size = let size = size + 1 in let decr x = let x' = x - 1 in if x' < 0 then size + x' else x' in let incr x = (x + 1) mod size in - object (self) - val data = Array.create size "" + object + val data = Array.make size "" inherit basic_history (0, -1 , -1) @@ -106,7 +106,7 @@ class shell_history size = class ['a] browser_history ?memento size init = object (self) initializer match memento with Some m -> self#load m | _ -> () - val data = Array.create size init + val data = Array.make size init inherit basic_history (0, 0, 0) @@ -149,8 +149,8 @@ let list_tl_at ?(equality=(==)) e l = let rec aux = function | [] -> raise Not_found - | hd :: tl as l when equality hd e -> l - | hd :: tl -> aux tl + | hd :: _ as l when equality hd e -> l + | _ :: tl -> aux tl in aux l diff --git a/matita/matita/matitaScript.ml b/matita/matita/matitaScript.ml index de78194f0..c39e1de40 100644 --- a/matita/matita/matitaScript.ml +++ b/matita/matita/matitaScript.ml @@ -26,7 +26,6 @@ (* $Id$ *) open Printf -open GrafiteTypes module TA = GrafiteAst @@ -84,7 +83,7 @@ let eval_with_engine include_paths status skipped_txt nonskipped_txt st (fun (acc, to_prepend) (status,alias) -> match alias with | None -> (status,to_prepend ^ nonskipped_txt)::acc,"" - | Some (k,value) -> + | Some (_k,value) -> let newtxt = GrafiteAstPp.pp_alias value in (status,to_prepend ^ newtxt ^ "\n")::acc, "") ([],skipped_txt) enriched_history_fragment @@ -94,7 +93,7 @@ let eval_with_engine include_paths status skipped_txt nonskipped_txt st let pp_eager_statement_ast = GrafiteAstPp.pp_statement -let eval_nmacro include_paths (buffer : GText.buffer) status unparsed_text parsed_text script mac = +let eval_nmacro _include_paths (_buffer : GText.buffer) status _unparsed_text parsed_text script mac = let parsed_text_length = String.length parsed_text in match mac with | TA.Screenshot (_,name) -> @@ -206,12 +205,12 @@ and eval_statement include_paths (buffer : GText.buffer) status script in match st with | GrafiteAst.Executable (loc, ex) -> - let _, nonskipped, skipped, parsed_text_length = text_of_loc loc in + let _, nonskipped, skipped, _parsed_text_length = text_of_loc loc in eval_executable include_paths buffer status unparsed_text skipped nonskipped script ex loc | GrafiteAst.Comment (loc, GrafiteAst.Code (_, ex)) when Helm_registry.get_bool "matita.execcomments" -> - let _, nonskipped, skipped, parsed_text_length = text_of_loc loc in + let _, nonskipped, skipped, _parsed_text_length = text_of_loc loc in eval_executable include_paths buffer status unparsed_text skipped nonskipped script ex loc | GrafiteAst.Comment (loc, _) -> @@ -251,7 +250,7 @@ let fresh_script_id = *) class script ~(parent:GBin.scrolled_window) ~tab_label () = let source_view = - GSourceView2.source_view + GSourceView3.source_view ~auto_indent:true ~insert_spaces_instead_of_tabs:true ~tab_width:2 ~right_margin_position:80 ~show_right_margin:true @@ -260,12 +259,18 @@ let source_view = () in let buffer = source_view#buffer in let source_buffer = source_view#source_buffer in +let _ = + source_buffer#connect#notify_can_undo + ~callback:(MatitaMisc.get_gui ())#main#undoMenuItem#misc#set_sensitive in +let _ = + source_buffer#connect#notify_can_redo + ~callback:(MatitaMisc.get_gui ())#main#redoMenuItem#misc#set_sensitive in let similarsymbols_tag_name = "similarsymbolos" in let similarsymbols_tag = `NAME similarsymbols_tag_name in let initial_statuses current baseuri = let status = new MatitaEngine.status baseuri in (match current with - Some current -> NCicLibrary.time_travel status; + Some _current -> NCicLibrary.time_travel status; (* (* MATITA 1.0: there is a known bug in invalidation; temporary fix here *) NCicEnvironment.invalidate () *) @@ -347,7 +352,7 @@ object (self) false )); ignore(source_view#event#connect#button_release - ~callback:(fun button -> clean_locked := false; false)); + ~callback:(fun _button -> clean_locked := false; false)); ignore(source_view#buffer#connect#after#apply_tag ~callback:( fun tag ~start:_ ~stop:_ -> @@ -369,23 +374,21 @@ object (self) let menuItems = menu#children in let undoMenuItem, redoMenuItem = match menuItems with - [undo;redo;sep1;cut;copy;paste;delete;sep2; - selectall;sep3;inputmethod;insertunicodecharacter] -> + [undo;redo;_sep1;cut;copy;paste;delete;_sep2; + _selectall;_sep3;_inputmethod;_insertunicodecharacter] -> List.iter menu#remove [ copy; cut; delete; paste ]; undo,redo | _ -> assert false in let add_menu_item = let i = ref 2 in (* last occupied position *) - fun ?label ?stock () -> + fun ~label -> incr i; - GMenu.image_menu_item ?label ?stock ~packing:(menu#insert ~pos:!i) - () - in - let copy = add_menu_item ~stock:`COPY () in - let cut = add_menu_item ~stock:`CUT () in - let delete = add_menu_item ~stock:`DELETE () in - let paste = add_menu_item ~stock:`PASTE () in - let paste_pattern = add_menu_item ~label:"Paste as pattern" () in + GMenu.menu_item ~label ~packing:(menu#insert ~pos:!i) () in + let copy = add_menu_item ~label:"Copy" in + let cut = add_menu_item ~label:"Cut" in + let delete = add_menu_item ~label:"Delete" in + let paste = add_menu_item ~label:"Paste" in + let paste_pattern = add_menu_item ~label:"Paste as pattern" in copy#misc#set_sensitive self#canCopy; cut#misc#set_sensitive self#canCut; delete#misc#set_sensitive self#canDelete; @@ -397,24 +400,22 @@ object (self) MatitaGtkMisc.connect_menu_item paste self#paste; MatitaGtkMisc.connect_menu_item paste_pattern self#pastePattern; let new_undoMenuItem = - GMenu.image_menu_item - ~image:(GMisc.image ~stock:`UNDO ()) + GMenu.menu_item ~use_mnemonic:true ~label:"_Undo" ~packing:(menu#insert ~pos:0) () in new_undoMenuItem#misc#set_sensitive - (undoMenuItem#misc#get_flag `SENSITIVE); + undoMenuItem#misc#sensitive; menu#remove (undoMenuItem :> GMenu.menu_item); MatitaGtkMisc.connect_menu_item new_undoMenuItem (fun () -> self#safe_undo); let new_redoMenuItem = - GMenu.image_menu_item - ~image:(GMisc.image ~stock:`REDO ()) + GMenu.menu_item ~use_mnemonic:true ~label:"_Redo" ~packing:(menu#insert ~pos:1) () in new_redoMenuItem#misc#set_sensitive - (redoMenuItem#misc#get_flag `SENSITIVE); + redoMenuItem#misc#sensitive; menu#remove (redoMenuItem :> GMenu.menu_item); MatitaGtkMisc.connect_menu_item new_redoMenuItem (fun () -> self#safe_redo))); diff --git a/matita/matita/matitaScript.mli b/matita/matita/matitaScript.mli index 9958170d9..ca4b2f86d 100644 --- a/matita/matita/matitaScript.mli +++ b/matita/matita/matitaScript.mli @@ -91,7 +91,7 @@ object (** misc *) method clean_dirty_lock: unit method set_star: bool -> unit - method source_view: GSourceView2.source_view + method source_view: GSourceView3.source_view method has_parent: GObj.widget -> bool (* debug *) diff --git a/matita/matita/matitaTypes.ml b/matita/matita/matitaTypes.ml index a772ae946..092c79c98 100644 --- a/matita/matita/matitaTypes.ml +++ b/matita/matita/matitaTypes.ml @@ -25,9 +25,6 @@ (* $Id$ *) -open Printf -open GrafiteTypes - (** user hit the cancel button *) exception Cancel diff --git a/matita/matita/predefined_virtuals.ml b/matita/matita/predefined_virtuals.ml index 9efd9a61b..09bcabd57 100644 --- a/matita/matita/predefined_virtuals.ml +++ b/matita/matita/predefined_virtuals.ml @@ -1513,11 +1513,11 @@ let predefined_classes = [ ["+"; "⨭"; "⨮"; "⨁"; "⊕"; "⊞"; ]; ["-"; "÷"; "⊢"; "⊩"; "⧟"; "⊟"; ]; ["="; "≝"; "≡"; "≘"; "≗"; "≐"; "≑"; "≛"; "≚"; "≙"; "⌆"; "⧦"; "⊜"; "≋"; "⩳"; "≅"; "⩬"; "≂"; "≃"; "≈"; ]; - ["→"; "↦"; "⇝"; "⤞"; "⇾"; "⤍"; "⤏"; "⤳"; ] ; - ["⇒"; "⤇"; "➾"; "⇨"; "➡"; "⬈"; "➤"; "➸"; "⇉"; "⥰"; ] ; + ["→"; "⥲"; "↦"; "⇝"; "⤞"; "⇾"; "⤍"; "⤏"; "⤳"; ] ; + ["⇒"; "⤇"; "➾"; "⇨"; "⬀"; "➡"; "⬈"; "➤"; "➸"; "⇉"; "⥰"; ] ; ["^"; "↑"; "⇡"; ] ; ["⇑"; "⇧"; "⬆"; ] ; - ["⇓"; "⇩"; "⬇"; "⬊"; "➷"; ] ; + ["⇓"; "⇩"; "⬂"; "⬇"; "⬊"; "➷"; ] ; ["⇕"; "⇳"; "⬍"; "↕"; ]; ["↔"; "⇔"; "⬄"; "⬌"; ] ; ["≤"; "≲"; "≼"; "≰"; "≴"; "⋠"; "⊆"; "⫃"; "⊑"; ] ; @@ -1586,16 +1586,16 @@ let predefined_classes = [ ["Y"; "ϒ"; "𝕐"; "𝐘"; "𝚼"; "Ⓨ"; ] ; ["z"; "ζ"; "𝕫"; "𝐳"; "𝛇"; "ⓩ"; ] ; ["Z"; "ℨ"; "ℤ"; "𝐙"; "Ⓩ"; ] ; - ["0"; "𝟘"; "⓪"; ] ; - ["1"; "𝟙"; "①"; "⓵"; ] ; - ["2"; "𝟚"; "②"; "⓶"; ] ; - ["3"; "𝟛"; "③"; "⓷"; ] ; - ["4"; "𝟜"; "④"; "⓸"; ] ; - ["5"; "𝟝"; "⑤"; "⓹"; ] ; - ["6"; "𝟞"; "⑥"; "⓺"; ] ; - ["7"; "𝟟"; "⑦"; "⓻"; ] ; - ["8"; "𝟠"; "⑧"; "⓼"; "∞"; ] ; - ["9"; "𝟡"; "⑨"; "⓽"; ] ; + ["0"; "𝟘"; "⓪"; "𝟎"; ] ; + ["1"; "𝟙"; "①"; "⓵"; "𝟏"; ] ; + ["2"; "𝟚"; "②"; "⓶"; "𝟐"; ] ; + ["3"; "𝟛"; "③"; "⓷"; "𝟑"; ] ; + ["4"; "𝟜"; "④"; "⓸"; "𝟒"; ] ; + ["5"; "𝟝"; "⑤"; "⓹"; "𝟓"; ] ; + ["6"; "𝟞"; "⑥"; "⓺"; "𝟔"; ] ; + ["7"; "𝟟"; "⑦"; "⓻"; "𝟕"; ] ; + ["8"; "𝟠"; "⑧"; "⓼"; "𝟖"; "∞"; ] ; + ["9"; "𝟡"; "⑨"; "⓽"; "𝟗"; ] ; ] ;; diff --git a/matita/matita/virtuals.ml b/matita/matita/virtuals.ml index 229e780c2..a174ffa21 100644 --- a/matita/matita/virtuals.ml +++ b/matita/matita/virtuals.ml @@ -59,7 +59,7 @@ let similar_symbols symbol = let get_all_eqclass () = let rc = ref [] in Hashtbl.iter - (fun k v -> + (fun _k v -> if not (List.mem v !rc) then rc := v :: !rc) classes;