From: Ferruccio Guidi Date: Sun, 29 Sep 2019 20:43:50 +0000 (+0200) Subject: Merge branch 'matita-lablgtk3' of ssh://matita.cs.unibo.it:/srv/git/helm into matita... X-Git-Tag: make_still_working~229^2~1 X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=commitdiff_plain;h=db020b4218272e2e35641ce3bc3b0a9b3afda899;hp=d8f6494f48aa08bb32d9d1ac82fc16e9e41b76ac Merge branch 'matita-lablgtk3' of ssh://matita.cs.unibo.it:/srv/git/helm 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/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/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/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/grafite/grafiteAst.ml b/matita/components/grafite/grafiteAst.ml index 5d138bbe0..7750dab27 100644 --- a/matita/components/grafite/grafiteAst.ml +++ b/matita/components/grafite/grafiteAst.ml @@ -36,6 +36,8 @@ type npattern = type auto_params = nterm list option * (string*string) list +type just = [`Term of nterm | `Auto of auto_params] + type ntactic = | NApply of loc * nterm | NSmartApply of loc * nterm @@ -75,6 +77,29 @@ type ntactic = | NAssumption of loc | NRepeat of loc * ntactic | NBlock of loc * ntactic list + (* Declarative langauge *) + (* Not the best idea to use a string directly, an abstract type for identifiers would be better *) + | Assume of loc * string * nterm (* loc, identifier, type *) + | Suppose of loc * nterm * string (* loc, assumption, identifier *) + | By_just_we_proved of loc * just * nterm * string option (* loc, justification, conclusion, identifier *) + | We_need_to_prove of loc * nterm * string option (* loc, newconclusion, identifier *) + | BetaRewritingStep of loc * nterm + | Bydone of loc * just + | ExistsElim of loc * just * string * nterm * nterm * string + | AndElim of loc * just * nterm * string * nterm * string + | RewritingStep of + loc * nterm * [ `Term of nterm | `Auto of auto_params | `Proof | `SolveWith of nterm ] * bool (* last step*) + | Obtain of + loc * string * nterm + | Conclude of + loc * nterm + | Thesisbecomes of loc * nterm + | We_proceed_by_induction_on of loc * nterm * nterm + | We_proceed_by_cases_on of loc * nterm * nterm + | Byinduction of loc * nterm * string + | Case of loc * string * (string * nterm) list + (* This is a debug tactic to print the stack to stdout, can be safely removed *) + | PrintStack of loc type nmacro = | NCheck of loc * nterm diff --git a/matita/components/grafite/grafiteAstPp.ml b/matita/components/grafite/grafiteAstPp.ml index 2e088bd77..e16ce39bd 100644 --- a/matita/components/grafite/grafiteAstPp.ml +++ b/matita/components/grafite/grafiteAstPp.ml @@ -1,14 +1,14 @@ (* Copyright (C) 2004, HELM Team. - * + * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science * Department, University of Bologna, Italy. - * + * * HELM is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * HELM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -18,7 +18,7 @@ * along with HELM; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. - * + * * For details, see the HELM World-Wide-Web page, * http://helm.cs.unibo.it/ *) @@ -32,8 +32,8 @@ let tactical_terminator = "" let tactic_terminator = tactical_terminator let command_terminator = tactical_terminator -let pp_tactic_pattern status ~map_unicode_to_tex (what, hyp, goal) = - if what = None && hyp = [] && goal = None then "" else +let pp_tactic_pattern status ~map_unicode_to_tex (what, hyp, goal) = + if what = None && hyp = [] && goal = None then "" else let what_text = match what with | None -> "" @@ -51,6 +51,22 @@ let pp_tactic_pattern status ~map_unicode_to_tex (what, hyp, goal) = in Printf.sprintf "%sin %s%s" what_text hyp_text goal_text +let pp_auto_params params status = + match params with + | (None,flags) -> String.concat " " (List.map (fun a,b -> a ^ "=" ^ b) flags) + | (Some l,flags) -> (String.concat "," (List.map (NotationPp.pp_term status) l)) ^ + String.concat " " (List.map (fun a,b -> a ^ "=" ^ b) flags) +;; + +let pp_just status just = + match just with + `Term term -> "using (" ^ NotationPp.pp_term status term ^ ") " + | `Auto params -> + match params with + | (None,[]) -> "" + | params -> "by " ^ pp_auto_params params status ^ " " +;; + let rec pp_ntactic status ~map_unicode_to_tex = let pp_tactic_pattern = pp_tactic_pattern ~map_unicode_to_tex in function @@ -97,16 +113,58 @@ let rec pp_ntactic status ~map_unicode_to_tex = | NPosbyname (_, s) -> s ^ ":" | NWildcard _ -> "*:" | NMerge _ -> "]" - | NFocus (_,l) -> - Printf.sprintf "focus %s" + | NFocus (_,l) -> + Printf.sprintf "focus %s" (String.concat " " (List.map string_of_int l)) | NUnfocus _ -> "unfocus" | NSkip _ -> "skip" | NTry (_,tac) -> "ntry " ^ pp_ntactic status ~map_unicode_to_tex tac | NAssumption _ -> "nassumption" - | NBlock (_,l) -> + | NBlock (_,l) -> "(" ^ String.concat " " (List.map (pp_ntactic status ~map_unicode_to_tex) l)^ ")" | NRepeat (_,t) -> "nrepeat " ^ pp_ntactic status ~map_unicode_to_tex t + | Assume (_, ident, term) -> "assume " ^ ident ^ ":(" ^ (NotationPp.pp_term status term) ^ ")" + | Suppose (_,term,ident) -> "suppose (" ^ (NotationPp.pp_term status term) ^ ") (" ^ ident ^ ") " + | By_just_we_proved (_, just, term1, ident) -> pp_just status just ^ " we proved (" ^ + (NotationPp.pp_term status term1) ^ ")" ^ (match ident with + None -> "" | Some ident -> "(" ^ident^ ")") + | We_need_to_prove (_,term,ident) -> "we need to prove (" ^ (NotationPp.pp_term status term) ^ ") " ^ + (match ident with None -> "" | Some id -> "(" ^ id ^ ")") + | BetaRewritingStep (_,t) -> "that is equivalent to (" ^ (NotationPp.pp_term status t) ^ ")" + | Bydone (_, just) -> pp_just status just ^ "done" + | ExistsElim (_, just, ident, term, term1, ident1) -> pp_just status just ^ "let " ^ ident ^ ": (" + ^ (NotationPp.pp_term status term) ^ ") such that (" ^ (NotationPp.pp_term status term1) ^ ") (" ^ ident1 ^ ")" + | AndElim (_, just, term1, ident1, term2, ident2) -> pp_just status just ^ " we have (" ^ + (NotationPp.pp_term status term1) ^ ") (" ^ ident1 ^ ") " ^ "and (" ^ (NotationPp.pp_term status + term2) + ^ ") (" ^ ident2 ^ ")" + | Thesisbecomes (_, t) -> "the thesis becomes (" ^ (NotationPp.pp_term status t) ^ ")" + | RewritingStep (_, rhs, just, cont) -> + "= (" ^ + (NotationPp.pp_term status rhs) ^ ")" ^ + (match just with + | `Auto params -> let s = pp_auto_params params status in + if s <> "" then " by " ^ s + else "" + | `Term t -> " exact (" ^ (NotationPp.pp_term status t) ^ ")" + | `Proof -> " proof" + | `SolveWith t -> " using (" ^ (NotationPp.pp_term status t) ^ ")" + ) + ^ (if cont then " done" else "") + | Obtain (_,id,t1) -> "obtain (" ^ id ^ ")" ^ " (" ^ (NotationPp.pp_term status t1) ^ ")" + | Conclude (_,t1) -> "conclude (" ^ (NotationPp.pp_term status t1) ^ ")" + | We_proceed_by_cases_on (_, term, term1) -> "we proceed by cases on (" ^ NotationPp.pp_term + status term ^ ") to prove (" ^ NotationPp.pp_term status term1 ^ ")" + | We_proceed_by_induction_on (_, term, term1) -> "we proceed by induction on (" ^ + NotationPp.pp_term status term ^ ") to prove (" ^ NotationPp.pp_term status term1 ^ ")" + | Byinduction (_, term, ident) -> "by induction hypothesis we know (" ^ NotationPp.pp_term status + term ^ ") (" ^ ident ^ ")" + | Case (_, id, args) -> + "case " ^ id ^ + String.concat " " + (List.map (function (id,term) -> "(" ^ id ^ ": (" ^ NotationPp.pp_term status term ^ "))") + args) + | PrintStack _ -> "print_stack" ;; let pp_nmacro status = function @@ -128,7 +186,7 @@ let pp_alias = function desc | Number_alias (instance,desc) -> sprintf "alias num (instance %d) = \"%s\"." instance desc - + let pp_associativity = function | Gramext.LeftA -> "left associative" | Gramext.RightA -> "right associative" @@ -144,18 +202,18 @@ let pp_argument_pattern = function done; sprintf "%s%s" (Buffer.contents eta_buf) name -let pp_interpretation dsc symbol arg_patterns cic_appl_pattern = +let pp_interpretation dsc symbol arg_patterns cic_appl_pattern = sprintf "interpretation \"%s\" '%s %s = %s." dsc symbol (String.concat " " (List.map pp_argument_pattern arg_patterns)) (NotationPp.pp_cic_appl_pattern cic_appl_pattern) - + let pp_dir_opt = function | None -> "" | Some `LeftToRight -> "> " | Some `RightToLeft -> "< " -let pp_notation status dir_opt l1_pattern assoc prec l2_pattern = +let pp_notation status dir_opt l1_pattern assoc prec l2_pattern = sprintf "notation %s\"%s\" %s %s for %s." (pp_dir_opt dir_opt) (pp_l1_pattern status l1_pattern) @@ -164,22 +222,22 @@ let pp_notation status dir_opt l1_pattern assoc prec l2_pattern = (pp_l2_pattern status l2_pattern) let pp_ncommand status = function - | UnificationHint (_,t, n) -> + | UnificationHint (_,t, n) -> "unification hint " ^ string_of_int n ^ " " ^ NotationPp.pp_term status t | NDiscriminator (_,_) | NInverter (_,_,_,_,_) | NUnivConstraint (_) -> "not supported" | NCoercion (_) -> "not supported" - | NObj (_,obj,index) -> - (if not index then "-" else "") ^ + | NObj (_,obj,index) -> + (if not index then "-" else "") ^ NotationPp.pp_obj (NotationPp.pp_term status) obj | NQed (_,true) -> "qed" | NQed (_,false) -> "qed-" - | NCopy (_,name,uri,map) -> - "copy " ^ name ^ " from " ^ NUri.string_of_uri uri ^ " with " ^ - String.concat " and " - (List.map - (fun (a,b) -> NUri.string_of_uri a ^ " ↦ " ^ NUri.string_of_uri b) + | NCopy (_,name,uri,map) -> + "copy " ^ name ^ " from " ^ NUri.string_of_uri uri ^ " with " ^ + String.concat " and " + (List.map + (fun (a,b) -> NUri.string_of_uri a ^ " ↦ " ^ NUri.string_of_uri b) map) | Include (_,mode,path) -> (* not precise, since path is absolute *) if mode = WithPreferences then @@ -192,14 +250,14 @@ let pp_ncommand status = function | Notation (_, dir_opt, l1_pattern, assoc, prec, l2_pattern) -> pp_notation status dir_opt l1_pattern assoc prec l2_pattern ;; - + let pp_executable status ~map_unicode_to_tex = function | NMacro (_, macro) -> pp_nmacro status macro ^ "." | NTactic (_,tacl) -> String.concat " " (List.map (pp_ntactic status ~map_unicode_to_tex) tacl) | NCommand (_, cmd) -> pp_ncommand status cmd ^ "." - + let pp_comment status ~map_unicode_to_tex = function | Note (_,"") -> Printf.sprintf "\n" @@ -209,5 +267,5 @@ let pp_comment status ~map_unicode_to_tex = let pp_statement status = function - | Executable (_, ex) -> pp_executable status ex + | Executable (_, ex) -> pp_executable status ex | Comment (_, c) -> pp_comment status c diff --git a/matita/components/grafite_engine/grafiteEngine.ml b/matita/components/grafite_engine/grafiteEngine.ml index bd9e76ff2..71f036904 100644 --- a/matita/components/grafite_engine/grafiteEngine.ml +++ b/matita/components/grafite_engine/grafiteEngine.ml @@ -404,6 +404,17 @@ let eval_add_constraint status acyclic u1 u2 = ;; let eval_ng_tac tac = + let just_to_tacstatus_just just text prefix_len = + match just with + | `Term t -> `Term (text,prefix_len,t) + | `Auto (l,params) -> + ( + match l with + | None -> `Auto (None,params) + | Some l -> `Auto (Some (List.map (fun t -> (text,prefix_len,t)) l),params) + ) + | _ -> assert false + in let rec aux f (text, prefix_len, tac) = match tac with | GrafiteAst.NApply (_loc, t) -> NTactics.apply_tac (text,prefix_len,t) @@ -481,6 +492,39 @@ let eval_ng_tac tac = NTactics.block_tac (List.map (fun x -> aux f (text,prefix_len,x)) l) |GrafiteAst.NRepeat (_,tac) -> NTactics.repeat_tac (f f (text, prefix_len, tac)) + |GrafiteAst.Assume (_,id,t) -> Declarative.assume id (text,prefix_len,t) + |GrafiteAst.Suppose (_,t,id) -> Declarative.suppose (text,prefix_len,t) id + |GrafiteAst.By_just_we_proved (_,j,t1,s) -> Declarative.by_just_we_proved + (just_to_tacstatus_just j text prefix_len) (text,prefix_len,t1) s + |GrafiteAst.We_need_to_prove (_, t, id) -> Declarative.we_need_to_prove (text,prefix_len,t) id + |GrafiteAst.BetaRewritingStep (_, t) -> Declarative.beta_rewriting_step (text,prefix_len,t) + | GrafiteAst.Bydone (_, j) -> Declarative.bydone (just_to_tacstatus_just j text prefix_len) + | GrafiteAst.ExistsElim (_, just, id1, t1, t2, id2) -> + Declarative.existselim (just_to_tacstatus_just just text prefix_len) id1 (text,prefix_len,t1) + (text,prefix_len,t2) id2 + | GrafiteAst.AndElim(_,just,t1,id1,t2,id2) -> Declarative.andelim (just_to_tacstatus_just just + text prefix_len) (text,prefix_len,t1) id1 (text,prefix_len,t2) id2 + | GrafiteAst.Thesisbecomes (_, t1) -> Declarative.thesisbecomes (text,prefix_len,t1) + | GrafiteAst.RewritingStep (_,rhs,just,cont) -> + Declarative.rewritingstep (text,prefix_len,rhs) + (match just with + `Term _ + | `Auto _ -> just_to_tacstatus_just just text prefix_len + |`Proof -> `Proof + |`SolveWith t -> `SolveWith (text,prefix_len,t) + ) + cont + | GrafiteAst.Obtain (_,id,t1) -> + Declarative.obtain id (text,prefix_len,t1) + | GrafiteAst.Conclude (_,t1) -> + Declarative.conclude (text,prefix_len,t1) + | GrafiteAst.We_proceed_by_cases_on (_, t, t1) -> + Declarative.we_proceed_by_cases_on (text,prefix_len,t) (text,prefix_len,t1) + | GrafiteAst.We_proceed_by_induction_on (_, t, t1) -> + Declarative.we_proceed_by_induction_on (text,prefix_len,t) (text,prefix_len,t1) + | GrafiteAst.Byinduction (_, t, id) -> Declarative.byinduction (text,prefix_len,t) id + | GrafiteAst.Case (_,id,params) -> Declarative.case id params + | GrafiteAst.PrintStack (_) -> Declarative.print_stack in aux aux tac (* trick for non uniform recursion call *) ;; diff --git a/matita/components/grafite_parser/grafiteParser.ml b/matita/components/grafite_parser/grafiteParser.ml index be39556d8..b1e3cc733 100644 --- a/matita/components/grafite_parser/grafiteParser.ml +++ b/matita/components/grafite_parser/grafiteParser.ml @@ -81,8 +81,8 @@ let nnon_punct_of_punct = function type by_continuation = BYC_done - | BYC_weproved of N.term * string option * N.term option - | BYC_letsuchthat of string * N.term * string * N.term + | BYC_weproved of N.term * string option + | BYC_letsuchthat of string * N.term * N.term * string | BYC_wehaveand of string * N.term * string * N.term let mk_parser statement lstatus = @@ -239,6 +239,112 @@ EXTEND | SYMBOL "#"; SYMBOL "_" -> G.NTactic(loc,[ G.NIntro (loc,"_")]) | SYMBOL "*" -> G.NTactic(loc,[ G.NCase1 (loc,"_")]) | SYMBOL "*"; "as"; n=IDENT -> G.NTactic(loc,[ G.NCase1 (loc,n)]) + | IDENT "assume" ; id = IDENT; SYMBOL ":"; t = tactic_term -> G.NTactic (loc,[G.Assume (loc,id,t)]) + | IDENT "suppose" ; t = tactic_term ; LPAREN ; id = IDENT ; RPAREN -> G.NTactic (loc,[G.Suppose (loc,t,id)]) + | "let"; name = IDENT ; SYMBOL <:unicode> ; t = tactic_term -> + G.NTactic(loc,[G.NLetIn (loc,(None,[],Some N.UserInput),t,name)]) + | just = + [ IDENT "using"; t=tactic_term -> `Term t + | params = auto_params -> + let just,params = params in + `Auto + (match just with + | None -> (None,params) + | Some (`Univ univ) -> (Some univ,params) + (* `Trace behaves exaclty like None for the moment being *) + | Some (`Trace) -> (None,params) + ) + ]; + cont=by_continuation -> G.NTactic (loc,[ + (match cont with + BYC_done -> G.Bydone (loc, just) + | BYC_weproved (ty,id) -> + G.By_just_we_proved(loc, just, ty, id) + | BYC_letsuchthat (id1,t1,t2,id2) -> + G.ExistsElim (loc, just, id1, t1, t2, id2) + | BYC_wehaveand (id1,t1,id2,t2) -> + G.AndElim (loc, just, t1, id1, t2, id2)) + ]) + | IDENT "we" ; IDENT "need" ; "to" ; IDENT "prove" ; t = tactic_term ; id = OPT [ LPAREN ; id = IDENT ; RPAREN -> id ] -> + G.NTactic (loc,[G.We_need_to_prove (loc, t, id)]) + | IDENT "that" ; IDENT "is" ; IDENT "equivalent" ; "to" ; t = tactic_term -> G.NTactic(loc,[G.BetaRewritingStep (loc,t)]) + | IDENT "the" ; IDENT "thesis" ; IDENT "becomes" ; t1=tactic_term -> G.NTactic (loc,[G.Thesisbecomes(loc,t1)]) + | IDENT "we" ; IDENT "proceed" ; IDENT "by" ; IDENT "cases" ; "on" ; t=tactic_term ; "to" ; IDENT "prove" ; t1=tactic_term -> + G.NTactic (loc,[G.We_proceed_by_cases_on (loc, t, t1)]) + | IDENT "we" ; IDENT "proceed" ; IDENT "by" ; IDENT "induction" ; "on" ; t=tactic_term ; "to" ; IDENT "prove" ; t1=tactic_term -> + G.NTactic (loc,[G.We_proceed_by_induction_on (loc, t, t1)]) + | IDENT "by" ; IDENT "induction" ; IDENT "hypothesis" ; IDENT "we" ; IDENT "know" ; t=tactic_term ; LPAREN ; id = IDENT ; RPAREN -> + G.NTactic (loc,[G.Byinduction(loc, t, id)]) + | IDENT "case" ; id = IDENT ; params=LIST0[LPAREN ; i=IDENT ; + SYMBOL":" ; t=tactic_term ; RPAREN -> i,t] -> + G.NTactic (loc,[G.Case(loc,id,params)]) + | IDENT "print_stack" -> G.NTactic (loc,[G.PrintStack loc]) + (* DO NOT FACTORIZE with the two following, camlp5 sucks*) +(* + | IDENT "conclude"; + termine = tactic_term; + SYMBOL "=" ; + t1=tactic_term ; + t2 = + [ IDENT "using"; t=tactic_term -> `Term t + | IDENT "using"; IDENT "once"; term=tactic_term -> `SolveWith term + | IDENT "proof" -> `Proof + | params = auto_params -> `Auto + ( + let just,params = params in + match just with + | None -> (None,params) + | Some (`Univ univ) -> (Some univ,params) + (* `Trace behaves exaclty like None for the moment being *) + | Some (`Trace) -> (None,params) + ) + ]; + cont = rewriting_step_continuation -> + G.NTactic (loc,[G.RewritingStep(loc, Some (None,termine), t1, t2, cont)]) + | IDENT "obtain" ; name = IDENT; + termine = tactic_term; + SYMBOL "=" ; + t1=tactic_term ; + t2 = + [ IDENT "using"; t=tactic_term -> `Term t + | IDENT "using"; IDENT "once"; term=tactic_term -> `SolveWith term + | IDENT "proof" -> `Proof + | params = auto_params -> `Auto + ( + let just,params = params in + match just with + | None -> (None,params) + | Some (`Univ univ) -> (Some univ,params) + (* `Trace behaves exaclty like None for the moment being *) + | Some (`Trace) -> (None,params) + ) + ]; + cont = rewriting_step_continuation -> + G.NTactic(loc,[G.RewritingStep(loc, Some (Some name,termine), t1, t2, cont)]) +*) + | IDENT "obtain" ; name = IDENT; + termine = tactic_term -> + G.NTactic(loc,[G.Obtain(loc, name, termine)]) + | IDENT "conclude" ; termine = tactic_term -> + G.NTactic(loc,[G.Conclude(loc, termine)]) + | SYMBOL "=" ; + t1=tactic_term ; + t2 = + [ IDENT "using"; t=tactic_term -> `Term t + | IDENT "using"; IDENT "once"; term=tactic_term -> `SolveWith term + | IDENT "proof" -> `Proof + | params = auto_params -> `Auto + ( + let just,params = params in + match just with + | None -> (None,params) + | Some (`Univ univ) -> (Some univ,params) + (* `Trace behaves exaclty like None for the moment being *) + | Some (`Trace) -> (None,params) + ) + ]; + cont = rewriting_step_continuation -> + G.NTactic(loc,[G.RewritingStep(loc, t1, t2, cont)]) ] ]; auto_fixed_param: [ @@ -263,27 +369,23 @@ EXTEND ] ]; -(* MATITA 1.0 by_continuation: [ - [ WEPROVED; ty = tactic_term ; LPAREN ; id = IDENT ; RPAREN ; t1 = OPT [IDENT "that" ; IDENT "is" ; IDENT "equivalent" ; "to" ; t2 = tactic_term -> t2] -> BYC_weproved (ty,Some id,t1) - | WEPROVED; ty = tactic_term ; t1 = OPT [IDENT "that" ; IDENT "is" ; IDENT "equivalent" ; "to" ; t2 = tactic_term -> t2] ; - "done" -> BYC_weproved (ty,None,t1) + [ WEPROVED; ty = tactic_term ; id = OPT [ LPAREN ; id = IDENT ; RPAREN -> id] -> BYC_weproved (ty,id) | "done" -> BYC_done | "let" ; id1 = IDENT ; SYMBOL ":" ; t1 = tactic_term ; IDENT "such" ; IDENT "that" ; t2=tactic_term ; LPAREN ; - id2 = IDENT ; RPAREN -> BYC_letsuchthat (id1,t1,id2,t2) + id2 = IDENT ; RPAREN -> BYC_letsuchthat (id1,t1,t2,id2) | WEHAVE; t1=tactic_term ; LPAREN ; id1=IDENT ; RPAREN ;"and" ; t2=tactic_term ; LPAREN ; id2=IDENT ; RPAREN -> BYC_wehaveand (id1,t1,id2,t2) ] ]; -*) -(* MATITA 1.0 + rewriting_step_continuation : [ [ "done" -> true | -> false ] ]; -*) + (* MATITA 1.0 atomic_tactical: [ "sequence" LEFTA diff --git a/matita/components/ng_extraction/mlutil.ml b/matita/components/ng_extraction/mlutil.ml index 01a0cd85d..9f553762a 100644 --- a/matita/components/ng_extraction/mlutil.ml +++ b/matita/components/ng_extraction/mlutil.ml @@ -1242,7 +1242,7 @@ and ml_size_array l = Array.fold_left (fun a t -> a + ml_size t) 0 l*) let n = List.length i in let cand = lift n cand in let cand = pop n (non_stricts add cand t) in - List.merge (compare) 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 diff --git a/matita/components/ng_tactics/.depend b/matita/components/ng_tactics/.depend index 90de5733d..57784f373 100644 --- a/matita/components/ng_tactics/.depend +++ b/matita/components/ng_tactics/.depend @@ -1,6 +1,11 @@ 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 nCicElim.cmi : diff --git a/matita/components/ng_tactics/.depend.opt b/matita/components/ng_tactics/.depend.opt index c8999df5a..75b2d57f8 100644 --- a/matita/components/ng_tactics/.depend.opt +++ b/matita/components/ng_tactics/.depend.opt @@ -1,5 +1,8 @@ continuationals.cmx : continuationals.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 : nCicTacReduction.cmx : nCicTacReduction.cmi diff --git a/matita/components/ng_tactics/Makefile b/matita/components/ng_tactics/Makefile index 3a261d192..b7a98406f 100644 --- a/matita/components/ng_tactics/Makefile +++ b/matita/components/ng_tactics/Makefile @@ -7,6 +7,7 @@ INTERFACE_FILES = \ nCicElim.mli \ nTactics.mli \ nnAuto.mli \ + declarative.mli \ nDestructTac.mli \ nInversion.mli diff --git a/matita/components/ng_tactics/continuationals.ml b/matita/components/ng_tactics/continuationals.ml index b10877130..dc54c89dd 100644 --- a/matita/components/ng_tactics/continuationals.ml +++ b/matita/components/ng_tactics/continuationals.ml @@ -35,21 +35,23 @@ let fail msg = raise (Error msg) type goal = int +type parameters = (string * string) list + module Stack = struct type switch = Open of goal | Closed of goal type locator = int * switch type tag = [ `BranchTag | `FocusTag | `NoTag ] - type entry = locator list * locator list * locator list * tag + type entry = locator list * locator list * locator list * tag * parameters type t = entry list - let empty = [ [], [], [], `NoTag ] + let empty = [ [], [], [], `NoTag , []] let fold ~env ~cont ~todo init stack = let rec aux acc depth = function | [] -> acc - | (locs, todos, conts, tag) :: 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 @@ -64,10 +66,10 @@ struct let map ~env ~cont ~todo = let depth = ref ~-1 in List.map - (fun (s, t, c, tag) -> + (fun (s, t, c, tag, p) -> incr depth; let d = !depth in - env d tag s, todo d tag t, cont d tag c, tag) + env d tag s, todo d tag t, cont d tag c, tag, p) let is_open = function _, Open _ -> true | _ -> false let close = function n, Open g -> n, Closed g | l -> l @@ -103,39 +105,39 @@ struct let rec find_goal = function | [] -> raise (Failure "Continuationals.find_goal") - | (l :: _, _ , _ , _) :: _ -> goal_of_loc l - | ( _ , _ , l :: _, _) :: _ -> goal_of_loc l - | ( _ , l :: _, _ , _) :: _ -> goal_of_loc l + | (l :: _, _ , _ , _, _) :: _ -> goal_of_loc l + | ( _ , _ , l :: _, _, _) :: _ -> goal_of_loc l + | ( _ , l :: _, _ , _, _) :: _ -> goal_of_loc l | _ :: tl -> find_goal tl let is_empty = function | [] -> assert false - | [ [], [], [], `NoTag ] -> true + | [ [], [], [], `NoTag , _] -> true | _ -> false let of_nmetasenv metasenv = let goals = List.map (fun (g, _) -> g) metasenv in - [ zero_pos goals, [], [], `NoTag ] + [ zero_pos goals, [], [], `NoTag , []] let head_switches = function - | (locs, _, _, _) :: _ -> List.map switch_of_loc locs + | (locs, _, _, _, _) :: _ -> List.map switch_of_loc locs | [] -> assert false let head_goals = function - | (locs, _, _, _) :: _ -> List.map goal_of_loc locs + | (locs, _, _, _, _) :: _ -> List.map goal_of_loc locs | [] -> assert false let head_tag = function - | (_, _, _, tag) :: _ -> tag + | (_, _, _, tag, _) :: _ -> tag | [] -> assert false let shift_goals = function - | _ :: (locs, _, _, _) :: _ -> List.map goal_of_loc locs + | _ :: (locs, _, _, _, _) :: _ -> List.map goal_of_loc locs | [] -> assert false | _ -> [] @@ -163,9 +165,10 @@ struct let pp_loc (i, s) = string_of_int i ^ pp_switch s in let pp_env env = sprintf "[%s]" (String.concat ";" (List.map pp_loc env)) in let pp_tag = function `BranchTag -> "B" | `FocusTag -> "F" | `NoTag -> "N" in - let pp_stack_entry (env, todo, cont, tag) = - sprintf "(%s, %s, %s, %s)" (pp_env env) (pp_env todo) (pp_env cont) - (pp_tag tag) + let pp_par = function [] -> "" | _ as l -> List.fold_left (fun acc (k,v) -> acc ^ "K: " ^ k ^ " V: " ^ v ^ "; ") "" l in + let pp_stack_entry (env, todo, cont, tag, parameters) = + sprintf "(%s, %s, %s, %s, %s)" (pp_env env) (pp_env todo) (pp_env cont) + (pp_tag tag) (pp_par parameters) in String.concat " :: " (List.map pp_stack_entry stack) end @@ -270,7 +273,7 @@ struct let ostatus, stack = match cmd, stack with | _, [] -> assert false - | Tactical tac, (g, t, k, tag) :: s -> + | Tactical tac, (g, t, k, tag, p) :: s -> (* COMMENTED OUT TO ALLOW PARAMODULATION TO DO A * auto paramodulation.try assumption. * EVEN IF NO GOALS ARE LEFT OPEN BY AUTO. @@ -300,49 +303,49 @@ struct debug_print (lazy ("closed: " ^ String.concat " " (List.map string_of_int gcn))); let stack = - (zero_pos gon, t @~- gcn, k @~- gcn, tag) :: deep_close gcn s + (zero_pos gon, t @~- gcn, k @~- gcn, tag, p) :: deep_close gcn s in sn, stack - | Dot, ([], _, [], _) :: _ -> + | Dot, ([], _, [], _, _) :: _ -> (* backward compatibility: do-nothing-dot *) new_stack stack - | Dot, (g, t, k, tag) :: s -> + | Dot, (g, t, k, tag, p) :: s -> (match filter_open g, k with - | loc :: loc_tl, _ -> new_stack (([ loc ], t, loc_tl @+ k, tag) :: s) + | loc :: loc_tl, _ -> new_stack (([ loc ], t, loc_tl @+ k, tag, p) :: s) | [], loc :: k -> assert (is_open loc); - new_stack (([ loc ], t, k, tag) :: s) + new_stack (([ loc ], t, k, tag, p) :: s) | _ -> fail (lazy "can't use \".\" here")) | Semicolon, _ -> new_stack stack - | Branch, (g, t, k, tag) :: s -> + | Branch, (g, t, k, tag, p) :: s -> (match init_pos g with | [] | [ _ ] -> fail (lazy "too few goals to branch"); | loc :: loc_tl -> new_stack - (([ loc ], [], [], `BranchTag) :: (loc_tl, t, k, tag) :: s)) - | Shift, (g, t, k, `BranchTag) :: (g', t', k', tag) :: s -> + (([ loc ], [], [], `BranchTag, []) :: (loc_tl, t, k, tag,p) :: s)) + | Shift, (g, t, k, `BranchTag, p) :: (g', t', k', tag, p') :: s -> (match g' with | [] -> fail (lazy "no more goals to shift") | loc :: loc_tl -> new_stack - (([ loc ], t @+ filter_open g @+ k, [],`BranchTag) - :: (loc_tl, t', k', tag) :: s)) + (([ loc ], t @+ filter_open g @+ k, [],`BranchTag, p) + :: (loc_tl, t', k', tag, p') :: s)) | Shift, _ -> fail (lazy "can't shift goals here") - | Pos i_s, ([ loc ], t, [],`BranchTag) :: (g', t', k', tag) :: s + | Pos i_s, ([ loc ], t, [],`BranchTag, p) :: (g', t', k', tag, p') :: s when is_fresh loc -> let l_js = List.filter (fun (i, _) -> List.mem i i_s) ([loc] @+ g') in new_stack - ((l_js, t , [],`BranchTag) - :: (([ loc ] @+ g') @- l_js, t', k', tag) :: s) + ((l_js, t , [],`BranchTag, p) + :: (([ loc ] @+ g') @- l_js, t', k', tag, p') :: s) | Pos _, _ -> fail (lazy "can't use relative positioning here") - | Wildcard, ([ loc ] , t, [], `BranchTag) :: (g', t', k', tag) :: s + | Wildcard, ([ loc ] , t, [], `BranchTag, p) :: (g', t', k', tag, p') :: s when is_fresh loc -> new_stack - (([loc] @+ g', t, [], `BranchTag) - :: ([], t', k', tag) :: s) + (([loc] @+ g', t, [], `BranchTag, p) + :: ([], t', k', tag, p') :: s) | Wildcard, _ -> fail (lazy "can't use wildcard here") - | Merge, (g, t, k,`BranchTag) :: (g', t', k', tag) :: s -> - new_stack ((t @+ filter_open g @+ g' @+ k, t', k', tag) :: s) + | Merge, (g, t, k,`BranchTag,_) :: (g', t', k', tag,p') :: s -> + new_stack ((t @+ filter_open g @+ g' @+ k, t', k', tag, p') :: s) | Merge, _ -> fail (lazy "can't merge goals here") | Focus [], _ -> assert false | Focus gs, s -> @@ -355,8 +358,8 @@ struct if not (List.exists (fun l -> goal_of_loc l = g) stack_locs) then fail (lazy (sprintf "goal %d not found (or closed)" g))) gs; - new_stack ((zero_pos gs, [], [], `FocusTag) :: deep_close gs s) - | Unfocus, ([], [], [], `FocusTag) :: s -> new_stack s + new_stack ((zero_pos gs, [], [], `FocusTag, []) :: deep_close gs s) + | Unfocus, ([], [], [], `FocusTag, _) :: s -> new_stack s | Unfocus, _ -> fail (lazy "can't unfocus, some goals are still open") in debug_print (lazy (sprintf "EVAL CONT %s -> %s" (pp_t cmd) (pp stack))); diff --git a/matita/components/ng_tactics/continuationals.mli b/matita/components/ng_tactics/continuationals.mli index 1dcf4aa7d..d3fdf716c 100644 --- a/matita/components/ng_tactics/continuationals.mli +++ b/matita/components/ng_tactics/continuationals.mli @@ -29,12 +29,15 @@ type goal = int (** {2 Goal stack} *) +(* Key value pairs *) +type parameters = (string * string) list + module Stack: sig type switch = Open of goal | Closed of goal type locator = int * switch type tag = [ `BranchTag | `FocusTag | `NoTag ] - type entry = locator list * locator list * locator list * tag + type entry = locator list * locator list * locator list * tag * parameters type t = entry list val empty: t diff --git a/matita/components/ng_tactics/declarative.ml b/matita/components/ng_tactics/declarative.ml new file mode 100644 index 000000000..d96e66811 --- /dev/null +++ b/matita/components/ng_tactics/declarative.ml @@ -0,0 +1,636 @@ +(* Copyright (C) 2019, HELM Team. + * + * This file is part of HELM, an Hypertextual, Electronic + * Library of Mathematics, developed at the Computer Science + * Department, University of Bologna, Italy. + * + * HELM is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * HELM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with HELM; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + * + * For details, see the HELM World-Wide-Web page, + * http://cs.unibo.it/helm/. +*) + +open Continuationals.Stack +module Ast = NotationPt +open NTactics +open NTacStatus + +type just = [ `Term of NTacStatus.tactic_term | `Auto of NnAuto.auto_params ] + +let mk_just status goal = + function + `Auto (l,params) -> NnAuto.auto_lowtac ~params:(l,params) status goal + | `Term t -> apply_tac t + +exception NotAProduct +exception FirstTypeWrong +exception NotEquivalentTypes + +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 -> + let goals = filter_open g1 in + match goals with + [] -> fail (lazy "No goals under focus") + | 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 + term_of_cic_term status gty ctx +;; + +let alpha_eq_tacterm_kerterm ty t status goal = + let gty = get_goalty status goal in + let ctx = ctx_of gty in + let status,cicterm = disambiguate status ctx ty `XTNone (*(`XTSome (mk_cic_term ctx t))*) in + let (_,_,metasenv,subst,_) = status#obj in + let status,ty = term_of_cic_term status cicterm ctx in + if NCicReduction.alpha_eq status metasenv subst ctx t ty then + true + else + false +;; + +let are_convertible ty1 ty2 status goal = + let gty = get_goalty status goal in + let ctx = ctx_of gty in + let status,cicterm1 = disambiguate status ctx ty1 `XTNone in + let status,cicterm2 = disambiguate status ctx ty2 `XTNone in + NTacStatus.are_convertible status ctx cicterm1 cicterm2 + +let clear_volatile_params_tac status = + match status#stack with + [] -> fail (lazy "Empty stack") + | (g,t,k,tag,p)::tl -> + let rec remove_volatile = function + [] -> [] + | (k,_v as hd')::tl' -> + let re = Str.regexp "volatile_.*" in + if Str.string_match re k 0 then + remove_volatile tl' + else + hd'::(remove_volatile tl') + in + let newp = remove_volatile p in + status#set_stack ((g,t,k,tag,newp)::tl) +;; + +let add_parameter_tac key value status = + match status#stack with + [] -> status + | (g,t,k,tag,p) :: tl -> status#set_stack ((g,t,k,tag,(key,value)::p)::tl) +;; + + +(* LCF-like tactic that checks whether the conclusion of the sequent of the given goal is a product, checks that + the type of the conclusion's bound variable is the same as t1 and then uses an exact_tac with + \lambda id: t1. ?. If a t2 is given it checks that t1 ~_{\beta} t2 and uses and exact_tac with \lambda id: t2. ? +*) +let lambda_abstract_tac id t1 status goal = + match extract_conclusion_type status goal with + | 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 + `JustOne))); clear_volatile_params_tac; + add_parameter_tac "volatile_newhypo" id] status + else + raise FirstTypeWrong + | _ -> raise NotAProduct + +let assume name ty status = + let goal = extract_first_goal_from_status status in + try lambda_abstract_tac name ty status goal + with + | NotAProduct -> fail (lazy "You can't assume without an universal quantification") + | FirstTypeWrong -> fail (lazy "The assumed type is wrong") + | NotEquivalentTypes -> fail (lazy "The two given types are not equivalent") +;; + +let suppose t1 id status = + let goal = extract_first_goal_from_status status in + try lambda_abstract_tac id t1 status goal + with + | NotAProduct -> fail (lazy "You can't suppose without a logical implication") + | FirstTypeWrong -> fail (lazy "The supposed proposition is different from the premise") + | NotEquivalentTypes -> fail (lazy "The two given propositions are not equivalent") +;; + +let assert_tac t1 t2 status goal continuation = + 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 + if res then continuation + else + raise NotEquivalentTypes + else + raise FirstTypeWrong + +let branch_dot_tac status = + match status#stack with + ([],t,k,tag,p) :: tl -> + if List.length t > 0 then + status#set_stack (([List.hd t],List.tl t,k,tag,p)::tl) + else + status + | _ -> status +;; + +let status_parameter key status = + match status#stack with + [] -> "" + | (_g,_t,_k,_tag,p)::_ -> try List.assoc key p with _ -> "" +;; + +let beta_rewriting_step t status = + let ctx = status_parameter "volatile_context" status in + if ctx <> "beta_rewrite" then + ( + let newhypo = status_parameter "volatile_newhypo" status in + if newhypo = "" then + fail (lazy "Invalid use of 'or equivalently'") + else + change_tac ~where:("",0,(None,[newhypo,Ast.UserInput],None)) ~with_what:t status + ) + else + change_tac ~where:("",0,(None,[],Some + Ast.UserInput)) ~with_what:t status +;; + +let done_continuation status = + let rec continuation l = + match l with + [] -> [] + | (_,t,_,tag,p)::tl -> + if tag = `BranchTag then + if List.length t > 0 then + let continue = + let ctx = + try List.assoc "context" p + with Not_found -> "" + in + ctx <> "induction" && ctx <> "cases" + in + if continue then [clear_volatile_params_tac;branch_dot_tac] else + [clear_volatile_params_tac] + else + [merge_tac] @ (continuation tl) + else + [] + in + continuation status#stack +;; + +let bydone just status = + let goal = extract_first_goal_from_status status in + let continuation = done_continuation status in + let l = [mk_just status goal just] @ continuation in + block_tac l status +;; + +let push_goals_tac status = + match status#stack with + [] -> fail (lazy "Error pushing goals") + | (g1,t1,k1,tag1,p1) :: (g2,t2,k2,tag2,p2) :: tl -> + if List.length g2 > 0 then + status#set_stack ((g1,t1 @+ g2,k1,tag1,p1) :: ([],t2,k2,tag2,p2) :: tl) + else status (* Nothing to push *) + | _ -> status + +let we_need_to_prove t id status = + let goal = extract_first_goal_from_status status in + match id with + | None -> + ( + try assert_tac t None status goal (add_parameter_tac "volatile_context" "beta_rewrite" status) + with + | FirstTypeWrong -> fail (lazy "The given proposition is not the same as the conclusion") + ) + | Some id -> + ( + block_tac [clear_volatile_params_tac; cut_tac t; branch_tac; shift_tac; intro_tac id; merge_tac; branch_tac; + push_goals_tac; add_parameter_tac "volatile_context" "beta_rewrite" + ] status + ) +;; + +let by_just_we_proved just ty id status = + let goal = extract_first_goal_from_status status in + let just = mk_just status goal just in + match id with + | None -> + assert_tac ty None status goal (block_tac [clear_volatile_params_tac; add_parameter_tac + "volatile_context" "beta_rewrite"] status) + | Some id -> + ( + block_tac [cut_tac ty; branch_tac; just; shift_tac; intro_tac id; merge_tac; + clear_volatile_params_tac; add_parameter_tac "volatile_newhypo" id] status + ) +;; + +let existselim just id1 t1 t2 id2 status = + let goal = extract_first_goal_from_status status in + let (_,_,t1) = t1 in + let (_,_,t2) = t2 in + let just = mk_just status goal just in + (block_tac [ + cut_tac ("",0,(Ast.Appl [Ast.Ident ("ex",None); t1; Ast.Binder (`Lambda,(Ast.Ident + (id1,None), Some t1),t2)])); + branch_tac ~force:false; + just; + shift_tac; + case1_tac "_"; + intros_tac ~names_ref:(ref []) [id1;id2]; + merge_tac; + clear_volatile_params_tac + ]) status +;; + +let andelim just t1 id1 t2 id2 status = + let goal = extract_first_goal_from_status status in + let (_,_,t1) = t1 in + let (_,_,t2) = t2 in + let just = mk_just status goal just in + (block_tac [ + cut_tac ("",0,(Ast.Appl [Ast.Ident ("And",None); t1 ; t2])); + branch_tac ~force:false; + just; + shift_tac; + case1_tac "_"; + intros_tac ~names_ref:(ref []) [id1;id2]; + merge_tac; + clear_volatile_params_tac + ]) status +;; + +let type_of_tactic_term status ctx t = + let status,cicterm = disambiguate status ctx t `XTNone in + let (_,cicty) = typeof status ctx cicterm in + cicty + +let swap_first_two_goals_tac status = + let gstatus = + match status#stack with + | [] -> assert false + | (g,t,k,tag,p) :: s -> + match g with + | (loc1) :: (loc2) :: tl -> + ([loc2;loc1] @+ tl,t,k,tag,p) :: s + | _ -> assert false + in + status#set_stack gstatus + +let thesisbecomes t1 = we_need_to_prove t1 None +;; + +let obtain id t1 status = + let goal = extract_first_goal_from_status status in + let cicgty = get_goalty status goal in + let ctx = ctx_of cicgty in + let cicty = type_of_tactic_term status ctx t1 in + let _,ty = term_of_cic_term status cicty ctx in + let (_,_,t1) = t1 in + block_tac [ cut_tac ("",0,(Ast.Appl [Ast.Ident ("eq",None); Ast.NCic ty; t1; Ast.Implicit + `JustOne])); + swap_first_two_goals_tac; + branch_tac; shift_tac; shift_tac; intro_tac id; merge_tac; branch_tac; push_goals_tac; + add_parameter_tac "volatile_context" "rewrite" + ] + status +;; + +let conclude t1 status = + let goal = extract_first_goal_from_status status in + let cicgty = get_goalty status goal in + let ctx = ctx_of cicgty in + let _,gty = term_of_cic_term status cicgty ctx in + match gty with + (* The first term of this Appl should probably be "eq" *) + NCic.Appl [_;_;plhs;_] -> + if alpha_eq_tacterm_kerterm t1 plhs status goal then + add_parameter_tac "volatile_context" "rewrite" status + else + fail (lazy "The given conclusion is different from the left-hand side of the current conclusion") + | _ -> fail (lazy "Your conclusion needs to be an equality") +;; + +let rewritingstep rhs just last_step status = + let ctx = status_parameter "volatile_context" status in + if ctx = "rewrite" then + ( + let goal = extract_first_goal_from_status status in + let cicgty = get_goalty status goal in + let ctx = ctx_of cicgty in + let _,gty = term_of_cic_term status cicgty ctx in + let cicty = type_of_tactic_term status ctx rhs in + let _,ty = term_of_cic_term status cicty ctx in + let just' = (* Extraction of the ""justification"" from the ad hoc justification *) + match just with + `Auto (univ, params) -> + let params = + if not (List.mem_assoc "timeout" params) then + ("timeout","3")::params + else params + in + let params' = + if not (List.mem_assoc "paramodulation" params) then + ("paramodulation","1")::params + else params + in + if params = params' then NnAuto.auto_lowtac ~params:(univ, params) status goal + else + first_tac [NnAuto.auto_lowtac ~params:(univ, params) status goal; NnAuto.auto_lowtac + ~params:(univ, params') status goal] + | `Term just -> apply_tac just + | `SolveWith term -> NnAuto.demod_tac ~params:(Some [term], ["all","1";"steps","1"; "use_ctx","false"]) + | `Proof -> id_tac + in + let plhs,prhs,prepare = + match gty with (* Extracting the lhs and rhs of the previous equality *) + NCic.Appl [_;_;plhs;prhs] -> plhs,prhs,(fun continuation -> continuation status) + | _ -> fail (lazy "You are not building an equaility chain") + in + let continuation = + if last_step then + let todo = [just'] @ (done_continuation status) in + block_tac todo + else + let (_,_,rhs) = rhs in + block_tac [apply_tac ("",0,Ast.Appl [Ast.Ident ("trans_eq",None); Ast.NCic ty; Ast.NCic plhs; + rhs; Ast.NCic prhs]); branch_tac; just'; merge_tac] + in + prepare continuation + ) + else + fail (lazy "You are not building an equality chain") +;; + +let rec pp_metasenv_names (metasenv:NCic.metasenv) = + match metasenv with + [] -> "" + | hd :: tl -> + let n,conj = hd in + let meta_attrs,_,_ = conj in + let rec find_name_aux meta_attrs = match meta_attrs with + [] -> "Anonymous" + | hd :: tl -> match hd with + `Name n -> n + | _ -> find_name_aux tl + in + let name = find_name_aux meta_attrs + in + "[Goal: " ^ (string_of_int n) ^ ", Name: " ^ name ^ "]; " ^ (pp_metasenv_names tl) +;; + +let print_goals_names_tac s (status:#NTacStatus.tac_status) = + let (_,_,metasenv,_,_) = status#obj in + prerr_endline (s ^" -> Metasenv: " ^ (pp_metasenv_names metasenv)); 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) +;; + +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) = 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 + in + let new_goals = + (* It's important that this tactic is called before branching and right after the creation of + * 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 -> + let rec sublist n = function + [] -> [] + | hd :: tl -> if n = 0 then [] else hd :: (sublist (n-1) tl) + in + List.map (fun _,sw -> goal_of_switch sw) (sublist (List.length !cl) g) + in + let rec add_names_to_goals g cl metasenv = + match g,cl with + [],[] -> metasenv + | hd::tl, (_,consname,_)::tl' -> + add_names_to_goals tl tl' (add_name_to_goal consname hd metasenv) + | _,_ -> fail (lazy "There are less goals than constructors") + in + let (olduri,oldint,metasenv,oldsubst,oldkind) = status#obj in + let newmetasenv = add_names_to_goals new_goals !cl metasenv + in status#set_obj(olduri,oldint,newmetasenv,oldsubst,oldkind) +;; +(* + let (olduri,oldint,metasenv,oldsubst,oldkind) = status#obj in + let remove_name_from_metaattrs = + List.filter (function `Name _ -> false | _ -> true) in + let rec add_names_to_metasenv cl metasenv = + match cl,metasenv with + [],_ -> metasenv + | hd :: tl, mhd :: mtl -> + let _,consname,_ = hd in + let gnum,conj = mhd in + let mattrs,ctx,t = conj in + let mattrs = [`Name consname] @ (remove_name_from_metaattrs mattrs) + in + let newconj = mattrs,ctx,t in + let newmeta = gnum,newconj in + newmeta :: (add_names_to_metasenv tl mtl) + | _,[] -> assert false + in + let newmetasenv = add_names_to_metasenv !cl metasenv in + status#set_obj (olduri,oldint,newmetasenv,oldsubst,oldkind) +*) + +let unfocus_branch_tac status = + match status#stack with + [] -> status + | (g,t,k,tag,p) :: tl -> status#set_stack (([],g @+ t,k,tag,p)::tl) +;; + +let we_proceed_by_induction_on t1 t2 status = + let goal = extract_first_goal_from_status status in + let txt,len,t1 = t1 in + let t1 = txt, len, Ast.Appl [t1; Ast.Implicit `Vector] in + let indtyinfo = ref None in + let sort = ref (NCic.Rel 1) in + let cl = ref [] in (* this is a ref on purpose, as the block of code after sort_of_goal_tac in + block_tac acts as a block of asynchronous code, in which cl gets modified with the info retrieved + with analize_indty_tac, and later used to label each new goal with a costructor name. Using a + plain list this doesn't seem to work, as add_names_to_goals_tac would immediately act on an empty + list, instead of acting on the list of constructors *) + try + assert_tac t2 None status goal (block_tac [ + analyze_indty_tac ~what:t1 indtyinfo; + sort_of_goal_tac sort; + (fun status -> + let ity = HExtlib.unopt !indtyinfo in + let NReference.Ref (uri, _) = ref_of_indtyinfo ity in + let name = + NUri.name_of_uri uri ^ "_" ^ + snd (NCicElim.ast_of_sort + (match !sort with NCic.Sort x -> x | _ -> assert false)) + in + let eliminator = + let l = [Ast.Ident (name,None)] in + (* Generating an implicit for each argument of the inductive type, plus one the + * predicate, plus an implicit for each constructor of the inductive type *) + let l = l @ HExtlib.mk_list (Ast.Implicit `JustOne) (ity.leftno+1+ity.consno) in + let _,_,t1 = t1 in + let l = l @ [t1] in + Ast.Appl l + in + cl := ity.cl; + exact_tac ("",0,eliminator) status); + add_names_to_goals_tac cl; + branch_tac; + push_goals_tac; + unfocus_branch_tac; + add_parameter_tac "context" "induction" + ] status) + with + | FirstTypeWrong -> fail (lazy "What you want to prove is different from the conclusion") +;; + +let we_proceed_by_cases_on ((txt,len,ast1) as t1) t2 status = + let goal = extract_first_goal_from_status status in + let npt1 = txt, len, Ast.Appl [ast1; Ast.Implicit `Vector] in + let indtyinfo = ref None in + let cl = ref [] in + try + assert_tac t2 None status goal (block_tac [ + analyze_indty_tac ~what:npt1 indtyinfo; + cases_tac ~what:t1 ~where:("",0,(None,[],Some + Ast.UserInput)); + ( + fun status -> + let ity = HExtlib.unopt !indtyinfo in + cl := ity.cl; add_names_to_goals_tac cl status + ); + branch_tac; push_goals_tac; + unfocus_branch_tac; + add_parameter_tac "context" "cases" + ] status) + with + | FirstTypeWrong -> fail (lazy "What you want to prove is different from the conclusion") +;; + +let byinduction t1 id = suppose t1 id ;; + +let name_of_conj conj = + let mattrs,_,_ = conj in + let rec search_name mattrs = + match mattrs with + [] -> "Anonymous" + | hd::tl -> + match hd with + `Name n -> n + | _ -> search_name tl + in + search_name mattrs + +let rec loc_of_goal goal l = + match l with + [] -> fail (lazy "Reached the end") + | hd :: tl -> + let _,sw = hd in + let g = goal_of_switch sw in + if g = goal then hd + else loc_of_goal goal tl +;; + +let has_focused_goal status = + match status#stack with + [] -> false + | ([],_,_,_,_) :: _tl -> false + | _ -> true +;; + +let focus_on_case_tac case status = + let (_,_,metasenv,_,_) = status#obj in + let rec goal_of_case case metasenv = + match metasenv with + [] -> fail (lazy "The given case does not exist") + | (goal,conj) :: tl -> + if name_of_conj conj = case then goal + else goal_of_case case tl + in + let goal_to_focus = goal_of_case case metasenv in + let gstatus = + match status#stack with + [] -> fail (lazy "There is nothing to prove") + | (g,t,k,tag,p) :: s -> + let loc = + try + loc_of_goal goal_to_focus t + with _ -> fail (lazy "The given case is not part of the current induction/cases analysis + context") + in + let curloc = if has_focused_goal status then + let goal = extract_first_goal_from_status status in + [loc_of_goal goal g] + else [] + in + (((g @- curloc) @+ [loc]),(curloc @+ (t @- [loc])),k,tag,p) :: s + in + status#set_stack gstatus +;; + +let case id l status = + let ctx = status_parameter "context" status in + if ctx <> "induction" && ctx <> "cases" then fail (lazy "You can't use case outside of an + induction/cases analysis context") +else + ( + if has_focused_goal status then fail (lazy "Finish the current case before switching") + else + ( +(* + let goal = extract_first_goal_from_status status in + let (_,_,metasenv,_,_) = status#obj in + let conj = NCicUtils.lookup_meta goal metasenv in + let name = name_of_conj conj in +*) + let continuation = + let rec aux l = + match l with + [] -> [id_tac] + | (id,ty)::tl -> + (try_tac (assume id ("",0,ty))) :: (aux tl) + in + aux l + in +(* if name = id then block_tac continuation status *) +(* else *) + block_tac ([focus_on_case_tac id] @ continuation) status + ) + ) +;; + +let print_stack status = prerr_endline ("PRINT STACK: " ^ (pp status#stack)); id_tac status ;; + +(* vim: ts=2: sw=0: et: + * *) diff --git a/matita/components/ng_tactics/declarative.mli b/matita/components/ng_tactics/declarative.mli new file mode 100644 index 000000000..f6863be27 --- /dev/null +++ b/matita/components/ng_tactics/declarative.mli @@ -0,0 +1,48 @@ +(* Copyright (C) 2019, HELM Team. + * + * This file is part of HELM, an Hypertextual, Electronic + * Library of Mathematics, developed at the Computer Science + * Department, University of Bologna, Italy. + * + * HELM is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * HELM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with HELM; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + * + * For details, see the HELM World-Wide-Web page, + * http://cs.unibo.it/helm/. + *) + +type just = [ `Term of NTacStatus.tactic_term | `Auto of NnAuto.auto_params ] + +val assume : string -> NTacStatus.tactic_term -> 's NTacStatus.tactic +val suppose : NTacStatus.tactic_term -> string -> 's NTacStatus.tactic +val we_need_to_prove : NTacStatus.tactic_term -> string option -> 's NTacStatus.tactic +val beta_rewriting_step : NTacStatus.tactic_term -> 's NTacStatus.tactic +val bydone : just -> 's NTacStatus.tactic +val by_just_we_proved : just -> NTacStatus.tactic_term -> string option -> 's NTacStatus.tactic +val andelim : just -> NTacStatus.tactic_term -> string -> NTacStatus.tactic_term -> string -> 's +NTacStatus.tactic +val existselim : just -> string -> NTacStatus.tactic_term -> NTacStatus.tactic_term -> string -> 's +NTacStatus.tactic +val thesisbecomes : NTacStatus.tactic_term -> 's NTacStatus.tactic +val rewritingstep : NTacStatus.tactic_term -> [ `Term of NTacStatus.tactic_term | `Auto of NnAuto.auto_params + | `Proof | `SolveWith of NTacStatus.tactic_term ] -> + bool (* last step *) -> 's NTacStatus.tactic +val we_proceed_by_cases_on: NTacStatus.tactic_term -> NTacStatus.tactic_term -> 's NTacStatus.tactic +val we_proceed_by_induction_on: NTacStatus.tactic_term -> NTacStatus.tactic_term -> 's NTacStatus.tactic +val byinduction: NTacStatus.tactic_term -> string -> 's NTacStatus.tactic +val case: string -> (string*NotationPt.term) list -> 's NTacStatus.tactic +val obtain: string -> NTacStatus.tactic_term -> 's NTacStatus.tactic +val conclude: NTacStatus.tactic_term -> 's NTacStatus.tactic +val print_stack : 's NTacStatus.tactic diff --git a/matita/components/ng_tactics/nTacStatus.ml b/matita/components/ng_tactics/nTacStatus.ml index fc525c84a..118261af0 100644 --- a/matita/components/ng_tactics/nTacStatus.ml +++ b/matita/components/ng_tactics/nTacStatus.ml @@ -232,6 +232,15 @@ let normalize status ?delta ctx t = status, (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 res = NCicReduction.are_convertible status metasenv subst ctx a b in + status, res +;; +let are_convertible a b c d = wrap "are_convertible" (are_convertible a b c) d;; + let unify status ctx a b = let status, (_,a) = relocate status ctx a in let status, (_,b) = relocate status ctx b in @@ -460,7 +469,7 @@ let analyse_indty status ty = let _,_,_,cl = List.nth tl i in let consno = List.length cl in let left, right = HExtlib.split_nth lno args in - status, (ref, consno, left, right) + status, (ref, consno, left, right, cl) ;; let apply_subst status ctx t = diff --git a/matita/components/ng_tactics/nTacStatus.mli b/matita/components/ng_tactics/nTacStatus.mli index da50ea2ac..e47700484 100644 --- a/matita/components/ng_tactics/nTacStatus.mli +++ b/matita/components/ng_tactics/nTacStatus.mli @@ -75,7 +75,7 @@ val disambiguate: val analyse_indty: #pstatus as 'status -> cic_term -> - 'status * (NReference.reference * int * NCic.term list * NCic.term list) + 'status * (NReference.reference * int * NCic.term list * NCic.term list * NCic.constructor list) val ppterm: #pstatus -> cic_term -> string val ppcontext: #pstatus -> NCic.context -> string @@ -85,6 +85,8 @@ val whd: val normalize: #pstatus as 'status -> ?delta:int -> NCic.context -> cic_term -> 'status * cic_term +val are_convertible: + #pstatus as 'status -> NCic.context -> cic_term -> cic_term -> 'status * bool val typeof: #pstatus as 'status -> NCic.context -> cic_term -> 'status * cic_term val unify: diff --git a/matita/components/ng_tactics/nTactics.ml b/matita/components/ng_tactics/nTactics.ml index 1aba2be9d..11427e9a7 100644 --- a/matita/components/ng_tactics/nTactics.ml +++ b/matita/components/ng_tactics/nTactics.ml @@ -31,16 +31,16 @@ let dot_tac status = let gstatus = match status#stack with | [] -> assert false - | ([], _, [], _) :: _ as stack -> + | ([], _, [], _, _) :: _ as stack -> (* backward compatibility: do-nothing-dot *) stack - | (g, t, k, tag) :: s -> + | (g, t, k, tag, p) :: s -> match filter_open g, k with | loc :: loc_tl, _ -> - (([ loc ], t, loc_tl @+ k, tag) :: s) + (([ loc ], t, loc_tl @+ k, tag, p) :: s) | [], loc :: k -> assert (is_open loc); - (([ loc ], t, k, tag) :: s) + (([ loc ], t, k, tag, p) :: s) | _ -> fail (lazy "can't use \".\" here") in status#set_stack gstatus @@ -50,12 +50,12 @@ let branch_tac ?(force=false) status = let gstatus = match status#stack with | [] -> assert false - | (g, t, k, tag) :: s -> + | (g, t, k, tag, p) :: s -> match init_pos g with (* TODO *) | [] -> fail (lazy "empty goals") - | [_] when (not force) -> fail (lazy "too few goals to branch") + | [_] when (not force) -> fail (lazy "too few goals to branch") | loc :: loc_tl -> - ([ loc ], [], [], `BranchTag) :: (loc_tl, t, k, tag) :: s + ([ loc ], [], [], `BranchTag, []) :: (loc_tl, t, k, tag, p) :: s in status#set_stack gstatus ;; @@ -63,12 +63,12 @@ let branch_tac ?(force=false) status = let shift_tac status = let gstatus = match status#stack with - | (g, t, k, `BranchTag) :: (g', t', k', tag) :: s -> + | (g, t, k, `BranchTag, p) :: (g', t', k', tag, p') :: s -> (match g' with | [] -> fail (lazy "no more goals to shift") | loc :: loc_tl -> - (([ loc ], t @+ filter_open g @+ k, [],`BranchTag) - :: (loc_tl, t', k', tag) :: s)) + (([ loc ], t @+ filter_open g @+ k, [],`BranchTag, p) + :: (loc_tl, t', k', tag, p') :: s)) | _ -> fail (lazy "can't shift goals here") in status#set_stack gstatus @@ -78,11 +78,11 @@ let pos_tac i_s status = let gstatus = match status#stack with | [] -> assert false - | ([ loc ], t, [],`BranchTag) :: (g', t', k', tag) :: s + | ([ loc ], t, [],`BranchTag, p) :: (g', t', k', tag, p') :: s when is_fresh loc -> let l_js = List.filter (fun (i, _) -> List.mem i i_s) ([loc] @+ g') in - ((l_js, t , [],`BranchTag) - :: (([ loc ] @+ g') @- l_js, t', k', tag) :: s) + ((l_js, t , [],`BranchTag, p) + :: (([ loc ] @+ g') @- l_js, t', k', tag, p') :: s) | _ -> fail (lazy "can't use relative positioning here") in status#set_stack gstatus @@ -92,7 +92,7 @@ let case_tac lab status = let gstatus = match status#stack with | [] -> assert false - | ([ loc ], t, [],`BranchTag) :: (g', t', k', tag) :: s + | ([ loc ], t, [],`BranchTag, p) :: (g', t', k', tag, p') :: s when is_fresh loc -> let l_js = List.filter @@ -101,8 +101,8 @@ let case_tac lab status = match NCicUtils.lookup_meta (goal_of_loc curloc) metasenv with attrs,_,_ when List.mem (`Name lab) attrs -> true | _ -> false) ([loc] @+ g') in - ((l_js, t , [],`BranchTag) - :: (([ loc ] @+ g') @- l_js, t', k', tag) :: s) + ((l_js, t , [],`BranchTag, p) + :: (([ loc ] @+ g') @- l_js, t', k', tag, p') :: s) | _ -> fail (lazy "can't use relative positioning here") in status#set_stack gstatus @@ -112,9 +112,9 @@ let wildcard_tac status = let gstatus = match status#stack with | [] -> assert false - | ([ loc ] , t, [], `BranchTag) :: (g', t', k', tag) :: s + | ([ loc ] , t, [], `BranchTag, p) :: (g', t', k', tag, p') :: s when is_fresh loc -> - (([loc] @+ g', t, [], `BranchTag) :: ([], t', k', tag) :: s) + (([loc] @+ g', t, [], `BranchTag, p) :: ([], t', k', tag, p') :: s) | _ -> fail (lazy "can't use wildcard here") in status#set_stack gstatus @@ -124,8 +124,8 @@ let merge_tac status = let gstatus = match status#stack with | [] -> assert false - | (g, t, k,`BranchTag) :: (g', t', k', tag) :: s -> - ((t @+ filter_open g @+ g' @+ k, t', k', tag) :: s) + | (g, t, k,`BranchTag, _) :: (g', t', k', tag, p) :: s -> + ((t @+ filter_open g @+ g' @+ k, t', k', tag, p) :: s) | _ -> fail (lazy "can't merge goals here") in status#set_stack gstatus @@ -145,7 +145,7 @@ let focus_tac gs status = if not (List.exists (fun l -> goal_of_loc l = g) stack_locs) then fail (lazy (sprintf "goal %d not found (or closed)" g))) gs; - (zero_pos gs, [], [], `FocusTag) :: deep_close gs s + (zero_pos gs, [], [], `FocusTag, []) :: deep_close gs s in status#set_stack gstatus ;; @@ -154,7 +154,7 @@ let unfocus_tac status = let gstatus = match status#stack with | [] -> assert false - | (g, [], [], `FocusTag) :: s when filter_open g = [] -> s + | (g, [], [], `FocusTag, _) :: s when filter_open g = [] -> s | _ as s -> fail (lazy ("can't unfocus, some goals are still open:\n"^ Continuationals.Stack.pp s)) in @@ -165,12 +165,12 @@ let skip_tac status = let gstatus = match status#stack with | [] -> assert false - | (gl, t, k, tag) :: s -> + | (gl, t, k, tag, p) :: s -> let gl = List.map switch_of_loc gl in if List.exists (function Open _ -> true | Closed _ -> false) gl then fail (lazy "cannot skip an open goal") else - ([],t,k,tag) :: s + ([],t,k,tag,p) :: s in status#set_stack gstatus ;; @@ -219,7 +219,7 @@ let change_stack_type (status : 'a #NTacStatus.status) (stack: 'b) : 'b NTacStat ;; let exec tac (low_status : #lowtac_status) g = - let stack = [ [0,Open g], [], [], `NoTag ] in + let stack = [ [0,Open g], [], [], `NoTag, [] ] in let status = change_stack_type low_status stack in let status = tac status in (low_status#set_pstatus status)#set_obj status#obj @@ -228,7 +228,7 @@ let exec tac (low_status : #lowtac_status) g = let distribute_tac tac (status : #tac_status) = match status#stack with | [] -> assert false - | (g, t, k, tag) :: s -> + | (g, t, k, tag, p) :: s -> debug_print (lazy ("context length " ^string_of_int (List.length g))); let rec aux s go gc = function @@ -258,7 +258,7 @@ let distribute_tac tac (status : #tac_status) = debug_print (lazy ("closed: " ^ String.concat " " (List.map string_of_int gcn))); let stack = - (zero_pos gon, t @~- gcn, k @~- gcn, tag) :: deep_close gcn s + (zero_pos gon, t @~- gcn, k @~- gcn, tag, p) :: deep_close gcn s in ((status#set_stack stack)#set_obj(sn:>lowtac_status)#obj)#set_pstatus sn ;; @@ -492,6 +492,7 @@ type indtyinfo = { leftno: int; consno: int; reference: NReference.reference; + cl: NCic.constructor list; } ;; @@ -502,11 +503,12 @@ 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) = 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 { rightno = rightno; leftno = leftno; consno = consno; reference = r; + cl = cl; }; exec id_tac orig_status goal) ;; @@ -522,6 +524,33 @@ let sort_of_goal_tac sortref = distribute_tac (fun status goal -> status) ;; +let pp_ref reference = + let NReference.Ref (uri,spec) = reference in + let nstring = NUri.string_of_uri uri in + (*"Shareno: " ^ (string_of_int nuri) ^*) "Uri: " ^ nstring ^ + (match spec with + | NReference.Decl -> "Decl" + | NReference.Def n -> "Def " ^ (string_of_int n) + | NReference.Fix (n1,n2,n3) -> "Fix " ^ (string_of_int n1) ^ " " ^ (string_of_int n2) ^ " " ^ (string_of_int n3)(* fixno, recparamno, height *) + | NReference.CoFix n -> "CoFix " ^ (string_of_int n) + | NReference.Ind (b,n1,n2) -> "Ind " ^ (string_of_bool b) ^ " " ^ (string_of_int n1) ^ " " ^ (string_of_int n2)(* inductive, indtyno, leftno *) + | NReference.Con (n1,n2,n3) -> "Con " ^ (string_of_int n1) ^ " " ^ (string_of_int n2) ^ " " ^ (string_of_int n3)(* indtyno, constrno, leftno *) + ) ;; + +let pp_cl cl = + let rec pp_aux acc = + match acc with + | [] -> "" + | (_,consname,_) :: tl -> consname ^ ", " ^ pp_aux tl + in + pp_aux cl +;; + +let pp_indtyinfo ity = "leftno: " ^ (string_of_int ity.leftno) ^ ", consno: " ^ (string_of_int + ity.consno) ^ ", rightno: " ^ + (string_of_int ity.rightno) ^ ", reference: " ^ (pp_ref ity.reference) ^ ", + cl: " ^ (pp_cl ity.cl);; + let elim_tac ~what:(txt,len,what) ~where = let what = txt, len, Ast.Appl [what; Ast.Implicit `Vector] in let indtyinfo = ref None in @@ -597,7 +626,7 @@ let cases ~what status goal = let gty = get_goalty status goal in let status, what = disambiguate status (ctx_of gty) what `XTInd in let status, ty = typeof status (ctx_of what) what in - let status, (ref, consno, _, _) = analyse_indty status ty in + let status, (ref, consno, _, _,_) = analyse_indty status ty in let status, what = term_of_cic_term status what (ctx_of gty) in let t = NCic.Match (ref,NCic.Implicit `Term, what, @@ -628,7 +657,7 @@ let case1_tac name = let constructor_tac ?(num=1) ~args = distribute_tac (fun status goal -> let gty = get_goalty status goal in - let status, (r,consno,_,_) = analyse_indty status gty in + let status, (r,consno,_,_,_) = analyse_indty status gty in if num < 1 || num > consno then fail (lazy "Non existant constructor"); let ref = NReference.mk_constructor num r in let t = diff --git a/matita/components/ng_tactics/nTactics.mli b/matita/components/ng_tactics/nTactics.mli index 5290a322e..6fb14f7b8 100644 --- a/matita/components/ng_tactics/nTactics.mli +++ b/matita/components/ng_tactics/nTactics.mli @@ -13,6 +13,7 @@ val print_tac: bool -> string -> 's NTacStatus.tactic +val id_tac: 's NTacStatus.tactic val dot_tac: 's NTacStatus.tactic val branch_tac: ?force:bool -> 's NTacStatus.tactic val shift_tac: 's NTacStatus.tactic @@ -75,7 +76,14 @@ val atomic_tac : NTacStatus.tac_status NTacStatus.tactic -> 's NTacStatus.tactic (*(NTacStatus.tac_status -> 'c #NTacStatus.status) -> (#NTacStatus.tac_status as 'f) -> 'f*) -type indtyinfo +(* type indtyinfo *) +type indtyinfo = { + rightno: int; + leftno: int; + consno: int; + reference: NReference.reference; + cl: NCic.constructor list; + } val ref_of_indtyinfo : indtyinfo -> NReference.reference @@ -89,3 +97,7 @@ val find_in_context : 'a -> ('a * 'b) list -> int val inversion_tac: what:NTacStatus.tactic_term -> where:NTacStatus.tactic_pattern -> 's NTacStatus.tactic + +val exact_tac: NTacStatus.tactic_term -> 's NTacStatus.tactic +val first_tac: 's NTacStatus.tactic list -> 's NTacStatus.tactic +val sort_of_goal_tac: NCic.term ref -> 's NTacStatus.tactic diff --git a/matita/components/ng_tactics/nnAuto.ml b/matita/components/ng_tactics/nnAuto.ml index 0f11cab74..3ac6040dc 100644 --- a/matita/components/ng_tactics/nnAuto.ml +++ b/matita/components/ng_tactics/nnAuto.ml @@ -54,7 +54,7 @@ let incr_uses tbl item = let toref f tbl t = match t with | Ast.NRef n -> - f tbl n + f tbl n | Ast.NCic _ (* local candidate *) | _ -> () @@ -82,7 +82,7 @@ let print_stat _status tbl = "; uses = " ^ (string_of_int !(v.uses)) ^ "; nom = " ^ (string_of_int !(v.nominations)) in lazy ("\n\nSTATISTICS:\n" ^ - String.concat "\n" (List.map vstring l)) + String.concat "\n" (List.map vstring l)) (* ======================= utility functions ========================= *) module IntSet = Set.Make(struct type t = int let compare = compare end) @@ -238,7 +238,7 @@ let solve f status eq_cache goal = debug_print (lazy ("refining: "^(status#ppterm ctx subst metasenv pt))); let stamp = Unix.gettimeofday () in let metasenv, subst, pt, pty = - (* NCicRefiner.typeof status + (* NCicRefiner.typeof status (* (status#set_coerc_db NCicCoercion.empty_db) *) metasenv subst ctx pt None in debug_print (lazy ("refined: "^(status#ppterm ctx subst metasenv pt))); @@ -259,14 +259,14 @@ let solve f status eq_cache goal = NCicRefiner.RefineFailure msg | NCicRefiner.Uncertain msg -> debug_print (lazy ("WARNING U: refining in fast_eq_check failed\n" ^ - snd (Lazy.force msg) ^ - "\n in the environment\n" ^ - status#ppmetasenv subst metasenv)); None + snd (Lazy.force msg) ^ + "\n in the environment\n" ^ + status#ppmetasenv subst metasenv)); None | NCicRefiner.AssertFailure msg -> debug_print (lazy ("WARNING F: refining in fast_eq_check failed" ^ Lazy.force msg ^ - "\n in the environment\n" ^ - status#ppmetasenv subst metasenv)); None + "\n in the environment\n" ^ + status#ppmetasenv subst metasenv)); None | Sys.Break as e -> raise e | _ -> None in @@ -292,7 +292,10 @@ let auto_eq_check eq_cache status = | Error _ -> debug_print (lazy ("no paramod proof found"));[] ;; -let index_local_equations eq_cache status = +let index_local_equations eq_cache ?(flag=false) status = + if flag then + NCicParamod.empty_state + else begin noprint (lazy "indexing equations"); let open_goals = head_goals status#stack in let open_goal = List.hd open_goals in @@ -316,9 +319,10 @@ let index_local_equations eq_cache status = | NCicTypeChecker.TypeCheckerFailure _ | NCicTypeChecker.AssertFailure _ -> eq_cache) eq_cache ctx + end ;; -let index_local_equations2 eq_cache status open_goal lemmas 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 @@ -575,13 +579,13 @@ let saturate_to_ref status metasenv subst ctx nref ty = NCicMetaSubst.saturate status ~delta:height metasenv subst ctx ty 0 in match ty with | NCic.Const(NReference.Ref (_,NReference.Def _) as nre) - when nre<>nref -> - let _, _, bo, _, _, _ = NCicEnvironment.get_checked_def status nre in - aux metasenv bo (args@moreargs) + when nre<>nref -> + let _, _, bo, _, _, _ = NCicEnvironment.get_checked_def status nre in + aux metasenv bo (args@moreargs) | NCic.Appl(NCic.Const(NReference.Ref (_,NReference.Def _) as nre)::tl) - when nre<>nref -> - let _, _, bo, _, _, _ = NCicEnvironment.get_checked_def status nre in - aux metasenv (NCic.Appl(bo::tl)) (args@moreargs) + when nre<>nref -> + let _, _, bo, _, _, _ = NCicEnvironment.get_checked_def status nre in + aux metasenv (NCic.Appl(bo::tl)) (args@moreargs) | _ -> ty,metasenv,(args@moreargs) in aux metasenv ty [] @@ -598,9 +602,9 @@ let smart_apply t unit_eq status g = match gty with | NCic.Const(nref) | NCic.Appl(NCic.Const(nref)::_) -> - saturate_to_ref status metasenv subst ctx nref ty + saturate_to_ref status metasenv subst ctx nref ty | _ -> - NCicMetaSubst.saturate status metasenv subst ctx ty 0 in + NCicMetaSubst.saturate status metasenv subst ctx ty 0 in let metasenv,j,inst,_ = NCicMetaSubst.mk_meta metasenv ctx `IsTerm in let status = status#set_obj (n,h,metasenv,subst,o) in let pterm = if args=[] then t else @@ -892,6 +896,7 @@ type flags = { do_types : bool; (* solve goals in Type *) last : bool; (* last goal: take first solution only *) candidates: Ast.term list option; + local_candidates: bool; maxwidth : int; maxsize : int; maxdepth : int; @@ -908,20 +913,20 @@ type cache = let add_to_trace status ~depth cache t = match t with | Ast.NRef _ -> - debug_print ~depth (lazy ("Adding to trace: " ^ NotationPp.pp_term status t)); - {cache with trace = t::cache.trace} + debug_print ~depth (lazy ("Adding to trace: " ^ NotationPp.pp_term status t)); + {cache with trace = t::cache.trace} | Ast.NCic _ (* local candidate *) | _ -> (*not an application *) cache let pptrace status tr = (lazy ("Proof Trace: " ^ (String.concat ";" - (List.map (NotationPp.pp_term status) tr)))) + (List.map (NotationPp.pp_term status) tr)))) (* not used let remove_from_trace cache t = match t with | Ast.NRef _ -> - (match cache.trace with - | _::tl -> {cache with trace = tl} + (match cache.trace with + | _::tl -> {cache with trace = tl} | _ -> assert false) | Ast.NCic _ (* local candidate *) | _ -> (*not an application *) cache *) @@ -982,7 +987,7 @@ let sort_candidates status ctx candidates = let ty = NCicTypeChecker.typeof status subst metasenv ctx t in let res = branch status (mk_cic_term ctx ty) in noprint (lazy ("branch factor for: " ^ (ppterm status ct) ^ " = " - ^ (string_of_int res))); + ^ (string_of_int res))); res in let candidates = List.map (fun t -> branch t,t) candidates in @@ -990,7 +995,7 @@ let sort_candidates status ctx candidates = List.sort (fun (a,_) (b,_) -> a - b) candidates in let candidates = List.map snd candidates in noprint (lazy ("candidates =\n" ^ (String.concat "\n" - (List.map (NotationPp.pp_term status) candidates)))); + (List.map (NotationPp.pp_term status) candidates)))); candidates let sort_new_elems l = @@ -1000,12 +1005,12 @@ let rec stack_goals level gs = if level = 0 then [] else match gs with | [] -> assert false - | (g,_,_,_)::s -> + | (g,_,_,_,_)::s -> let is_open = function | (_,Continuationals.Stack.Open i) -> Some i | (_,Continuationals.Stack.Closed _) -> None in - HExtlib.filter_map is_open g @ stack_goals (level-1) s + HExtlib.filter_map is_open g @ stack_goals (level-1) s ;; let open_goals level status = stack_goals level status#stack @@ -1045,7 +1050,7 @@ let try_candidate ?(smart=0) _flags depth status eq_cache _ctx t = (* some flexibility *) if og_no - old_og_no > res then (debug_print (lazy ("branch factor for: " ^ (ppterm status cict) ^ " = " - ^ (string_of_int res) ^ " vs. " ^ (string_of_int og_no))); + ^ (string_of_int res) ^ " vs. " ^ (string_of_int og_no))); debug_print ~depth (lazy "strange application"); None) else *) (incr candidate_no; Some ((!candidate_no,t),status)) @@ -1065,14 +1070,14 @@ let type0= NUri.uri_of_string ("cic:/matita/pts/Type0.univ") let perforate_small status subst metasenv context t = let rec aux = function | NCic.Appl (hd::tl) -> - let map t = - let s = sort_of status subst metasenv context t in - match s with - | NCic.Sort(NCic.Type [`Type,u]) - when u=type0 -> NCic.Meta (0,(0,NCic.Irl 0)) - | _ -> aux t - in - NCic.Appl (hd::List.map map tl) + let map t = + let s = sort_of status subst metasenv context t in + match s with + | NCic.Sort(NCic.Type [`Type,u]) + when u=type0 -> NCic.Meta (0,(0,NCic.Irl 0)) + | _ -> aux t + in + NCic.Appl (hd::List.map map tl) | t -> t in aux t @@ -1087,17 +1092,25 @@ let get_cands retrieve_for diff empty gty weak_gty = cands, diff more_cands cands ;; +let is_a_needed_uri s = + s = "cic:/matita/basics/logic/eq.ind" || + s = "cic:/matita/basics/logic/sym_eq.con" || + s = "cic:/matita/basics/logic/trans_eq.con" || + s = "cic:/matita/basics/logic/eq_f3.con" || + 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 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 status, t = term_of_cic_term status gty context in - let t = NCicReduction.whd status subst context t in - match t with - | NCic.Prod _ -> true, false - | _ -> false, NCicParamod.is_equation status metasenv subst context t + let status, t = term_of_cic_term status gty context in + let t = NCicReduction.whd status subst context t in + match t with + | NCic.Prod _ -> true, false + | _ -> false, NCicParamod.is_equation status metasenv subst context t in debug_print ~depth (lazy ("gty:" ^ NTacStatus.ppterm status gty)); let is_eq = @@ -1106,46 +1119,62 @@ let get_candidates ?(smart=true) ~pfailed depth flags status cache _signature gt let raw_weak_gty, weak_gty = if smart then match raw_gty with - | NCic.Appl _ - | NCic.Const _ - | NCic.Rel _ -> + | NCic.Appl _ + | NCic.Const _ + | NCic.Rel _ -> let raw_weak = perforate_small status subst metasenv context raw_gty in let weak = mk_cic_term context raw_weak in noprint ~depth (lazy ("weak_gty:" ^ NTacStatus.ppterm status weak)); Some raw_weak, Some (weak) - | _ -> None,None + | _ -> None,None else None,None in (* we now compute global candidates *) let global_cands, smart_global_cands = - let mapf s = - let to_ast = function - | NCic.Const r when true - (*is_relevant statistics r*) -> Some (Ast.NRef r) - (* | NCic.Const _ -> None *) - | _ -> assert false in - HExtlib.filter_map - to_ast (NDiscriminationTree.TermSet.elements s) in - let g,l = - get_cands - (NDiscriminationTree.DiscriminationTree.retrieve_unifiables universe) - NDiscriminationTree.TermSet.diff - NDiscriminationTree.TermSet.empty - raw_gty raw_weak_gty in - mapf g, mapf l in + let mapf s = + let to_ast = function + | NCic.Const r when true + (*is_relevant statistics r*) -> Some (Ast.NRef r) + (* | NCic.Const _ -> None *) + | _ -> assert false in + HExtlib.filter_map + to_ast (NDiscriminationTree.TermSet.elements s) in + let g,l = + get_cands + (NDiscriminationTree.DiscriminationTree.retrieve_unifiables universe) + NDiscriminationTree.TermSet.diff + NDiscriminationTree.TermSet.empty + raw_gty raw_weak_gty in + mapf g, mapf l + in + let global_cands,smart_global_cands = + if flags.local_candidates then global_cands,smart_global_cands + else let filter = List.filter (function Ast.NRef NReference.Ref (uri,_) -> is_a_needed_uri + (NUri.string_of_uri + uri) | _ -> false) + in filter global_cands,filter smart_global_cands + in (* we now compute local candidates *) let local_cands,smart_local_cands = let mapf s = let to_ast t = - let _status, t = term_of_cic_term status t context - in Ast.NCic t in - List.map to_ast (Ncic_termSet.elements s) in + let _status, t = term_of_cic_term status t context + in Ast.NCic t in + List.map to_ast (Ncic_termSet.elements s) in let g,l = get_cands - (fun ty -> search_in_th ty cache) - Ncic_termSet.diff Ncic_termSet.empty gty weak_gty in - mapf g, mapf l in + (fun ty -> search_in_th ty cache) + Ncic_termSet.diff Ncic_termSet.empty gty weak_gty in + mapf g, mapf l + in + let local_cands,smart_local_cands = + if flags.local_candidates then local_cands,smart_local_cands + else let filter = List.filter (function Ast.NRef NReference.Ref (uri,_) -> is_a_needed_uri + (NUri.string_of_uri + uri) | _ -> false) + in filter local_cands,filter smart_local_cands + in (* we now splits candidates in facts or not facts *) let test = is_a_fact_ast status subst metasenv context in let by,given_candidates = @@ -1198,8 +1227,8 @@ let applicative_case ~pfailed depth signature status flags gty cache = let status, t = term_of_cic_term status gty context in let t = NCicReduction.whd status subst context t in match t with - | NCic.Prod _ -> true, false - | _ -> false, NCicParamod.is_equation status metasenv subst context t + | NCic.Prod _ -> true, false + | _ -> false, NCicParamod.is_equation status metasenv subst context t in debug_print ~depth (lazy (string_of_bool is_eq)); (* new *) @@ -1294,7 +1323,7 @@ let is_subsumed depth filter_depth status gty cache = NCicMetaSubst.mk_meta metasenv ctx ~with_type:implication `IsType in let status = status#set_obj (n,h,metasenv,subst,obj) in - let status = status#set_stack [([1,Open j],[],[],`NoTag)] in + let status = status#set_stack [([1,Open j],[],[],`NoTag,[])] in try let status = NTactics.intro_tac "foo" status in let status = @@ -1358,11 +1387,11 @@ let rec intros_facts ~depth status facts = | _ -> status, facts ;; -let intros ~depth status cache = +let intros ~depth status ?(use_given_only=false) cache = match is_prod status with | `Inductive _ | `Some _ -> - let trace = cache.trace in + let trace = cache.trace in let status,facts = intros_facts ~depth status cache.facts in @@ -1371,7 +1400,7 @@ let intros ~depth status cache = [(0,Ast.Ident("__intros",None)),status], cache else (* we reindex the equation from scratch *) - let unit_eq = index_local_equations status#eq_cache status in + let unit_eq = index_local_equations status#eq_cache status ~flag:use_given_only in let status = NTactics.merge_tac status in [(0,Ast.Ident("__intros",None)),status], init_cache ~facts ~unit_eq () ~trace @@ -1407,7 +1436,7 @@ let is_meta status gty = | _ -> false ;; -let do_something signature flags status g depth gty cache = +let do_something signature flags status g depth gty ?(use_given_only=false) cache = (* if the goal is meta we close it with I:True. This should work thanks to the toplogical sorting of goals. *) if is_meta status gty then @@ -1416,7 +1445,7 @@ let do_something signature flags status g depth gty cache = let s = NTactics.apply_tac ("",0,t) status in [(0,t),s], cache else - let l0, cache = intros ~depth status cache in + let l0, cache = intros ~depth status cache ~use_given_only in if l0 <> [] then l0, cache else (* whd *) @@ -1472,7 +1501,7 @@ let sort_tac status = let gstatus = match status#stack with | [] -> assert false - | (goals, t, k, tag) :: s -> + | (goals, t, k, tag, p) :: s -> let g = head_goals status#stack in let sortedg = (List.rev (MS.topological_sort g (deps status))) in @@ -1487,7 +1516,7 @@ let sort_tac status = let sorted_goals = List.map (fun i -> List.find (is_it i) goals) sortedg in - (sorted_goals, t, k, tag) :: s + (sorted_goals, t, k, tag, p) :: s in status#set_stack gstatus ;; @@ -1496,13 +1525,13 @@ let clean_up_tac status = let gstatus = match status#stack with | [] -> assert false - | (g, t, k, tag) :: s -> + | (g, t, k, tag, p) :: s -> let is_open = function | (_,Continuationals.Stack.Open _) -> true | (_,Continuationals.Stack.Closed _) -> false in let g' = List.filter is_open g in - (g', t, k, tag) :: s + (g', t, k, tag, p) :: s in status#set_stack gstatus ;; @@ -1532,12 +1561,12 @@ let deep_focus_tac level focus status = let rec slice level gs = if level = 0 then [],[],gs else match gs with - | [] -> assert false - | (g, t, k, tag) :: s -> + | [] -> assert false + | (g, t, k, tag,p) :: s -> let f,o,gs = slice (level-1) s in let f1,o1 = List.partition in_focus g in - (f1,[],[],`BranchTag)::f, (o1, t, k, tag)::o, gs + (f1,[],[],`BranchTag, [])::f, (o1, t, k, tag, p)::o, gs in let gstatus = let f,o,s = slice level status#stack in f@o@s @@ -1548,25 +1577,24 @@ let deep_focus_tac level focus status = let move_to_side level status = match status#stack with | [] -> assert false - | (g,_,_,_)::tl -> + | (g,_,_,_,_)::tl -> let is_open = function | (_,Continuationals.Stack.Open i) -> Some i | (_,Continuationals.Stack.Closed _) -> None in let others = menv_closure status (stack_goals (level-1) tl) in List.for_all (fun i -> IntSet.mem i others) - (HExtlib.filter_map is_open g) + (HExtlib.filter_map is_open g) -let top_cache ~depth:_ top status 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 in + let unit_eq = index_local_equations status#eq_cache status ~flag:use_given_only in {cache with unit_eq = unit_eq} else cache -let rec auto_clusters ?(top=false) - flags signature cache depth status : unit = +let rec auto_clusters ?(top=false) flags signature cache depth ?(use_given_only=false) status : unit = debug_print ~depth (lazy ("entering auto clusters at depth " ^ - (string_of_int depth))); + (string_of_int depth))); debug_print ~depth (pptrace status cache.trace); (* ignore(Unix.select [] [] [] 0.01); *) let status = clean_up_tac status in @@ -1577,15 +1605,15 @@ let rec auto_clusters ?(top=false) 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} + 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 + auto_clusters flags signature cache (depth-1) status ~use_given_only else if List.length goals < 2 then - let cache = top_cache ~depth top status cache in - auto_main flags signature cache depth status + let cache = top_cache ~depth top status cache ~use_given_only in + auto_main flags signature cache depth status ~use_given_only else let all_goals = open_goals (depth+1) status in debug_print ~depth (lazy ("goals = " ^ @@ -1596,17 +1624,17 @@ let rec auto_clusters ?(top=false) (fun gl -> if List.length gl > flags.maxwidth then begin - debug_print ~depth (lazy "FAIL GLOBAL WIDTH"); - HLog.warn (sprintf "global width (%u) exceeded: %u" - flags.maxwidth (List.length gl)); - raise (Gaveup cache.failures) - end else ()) classes; + debug_print ~depth (lazy "FAIL GLOBAL WIDTH"); + HLog.warn (sprintf "global width (%u) exceeded: %u" + flags.maxwidth (List.length gl)); + raise (Gaveup cache.failures) + end else ()) classes; if List.length classes = 1 then let flags = {flags with last = (List.length all_goals = 1)} in - (* no need to cluster *) - let cache = top_cache ~depth top status cache in - auto_main flags signature cache depth status + (* no need to cluster *) + let cache = top_cache ~depth top status cache ~use_given_only in + auto_main flags signature cache depth status ~use_given_only else let classes = if top then List.rev classes else classes in debug_print ~depth @@ -1623,21 +1651,21 @@ let rec auto_clusters ?(top=false) let flags = {flags with last = (List.length gl = 1)} in let lold = List.length status#stack in - debug_print ~depth (lazy ("stack length = " ^ - (string_of_int lold))); + debug_print ~depth (lazy ("stack length = " ^ + (string_of_int lold))); let fstatus = deep_focus_tac (depth+1) gl status in - let cache = top_cache ~depth top fstatus cache in + let cache = top_cache ~depth top fstatus cache ~use_given_only in try debug_print ~depth (lazy ("focusing on" ^ String.concat "," (List.map string_of_int gl))); - auto_main flags signature cache depth fstatus; assert false + auto_main flags signature cache depth fstatus ~use_given_only; assert false with | Proved(status,trace) -> - let status = NTactics.merge_tac status in - let cache = {cache with trace = trace} in - let lnew = List.length status#stack in - assert (lold = lnew); - (status,cache,true) + let status = NTactics.merge_tac status in + let cache = {cache with trace = trace} in + let lnew = List.length status#stack in + assert (lold = lnew); + (status,cache,true) | Gaveup failures when top -> let cache = {cache with failures = failures} in (status,cache,b) @@ -1645,18 +1673,18 @@ let rec auto_clusters ?(top=false) (status,cache,false) classes in let rec final_merge n s = - if n = 0 then s else final_merge (n-1) (NTactics.merge_tac s) + if n = 0 then s else final_merge (n-1) (NTactics.merge_tac s) in let status = final_merge depth status in if b then raise (Proved(status,cache.trace)) else raise (Gaveup cache.failures) and (* BRAND NEW VERSION *) -auto_main flags signature cache depth status: 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 = " ^ - (string_of_int (List.length status#stack)))); + (string_of_int (List.length status#stack)))); (* ignore(Unix.select [] [] [] 0.01); *) let status = sort_tac (clean_up_tac status) in let goals = head_goals status#stack in @@ -1671,7 +1699,7 @@ auto_main flags signature cache depth status: unit = | 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 + auto_clusters flags signature cache (depth-1) status ~use_given_only | _orig::_ -> if depth > 0 && move_to_side depth status then @@ -1683,17 +1711,17 @@ auto_main flags signature cache depth status: unit = | 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 + 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 debug_print ~depth (lazy "FAIL LOCAL WIDTH"); - HLog.warn (sprintf "local width (%u) exceeded: %u" - flags.maxwidth ng); - raise (Gaveup cache.failures) + HLog.warn (sprintf "local width (%u) exceeded: %u" + flags.maxwidth ng); + raise (Gaveup cache.failures) end else if depth = flags.maxdepth then - raise (Gaveup cache.failures) + raise (Gaveup cache.failures) else let status = NTactics.branch_tac ~force:true status in let g,gctx, gty = current_goal status in @@ -1713,7 +1741,7 @@ auto_main flags signature cache depth status: unit = (* for efficiency reasons, in this case we severely cripple the search depth *) (debug_print ~depth (lazy ("RAISING DEPTH TO " ^ string_of_int (depth+1))); - auto_main flags signature cache (depth+1) status) + auto_main flags signature cache (depth+1) status ~use_given_only) (* check for loops *) else if is_subsumed depth false status closegty (snd cache.under_inspection) then (debug_print ~depth (lazy "SUBSUMED"); @@ -1723,40 +1751,40 @@ auto_main flags signature cache depth status: unit = (debug_print ~depth (lazy "ALREADY MET"); raise (Gaveup cache.failures)) else - let new_sig = height_of_goal g status in + let new_sig = height_of_goal g status in if new_sig < signature then - (debug_print ~depth (lazy ("news = " ^ (string_of_int new_sig))); - debug_print ~depth (lazy ("olds = " ^ (string_of_int signature)))); + (debug_print ~depth (lazy ("news = " ^ (string_of_int new_sig))); + debug_print ~depth (lazy ("olds = " ^ (string_of_int signature)))); let alternatives, cache = - do_something signature flags status g depth gty cache in + do_something signature flags status g depth gty cache ~use_given_only in let loop_cache = if flags.last then - let l,tree = cache.under_inspection in - let l,tree = closegty::l, add_to_th closegty tree closegty in + let l,tree = cache.under_inspection in + let l,tree = closegty::l, add_to_th closegty tree closegty in {cache with under_inspection = l,tree} else cache in let failures = List.fold_left (fun allfailures ((_,t),status) -> debug_print ~depth - (lazy ("(re)considering goal " ^ - (string_of_int g) ^" : "^ppterm status gty)); + (lazy ("(re)considering goal " ^ + (string_of_int g) ^" : "^ppterm status gty)); debug_print (~depth:depth) (lazy ("Case: " ^ NotationPp.pp_term status t)); let depth,cache = - if t=Ast.Ident("__whd",None) || + if t=Ast.Ident("__whd",None) || t=Ast.Ident("__intros",None) then depth, cache - else depth+1,loop_cache in - let cache = add_to_trace status ~depth cache t in + else depth+1,loop_cache in + let cache = add_to_trace status ~depth cache t in let cache = {cache with failures = allfailures} in - try - auto_clusters flags signature cache depth status; + try + auto_clusters flags signature cache depth status ~use_given_only; assert false; - with Gaveup fail -> - debug_print ~depth (lazy "Failed"); - fail) - cache.failures alternatives in + with Gaveup fail -> + debug_print ~depth (lazy "Failed"); + fail) + cache.failures alternatives in let failures = if flags.last then let newfail = @@ -1767,7 +1795,7 @@ auto_main flags signature cache depth status: unit = add_to_th newfail failures closegty else failures in debug_print ~depth (lazy "no more candidates"); - raise (Gaveup failures) + raise (Gaveup failures) ;; let int name l def = @@ -1787,12 +1815,34 @@ let cleanup_trace s trace = (* filtering facts *) in List.filter (fun t -> - match t with - | Ast.NRef (NReference.Ref (u,_)) -> not (is_a_fact_obj s u) - | _ -> false) trace + match t with + | Ast.NRef (NReference.Ref (u,_)) -> not (is_a_fact_obj s u) + | _ -> false) trace ;; -let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status = +(*CSC: TODO + +- auto_params e' una high tactic che prende in input i parametri e poi li + processa nel contesto vuoto calcolando i candidate + +- astrarla su una auto_params' che prende in input gia' i candidate e un + nuovo parametro per evitare il calcolo dei candidate locali che invece + diventano vuoti (ovvero: non usare automaticamente tutte le ipotesi, bensi' + nessuna) + +- reimplementi la auto_params chiamando la auto_params' con il flag a + false e il vecchio codice per andare da parametri a candiddati + OVVERO: usa tutti le ipotesi locali + candidati globali + +- crei un nuovo entry point lowtac che calcola i candidati usando il contesto + corrente e poi fa exec della auto_params' con i candidati e il flag a true + OVVERO: usa solo candidati globali che comprendono ipotesi locali +*) + +type auto_params = NTacStatus.tactic_term list option * (string * string) list + +(*let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status =*) +let auto_tac' candidates ~local_candidates ?(use_given_only=false) flags ?(trace_ref=ref []) status = let oldstatus = status in let status = (status:> NTacStatus.tac_status) in let goals = head_goals status#stack in @@ -1809,17 +1859,6 @@ let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status = (NDiscriminationTree.TermSet.elements t)) ))); *) - let candidates = - match univ with - | None -> None - | Some l -> - let to_Ast t = -(* FG: `XTSort here? *) - let status, res = disambiguate status [] t `XTNone in - let _,res = term_of_cic_term status res (ctx_of res) - in Ast.NCic res - in Some (List.map to_Ast l) - in let depth = int "depth" flags 3 in let size = int "size" flags 10 in let width = int "width" flags 4 (* (3+List.length goals)*) in @@ -1829,6 +1868,7 @@ let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status = let flags = { last = true; candidates = candidates; + local_candidates = local_candidates; maxwidth = width; maxsize = size; maxdepth = depth; @@ -1847,7 +1887,7 @@ let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status = let _ = debug_print (lazy("\n\nRound "^string_of_int x^"\n")) in let flags = { flags with maxdepth = x } in - try auto_clusters (~top:true) flags signature cache 0 status;assert false + try auto_clusters (~top:true) flags signature cache 0 status ~use_given_only;assert false (* try auto_main flags signature cache 0 status;assert false *) @@ -1855,12 +1895,12 @@ let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status = | Gaveup _ -> up_to (x+1) y | Proved (s,trace) -> debug_print (lazy ("proved at depth " ^ string_of_int x)); - List.iter (toref incr_uses statistics) trace; + List.iter (toref incr_uses statistics) trace; let trace = cleanup_trace s trace in - let _ = debug_print (pptrace status trace) in + let _ = debug_print (pptrace status trace) in let stack = match s#stack with - | (g,t,k,f) :: rest -> (filter_open g,t,k,f):: rest + | (g,t,k,f,p) :: rest -> (filter_open g,t,k,f,p):: rest | _ -> assert false in let s = s#set_stack stack in @@ -1876,6 +1916,31 @@ let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status = s ;; +let candidates_from_ctx univ ctx status = + match univ with + | None -> None + | Some l -> + let to_Ast t = + (* FG: `XTSort here? *) + let status, res = disambiguate status ctx t `XTNone in + let _,res = term_of_cic_term status res (ctx_of res) + in Ast.NCic res + in Some ((List.map to_Ast l) @ [Ast.Ident("refl",None); Ast.Ident("sym_eq",None); + Ast.Ident("trans_eq",None); Ast.Ident("eq_f",None); + Ast.Ident("eq_f2",None); Ast.Ident("eq_f3",None); + Ast.Ident("rewrite_r",None); Ast.Ident("rewrite_l",None) + ]) + +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 + auto_tac' candidates ~local_candidates:true ~use_given_only:false flags ~trace_ref:(ref []) + +let auto_tac ~params:(univ,flags) ?(trace_ref=ref []) status = + let candidates = candidates_from_ctx univ [] status in + auto_tac' candidates ~local_candidates:true ~use_given_only:false flags ~trace_ref status + let auto_tac ~params:(_,flags as params) ?trace_ref = if List.mem_assoc "demod" flags then demod_tac ~params diff --git a/matita/components/ng_tactics/nnAuto.mli b/matita/components/ng_tactics/nnAuto.mli index 87b2e8e4b..d77d32085 100644 --- a/matita/components/ng_tactics/nnAuto.mli +++ b/matita/components/ng_tactics/nnAuto.mli @@ -9,29 +9,27 @@ \ / This software is distributed as is, NO WARRANTY. V_______________________________________________________________ *) +type auto_params = NTacStatus.tactic_term list option * (string * string) list + val is_a_fact_obj: #NTacStatus.pstatus -> NUri.uri -> bool -val fast_eq_check_tac: - params:(NTacStatus.tactic_term list option * (string * string) list) -> - 's NTacStatus.tactic +val fast_eq_check_tac: params:auto_params -> 's NTacStatus.tactic -val paramod_tac: - params:(NTacStatus.tactic_term list option * (string * string) list) -> - 's NTacStatus.tactic +val paramod_tac: params:auto_params -> 's NTacStatus.tactic -val demod_tac: - params:(NTacStatus.tactic_term list option* (string * string) list) -> - 's NTacStatus.tactic +val demod_tac: params:auto_params -> 's NTacStatus.tactic val smart_apply_tac: NTacStatus.tactic_term -> 's NTacStatus.tactic val auto_tac: - params:(NTacStatus.tactic_term list option * (string * string) list) -> + params:auto_params -> ?trace_ref:NotationPt.term list ref -> 's NTacStatus.tactic +val auto_lowtac: params:auto_params -> #NTacStatus.pstatus -> int -> 's NTacStatus.tactic + val keys_of_type: (#NTacStatus.pstatus as 'a) -> NTacStatus.cic_term -> 'a * NTacStatus.cic_term list diff --git a/matita/configure.ac b/matita/configure.ac index 10725e662..04b7da8bd 100644 --- a/matita/configure.ac +++ b/matita/configure.ac @@ -67,7 +67,7 @@ pcre \ str \ unix \ lablgtk3 \ -lablgtk3.sourceview3 \ +lablgtk3-sourceview3 \ netstring \ ulex-camlp5 \ zip \ @@ -92,7 +92,7 @@ $FINDLIB_COMREQUIRES \ " FINDLIB_REQUIRES="\ $FINDLIB_CREQUIRES \ -lablgtk3.sourceview3 \ +lablgtk3-sourceview3 \ " for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES diff --git a/matita/matita/applyTransformation.ml b/matita/matita/applyTransformation.ml index 50d7d25bf..2ae27ee63 100644 --- a/matita/matita/applyTransformation.ml +++ b/matita/matita/applyTransformation.ml @@ -96,3 +96,15 @@ class status = method ppobj obj = snd (ntxt_of_cic_object ~map_unicode_to_tex:false 80 self obj) end + +let notation_pp_term status term = + let to_pres = Content2pres.nterm2pres ?prec:None in + let content = term in + let size = 80 in + let ids_to_nrefs = Hashtbl.create 1 in + let pres = to_pres status ~ids_to_nrefs content in + let pres = CicNotationPres.mpres_of_box pres in + BoxPp.render_to_string ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") + (function x::_ -> x | _ -> assert false) size pres + +let _ = NotationPp.set_pp_term (fun status y -> snd (notation_pp_term (Obj.magic status) y)) 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/help/C/sec_declarative_tactics.xml b/matita/matita/help/C/sec_declarative_tactics.xml index d77c276c4..9c1ed995c 100644 --- a/matita/matita/help/C/sec_declarative_tactics.xml +++ b/matita/matita/help/C/sec_declarative_tactics.xml @@ -1,5 +1,4 @@ - 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/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/didactic/natural_deduction.ma b/matita/matita/lib/didactic/natural_deduction.ma new file mode 100644 index 000000000..45ce24f91 --- /dev/null +++ b/matita/matita/lib/didactic/natural_deduction.ma @@ -0,0 +1,863 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| A.Asperti, C.Sacerdoti Coen, *) +(* ||A|| E.Tassi, S.Zacchiroli *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU Lesser General Public License Version 2.1 *) +(* *) +(**************************************************************************) + +(* Logic system *) + +include "basics/pts.ma". +include "hints_declaration.ma". + +inductive Imply (A,B:Prop) : Prop ≝ +| Imply_intro: (A → B) → Imply A B. + +definition Imply_elim ≝ λA,B:Prop.λf:Imply A B. λa:A. + match f with [ Imply_intro g ⇒ g a]. + +inductive And (A,B:Prop) : Prop ≝ +| And_intro: A → B → And A B. + +definition And_elim_l ≝ λA,B.λc:And A B. + match c with [ And_intro a b ⇒ a ]. + +definition And_elim_r ≝ λA,B.λc:And A B. + match c with [ And_intro a b ⇒ b ]. + +inductive Or (A,B:Prop) : Prop ≝ +| Or_intro_l: A → Or A B +| Or_intro_r: B → Or A B. + +definition Or_elim ≝ λA,B,C:Prop.λc:Or A B.λfa: A → C.λfb: B → C. + match c with + [ Or_intro_l a ⇒ fa a + | Or_intro_r b ⇒ fb b]. + +inductive Top : Prop := +| Top_intro : Top. + +inductive Bot : Prop := . + +definition Bot_elim ≝ λP:Prop.λx:Bot. + match x in Bot return λx.P with []. + +definition Not := λA:Prop.Imply A Bot. + +definition Not_intro : ∀A.(A → Bot) → Not A ≝ λA. + Imply_intro A Bot. + +definition Not_elim : ∀A.Not A → A → Bot ≝ λA. + Imply_elim ? Bot. + +definition Discharge := λA:Prop.λa:A. + a. + +axiom Raa : ∀A.(Not A → Bot) → A. + +axiom sort : Type[0]. + +inductive Exists (A:Type[0]) (P:A→Prop) : Prop ≝ + Exists_intro: ∀w:A. P w → Exists A P. + +definition Exists_elim ≝ + λA:Type[0].λP:A→Prop.λC:Prop.λc:Exists A P.λH:(Πx.P x → C). + match c with [ Exists_intro w p ⇒ H w p ]. + +inductive Forall (A:Type[0]) (P:A→Prop) : Prop ≝ + Forall_intro: (∀n:A. P n) → Forall A P. + +definition Forall_elim ≝ + λA:Type[0].λP:A→Prop.λn:A.λf:Forall A P.match f with [ Forall_intro g ⇒ g n ]. + +(* Dummy proposition *) +axiom unit : Prop. + +(* Notations *) +notation "hbox(a break ⇒ b)" right associative with precedence 20 +for @{ 'Imply $a $b }. +interpretation "Imply" 'Imply a b = (Imply a b). +interpretation "constructive or" 'or x y = (Or x y). +interpretation "constructive and" 'and x y = (And x y). +notation "⊤" non associative with precedence 90 for @{'Top}. +interpretation "Top" 'Top = Top. +notation "⊥" non associative with precedence 90 for @{'Bot}. +interpretation "Bot" 'Bot = Bot. +interpretation "Not" 'not a = (Not a). +notation "✶" non associative with precedence 90 for @{'unit}. +interpretation "dummy prop" 'unit = unit. +notation > "\exists list1 ident x sep , . term 19 Px" with precedence 20 +for ${ fold right @{$Px} rec acc @{'myexists (λ${ident x}.$acc)} }. +notation < "hvbox(\exists ident i break . p)" with precedence 20 +for @{ 'myexists (\lambda ${ident i} : $ty. $p) }. +interpretation "constructive ex" 'myexists \eta.x = (Exists sort x). +notation > "\forall ident x.break term 19 Px" with precedence 20 +for @{ 'Forall (λ${ident x}.$Px) }. +notation < "\forall ident x.break term 19 Px" with precedence 20 +for @{ 'Forall (λ${ident x}:$tx.$Px) }. +interpretation "Forall" 'Forall \eta.Px = (Forall ? Px). + +(* Variables *) +axiom A : Prop. +axiom B : Prop. +axiom C : Prop. +axiom D : Prop. +axiom E : Prop. +axiom F : Prop. +axiom G : Prop. +axiom H : Prop. +axiom I : Prop. +axiom J : Prop. +axiom K : Prop. +axiom L : Prop. +axiom M : Prop. +axiom N : Prop. +axiom O : Prop. +axiom x: sort. +axiom y: sort. +axiom z: sort. +axiom w: sort. + +(* Every formula user provided annotates its proof: + `A` becomes `(show A ?)` *) +definition show : ΠA.A→A ≝ λA:Prop.λa:A.a. + +(* When something does not fit, this daemon is used *) +axiom cast: ΠA,B:Prop.B → A. + +(* begin a proof: draws the root *) +notation > "'prove' p" non associative with precedence 19 +for @{ 'prove $p }. +interpretation "prove KO" 'prove p = (cast ? ? (show p ?)). +interpretation "prove OK" 'prove p = (show p ?). + +(* Leaves *) +notation < "\infrule (t\atop ⋮) a ?" with precedence 19 +for @{ 'leaf_ok $a $t }. +interpretation "leaf OK" 'leaf_ok a t = (show a t). +notation < "\infrule (t\atop ⋮) mstyle color #ff0000 (a) ?" with precedence 19 +for @{ 'leaf_ko $a $t }. +interpretation "leaf KO" 'leaf_ko a t = (cast ? ? (show a t)). + +(* discharging *) +notation < "[ a ] \sup mstyle color #ff0000 (H)" with precedence 19 +for @{ 'discharge_ko_1 $a $H }. +interpretation "discharge_ko_1" 'discharge_ko_1 a H = + (show a (cast ? ? (Discharge ? H))). +notation < "[ mstyle color #ff0000 (a) ] \sup mstyle color #ff0000 (H)" with precedence 19 +for @{ 'discharge_ko_2 $a $H }. +interpretation "discharge_ko_2" 'discharge_ko_2 a H = + (cast ? ? (show a (cast ? ? (Discharge ? H)))). + +notation < "[ a ] \sup H" with precedence 19 +for @{ 'discharge_ok_1 $a $H }. +interpretation "discharge_ok_1" 'discharge_ok_1 a H = + (show a (Discharge ? H)). +notation < "[ mstyle color #ff0000 (a) ] \sup H" with precedence 19 +for @{ 'discharge_ok_2 $a $H }. +interpretation "discharge_ok_2" 'discharge_ok_2 a H = + (cast ? ? (show a (Discharge ? H))). + +notation > "'discharge' [H]" with precedence 19 +for @{ 'discharge $H }. +interpretation "discharge KO" 'discharge H = (cast ? ? (Discharge ? H)). +interpretation "discharge OK" 'discharge H = (Discharge ? H). + +(* ⇒ introduction *) +notation < "\infrule hbox(\emsp b \emsp) ab (mstyle color #ff0000 (⇒\sub\i \emsp) ident H) " with precedence 19 +for @{ 'Imply_intro_ko_1 $ab (λ${ident H}:$p.$b) }. +interpretation "Imply_intro_ko_1" 'Imply_intro_ko_1 ab \eta.b = + (show ab (cast ? ? (Imply_intro ? ? b))). + +notation < "\infrule hbox(\emsp b \emsp) mstyle color #ff0000 (ab) (mstyle color #ff0000 (⇒\sub\i \emsp) ident H) " with precedence 19 +for @{ 'Imply_intro_ko_2 $ab (λ${ident H}:$p.$b) }. +interpretation "Imply_intro_ko_2" 'Imply_intro_ko_2 ab \eta.b = + (cast ? ? (show ab (cast ? ? (Imply_intro ? ? b)))). + +notation < "maction (\infrule hbox(\emsp b \emsp) ab (⇒\sub\i \emsp ident H) ) (\vdots)" with precedence 19 +for @{ 'Imply_intro_ok_1 $ab (λ${ident H}:$p.$b) }. +interpretation "Imply_intro_ok_1" 'Imply_intro_ok_1 ab \eta.b = + (show ab (Imply_intro ? ? b)). + +notation < "\infrule hbox(\emsp b \emsp) mstyle color #ff0000 (ab) (⇒\sub\i \emsp ident H) " with precedence 19 +for @{ 'Imply_intro_ok_2 $ab (λ${ident H}:$p.$b) }. +interpretation "Imply_intro_ok_2" 'Imply_intro_ok_2 ab \eta.b = + (cast ? ? (show ab (Imply_intro ? ? b))). + +notation > "⇒#'i' [ident H] term 90 b" with precedence 19 +for @{ 'Imply_intro $b (λ${ident H}.show $b ?) }. + +interpretation "Imply_intro KO" 'Imply_intro b pb = + (cast ? (Imply unit b) (Imply_intro ? b pb)). +interpretation "Imply_intro OK" 'Imply_intro b pb = + (Imply_intro ? b pb). + +(* ⇒ elimination *) +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) b mstyle color #ff0000 (⇒\sub\e) " with precedence 19 +for @{ 'Imply_elim_ko_1 $ab $a $b }. +interpretation "Imply_elim_ko_1" 'Imply_elim_ko_1 ab a b = + (show b (cast ? ? (Imply_elim ? ? (cast ? ? ab) (cast ? ? a)))). + +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) mstyle color #ff0000 (b) mstyle color #ff0000 (⇒\sub\e) " with precedence 19 +for @{ 'Imply_elim_ko_2 $ab $a $b }. +interpretation "Imply_elim_ko_2" 'Imply_elim_ko_2 ab a b = + (cast ? ? (show b (cast ? ? (Imply_elim ? ? (cast ? ? ab) (cast ? ? a))))). + +notation < "maction (\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) b (⇒\sub\e) ) (\vdots)" with precedence 19 +for @{ 'Imply_elim_ok_1 $ab $a $b }. +interpretation "Imply_elim_ok_1" 'Imply_elim_ok_1 ab a b = + (show b (Imply_elim ? ? ab a)). + +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) mstyle color #ff0000 (b) (⇒\sub\e) " with precedence 19 +for @{ 'Imply_elim_ok_2 $ab $a $b }. +interpretation "Imply_elim_ok_2" 'Imply_elim_ok_2 ab a b = + (cast ? ? (show b (Imply_elim ? ? ab a))). + +notation > "⇒#'e' term 90 ab term 90 a" with precedence 19 +for @{ 'Imply_elim (show $ab ?) (show $a ?) }. +interpretation "Imply_elim KO" 'Imply_elim ab a = + (cast ? ? (Imply_elim ? ? (cast (Imply unit unit) ? ab) (cast unit ? a))). +interpretation "Imply_elim OK" 'Imply_elim ab a = + (Imply_elim ? ? ab a). + +(* ∧ introduction *) +notation < "\infrule hbox(\emsp a \emsp\emsp\emsp b \emsp) ab mstyle color #ff0000 (∧\sub\i)" with precedence 19 +for @{ 'And_intro_ko_1 $a $b $ab }. +interpretation "And_intro_ko_1" 'And_intro_ko_1 a b ab = + (show ab (cast ? ? (And_intro ? ? a b))). + +notation < "\infrule hbox(\emsp a \emsp\emsp\emsp b \emsp) mstyle color #ff0000 (ab) mstyle color #ff0000 (∧\sub\i)" with precedence 19 +for @{ 'And_intro_ko_2 $a $b $ab }. +interpretation "And_intro_ko_2" 'And_intro_ko_2 a b ab = + (cast ? ? (show ab (cast ? ? (And_intro ? ? a b)))). + +notation < "maction (\infrule hbox(\emsp a \emsp\emsp\emsp b \emsp) ab (∧\sub\i)) (\vdots)" with precedence 19 +for @{ 'And_intro_ok_1 $a $b $ab }. +interpretation "And_intro_ok_1" 'And_intro_ok_1 a b ab = + (show ab (And_intro ? ? a b)). + +notation < "\infrule hbox(\emsp a \emsp\emsp\emsp b \emsp) mstyle color #ff0000 (ab) (∧\sub\i)" with precedence 19 +for @{ 'And_intro_ok_2 $a $b $ab }. +interpretation "And_intro_ok_2" 'And_intro_ok_2 a b ab = + (cast ? ? (show ab (And_intro ? ? a b))). + +notation > "∧#'i' term 90 a term 90 b" with precedence 19 +for @{ 'And_intro (show $a ?) (show $b ?) }. +interpretation "And_intro KO" 'And_intro a b = (cast ? ? (And_intro ? ? a b)). +interpretation "And_intro OK" 'And_intro a b = (And_intro ? ? a b). + +(* ∧ elimination *) +notation < "\infrule hbox(\emsp ab \emsp) a mstyle color #ff0000 (∧\sub(\e_\l))" with precedence 19 +for @{ 'And_elim_l_ko_1 $ab $a }. +interpretation "And_elim_l_ko_1" 'And_elim_l_ko_1 ab a = + (show a (cast ? ? (And_elim_l ? ? (cast ? ? ab)))). + +notation < "\infrule hbox(\emsp ab \emsp) mstyle color #ff0000 (a) mstyle color #ff0000 (∧\sub(\e_\l))" with precedence 19 +for @{ 'And_elim_l_ko_2 $ab $a }. +interpretation "And_elim_l_ko_2" 'And_elim_l_ko_2 ab a = + (cast ? ? (show a (cast ? ? (And_elim_l ? ? (cast ? ? ab))))). + +notation < "maction (\infrule hbox(\emsp ab \emsp) a (∧\sub(\e_\l))) (\vdots)" with precedence 19 +for @{ 'And_elim_l_ok_1 $ab $a }. +interpretation "And_elim_l_ok_1" 'And_elim_l_ok_1 ab a = + (show a (And_elim_l ? ? ab)). + +notation < "\infrule hbox(\emsp ab \emsp) mstyle color #ff0000 (a) (∧\sub(\e_\l))" with precedence 19 +for @{ 'And_elim_l_ok_2 $ab $a }. +interpretation "And_elim_l_ok_2" 'And_elim_l_ok_2 ab a = + (cast ? ? (show a (And_elim_l ? ? ab))). + +notation > "∧#'e_l' term 90 ab" with precedence 19 +for @{ 'And_elim_l (show $ab ?) }. +interpretation "And_elim_l KO" 'And_elim_l a = (cast ? ? (And_elim_l ? ? (cast (And unit unit) ? a))). +interpretation "And_elim_l OK" 'And_elim_l a = (And_elim_l ? ? a). + +notation < "\infrule hbox(\emsp ab \emsp) a mstyle color #ff0000 (∧\sub(\e_\r))" with precedence 19 +for @{ 'And_elim_r_ko_1 $ab $a }. +interpretation "And_elim_r_ko_1" 'And_elim_r_ko_1 ab a = + (show a (cast ? ? (And_elim_r ? ? (cast ? ? ab)))). + +notation < "\infrule hbox(\emsp ab \emsp) mstyle color #ff0000 (a) mstyle color #ff0000 (∧\sub(\e_\r))" with precedence 19 +for @{ 'And_elim_r_ko_2 $ab $a }. +interpretation "And_elim_r_ko_2" 'And_elim_r_ko_2 ab a = + (cast ? ? (show a (cast ? ? (And_elim_r ? ? (cast ? ? ab))))). + +notation < "maction (\infrule hbox(\emsp ab \emsp) a (∧\sub(\e_\r))) (\vdots)" with precedence 19 +for @{ 'And_elim_r_ok_1 $ab $a }. +interpretation "And_elim_r_ok_1" 'And_elim_r_ok_1 ab a = + (show a (And_elim_r ? ? ab)). + +notation < "\infrule hbox(\emsp ab \emsp) mstyle color #ff0000 (a) (∧\sub(\e_\r))" with precedence 19 +for @{ 'And_elim_r_ok_2 $ab $a }. +interpretation "And_elim_r_ok_2" 'And_elim_r_ok_2 ab a = + (cast ? ? (show a (And_elim_r ? ? ab))). + +notation > "∧#'e_r' term 90 ab" with precedence 19 +for @{ 'And_elim_r (show $ab ?) }. +interpretation "And_elim_r KO" 'And_elim_r a = (cast ? ? (And_elim_r ? ? (cast (And unit unit) ? a))). +interpretation "And_elim_r OK" 'And_elim_r a = (And_elim_r ? ? a). + +(* ∨ introduction *) +notation < "\infrule hbox(\emsp a \emsp) ab mstyle color #ff0000 (∨\sub(\i_\l))" with precedence 19 +for @{ 'Or_intro_l_ko_1 $a $ab }. +interpretation "Or_intro_l_ko_1" 'Or_intro_l_ko_1 a ab = + (show ab (cast ? ? (Or_intro_l ? ? a))). + +notation < "\infrule hbox(\emsp a \emsp) mstyle color #ff0000 (ab) mstyle color #ff0000 (∨\sub(\i_\l))" with precedence 19 +for @{ 'Or_intro_l_ko_2 $a $ab }. +interpretation "Or_intro_l_ko_2" 'Or_intro_l_ko_2 a ab = + (cast ? ? (show ab (cast ? ? (Or_intro_l ? ? a)))). + +notation < "maction (\infrule hbox(\emsp a \emsp) ab (∨\sub(\i_\l))) (\vdots)" with precedence 19 +for @{ 'Or_intro_l_ok_1 $a $ab }. +interpretation "Or_intro_l_ok_1" 'Or_intro_l_ok_1 a ab = + (show ab (Or_intro_l ? ? a)). + +notation < "\infrule hbox(\emsp a \emsp) mstyle color #ff0000 (ab) (∨\sub(\i_\l))" with precedence 19 +for @{ 'Or_intro_l_ok_2 $a $ab }. +interpretation "Or_intro_l_ok_2" 'Or_intro_l_ok_2 a ab = + (cast ? ? (show ab (Or_intro_l ? ? a))). + +notation > "∨#'i_l' term 90 a" with precedence 19 +for @{ 'Or_intro_l (show $a ?) }. +interpretation "Or_intro_l KO" 'Or_intro_l a = (cast ? (Or ? unit) (Or_intro_l ? ? a)). +interpretation "Or_intro_l OK" 'Or_intro_l a = (Or_intro_l ? ? a). + +notation < "\infrule hbox(\emsp a \emsp) ab mstyle color #ff0000 (∨\sub(\i_\r))" with precedence 19 +for @{ 'Or_intro_r_ko_1 $a $ab }. +interpretation "Or_intro_r_ko_1" 'Or_intro_r_ko_1 a ab = + (show ab (cast ? ? (Or_intro_r ? ? a))). + +notation < "\infrule hbox(\emsp a \emsp) mstyle color #ff0000 (ab) mstyle color #ff0000 (∨\sub(\i_\r))" with precedence 19 +for @{ 'Or_intro_r_ko_2 $a $ab }. +interpretation "Or_intro_r_ko_2" 'Or_intro_r_ko_2 a ab = + (cast ? ? (show ab (cast ? ? (Or_intro_r ? ? a)))). + +notation < "maction (\infrule hbox(\emsp a \emsp) ab (∨\sub(\i_\r))) (\vdots)" with precedence 19 +for @{ 'Or_intro_r_ok_1 $a $ab }. +interpretation "Or_intro_r_ok_1" 'Or_intro_r_ok_1 a ab = + (show ab (Or_intro_r ? ? a)). + +notation < "\infrule hbox(\emsp a \emsp) mstyle color #ff0000 (ab) (∨\sub(\i_\r))" with precedence 19 +for @{ 'Or_intro_r_ok_2 $a $ab }. +interpretation "Or_intro_r_ok_2" 'Or_intro_r_ok_2 a ab = + (cast ? ? (show ab (Or_intro_r ? ? a))). + +notation > "∨#'i_r' term 90 a" with precedence 19 +for @{ 'Or_intro_r (show $a ?) }. +interpretation "Or_intro_r KO" 'Or_intro_r a = (cast ? (Or unit ?) (Or_intro_r ? ? a)). +interpretation "Or_intro_r OK" 'Or_intro_r a = (Or_intro_r ? ? a). + +(* ∨ elimination *) +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp ac \emsp\emsp\emsp bc \emsp) c (mstyle color #ff0000 (∨\sub\e \emsp) ident Ha \emsp ident Hb)" with precedence 19 +for @{ 'Or_elim_ko_1 $ab $c (λ${ident Ha}:$ta.$ac) (λ${ident Hb}:$tb.$bc) }. +interpretation "Or_elim_ko_1" 'Or_elim_ko_1 ab c \eta.ac \eta.bc = + (show c (cast ? ? (Or_elim ? ? ? (cast ? ? ab) (cast ? ? ac) (cast ? ? bc)))). + +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp ac \emsp\emsp\emsp bc \emsp) mstyle color #ff0000 (c) (mstyle color #ff0000 (∨\sub\e) \emsp ident Ha \emsp ident Hb)" with precedence 19 +for @{ 'Or_elim_ko_2 $ab (λ${ident Ha}:$ta.$ac) (λ${ident Hb}:$tb.$bc) $c }. +interpretation "Or_elim_ko_2" 'Or_elim_ko_2 ab \eta.ac \eta.bc c = + (cast ? ? (show c (cast ? ? (Or_elim ? ? ? (cast ? ? ab) (cast ? ? ac) (cast ? ? bc))))). + +notation < "maction (\infrule hbox(\emsp ab \emsp\emsp\emsp ac \emsp\emsp\emsp bc \emsp) c (∨\sub\e \emsp ident Ha \emsp ident Hb)) (\vdots)" with precedence 19 +for @{ 'Or_elim_ok_1 $ab (λ${ident Ha}:$ta.$ac) (λ${ident Hb}:$tb.$bc) $c }. +interpretation "Or_elim_ok_1" 'Or_elim_ok_1 ab \eta.ac \eta.bc c = + (show c (Or_elim ? ? ? ab ac bc)). + +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp ac \emsp\emsp\emsp bc \emsp) mstyle color #ff0000 (c) (∨\sub\e \emsp ident Ha \emsp ident Hb)" with precedence 19 +for @{ 'Or_elim_ok_2 $ab (λ${ident Ha}:$ta.$ac) (λ${ident Hb}:$tb.$bc) $c }. +interpretation "Or_elim_ok_2" 'Or_elim_ok_2 ab \eta.ac \eta.bc c = + (cast ? ? (show c (Or_elim ? ? ? ab ac bc))). + +definition unit_to ≝ λx:Prop.unit → x. + +notation > "∨#'e' term 90 ab [ident Ha] term 90 cl [ident Hb] term 90 cr" with precedence 19 +for @{ 'Or_elim (show $ab ?) (λ${ident Ha}.show $cl ?) (λ${ident Hb}.show $cr ?) }. +interpretation "Or_elim KO" 'Or_elim ab ac bc = + (cast ? ? (Or_elim ? ? ? + (cast (Or unit unit) ? ab) + (cast (unit_to unit) (unit_to ?) ac) + (cast (unit_to unit) (unit_to ?) bc))). +interpretation "Or_elim OK" 'Or_elim ab ac bc = (Or_elim ? ? ? ab ac bc). + +(* ⊤ introduction *) +notation < "\infrule \nbsp ⊤ mstyle color #ff0000 (⊤\sub\i)" with precedence 19 +for @{'Top_intro_ko_1}. +interpretation "Top_intro_ko_1" 'Top_intro_ko_1 = + (show ? (cast ? ? Top_intro)). + +notation < "\infrule \nbsp mstyle color #ff0000 (⊤) mstyle color #ff0000 (⊤\sub\i)" with precedence 19 +for @{'Top_intro_ko_2}. +interpretation "Top_intro_ko_2" 'Top_intro_ko_2 = + (cast ? ? (show ? (cast ? ? Top_intro))). + +notation < "maction (\infrule \nbsp ⊤ (⊤\sub\i)) (\vdots)" with precedence 19 +for @{'Top_intro_ok_1}. +interpretation "Top_intro_ok_1" 'Top_intro_ok_1 = (show ? Top_intro). + +notation < "maction (\infrule \nbsp ⊤ (⊤\sub\i)) (\vdots)" with precedence 19 +for @{'Top_intro_ok_2 }. +interpretation "Top_intro_ok_2" 'Top_intro_ok_2 = (cast ? ? (show ? Top_intro)). + +notation > "⊤#'i'" with precedence 19 for @{ 'Top_intro }. +interpretation "Top_intro KO" 'Top_intro = (cast ? ? Top_intro). +interpretation "Top_intro OK" 'Top_intro = Top_intro. + +(* ⊥ introduction *) +notation < "\infrule b a mstyle color #ff0000 (⊥\sub\e)" with precedence 19 +for @{'Bot_elim_ko_1 $a $b}. +interpretation "Bot_elim_ko_1" 'Bot_elim_ko_1 a b = + (show a (Bot_elim ? (cast ? ? b))). + +notation < "\infrule b mstyle color #ff0000 (a) mstyle color #ff0000 (⊥\sub\e)" with precedence 19 +for @{'Bot_elim_ko_2 $a $b}. +interpretation "Bot_elim_ko_2" 'Bot_elim_ko_2 a b = + (cast ? ? (show a (Bot_elim ? (cast ? ? b)))). + +notation < "maction (\infrule b a (⊥\sub\e)) (\vdots)" with precedence 19 +for @{'Bot_elim_ok_1 $a $b}. +interpretation "Bot_elim_ok_1" 'Bot_elim_ok_1 a b = + (show a (Bot_elim ? b)). + +notation < "\infrule b mstyle color #ff0000 (a) (⊥\sub\e)" with precedence 19 +for @{'Bot_elim_ok_2 $a $b}. +interpretation "Bot_elim_ok_2" 'Bot_elim_ok_2 a b = + (cast ? ? (show a (Bot_elim ? b))). + +notation > "⊥#'e' term 90 b" with precedence 19 +for @{ 'Bot_elim (show $b ?) }. +interpretation "Bot_elim KO" 'Bot_elim a = (Bot_elim ? (cast ? ? a)). +interpretation "Bot_elim OK" 'Bot_elim a = (Bot_elim ? a). + +(* ¬ introduction *) +notation < "\infrule hbox(\emsp b \emsp) ab (mstyle color #ff0000 (\lnot\sub(\emsp\i)) \emsp ident H)" with precedence 19 +for @{ 'Not_intro_ko_1 $ab (λ${ident H}:$p.$b) }. +interpretation "Not_intro_ko_1" 'Not_intro_ko_1 ab \eta.b = + (show ab (cast ? ? (Not_intro ? (cast ? ? b)))). + +notation < "\infrule hbox(\emsp b \emsp) mstyle color #ff0000 (ab) (mstyle color #ff0000 (\lnot\sub(\emsp\i)) \emsp ident H)" with precedence 19 +for @{ 'Not_intro_ko_2 $ab (λ${ident H}:$p.$b) }. +interpretation "Not_intro_ko_2" 'Not_intro_ko_2 ab \eta.b = + (cast ? ? (show ab (cast ? ? (Not_intro ? (cast ? ? b))))). + +notation < "maction (\infrule hbox(\emsp b \emsp) ab (\lnot\sub(\emsp\i) \emsp ident H) ) (\vdots)" with precedence 19 +for @{ 'Not_intro_ok_1 $ab (λ${ident H}:$p.$b) }. +interpretation "Not_intro_ok_1" 'Not_intro_ok_1 ab \eta.b = + (show ab (Not_intro ? b)). + +notation < "\infrule hbox(\emsp b \emsp) mstyle color #ff0000 (ab) (\lnot\sub(\emsp\i) \emsp ident H) " with precedence 19 +for @{ 'Not_intro_ok_2 $ab (λ${ident H}:$p.$b) }. +interpretation "Not_intro_ok_2" 'Not_intro_ok_2 ab \eta.b = + (cast ? ? (show ab (Not_intro ? b))). + +notation > "¬#'i' [ident H] term 90 b" with precedence 19 +for @{ 'Not_intro (λ${ident H}.show $b ?) }. +interpretation "Not_intro KO" 'Not_intro a = (cast ? ? (Not_intro ? (cast ? ? a))). +interpretation "Not_intro OK" 'Not_intro a = (Not_intro ? a). + +(* ¬ elimination *) +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) b mstyle color #ff0000 (\lnot\sub(\emsp\e)) " with precedence 19 +for @{ 'Not_elim_ko_1 $ab $a $b }. +interpretation "Not_elim_ko_1" 'Not_elim_ko_1 ab a b = + (show b (cast ? ? (Not_elim ? (cast ? ? ab) (cast ? ? a)))). + +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) mstyle color #ff0000 (b) mstyle color #ff0000 (\lnot\sub(\emsp\e)) " with precedence 19 +for @{ 'Not_elim_ko_2 $ab $a $b }. +interpretation "Not_elim_ko_2" 'Not_elim_ko_2 ab a b = + (cast ? ? (show b (cast ? ? (Not_elim ? (cast ? ? ab) (cast ? ? a))))). + +notation < "maction (\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) b (\lnot\sub(\emsp\e)) ) (\vdots)" with precedence 19 +for @{ 'Not_elim_ok_1 $ab $a $b }. +interpretation "Not_elim_ok_1" 'Not_elim_ok_1 ab a b = + (show b (Not_elim ? ab a)). + +notation < "\infrule hbox(\emsp ab \emsp\emsp\emsp a\emsp) mstyle color #ff0000 (b) (\lnot\sub(\emsp\e)) " with precedence 19 +for @{ 'Not_elim_ok_2 $ab $a $b }. +interpretation "Not_elim_ok_2" 'Not_elim_ok_2 ab a b = + (cast ? ? (show b (Not_elim ? ab a))). + +notation > "¬#'e' term 90 ab term 90 a" with precedence 19 +for @{ 'Not_elim (show $ab ?) (show $a ?) }. +interpretation "Not_elim KO" 'Not_elim ab a = + (cast ? ? (Not_elim unit (cast ? ? ab) (cast ? ? a))). +interpretation "Not_elim OK" 'Not_elim ab a = + (Not_elim ? ab a). + +(* RAA *) +notation < "\infrule hbox(\emsp Px \emsp) Pn (mstyle color #ff0000 (\RAA) \emsp ident x)" with precedence 19 +for @{ 'RAA_ko_1 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "RAA_ko_1" 'RAA_ko_1 Px Pn = + (show Pn (cast ? ? (Raa ? (cast ? ? Px)))). + +notation < "\infrule hbox(\emsp Px \emsp) mstyle color #ff0000 (Pn) (mstyle color #ff0000 (\RAA) \emsp ident x)" with precedence 19 +for @{ 'RAA_ko_2 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "RAA_ko_2" 'RAA_ko_2 Px Pn = + (cast ? ? (show Pn (cast ? ? (Raa ? (cast ? ? Px))))). + +notation < "maction (\infrule hbox(\emsp Px \emsp) Pn (\RAA \emsp ident x)) (\vdots)" with precedence 19 +for @{ 'RAA_ok_1 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "RAA_ok_1" 'RAA_ok_1 Px Pn = + (show Pn (Raa ? Px)). + +notation < "\infrule hbox(\emsp Px \emsp) mstyle color #ff0000 (Pn) (\RAA \emsp ident x)" with precedence 19 +for @{ 'RAA_ok_2 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "RAA_ok_2" 'RAA_ok_2 Px Pn = + (cast ? ? (show Pn (Raa ? Px))). + +notation > "'RAA' [ident H] term 90 b" with precedence 19 +for @{ 'Raa (λ${ident H}.show $b ?) }. +interpretation "RAA KO" 'Raa p = (cast ? unit (Raa ? (cast ? (unit_to ?) p))). +interpretation "RAA OK" 'Raa p = (Raa ? p). + +(* ∃ introduction *) +notation < "\infrule hbox(\emsp Pn \emsp) Px mstyle color #ff0000 (∃\sub\i)" with precedence 19 +for @{ 'Exists_intro_ko_1 $Pn $Px }. +interpretation "Exists_intro_ko_1" 'Exists_intro_ko_1 Pn Px = + (show Px (cast ? ? (Exists_intro ? ? ? (cast ? ? Pn)))). + +notation < "\infrule hbox(\emsp Pn \emsp) mstyle color #ff0000 (Px) mstyle color #ff0000 (∃\sub\i)" with precedence 19 +for @{ 'Exists_intro_ko_2 $Pn $Px }. +interpretation "Exists_intro_ko_2" 'Exists_intro_ko_2 Pn Px = + (cast ? ? (show Px (cast ? ? (Exists_intro ? ? ? (cast ? ? Pn))))). + +notation < "maction (\infrule hbox(\emsp Pn \emsp) Px (∃\sub\i)) (\vdots)" with precedence 19 +for @{ 'Exists_intro_ok_1 $Pn $Px }. +interpretation "Exists_intro_ok_1" 'Exists_intro_ok_1 Pn Px = + (show Px (Exists_intro ? ? ? Pn)). + +notation < "\infrule hbox(\emsp Pn \emsp) mstyle color #ff0000 (Px) (∃\sub\i)" with precedence 19 +for @{ 'Exists_intro_ok_2 $Pn $Px }. +interpretation "Exists_intro_ok_2" 'Exists_intro_ok_2 Pn Px = + (cast ? ? (show Px (Exists_intro ? ? ? Pn))). + +notation >"∃#'i' {term 90 t} term 90 Pt" non associative with precedence 19 +for @{'Exists_intro $t (λw.? w) (show $Pt ?)}. +interpretation "Exists_intro KO" 'Exists_intro t P Pt = + (cast ? ? (Exists_intro sort P t (cast ? ? Pt))). +interpretation "Exists_intro OK" 'Exists_intro t P Pt = + (Exists_intro sort P t Pt). + +(* ∃ elimination *) +notation < "\infrule hbox(\emsp ExPx \emsp\emsp\emsp Pc \emsp) c (mstyle color #ff0000 (∃\sub\e) \emsp ident n \emsp ident HPn)" with precedence 19 +for @{ 'Exists_elim_ko_1 $ExPx (λ${ident n}:$tn.λ${ident HPn}:$Pn.$Pc) $c }. +interpretation "Exists_elim_ko_1" 'Exists_elim_ko_1 ExPx Pc c = + (show c (cast ? ? (Exists_elim ? ? ? (cast ? ? ExPx) (cast ? ? Pc)))). + +notation < "\infrule hbox(\emsp ExPx \emsp\emsp\emsp Pc \emsp) mstyle color #ff0000 (c) (mstyle color #ff0000 (∃\sub\e) \emsp ident n \emsp ident HPn)" with precedence 19 +for @{ 'Exists_elim_ko_2 $ExPx (λ${ident n}:$tn.λ${ident HPn}:$Pn.$Pc) $c }. +interpretation "Exists_elim_ko_2" 'Exists_elim_ko_2 ExPx Pc c = + (cast ? ? (show c (cast ? ? (Exists_elim ? ? ? (cast ? ? ExPx) (cast ? ? Pc))))). + +notation < "maction (\infrule hbox(\emsp ExPx \emsp\emsp\emsp Pc \emsp) c (∃\sub\e \emsp ident n \emsp ident HPn)) (\vdots)" with precedence 19 +for @{ 'Exists_elim_ok_1 $ExPx (λ${ident n}:$tn.λ${ident HPn}:$Pn.$Pc) $c }. +interpretation "Exists_elim_ok_1" 'Exists_elim_ok_1 ExPx Pc c = + (show c (Exists_elim ? ? ? ExPx Pc)). + +notation < "\infrule hbox(\emsp ExPx \emsp\emsp\emsp Pc \emsp) mstyle color #ff0000 (c) (∃\sub\e \emsp ident n \emsp ident HPn)" with precedence 19 +for @{ 'Exists_elim_ok_2 $ExPx (λ${ident n}:$tn.λ${ident HPn}:$Pn.$Pc) $c }. +interpretation "Exists_elim_ok_2" 'Exists_elim_ok_2 ExPx Pc c = + (cast ? ? (show c (Exists_elim ? ? ? ExPx Pc))). + +definition ex_concl := λx:sort → Prop.Πy:sort.unit → x y. +definition ex_concl_dummy := Πy:sort.unit → unit. +definition fake_pred := λx:sort.unit. + +notation >"∃#'e' term 90 ExPt {ident t} [ident H] term 90 c" non associative with precedence 19 +for @{'Exists_elim (λx.? x) (show $ExPt ?) (λ${ident t}:sort.λ${ident H}.show $c ?)}. +interpretation "Exists_elim KO" 'Exists_elim P ExPt c = + (cast ? ? (Exists_elim sort P ? + (cast (Exists ? P) ? ExPt) + (cast ex_concl_dummy (ex_concl ?) c))). +interpretation "Exists_elim OK" 'Exists_elim P ExPt c = + (Exists_elim sort P ? ExPt c). + +(* ∀ introduction *) + +notation < "\infrule hbox(\emsp Px \emsp) Pn (mstyle color #ff0000 (∀\sub\i) \emsp ident x)" with precedence 19 +for @{ 'Forall_intro_ko_1 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "Forall_intro_ko_1" 'Forall_intro_ko_1 Px Pn = + (show Pn (cast ? ? (Forall_intro ? ? (cast ? ? Px)))). + +notation < "\infrule hbox(\emsp Px \emsp) mstyle color #ff0000(Pn) (mstyle color #ff0000 (∀\sub\i) \emsp ident x)" with precedence 19 +for @{ 'Forall_intro_ko_2 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "Forall_intro_ko_2" 'Forall_intro_ko_2 Px Pn = + (cast ? ? (show Pn (cast ? ? (Forall_intro ? ? (cast ? ? Px))))). + +notation < "maction (\infrule hbox(\emsp Px \emsp) Pn (∀\sub\i \emsp ident x)) (\vdots)" with precedence 19 +for @{ 'Forall_intro_ok_1 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "Forall_intro_ok_1" 'Forall_intro_ok_1 Px Pn = + (show Pn (Forall_intro ? ? Px)). + +notation < "\infrule hbox(\emsp Px \emsp) mstyle color #ff0000 (Pn) (∀\sub\i \emsp ident x)" with precedence 19 +for @{ 'Forall_intro_ok_2 (λ${ident x}:$tx.$Px) $Pn }. +interpretation "Forall_intro_ok_2" 'Forall_intro_ok_2 Px Pn = + (cast ? ? (show Pn (Forall_intro ? ? Px))). + +notation > "∀#'i' {ident y} term 90 Px" non associative with precedence 19 +for @{ 'Forall_intro (λ_.?) (λ${ident y}.show $Px ?) }. +interpretation "Forall_intro KO" 'Forall_intro P Px = + (cast ? ? (Forall_intro sort P (cast ? ? Px))). +interpretation "Forall_intro OK" 'Forall_intro P Px = + (Forall_intro sort P Px). + +(* ∀ elimination *) +notation < "\infrule hbox(\emsp Px \emsp) Pn (mstyle color #ff0000 (∀\sub\e))" with precedence 19 +for @{ 'Forall_elim_ko_1 $Px $Pn }. +interpretation "Forall_elim_ko_1" 'Forall_elim_ko_1 Px Pn = + (show Pn (cast ? ? (Forall_elim ? ? ? (cast ? ? Px)))). + +notation < "\infrule hbox(\emsp Px \emsp) mstyle color #ff0000(Pn) (mstyle color #ff0000 (∀\sub\e))" with precedence 19 +for @{ 'Forall_elim_ko_2 $Px $Pn }. +interpretation "Forall_elim_ko_2" 'Forall_elim_ko_2 Px Pn = + (cast ? ? (show Pn (cast ? ? (Forall_elim ? ? ? (cast ? ? Px))))). + +notation < "maction (\infrule hbox(\emsp Px \emsp) Pn (∀\sub\e)) (\vdots)" with precedence 19 +for @{ 'Forall_elim_ok_1 $Px $Pn }. +interpretation "Forall_elim_ok_1" 'Forall_elim_ok_1 Px Pn = + (show Pn (Forall_elim ? ? ? Px)). + +notation < "\infrule hbox(\emsp Px \emsp) mstyle color #ff0000 (Pn) (∀\sub\e)" with precedence 19 +for @{ 'Forall_elim_ok_2 $Px $Pn }. +interpretation "Forall_elim_ok_2" 'Forall_elim_ok_2 Px Pn = + (cast ? ? (show Pn (Forall_elim ? ? ? Px))). + +notation > "∀#'e' {term 90 t} term 90 Pn" non associative with precedence 19 +for @{ 'Forall_elim (λ_.?) $t (show $Pn ?) }. +interpretation "Forall_elim KO" 'Forall_elim P t Px = + (cast ? unit (Forall_elim sort P t (cast ? ? Px))). +interpretation "Forall_elim OK" 'Forall_elim P t Px = + (Forall_elim sort P t Px). + +(* already proved lemma *) +definition hide_args : ΠA:Type[0].A→A := λA:Type[0].λa:A.a. +notation < "t" non associative with precedence 90 for @{'hide_args $t}. +interpretation "hide 0 args" 'hide_args t = (hide_args ? t). +interpretation "hide 1 args" 'hide_args t = (hide_args ? t ?). +interpretation "hide 2 args" 'hide_args t = (hide_args ? t ? ?). +interpretation "hide 3 args" 'hide_args t = (hide_args ? t ? ? ?). +interpretation "hide 4 args" 'hide_args t = (hide_args ? t ? ? ? ?). +interpretation "hide 5 args" 'hide_args t = (hide_args ? t ? ? ? ? ?). +interpretation "hide 6 args" 'hide_args t = (hide_args ? t ? ? ? ? ? ?). +interpretation "hide 7 args" 'hide_args t = (hide_args ? t ? ? ? ? ? ? ?). + +(* more args crashes the pattern matcher *) + +(* already proved lemma, 0 assumptions *) +definition Lemma : ΠA.A→A ≝ λA:Prop.λa:A.a. + +notation < "\infrule + (\infrule + (\emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma_ko_1 $p ($H : $_) }. +interpretation "lemma_ko_1" 'lemma_ko_1 p H = + (show p (cast ? ? (Lemma ? (cast ? ? H)))). + +notation < "\infrule + (\infrule + (\emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma_ko_2 $p ($H : $_) }. +interpretation "lemma_ko_2" 'lemma_ko_2 p H = + (cast ? ? (show p (cast ? ? + (Lemma ? (cast ? ? H))))). + + +notation < "\infrule + (\infrule + (\emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma_ok_1 $p ($H : $_) }. +interpretation "lemma_ok_1" 'lemma_ok_1 p H = + (show p (Lemma ? H)). + +notation < "\infrule + (\infrule + (\emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma_ok_2 $p ($H : $_) }. +interpretation "lemma_ok_2" 'lemma_ok_2 p H = + (cast ? ? (show p (Lemma ? H))). + +notation > "'lem' 0 term 90 l" non associative with precedence 19 +for @{ 'Lemma (hide_args ? $l : ?) }. +interpretation "lemma KO" 'Lemma l = + (cast ? ? (Lemma unit (cast unit ? l))). +interpretation "lemma OK" 'Lemma l = (Lemma ? l). + + +(* already proved lemma, 1 assumption *) +definition Lemma1 : ΠA,B. (A ⇒ B) → A → B ≝ + λA,B:Prop.λf:A⇒B.λa:A. + Imply_elim A B f a. + +notation < "\infrule + (\infrule + (\emsp a \emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma1_ko_1 $a $p ($H : $_) }. +interpretation "lemma1_ko_1" 'lemma1_ko_1 a p H = + (show p (cast ? ? (Lemma1 ? ? (cast ? ? H) (cast ? ? a)))). + +notation < "\infrule + (\infrule + (\emsp a \emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma1_ko_2 $a $p ($H : $_) }. +interpretation "lemma1_ko_2" 'lemma1_ko_2 a p H = + (cast ? ? (show p (cast ? ? + (Lemma1 ? ? (cast ? ? H) (cast ? ? a))))). + + +notation < "\infrule + (\infrule + (\emsp a \emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma1_ok_1 $a $p ($H : $_) }. +interpretation "lemma1_ok_1" 'lemma1_ok_1 a p H = + (show p (Lemma1 ? ? H a)). + +notation < "\infrule + (\infrule + (\emsp a \emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma1_ok_2 $a $p ($H : $_) }. +interpretation "lemma1_ok_2" 'lemma1_ok_2 a p H = + (cast ? ? (show p (Lemma1 ? ? H a))). + + +notation > "'lem' 1 term 90 l term 90 p" non associative with precedence 19 +for @{ 'Lemma1 (hide_args ? $l : ?) (show $p ?) }. +interpretation "lemma 1 KO" 'Lemma1 l p = + (cast ? ? (Lemma1 unit unit (cast (Imply unit unit) ? l) (cast unit ? p))). +interpretation "lemma 1 OK" 'Lemma1 l p = (Lemma1 ? ? l p). + +(* already proved lemma, 2 assumptions *) +definition Lemma2 : ΠA,B,C. (A ⇒ B ⇒ C) → A → B → C ≝ + λA,B,C:Prop.λf:A⇒B⇒C.λa:A.λb:B. + Imply_elim B C (Imply_elim A (B⇒C) f a) b. + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma2_ko_1 $a $b $p ($H : $_) }. +interpretation "lemma2_ko_1" 'lemma2_ko_1 a b p H = + (show p (cast ? ? (Lemma2 ? ? ? (cast ? ? H) (cast ? ? a) (cast ? ? b)))). + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma2_ko_2 $a $b $p ($H : $_) }. +interpretation "lemma2_ko_2" 'lemma2_ko_2 a b p H = + (cast ? ? (show p (cast ? ? + (Lemma2 ? ? ? (cast ? ? H) (cast ? ? a) (cast ? ? b))))). + + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma2_ok_1 $a $b $p ($H : $_) }. +interpretation "lemma2_ok_1" 'lemma2_ok_1 a b p H = + (show p (Lemma2 ? ? ? H a b)). + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma2_ok_2 $a $b $p ($H : $_) }. +interpretation "lemma2_ok_2" 'lemma2_ok_2 a b p H = + (cast ? ? (show p (Lemma2 ? ? ? H a b))). + +notation > "'lem' 2 term 90 l term 90 p term 90 q" non associative with precedence 19 +for @{ 'Lemma2 (hide_args ? $l : ?) (show $p ?) (show $q ?) }. +interpretation "lemma 2 KO" 'Lemma2 l p q = + (cast ? ? (Lemma2 unit unit unit (cast (Imply unit (Imply unit unit)) ? l) (cast unit ? p) (cast unit ? q))). +interpretation "lemma 2 OK" 'Lemma2 l p q = (Lemma2 ? ? ? l p q). + +(* already proved lemma, 3 assumptions *) +definition Lemma3 : ΠA,B,C,D. (A ⇒ B ⇒ C ⇒ D) → A → B → C → D ≝ + λA,B,C,D:Prop.λf:A⇒B⇒C⇒D.λa:A.λb:B.λc:C. + Imply_elim C D (Imply_elim B (C⇒D) (Imply_elim A (B⇒C⇒D) f a) b) c. + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp\emsp\emsp c \emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma3_ko_1 $a $b $c $p ($H : $_) }. +interpretation "lemma3_ko_1" 'lemma3_ko_1 a b c p H = + (show p (cast ? ? + (Lemma3 ? ? ? ? (cast ? ? H) (cast ? ? a) (cast ? ? b) (cast ? ? c)))). + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp\emsp\emsp c \emsp) + (╲ mstyle mathsize normal (mstyle color #ff0000 (H)) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma3_ko_2 $a $b $c $p ($H : $_) }. +interpretation "lemma3_ko_2" 'lemma3_ko_2 a b c p H = + (cast ? ? (show p (cast ? ? + (Lemma3 ? ? ? ? (cast ? ? H) (cast ? ? a) (cast ? ? b) (cast ? ? c))))). + + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp\emsp\emsp c \emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + p \nbsp" +non associative with precedence 19 +for @{ 'lemma3_ok_1 $a $b $c $p ($H : $_) }. +interpretation "lemma3_ok_1" 'lemma3_ok_1 a b c p H = + (show p (Lemma3 ? ? ? ? H a b c)). + +notation < "\infrule + (\infrule + (\emsp a \emsp\emsp\emsp b \emsp\emsp\emsp c \emsp) + (╲ mstyle mathsize normal (H) ╱) \nbsp) + mstyle color #ff0000 (p) \nbsp" +non associative with precedence 19 +for @{ 'lemma3_ok_2 $a $b $c $p ($H : $_) }. +interpretation "lemma3_ok_2" 'lemma3_ok_2 a b c p H = + (cast ? ? (show p (Lemma3 ? ? ? ? H a b c))). + +notation > "'lem' 3 term 90 l term 90 p term 90 q term 90 r" non associative with precedence 19 +for @{ 'Lemma3 (hide_args ? $l : ?) (show $p ?) (show $q ?) (show $r ?) }. +interpretation "lemma 3 KO" 'Lemma3 l p q r = + (cast ? ? (Lemma3 unit unit unit unit (cast (Imply unit (Imply unit (Imply unit unit))) ? l) (cast unit ? p) (cast unit ? q) (cast unit ? r))). +interpretation "lemma 3 OK" 'Lemma3 l p q r = (Lemma3 ? ? ? ? l p q r). 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/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/matita.lang b/matita/matita/matita.lang index 3caf034a3..56cb0c411 100644 --- a/matita/matita/matita.lang +++ b/matita/matita/matita.lang @@ -106,6 +106,32 @@ inversion lapply destruct + assume + suppose + that + is + equivalent + to + we + need + prove + or + equivalently + by + done + proved + have + such + the + thesis + becomes + conclude + obtain + proceed + induction + case + hypothesis + know alias diff --git a/matita/matita/matitaEngine.ml b/matita/matita/matitaEngine.ml index 2963e71c4..fea7161c1 100644 --- a/matita/matita/matitaEngine.ml +++ b/matita/matita/matitaEngine.ml @@ -1,14 +1,14 @@ (* Copyright (C) 2005, HELM Team. - * + * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science * Department, University of Bologna, Italy. - * + * * HELM is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * HELM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -18,20 +18,21 @@ * along with HELM; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. - * + * * For details, see the HELM World-Wide-Web page, * http://helm.cs.unibo.it/ - *) +*) (* $Id$ *) +module G = GrafiteAst open Printf class status baseuri = - object - inherit GrafiteTypes.status baseuri - inherit ApplyTransformation.status - end + object + inherit GrafiteTypes.status baseuri + inherit ApplyTransformation.status + end exception TryingToAdd of string Lazy.t exception EnrichedWithStatus of exn * status @@ -44,16 +45,105 @@ let debug_print = if debug then prerr_endline else ignore ;; let slash_n_RE = Pcre.regexp "\\n" ;; -let pp_ast_statement status stm = - let stm = GrafiteAstPp.pp_statement status stm - ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") +let first_line = ref true ;; + +let cases_or_induction_context stack = + match stack with + [] -> false + | (_g,_t,_k,_tag,p)::_tl -> try + let s = List.assoc "context" p in + s = "cases" || s = "induction" + with + Not_found -> false +;; + +let has_focused_goal stack = + match stack with + [] -> false + | (g,_t,_k,_tag,_p)::_tl -> (List.length g) > 0 +;; + +let get_indentation status _statement = + let base_ind = + match status#stack with + [] -> 0 + | s -> List.length(s) * 2 in - let stm = Pcre.replace ~rex:slash_n_RE stm in - let stm = + if cases_or_induction_context status#stack then + ( + if has_focused_goal status#stack then + base_ind + 2 + else + base_ind + ) + else + base_ind +;; + +let pp_ind s n = + let rec aux s n = + match n with + 0 -> s + | n -> " " ^ (aux s (n-1)) + in + aux s n + +let write_ast_to_file status fname statement = + let indentation = get_indentation status statement in + let str = match statement with + G.Comment _ -> GrafiteAstPp.pp_statement status statement + ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") + | G.Executable (_,code) -> + ( + match code with + G.NTactic _ -> GrafiteAstPp.pp_statement status statement + ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") + | G.NCommand (_,cmd) -> + ( + match cmd with + | G.NObj (_,obj,_) -> + ( + match obj with + NotationPt.Theorem _ -> "\n" ^ GrafiteAstPp.pp_statement status statement + ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") + | _ -> "" + ) + | G.NQed _ -> GrafiteAstPp.pp_statement status statement + ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") + | _ -> "" + ) + | _ -> "" + ) + in + if str <> "" then + ( + let s = pp_ind str indentation in + let flaglist = if !first_line = false then [Open_wronly; Open_append; Open_creat] + else (first_line := false; [Open_wronly; Open_trunc; Open_creat]) + in + let out_channel = + Stdlib.open_out_gen flaglist 0o0644 fname in + let _ = Stdlib.output_string out_channel ((if str.[0] <> '\n' then s else str) ^ "\n") in + let _ = Stdlib.close_out out_channel in + str + ) + else + str +;; + +let pp_ast_statement status stm ~fname = + let stm = write_ast_to_file status (fname ^ ".parsed.ma") stm in + if stm <> "" then + ( + let stm = Pcre.replace ~rex:slash_n_RE stm in + let stm = if String.length stm > 50 then String.sub stm 0 50 ^ " ..." else stm - in + in HLog.debug ("Executing: ``" ^ stm ^ "''") + ) + else + HLog.debug ("Executing: `` Unprintable statement ''") ;; let clean_exit baseuri exn = @@ -61,7 +151,7 @@ let clean_exit baseuri exn = raise (FailureCompiling (baseuri,exn)) ;; -let cut prefix s = +let cut prefix s = let lenp = String.length prefix in let lens = String.length s in assert (lens > lenp); @@ -69,33 +159,33 @@ let cut prefix s = String.sub s lenp (lens-lenp) ;; -let print_string = - let indent = ref 0 in - let print_string ~right_justify s = - let ss = - match right_justify with - None -> "" - | Some (ss,len_ss) -> - let i = 80 - !indent - len_ss - String.length s in - if i > 0 then String.make i ' ' ^ ss else ss - in - assert (!indent >=0); - print_string (String.make !indent ' ' ^ s ^ ss) in - fun enter ?right_justify s -> - if enter then (print_string ~right_justify s; incr indent) else (decr indent; print_string ~right_justify s) +let print_string = + let indent = ref 0 in + let print_string ~right_justify s = + let ss = + match right_justify with + None -> "" + | Some (ss,len_ss) -> + let i = 80 - !indent - len_ss - String.length s in + if i > 0 then String.make i ' ' ^ ss else ss + in + assert (!indent >=0); + print_string (String.make !indent ' ' ^ s ^ ss) in + fun enter ?right_justify s -> + if enter then (print_string ~right_justify s; incr indent) else (decr indent; print_string ~right_justify s) ;; -let pp_times ss fname rc big_bang big_bang_u big_bang_s = +let pp_times ss fname rc big_bang big_bang_u big_bang_s = if not (Helm_registry.get_bool "matita.verbose") then let { Unix.tms_utime = u ; Unix.tms_stime = s} = Unix.times () in let r = Unix.gettimeofday () -. big_bang in let u = u -. big_bang_u in let s = s -. big_bang_s in let extra = try Sys.getenv "BENCH_EXTRA_TEXT" with Not_found -> "" in - let rc = + let rc = if rc then "OK" else "FAIL" in - let times = - let fmt t = + let times = + let fmt t = let seconds = int_of_float t in let cents = int_of_float ((t -. floor t) *. 100.0) in let minutes = seconds / 60 in @@ -111,51 +201,51 @@ let pp_times ss fname rc big_bang big_bang_u big_bang_s = ;; let eval_ast ~include_paths ?do_heavy_checks status (text,prefix_len,ast) = - let baseuri = status#baseuri in - let new_aliases,new_status = - GrafiteDisambiguate.eval_with_new_aliases status - (fun status -> - let time0 = Unix.gettimeofday () in - let status = - GrafiteEngine.eval_ast ~include_paths ?do_heavy_checks status - (text,prefix_len,ast) in - let time1 = Unix.gettimeofday () in - HLog.debug ("... grafite_engine done in " ^ string_of_float (time1 -. time0) ^ "s"); - status - ) in - let _,intermediate_states = - List.fold_left - (fun (status,acc) (k,value) -> - let v = GrafiteAst.description_of_alias value in - let b = - try - let NReference.Ref (uri,_) = NReference.reference_of_string v in - NUri.baseuri_of_uri uri = baseuri - with - NReference.IllFormedReference _ -> - false (* v is a description, not a URI *) - in - if b then - status,acc - else - let status = - GrafiteDisambiguate.set_proof_aliases status ~implicit_aliases:false - GrafiteAst.WithPreferences [k,value] - in - status, (status ,Some (k,value))::acc - ) (status,[]) new_aliases (* WARNING: this must be the old status! *) - in + let baseuri = status#baseuri in + let new_aliases,new_status = + GrafiteDisambiguate.eval_with_new_aliases status + (fun status -> + let time0 = Unix.gettimeofday () in + let status = + GrafiteEngine.eval_ast ~include_paths ?do_heavy_checks status + (text,prefix_len,ast) in + let time1 = Unix.gettimeofday () in + HLog.debug ("... grafite_engine done in " ^ string_of_float (time1 -. time0) ^ "s"); + status + ) in + let _,intermediate_states = + List.fold_left + (fun (status,acc) (k,value) -> + let v = GrafiteAst.description_of_alias value in + let b = + try + let NReference.Ref (uri,_) = NReference.reference_of_string v in + NUri.baseuri_of_uri uri = baseuri + with + NReference.IllFormedReference _ -> + false (* v is a description, not a URI *) + in + if b then + status,acc + else + let status = + GrafiteDisambiguate.set_proof_aliases status ~implicit_aliases:false + GrafiteAst.WithPreferences [k,value] + in + status, (status ,Some (k,value))::acc + ) (status,[]) new_aliases (* WARNING: this must be the old status! *) + in (new_status,None)::intermediate_states ;; let baseuri_of_script ~include_paths fname = - try Librarian.baseuri_of_script ~include_paths fname - with - Librarian.NoRootFor _ -> + try Librarian.baseuri_of_script ~include_paths fname + with + Librarian.NoRootFor _ -> HLog.error ("The included file '"^fname^"' has no root file,"); HLog.error "please create it."; raise (Failure ("No root file for "^fname)) - | Librarian.FileNotFound _ -> + | Librarian.FileNotFound _ -> raise (Failure ("File not found: "^fname)) ;; @@ -173,68 +263,68 @@ let read_include_paths ~include_paths:_ file = in let rc = root :: includes in List.iter (HLog.debug) rc; rc - with Librarian.NoRootFor _ | Librarian.FileNotFound _ -> - [] + with Librarian.NoRootFor _ | Librarian.FileNotFound _ -> + [] ;; -let rec get_ast status ~compiling ~asserted ~include_paths strm = +let rec get_ast status ~compiling ~asserted ~include_paths strm = match GrafiteParser.parse_statement status strm with - (GrafiteAst.Executable + (GrafiteAst.Executable (_,GrafiteAst.NCommand (_,GrafiteAst.Include (_,_,mafilename)))) as cmd - -> - let already_included = NCicLibrary.get_transitively_included status in - let asserted,_ = - assert_ng ~already_included ~compiling ~asserted ~include_paths - mafilename - in - asserted,cmd - | cmd -> asserted,cmd + -> + let already_included = NCicLibrary.get_transitively_included status in + let asserted,_ = + assert_ng ~already_included ~compiling ~asserted ~include_paths + mafilename + in + asserted,cmd + | cmd -> asserted,cmd and eval_from_stream ~compiling ~asserted ~include_paths ?do_heavy_checks status str cb = - let matita_debug = Helm_registry.get_bool "matita.debug" in - let rec loop asserted status str = - let asserted,stop,status,str = - try - let cont = - try Some (get_ast status ~compiling ~asserted ~include_paths str) - with End_of_file -> None in - match cont with - | None -> asserted, true, status, str - | Some (asserted,ast) -> - cb status ast; - let new_statuses = - eval_ast ~include_paths ?do_heavy_checks status ("",0,ast) in - let status = - match new_statuses with - [s,None] -> s - | _::(_,Some (_,value))::_ -> - raise (TryingToAdd (lazy (GrafiteAstPp.pp_alias value))) - | _ -> assert false in - (* CSC: complex patch to re-build the lexer since the tokens may - have changed. Note: this way we loose look-ahead tokens. - Hence the "include" command must be terminated (no look-ahead) *) - let str = - match ast with - (GrafiteAst.Executable - (_,GrafiteAst.NCommand - (_,(GrafiteAst.Include _ | GrafiteAst.Notation _)))) -> + let matita_debug = Helm_registry.get_bool "matita.debug" in + let rec loop asserted status str = + let asserted,stop,status,str = + try + let cont = + try Some (get_ast status ~compiling ~asserted ~include_paths str) + with End_of_file -> None in + match cont with + | None -> asserted, true, status, str + | Some (asserted,ast) -> + cb status ast; + let new_statuses = + eval_ast ~include_paths ?do_heavy_checks status ("",0,ast) in + let status = + match new_statuses with + [s,None] -> s + | _::(_,Some (_,value))::_ -> + raise (TryingToAdd (lazy (GrafiteAstPp.pp_alias value))) + | _ -> assert false in + (* CSC: complex patch to re-build the lexer since the tokens may + have changed. Note: this way we loose look-ahead tokens. + Hence the "include" command must be terminated (no look-ahead) *) + let str = + match ast with + (GrafiteAst.Executable + (_,GrafiteAst.NCommand + (_,(GrafiteAst.Include _ | GrafiteAst.Notation _)))) -> GrafiteParser.parsable_statement status - (GrafiteParser.strm_of_parsable str) - | _ -> str - in - asserted, false, status, str - with exn when not matita_debug -> - raise (EnrichedWithStatus (exn, status)) + (GrafiteParser.strm_of_parsable str) + | _ -> str + in + asserted, false, status, str + with exn when not matita_debug -> + raise (EnrichedWithStatus (exn, status)) + in + if stop then asserted,status else loop asserted status str in - if stop then asserted,status else loop asserted status str - in loop asserted status str and compile ~compiling ~asserted ~include_paths fname = if List.mem fname compiling then raise (CircularDependency fname); let compiling = fname::compiling in let matita_debug = Helm_registry.get_bool "matita.debug" in - let root,baseuri,fname,_tgt = + let root,baseuri,fname,_tgt = Librarian.baseuri_of_script ~include_paths fname in if Http_getter_storage.is_read_only baseuri then assert false; (* MATITA 1.0: debbo fare time_travel sulla ng_library? *) @@ -245,154 +335,154 @@ and compile ~compiling ~asserted ~include_paths fname = let ocamldirname = Filename.dirname fname in let ocamlfname = Filename.chop_extension (Filename.basename fname) in let status,ocamlfname = - Common.modname_of_filename status false ocamlfname in + Common.modname_of_filename status false ocamlfname in let ocamlfname = ocamldirname ^ "/" ^ ocamlfname ^ ".ml" in let status = OcamlExtraction.open_file status ~baseuri ocamlfname in let big_bang = Unix.gettimeofday () in - let { Unix.tms_utime = big_bang_u ; Unix.tms_stime = big_bang_s} = - Unix.times () + let { Unix.tms_utime = big_bang_u ; Unix.tms_stime = big_bang_s} = + Unix.times () in let time = Unix.time () in - let cc = - let rex = Str.regexp ".*opt$" in - if Str.string_match rex Sys.argv.(0) 0 then "matitac.opt" - else "matitac" in + let cc = + let rex = Str.regexp ".*opt$" in + if Str.string_match rex Sys.argv.(0) 0 then "matitac.opt" + else "matitac" in let s = Printf.sprintf "%s %s" cc (cut (root^"/") fname) in try (* cleanup of previously compiled objects *) if (not (Http_getter_storage.is_empty ~local:true baseuri)) - then begin + then begin HLog.message ("baseuri " ^ baseuri ^ " is not empty"); HLog.message ("cleaning baseuri " ^ baseuri); LibraryClean.clean_baseuris [baseuri]; end; HLog.message ("compiling " ^ Filename.basename fname ^ " in " ^ baseuri); if not (Helm_registry.get_bool "matita.verbose") then - (print_string true (s ^ "\n"); flush stdout); + (print_string true (s ^ "\n"); flush stdout); (* we dalay this error check until we print 'matitac file ' *) assert (Http_getter_storage.is_empty ~local:true baseuri); (* create dir for XML files *) if not (Helm_registry.get_opt_default Helm_registry.bool "matita.nodisk" - ~default:false) + ~default:false) then - HExtlib.mkdir - (Filename.dirname - (Http_getter.filename ~local:true ~writable:true (baseuri ^ - "foo.con"))); + HExtlib.mkdir + (Filename.dirname + (Http_getter.filename ~local:true ~writable:true (baseuri ^ + "foo.con"))); let buf = - GrafiteParser.parsable_statement status - (Ulexing.from_utf8_channel (open_in fname)) + GrafiteParser.parsable_statement status + (Ulexing.from_utf8_channel (open_in fname)) in let print_cb = - if not (Helm_registry.get_bool "matita.verbose") then (fun _ _ -> ()) - else pp_ast_statement + if not (Helm_registry.get_bool "matita.verbose") then fun _ _ -> () + else pp_ast_statement ~fname in let asserted, status = - eval_from_stream ~compiling ~asserted ~include_paths status buf print_cb in + eval_from_stream ~compiling ~asserted ~include_paths status buf print_cb in let status = OcamlExtraction.close_file status in let elapsed = Unix.time () -. time in - (if Helm_registry.get_bool "matita.moo" then begin - GrafiteTypes.Serializer.serialize ~baseuri:(NUri.uri_of_string baseuri) - status - end; + (if Helm_registry.get_bool "matita.moo" then begin + GrafiteTypes.Serializer.serialize ~baseuri:(NUri.uri_of_string baseuri) + status + end; let tm = Unix.gmtime elapsed in let sec = string_of_int tm.Unix.tm_sec ^ "''" in - let min = - if tm.Unix.tm_min > 0 then (string_of_int tm.Unix.tm_min^"' ") else "" + let min = + if tm.Unix.tm_min > 0 then (string_of_int tm.Unix.tm_min^"' ") else "" in - let hou = + let hou = if tm.Unix.tm_hour > 0 then (string_of_int tm.Unix.tm_hour^"h ") else "" in - HLog.message + HLog.message (sprintf "execution of %s completed in %s." fname (hou^min^sec)); pp_times s fname true big_bang big_bang_u big_bang_s; (*CSC: bad, one imperative bit is still there! to be moved into functional status *) NCicMetaSubst.pushmaxmeta (); -(* MATITA 1.0: debbo fare time_travel sulla ng_library? - LexiconSync.time_travel - ~present:lexicon_status ~past:initial_lexicon_status; -*) + (* MATITA 1.0: debbo fare time_travel sulla ng_library? + LexiconSync.time_travel + ~present:lexicon_status ~past:initial_lexicon_status; + *) asserted) - with + with (* all exceptions should be wrapped to allow lexicon-undo (LS.time_travel) *) | exn when not matita_debug -> -(* MATITA 1.0: debbo fare time_travel sulla ng_library? - LexiconSync.time_travel ~present:lexicon ~past:initial_lexicon_status; - * *) - (*CSC: bad, one imperative bit is still there! - to be moved into functional status *) - NCicMetaSubst.pushmaxmeta (); - pp_times s fname false big_bang big_bang_u big_bang_s; - clean_exit baseuri exn + (* MATITA 1.0: debbo fare time_travel sulla ng_library? + LexiconSync.time_travel ~present:lexicon ~past:initial_lexicon_status; + * *) + (*CSC: bad, one imperative bit is still there! + to be moved into functional status *) + NCicMetaSubst.pushmaxmeta (); + pp_times s fname false big_bang big_bang_u big_bang_s; + clean_exit baseuri exn and assert_ng ~already_included ~compiling ~asserted ~include_paths mapath = - let root,baseuri,fullmapath,_ = - Librarian.baseuri_of_script ~include_paths mapath in - if List.mem fullmapath asserted then asserted,false - else - begin - let include_paths = - let includes = - try - Str.split (Str.regexp " ") - (List.assoc "include_paths" (Librarian.load_root_file (root^"/root"))) - with Not_found -> [] - in - root::includes @ - Helm_registry.get_list Helm_registry.string "matita.includes" in - let baseuri = NUri.uri_of_string baseuri in - let ngtime_of baseuri = - let ngpath = NCicLibrary.ng_path_of_baseuri baseuri in - try - Some (Unix.stat ngpath).Unix.st_mtime - with Unix.Unix_error (Unix.ENOENT, "stat", f) when f = ngpath -> None in - let matime = - try (Unix.stat fullmapath).Unix.st_mtime - with Unix.Unix_error (Unix.ENOENT, "stat", f) when f = fullmapath -> assert false - in - let ngtime = ngtime_of baseuri in - let asserted,to_be_compiled = - match ngtime with - Some ngtime -> - let preamble = GrafiteTypes.Serializer.dependencies_of baseuri in - let asserted,children_bad = - List.fold_left - (fun (asserted,b) mapath -> - let asserted,b1 = - try - assert_ng ~already_included ~compiling ~asserted ~include_paths - mapath - with Librarian.NoRootFor _ | Librarian.FileNotFound _ -> - asserted, true - in - asserted, b || b1 - || let _,baseuri,_,_ = - (*CSC: bug here? include_paths should be empty and - mapath should be absolute *) - Librarian.baseuri_of_script ~include_paths mapath in - let baseuri = NUri.uri_of_string baseuri in - (match ngtime_of baseuri with - Some child_ngtime -> child_ngtime > ngtime - | None -> assert false) - ) (asserted,false) preamble + let root,baseuri,fullmapath,_ = + Librarian.baseuri_of_script ~include_paths mapath in + if List.mem fullmapath asserted then asserted,false + else + begin + let include_paths = + let includes = + try + Str.split (Str.regexp " ") + (List.assoc "include_paths" (Librarian.load_root_file (root^"/root"))) + with Not_found -> [] in - asserted, children_bad || matime > ngtime - | None -> asserted,true - in - if not to_be_compiled then fullmapath::asserted,false - else - if List.mem baseuri already_included then - (* maybe recompiling it I would get the same... *) - raise (AlreadyLoaded (lazy mapath)) - else - let asserted = compile ~compiling ~asserted ~include_paths fullmapath in - fullmapath::asserted,true - end + root::includes @ + Helm_registry.get_list Helm_registry.string "matita.includes" in + let baseuri = NUri.uri_of_string baseuri in + let ngtime_of baseuri = + let ngpath = NCicLibrary.ng_path_of_baseuri baseuri in + try + Some (Unix.stat ngpath).Unix.st_mtime + with Unix.Unix_error (Unix.ENOENT, "stat", f) when f = ngpath -> None in + let matime = + try (Unix.stat fullmapath).Unix.st_mtime + with Unix.Unix_error (Unix.ENOENT, "stat", f) when f = fullmapath -> assert false + in + let ngtime = ngtime_of baseuri in + let asserted,to_be_compiled = + match ngtime with + Some ngtime -> + let preamble = GrafiteTypes.Serializer.dependencies_of baseuri in + let asserted,children_bad = + List.fold_left + (fun (asserted,b) mapath -> + let asserted,b1 = + try + assert_ng ~already_included ~compiling ~asserted ~include_paths + mapath + with Librarian.NoRootFor _ | Librarian.FileNotFound _ -> + asserted, true + in + asserted, b || b1 + || let _,baseuri,_,_ = + (*CSC: bug here? include_paths should be empty and + mapath should be absolute *) + Librarian.baseuri_of_script ~include_paths mapath in + let baseuri = NUri.uri_of_string baseuri in + (match ngtime_of baseuri with + Some child_ngtime -> child_ngtime > ngtime + | None -> assert false) + ) (asserted,false) preamble + in + asserted, children_bad || matime > ngtime + | None -> asserted,true + in + if not to_be_compiled then fullmapath::asserted,false + else + if List.mem baseuri already_included then + (* maybe recompiling it I would get the same... *) + raise (AlreadyLoaded (lazy mapath)) + else + let asserted = compile ~compiling ~asserted ~include_paths fullmapath in + fullmapath::asserted,true + end ;; let assert_ng ~include_paths mapath = - snd (assert_ng ~include_paths ~already_included:[] ~compiling:[] ~asserted:[] - mapath) + snd (assert_ng ~include_paths ~already_included:[] ~compiling:[] ~asserted:[] + mapath) let get_ast status ~include_paths strm = - snd (get_ast status ~compiling:[] ~asserted:[] ~include_paths strm) + snd (get_ast status ~compiling:[] ~asserted:[] ~include_paths strm) diff --git a/matita/matita/matitaMathView.ml b/matita/matita/matitaMathView.ml index b6c0d209d..271a7b19a 100644 --- a/matita/matita/matitaMathView.ml +++ b/matita/matita/matitaMathView.ml @@ -122,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)); @@ -573,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 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"; "𝟡"; "⑨"; "⓽"; "𝟗"; ] ; ] ;;