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
matita/matita/contribs/lambdadelta/2A
matita/matita/contribs/lambdadelta/*/*_probe.txt
matita/matita/contribs/lambdadelta/*/web/*_sum.tbl
+
+matita/matita/contribs/convergence/
-matita : current version: 0.99.3
+matita : current version: 0.99.4
matitaB: new version: 0.5.8
helm : old version: 0.5.8 with additional material
--- /dev/null
+sed s?lambdadelta.info?www.cs.unibo.it/~fguidi/lambdadelta?g html/$1.html > html/$1.alt.html
@charset "UTF-8";
-/* menus ********************************************************************/
+/* term selection ***********************************************************/
-td {
- padding: inherit;
+.term:hover > .term:not(:hover) {
+ opacity: 0.35;
}
+/* log table ****************************************************************/
+
+.log {
+ width: 100%;
+ border-collapse: collapse;
+}
+
+.log_cell {
+ border-color: initial;
+ border-style: solid none;
+ border-width: thin;
+ padding: 2px;
+}
+
+/* forms ********************************************************************/
+
.text {
display: inline-block;
list-style: none;
margin: initial;
padding: initial;
- white-space: nowrap;
+ white-space: nowrap;
}
.menu {
display: none;
border-style: solid;
border-width: thin;
+ border-collapse: collapse;
position: absolute;
}
display: inline-block;
}
+.menu_cell {
+ padding: 2px;
+}
+
+.menu_empty {
+ padding: inherit;
+}
+
+.menu_sep {
+ padding: inherit;
+ border-top-style: solid;
+ border-top-width: thin;
+}
+
/* buttons ******************************************************************/
+.type {
+ font: inherit;
+}
+
.button {
- color: inherit;
background-color: inherit;
- border-style: none;
+ border-style: none;
+ color: inherit;
+ font: inherit;
margin: initial;
padding: initial;
+ text-align: inherit;
}
.button:hover {
/* font families ************************************************************/
.monospace {
- font-family:monospace;
+ font-family: monospace; "Courier New", Courier;
}
/* line heights *************************************************************/
.l_150 {
- line-height:150%;
+ line-height: 150%;
}
/* font sizes ***************************************************************/
/* foreground colors (equalized to gray 8F) *********************************/
+.f_white {
+ color:#FFFFFF;
+}
+
.f_gray {
color:#8F8F8F;
}
.f_wine {
- color:#FF52A0;
-}
+ color:#FF52A0;
+}
.f_magenta {
- color:#FF41FF;
-}
+ color:#FF41FF;
+}
.f_prune {
- color:#C65DFF;
-}
+ color:#C65DFF;
+}
.f_blue {
color:#8181FF;
}
.b_cyan {
- background-color:#6CFFFF;
+ background-color:#6CFFFF;
}
.b_water {
background-color:#FFC0C0;
}
+.b_black {
+ background-color:#000000;
+}
+
/* background colors (equalized to gray EB) *********************************/
.b_gray_EB {
background-color:#EBEBEB;
}
+
+.b_blue_EB {
+ background-color:#E8E8FF;
+}
+
+.b_orange_EB {
+ background-color:#FFEBB1;
+}
+
+.b_red_EB {
+ background-color:#FFE2E2;
+}
+
+/* background colors (equalized to gray 48) *********************************/
+
+.b_gray_48 {
+ background-color:#484848;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<page xmlns="http://lambdadelta.info/"
+ description = "\lambda\delta home page"
+ title = "\lambda\delta home page"
+ logo = "crux"
+ head = "The Formal Systems of the λδ (\lambda\delta) Family"
+>
+ <sitemap name="sitemap"/>
+
+ <section15 name="changes">Changes</section15>
+ <body>
+ </body>
+ <table name="changes"/>
+
+ <footer/>
+</page>
--- /dev/null
+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 }
to view this site correctly, please select a font
with <link to="http://www.unicode.org/">Unicode</link> support.
</body>
+ <body>
+ <ucs-bronze char="03BB"/>
+ </body>
<!-- ===================================================================== -->
</xsl:choose>
</xsl:template>
+<xsl:template match="ld:ucs-bronze">
+ <img
+ alt="[Official bronze sponsor of Unicode Consortium]"
+ title="Official bronze sponsor of Unicode Consortium"
+ src="{$baseurl}images/bronze-{@char}.png"
+ />
+</xsl:template>
+
<xsl:template match="ld:footer">
<xsl:call-template name="rule"/>
<div class="spacer"><br/></div>
--- /dev/null
+S components/*
+S matita
+
+B components/*
+B matita
+
+PKG lablgtk3 helm-content helm-ng_disambiguation helm-content_pres helm-ng_extraction helm-disambiguation helm-ng_kernel helm-extlib helm-ng_library helm-getter helm-ng_paramodulation helm-grafite helm-ng_refiner helm-grafite_engine helm-ng_tactics helm-grafite_parser helm-registry helm-library helm-syntax_extensions helm-logger helm-thread helm-ng_cic_content helm-xml
+
+FLG -rectypes
dist_export: dist/configure
rm -rf $(DISTDIR)
mkdir $(DISTDIR)
- svn export components $(DISTDIR)/components
- svn export matita $(DISTDIR)/matita
+ git archive matita-lablgtk3 components | tar -x -C $(DISTDIR)
+ git archive matita-lablgtk3 matita | tar -x -C $(DISTDIR)
(cd $(DISTDIR) && find . -name .depend -exec rm \{\} \;)
(cd $(DISTDIR) && find . -name .depend.opt -exec rm \{\} \;)
(cd $(DISTDIR) && rm -rf $(CLEAN_ON_DIST))
-requires="helm-content helm-syntax_extensions camlp5.gramlib ulex08 helm-grafite"
+requires="helm-content helm-syntax_extensions camlp5.gramlib ulex-camlp5 helm-grafite"
version="0.0.1"
archive(byte)="content_pres.cma"
archive(native)="content_pres.cmxa"
-requires="helm-grafite ulex08 helm-ng_disambiguation helm-ng_library helm-content_pres"
+requires="helm-grafite ulex-camlp5 helm-ng_disambiguation helm-ng_library helm-content_pres"
version="0.0.1"
archive(byte)="grafite_parser.cma"
archive(native)="grafite_parser.cmxa"
PREPROCOPTIONS = -pp camlp5o
SYNTAXOPTIONS = -syntax camlp5o
PREREQ =
-OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread -rectypes $(ANNOTOPTION)
+OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread -rectypes $(ANNOTOPTION) -w @A-52-4-34-37-45-9-44-48-6-32-20-58-7-57-3 # -57-3 for ocaml 4.0.5
OCAMLDEBUGOPTIONS = -g
#OCAML_PROF=p -p a
OCAMLARCHIVEOPTIONS =
-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
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 <int> ] < <file>" in
- let help_c = " Print the redundant and looping arcs of the dependences graph" in
- let help_d = "<flags> 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 <int> | -b <string> ] < <file>" in
+ let help_b = "<string> 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 = "<flags> 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 ()
EXEC = xoa
VERSION=0.2.0
-REQUIRES = helm-grafite
+REQUIRES = helm-registry
include ../Makefile.common
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 | <configuration file> ]*\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 | <configuration file> ]*\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
+content.cmo : \
+ content.cmi
+content.cmx : \
+ content.cmi
content.cmi :
-notationUtil.cmi : notationPt.cmo
-notationEnv.cmi : notationPt.cmo
-notationPp.cmi : notationPt.cmo notationEnv.cmi
+notationEnv.cmo : \
+ notationUtil.cmi \
+ notationPt.cmo \
+ notationEnv.cmi
+notationEnv.cmx : \
+ notationUtil.cmx \
+ notationPt.cmx \
+ notationEnv.cmi
+notationEnv.cmi : \
+ notationPt.cmo
+notationPp.cmo : \
+ notationPt.cmo \
+ notationEnv.cmi \
+ notationPp.cmi
+notationPp.cmx : \
+ notationPt.cmx \
+ notationEnv.cmx \
+ notationPp.cmi
+notationPp.cmi : \
+ notationPt.cmo \
+ notationEnv.cmi
notationPt.cmo :
notationPt.cmx :
-content.cmo : content.cmi
-content.cmx : content.cmi
-notationUtil.cmo : notationPt.cmo notationUtil.cmi
-notationUtil.cmx : notationPt.cmx notationUtil.cmi
-notationEnv.cmo : notationUtil.cmi notationPt.cmo notationEnv.cmi
-notationEnv.cmx : notationUtil.cmx notationPt.cmx notationEnv.cmi
-notationPp.cmo : notationPt.cmo notationEnv.cmi notationPp.cmi
-notationPp.cmx : notationPt.cmx notationEnv.cmx notationPp.cmi
+notationUtil.cmo : \
+ notationPt.cmo \
+ notationUtil.cmi
+notationUtil.cmx : \
+ notationPt.cmx \
+ notationUtil.cmi
+notationUtil.cmi : \
+ notationPt.cmo
+content.cmx : \
+ content.cmi
content.cmi :
-notationUtil.cmi : notationPt.cmx
-notationEnv.cmi : notationPt.cmx
-notationPp.cmi : notationPt.cmx notationEnv.cmi
-notationPt.cmo :
+notationEnv.cmx : \
+ notationUtil.cmx \
+ notationPt.cmx \
+ notationEnv.cmi
+notationEnv.cmi : \
+ notationPt.cmx
+notationPp.cmx : \
+ notationPt.cmx \
+ notationEnv.cmx \
+ notationPp.cmi
+notationPp.cmi : \
+ notationPt.cmx \
+ notationEnv.cmi
notationPt.cmx :
-content.cmo : content.cmi
-content.cmx : content.cmi
-notationUtil.cmo : notationPt.cmx notationUtil.cmi
-notationUtil.cmx : notationPt.cmx notationUtil.cmi
-notationEnv.cmo : notationUtil.cmi notationPt.cmx notationEnv.cmi
-notationEnv.cmx : notationUtil.cmx notationPt.cmx notationEnv.cmi
-notationPp.cmo : notationPt.cmx notationEnv.cmi notationPp.cmi
-notationPp.cmx : notationPt.cmx notationEnv.cmx notationPp.cmi
+notationUtil.cmx : \
+ notationPt.cmx \
+ notationUtil.cmi
+notationUtil.cmi : \
+ notationPt.cmx
| ty, _ -> raise (Type_mismatch (name, ty))
let opt_binding_some (n, (ty, v)) = (n, (OptType ty, OptValue (Some v)))
-let opt_binding_none (n, (ty, v)) = (n, (OptType ty, OptValue None))
+let opt_binding_none (n, (ty, _v)) = (n, (OptType ty, OptValue None))
let opt_binding_of_name (n, ty) = (n, (OptType ty, OptValue None))
let list_binding_of_name (n, ty) = (n, (ListType ty, ListValue []))
let opt_declaration (n, ty) = (n, OptType ty)
(match typ with None -> "" | Some t -> sprintf " return %s" (pp_term t))
(pp_patterns status patterns)
| Ast.Cast (t1, t2) -> sprintf "(%s: %s)" (pp_term ~pp_parens:true t1) (pp_term ~pp_parens:true t2)
- | Ast.LetIn ((var,t2), t1, t3) ->
+ | Ast.LetIn ((var,_t2), t1, t3) ->
(* let t2 = match t2 with None -> Ast.Implicit | Some t -> t in *)
sprintf "let %s \\def %s in %s" (pp_term var)
(* (pp_term ~pp_parens:true t2) *)
| Ast.NumVar s -> "number " ^ s
| Ast.IdentVar s -> "ident " ^ s
| Ast.TermVar (s,Ast.Self _) -> s
- | Ast.TermVar (s,Ast.Level l) -> "term " ^string_of_int l
- | Ast.Ascription (t, n) -> assert false
+ | Ast.TermVar (_s,Ast.Level l) -> "term " ^string_of_int l
+ | Ast.Ascription (_t, _n) -> assert false
| Ast.FreshVar n -> "fresh " ^ n
let _pp_term = ref (pp_term ~pp_parens:false)
| Ast.Ascription (t, s) -> Ast.Ascription (k t, s)
let variables_of_term t =
- let rec vars = ref [] in
+ let vars = ref [] in
let add_variable v =
if List.mem v !vars then ()
else vars := v :: !vars
List.map aux (variables_of_term t)
let keywords_of_term t =
- let rec keywords = ref [] in
+ let keywords = ref [] in
let add_keyword k = keywords := k :: !keywords in
let rec aux = function
| Ast.AttributedTerm (_, t) -> aux t
| Ast.AttributedTerm (_, term) -> strip_attributes term
| Ast.Magic m -> Ast.Magic (visit_magic strip_attributes m)
| Ast.Variable _ as t -> t
- | t -> assert false
+ | _t -> assert false
in
visit_ast ~special_k strip_attributes t
| _ -> []
let meta_names_of_term term =
- let rec names = ref [] in
+ let names = ref [] in
let add_name n =
if List.mem n !names then ()
else names := n :: !names
| Ast.AttributedTerm (_, term) -> aux term
| Ast.Appl terms -> List.iter aux terms
| Ast.Binder (_, _, body) -> aux body
- | Ast.Case (term, indty, outty_opt, patterns) ->
+ | Ast.Case (term, _indty, outty_opt, patterns) ->
aux term ;
aux_opt outty_opt ;
List.iter aux_branch patterns
aux term
and aux_pattern =
function
- Ast.Pattern (head, _, vars) -> List.iter aux_capture_var vars
+ Ast.Pattern (_head, _, vars) -> List.iter aux_capture_var vars
| Ast.Wildcard -> ()
and aux_substs substs = List.iter (fun (_, term) -> aux term) substs
and aux_meta_substs meta_substs = List.iter aux_opt meta_substs
| _ -> assert false
in
match term with
- | Ast.Symbol (s, instance) -> Ast.Symbol (s, fresh_instance ())
- | Ast.Num (s, instance) -> Ast.Num (s, fresh_instance ())
+ | Ast.Symbol (s, _instance) -> Ast.Symbol (s, fresh_instance ())
+ | Ast.Num (s, _instance) -> Ast.Num (s, fresh_instance ())
| t -> visit_ast ~special_k freshen_term t
let freshen_obj obj =
-renderingAttrs.cmi :
-cicNotationLexer.cmi :
-cicNotationParser.cmi :
-mpresentation.cmi :
+box.cmo : \
+ renderingAttrs.cmi \
+ box.cmi
+box.cmx : \
+ renderingAttrs.cmx \
+ box.cmi
box.cmi :
-content2presMatcher.cmi :
-termContentPres.cmi : cicNotationParser.cmi
-boxPp.cmi : mpresentation.cmi cicNotationPres.cmi box.cmi
-cicNotationPres.cmi : mpresentation.cmi box.cmi
-content2pres.cmi : termContentPres.cmi cicNotationPres.cmi
-renderingAttrs.cmo : renderingAttrs.cmi
-renderingAttrs.cmx : renderingAttrs.cmi
-cicNotationLexer.cmo : cicNotationLexer.cmi
-cicNotationLexer.cmx : cicNotationLexer.cmi
-cicNotationParser.cmo : cicNotationLexer.cmi cicNotationParser.cmi
-cicNotationParser.cmx : cicNotationLexer.cmx cicNotationParser.cmi
-mpresentation.cmo : mpresentation.cmi
-mpresentation.cmx : mpresentation.cmi
-box.cmo : renderingAttrs.cmi box.cmi
-box.cmx : renderingAttrs.cmx box.cmi
-content2presMatcher.cmo : content2presMatcher.cmi
-content2presMatcher.cmx : content2presMatcher.cmi
-termContentPres.cmo : renderingAttrs.cmi content2presMatcher.cmi \
- cicNotationParser.cmi termContentPres.cmi
-termContentPres.cmx : renderingAttrs.cmx content2presMatcher.cmx \
- cicNotationParser.cmx termContentPres.cmi
-boxPp.cmo : renderingAttrs.cmi mpresentation.cmi cicNotationPres.cmi box.cmi \
+boxPp.cmo : \
+ renderingAttrs.cmi \
+ mpresentation.cmi \
+ cicNotationPres.cmi \
+ box.cmi \
boxPp.cmi
-boxPp.cmx : renderingAttrs.cmx mpresentation.cmx cicNotationPres.cmx box.cmx \
+boxPp.cmx : \
+ renderingAttrs.cmx \
+ mpresentation.cmx \
+ cicNotationPres.cmx \
+ box.cmx \
boxPp.cmi
-cicNotationPres.cmo : renderingAttrs.cmi mpresentation.cmi box.cmi \
+boxPp.cmi : \
+ mpresentation.cmi \
+ cicNotationPres.cmi \
+ box.cmi
+cicNotationLexer.cmo : \
+ cicNotationLexer.cmi
+cicNotationLexer.cmx : \
+ cicNotationLexer.cmi
+cicNotationLexer.cmi :
+cicNotationParser.cmo : \
+ cicNotationLexer.cmi \
+ cicNotationParser.cmi
+cicNotationParser.cmx : \
+ cicNotationLexer.cmx \
+ cicNotationParser.cmi
+cicNotationParser.cmi :
+cicNotationPres.cmo : \
+ renderingAttrs.cmi \
+ mpresentation.cmi \
+ box.cmi \
+ cicNotationPres.cmi
+cicNotationPres.cmx : \
+ renderingAttrs.cmx \
+ mpresentation.cmx \
+ box.cmx \
cicNotationPres.cmi
-cicNotationPres.cmx : renderingAttrs.cmx mpresentation.cmx box.cmx \
+cicNotationPres.cmi : \
+ mpresentation.cmi \
+ box.cmi
+content2pres.cmo : \
+ termContentPres.cmi \
+ renderingAttrs.cmi \
+ mpresentation.cmi \
+ cicNotationPres.cmi \
+ box.cmi \
+ content2pres.cmi
+content2pres.cmx : \
+ termContentPres.cmx \
+ renderingAttrs.cmx \
+ mpresentation.cmx \
+ cicNotationPres.cmx \
+ box.cmx \
+ content2pres.cmi
+content2pres.cmi : \
+ termContentPres.cmi \
cicNotationPres.cmi
-content2pres.cmo : termContentPres.cmi renderingAttrs.cmi mpresentation.cmi \
- cicNotationPres.cmi box.cmi content2pres.cmi
-content2pres.cmx : termContentPres.cmx renderingAttrs.cmx mpresentation.cmx \
- cicNotationPres.cmx box.cmx content2pres.cmi
+content2presMatcher.cmo : \
+ content2presMatcher.cmi
+content2presMatcher.cmx : \
+ content2presMatcher.cmi
+content2presMatcher.cmi :
+mpresentation.cmo : \
+ mpresentation.cmi
+mpresentation.cmx : \
+ mpresentation.cmi
+mpresentation.cmi :
+renderingAttrs.cmo : \
+ renderingAttrs.cmi
+renderingAttrs.cmx : \
+ renderingAttrs.cmi
+renderingAttrs.cmi :
+termContentPres.cmo : \
+ renderingAttrs.cmi \
+ content2presMatcher.cmi \
+ cicNotationParser.cmi \
+ termContentPres.cmi
+termContentPres.cmx : \
+ renderingAttrs.cmx \
+ content2presMatcher.cmx \
+ cicNotationParser.cmx \
+ termContentPres.cmi
+termContentPres.cmi : \
+ cicNotationParser.cmi
-renderingAttrs.cmi :
-cicNotationLexer.cmi :
-cicNotationParser.cmi :
-mpresentation.cmi :
+box.cmx : \
+ renderingAttrs.cmx \
+ box.cmi
box.cmi :
-content2presMatcher.cmi :
-termContentPres.cmi : cicNotationParser.cmi
-boxPp.cmi : mpresentation.cmi cicNotationPres.cmi box.cmi
-cicNotationPres.cmi : mpresentation.cmi box.cmi
-content2pres.cmi : termContentPres.cmi cicNotationPres.cmi
-renderingAttrs.cmo : renderingAttrs.cmi
-renderingAttrs.cmx : renderingAttrs.cmi
-cicNotationLexer.cmo : cicNotationLexer.cmi
-cicNotationLexer.cmx : cicNotationLexer.cmi
-cicNotationParser.cmo : cicNotationLexer.cmi cicNotationParser.cmi
-cicNotationParser.cmx : cicNotationLexer.cmx cicNotationParser.cmi
-mpresentation.cmo : mpresentation.cmi
-mpresentation.cmx : mpresentation.cmi
-box.cmo : renderingAttrs.cmi box.cmi
-box.cmx : renderingAttrs.cmx box.cmi
-content2presMatcher.cmo : content2presMatcher.cmi
-content2presMatcher.cmx : content2presMatcher.cmi
-termContentPres.cmo : renderingAttrs.cmi content2presMatcher.cmi \
- cicNotationParser.cmi termContentPres.cmi
-termContentPres.cmx : renderingAttrs.cmx content2presMatcher.cmx \
- cicNotationParser.cmx termContentPres.cmi
-boxPp.cmo : renderingAttrs.cmi mpresentation.cmi cicNotationPres.cmi box.cmi \
- boxPp.cmi
-boxPp.cmx : renderingAttrs.cmx mpresentation.cmx cicNotationPres.cmx box.cmx \
+boxPp.cmx : \
+ renderingAttrs.cmx \
+ mpresentation.cmx \
+ cicNotationPres.cmx \
+ box.cmx \
boxPp.cmi
-cicNotationPres.cmo : renderingAttrs.cmi mpresentation.cmi box.cmi \
+boxPp.cmi : \
+ mpresentation.cmi \
+ cicNotationPres.cmi \
+ box.cmi
+cicNotationLexer.cmx : \
+ cicNotationLexer.cmi
+cicNotationLexer.cmi :
+cicNotationParser.cmx : \
+ cicNotationLexer.cmx \
+ cicNotationParser.cmi
+cicNotationParser.cmi :
+cicNotationPres.cmx : \
+ renderingAttrs.cmx \
+ mpresentation.cmx \
+ box.cmx \
cicNotationPres.cmi
-cicNotationPres.cmx : renderingAttrs.cmx mpresentation.cmx box.cmx \
+cicNotationPres.cmi : \
+ mpresentation.cmi \
+ box.cmi
+content2pres.cmx : \
+ termContentPres.cmx \
+ renderingAttrs.cmx \
+ mpresentation.cmx \
+ cicNotationPres.cmx \
+ box.cmx \
+ content2pres.cmi
+content2pres.cmi : \
+ termContentPres.cmi \
cicNotationPres.cmi
-content2pres.cmo : termContentPres.cmi renderingAttrs.cmi mpresentation.cmi \
- cicNotationPres.cmi box.cmi content2pres.cmi
-content2pres.cmx : termContentPres.cmx renderingAttrs.cmx mpresentation.cmx \
- cicNotationPres.cmx box.cmx content2pres.cmi
+content2presMatcher.cmx : \
+ content2presMatcher.cmi
+content2presMatcher.cmi :
+mpresentation.cmx : \
+ mpresentation.cmi
+mpresentation.cmi :
+renderingAttrs.cmx : \
+ renderingAttrs.cmi
+renderingAttrs.cmi :
+termContentPres.cmx : \
+ renderingAttrs.cmx \
+ content2presMatcher.cmx \
+ cicNotationParser.cmx \
+ termContentPres.cmi
+termContentPres.cmi : \
+ cicNotationParser.cmi
IMPLEMENTATION_FILES = \
$(INTERFACE_FILES:%.mli=%.ml)
-cicNotationPres.cmi: OCAMLOPTIONS += -rectypes
-cicNotationPres.cmo: OCAMLOPTIONS += -rectypes
-cicNotationPres.cmx: OCAMLOPTIONS += -rectypes
-
all:
clean:
LOCAL_LINKOPTS = -package helm-content_pres -linkpkg
cicNotationLexer.cmo: OCAMLC = $(OCAMLC_P4)
-cicNotationParser.cmo: OCAMLC = $(OCAMLC_P4)
+cicNotationParser.cmo: OCAMLC = $(OCAMLC_P4) -w -27
cicNotationLexer.cmx: OCAMLOPT = $(OCAMLOPT_P4)
-cicNotationParser.cmx: OCAMLOPT = $(OCAMLOPT_P4)
+cicNotationParser.cmx: OCAMLOPT = $(OCAMLOPT_P4) -w -27
cicNotationLexer.ml.annot: OCAMLC = $(OCAMLC_P4)
cicNotationParser.ml.annot: OCAMLC = $(OCAMLC_P4)
# soon as we have ocaml 3.09 everywhere and "loc" occurrences are replaced by
# "_loc" occurrences
UTF8DIR := $(shell $(OCAMLFIND) query helm-syntax_extensions)
-ULEXDIR := $(shell $(OCAMLFIND) query ulex08)
+ULEXDIR := $(shell $(OCAMLFIND) query ulex-camlp5)
MY_SYNTAXOPTIONS = -pp "camlp5o -I $(UTF8DIR) -I $(ULEXDIR) pa_extend.cmo pa_ulex.cma pa_unicode_macro.cma -loc loc"
cicNotationLexer.cmo: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS)
cicNotationParser.cmo: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS)
let spacing = want_spacing attrs in
let children' = List.map aux_box children in
(fun size ->
- let (size', renderings) as res =
+ let (size', _renderings) as res =
render_row max_size spacing children'
in
if size' <= size then (* children fit in a row *)
res
else (* break needed, re-render using a Box.V *)
aux_box (Box.V (attrs, children)) size)
- | Box.V (attrs, []) -> assert false
- | Box.V (attrs, [child]) -> aux_box child
+ | Box.V (_attrs, []) -> assert false
+ | Box.V (_attrs, [child]) -> aux_box child
| Box.V (attrs, hd :: tl) ->
let indent = want_indent attrs in
let hd_f = aux_box hd in
in
let rows = hd_rendering @ List.concat tl_renderings in
max_len rows, rows)
- | Box.HOV (attrs, []) -> assert false
- | Box.HOV (attrs, [child]) -> aux_box child
+ | Box.HOV (_attrs, []) -> assert false
+ | Box.HOV (_attrs, [child]) -> aux_box child
| Box.HOV (attrs, children) ->
let spacing = want_spacing attrs in
let indent = want_indent attrs in
let href =
try
let _,_,href =
- List.find (fun (ns,na,value) -> ns = Some "xlink" && na = "href") attrs
+ List.find (fun (ns,na,_value) -> ns = Some "xlink" && na = "href") attrs
in
Some href
with Not_found -> None in
in
fixed_rendering href s
| Pres.Mspace _ -> fixed_rendering href string_space
- | Pres.Mrow (attrs, children) ->
+ | Pres.Mrow (_attrs, children) ->
let children' = List.map aux_mpres children in
(fun size -> render_row size false children')
| Pres.Mfrac (_, m, n) ->
and aux_magic magic =
match magic with
| Ast.Opt p ->
- let p_bindings, p_atoms, p_names, p_action = inner_pattern p in
- let action (env_opt : NotationEnv.t option) (loc : Ast.location) =
+ let _p_bindings, p_atoms, p_names, p_action = inner_pattern p in
+ let action (env_opt : NotationEnv.t option) (_loc : Ast.location) =
match env_opt with
| Some env -> List.map Env.opt_binding_some env
| None -> List.map Env.opt_binding_of_name p_names
(* $Id$ *)
-open Printf
-
module Ast = NotationPt
module Mpres = Mpresentation
match t with
| Mpresentation.Mobject (_, box) ->
mpres_of_box (Box.H ([], [ open_box_paren; box; closed_box_paren ]))
- | mpres -> Mpresentation.Mrow ([], [open_paren; t; closed_paren])
+ | _mpres -> Mpresentation.Mrow ([], [open_paren; t; closed_paren])
end else
((*prerr_endline ("NOT adding parens around: "^
BoxPp.render_to_string (function x::_->x|_->assert false)
| t ->
prerr_endline ("unexpected ast: " ^ NotationPp.pp_term status t);
assert false
- and aux_attributes xmlattrs mathonly xref prec t =
+ and aux_attributes _xmlattrs mathonly _xref prec t =
let reset = ref false in
let inferred_level = ref None in
let expected_level = ref None in
in
(* prerr_endline (NotationPp.pp_term t); *)
aux_attribute t
- and aux_literal xmlattrs xref prec l =
+ and aux_literal xmlattrs xref _prec l =
let attrs = make_href xmlattrs xref in
(match l with
| `Symbol s -> Mpres.Mo (attrs, to_unicode s)
let make_arg_for_apply is_first arg row =
let res =
match arg with
- Con.Aux n -> assert false
+ Con.Aux _n -> assert false
| Con.Premise prem ->
let name =
(match prem.Con.premise_binder with
(match p.Con.premise_binder with
| None -> assert false; (* unnamed hypothesis ??? *)
| Some s -> B.Text([],s))
- | err -> assert false) in
+ | _err -> assert false) in
(match conclude.Con.conclude_conclusion with
None ->
B.b_h [] [B.b_kw "by"; B.b_space; arg]
- | Some c ->
+ | Some _c ->
B.b_h [] [B.b_kw "by"; B.b_space; arg]
)
else if conclude.Con.conclude_method = "Intros+LetTac" then
(match conclude.Con.conclude_args with
- [Con.ArgProof p] ->
+ [Con.ArgProof _p] ->
(match conclude.Con.conclude_args with
[Con.ArgProof p] ->
proof2pres0 term2pres ?skip_initial_lambdas_internal true p false
and arg2pres term2pres =
function
Con.Aux n -> B.b_kw ("aux " ^ n)
- | Con.Premise prem -> B.b_kw "premise"
- | Con.Lemma lemma -> B.b_kw "lemma"
+ | Con.Premise _prem -> B.b_kw "premise"
+ | Con.Lemma _lemma -> B.b_kw "lemma"
| Con.Term (_,t) -> term2pres t
| Con.ArgProof p -> proof2pres0 term2pres true p false
- | Con.ArgMethod s -> B.b_kw "method"
+ | Con.ArgMethod _s -> B.b_kw "method"
and case term2pres conclude =
let proof_conclusion =
let case_on =
let case_arg =
(match arg with
- Con.Aux n -> B.b_kw "an aux???"
+ Con.Aux _n -> B.b_kw "an aux???"
| Con.Premise prem ->
(match prem.Con.premise_binder with
None -> B.b_kw "previous"
| Con.Lemma lemma -> B.Object ([], P.Mi([],lemma.Con.lemma_name))
| Con.Term (_,t) ->
term2pres t
- | Con.ArgProof p -> B.b_kw "a proof???"
- | Con.ArgMethod s -> B.b_kw "a method???")
+ | Con.ArgProof _p -> B.b_kw "a proof???"
+ | Con.ArgMethod _s -> B.b_kw "a method???")
in
(make_concl "we proceed by cases on" case_arg) in
let to_prove =
let induction_on =
let arg =
(match inductive_arg with
- Con.Aux n -> B.b_kw "an aux???"
+ Con.Aux _n -> B.b_kw "an aux???"
| Con.Premise prem ->
(match prem.Con.premise_binder with
None -> B.b_kw "previous"
| Con.Lemma lemma -> B.Object ([], P.Mi([],lemma.Con.lemma_name))
| Con.Term (_,t) ->
term2pres t
- | Con.ArgProof p -> B.b_kw "a proof???"
- | Con.ArgMethod s -> B.b_kw "a method???") in
+ | Con.ArgProof _p -> B.b_kw "a proof???"
+ | Con.ArgMethod _s -> B.b_kw "a method???") in
(make_concl "we proceed by induction on" arg) in
let to_prove =
B.H ([], [make_concl "to prove" proof_conclusion ; B.Text([],".")]) in
| Some t -> term2pres t) in
let case_arg =
(match conclude.Con.conclude_args with
- [Con.Aux(n);_;case_arg] -> case_arg
+ [Con.Aux(_n);_;case_arg] -> case_arg
| _ -> assert false;
(*
List.map (ContentPp.parg 0) conclude.Con.conclude_args;
assert false *)) in
let arg =
(match case_arg with
- Con.Aux n -> assert false
+ Con.Aux _n -> assert false
| Con.Premise prem ->
(match prem.Con.premise_binder with
None -> [B.b_kw "Contradiction, hence"]
and andind term2pres conclude =
let proof,case_arg =
(match conclude.Con.conclude_args with
- [Con.Aux(n);_;Con.ArgProof proof;case_arg] -> proof,case_arg
+ [Con.Aux(_n);_;Con.ArgProof proof;case_arg] -> proof,case_arg
| _ -> assert false;
(*
List.map (ContentPp.parg 0) conclude.Con.conclude_args;
assert false *)) in
let arg =
(match case_arg with
- Con.Aux n -> assert false
+ Con.Aux _n -> assert false
| Con.Premise prem ->
(match prem.Con.premise_binder with
None -> []
B.Object([], P.Mi([],lemma.Con.lemma_name))]
| _ -> assert false) in
match proof.Con.proof_context with
- `Hypothesis hyp1::`Hypothesis hyp2::tl ->
+ `Hypothesis hyp1::`Hypothesis hyp2::_tl ->
let preshyp1 =
B.H ([],
[B.Text([],"(");
and exists term2pres conclude =
let proof =
(match conclude.Con.conclude_args with
- [Con.Aux(n);_;Con.ArgProof proof;_] -> proof
+ [Con.Aux(_n);_;Con.ArgProof proof;_] -> proof
| _ -> assert false;
(*
List.map (ContentPp.parg 0) conclude.Con.conclude_args;
assert false *)) in
match proof.Con.proof_context with
- `Declaration decl::`Hypothesis hyp::tl
- | `Hypothesis decl::`Hypothesis hyp::tl ->
+ `Declaration decl::`Hypothesis hyp::_tl
+ | `Hypothesis decl::`Hypothesis hyp::_tl ->
let presdecl =
B.H ([],
[(B.b_kw "let");
let nobj2pres0
?skip_initial_lambdas ?(skip_thm_and_qed=false) term2pres
- (id,metasenv,obj : NotationPt.term Content.cobj)
+ (_id,metasenv,obj : NotationPt.term Content.cobj)
=
match obj with
| `Def (Content.Const, thesis, `Proof p) ->
(* $Id$ *)
-open Printf
-
module Ast = NotationPt
module Env = NotationEnv
-module Pp = NotationPp
module Util = NotationUtil
let get_tag term0 =
Ast.Variable (Ast.TermVar (name,Ast.Level 0))
in
let rec aux = function
- | Ast.AttributedTerm (_, t) -> assert false
+ | Ast.AttributedTerm (_, _t) -> assert false
| Ast.Literal _
| Ast.Layout _ -> assert false
| Ast.Variable v -> Ast.Variable v
*)
and compile_magic = function
- | Ast.Fold (kind, p_base, names, p_rec) ->
+ | Ast.Fold (_kind, p_base, names, p_rec) ->
let p_rec_decls = Env.declarations_of_term p_rec in
(* LUCA: p_rec_decls should not contain "names" *)
let acc_name = try List.hd names with Failure _ -> assert false in
let rec aux term =
match compiled_rec term with
| None -> aux_base term
- | Some (env', ctors', _) ->
+ | Some (env', _ctors', _) ->
begin
let acc = Env.lookup_term env' acc_name in
let env'' = Env.remove_name env' acc_name in
| Some (env', ctors', 0) ->
let env' =
List.map
- (fun (name, (ty, v)) as binding ->
+ (fun (name, (_ty, _v)) as binding ->
if List.exists (fun (name', _) -> name = name') p_opt_decls
then Env.opt_binding_some binding
else binding)
let add_level_info prec t = Ast.AttributedTerm (`Level prec, t)
-let rec top_pos t = add_level_info ~-1 t
+let top_pos t = add_level_info ~-1 t
let rec remove_level_info =
function
Ast.AttributedTerm (attr, subst_singleton pos env t)
| t -> NotationUtil.group (subst pos env t)
and subst pos env = function
- | Ast.AttributedTerm (attr, t) ->
+ | Ast.AttributedTerm (_attr, t) ->
(* prerr_endline ("loosing attribute " ^ NotationPp.pp_attribute attr); *)
subst pos env t
| Ast.Variable var ->
| Ast.Literal l as t ->
let t = add_idrefs idrefs t in
(match l with
- | `Keyword k -> [ add_keyword_attrs t ]
+ | `Keyword _k -> [ add_keyword_attrs t ]
| _ -> [ t ])
| Ast.Layout l -> [ Ast.Layout (subst_layout pos env l) ]
| t -> [ NotationUtil.visit_ast (subst_singleton pos env) t ]
in
let rec aux env term =
match term with
- | Ast.AttributedTerm (a, term) -> (*Ast.AttributedTerm (a, *)aux env term
+ | Ast.AttributedTerm (_a, term) -> (*Ast.AttributedTerm (a, *)aux env term
| Ast.Appl terms -> Ast.Appl (List.map (aux env) terms)
| Ast.Binder (binder, var, body) ->
Ast.Binder (binder, aux_capture_var env var, aux env body)
Ast.Pattern (head, hrefs, vars) ->
Ast.Pattern (head, hrefs, List.map (aux_capture_var env) vars)
| Ast.Wildcard -> Ast.Wildcard
- and aux_definition env (params, var, term, i) =
- (List.map (aux_capture_var env) params, aux_capture_var env var, aux env term, i)
+ (*and aux_definition env (params, var, term, i) =
+ (List.map (aux_capture_var env) params, aux_capture_var env var, aux env term, i)*)
and aux_substs env substs =
List.map (fun (name, term) -> (name, aux env term)) substs
and aux_meta_substs env meta_substs = List.map (aux_opt env) meta_substs
| Ast.TermVar (name,(Ast.Level l|Ast.Self l)) ->
Ast.AttributedTerm (`Level l,Env.lookup_term env name)
| Ast.FreshVar name -> Ast.Ident (lookup_fresh_name name, None)
- | Ast.Ascription (term, name) -> assert false
+ | Ast.Ascription (_term, _name) -> assert false
and aux_magic env = function
| Ast.Default (some_pattern, none_pattern) ->
let some_pattern_names = NotationUtil.names_of_term some_pattern in
| _ -> assert false
in
instantiate_fold_right env)
- | Ast.If (_, p_true, p_false) as t ->
+ | Ast.If (_, _p_true, _p_false) as t ->
aux env (NotationUtil.find_branch (Ast.Magic t))
| Ast.Fail -> assert false
| _ -> assert false
+disambiguate.cmo : \
+ disambiguateTypes.cmi \
+ disambiguate.cmi
+disambiguate.cmx : \
+ disambiguateTypes.cmx \
+ disambiguate.cmi
+disambiguate.cmi : \
+ disambiguateTypes.cmi
+disambiguateTypes.cmo : \
+ disambiguateTypes.cmi
+disambiguateTypes.cmx : \
+ disambiguateTypes.cmi
disambiguateTypes.cmi :
-disambiguate.cmi : disambiguateTypes.cmi
-multiPassDisambiguator.cmi : disambiguateTypes.cmi disambiguate.cmi
-disambiguateTypes.cmo : disambiguateTypes.cmi
-disambiguateTypes.cmx : disambiguateTypes.cmi
-disambiguate.cmo : disambiguateTypes.cmi disambiguate.cmi
-disambiguate.cmx : disambiguateTypes.cmx disambiguate.cmi
-multiPassDisambiguator.cmo : disambiguateTypes.cmi disambiguate.cmi \
+multiPassDisambiguator.cmo : \
+ disambiguateTypes.cmi \
+ disambiguate.cmi \
multiPassDisambiguator.cmi
-multiPassDisambiguator.cmx : disambiguateTypes.cmx disambiguate.cmx \
+multiPassDisambiguator.cmx : \
+ disambiguateTypes.cmx \
+ disambiguate.cmx \
multiPassDisambiguator.cmi
+multiPassDisambiguator.cmi : \
+ disambiguateTypes.cmi \
+ disambiguate.cmi
+disambiguate.cmx : \
+ disambiguateTypes.cmx \
+ disambiguate.cmi
+disambiguate.cmi : \
+ disambiguateTypes.cmi
+disambiguateTypes.cmx : \
+ disambiguateTypes.cmi
disambiguateTypes.cmi :
-disambiguate.cmi : disambiguateTypes.cmi
-multiPassDisambiguator.cmi : disambiguateTypes.cmi disambiguate.cmi
-disambiguateTypes.cmo : disambiguateTypes.cmi
-disambiguateTypes.cmx : disambiguateTypes.cmi
-disambiguate.cmo : disambiguateTypes.cmi disambiguate.cmi
-disambiguate.cmx : disambiguateTypes.cmx disambiguate.cmi
-multiPassDisambiguator.cmo : disambiguateTypes.cmi disambiguate.cmi \
- multiPassDisambiguator.cmi
-multiPassDisambiguator.cmx : disambiguateTypes.cmx disambiguate.cmx \
+multiPassDisambiguator.cmx : \
+ disambiguateTypes.cmx \
+ disambiguate.cmx \
multiPassDisambiguator.cmi
+multiPassDisambiguator.cmi : \
+ disambiguateTypes.cmi \
+ disambiguate.cmi
type domain = domain_tree list
and domain_tree = Node of Stdpp.location list * domain_item * domain
-let mono_uris_callback ~selection_mode ?ok
- ?(enable_button_for_non_vars = true) ~title ~msg ~id =
+let mono_uris_callback ~selection_mode:_ ?ok:(_)
+ ?enable_button_for_non_vars:(_ = true) ~title:(_) ~msg:(_) ~id:(_) =
if Helm_registry.get_opt_default Helm_registry.get_bool ~default:true
"matita.auto_disambiguation"
then
let interactive_user_uri_choice = !_choose_uris_callback
let interactive_interpretation_choice interp = !_choose_interp_callback interp
-let input_or_locate_uri ~(title:string) ?id () = None
+let input_or_locate_uri ~title:(_:string) ?id:(_) () = None
(* Zack: I try to avoid using this callback. I therefore assume that
* the presence of an identifier that can't be resolved via "locate"
* query is a syntax error *)
match snd (mk_choice (Environment.find item env)), arg with
`Num_interp f, `Num_arg n -> f n
| `Sym_interp f, `Args l -> f l
- | `Sym_interp f, `Num_arg n -> (* Implicit number! *) f []
+ | `Sym_interp f, `Num_arg _n -> (* Implicit number! *) f []
| _,_ -> assert false
with Not_found ->
failwith ("Domain item not found: " ^
let find_in_context name context =
let rec aux acc = function
| [] -> raise Not_found
- | Some hd :: tl when hd = name -> acc
+ | Some hd :: _tl when hd = name -> acc
| _ :: tl -> aux (acc + 1) tl
in
aux 1 context
| _ :: tl -> get_first_constructor tl in
let do_branch =
function
- Ast.Pattern (head, _, args), term ->
+ Ast.Pattern (_head, _, args), term ->
let (term_context, args_domain) =
List.fold_left
(fun (cont, dom) (name, typ) ->
| Ast.NRef _ -> []
| Ast.NCic _ -> []
| Ast.Implicit _ -> []
- | Ast.Num (num, i) -> [ Node ([loc], Num i, []) ]
- | Ast.Meta (index, local_context) ->
+ | Ast.Num (_num, i) -> [ Node ([loc], Num i, []) ]
+ | Ast.Meta (_index, local_context) ->
List.fold_left
(fun dom term -> dom @ domain_of_term_option ~loc ~context term)
[] local_context
(fun (context,res) (name,ty,_,_) ->
Some name::context, res @ domain_of_term context ty
) (context_w_types,[]) fields)
- | Ast.LetRec (kind, defs, _) ->
+ | Ast.LetRec (_kind, defs, _) ->
let add_defs context =
List.fold_left
(fun acc (_, (var, _), _, _) -> string_of_name var :: acc
(match elt with
Symbol (symb',_) when symb = symb' -> true
| _ -> false)
- | Num i ->
+ | Num _i ->
(match elt with
Num _ -> true
| _ -> false)
let aliases, todo_dom =
let rec aux (aliases,acc) = function
| [] -> aliases, acc
- | (Node (locs, item,extra) as node) :: tl ->
+ | Node (locs, item,extra) :: tl ->
let choices = lookup_choices item in
if List.length choices = 0 then
(* Quick failure *)
let find k env =
match k with
- Symbol (sym,n) ->
+ Symbol (sym,_n) ->
(try find k env
with Not_found -> find (Symbol (sym,0)) env)
- | Num n ->
+ | Num _n ->
(try find k env
with Not_found -> find (Num 0) env)
| _ -> find k env
(* $Id$ *)
-open Printf
-
let debug = ref false;;
let debug_print s =
if !debug then prerr_endline (Lazy.force s) else ();;
let try_pass (fresh_instances, (_, aliases, universe), use_coercions) =
f ~fresh_instances ~aliases ~universe ~use_coercions thing
in
- let set_aliases (instances,(use_mono_aliases,_,_),_) (_, user_asked as res) =
+ let set_aliases (_instances,(use_mono_aliases,_,_),_) (_, user_asked as res) =
if use_mono_aliases then
drop_aliases ~minimize_instances:true ~description_of_alias res (* one shot aliases *)
else if user_asked then
+componentsConf.cmo : \
+ componentsConf.cmi
+componentsConf.cmx : \
+ componentsConf.cmi
componentsConf.cmi :
+discrimination_tree.cmo : \
+ trie.cmi \
+ hExtlib.cmi \
+ discrimination_tree.cmi
+discrimination_tree.cmx : \
+ trie.cmx \
+ hExtlib.cmx \
+ discrimination_tree.cmi
+discrimination_tree.cmi :
+graphvizPp.cmo : \
+ graphvizPp.cmi
+graphvizPp.cmx : \
+ graphvizPp.cmi
+graphvizPp.cmi :
+hExtlib.cmo : \
+ hExtlib.cmi
+hExtlib.cmx : \
+ hExtlib.cmi
hExtlib.cmi :
+hLog.cmo : \
+ hLog.cmi
+hLog.cmx : \
+ hLog.cmi
+hLog.cmi :
+hMarshal.cmo : \
+ hExtlib.cmi \
+ hMarshal.cmi
+hMarshal.cmx : \
+ hExtlib.cmx \
+ hMarshal.cmi
hMarshal.cmi :
+hTopoSort.cmo : \
+ hTopoSort.cmi
+hTopoSort.cmx : \
+ hTopoSort.cmi
+hTopoSort.cmi :
+patternMatcher.cmo : \
+ patternMatcher.cmi
+patternMatcher.cmx : \
+ patternMatcher.cmi
patternMatcher.cmi :
-hLog.cmi :
+trie.cmo : \
+ trie.cmi
+trie.cmx : \
+ trie.cmi
trie.cmi :
-discrimination_tree.cmi :
-hTopoSort.cmi :
-graphvizPp.cmi :
-componentsConf.cmo : componentsConf.cmi
-componentsConf.cmx : componentsConf.cmi
-hExtlib.cmo : hExtlib.cmi
-hExtlib.cmx : hExtlib.cmi
-hMarshal.cmo : hExtlib.cmi hMarshal.cmi
-hMarshal.cmx : hExtlib.cmx hMarshal.cmi
-patternMatcher.cmo : patternMatcher.cmi
-patternMatcher.cmx : patternMatcher.cmi
-hLog.cmo : hLog.cmi
-hLog.cmx : hLog.cmi
-trie.cmo : trie.cmi
-trie.cmx : trie.cmi
-discrimination_tree.cmo : trie.cmi hExtlib.cmi discrimination_tree.cmi
-discrimination_tree.cmx : trie.cmx hExtlib.cmx discrimination_tree.cmi
-hTopoSort.cmo : hTopoSort.cmi
-hTopoSort.cmx : hTopoSort.cmi
-graphvizPp.cmo : graphvizPp.cmi
-graphvizPp.cmx : graphvizPp.cmi
+componentsConf.cmx : \
+ componentsConf.cmi
componentsConf.cmi :
+discrimination_tree.cmx : \
+ trie.cmx \
+ hExtlib.cmx \
+ discrimination_tree.cmi
+discrimination_tree.cmi :
+graphvizPp.cmx : \
+ graphvizPp.cmi
+graphvizPp.cmi :
+hExtlib.cmx : \
+ hExtlib.cmi
hExtlib.cmi :
+hLog.cmx : \
+ hLog.cmi
+hLog.cmi :
+hMarshal.cmx : \
+ hExtlib.cmx \
+ hMarshal.cmi
hMarshal.cmi :
+hTopoSort.cmx : \
+ hTopoSort.cmi
+hTopoSort.cmi :
+patternMatcher.cmx : \
+ patternMatcher.cmi
patternMatcher.cmi :
-hLog.cmi :
+trie.cmx : \
+ trie.cmi
trie.cmi :
-discrimination_tree.cmi :
-hTopoSort.cmi :
-graphvizPp.cmi :
-componentsConf.cmo : componentsConf.cmi
-componentsConf.cmx : componentsConf.cmi
-hExtlib.cmo : hExtlib.cmi
-hExtlib.cmx : hExtlib.cmi
-hMarshal.cmo : hExtlib.cmi hMarshal.cmi
-hMarshal.cmx : hExtlib.cmx hMarshal.cmi
-patternMatcher.cmo : patternMatcher.cmi
-patternMatcher.cmx : patternMatcher.cmi
-hLog.cmo : hLog.cmi
-hLog.cmx : hLog.cmi
-trie.cmo : trie.cmi
-trie.cmx : trie.cmi
-discrimination_tree.cmo : trie.cmi hExtlib.cmi discrimination_tree.cmi
-discrimination_tree.cmx : trie.cmx hExtlib.cmx discrimination_tree.cmi
-hTopoSort.cmo : hTopoSort.cmi
-hTopoSort.cmx : hTopoSort.cmi
-graphvizPp.cmo : graphvizPp.cmi
-graphvizPp.cmx : graphvizPp.cmi
(* the equivalent of skip, but on the index, thus the list of trees
that are rooted just after the term represented by the tree root
are returned (we are skipping the root) *)
- let skip_root = function DiscriminationTree.Node (value, map) ->
- let rec get n = function DiscriminationTree.Node (v, m) as tree ->
+ let skip_root = function DiscriminationTree.Node (_value, map) ->
+ let rec get n = function DiscriminationTree.Node (_v, m) as tree ->
if n = 0 then [tree] else
PSMap.fold (fun k v res -> (get (n-1 + arity_of k) v) @ res) m []
in
match tree, path with
| DiscriminationTree.Node (Some s, _), [] -> s
| DiscriminationTree.Node (None, _), [] -> A.empty
- | DiscriminationTree.Node (_, map), Variable::path when unif ->
+ | DiscriminationTree.Node (_, _map), Variable::path when unif ->
List.fold_left A.union A.empty
(List.map (retrieve path) (skip_root tree))
| DiscriminationTree.Node (_, map), node::path ->
(List.map
(fun s, w ->
HExtlib.filter_map (fun x ->
- try Some (x, w + snd (List.find (fun (s,w) -> A.mem x s) l2))
+ try Some (x, w + snd (List.find (fun (s,_w) -> A.mem x s) l2))
with Not_found -> None)
(A.elements s))
l1)
match tree, path with
| DiscriminationTree.Node (Some s, _), [] -> S.singleton (s, n)
| DiscriminationTree.Node (None, _), [] -> S.empty
- | DiscriminationTree.Node (_, map), Variable::path when unif ->
+ | DiscriminationTree.Node (_, _map), Variable::path when unif ->
List.fold_left S.union S.empty
(List.map (retrieve n path) (skip_root tree))
| DiscriminationTree.Node (_, map), node::path ->
in
aux
-let rec list_findopt f l =
+let list_findopt f l =
let rec aux k = function
| [] -> None
| x::tl ->
let rec aux acc n l =
match n, l with
| 0, _ -> List.rev acc, l
- | n, [] -> raise (Failure "HExtlib.split_nth")
+ | _, [] -> raise (Failure "HExtlib.split_nth")
| n, hd :: tl -> aux (hd :: acc) (n - 1) tl in
aux [] n l
let list_last l =
let l = List.rev l in
- try List.hd l with exn -> raise (Failure "HExtlib.list_last")
+ try List.hd l with _ -> raise (Failure "HExtlib.list_last")
;;
let rec list_assoc_all a = function
let input_all ic =
let size = 10240 in
let buf = Buffer.create size in
- let s = String.create size in
+ let s = Bytes.create size in
(try
while true do
let bytes = input ic s 0 size in
if bytes = 0 then raise End_of_file
- else Buffer.add_substring buf s 0 bytes
+ else Buffer.add_subbytes buf s 0 bytes
done
with End_of_file -> ());
Buffer.contents buf
(* $Id$ *)
-open Printf
-
type log_tag = [ `Debug | `Error | `Message | `Warning ]
type log_callback = log_tag -> string -> unit
HExtlib.chmod 0o664 fname
let expect ic fname s =
- let len = String.length s in
- let buf = String.create len in
+ let len = Bytes.length s in
+ let buf = Bytes.create len in
really_input ic buf 0 len;
if buf <> s then raise (Corrupt_file fname)
if fmt' <> Hashtbl.hash fmt then raise (Format_mismatch fname);
let version' = input_binary_int ic in (* field 2 *)
if version' <> version then raise (Version_mismatch fname);
- expect ic fname fmt; (* field 3 *)
- expect ic fname (string_of_int version); (* field 4 *)
+ expect ic fname (Bytes.of_string fmt); (* field 3 *)
+ expect ic fname (Bytes.of_string (string_of_int version)); (* field 4 *)
let checksum' = input_binary_int ic in (* field 5 *)
let marshalled' = HExtlib.input_all ic in (* field 6 *)
if checksum' <> Hashtbl.hash marshalled' then
(* $Id$ *)
-open Printf
-
type pattern_kind = Variable | Constructor
type tag_t = int
| _ -> kfail () (*CSC: was assert false, but it did happen*))
let success_closure ksucc =
- (fun matched_terms constructors terms ->
+ (fun matched_terms constructors _terms ->
(* prerr_endline "success_closure"; *)
ksucc matched_terms constructors)
in
traverse [] t
- let rec fold f t acc =
+ let fold f t acc =
let rec traverse revp t acc = match t with
| Node (None,m) ->
M.fold (fun x -> traverse (x::revp)) m acc
-http_getter_wget.cmi :
+http_getter.cmo : \
+ http_getter_wget.cmi \
+ http_getter_types.cmo \
+ http_getter_storage.cmi \
+ http_getter_misc.cmi \
+ http_getter_logger.cmi \
+ http_getter_env.cmi \
+ http_getter_const.cmi \
+ http_getter_common.cmi \
+ http_getter.cmi
+http_getter.cmx : \
+ http_getter_wget.cmx \
+ http_getter_types.cmx \
+ http_getter_storage.cmx \
+ http_getter_misc.cmx \
+ http_getter_logger.cmx \
+ http_getter_env.cmx \
+ http_getter_const.cmx \
+ http_getter_common.cmx \
+ http_getter.cmi
+http_getter.cmi : \
+ http_getter_types.cmo
+http_getter_common.cmo : \
+ http_getter_types.cmo \
+ http_getter_misc.cmi \
+ http_getter_logger.cmi \
+ http_getter_env.cmi \
+ http_getter_common.cmi
+http_getter_common.cmx : \
+ http_getter_types.cmx \
+ http_getter_misc.cmx \
+ http_getter_logger.cmx \
+ http_getter_env.cmx \
+ http_getter_common.cmi
+http_getter_common.cmi : \
+ http_getter_types.cmo
+http_getter_const.cmo : \
+ http_getter_const.cmi
+http_getter_const.cmx : \
+ http_getter_const.cmi
+http_getter_const.cmi :
+http_getter_env.cmo : \
+ http_getter_types.cmo \
+ http_getter_misc.cmi \
+ http_getter_logger.cmi \
+ http_getter_const.cmi \
+ http_getter_env.cmi
+http_getter_env.cmx : \
+ http_getter_types.cmx \
+ http_getter_misc.cmx \
+ http_getter_logger.cmx \
+ http_getter_const.cmx \
+ http_getter_env.cmi
+http_getter_env.cmi : \
+ http_getter_types.cmo
+http_getter_logger.cmo : \
+ http_getter_logger.cmi
+http_getter_logger.cmx : \
+ http_getter_logger.cmi
http_getter_logger.cmi :
+http_getter_misc.cmo : \
+ http_getter_logger.cmi \
+ http_getter_misc.cmi
+http_getter_misc.cmx : \
+ http_getter_logger.cmx \
+ http_getter_misc.cmi
http_getter_misc.cmi :
-http_getter_const.cmi :
-http_getter_env.cmi : http_getter_types.cmo
+http_getter_storage.cmo : \
+ http_getter_wget.cmi \
+ http_getter_types.cmo \
+ http_getter_misc.cmi \
+ http_getter_env.cmi \
+ http_getter_storage.cmi
+http_getter_storage.cmx : \
+ http_getter_wget.cmx \
+ http_getter_types.cmx \
+ http_getter_misc.cmx \
+ http_getter_env.cmx \
+ http_getter_storage.cmi
http_getter_storage.cmi :
-http_getter_common.cmi : http_getter_types.cmo
-http_getter.cmi : http_getter_types.cmo
http_getter_types.cmo :
http_getter_types.cmx :
-http_getter_wget.cmo : http_getter_types.cmo http_getter_wget.cmi
-http_getter_wget.cmx : http_getter_types.cmx http_getter_wget.cmi
-http_getter_logger.cmo : http_getter_logger.cmi
-http_getter_logger.cmx : http_getter_logger.cmi
-http_getter_misc.cmo : http_getter_logger.cmi http_getter_misc.cmi
-http_getter_misc.cmx : http_getter_logger.cmx http_getter_misc.cmi
-http_getter_const.cmo : http_getter_const.cmi
-http_getter_const.cmx : http_getter_const.cmi
-http_getter_env.cmo : http_getter_types.cmo http_getter_misc.cmi \
- http_getter_logger.cmi http_getter_const.cmi http_getter_env.cmi
-http_getter_env.cmx : http_getter_types.cmx http_getter_misc.cmx \
- http_getter_logger.cmx http_getter_const.cmx http_getter_env.cmi
-http_getter_storage.cmo : http_getter_wget.cmi http_getter_types.cmo \
- http_getter_misc.cmi http_getter_env.cmi http_getter_storage.cmi
-http_getter_storage.cmx : http_getter_wget.cmx http_getter_types.cmx \
- http_getter_misc.cmx http_getter_env.cmx http_getter_storage.cmi
-http_getter_common.cmo : http_getter_types.cmo http_getter_misc.cmi \
- http_getter_logger.cmi http_getter_env.cmi http_getter_common.cmi
-http_getter_common.cmx : http_getter_types.cmx http_getter_misc.cmx \
- http_getter_logger.cmx http_getter_env.cmx http_getter_common.cmi
-http_getter.cmo : http_getter_wget.cmi http_getter_types.cmo \
- http_getter_storage.cmi http_getter_misc.cmi http_getter_logger.cmi \
- http_getter_env.cmi http_getter_const.cmi http_getter_common.cmi \
- http_getter.cmi
-http_getter.cmx : http_getter_wget.cmx http_getter_types.cmx \
- http_getter_storage.cmx http_getter_misc.cmx http_getter_logger.cmx \
- http_getter_env.cmx http_getter_const.cmx http_getter_common.cmx \
- http_getter.cmi
+http_getter_wget.cmo : \
+ http_getter_types.cmo \
+ http_getter_wget.cmi
+http_getter_wget.cmx : \
+ http_getter_types.cmx \
+ http_getter_wget.cmi
+http_getter_wget.cmi :
-http_getter_wget.cmi :
+http_getter.cmx : \
+ http_getter_wget.cmx \
+ http_getter_types.cmx \
+ http_getter_storage.cmx \
+ http_getter_misc.cmx \
+ http_getter_logger.cmx \
+ http_getter_env.cmx \
+ http_getter_const.cmx \
+ http_getter_common.cmx \
+ http_getter.cmi
+http_getter.cmi : \
+ http_getter_types.cmx
+http_getter_common.cmx : \
+ http_getter_types.cmx \
+ http_getter_misc.cmx \
+ http_getter_logger.cmx \
+ http_getter_env.cmx \
+ http_getter_common.cmi
+http_getter_common.cmi : \
+ http_getter_types.cmx
+http_getter_const.cmx : \
+ http_getter_const.cmi
+http_getter_const.cmi :
+http_getter_env.cmx : \
+ http_getter_types.cmx \
+ http_getter_misc.cmx \
+ http_getter_logger.cmx \
+ http_getter_const.cmx \
+ http_getter_env.cmi
+http_getter_env.cmi : \
+ http_getter_types.cmx
+http_getter_logger.cmx : \
+ http_getter_logger.cmi
http_getter_logger.cmi :
+http_getter_misc.cmx : \
+ http_getter_logger.cmx \
+ http_getter_misc.cmi
http_getter_misc.cmi :
-http_getter_const.cmi :
-http_getter_env.cmi : http_getter_types.cmx
+http_getter_storage.cmx : \
+ http_getter_wget.cmx \
+ http_getter_types.cmx \
+ http_getter_misc.cmx \
+ http_getter_env.cmx \
+ http_getter_storage.cmi
http_getter_storage.cmi :
-http_getter_common.cmi : http_getter_types.cmx
-http_getter.cmi : http_getter_types.cmx
-http_getter_types.cmo :
http_getter_types.cmx :
-http_getter_wget.cmo : http_getter_types.cmx http_getter_wget.cmi
-http_getter_wget.cmx : http_getter_types.cmx http_getter_wget.cmi
-http_getter_logger.cmo : http_getter_logger.cmi
-http_getter_logger.cmx : http_getter_logger.cmi
-http_getter_misc.cmo : http_getter_logger.cmi http_getter_misc.cmi
-http_getter_misc.cmx : http_getter_logger.cmx http_getter_misc.cmi
-http_getter_const.cmo : http_getter_const.cmi
-http_getter_const.cmx : http_getter_const.cmi
-http_getter_env.cmo : http_getter_types.cmx http_getter_misc.cmi \
- http_getter_logger.cmi http_getter_const.cmi http_getter_env.cmi
-http_getter_env.cmx : http_getter_types.cmx http_getter_misc.cmx \
- http_getter_logger.cmx http_getter_const.cmx http_getter_env.cmi
-http_getter_storage.cmo : http_getter_wget.cmi http_getter_types.cmx \
- http_getter_misc.cmi http_getter_env.cmi http_getter_storage.cmi
-http_getter_storage.cmx : http_getter_wget.cmx http_getter_types.cmx \
- http_getter_misc.cmx http_getter_env.cmx http_getter_storage.cmi
-http_getter_common.cmo : http_getter_types.cmx http_getter_misc.cmi \
- http_getter_logger.cmi http_getter_env.cmi http_getter_common.cmi
-http_getter_common.cmx : http_getter_types.cmx http_getter_misc.cmx \
- http_getter_logger.cmx http_getter_env.cmx http_getter_common.cmi
-http_getter.cmo : http_getter_wget.cmi http_getter_types.cmx \
- http_getter_storage.cmi http_getter_misc.cmi http_getter_logger.cmi \
- http_getter_env.cmi http_getter_const.cmi http_getter_common.cmi \
- http_getter.cmi
-http_getter.cmx : http_getter_wget.cmx http_getter_types.cmx \
- http_getter_storage.cmx http_getter_misc.cmx http_getter_logger.cmx \
- http_getter_env.cmx http_getter_const.cmx http_getter_common.cmx \
- http_getter.cmi
+http_getter_wget.cmx : \
+ http_getter_types.cmx \
+ http_getter_wget.cmi
+http_getter_wget.cmi :
(* Remote interface: getter methods implemented using a remote getter *)
(* <TODO> *)
-let getxml_remote uri = not_implemented "getxml_remote"
-let getxslt_remote uri = not_implemented "getxslt_remote"
-let getdtd_remote uri = not_implemented "getdtd_remote"
+let getxml_remote _uri = not_implemented "getxml_remote"
+let getxslt_remote _uri = not_implemented "getxslt_remote"
+let getdtd_remote _uri = not_implemented "getdtd_remote"
let clean_cache_remote () = not_implemented "clean_cache_remote"
let list_servers_remote () = not_implemented "list_servers_remote"
-let add_server_remote ~logger ~position name =
+let add_server_remote ~logger:_ ~position:_ _name =
not_implemented "add_server_remote"
-let remove_server_remote ~logger position =
+let remove_server_remote ~logger:_ _position =
not_implemented "remove_server_remote"
let getalluris_remote () = not_implemented "getalluris_remote"
-let ls_remote lsuri = not_implemented "ls_remote"
-let exists_remote uri = not_implemented "exists_remote"
+let ls_remote _lsuri = not_implemented "ls_remote"
+let exists_remote _uri = not_implemented "exists_remote"
(* </TODO> *)
let resolve_remote ~writable uri =
| Exception e -> raise e
| Resolved url -> url
-let deref_index_theory ~local uri =
+let deref_index_theory ~local:_ uri =
(* if Http_getter_storage.exists ~local (uri ^ xml_suffix) then uri *)
if is_theory_uri uri && Filename.basename uri = "index.theory" then
strip_trailing_slash (Filename.dirname uri) ^ theory_suffix
| s when Pcre.pmatch ~rex:body_ann_RE s -> (true, No, Ann, No)
| s when Pcre.pmatch ~rex:proof_tree_RE s -> (false, No, No, Yes)
| s when Pcre.pmatch ~rex:proof_tree_ann_RE s -> (true, No, No, Ann)
- | s -> no_flags
+ | _s -> no_flags
in
Hashtbl.replace tbl basepart (oldflags ++ newflags)
end
Cic_uri (Theory (Pcre.replace ~pat:"^theory:" uri))
| uri -> raise (Invalid_URI uri)
-let patch_xsl ?(via_http = true) () =
+let patch_xsl ?via_http:(_ = true) () =
fun line ->
let mk_patch_fun tag line =
Pcre.replace
| (None, None) -> []
in
Http_daemon.send_basic_headers ~code:(`Code 200) outchan;
- Http_daemon.send_headers headers outchan;
+ Http_daemon.send_headers ~headers outchan;
Http_daemon.send_CRLF outchan
end;
match gunzip, patch_fun with
let msg = "[HTTP-Getter] " ^ s in
match (!logfile, !logchan) with
| None, _ -> prerr_endline msg
- | Some fname, Some oc ->
+ | Some _fname, Some oc ->
output_string oc msg;
output_string oc "\n";
flush oc
let file_scheme_prefix = "file://"
let trailing_dot_gz_RE = Pcre.regexp "\\.gz$" (* for g{,un}zip *)
-let url_RE = Pcre.regexp "^([\\w.-]+)(:(\\d+))?(/.*)?$"
+(*let url_RE = Pcre.regexp "^([\\w.-]+)(:(\\d+))?(/.*)?$"*)
let http_scheme_RE = Pcre.regexp ~flags:[`CASELESS] "^http://"
let file_scheme_RE = Pcre.regexp ~flags:[`CASELESS] ("^" ^ file_scheme_prefix)
let dir_sep_RE = Pcre.regexp "/"
with Not_found -> None
let bufsiz = 16384 (* for file system I/O *)
-let tcp_bufsiz = 4096 (* for TCP I/O *)
+(*let tcp_bufsiz = 4096 (* for TCP I/O *)*)
let fold_file f init fname =
let ic = open_in fname in
let iter_file_data f fname =
let ic = open_in fname in
- let buf = String.create iter_buf_size in
+ let buf = Bytes.create iter_buf_size in
try
while true do
let bytes = input ic buf 0 iter_buf_size in
if bytes = 0 then raise End_of_file;
- f (String.sub buf 0 bytes)
+ f (Bytes.to_string (Bytes.sub buf 0 bytes))
done
with End_of_file -> close_in ic
let ic = open_in src in
try
let oc = open_out dst in
- let buf = String.create bufsiz in
+ let buf = Bytes.create bufsiz in
(try
while true do
let bytes = input ic buf 0 bufsiz in
(let oc =
open_out (match output with Some f -> f | None -> Filename.basename url)
in
- Http_user_agent.get_iter (fun data -> output_string oc data) url;
+ Http_user_agent.get_iter (fun data -> output_bytes oc data) url;
close_out oc)
| scheme -> (* unsupported scheme *)
failwith ("Http_getter_misc.wget: unsupported scheme: " ^ scheme)
Http_getter_logger.log ~level:3
(sprintf "gzipping %s (keep: %b, output: %s)" fname keep output);
let (ic, oc) = (open_in fname, Gzip.open_out output) in
- let buf = String.create bufsiz in
+ let buf = Bytes.create bufsiz in
(try
while true do
let bytes = input ic buf 0 bufsiz in
try
let ic = Gzip.open_in_chan zic in
let oc = open_out output in
- let buf = String.create bufsiz in
+ let buf = Bytes.create bufsiz in
(try
while true do
let bytes = Gzip.input ic buf 0 bufsiz in
let fname = Pcre.replace ~rex:file_scheme_RE url in
try
let size = (Unix.stat fname).Unix.st_size in
- let buf = String.create size in
+ let buf = Bytes.create size in
let ic = open_in fname in
really_input ic buf 0 size ;
close_in ic;
- Some buf
+ Some (Bytes.to_string buf)
with Unix.Unix_error (Unix.ENOENT, "stat", _) -> None
end else (* other URL, pass it to Http_user_agent *)
try
let temp_file_of_uri uri =
let flat_string s s' c =
- let cs = String.copy s in
+ let cs = Bytes.of_string s in
for i = 0 to (String.length s) - 1 do
if String.contains s' s.[i] then cs.[i] <- c
done;
- cs
+ Bytes.to_string cs
in
let user = try Unix.getlogin () with _ -> "" in
Filename.open_temp_file (user ^ flat_string uri ".-=:;!?/&" '_') ""
(******************************* HELPERS **************************************)
-let trailing_slash_RE = Pcre.regexp "/$"
+(*let trailing_slash_RE = Pcre.regexp "/$"*)
let relative_RE_raw = "(^[^/]+(/[^/]+)*/?$)"
let relative_RE = Pcre.regexp relative_RE_raw
let file_scheme_RE_raw = "(^file://)"
let lookup uri =
let matches =
HExtlib.filter_map
- (fun (rex, _, l, _ as entry) ->
+ (fun (rex, _, _l, _ as entry) ->
try
let got = Pcre.extract ~full_match:true ~rex uri in
Some (entry, String.length got.(0))
let get_and_save url dest_filename =
let out_channel = open_out dest_filename in
(try
- Http_user_agent.get_iter (output_string out_channel) url;
+ Http_user_agent.get_iter (output_bytes out_channel) url;
with exn ->
close_out out_channel;
Sys.remove dest_filename;
let get_and_save_to_tmp url =
let flat_string s s' c =
- let cs = String.copy s in
+ let cs = Bytes.of_string s in
for i = 0 to (String.length s) - 1 do
if String.contains s' s.[i] then cs.[i] <- c
done;
- cs
+ Bytes.to_string cs
in
let user = try Unix.getlogin () with _ -> "" in
let tmp_file =
-grafiteAstPp.cmi : grafiteAst.cmo
grafiteAst.cmo :
grafiteAst.cmx :
-grafiteAstPp.cmo : grafiteAst.cmo grafiteAstPp.cmi
-grafiteAstPp.cmx : grafiteAst.cmx grafiteAstPp.cmi
+grafiteAstPp.cmo : \
+ grafiteAst.cmo \
+ grafiteAstPp.cmi
+grafiteAstPp.cmx : \
+ grafiteAst.cmx \
+ grafiteAstPp.cmi
+grafiteAstPp.cmi : \
+ grafiteAst.cmo
-grafiteAstPp.cmi : grafiteAst.cmx
-grafiteAst.cmo :
grafiteAst.cmx :
-grafiteAstPp.cmo : grafiteAst.cmx grafiteAstPp.cmi
-grafiteAstPp.cmx : grafiteAst.cmx grafiteAstPp.cmi
+grafiteAstPp.cmx : \
+ grafiteAst.cmx \
+ grafiteAstPp.cmi
+grafiteAstPp.cmi : \
+ grafiteAst.cmx
let pp_tactic_pattern = pp_tactic_pattern ~map_unicode_to_tex in
function
| NApply (_,t) -> "@" ^ NotationPp.pp_term status t
- | NSmartApply (_,t) -> "fixme"
+ | NSmartApply (_,_t) -> "fixme"
| NAuto (_,(None,flgs)) ->
"nautobatch" ^
String.concat " " (List.map (fun a,b -> a ^ "=" ^ b) flgs)
"nautobatch" ^ " by " ^
(String.concat "," (List.map (NotationPp.pp_term status) l)) ^
String.concat " " (List.map (fun a,b -> a ^ "=" ^ b) flgs)
- | NCases (_,what,where) -> "ncases " ^ NotationPp.pp_term status what ^
+ | NCases (_,what,_where) -> "ncases " ^ NotationPp.pp_term status what ^
"...to be implemented..." ^ " " ^ "...to be implemented..."
| NConstructor (_,None,l) -> "@ " ^
String.concat " " (List.map (NotationPp.pp_term status) l)
| NConstructor (_,Some x,l) -> "@" ^ string_of_int x ^ " " ^
String.concat " " (List.map (NotationPp.pp_term status) l)
| NCase1 (_,n) -> "*" ^ n ^ ":"
- | NChange (_,what,wwhat) -> "nchange " ^ "...to be implemented..." ^
+ | NChange (_,_what,wwhat) -> "nchange " ^ "...to be implemented..." ^
" with " ^ NotationPp.pp_term status wwhat
| NCut (_,t) -> "ncut " ^ NotationPp.pp_term status t
(*| NDiscriminate (_,t) -> "ndiscriminate " ^ NotationPp.pp_term status t
| NSubst (_,t) -> "nsubst " ^ NotationPp.pp_term status t *)
| NClear (_,l) -> "nclear " ^ String.concat " " l
- | NDestruct (_,dom,skip) -> "ndestruct ..."
- | NElim (_,what,where) -> "nelim " ^ NotationPp.pp_term status what ^
+ | NDestruct (_,_dom,_skip) -> "ndestruct ..."
+ | NElim (_,what,_where) -> "nelim " ^ NotationPp.pp_term status what ^
"...to be implemented..." ^ " " ^ "...to be implemented..."
| NId _ -> "nid"
| NIntro (_,n) -> "#" ^ n
| NIntros (_,l) -> "#" ^ String.concat " " l
- | NInversion (_,what,where) -> "ninversion " ^ NotationPp.pp_term status what ^
+ | NInversion (_,what,_where) -> "ninversion " ^ NotationPp.pp_term status what ^
"...to be implemented..." ^ " " ^ "...to be implemented..."
| NLApply (_,t) -> "lapply " ^ NotationPp.pp_term status t
| NRewrite (_,dir,n,where) -> "nrewrite " ^
String.concat " "
(List.map (function (id,term) -> "(" ^ id ^ ": (" ^ NotationPp.pp_term status term ^ "))")
args)
+ | PrintStack _ -> "print_stack"
;;
let pp_nmacro status = function
| NCheck (_, term) -> Printf.sprintf "ncheck %s" (NotationPp.pp_term status term)
| Screenshot (_, name) -> Printf.sprintf "screenshot \"%s\"" name
+ | NAutoInteractive _
+ | NIntroGuess _ -> assert false (* TODO *)
;;
let pp_l1_pattern = NotationPp.pp_term
let pp_argument_pattern = function
| NotationPt.IdentArg (eta_depth, name) ->
let eta_buf = Buffer.create 5 in
- for i = 1 to eta_depth do
+ for _i = 1 to eta_depth do
Buffer.add_string eta_buf "\\eta."
done;
sprintf "%s%s" (Buffer.contents eta_buf) name
-grafiteTypes.cmi :
-nCicCoercDeclaration.cmi : grafiteTypes.cmi
-grafiteEngine.cmi : grafiteTypes.cmi
-grafiteTypes.cmo : grafiteTypes.cmi
-grafiteTypes.cmx : grafiteTypes.cmi
-nCicCoercDeclaration.cmo : grafiteTypes.cmi nCicCoercDeclaration.cmi
-nCicCoercDeclaration.cmx : grafiteTypes.cmx nCicCoercDeclaration.cmi
-grafiteEngine.cmo : nCicCoercDeclaration.cmi grafiteTypes.cmi \
+grafiteEngine.cmo : \
+ nCicCoercDeclaration.cmi \
+ grafiteTypes.cmi \
grafiteEngine.cmi
-grafiteEngine.cmx : nCicCoercDeclaration.cmx grafiteTypes.cmx \
+grafiteEngine.cmx : \
+ nCicCoercDeclaration.cmx \
+ grafiteTypes.cmx \
grafiteEngine.cmi
+grafiteEngine.cmi : \
+ grafiteTypes.cmi
+grafiteTypes.cmo : \
+ grafiteTypes.cmi
+grafiteTypes.cmx : \
+ grafiteTypes.cmi
+grafiteTypes.cmi :
+nCicCoercDeclaration.cmo : \
+ grafiteTypes.cmi \
+ nCicCoercDeclaration.cmi
+nCicCoercDeclaration.cmx : \
+ grafiteTypes.cmx \
+ nCicCoercDeclaration.cmi
+nCicCoercDeclaration.cmi : \
+ grafiteTypes.cmi
-grafiteTypes.cmi :
-nCicCoercDeclaration.cmi : grafiteTypes.cmi
-grafiteEngine.cmi : grafiteTypes.cmi
-grafiteTypes.cmo : grafiteTypes.cmi
-grafiteTypes.cmx : grafiteTypes.cmi
-nCicCoercDeclaration.cmo : grafiteTypes.cmi nCicCoercDeclaration.cmi
-nCicCoercDeclaration.cmx : grafiteTypes.cmx nCicCoercDeclaration.cmi
-grafiteEngine.cmo : nCicCoercDeclaration.cmi grafiteTypes.cmi \
- grafiteEngine.cmi
-grafiteEngine.cmx : nCicCoercDeclaration.cmx grafiteTypes.cmx \
+grafiteEngine.cmx : \
+ nCicCoercDeclaration.cmx \
+ grafiteTypes.cmx \
grafiteEngine.cmi
+grafiteEngine.cmi : \
+ grafiteTypes.cmi
+grafiteTypes.cmx : \
+ grafiteTypes.cmi
+grafiteTypes.cmi :
+nCicCoercDeclaration.cmx : \
+ grafiteTypes.cmx \
+ nCicCoercDeclaration.cmi
+nCicCoercDeclaration.cmi : \
+ grafiteTypes.cmi
let inject_unification_hint =
let basic_eval_unification_hint (t,n)
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
+ ~refresh_uri_in_universe:_ ~refresh_uri_in_term ~refresh_uri_in_reference:_
~alias_only status
=
if not alias_only then
let inject_interpretation =
let basic_eval_interpretation (dsc, (symbol, args), cic_appl_pattern)
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
+ ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_ ~refresh_uri_in_reference:_
~alias_only
=
let rec refresh =
;;
let inject_alias =
- let basic_eval_alias (mode,diff) ~refresh_uri_in_universe ~refresh_uri_in_term
- ~refresh_uri_in_reference ~alias_only =
+ let basic_eval_alias (mode,diff) ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_
+ ~refresh_uri_in_reference:_ ~alias_only:_ =
basic_eval_alias (mode,diff)
in
GrafiteTypes.Serializer.register#run "alias" basic_eval_alias
let inject_input_notation =
let basic_eval_input_notation (l1,l2)
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
+ ~refresh_uri_in_universe:_ ~refresh_uri_in_term ~refresh_uri_in_reference
~alias_only status
=
if not alias_only then
let inject_output_notation =
let basic_eval_output_notation (l1,l2)
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
+ ~refresh_uri_in_universe:_ ~refresh_uri_in_term ~refresh_uri_in_reference
~alias_only status
=
if not alias_only then
;;
let record_index_obj =
- let aux l ~refresh_uri_in_universe
- ~refresh_uri_in_term ~refresh_uri_in_reference ~alias_only status
+ let aux l ~refresh_uri_in_universe:_
+ ~refresh_uri_in_term ~refresh_uri_in_reference:_ ~alias_only status
=
let refresh_uri_in_term = refresh_uri_in_term (status:>NCic.status) in
if not alias_only then
let inject_extract_obj =
let basic_extract_obj info
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
- ~alias_only status
+ ~refresh_uri_in_universe:__ ~refresh_uri_in_term:_ ~refresh_uri_in_reference
+ ~alias_only:_ status
=
let info= NCicExtraction.refresh_uri_in_info ~refresh_uri_in_reference info in
status#set_extraction_db
let inject_extract_ocaml_obj =
let basic_extract_ocaml_obj info
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
- ~alias_only status
+ ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_ ~refresh_uri_in_reference
+ ~alias_only:_ status
=
let info= OcamlExtractionTable.refresh_uri_in_info ~refresh_uri_in_reference ~refresh_uri:NCicLibrary.refresh_uri info in
status#set_ocaml_extraction_db
let record_index_eq =
let basic_index_eq uri
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
+ ~refresh_uri_in_universe:_ ~refresh_uri_in_term:_ ~refresh_uri_in_reference:_
~alias_only status
= if not alias_only then index_eq false (NCicLibrary.refresh_uri uri) status
else
let inject_constraint =
let basic_eval_add_constraint (acyclic,u1,u2)
- ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference
+ ~refresh_uri_in_universe ~refresh_uri_in_term:_ ~refresh_uri_in_reference:_
~alias_only status
=
if not alias_only then
| GrafiteAst.RewritingStep (_,rhs,just,cont) ->
Declarative.rewritingstep (text,prefix_len,rhs)
(match just with
- `Term t -> just_to_tacstatus_just just text prefix_len
- | `Auto params -> just_to_tacstatus_just just text prefix_len
+ `Term _
+ | `Auto _ -> just_to_tacstatus_just just text prefix_len
|`Proof -> `Proof
|`SolveWith t -> `SolveWith (text,prefix_len,t)
)
let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) =
match cmd with
- | GrafiteAst.Include (loc, mode, fname) ->
+ | GrafiteAst.Include (_loc, mode, fname) ->
let _root, baseuri, fullpath, _rrelpath =
Librarian.baseuri_of_script ~include_paths fname in
let baseuri = NUri.uri_of_string baseuri in
~alias_only ~baseuri ~fname:fullpath status in
OcamlExtraction.print_open status
(NCicLibrary.get_transitively_included status)
- | GrafiteAst.UnificationHint (loc, t, n) -> eval_unification_hint status t n
+ | GrafiteAst.UnificationHint (_loc, t, n) -> eval_unification_hint status t n
| GrafiteAst.NCoercion (loc, name, compose, None) ->
let status, t, ty, source, target =
let o_t = NotationPt.Ident (name,None) in
GrafiteAst.NCoercion (loc, name, compose, Some (t, ty, source, target))
in
eval_ncommand ~include_paths opts status (text,prefix_len,cmd)
- | GrafiteAst.NCoercion (loc, name, compose, Some (t, ty, source, target)) ->
+ | GrafiteAst.NCoercion (_loc, name, compose, Some (t, ty, source, target)) ->
let status, composites =
NCicCoercDeclaration.eval_ncoercion status name compose t ty source
target in
let mode = GrafiteAst.WithPreferences in (* MATITA 1.0: fixme *)
let aliases = GrafiteDisambiguate.aliases_for_objs status composites in
eval_alias status (mode,aliases)
- | GrafiteAst.NQed (loc,index) ->
+ | GrafiteAst.NQed (_loc,index) ->
if status#ng_mode <> `ProofMode then
raise (GrafiteTypes.Command_error "Not in proof mode")
else
- let uri,height,menv,subst,obj_kind = status#obj in
+ let uri,_height,menv,subst,obj_kind = status#obj in
if menv <> [] then
raise
(GrafiteTypes.Command_error"You can't Qed an incomplete theorem")
let status = match nobj with
NCic.Inductive (is_ind,leftno,itl,_) ->
List.fold_left (fun status it ->
- (let _,ind_name,ty,cl = it in
+ (let _,ind_name,_ty,_cl = it in
List.fold_left
(fun status outsort ->
let status = status#set_ng_mode `ProofMode in
| _ -> status
in
let status = match nobj with
- NCic.Inductive (is_ind,leftno,itl,_) ->
+ NCic.Inductive (_is_ind,leftno,itl,_) ->
(* first leibniz *)
let status' = List.fold_left
(fun status it ->
- let _,ind_name,ty,cl = it in
+ let _,ind_name,_ty,_cl = it in
let status = status#set_ng_mode `ProofMode in
try
(let status,invobj =
(* then JMeq *)
List.fold_left
(fun status it ->
- let _,ind_name,ty,cl = it in
+ let _,ind_name,_ty,_cl = it in
let status = status#set_ng_mode `ProofMode in
try
(let status,invobj =
exn ->
NCicLibrary.time_travel old_status;
raise exn)
- | GrafiteAst.NCopy (log,tgt,src_uri, map) ->
+ | GrafiteAst.NCopy (_loc,tgt,src_uri, map) ->
if status#ng_mode <> `CommandMode then
raise (GrafiteTypes.Command_error "Not in command mode")
else
let status = subst_metasenv_and_fix_names status in
let status = status#set_ng_mode `ProofMode in
eval_ncommand ~include_paths opts status ("",0,GrafiteAst.NQed(Stdpp.dummy_loc,false))
- | GrafiteAst.NObj (loc,obj,index) ->
+ | GrafiteAst.NObj (_loc,obj,index) ->
if status#ng_mode <> `CommandMode then
raise (GrafiteTypes.Command_error "Not in command mode")
else
let status,obj =
GrafiteDisambiguate.disambiguate_nobj status
~baseuri:status#baseuri (text,prefix_len,obj) in
- let uri,height,nmenv,nsubst,nobj = obj in
+ let _uri,_height,nmenv,_nsubst,_nobj = obj in
let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in
let status = status#set_obj obj in
let status = status#set_stack ninitial_stack in
eval_ncommand ~include_paths opts status
("",0,GrafiteAst.NQed(Stdpp.dummy_loc,index))
| _ -> status)
- | GrafiteAst.NDiscriminator (loc, indty) ->
+ | GrafiteAst.NDiscriminator (_loc, indty) ->
if status#ng_mode <> `CommandMode then
raise (GrafiteTypes.Command_error "Not in command mode")
else
let status = status#set_ng_mode `ProofMode in
- let metasenv,subst,status,indty =
+ let _metasenv,_subst,status,indty =
GrafiteDisambiguate.disambiguate_nterm status `XTNone [] [] [] (text,prefix_len,indty) in
let indtyno, (_,_,tys,_,_),leftno = match indty with
NCic.Const ((NReference.Ref (_,NReference.Ind (_,indtyno,leftno))) as r) ->
[] -> eval_ncommand ~include_paths opts status ("",0,GrafiteAst.NQed(Stdpp.dummy_loc,false))
| _ -> prerr_endline ("Discriminator: non empty metasenv");
status)
- | GrafiteAst.NInverter (loc, name, indty, selection, sort) ->
+ | GrafiteAst.NInverter (_loc, name, indty, selection, sort) ->
if status#ng_mode <> `CommandMode then
raise (GrafiteTypes.Command_error "Not in command mode")
else
"ninverter: found target %s, which is not a sort"
(status#ppterm ~metasenv ~subst ~context:[] sort))) in
let status = status#set_ng_mode `ProofMode in
- let metasenv,subst,status,indty =
+ let _metasenv,_subst,status,indty =
GrafiteDisambiguate.disambiguate_nterm status `XTNone [] [] subst
(text,prefix_len,indty) in
let indtyno,(_,leftno,tys,_,_) =
eval_ncommand ~include_paths opts status
("",0,GrafiteAst.NQed(Stdpp.dummy_loc,false))
| _ -> assert false)
- | GrafiteAst.NUnivConstraint (loc,acyclic,u1,u2) ->
+ | GrafiteAst.NUnivConstraint (_loc,acyclic,u1,u2) ->
eval_add_constraint status acyclic [`Type,u1] [`Type,u2]
(* ex lexicon commands *)
- | GrafiteAst.Interpretation (loc, dsc, (symbol, args), cic_appl_pattern) ->
+ | GrafiteAst.Interpretation (_loc, dsc, (symbol, args), cic_appl_pattern) ->
let cic_appl_pattern =
GrafiteDisambiguate.disambiguate_cic_appl_pattern status args
cic_appl_pattern
in
eval_interpretation status (dsc,(symbol, args),cic_appl_pattern)
- | GrafiteAst.Notation (loc, dir, l1, associativity, precedence, l2) ->
+ | GrafiteAst.Notation (_loc, dir, l1, associativity, precedence, l2) ->
let l1 =
CicNotationParser.check_l1_pattern
l1 (dir = Some `RightToLeft) precedence associativity
in
if dir <> Some `LeftToRight then eval_output_notation status (l1,l2)
else status
- | GrafiteAst.Alias (loc, spec) ->
+ | GrafiteAst.Alias (_loc, spec) ->
let diff =
(*CSC: Warning: this code should be factorized with the corresponding
code in DisambiguatePp *)
match spec with
- | GrafiteAst.Ident_alias (id,uri) ->
+ | GrafiteAst.Ident_alias (id,_uri) ->
[DisambiguateTypes.Id id,spec]
- | GrafiteAst.Symbol_alias (symb, instance, desc) ->
+ | GrafiteAst.Symbol_alias (symb, instance, _desc) ->
[DisambiguateTypes.Symbol (symb,instance),spec]
- | GrafiteAst.Number_alias (instance,desc) ->
+ | GrafiteAst.Number_alias (instance,_desc) ->
[DisambiguateTypes.Num instance,spec]
in
let mode = GrafiteAst.WithPreferences in(*assert false in (* VEDI SOPRA *) MATITA 1.0*)
eval_alias status (mode,diff)
;;
-let eval_comment opts status (text,prefix_len,c) = status
+let eval_comment _opts status (_text,_prefix_len,_c) = status
let rec eval_executable ~include_paths opts status (text,prefix_len,ex) =
match ex with
aux 0 [] ty
in
let status, tgt, arity =
- let metasenv,subst,status,tgt =
+ let _metasenv,subst,status,tgt =
GrafiteDisambiguate.disambiguate_nterm
status `XTSort [] [] [] ("",0,tgt) in
let tgt = NCicUntrusted.apply_subst status subst [] tgt in
exception Stop;;
-let close_graph name t s d to_s from_d p a status =
+let close_graph _name t s d to_s from_d _p a status =
let c =
List.find
(function (_,_,NCic.Appl (x::_),_,_) -> x = t | _ -> assert false)
let pos =
match p with
| NCic.Meta (p,_) -> pos_in_list p (List.map fst metasenv)
- | t -> raise Stop
+ | _t -> raise Stop
in
let ty = NCicTypeChecker.typeof status ~metasenv:[] ~subst:[] [] bo in
let src,tgt = src_tgt_of_ty_cpos_arity status ty pos arity in
let d = refresh_uri_in_term d in
basic_index_ncoercion (name,compose,t,s,d,p,a)
in
- let aux_l l ~refresh_uri_in_universe ~refresh_uri_in_term
- ~refresh_uri_in_reference ~alias_only status
+ let aux_l l ~refresh_uri_in_universe:_ ~refresh_uri_in_term
+ ~refresh_uri_in_reference:_ ~alias_only status
=
if not alias_only then
List.fold_right (aux ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCic.status))) l status
+grafiteParser.cmo : \
+ grafiteParser.cmi
+grafiteParser.cmx : \
+ grafiteParser.cmi
grafiteParser.cmi :
-print_grammar.cmi : grafiteParser.cmi
-grafiteParser.cmo : grafiteParser.cmi
-grafiteParser.cmx : grafiteParser.cmi
-print_grammar.cmo : print_grammar.cmi
-print_grammar.cmx : print_grammar.cmi
+print_grammar.cmo : \
+ print_grammar.cmi
+print_grammar.cmx : \
+ print_grammar.cmi
+print_grammar.cmi : \
+ grafiteParser.cmi
+grafiteParser.cmx : \
+ grafiteParser.cmi
grafiteParser.cmi :
-print_grammar.cmi : grafiteParser.cmi
-grafiteParser.cmo : grafiteParser.cmi
-grafiteParser.cmx : grafiteParser.cmi
-print_grammar.cmo : print_grammar.cmi
-print_grammar.cmx : print_grammar.cmi
+print_grammar.cmx : \
+ print_grammar.cmi
+print_grammar.cmi : \
+ grafiteParser.cmi
# soon as we have ocaml 3.09 everywhere and "loc" occurrences are replaced by
# "_loc" occurrences
UTF8DIR = $(shell $(OCAMLFIND) query helm-syntax_extensions)
-ULEXDIR = $(shell $(OCAMLFIND) query ulex08)
+ULEXDIR = $(shell $(OCAMLFIND) query ulex-camlp5)
MY_SYNTAXOPTIONS = -pp "camlp5o -I $(UTF8DIR) -I $(ULEXDIR) pa_extend.cmo pa_ulex.cma pa_unicode_macro.cma -loc loc"
grafiteParser.cmo: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS)
grafiteParser.cmx: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS)
depend.opt: SYNTAXOPTIONS = $(MY_SYNTAXOPTIONS)
# </cross>
#
-grafiteParser.cmo: OCAMLC = $(OCAMLC_P4)
-grafiteParser.cmx: OCAMLOPT = $(OCAMLOPT_P4)
+grafiteParser.cmo: OCAMLC = $(OCAMLC_P4) -w -27
+grafiteParser.cmx: OCAMLOPT = $(OCAMLOPT_P4) -w -27
include ../../Makefile.defs
include ../Makefile.common
count_brothers t > 1
let visit_description desc fmt self =
- let skip s = true in
+ let skip _s = true in
let inline s = List.mem s [ "int" ] in
let rec visit_entry e ?level todo is_son =
(fun x -> Sself :: x) (flatten_tree suff) @ flatten_tree pref)
todo is_son
- and visit_tree name t todo is_son =
+ and visit_tree name t todo _is_son =
if List.for_all (List.for_all is_symbol_dummy) t then todo else (
Format.fprintf fmt "@[<v>";
(match name with
+librarian.cmo : \
+ librarian.cmi
+librarian.cmx : \
+ librarian.cmi
librarian.cmi :
-libraryMisc.cmi :
+libraryClean.cmo : \
+ libraryClean.cmi
+libraryClean.cmx : \
+ libraryClean.cmi
libraryClean.cmi :
-librarian.cmo : librarian.cmi
-librarian.cmx : librarian.cmi
-libraryMisc.cmo : libraryMisc.cmi
-libraryMisc.cmx : libraryMisc.cmi
-libraryClean.cmo : libraryClean.cmi
-libraryClean.cmx : libraryClean.cmi
+libraryMisc.cmo : \
+ libraryMisc.cmi
+libraryMisc.cmx : \
+ libraryMisc.cmi
+libraryMisc.cmi :
+librarian.cmx : \
+ librarian.cmi
librarian.cmi :
-libraryMisc.cmi :
+libraryClean.cmx : \
+ libraryClean.cmi
libraryClean.cmi :
-librarian.cmo : librarian.cmi
-librarian.cmx : librarian.cmi
-libraryMisc.cmo : libraryMisc.cmi
-libraryMisc.cmx : libraryMisc.cmi
-libraryClean.cmo : libraryClean.cmi
-libraryClean.cmx : libraryClean.cmi
+libraryMisc.cmx : \
+ libraryMisc.cmi
+libraryMisc.cmi :
let path = absolutize path in
let paths = List.rev (Str.split (Str.regexp "/") path) in
let rec build = function
- | he::tl as l -> ("/" ^ String.concat "/" (List.rev l) ^ "/") :: build tl
+ | _he::tl as l -> ("/" ^ String.concat "/" (List.rev l) ^ "/") :: build tl
| [] -> ["/"]
in
let paths = List.map HExtlib.normalize_path (build paths) in
let find_root_for ~include_paths file =
let include_paths = "" :: Sys.getcwd () :: include_paths in
- let rec find_path_for file =
+ let find_path_for file =
try HExtlib.find_in include_paths file
with Failure "find_in" ->
HLog.error ("We are in: " ^ Sys.getcwd ());
(* $Id$ *)
-open Printf
-
let debug = false
let debug_prerr = if debug then prerr_endline else ignore
-module HGT = Http_getter_types;;
-module HG = Http_getter;;
+(*module HGT = Http_getter_types;;*)
+(*module HG = Http_getter;;*)
(*module UM = UriManager;;*)
-let decompile = ref (fun ~baseuri -> assert false);;
+let decompile = ref (fun ~baseuri:_ -> assert false);;
let set_decompile_cb f = decompile := f;;
(*
;;
*)
-let rec close_db cache_of_processed_baseuri uris next =
+let close_db _cache_of_processed_baseuri uris _next =
uris (* MATITA 1.0 *)
;;
-let clean_baseuris ?(verbose=true) buris =
+let clean_baseuris ?verbose:(_=true) _buris =
(* MATITA 1.0 *) () (*
let cache_of_processed_baseuri = Hashtbl.create 1024 in
let buris = List.map Http_getter_misc.strip_trailing_slash buris in
+helmLogger.cmo : \
+ helmLogger.cmi
+helmLogger.cmx : \
+ helmLogger.cmi
helmLogger.cmi :
-helmLogger.cmo : helmLogger.cmi
-helmLogger.cmx : helmLogger.cmi
+helmLogger.cmx : \
+ helmLogger.cmi
helmLogger.cmi :
-helmLogger.cmo : helmLogger.cmi
-helmLogger.cmx : helmLogger.cmi
type logger_fun = ?append_NL:bool -> html_msg -> unit
-let rec string_of_html_tag =
+let string_of_html_tag =
let rec aux indent =
let indent_str = String.make indent ' ' in
function
-ncic2astMatcher.cmi :
+interpretations.cmo : \
+ ncic2astMatcher.cmi \
+ interpretations.cmi
+interpretations.cmx : \
+ ncic2astMatcher.cmx \
+ interpretations.cmi
interpretations.cmi :
-ncic2astMatcher.cmo : ncic2astMatcher.cmi
-ncic2astMatcher.cmx : ncic2astMatcher.cmi
-interpretations.cmo : ncic2astMatcher.cmi interpretations.cmi
-interpretations.cmx : ncic2astMatcher.cmx interpretations.cmi
+ncic2astMatcher.cmo : \
+ ncic2astMatcher.cmi
+ncic2astMatcher.cmx : \
+ ncic2astMatcher.cmi
+ncic2astMatcher.cmi :
-ncic2astMatcher.cmi :
+interpretations.cmx : \
+ ncic2astMatcher.cmx \
+ interpretations.cmi
interpretations.cmi :
-ncic2astMatcher.cmo : ncic2astMatcher.cmi
-ncic2astMatcher.cmx : ncic2astMatcher.cmi
-interpretations.cmo : ncic2astMatcher.cmi interpretations.cmi
-interpretations.cmx : ncic2astMatcher.cmx interpretations.cmi
+ncic2astMatcher.cmx : \
+ ncic2astMatcher.cmi
+ncic2astMatcher.cmi :
List.fold_right (fun idref t -> Ast.AttributedTerm (`IdRef idref, t))
let instantiate32 idrefs env symbol args =
- let rec instantiate_arg = function
+ let instantiate_arg = function
| Ast.IdentArg (n, name) ->
let t =
try List.assoc name env
| NCic.Lambda (n,s,t) ->
idref (Ast.Binder (`Lambda,(Ast.Ident (n,None), Some (k ~context s)),
k ~context:((n,NCic.Decl s)::context) t))
- | NCic.LetIn (n,s,ty,NCic.Rel 1) ->
+ | NCic.LetIn (_n,s,ty,NCic.Rel 1) ->
idref (Ast.Cast (k ~context ty, k ~context s))
| NCic.LetIn (n,s,ty,t) ->
idref (Ast.LetIn ((Ast.Ident (n,None), Some (k ~context s)), k ~context
in
let rec eat_branch n ctx ty pat =
match (ty, pat) with
- | NCic.Prod (name, s, t), _ when n > 0 ->
+ | NCic.Prod (_name, _s, t), _ when n > 0 ->
eat_branch (pred n) ctx t pat
| NCic.Prod (_, _, t), NCic.Lambda (name, s, t') ->
let cv, rhs = eat_branch 0 ((name,NCic.Decl s)::ctx) t t' in
) context ([],[]))
;;
-let nmap_sequent0 status ~idref ~metasenv ~subst (i,(n,context,ty)) =
+let nmap_sequent0 status ~idref ~metasenv ~subst (i,(_n,context,ty)) =
let module K = Content in
let nast_of_cic =
nast_of_cic1 status ~idref ~output_type:`Term ~metasenv ~subst in
res
;;
-let build_def_item seed context metasenv id n t ty =
+let build_def_item seed _context _metasenv id n t ty =
let module K = Content in
(*
try
K.inductive_constructors = build_constructors seed cl
}
in
-let build_fixpoint b seed =
+let build_fixpoint _b seed =
fun (_,n,_,ty,t) ->
let t = nast_of_cic ~context:[] t in
let ty = nast_of_cic ~context:[] ty in
-nnumber_notation.cmi :
+disambiguateChoices.cmo : \
+ nnumber_notation.cmi \
+ disambiguateChoices.cmi
+disambiguateChoices.cmx : \
+ nnumber_notation.cmx \
+ disambiguateChoices.cmi
disambiguateChoices.cmi :
-nCicDisambiguate.cmi :
-grafiteDisambiguate.cmi :
-nnumber_notation.cmo : nnumber_notation.cmi
-nnumber_notation.cmx : nnumber_notation.cmi
-disambiguateChoices.cmo : nnumber_notation.cmi disambiguateChoices.cmi
-disambiguateChoices.cmx : nnumber_notation.cmx disambiguateChoices.cmi
-nCicDisambiguate.cmo : nCicDisambiguate.cmi
-nCicDisambiguate.cmx : nCicDisambiguate.cmi
-grafiteDisambiguate.cmo : nCicDisambiguate.cmi disambiguateChoices.cmi \
+grafiteDisambiguate.cmo : \
+ nCicDisambiguate.cmi \
+ disambiguateChoices.cmi \
grafiteDisambiguate.cmi
-grafiteDisambiguate.cmx : nCicDisambiguate.cmx disambiguateChoices.cmx \
+grafiteDisambiguate.cmx : \
+ nCicDisambiguate.cmx \
+ disambiguateChoices.cmx \
grafiteDisambiguate.cmi
+grafiteDisambiguate.cmi :
+nCicDisambiguate.cmo : \
+ nCicDisambiguate.cmi
+nCicDisambiguate.cmx : \
+ nCicDisambiguate.cmi
+nCicDisambiguate.cmi :
+nnumber_notation.cmo : \
+ nnumber_notation.cmi
+nnumber_notation.cmx : \
+ nnumber_notation.cmi
+nnumber_notation.cmi :
-nnumber_notation.cmi :
+disambiguateChoices.cmx : \
+ nnumber_notation.cmx \
+ disambiguateChoices.cmi
disambiguateChoices.cmi :
-nCicDisambiguate.cmi :
-grafiteDisambiguate.cmi :
-nnumber_notation.cmo : nnumber_notation.cmi
-nnumber_notation.cmx : nnumber_notation.cmi
-disambiguateChoices.cmo : nnumber_notation.cmi disambiguateChoices.cmi
-disambiguateChoices.cmx : nnumber_notation.cmx disambiguateChoices.cmi
-nCicDisambiguate.cmo : nCicDisambiguate.cmi
-nCicDisambiguate.cmx : nCicDisambiguate.cmi
-grafiteDisambiguate.cmo : nCicDisambiguate.cmi disambiguateChoices.cmi \
- grafiteDisambiguate.cmi
-grafiteDisambiguate.cmx : nCicDisambiguate.cmx disambiguateChoices.cmx \
+grafiteDisambiguate.cmx : \
+ nCicDisambiguate.cmx \
+ disambiguateChoices.cmx \
grafiteDisambiguate.cmi
+grafiteDisambiguate.cmi :
+nCicDisambiguate.cmx : \
+ nCicDisambiguate.cmi
+nCicDisambiguate.cmi :
+nnumber_notation.cmx : \
+ nnumber_notation.cmi
+nnumber_notation.cmi :
let eval_with_new_aliases status f =
let status =
status#set_disambiguate_db { status#disambiguate_db with new_aliases = [] } in
- let res = f status in
- let new_aliases = status#disambiguate_db.new_aliases in
- new_aliases,res
+ let new_status = f status in
+ let new_aliases = new_status#disambiguate_db.new_aliases in
+ new_aliases,new_status
;;
let dump_aliases out msg status =
let desc,f = DisambiguateChoices.nlookup_num_by_dsc dsc in
desc, `Num_interp
(fun num -> match f with `Num_interp f -> f num | _ -> assert false)
- | GrafiteAst.Ident_alias (name, uri) ->
+ | GrafiteAst.Ident_alias (_name, uri) ->
uri, `Sym_interp
(fun l->assert(l = []);
let nref = NReference.reference_of_string uri in
;;
let nlookup_in_library
- interactive_user_uri_choice input_or_locate_uri item
+ _interactive_user_uri_choice _input_or_locate_uri item
=
match item with
| DisambiguateTypes.Id id ->
(wanted, hyp_paths, goal_path)
;;
-let disambiguate_reduction_kind text prefix_len = function
- | `Unfold (Some t) -> assert false (* MATITA 1.0 *)
+let disambiguate_reduction_kind _text _prefix_len = function
+ | `Unfold (Some _t) -> assert false (* MATITA 1.0 *)
| `Normalize
| `Simpl
| `Unfold None
end
val eval_with_new_aliases:
- #status as 'status -> ('status -> 'a) ->
+ #status as 'status -> ('status -> (#status as 'a)) ->
(DisambiguateTypes.domain_item * GrafiteAst.alias_spec) list * 'a
val set_proof_aliases:
-nCicExtraction.cmi :
-coq.cmi :
-ocamlExtractionTable.cmi : miniml.cmo coq.cmi
-mlutil.cmi : ocamlExtractionTable.cmi miniml.cmo coq.cmi
-common.cmi : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi
-extraction.cmi : ocamlExtractionTable.cmi miniml.cmo coq.cmi
-ocaml.cmi : ocamlExtractionTable.cmi miniml.cmo coq.cmi
-ocamlExtraction.cmi : ocamlExtractionTable.cmi
-miniml.cmo : coq.cmi
-miniml.cmx : coq.cmx
-nCicExtraction.cmo : nCicExtraction.cmi
-nCicExtraction.cmx : nCicExtraction.cmi
-coq.cmo : coq.cmi
-coq.cmx : coq.cmi
-ocamlExtractionTable.cmo : miniml.cmo coq.cmi ocamlExtractionTable.cmi
-ocamlExtractionTable.cmx : miniml.cmx coq.cmx ocamlExtractionTable.cmi
-mlutil.cmo : ocamlExtractionTable.cmi miniml.cmo coq.cmi mlutil.cmi
-mlutil.cmx : ocamlExtractionTable.cmx miniml.cmx coq.cmx mlutil.cmi
-common.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi \
+common.cmo : \
+ ocamlExtractionTable.cmi \
+ mlutil.cmi \
+ coq.cmi \
common.cmi
-common.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \
+common.cmx : \
+ ocamlExtractionTable.cmx \
+ mlutil.cmx \
+ coq.cmx \
common.cmi
-extraction.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi \
- common.cmi extraction.cmi
-extraction.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \
- common.cmx extraction.cmi
-ocaml.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmo coq.cmi \
- common.cmi ocaml.cmi
-ocaml.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \
- common.cmx ocaml.cmi
-ocamlExtraction.cmo : ocamlExtractionTable.cmi ocaml.cmi extraction.cmi \
- coq.cmi ocamlExtraction.cmi
-ocamlExtraction.cmx : ocamlExtractionTable.cmx ocaml.cmx extraction.cmx \
- coq.cmx ocamlExtraction.cmi
+common.cmi : \
+ ocamlExtractionTable.cmi \
+ coq.cmi
+coq.cmo : \
+ coq.cmi
+coq.cmx : \
+ coq.cmi
+coq.cmi :
+extraction.cmo : \
+ ocamlExtractionTable.cmi \
+ mlutil.cmi \
+ miniml.cmo \
+ coq.cmi \
+ common.cmi \
+ extraction.cmi
+extraction.cmx : \
+ ocamlExtractionTable.cmx \
+ mlutil.cmx \
+ miniml.cmx \
+ coq.cmx \
+ common.cmx \
+ extraction.cmi
+extraction.cmi : \
+ ocamlExtractionTable.cmi \
+ miniml.cmo
+miniml.cmo : \
+ coq.cmi
+miniml.cmx : \
+ coq.cmx
+mlutil.cmo : \
+ ocamlExtractionTable.cmi \
+ miniml.cmo \
+ coq.cmi \
+ mlutil.cmi
+mlutil.cmx : \
+ ocamlExtractionTable.cmx \
+ miniml.cmx \
+ coq.cmx \
+ mlutil.cmi
+mlutil.cmi : \
+ ocamlExtractionTable.cmi \
+ miniml.cmo \
+ coq.cmi
+nCicExtraction.cmo : \
+ nCicExtraction.cmi
+nCicExtraction.cmx : \
+ nCicExtraction.cmi
+nCicExtraction.cmi :
+ocaml.cmo : \
+ ocamlExtractionTable.cmi \
+ mlutil.cmi \
+ miniml.cmo \
+ coq.cmi \
+ common.cmi \
+ ocaml.cmi
+ocaml.cmx : \
+ ocamlExtractionTable.cmx \
+ mlutil.cmx \
+ miniml.cmx \
+ coq.cmx \
+ common.cmx \
+ ocaml.cmi
+ocaml.cmi : \
+ ocamlExtractionTable.cmi \
+ miniml.cmo \
+ coq.cmi
+ocamlExtraction.cmo : \
+ ocamlExtractionTable.cmi \
+ ocaml.cmi \
+ extraction.cmi \
+ coq.cmi \
+ ocamlExtraction.cmi
+ocamlExtraction.cmx : \
+ ocamlExtractionTable.cmx \
+ ocaml.cmx \
+ extraction.cmx \
+ coq.cmx \
+ ocamlExtraction.cmi
+ocamlExtraction.cmi : \
+ ocamlExtractionTable.cmi
+ocamlExtractionTable.cmo : \
+ miniml.cmo \
+ coq.cmi \
+ ocamlExtractionTable.cmi
+ocamlExtractionTable.cmx : \
+ miniml.cmx \
+ coq.cmx \
+ ocamlExtractionTable.cmi
+ocamlExtractionTable.cmi : \
+ miniml.cmo \
+ coq.cmi
-nCicExtraction.cmi :
-coq.cmi :
-ocamlExtractionTable.cmi : miniml.cmx coq.cmi
-mlutil.cmi : ocamlExtractionTable.cmi miniml.cmx coq.cmi
-common.cmi : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi
-extraction.cmi : ocamlExtractionTable.cmi miniml.cmx coq.cmi
-ocaml.cmi : ocamlExtractionTable.cmi miniml.cmx coq.cmi
-ocamlExtraction.cmi : ocamlExtractionTable.cmi
-miniml.cmo : coq.cmi
-miniml.cmx : coq.cmx
-nCicExtraction.cmo : nCicExtraction.cmi
-nCicExtraction.cmx : nCicExtraction.cmi
-coq.cmo : coq.cmi
-coq.cmx : coq.cmi
-ocamlExtractionTable.cmo : miniml.cmx coq.cmi ocamlExtractionTable.cmi
-ocamlExtractionTable.cmx : miniml.cmx coq.cmx ocamlExtractionTable.cmi
-mlutil.cmo : ocamlExtractionTable.cmi miniml.cmx coq.cmi mlutil.cmi
-mlutil.cmx : ocamlExtractionTable.cmx miniml.cmx coq.cmx mlutil.cmi
-common.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi \
- common.cmi
-common.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \
+common.cmx : \
+ ocamlExtractionTable.cmx \
+ mlutil.cmx \
+ coq.cmx \
common.cmi
-extraction.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi \
- common.cmi extraction.cmi
-extraction.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \
- common.cmx extraction.cmi
-ocaml.cmo : ocamlExtractionTable.cmi mlutil.cmi miniml.cmx coq.cmi \
- common.cmi ocaml.cmi
-ocaml.cmx : ocamlExtractionTable.cmx mlutil.cmx miniml.cmx coq.cmx \
- common.cmx ocaml.cmi
-ocamlExtraction.cmo : ocamlExtractionTable.cmi ocaml.cmi extraction.cmi \
- coq.cmi ocamlExtraction.cmi
-ocamlExtraction.cmx : ocamlExtractionTable.cmx ocaml.cmx extraction.cmx \
- coq.cmx ocamlExtraction.cmi
+common.cmi : \
+ ocamlExtractionTable.cmi \
+ coq.cmi
+coq.cmx : \
+ coq.cmi
+coq.cmi :
+extraction.cmx : \
+ ocamlExtractionTable.cmx \
+ mlutil.cmx \
+ miniml.cmx \
+ coq.cmx \
+ common.cmx \
+ extraction.cmi
+extraction.cmi : \
+ ocamlExtractionTable.cmi \
+ miniml.cmx
+miniml.cmx : \
+ coq.cmx
+mlutil.cmx : \
+ ocamlExtractionTable.cmx \
+ miniml.cmx \
+ coq.cmx \
+ mlutil.cmi
+mlutil.cmi : \
+ ocamlExtractionTable.cmi \
+ miniml.cmx \
+ coq.cmi
+nCicExtraction.cmx : \
+ nCicExtraction.cmi
+nCicExtraction.cmi :
+ocaml.cmx : \
+ ocamlExtractionTable.cmx \
+ mlutil.cmx \
+ miniml.cmx \
+ coq.cmx \
+ common.cmx \
+ ocaml.cmi
+ocaml.cmi : \
+ ocamlExtractionTable.cmi \
+ miniml.cmx \
+ coq.cmi
+ocamlExtraction.cmx : \
+ ocamlExtractionTable.cmx \
+ ocaml.cmx \
+ extraction.cmx \
+ coq.cmx \
+ ocamlExtraction.cmi
+ocamlExtraction.cmi : \
+ ocamlExtractionTable.cmi
+ocamlExtractionTable.cmx : \
+ miniml.cmx \
+ coq.cmx \
+ ocamlExtractionTable.cmi
+ocamlExtractionTable.cmi : \
+ miniml.cmx \
+ coq.cmi
miniml.ml $(INTERFACE_FILES:%.mli=%.ml)
EXTRA_OBJECTS_TO_INSTALL =
EXTRA_OBJECTS_TO_CLEAN =
-%.cmo: OCAMLOPTIONS += -w Ae
-%.cmi: OCAMLOPTIONS += -w Ae
-%.cmx: OCAMLOPTIONS += -w Ae
include ../../Makefile.defs
include ../Makefile.common
open Coq
open OcamlExtractionTable
-open Miniml
+(*open Miniml*)
open Mlutil
(*s Some pretty-print utility functions. *)
if id = "" then "x" else
if id.[0] = '_' then lowercase_id (String.sub id 1 (String.length id - 1)) else
if is_invalid_id id then lowercase_id ("x" ^ id) else
- String.uncapitalize id
+ String.uncapitalize_ascii id
let rec uppercase_id id =
if id = "" then "T" else
if id.[0] = '_' then uppercase_id (String.sub id 1 (String.length id - 1)) else
if is_invalid_id id then uppercase_id ("x" ^ id) else
- String.capitalize id
+ String.capitalize_ascii id
type kind = Term | Type | Cons
NUri.name_of_uri uri
| _ -> NCicPp.r2s status true r
-let maybe_capitalize b n = if b then String.capitalize n else n
+let maybe_capitalize b n = if b then String.capitalize_ascii n else n
let modname_of_filename status capitalize name =
try
status, maybe_capitalize capitalize name
with Not_found ->
let globs = Idset.elements (get_modnames status) in
- let s = next_ident_away (String.uncapitalize name) globs in
+ let s = next_ident_away (String.uncapitalize_ascii name) globs in
let status = add_modname status s in
let status = add_modname_for_filename status name s in
status, maybe_capitalize capitalize s
(*i $Id: common.mli 14641 2011-11-06 11:59:10Z herbelin $ i*)
open Coq
-open Miniml
-open Mlutil
+(**open Miniml
+open Mlutil*)
open OcamlExtractionTable
(** By default, in module Format, you can do horizontal placing of blocks
numpart (n-1) n'
else if code_of_0 <= c && c <= code_of_9 then
numpart (n-1) (n-1)
- else if skip_quote & (c = Char.code '\'' || c = Char.code '_') then
+ else if skip_quote && (c = Char.code '\'' || c = Char.code '_') then
numpart (n-1) (n-1)
else
n'
let forget_subscript id =
let numstart = cut_ident false id in
- let newid = String.make (numstart+1) '0' in
+ let newid = Bytes.make (numstart+1) '0' in
String.blit id 0 newid 0 numstart;
- newid
+ Bytes.to_string newid
(* Namegen.ml *)
add (carrypos-1)
end
else begin
- let newid = String.copy id in
- String.fill newid (carrypos+1) (len-1-carrypos) '0';
+ let newid = Bytes.of_string id in
+ Bytes.fill newid (carrypos+1) (len-1-carrypos) '0';
newid.[carrypos] <- Char.chr (Char.code c + 1);
- newid
+ Bytes.to_string newid
end
else begin
- let newid = id^"0" in
+ let newid = Bytes.of_string (id^"0") in
if carrypos < len-1 then begin
- String.fill newid (carrypos+1) (len-1-carrypos) '0';
+ Bytes.fill newid (carrypos+1) (len-1-carrypos) '0';
newid.[carrypos+1] <- '1'
end;
- newid
+ Bytes.to_string newid
end
in add (len-1)
if Array.length v1 == 0 then
[| |]
else begin
- let res = Array.create (Array.length v1) (f v1.(0) v2.(0)) in
+ let res = Array.make (Array.length v1) (f v1.(0) v2.(0)) in
for i = 1 to pred (Array.length v1) do
res.(i) <- f v1.(i) v2.(i)
done;
let n = String.index s '\n' in
String.sub s 0 n, Some (String.sub s (n+1) (String.length s - n - 1))
with Not_found -> s,None in
- com_if ft (Lazy.lazy_from_val());
+ com_if ft (Lazy.from_val());
(* let s1 =
if String.length s1 <> 0 && s1.[0] = ' ' then
(Format.pp_print_space ft (); String.sub s1 1 (String.length s1 - 1))
in
let rec pp_cmd = function
| Ppcmd_print(n,s) ->
- com_if ft (Lazy.lazy_from_val()); Format.pp_print_as ft n s
+ com_if ft (Lazy.from_val()); Format.pp_print_as ft n s
| Ppcmd_box(bty,ss) -> (* Prevent evaluation of the stream! *)
- com_if ft (Lazy.lazy_from_val());
+ com_if ft (Lazy.from_val());
pp_open_box bty ;
if not (Format.over_max_boxes ()) then Stream.iter pp_cmd ss;
Format.pp_close_box ft ()
- | Ppcmd_open_box bty -> com_if ft (Lazy.lazy_from_val()); pp_open_box bty
+ | Ppcmd_open_box bty -> com_if ft (Lazy.from_val()); pp_open_box bty
| Ppcmd_close_box -> Format.pp_close_box ft ()
| Ppcmd_close_tbox -> Format.pp_close_tbox ft ()
| Ppcmd_white_space n ->
- com_if ft (Lazy.lazy_from_fun (fun()->Format.pp_print_break ft n 0))
+ com_if ft (Lazy.from_fun (fun()->Format.pp_print_break ft n 0))
| Ppcmd_print_break(m,n) ->
- com_if ft (Lazy.lazy_from_fun(fun()->Format.pp_print_break ft m n))
+ com_if ft (Lazy.from_fun(fun()->Format.pp_print_break ft m n))
| Ppcmd_set_tab -> Format.pp_set_tab ft ()
| Ppcmd_print_tbreak(m,n) ->
- com_if ft (Lazy.lazy_from_fun(fun()->Format.pp_print_tbreak ft m n))
+ com_if ft (Lazy.from_fun(fun()->Format.pp_print_tbreak ft m n))
| Ppcmd_force_newline ->
com_brk ft; Format.pp_force_newline ft ()
| Ppcmd_print_if_broken ->
- com_if ft (Lazy.lazy_from_fun(fun()->Format.pp_print_if_newline ft ()))
+ com_if ft (Lazy.from_fun(fun()->Format.pp_print_if_newline ft ()))
| Ppcmd_comment i ->
let coms = split_com [] [] i !comments in
(* Format.pp_open_hvbox ft 0;*)
(* Enriching a exception message *)
-let rec handle_exn _r _n _fn_name = function x -> x
+let handle_exn _r _n _fn_name = function x -> x
(*CSC: only for pretty printing
| MLexn s ->
(try Scanf.sscanf s "UNBOUND %d"
(* [decomp_lams_eta env c t] finds the number [n] of products in the type [t],
and decompose the term [c] in [n] lambdas, with eta-expansion if needed. *)
-let rec decomp_lams_eta_n n m status context c t =
+let decomp_lams_eta_n n m status context c t =
let rels = fst (splay_prod_n status context n t) in
let rels',c = decompose_lam c in
let d = n - m in
(*s Extraction from Coq terms to Miniml. *)
-open Coq
open Miniml
-open OcamlExtractionTable
val extract:
#OcamlExtractionTable.status as 'status -> NCic.obj ->
let clean_free mle =
let rem = ref Metaset.empty
and add = ref Metaset.empty in
- let clean m = match m.contents with
+ let clean m = match m.Miniml.contents with
| None -> ()
| Some u -> rem := Metaset.add m !rem; add := find_free !add u
in
(*s What are the type variables occurring in [t]. *)
-let intset_union_map_list f l =
- List.fold_left (fun s t -> Intset.union s (f t)) Intset.empty l
+(*let intset_union_map_list f l =
+ List.fold_left (fun s t -> Intset.union s (f t)) Intset.empty l*)
-let intset_union_map_array f a =
- Array.fold_left (fun s t -> Intset.union s (f t)) Intset.empty a
+(*let intset_union_map_array f a =
+ Array.fold_left (fun s t -> Intset.union s (f t)) Intset.empty a*)
-let rec type_listvar = function
+(*let rec type_listvar = function
| Tmeta {contents = Some t} -> type_listvar t
| Tvar i | Tvar' i -> Intset.singleton i
| Tarr (a,b) -> Intset.union (type_listvar a) (type_listvar b)
| Tglob (_,l) -> intset_union_map_list type_listvar l
- | _ -> Intset.empty
+ | _ -> Intset.empty*)
(*s From [a -> b -> c] to [[a;b],c]. *)
(*s Number of occurences of [Rel k] (resp. [Rel 1]) in [t]. *)
-let nb_occur_k k t =
+(*let nb_occur_k k t =
let cpt = ref 0 in
ast_iter_rel (fun i -> if i = k then incr cpt) t;
- !cpt
+ !cpt*)
-let nb_occur t = nb_occur_k 1 t
+(*let nb_occur t = nb_occur_k 1 t*)
(* Number of occurences of [Rel 1] in [t], with special treatment of match:
occurences in different branches aren't added, but we rather use max. *)
| 0 -> a
| n -> many_lams id (MLlam (id,a)) (pred n)
-let anonym_lams a n = many_lams anonymous a n
+(*let anonym_lams a n = many_lams anonymous a n*)
let anonym_tmp_lams a n = many_lams (Tmp anonymous_name) a n
let dummy_lams a n = many_lams Dummy a n
(*s Computes an eta-reduction. *)
-let eta_red e =
+(*let eta_red e =
let ids,t = collect_lams e in
let n = List.length ids in
if n = 0 then e
if test_eta_args_lift 0 p args && not (ast_occurs_itvl 1 p body)
then named_lams ids (ast_lift (-p) body)
else e
- | _ -> e
+ | _ -> e*)
(*s Computes all head linear beta-reductions possible in [(t a)].
Non-linear head beta-redex become let-in. *)
-let rec linear_beta_red a t = match a,t with
+(*let rec linear_beta_red a t = match a,t with
| [], _ -> t
| a0::a, MLlam (id,t) ->
(match nb_occur_match t with
| _ ->
let a = List.map (ast_lift 1) a in
MLletin (id, a0, linear_beta_red a t))
- | _ -> MLapp (t, a)
+ | _ -> MLapp (t, a)*)
-let rec tmp_head_lams = function
+(*let rec tmp_head_lams = function
| MLlam (id, t) -> MLlam (tmp_id id, tmp_head_lams t)
- | e -> e
+ | e -> e*)
(*s Applies a substitution [s] of constants by their body, plus
linear beta reductions at modified positions.
reduction (this helps the inlining of recursors).
*)
-let rec ast_glob_subst _s _t = assert false (*CSC: reimplement match t with
+let ast_glob_subst _s _t = assert false (*CSC: reimplement match t with
| MLapp ((MLglob ((ConstRef kn) as refe)) as f, a) ->
let a = List.map (fun e -> tmp_head_lams (ast_glob_subst s e)) a in
(try linear_beta_red a (Refmap'.find refe s)
let is_exn = function MLexn _ -> true | _ -> false
-let rec permut_case_fun br _acc =
+let permut_case_fun br _acc =
let nb = ref max_int in
Array.iter (fun (_,_,t) ->
let ids, c = collect_lams t in
(* Utility functions used in the decision of inlining. *)
-let rec ml_size = function
+(*let rec ml_size = function
| MLapp(t,l) -> List.length l + ml_size t + ml_size_list l
| MLlam(_,t) -> 1 + ml_size t
| MLcons(_,_,l) -> ml_size_list l
and ml_size_list l = List.fold_left (fun a t -> a + ml_size t) 0 l
-and ml_size_array l = Array.fold_left (fun a t -> a + ml_size t) 0 l
+and ml_size_array l = Array.fold_left (fun a t -> a + ml_size t) 0 l*)
-let is_fix = function MLfix _ -> true | _ -> false
+(*let is_fix = function MLfix _ -> true | _ -> false*)
-let rec is_constr = function
+(*let rec is_constr = function
| MLcons _ -> true
| MLlam(_,t) -> is_constr t
- | _ -> false
+ | _ -> false*)
(*s Strictness *)
it begins by at least one non-strict lambda, since the corresponding
argument to [t] might be unevaluated in the expanded code. *)
-exception Toplevel
+(*exception Toplevel*)
-let lift n l = List.map ((+) n) l
+(*let lift n l = List.map ((+) n) l*)
-let pop n l = List.map (fun x -> if x<=n then raise Toplevel else x-n) l
+(*let pop n l = List.map (fun x -> if x<=n then raise Toplevel else x-n) l*)
(* This function returns a list of de Bruijn indices of non-strict variables,
or raises [Toplevel] if it has an internal non-strict variable.
variable to the candidates? We use this flag to check only the external
lambdas, those that will correspond to arguments. *)
-let rec non_stricts add cand = function
+(*let rec non_stricts add cand = function
| MLlam (_id,t) ->
let cand = lift 1 cand in
let cand = if add then 1::cand else cand in
let n = List.length i in
let cand = lift n cand in
let cand = pop n (non_stricts add cand t) in
- List.merge (fun c1 c2 -> c1 - c2) cand c) [] v
+ List.merge (-) cand c) [] v
(* [merge] may duplicates some indices, but I don't mind. *)
| MLmagic t ->
non_stricts add cand t
| _ ->
- cand
+ cand*)
(* The real test: we are looking for internal non-strict variables, so we start
with no candidates, and the only positive answer is via the [Toplevel]
exception. *)
-let is_not_strict t =
+(*let is_not_strict t =
try let _ = non_stricts true [] t in false
- with Toplevel -> true
+ with Toplevel -> true*)
(*s Inlining decision *)
restriction for the moment.
*)
-let inline_test _r _t =
+(*let inline_test _r _t =
(*CSC:if not (auto_inline ()) then*) false
(*
else
let t1 = eta_red t in
let t2 = snd (collect_lams t1) in
not (is_fix t2) && ml_size t < 12 && is_not_strict t
-*)
+*)*)
(*CSC: (not) reimplemented
let con_of_string s =
]
Cset_env.empty*)
-let manual_inline = function (*CSC:
+(*let manual_inline = function (*CSC:
| ConstRef c -> Cset_env.mem c manual_inline_set
- |*) _ -> false
+ |*) _ -> false*)
(* If the user doesn't say he wants to keep [t], we inline in two cases:
\begin{itemize}
(fun p1 n ->
HExtlib.map_option (fun (_,k) ->
(*CSC: BUG here, clashes*)
- String.uncapitalize (fst n),k) p1)
+ String.uncapitalize_ascii (fst n),k) p1)
ctx0 ctx
in
let bo = typ_of status ~metasenv ctx bo in
fun x -> g (f x)
;;
-let curry f x y =
+(*let curry f x y =
f (x, y)
-;;
+;;*)
let uncurry f (x, y) =
f x y
;;
-let rec char_list_of_string s =
+let char_list_of_string s =
let l = String.length s in
let rec aux buffer s =
function
| [] -> s
| x::xs ->
if x < String.length s then
- let c = Char.uppercase (String.get s x) in
- let _ = String.set s x c in
+ let c = Char.uppercase_ascii (String.get s x) in
+ let b = Bytes.of_string s in
+ let _ = Bytes.set b x c in
+ let s = Bytes.to_string b in
capitalize_marked_positions s xs
else
capitalize_marked_positions s xs
let idiomatic_haskell_type_name_of_string =
contract_underscores_and_capitalise |>
- String.capitalize
+ String.capitalize_ascii
;;
let idiomatic_haskell_term_name_of_string =
contract_underscores_and_capitalise |>
- String.uncapitalize
+ String.uncapitalize_ascii
;;
let classify_reference status ref =
) il)
(* inductive and records missing *)
-let rec infos_of (info,_,obj_kind) =
+let infos_of (info,_,obj_kind) =
info @
match obj_kind with
LetRec l -> List.concat (List.map (fun (infos,_,_) -> infos) l)
(*s Pretty-printing of types. [par] is a boolean indicating whether parentheses
are needed or not. *)
-let rec pp_type status par vl t =
+let pp_type status par vl t =
let rec pp_rec status par = function
| Tmeta _ | Tvar' _ | Taxiom -> assert false
| Tvar i -> (try status,pp_tvar (List.nth vl (pred i))
-nUri.cmi :
-nReference.cmi : nUri.cmi
-nCicUtils.cmi : nCic.cmo
-nCicSubstitution.cmi : nCic.cmo
-nCicEnvironment.cmi : nUri.cmi nReference.cmi nCic.cmo
-nCicReduction.cmi : nCic.cmo
-nCicTypeChecker.cmi : nUri.cmi nReference.cmi nCic.cmo
-nCicUntrusted.cmi : nCic.cmo
-nCicPp.cmi : nReference.cmi nCic.cmo
-nCic.cmo : nUri.cmi nReference.cmi
-nCic.cmx : nUri.cmx nReference.cmx
-nUri.cmo : nUri.cmi
-nUri.cmx : nUri.cmi
-nReference.cmo : nUri.cmi nReference.cmi
-nReference.cmx : nUri.cmx nReference.cmi
-nCicUtils.cmo : nReference.cmi nCic.cmo nCicUtils.cmi
-nCicUtils.cmx : nReference.cmx nCic.cmx nCicUtils.cmi
-nCicSubstitution.cmo : nReference.cmi nCicUtils.cmi nCic.cmo \
+nCic.cmo : \
+ nUri.cmi \
+ nReference.cmi
+nCic.cmx : \
+ nUri.cmx \
+ nReference.cmx
+nCicEnvironment.cmo : \
+ nUri.cmi \
+ nReference.cmi \
+ nCic.cmo \
+ nCicEnvironment.cmi
+nCicEnvironment.cmx : \
+ nUri.cmx \
+ nReference.cmx \
+ nCic.cmx \
+ nCicEnvironment.cmi
+nCicEnvironment.cmi : \
+ nUri.cmi \
+ nReference.cmi \
+ nCic.cmo
+nCicPp.cmo : \
+ nUri.cmi \
+ nReference.cmi \
+ nCicSubstitution.cmi \
+ nCicReduction.cmi \
+ nCicEnvironment.cmi \
+ nCic.cmo \
+ nCicPp.cmi
+nCicPp.cmx : \
+ nUri.cmx \
+ nReference.cmx \
+ nCicSubstitution.cmx \
+ nCicReduction.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
+ nCicPp.cmi
+nCicPp.cmi : \
+ nReference.cmi \
+ nCic.cmo
+nCicReduction.cmo : \
+ nReference.cmi \
+ nCicUtils.cmi \
+ nCicSubstitution.cmi \
+ nCicEnvironment.cmi \
+ nCic.cmo \
+ nCicReduction.cmi
+nCicReduction.cmx : \
+ nReference.cmx \
+ nCicUtils.cmx \
+ nCicSubstitution.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
+ nCicReduction.cmi
+nCicReduction.cmi : \
+ nCic.cmo
+nCicSubstitution.cmo : \
+ nCicUtils.cmi \
+ nCic.cmo \
nCicSubstitution.cmi
-nCicSubstitution.cmx : nReference.cmx nCicUtils.cmx nCic.cmx \
+nCicSubstitution.cmx : \
+ nCicUtils.cmx \
+ nCic.cmx \
nCicSubstitution.cmi
-nCicEnvironment.cmo : nUri.cmi nReference.cmi nCic.cmo nCicEnvironment.cmi
-nCicEnvironment.cmx : nUri.cmx nReference.cmx nCic.cmx nCicEnvironment.cmi
-nCicReduction.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \
- nCicEnvironment.cmi nCic.cmo nCicReduction.cmi
-nCicReduction.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \
- nCicEnvironment.cmx nCic.cmx nCicReduction.cmi
-nCicTypeChecker.cmo : nUri.cmi nReference.cmi nCicUtils.cmi \
- nCicSubstitution.cmi nCicReduction.cmi nCicEnvironment.cmi nCic.cmo \
+nCicSubstitution.cmi : \
+ nCic.cmo
+nCicTypeChecker.cmo : \
+ nUri.cmi \
+ nReference.cmi \
+ nCicUtils.cmi \
+ nCicSubstitution.cmi \
+ nCicReduction.cmi \
+ nCicEnvironment.cmi \
+ nCic.cmo \
nCicTypeChecker.cmi
-nCicTypeChecker.cmx : nUri.cmx nReference.cmx nCicUtils.cmx \
- nCicSubstitution.cmx nCicReduction.cmx nCicEnvironment.cmx nCic.cmx \
+nCicTypeChecker.cmx : \
+ nUri.cmx \
+ nReference.cmx \
+ nCicUtils.cmx \
+ nCicSubstitution.cmx \
+ nCicReduction.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
nCicTypeChecker.cmi
-nCicUntrusted.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \
- nCicReduction.cmi nCicEnvironment.cmi nCic.cmo nCicUntrusted.cmi
-nCicUntrusted.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \
- nCicReduction.cmx nCicEnvironment.cmx nCic.cmx nCicUntrusted.cmi
-nCicPp.cmo : nUri.cmi nReference.cmi nCicSubstitution.cmi nCicReduction.cmi \
- nCicEnvironment.cmi nCic.cmo nCicPp.cmi
-nCicPp.cmx : nUri.cmx nReference.cmx nCicSubstitution.cmx nCicReduction.cmx \
- nCicEnvironment.cmx nCic.cmx nCicPp.cmi
+nCicTypeChecker.cmi : \
+ nUri.cmi \
+ nReference.cmi \
+ nCic.cmo
+nCicUntrusted.cmo : \
+ nReference.cmi \
+ nCicUtils.cmi \
+ nCicSubstitution.cmi \
+ nCicReduction.cmi \
+ nCicEnvironment.cmi \
+ nCic.cmo \
+ nCicUntrusted.cmi
+nCicUntrusted.cmx : \
+ nReference.cmx \
+ nCicUtils.cmx \
+ nCicSubstitution.cmx \
+ nCicReduction.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
+ nCicUntrusted.cmi
+nCicUntrusted.cmi : \
+ nCic.cmo
+nCicUtils.cmo : \
+ nCic.cmo \
+ nCicUtils.cmi
+nCicUtils.cmx : \
+ nCic.cmx \
+ nCicUtils.cmi
+nCicUtils.cmi : \
+ nCic.cmo
+nReference.cmo : \
+ nUri.cmi \
+ nReference.cmi
+nReference.cmx : \
+ nUri.cmx \
+ nReference.cmi
+nReference.cmi : \
+ nUri.cmi
+nUri.cmo : \
+ nUri.cmi
+nUri.cmx : \
+ nUri.cmi
+nUri.cmi :
-nUri.cmi :
-nReference.cmi : nUri.cmi
-nCicUtils.cmi : nCic.cmx
-nCicSubstitution.cmi : nCic.cmx
-nCicEnvironment.cmi : nUri.cmi nReference.cmi nCic.cmx
-nCicReduction.cmi : nCic.cmx
-nCicTypeChecker.cmi : nUri.cmi nReference.cmi nCic.cmx
-nCicUntrusted.cmi : nCic.cmx
-nCicPp.cmi : nReference.cmi nCic.cmx
-nCic.cmo : nUri.cmi nReference.cmi
-nCic.cmx : nUri.cmx nReference.cmx
-nUri.cmo : nUri.cmi
-nUri.cmx : nUri.cmi
-nReference.cmo : nUri.cmi nReference.cmi
-nReference.cmx : nUri.cmx nReference.cmi
-nCicUtils.cmo : nReference.cmi nCic.cmx nCicUtils.cmi
-nCicUtils.cmx : nReference.cmx nCic.cmx nCicUtils.cmi
-nCicSubstitution.cmo : nReference.cmi nCicUtils.cmi nCic.cmx \
- nCicSubstitution.cmi
-nCicSubstitution.cmx : nReference.cmx nCicUtils.cmx nCic.cmx \
+nCic.cmx : \
+ nUri.cmx \
+ nReference.cmx
+nCicEnvironment.cmx : \
+ nUri.cmx \
+ nReference.cmx \
+ nCic.cmx \
+ nCicEnvironment.cmi
+nCicEnvironment.cmi : \
+ nUri.cmi \
+ nReference.cmi \
+ nCic.cmx
+nCicPp.cmx : \
+ nUri.cmx \
+ nReference.cmx \
+ nCicSubstitution.cmx \
+ nCicReduction.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
+ nCicPp.cmi
+nCicPp.cmi : \
+ nReference.cmi \
+ nCic.cmx
+nCicReduction.cmx : \
+ nReference.cmx \
+ nCicUtils.cmx \
+ nCicSubstitution.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
+ nCicReduction.cmi
+nCicReduction.cmi : \
+ nCic.cmx
+nCicSubstitution.cmx : \
+ nCicUtils.cmx \
+ nCic.cmx \
nCicSubstitution.cmi
-nCicEnvironment.cmo : nUri.cmi nReference.cmi nCic.cmx nCicEnvironment.cmi
-nCicEnvironment.cmx : nUri.cmx nReference.cmx nCic.cmx nCicEnvironment.cmi
-nCicReduction.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \
- nCicEnvironment.cmi nCic.cmx nCicReduction.cmi
-nCicReduction.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \
- nCicEnvironment.cmx nCic.cmx nCicReduction.cmi
-nCicTypeChecker.cmo : nUri.cmi nReference.cmi nCicUtils.cmi \
- nCicSubstitution.cmi nCicReduction.cmi nCicEnvironment.cmi nCic.cmx \
+nCicSubstitution.cmi : \
+ nCic.cmx
+nCicTypeChecker.cmx : \
+ nUri.cmx \
+ nReference.cmx \
+ nCicUtils.cmx \
+ nCicSubstitution.cmx \
+ nCicReduction.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
nCicTypeChecker.cmi
-nCicTypeChecker.cmx : nUri.cmx nReference.cmx nCicUtils.cmx \
- nCicSubstitution.cmx nCicReduction.cmx nCicEnvironment.cmx nCic.cmx \
- nCicTypeChecker.cmi
-nCicUntrusted.cmo : nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \
- nCicReduction.cmi nCicEnvironment.cmi nCic.cmx nCicUntrusted.cmi
-nCicUntrusted.cmx : nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \
- nCicReduction.cmx nCicEnvironment.cmx nCic.cmx nCicUntrusted.cmi
-nCicPp.cmo : nUri.cmi nReference.cmi nCicSubstitution.cmi nCicReduction.cmi \
- nCicEnvironment.cmi nCic.cmx nCicPp.cmi
-nCicPp.cmx : nUri.cmx nReference.cmx nCicSubstitution.cmx nCicReduction.cmx \
- nCicEnvironment.cmx nCic.cmx nCicPp.cmi
+nCicTypeChecker.cmi : \
+ nUri.cmi \
+ nReference.cmi \
+ nCic.cmx
+nCicUntrusted.cmx : \
+ nReference.cmx \
+ nCicUtils.cmx \
+ nCicSubstitution.cmx \
+ nCicReduction.cmx \
+ nCicEnvironment.cmx \
+ nCic.cmx \
+ nCicUntrusted.cmi
+nCicUntrusted.cmi : \
+ nCic.cmx
+nCicUtils.cmx : \
+ nCic.cmx \
+ nCicUtils.cmi
+nCicUtils.cmi : \
+ nCic.cmx
+nReference.cmx : \
+ nUri.cmx \
+ nReference.cmi
+nReference.cmi : \
+ nUri.cmi
+nUri.cmx : \
+ nUri.cmi
+nUri.cmi :
nCic.ml $(INTERFACE_FILES:%.mli=%.ml)
EXTRA_OBJECTS_TO_INSTALL =
EXTRA_OBJECTS_TO_CLEAN =
-%.cmo: OCAMLOPTIONS += -w Ae
-%.cmi: OCAMLOPTIONS += -w Ae
-%.cmx: OCAMLOPTIONS += -w Ae
include ../../Makefile.defs
include ../Makefile.common
exception AssertFailure of string Lazy.t;;
let debug = ref false;;
-let pp m = if !debug then prerr_endline (Lazy.force m) else ();;
+(*let pp m = if !debug then prerr_endline (Lazy.force m) else ();;*)
module type Strategy = sig
type stack_term
(* $Id$ *)
module C = NCic
-module Ref = NReference
-
-let debug_print = fun _ -> ();;
let lift_from status ?(no_implicit=true) k n =
let rec liftaux k = function
let indent = ref 0;;
let debug = true;;
-let logger =
+let _logger =
let do_indent () = String.make !indent ' ' in
(function
| `Start_type_checking s ->
(* $Id$ *)
module C = NCic
-module Ref = NReference
exception Subst_not_found of int
exception Meta_not_found of int
+nCicLibrary.cmo : \
+ nCicLibrary.cmi
+nCicLibrary.cmx : \
+ nCicLibrary.cmi
nCicLibrary.cmi :
-nCicLibrary.cmo : nCicLibrary.cmi
-nCicLibrary.cmx : nCicLibrary.cmi
+nCicLibrary.cmx : \
+ nCicLibrary.cmi
nCicLibrary.cmi :
-nCicLibrary.cmo : nCicLibrary.cmi
-nCicLibrary.cmx : nCicLibrary.cmi
$(INTERFACE_FILES:%.mli=%.ml)
EXTRA_OBJECTS_TO_INSTALL =
EXTRA_OBJECTS_TO_CLEAN =
-%.cmo: OCAMLOPTIONS += -w Ae
-%.cmi: OCAMLOPTIONS += -w Ae
-%.cmx: OCAMLOPTIONS += -w Ae
all:
%: %.ml $(PACKAGE).cma
+foSubst.cmo : \
+ terms.cmi \
+ foSubst.cmi
+foSubst.cmx : \
+ terms.cmx \
+ foSubst.cmi
+foSubst.cmi : \
+ terms.cmi
+foUnif.cmo : \
+ terms.cmi \
+ orderings.cmi \
+ foUtils.cmi \
+ foSubst.cmi \
+ foUnif.cmi
+foUnif.cmx : \
+ terms.cmx \
+ orderings.cmx \
+ foUtils.cmx \
+ foSubst.cmx \
+ foUnif.cmi
+foUnif.cmi : \
+ terms.cmi \
+ orderings.cmi
+foUtils.cmo : \
+ terms.cmi \
+ orderings.cmi \
+ foSubst.cmi \
+ foUtils.cmi
+foUtils.cmx : \
+ terms.cmx \
+ orderings.cmx \
+ foSubst.cmx \
+ foUtils.cmi
+foUtils.cmi : \
+ terms.cmi \
+ orderings.cmi
+index.cmo : \
+ terms.cmi \
+ orderings.cmi \
+ foUtils.cmi \
+ index.cmi
+index.cmx : \
+ terms.cmx \
+ orderings.cmx \
+ foUtils.cmx \
+ index.cmi
+index.cmi : \
+ terms.cmi \
+ orderings.cmi
+nCicBlob.cmo : \
+ terms.cmi \
+ foUtils.cmi \
+ nCicBlob.cmi
+nCicBlob.cmx : \
+ terms.cmx \
+ foUtils.cmx \
+ nCicBlob.cmi
+nCicBlob.cmi : \
+ terms.cmi
+nCicParamod.cmo : \
+ terms.cmi \
+ pp.cmi \
+ paramod.cmi \
+ orderings.cmi \
+ nCicProof.cmi \
+ nCicBlob.cmi \
+ nCicParamod.cmi
+nCicParamod.cmx : \
+ terms.cmx \
+ pp.cmx \
+ paramod.cmx \
+ orderings.cmx \
+ nCicProof.cmx \
+ nCicBlob.cmx \
+ nCicParamod.cmi
+nCicParamod.cmi : \
+ terms.cmi
+nCicProof.cmo : \
+ terms.cmi \
+ pp.cmi \
+ nCicBlob.cmi \
+ foSubst.cmi \
+ nCicProof.cmi
+nCicProof.cmx : \
+ terms.cmx \
+ pp.cmx \
+ nCicBlob.cmx \
+ foSubst.cmx \
+ nCicProof.cmi
+nCicProof.cmi : \
+ terms.cmi
+orderings.cmo : \
+ terms.cmi \
+ foSubst.cmi \
+ orderings.cmi
+orderings.cmx : \
+ terms.cmx \
+ foSubst.cmx \
+ orderings.cmi
+orderings.cmi : \
+ terms.cmi
+paramod.cmo : \
+ terms.cmi \
+ superposition.cmi \
+ pp.cmi \
+ orderings.cmi \
+ index.cmi \
+ foUtils.cmi \
+ paramod.cmi
+paramod.cmx : \
+ terms.cmx \
+ superposition.cmx \
+ pp.cmx \
+ orderings.cmx \
+ index.cmx \
+ foUtils.cmx \
+ paramod.cmi
+paramod.cmi : \
+ terms.cmi \
+ orderings.cmi
+pp.cmo : \
+ terms.cmi \
+ pp.cmi
+pp.cmx : \
+ terms.cmx \
+ pp.cmi
+pp.cmi : \
+ terms.cmi
+stats.cmo : \
+ terms.cmi \
+ stats.cmi
+stats.cmx : \
+ terms.cmx \
+ stats.cmi
+stats.cmi : \
+ terms.cmi \
+ orderings.cmi
+superposition.cmo : \
+ terms.cmi \
+ pp.cmi \
+ orderings.cmi \
+ index.cmi \
+ foUtils.cmi \
+ foUnif.cmi \
+ foSubst.cmi \
+ superposition.cmi
+superposition.cmx : \
+ terms.cmx \
+ pp.cmx \
+ orderings.cmx \
+ index.cmx \
+ foUtils.cmx \
+ foUnif.cmx \
+ foSubst.cmx \
+ superposition.cmi
+superposition.cmi : \
+ terms.cmi \
+ orderings.cmi \
+ index.cmi
+terms.cmo : \
+ terms.cmi
+terms.cmx : \
+ terms.cmi
terms.cmi :
-pp.cmi : terms.cmi
-foSubst.cmi : terms.cmi
-orderings.cmi : terms.cmi
-foUtils.cmi : terms.cmi orderings.cmi
-foUnif.cmi : terms.cmi orderings.cmi
-index.cmi : terms.cmi orderings.cmi
-superposition.cmi : terms.cmi orderings.cmi index.cmi
-stats.cmi : terms.cmi orderings.cmi
-paramod.cmi : terms.cmi orderings.cmi
-nCicBlob.cmi : terms.cmi
-nCicProof.cmi : terms.cmi
-nCicParamod.cmi : terms.cmi
-terms.cmo : terms.cmi
-terms.cmx : terms.cmi
-pp.cmo : terms.cmi pp.cmi
-pp.cmx : terms.cmx pp.cmi
-foSubst.cmo : terms.cmi foSubst.cmi
-foSubst.cmx : terms.cmx foSubst.cmi
-orderings.cmo : terms.cmi pp.cmi foSubst.cmi orderings.cmi
-orderings.cmx : terms.cmx pp.cmx foSubst.cmx orderings.cmi
-foUtils.cmo : terms.cmi orderings.cmi foSubst.cmi foUtils.cmi
-foUtils.cmx : terms.cmx orderings.cmx foSubst.cmx foUtils.cmi
-foUnif.cmo : terms.cmi orderings.cmi foUtils.cmi foSubst.cmi foUnif.cmi
-foUnif.cmx : terms.cmx orderings.cmx foUtils.cmx foSubst.cmx foUnif.cmi
-index.cmo : terms.cmi pp.cmi orderings.cmi foUtils.cmi foUnif.cmi index.cmi
-index.cmx : terms.cmx pp.cmx orderings.cmx foUtils.cmx foUnif.cmx index.cmi
-superposition.cmo : terms.cmi pp.cmi orderings.cmi index.cmi foUtils.cmi \
- foUnif.cmi foSubst.cmi superposition.cmi
-superposition.cmx : terms.cmx pp.cmx orderings.cmx index.cmx foUtils.cmx \
- foUnif.cmx foSubst.cmx superposition.cmi
-stats.cmo : terms.cmi stats.cmi
-stats.cmx : terms.cmx stats.cmi
-paramod.cmo : terms.cmi superposition.cmi pp.cmi orderings.cmi index.cmi \
- foUtils.cmi foUnif.cmi paramod.cmi
-paramod.cmx : terms.cmx superposition.cmx pp.cmx orderings.cmx index.cmx \
- foUtils.cmx foUnif.cmx paramod.cmi
-nCicBlob.cmo : terms.cmi foUtils.cmi nCicBlob.cmi
-nCicBlob.cmx : terms.cmx foUtils.cmx nCicBlob.cmi
-nCicProof.cmo : terms.cmi pp.cmi nCicBlob.cmi foSubst.cmi nCicProof.cmi
-nCicProof.cmx : terms.cmx pp.cmx nCicBlob.cmx foSubst.cmx nCicProof.cmi
-nCicParamod.cmo : terms.cmi pp.cmi paramod.cmi orderings.cmi nCicProof.cmi \
- nCicBlob.cmi nCicParamod.cmi
-nCicParamod.cmx : terms.cmx pp.cmx paramod.cmx orderings.cmx nCicProof.cmx \
- nCicBlob.cmx nCicParamod.cmi
+foSubst.cmx : \
+ terms.cmx \
+ foSubst.cmi
+foSubst.cmi : \
+ terms.cmi
+foUnif.cmx : \
+ terms.cmx \
+ orderings.cmx \
+ foUtils.cmx \
+ foSubst.cmx \
+ foUnif.cmi
+foUnif.cmi : \
+ terms.cmi \
+ orderings.cmi
+foUtils.cmx : \
+ terms.cmx \
+ orderings.cmx \
+ foSubst.cmx \
+ foUtils.cmi
+foUtils.cmi : \
+ terms.cmi \
+ orderings.cmi
+index.cmx : \
+ terms.cmx \
+ orderings.cmx \
+ foUtils.cmx \
+ index.cmi
+index.cmi : \
+ terms.cmi \
+ orderings.cmi
+nCicBlob.cmx : \
+ terms.cmx \
+ foUtils.cmx \
+ nCicBlob.cmi
+nCicBlob.cmi : \
+ terms.cmi
+nCicParamod.cmx : \
+ terms.cmx \
+ pp.cmx \
+ paramod.cmx \
+ orderings.cmx \
+ nCicProof.cmx \
+ nCicBlob.cmx \
+ nCicParamod.cmi
+nCicParamod.cmi : \
+ terms.cmi
+nCicProof.cmx : \
+ terms.cmx \
+ pp.cmx \
+ nCicBlob.cmx \
+ foSubst.cmx \
+ nCicProof.cmi
+nCicProof.cmi : \
+ terms.cmi
+orderings.cmx : \
+ terms.cmx \
+ foSubst.cmx \
+ orderings.cmi
+orderings.cmi : \
+ terms.cmi
+paramod.cmx : \
+ terms.cmx \
+ superposition.cmx \
+ pp.cmx \
+ orderings.cmx \
+ index.cmx \
+ foUtils.cmx \
+ paramod.cmi
+paramod.cmi : \
+ terms.cmi \
+ orderings.cmi
+pp.cmx : \
+ terms.cmx \
+ pp.cmi
+pp.cmi : \
+ terms.cmi
+stats.cmx : \
+ terms.cmx \
+ stats.cmi
+stats.cmi : \
+ terms.cmi \
+ orderings.cmi
+superposition.cmx : \
+ terms.cmx \
+ pp.cmx \
+ orderings.cmx \
+ index.cmx \
+ foUtils.cmx \
+ foUnif.cmx \
+ foSubst.cmx \
+ superposition.cmi
+superposition.cmi : \
+ terms.cmi \
+ orderings.cmi \
+ index.cmi
+terms.cmx : \
+ terms.cmi
terms.cmi :
-pp.cmi : terms.cmi
-foSubst.cmi : terms.cmi
-orderings.cmi : terms.cmi
-foUtils.cmi : terms.cmi orderings.cmi
-foUnif.cmi : terms.cmi orderings.cmi
-index.cmi : terms.cmi orderings.cmi
-superposition.cmi : terms.cmi orderings.cmi index.cmi
-stats.cmi : terms.cmi orderings.cmi
-paramod.cmi : terms.cmi orderings.cmi
-nCicBlob.cmi : terms.cmi
-nCicProof.cmi : terms.cmi
-nCicParamod.cmi : terms.cmi
-terms.cmo : terms.cmi
-terms.cmx : terms.cmi
-pp.cmo : terms.cmi pp.cmi
-pp.cmx : terms.cmx pp.cmi
-foSubst.cmo : terms.cmi foSubst.cmi
-foSubst.cmx : terms.cmx foSubst.cmi
-orderings.cmo : terms.cmi pp.cmi foSubst.cmi orderings.cmi
-orderings.cmx : terms.cmx pp.cmx foSubst.cmx orderings.cmi
-foUtils.cmo : terms.cmi orderings.cmi foSubst.cmi foUtils.cmi
-foUtils.cmx : terms.cmx orderings.cmx foSubst.cmx foUtils.cmi
-foUnif.cmo : terms.cmi orderings.cmi foUtils.cmi foSubst.cmi foUnif.cmi
-foUnif.cmx : terms.cmx orderings.cmx foUtils.cmx foSubst.cmx foUnif.cmi
-index.cmo : terms.cmi pp.cmi orderings.cmi foUtils.cmi foUnif.cmi index.cmi
-index.cmx : terms.cmx pp.cmx orderings.cmx foUtils.cmx foUnif.cmx index.cmi
-superposition.cmo : terms.cmi pp.cmi orderings.cmi index.cmi foUtils.cmi \
- foUnif.cmi foSubst.cmi superposition.cmi
-superposition.cmx : terms.cmx pp.cmx orderings.cmx index.cmx foUtils.cmx \
- foUnif.cmx foSubst.cmx superposition.cmi
-stats.cmo : terms.cmi stats.cmi
-stats.cmx : terms.cmx stats.cmi
-paramod.cmo : terms.cmi superposition.cmi pp.cmi orderings.cmi index.cmi \
- foUtils.cmi foUnif.cmi paramod.cmi
-paramod.cmx : terms.cmx superposition.cmx pp.cmx orderings.cmx index.cmx \
- foUtils.cmx foUnif.cmx paramod.cmi
-nCicBlob.cmo : terms.cmi foUtils.cmi nCicBlob.cmi
-nCicBlob.cmx : terms.cmx foUtils.cmx nCicBlob.cmi
-nCicProof.cmo : terms.cmi pp.cmi nCicBlob.cmi foSubst.cmi nCicProof.cmi
-nCicProof.cmx : terms.cmx pp.cmx nCicBlob.cmx foSubst.cmx nCicProof.cmi
-nCicParamod.cmo : terms.cmi pp.cmi paramod.cmi orderings.cmi nCicProof.cmi \
- nCicBlob.cmi nCicParamod.cmi
-nCicParamod.cmx : terms.cmx pp.cmx paramod.cmx orderings.cmx nCicProof.cmx \
- nCicBlob.cmx nCicParamod.cmi
Subst.build_subst i t subst
| Terms.Var i, t when occurs_check subst i t ->
raise (UnificationFailure (lazy "Inference.unification.unif"))
- | Terms.Var i, t when (List.mem i locked_vars) ->
+ | Terms.Var i, _t when (List.mem i locked_vars) ->
raise (UnificationFailure (lazy "Inference.unification.unif"))
| Terms.Var i, t -> Subst.build_subst i t subst
| t, Terms.Var i when occurs_check subst i t ->
raise (UnificationFailure (lazy "Inference.unification.unif"))
- | t, Terms.Var i when (List.mem i locked_vars) ->
+ | _t, Terms.Var i when (List.mem i locked_vars) ->
raise (UnificationFailure (lazy "Inference.unification.unif"))
| t, Terms.Var i -> Subst.build_subst i t subst
| Terms.Node l1, Terms.Node l2 -> (
in
match s, t with
| s, t when U.eq_foterm s t -> subst
- | Terms.Var i, Terms.Var j
+ | Terms.Var i, Terms.Var _j
when (not (List.exists (fun (_,k) -> k=t) subst)) ->
let subst = Subst.build_subst i t subst in
subst
module Index(B : Orderings.Blob) = struct
module U = FoUtils.Utils(B)
- module Unif = FoUnif.Founif(B)
- module Pp = Pp.Pp(B)
+ (*module Unif = FoUnif.Founif(B)*)
+ (*module Pp = Pp.Pp(B)*)
module ClauseOT =
struct
let path_string_of =
let rec aux arity = function
| Terms.Leaf a -> [Constant (a, arity)]
- | Terms.Var i -> (* assert (arity = 0); *) [Variable]
+ | Terms.Var _i -> (* assert (arity = 0); *) [Variable]
(* FIXME : should this be allowed or not ?
| Terms.Node (Terms.Var _::_) ->
assert false *)
op t l (Terms.Left2Right, c)
| (_,Terms.Equation (_,r,_,Terms.Lt),_,_) as c ->
op t r (Terms.Right2Left, c)
- | (_,Terms.Equation (l,r,_,Terms.Incomparable),vl,_) as c ->
+ | (_,Terms.Equation (l,r,_,Terms.Incomparable),_vl,_) as c ->
op (op t l (Terms.Left2Right, c))
r (Terms.Right2Left, c)
- | (_,Terms.Equation (l,r,_,Terms.Invertible),vl,_) as c ->
+ | (_,Terms.Equation (l,_r,_,Terms.Invertible),_vl,_) as c ->
op t l (Terms.Left2Right, c)
- | (_,Terms.Equation (_,r,_,Terms.Eq),_,_) -> assert false
+ | (_,Terms.Equation (_,_r,_,Terms.Eq),_,_) -> assert false
| (_,Terms.Predicate p,_,_) as c ->
op t p (Terms.Nodir, c)
;;
| NReference.Fix(_,_,h) -> h
| _ -> 0
-external old_hash_param :
- int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc";;
+ external old_hash_param :
+ int -> int -> 'a -> int = "caml_hash_univ_param" (*[@@noalloc]*);;
-let old_hash = old_hash_param 10 100;;
+ let old_hash = old_hash_param 10 100;;
let compare_refs (NReference.Ref (u1,r1)) (NReference.Ref (u2,r2)) =
let x = height_of_ref r2 - height_of_ref r1 in
NCicMetaSubst.saturate status ~delta:0 metasenv subst context
ty 0
in match hty with
- | NCic.Appl (eq ::tl) when eq = CB.eqP -> true
+ | NCic.Appl (eq ::_) when eq = CB.eqP -> true
| _ -> false
;;
NCic.Implicit `Term; eq; NCic.Implicit `Term];
;;
- let trans eq p =
+ let trans eq _p =
let u= NUri.uri_of_string "cic:/matita/ng/properties/relations/trans.con" in
let u = NReference.reference_of_spec u (NReference.Fix(0,1,3)) in
NCic.Appl[NCic.Const u; NCic.Implicit `Type; NCic.Implicit `Term;
List.fold_left
(fun (i,acc) t ->
i+1,
- let f = extract status amount vl f in
+ let _f = extract status amount vl f in
if i = n then
let imp = NCic.Implicit `Term in
NCic.Appl (dag::imp::imp::imp(* f *)::imp::imp::
let module Pp = Pp.Pp(NCicBlob)
in
let module Subst = FoSubst in
- let compose subst1 subst2 =
+ (*let compose subst1 subst2 =
let s1 = List.map (fun (x,t) -> (x, Subst.apply_subst subst2 t)) subst1 in
let s2 = List.filter (fun (m,_) -> not (List.mem_assoc m s1)) subst2
in s1 @ s2
- in
+ in*)
let position i l =
let rec aux = function
| [] -> assert false
- | (j,_) :: tl when i = j -> 1
+ | (j,_) :: _ when i = j -> 1
| _ :: tl -> 1 + aux tl
in
aux l
(* prerr_endline (if ongoal then "on goal" else "not on goal");
prerr_endline (Pp.pp_substitution subst); *)
(* let subst = if ongoal then res_subst else subst in *)
- let id, id1,(lit,vl,proof) =
+ let id, id1,(lit,vl,_proof) =
if ongoal then
let lit,vl,proof = get_literal id1 in
id1,id,(Subst.apply_subst res_subst lit,
if var1 = var2 then
let diffs = (w1 - w2) + diffs in
let r = Pervasives.compare w1 w2 in
- let lt = lt or (r < 0) in
- let gt = gt or (r > 0) in
+ let lt = lt || (r < 0) in
+ let gt = gt || (r > 0) in
if lt && gt then XINCOMPARABLE else
aux hdiff (lt, gt) diffs tl1 tl2
else if var1 < var2 then
let name = "nrkbo"
include B
- module Pp = Pp.Pp(B)
+ (*module Pp = Pp.Pp(B)*)
let eq_foterm = eq_foterm B.eq;;
in
match s, t with
| s, t when eq_foterm s t -> subst
- | Terms.Var i, Terms.Var j
+ | Terms.Var i, Terms.Var _j
when (not (List.exists (fun (_,k) -> k=t) subst)) ->
let subst = FoSubst.build_subst i t subst in
subst
let name = "kbo"
include B
- module Pp = Pp.Pp(B)
+ (*module Pp = Pp.Pp(B)*)
let eq_foterm = eq_foterm B.eq;;
let name = "lpo"
include B
- module Pp = Pp.Pp(B)
+ (*module Pp = Pp.Pp(B)*)
let eq_foterm = eq_foterm B.eq;;
(* $Id: orderings.ml 9869 2009-06-11 22:52:38Z denes $ *)
let print s = prerr_endline (Lazy.force s) ;;
-let noprint s = ();;
+let noprint _s = ();;
let debug = noprint;;
let monster = 100;;
module Paramod (B : Orderings.Blob) = struct
module Pp = Pp.Pp (B)
- module FU = FoUnif.Founif(B)
+ (*module FU = FoUnif.Founif(B)*)
module IDX = Index.Index(B)
module Sup = Superposition.Superposition(B)
module Utils = FoUtils.Utils(B)
debug (lazy("Last chance " ^ string_of_float
(Unix.gettimeofday())));
let actives_l, active_t = actives in
- let passive_t,wset,_ = passives in
+ let passive_t,_wset,_ = passives in
let _ = noprint
(lazy
("Actives :" ^ (String.concat ";\n"
let newstatus =
List.fold_left
(fun acc g ->
- let bag,maxvar,actives,passives,g_actives,g_passives = acc in
- let g_passives =
+ let _bag,_maxvar,_actives,_passives,_g_actives,g_passives = acc in
+ let _g_passives =
remove_passive_goal g_passives g in
let current = snd g in
let _ =
let l =
let rec traverse ongoal (accg,acce) i =
match Terms.get_from_bag i bag with
- | (id,_,_,Terms.Exact _),_,_ ->
+ | (_id,_,_,Terms.Exact _),_,_ ->
if ongoal then [i],acce else
if (List.mem i acce) then accg,acce else accg,acce@[i]
| (_,_,_,Terms.Step (_,i1,i2,_,_,_)),_,_ ->
;;
let demod s goal =
- let bag,maxvar,actives,passives,g_actives,g_passives = s in
- let (bag,maxvar), g = mk_goal (bag,maxvar) goal in
+ let bag,maxvar,actives,_passives,_g_actives,_g_passives = s in
+ let (bag,_maxvar), g = mk_goal (bag,maxvar) goal in
let bag, ((i,_,_,_) as g1) = Sup.demodulate bag g (snd actives) in
if g1 = g then GaveUp else compute_result bag i []
(*
let fast_eq_check s goal =
let (_,_,_,_,_,g_passives) as s = initialize_goal s goal in
- if is_passive_g_set_empty g_passives then Error "not an equation"
+ if is_passive_g_set_empty g_passives then (Error "not an equation" : szsontology)
else
try
goal_narrowing 0 2 None s
let nparamod ~useage ~max_steps ?timeout s goal =
let bag,maxvar,actives,passives,g_actives,g_passives
= initialize_goal s goal in
- if is_passive_g_set_empty g_passives then Error "not an equation"
+ if is_passive_g_set_empty g_passives then (Error "not an equation" : szsontology)
else
try given_clause ~useage ~noinfer:false
bag maxvar 0 0 max_steps timeout actives passives g_actives g_passives
Format.fprintf f "%d: Exact (" eq;
pp_foterm f t;
Format.fprintf f ")@;";
- | Terms.Step (rule,eq1,eq2,dir,pos,subst) ->
+ | Terms.Step (rule,eq1,eq2,dir,_pos,_subst) ->
Format.fprintf f "%d: %s("
eq (string_of_rule rule);
Format.fprintf f "|%d with %d dir %s))" eq1 eq2
else
dependencies op tl acc
else dependencies op tl acc
- | ((Terms.Node (Terms.Leaf op1::t) as x),y)
- | (y,(Terms.Node (Terms.Leaf op1::t) as x)) when leaf_count x > leaf_count y ->
+ | ((Terms.Node (Terms.Leaf op1::_t) as x),y)
+ | (y,(Terms.Node (Terms.Leaf op1::_t) as x)) when leaf_count x > leaf_count y ->
let rec term_leaves = function
| Terms.Node l -> List.fold_left (fun acc x -> acc @ (term_leaves x)) [] l
| Terms.Leaf x -> [x]
| Terms.Leaf _ as t ->
let bag,subst,t,id = f bag t pos ctx id in
assert (subst=[]); bag,t,id
- | Terms.Var i as t ->
+ | Terms.Var _ as t ->
let t= Subst.apply_subst subst t in
bag,t,id
| Terms.Node (hd::l) ->
(IDX.DT.retrieve_generalizations table) subterm
in
list_first
- (fun (dir, (id,lit,vl,_)) ->
+ (fun (dir, (id,lit,_vl,_)) ->
match lit with
| Terms.Predicate _ -> assert false
| Terms.Equation (l,r,_,o) ->
(IDX.DT.retrieve_generalizations table) subterm
in
list_first
- (fun (dir, ((id,lit,vl,_) as c)) ->
+ (fun (dir, ((id,lit,_vl,_) as c)) ->
debug (lazy("candidate: "
^ Pp.pp_unit_clause c));
match lit with
(bag,subst,newside,id)
;;
- let rec demodulate bag (id, literal, vl, pr) table =
+ let demodulate bag (id, literal, vl, _pr) table =
debug (lazy ("demodulate " ^ (string_of_int id)));
match literal with
| Terms.Predicate t -> (* assert false *)
let is_identity_goal = function
| _, Terms.Equation (_,_,_,Terms.Eq), _, _ -> Some []
- | _, Terms.Equation (l,r,_,_), vl, proof ->
+ | _, Terms.Equation (l,r,_,_), _vl, _proof ->
(try Some (Unif.unification (* vl *) [] l r)
with FoUnif.UnificationFailure _ -> None)
| _, Terms.Predicate _, _, _ -> assert false
let f b c =
let id, dir, l, r, vl =
match c with
- | (d, (id,Terms.Equation (l,r,ty,_),vl,_))-> id, d, l, r, vl
+ | (d, (id,Terms.Equation (l,r,_ty,_),vl,_))-> id, d, l, r, vl
|_ -> assert false
in
let reverse = (dir = Terms.Left2Right) = b in
let rec orphan_murder bag acc i =
match Terms.get_from_bag i bag with
| (_,_,_,Terms.Exact _),discarded,_ -> (discarded,acc)
- | (_,_,_,Terms.Step (_,i1,i2,_,_,_)),true,_ -> (true,acc)
+ | (_,_,_,Terms.Step (_,_i1,_i2,_,_,_)),true,_ -> (true,acc)
| (_,_,_,Terms.Step (_,i1,i2,_,_,_)),false,_ ->
if (List.mem i acc) then (false,acc)
else match orphan_murder bag acc i1 with
match simplify ctable maxvar bag c with
|bag,None -> (bag,alist,atable)
(* an active clause as been discarded *)
- |bag,Some c1 ->
+ |bag,Some _c1 ->
bag, c :: alist, IDX.index_unit_clause atable c)
(bag,[],IDX.DT.empty) alist
in
else match (is_identity_goal clause) with
| Some subst -> raise (Success (bag,maxvar,clause,subst))
| None ->
- let (id,lit,vl,_) = clause in
+ let (_id,lit,vl,_) = clause in
(* this optimization makes sense only if we demodulated, since in
that case the clause should have been turned into an identity *)
if (vl = [] && not(no_demod))
(* =================== inference ===================== *)
(* this is OK for both the sup_left and sup_right inference steps *)
- let superposition table varlist subterm pos context =
+ let superposition table _varlist subterm pos context =
let cands = IDX.DT.retrieve_unifiables table subterm in
HExtlib.filter_map
- (fun (dir, (id,lit,vl,_ (*as uc*))) ->
+ (fun (dir, (id,lit,_vl,_ (*as uc*))) ->
match lit with
| Terms.Predicate _ -> assert false
| Terms.Equation (l,r,_,o) ->
-nDiscriminationTree.cmi :
+nCicCoercion.cmo : \
+ nDiscriminationTree.cmi \
+ nCicUnifHint.cmi \
+ nCicMetaSubst.cmi \
+ nCicCoercion.cmi
+nCicCoercion.cmx : \
+ nDiscriminationTree.cmx \
+ nCicUnifHint.cmx \
+ nCicMetaSubst.cmx \
+ nCicCoercion.cmi
+nCicCoercion.cmi : \
+ nCicUnifHint.cmi
+nCicMetaSubst.cmo : \
+ nCicMetaSubst.cmi
+nCicMetaSubst.cmx : \
+ nCicMetaSubst.cmi
nCicMetaSubst.cmi :
-nCicUnifHint.cmi :
-nCicCoercion.cmi : nCicUnifHint.cmi
+nCicRefineUtil.cmo : \
+ nCicMetaSubst.cmi \
+ nCicRefineUtil.cmi
+nCicRefineUtil.cmx : \
+ nCicMetaSubst.cmx \
+ nCicRefineUtil.cmi
nCicRefineUtil.cmi :
-nCicUnification.cmi : nCicCoercion.cmi
-nCicRefiner.cmi : nCicCoercion.cmi
-nDiscriminationTree.cmo : nDiscriminationTree.cmi
-nDiscriminationTree.cmx : nDiscriminationTree.cmi
-nCicMetaSubst.cmo : nCicMetaSubst.cmi
-nCicMetaSubst.cmx : nCicMetaSubst.cmi
-nCicUnifHint.cmo : nDiscriminationTree.cmi nCicMetaSubst.cmi \
+nCicRefiner.cmo : \
+ nCicUnification.cmi \
+ nCicRefineUtil.cmi \
+ nCicMetaSubst.cmi \
+ nCicCoercion.cmi \
+ nCicRefiner.cmi
+nCicRefiner.cmx : \
+ nCicUnification.cmx \
+ nCicRefineUtil.cmx \
+ nCicMetaSubst.cmx \
+ nCicCoercion.cmx \
+ nCicRefiner.cmi
+nCicRefiner.cmi : \
+ nCicCoercion.cmi
+nCicUnifHint.cmo : \
+ nDiscriminationTree.cmi \
+ nCicMetaSubst.cmi \
nCicUnifHint.cmi
-nCicUnifHint.cmx : nDiscriminationTree.cmx nCicMetaSubst.cmx \
+nCicUnifHint.cmx : \
+ nDiscriminationTree.cmx \
+ nCicMetaSubst.cmx \
nCicUnifHint.cmi
-nCicCoercion.cmo : nDiscriminationTree.cmi nCicUnifHint.cmi \
- nCicMetaSubst.cmi nCicCoercion.cmi
-nCicCoercion.cmx : nDiscriminationTree.cmx nCicUnifHint.cmx \
- nCicMetaSubst.cmx nCicCoercion.cmi
-nCicRefineUtil.cmo : nCicMetaSubst.cmi nCicRefineUtil.cmi
-nCicRefineUtil.cmx : nCicMetaSubst.cmx nCicRefineUtil.cmi
-nCicUnification.cmo : nCicUnifHint.cmi nCicMetaSubst.cmi nCicUnification.cmi
-nCicUnification.cmx : nCicUnifHint.cmx nCicMetaSubst.cmx nCicUnification.cmi
-nCicRefiner.cmo : nCicUnification.cmi nCicRefineUtil.cmi nCicMetaSubst.cmi \
- nCicCoercion.cmi nCicRefiner.cmi
-nCicRefiner.cmx : nCicUnification.cmx nCicRefineUtil.cmx nCicMetaSubst.cmx \
- nCicCoercion.cmx nCicRefiner.cmi
+nCicUnifHint.cmi :
+nCicUnification.cmo : \
+ nCicUnifHint.cmi \
+ nCicMetaSubst.cmi \
+ nCicUnification.cmi
+nCicUnification.cmx : \
+ nCicUnifHint.cmx \
+ nCicMetaSubst.cmx \
+ nCicUnification.cmi
+nCicUnification.cmi : \
+ nCicCoercion.cmi
+nDiscriminationTree.cmo : \
+ nDiscriminationTree.cmi
+nDiscriminationTree.cmx : \
+ nDiscriminationTree.cmi
+nDiscriminationTree.cmi :
-nDiscriminationTree.cmi :
+nCicCoercion.cmx : \
+ nDiscriminationTree.cmx \
+ nCicUnifHint.cmx \
+ nCicMetaSubst.cmx \
+ nCicCoercion.cmi
+nCicCoercion.cmi : \
+ nCicUnifHint.cmi
+nCicMetaSubst.cmx : \
+ nCicMetaSubst.cmi
nCicMetaSubst.cmi :
-nCicUnifHint.cmi :
-nCicCoercion.cmi : nCicUnifHint.cmi
+nCicRefineUtil.cmx : \
+ nCicMetaSubst.cmx \
+ nCicRefineUtil.cmi
nCicRefineUtil.cmi :
-nCicUnification.cmi : nCicCoercion.cmi
-nCicRefiner.cmi : nCicCoercion.cmi
-nDiscriminationTree.cmo : nDiscriminationTree.cmi
-nDiscriminationTree.cmx : nDiscriminationTree.cmi
-nCicMetaSubst.cmo : nCicMetaSubst.cmi
-nCicMetaSubst.cmx : nCicMetaSubst.cmi
-nCicUnifHint.cmo : nDiscriminationTree.cmi nCicMetaSubst.cmi \
+nCicRefiner.cmx : \
+ nCicUnification.cmx \
+ nCicRefineUtil.cmx \
+ nCicMetaSubst.cmx \
+ nCicCoercion.cmx \
+ nCicRefiner.cmi
+nCicRefiner.cmi : \
+ nCicCoercion.cmi
+nCicUnifHint.cmx : \
+ nDiscriminationTree.cmx \
+ nCicMetaSubst.cmx \
nCicUnifHint.cmi
-nCicUnifHint.cmx : nDiscriminationTree.cmx nCicMetaSubst.cmx \
- nCicUnifHint.cmi
-nCicCoercion.cmo : nDiscriminationTree.cmi nCicUnifHint.cmi \
- nCicMetaSubst.cmi nCicCoercion.cmi
-nCicCoercion.cmx : nDiscriminationTree.cmx nCicUnifHint.cmx \
- nCicMetaSubst.cmx nCicCoercion.cmi
-nCicRefineUtil.cmo : nCicMetaSubst.cmi nCicRefineUtil.cmi
-nCicRefineUtil.cmx : nCicMetaSubst.cmx nCicRefineUtil.cmi
-nCicUnification.cmo : nCicUnifHint.cmi nCicMetaSubst.cmi nCicUnification.cmi
-nCicUnification.cmx : nCicUnifHint.cmx nCicMetaSubst.cmx nCicUnification.cmi
-nCicRefiner.cmo : nCicUnification.cmi nCicRefineUtil.cmi nCicMetaSubst.cmi \
- nCicCoercion.cmi nCicRefiner.cmi
-nCicRefiner.cmx : nCicUnification.cmx nCicRefineUtil.cmx nCicMetaSubst.cmx \
- nCicCoercion.cmx nCicRefiner.cmi
+nCicUnifHint.cmi :
+nCicUnification.cmx : \
+ nCicUnifHint.cmx \
+ nCicMetaSubst.cmx \
+ nCicUnification.cmi
+nCicUnification.cmi : \
+ nCicCoercion.cmi
+nDiscriminationTree.cmx : \
+ nDiscriminationTree.cmi
+nDiscriminationTree.cmi :
$(INTERFACE_FILES:%.mli=%.ml)
EXTRA_OBJECTS_TO_INSTALL =
EXTRA_OBJECTS_TO_CLEAN =
-%.cmo: OCAMLOPTIONS += -w Ae
-%.cmi: OCAMLOPTIONS += -w Ae
-%.cmx: OCAMLOPTIONS += -w Ae
include ../../Makefile.defs
include ../Makefile.common
(fun () -> incr maxmeta; !maxmeta),
(fun () -> !maxmeta),
(fun () -> pushedmetas := !maxmeta::!pushedmetas; maxmeta := 0),
- (fun () -> match !pushedmetas with [] -> assert false | hd::tl -> pushedmetas := tl)
+ (fun () -> match !pushedmetas with [] -> assert false | _hd::tl -> pushedmetas := tl)
;;
exception NotFound of [`NotInTheList | `NotWellTyped];;
raise (NotFound `NotWellTyped)
| TypeNotGood
| NCicTypeChecker.AssertFailure _
- | NCicReduction.AssertFailure _
- | NCicTypeChecker.TypeCheckerFailure _ ->
+ | NCicReduction.AssertFailure _ ->
raise (NotFound `NotWellTyped))
with NotFound reason ->
(* This is the case where we fail even first order unification. *)
(* $Id: cicUtil.ml 10153 2009-07-28 15:17:51Z sacerdot $ *)
-exception Meta_not_found of int
-exception Subst_not_found of int
+(*exception Meta_not_found of int
+exception Subst_not_found of int*)
(* syntactic_equality up to the *)
(* distinction between fake dependent products *)
pp (lazy "WWW: trying coercions -- inner check");
match infty, expty, t with
(* `XTSort|`XTProd|`XTInd + Match not implemented *)
- | _,`XTSome expty, C.Match (Ref.Ref (_,Ref.Ind (_,tyno,leftno)) as r,outty,m,pl) ->
+ | _,`XTSome expty, C.Match (Ref.Ref (_,Ref.Ind (_,_tyno,_leftno)) as r,outty,m,pl) ->
(*{{{*) pp (lazy "CASE");
(* {{{ helper functions *)
let get_cl_and_left_p refit outty =
match refit with
- | Ref.Ref (uri, Ref.Ind (_,tyno,leftno)) ->
+ | Ref.Ref (_uri, Ref.Ind (_,tyno,_leftno)) ->
let _, leftno, itl, _, _ = NCicEnvironment.get_checked_indtys status r in
let _, _, ty, cl = List.nth itl tyno in
- let constructorsno = List.length cl in
+ (*let constructorsno = List.length cl in*)
let count_pis t =
let rec aux ctx t =
match NCicReduction.whd status ~subst ~delta:max_int ctx t with
(NCicSubstitution.lift status 1 mty) (NCicSubstitution.lift status 1 m) tgt
in
C.Prod (name, src, t), k
- | C.Const (Ref.Ref (_,Ref.Ind (_,_,leftno)) as r) ->
+ | C.Const (Ref.Ref (_,Ref.Ind (_,_,_leftno)) as r) ->
let k =
let k = C.Const(Ref.mk_constructor i r) in
NCicUntrusted.mk_appl k par
(NCicReduction.head_beta_reduce status ~delta:max_int
(NCicUntrusted.mk_appl outty [k])))),[mty,m,mty,k]
| C.Appl (C.Const (Ref.Ref (_,Ref.Ind (_,_,leftno)) as r)::pl) ->
- let left_p,right_p = HExtlib.split_nth leftno pl in
- let has_rights = right_p <> [] in
+ let left_p,_right_p = HExtlib.split_nth leftno pl in
+ (*let has_rights = right_p <> [] in*)
let k =
let k = C.Const(Ref.mk_constructor i r) in
NCicUntrusted.mk_appl k (left_p@par)
in (* }}} end helper functions *)
(* constructors types with left params already instantiated *)
let outty = NCicUntrusted.apply_subst status subst context outty in
- let cl, left_p, leftno,rno =
+ let cl, _left_p, leftno,rno =
get_cl_and_left_p r outty
in
let right_p, mty =
pp (lazy ("LAM: coerced = " ^ status#ppterm ~metasenv ~subst ~context coerced));
metasenv, subst, coerced, expty (*}}}*)
| _ -> raise exc
- with exc2 ->
+ with _ ->
let expty =
match expty with
`XTSome expty -> expty
let rec aux context (metasenv,subst) = function
| C.Meta _ -> metasenv, subst
| C.Implicit _ -> metasenv, subst
- | C.Appl (C.Rel i :: args) as t
+ | C.Appl (C.Rel i :: args)
when i > List.length context - len ->
let lefts, _ = HExtlib.split_nth leftno args in
let ctxlen = List.length context in
end
;;
-let pp_hint t p =
- let context, t =
+let pp_hint _t _p =
+(* let context, t =
let rec aux ctx = function
| NCic.Prod (name, ty, rest) -> aux ((name, NCic.Decl ty) :: ctx) rest
| t -> ctx, t
in
let buff = Buffer.create 100 in
let fmt = Format.formatter_of_buffer buff in
-(*
F.fprintf "@[<hov>"
F.fprintf "@[<hov>"
(* pp_ctx [] context *)
(HintSet.elements dataset);
);
List.iter (fun x, l -> Pp.node x ~attrs:["label",l] fmt) !nodes;
- List.iter (fun x, y, l, _, _ ->
+ List.iter (fun x, y, _l, _, _ ->
Pp.raw (Printf.sprintf "%s -- %s [ label=\"%s\" ];\n" x y "?") fmt)
!edges;
edges := List.sort (fun (_,_,_,p1,_) (_,_,_,p2,_) -> p1 - p2) !edges;
- List.iter (fun x, y, _, p, l -> pp_hint l p) !edges;
+ List.iter (fun _x, _y, _, p, l -> pp_hint l p) !edges;
;;
-continuationals.cmo : continuationals.cmi
-continuationals.cmx : continuationals.cmi
+continuationals.cmo : \
+ continuationals.cmi
+continuationals.cmx : \
+ continuationals.cmi
continuationals.cmi :
-declarative.cmo : nnAuto.cmi nTactics.cmi nTacStatus.cmi nCicElim.cmi \
- continuationals.cmi declarative.cmi
-declarative.cmx : nnAuto.cmx nTactics.cmx nTacStatus.cmx nCicElim.cmx \
- continuationals.cmx declarative.cmi
-declarative.cmi : nnAuto.cmi nTacStatus.cmi
-nCicElim.cmo : nCicElim.cmi
-nCicElim.cmx : nCicElim.cmi
+declarative.cmo : \
+ nnAuto.cmi \
+ nTactics.cmi \
+ nTacStatus.cmi \
+ nCicElim.cmi \
+ continuationals.cmi \
+ declarative.cmi
+declarative.cmx : \
+ nnAuto.cmx \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ nCicElim.cmx \
+ continuationals.cmx \
+ declarative.cmi
+declarative.cmi : \
+ nnAuto.cmi \
+ nTacStatus.cmi
+nCicElim.cmo : \
+ nCicElim.cmi
+nCicElim.cmx : \
+ nCicElim.cmi
nCicElim.cmi :
-nCicTacReduction.cmo : nCicTacReduction.cmi
-nCicTacReduction.cmx : nCicTacReduction.cmi
+nCicTacReduction.cmo : \
+ nCicTacReduction.cmi
+nCicTacReduction.cmx : \
+ nCicTacReduction.cmi
nCicTacReduction.cmi :
-nDestructTac.cmo : nTactics.cmi nTacStatus.cmi continuationals.cmi \
+nDestructTac.cmo : \
+ nTactics.cmi \
+ nTacStatus.cmi \
+ continuationals.cmi \
nDestructTac.cmi
-nDestructTac.cmx : nTactics.cmx nTacStatus.cmx continuationals.cmx \
+nDestructTac.cmx : \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ continuationals.cmx \
nDestructTac.cmi
-nDestructTac.cmi : nTacStatus.cmi
-nInversion.cmo : nTactics.cmi nTacStatus.cmi nCicElim.cmi \
- continuationals.cmi nInversion.cmi
-nInversion.cmx : nTactics.cmx nTacStatus.cmx nCicElim.cmx \
- continuationals.cmx nInversion.cmi
-nInversion.cmi : nTacStatus.cmi
-nTacStatus.cmo : nCicTacReduction.cmi continuationals.cmi nTacStatus.cmi
-nTacStatus.cmx : nCicTacReduction.cmx continuationals.cmx nTacStatus.cmi
-nTacStatus.cmi : continuationals.cmi
-nTactics.cmo : nTacStatus.cmi nCicElim.cmi continuationals.cmi nTactics.cmi
-nTactics.cmx : nTacStatus.cmx nCicElim.cmx continuationals.cmx nTactics.cmi
-nTactics.cmi : nTacStatus.cmi
-nnAuto.cmo : nTactics.cmi nTacStatus.cmi nCicTacReduction.cmi \
- continuationals.cmi nnAuto.cmi
-nnAuto.cmx : nTactics.cmx nTacStatus.cmx nCicTacReduction.cmx \
- continuationals.cmx nnAuto.cmi
-nnAuto.cmi : nTacStatus.cmi
+nDestructTac.cmi : \
+ nTacStatus.cmi
+nInversion.cmo : \
+ nTactics.cmi \
+ nTacStatus.cmi \
+ nCicElim.cmi \
+ continuationals.cmi \
+ nInversion.cmi
+nInversion.cmx : \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ nCicElim.cmx \
+ continuationals.cmx \
+ nInversion.cmi
+nInversion.cmi : \
+ nTacStatus.cmi
+nTacStatus.cmo : \
+ nCicTacReduction.cmi \
+ continuationals.cmi \
+ nTacStatus.cmi
+nTacStatus.cmx : \
+ nCicTacReduction.cmx \
+ continuationals.cmx \
+ nTacStatus.cmi
+nTacStatus.cmi : \
+ continuationals.cmi
+nTactics.cmo : \
+ nTacStatus.cmi \
+ nCicElim.cmi \
+ continuationals.cmi \
+ nTactics.cmi
+nTactics.cmx : \
+ nTacStatus.cmx \
+ nCicElim.cmx \
+ continuationals.cmx \
+ nTactics.cmi
+nTactics.cmi : \
+ nTacStatus.cmi
+nnAuto.cmo : \
+ nTactics.cmi \
+ nTacStatus.cmi \
+ nCicTacReduction.cmi \
+ continuationals.cmi \
+ nnAuto.cmi
+nnAuto.cmx : \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ nCicTacReduction.cmx \
+ continuationals.cmx \
+ nnAuto.cmi
+nnAuto.cmi : \
+ nTacStatus.cmi
+continuationals.cmx : \
+ continuationals.cmi
continuationals.cmi :
-nCicTacReduction.cmi :
-nTacStatus.cmi : continuationals.cmi
+declarative.cmx : \
+ nnAuto.cmx \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ nCicElim.cmx \
+ continuationals.cmx \
+ declarative.cmi
+declarative.cmi : \
+ nnAuto.cmi \
+ nTacStatus.cmi
+nCicElim.cmx : \
+ nCicElim.cmi
nCicElim.cmi :
-nTactics.cmi : nTacStatus.cmi
-declarative.cmi : nTacStatus.cmi
-nnAuto.cmi : nTacStatus.cmi
-nDestructTac.cmi : nTacStatus.cmi
-nInversion.cmi : nTacStatus.cmi
-continuationals.cmo : continuationals.cmi
-continuationals.cmx : continuationals.cmi
-nCicTacReduction.cmo : nCicTacReduction.cmi
-nCicTacReduction.cmx : nCicTacReduction.cmi
-nTacStatus.cmo : nCicTacReduction.cmi continuationals.cmi nTacStatus.cmi
-nTacStatus.cmx : nCicTacReduction.cmx continuationals.cmx nTacStatus.cmi
-nCicElim.cmo : nCicElim.cmi
-nCicElim.cmx : nCicElim.cmi
-nTactics.cmo : nTacStatus.cmi nCicElim.cmi continuationals.cmi nTactics.cmi
-nTactics.cmx : nTacStatus.cmx nCicElim.cmx continuationals.cmx nTactics.cmi
-declarative.cmo : nTactics.cmi declarative.cmi
-declarative.cmx : nTactics.cmx declarative.cmi
-nnAuto.cmo : nTactics.cmi nTacStatus.cmi nCicTacReduction.cmi \
- continuationals.cmi nnAuto.cmi
-nnAuto.cmx : nTactics.cmx nTacStatus.cmx nCicTacReduction.cmx \
- continuationals.cmx nnAuto.cmi
-nDestructTac.cmo : nTactics.cmi nTacStatus.cmi continuationals.cmi \
- nDestructTac.cmi
-nDestructTac.cmx : nTactics.cmx nTacStatus.cmx continuationals.cmx \
+nCicTacReduction.cmx : \
+ nCicTacReduction.cmi
+nCicTacReduction.cmi :
+nDestructTac.cmx : \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ continuationals.cmx \
nDestructTac.cmi
-nInversion.cmo : nTactics.cmi nTacStatus.cmi nCicElim.cmi \
- continuationals.cmi nInversion.cmi
-nInversion.cmx : nTactics.cmx nTacStatus.cmx nCicElim.cmx \
- continuationals.cmx nInversion.cmi
+nDestructTac.cmi : \
+ nTacStatus.cmi
+nInversion.cmx : \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ nCicElim.cmx \
+ continuationals.cmx \
+ nInversion.cmi
+nInversion.cmi : \
+ nTacStatus.cmi
+nTacStatus.cmx : \
+ nCicTacReduction.cmx \
+ continuationals.cmx \
+ nTacStatus.cmi
+nTacStatus.cmi : \
+ continuationals.cmi
+nTactics.cmx : \
+ nTacStatus.cmx \
+ nCicElim.cmx \
+ continuationals.cmx \
+ nTactics.cmi
+nTactics.cmi : \
+ nTacStatus.cmi
+nnAuto.cmx : \
+ nTactics.cmx \
+ nTacStatus.cmx \
+ nCicTacReduction.cmx \
+ continuationals.cmx \
+ nnAuto.cmi
+nnAuto.cmi : \
+ nTacStatus.cmi
let rec aux acc depth =
function
| [] -> acc
- | (locs, todos, conts, tag, p) :: tl ->
+ | (locs, todos, conts, tag, _p) :: tl ->
let acc = List.fold_left (fun acc -> env acc depth tag) acc locs in
let acc = List.fold_left (fun acc -> cont acc depth tag) acc conts in
let acc = List.fold_left (fun acc -> todo acc depth tag) acc todos in
let s = status#stack in
match s with
| [] -> fail (lazy "There's nothing to prove")
- | (g1, _, k, tag1, _) :: tl ->
+ | (g1, _, _k, _tag1, _) :: _tl ->
let goals = filter_open g1 in
match goals with
[] -> fail (lazy "No goals under focus")
- | loc::tl ->
+ | loc::_tl ->
let goal = goal_of_loc (loc) in
goal ;;
let extract_conclusion_type status goal =
let gty = get_goalty status goal in
let ctx = ctx_of gty in
- let status,gty = term_of_cic_term status gty ctx in
- gty
+ term_of_cic_term status gty ctx
;;
let alpha_eq_tacterm_kerterm ty t status goal =
| (g,t,k,tag,p)::tl ->
let rec remove_volatile = function
[] -> []
- | (k,v as hd')::tl' ->
+ | (k,_v as hd')::tl' ->
let re = Str.regexp "volatile_.*" in
if Str.string_match re k 0 then
remove_volatile tl'
*)
let lambda_abstract_tac id t1 status goal =
match extract_conclusion_type status goal with
- | NCic.Prod (_,t,_) ->
+ | status,NCic.Prod (_,t,_) ->
if alpha_eq_tacterm_kerterm t1 t status goal then
let (_,_,t1) = t1 in
block_tac [exact_tac ("",0,(Ast.Binder (`Lambda,(Ast.Ident (id,None),Some t1),Ast.Implicit
;;
let assert_tac t1 t2 status goal continuation =
- let t = extract_conclusion_type status goal in
+ let status,t = extract_conclusion_type status goal in
if alpha_eq_tacterm_kerterm t1 t status goal then
match t2 with
| None -> continuation
| Some t2 ->
- let status,res = are_convertible t1 t2 status goal in
+ let _status,res = are_convertible t1 t2 status goal in
if res then continuation
else
raise NotEquivalentTypes
let status_parameter key status =
match status#stack with
[] -> ""
- | (g,t,k,tag,p)::_ -> try List.assoc key p with _ -> ""
+ | (_g,_t,_k,_tag,p)::_ -> try List.assoc key p with _ -> ""
;;
let beta_rewriting_step t status =
let by_just_we_proved just ty id status =
let goal = extract_first_goal_from_status status in
- let wrappedjust = just in
let just = mk_just status goal just in
match id with
| None ->
(* Useful as it does not change the order in the list *)
let rec list_change_assoc k v = function
[] -> []
- | (k',v' as hd) :: tl -> if k' = k then (k',v) :: tl else hd :: (list_change_assoc k v tl)
+ | (k',_v' as hd) :: tl -> if k' = k then (k',v) :: tl else hd :: (list_change_assoc k v tl)
;;
let add_names_to_goals_tac (cl:NCic.constructor list ref) (status:#NTacStatus.tac_status) =
let add_name_to_goal name goal metasenv =
- let (mattrs,ctx,t as conj) = try List.assoc goal metasenv with _ -> assert false in
+ let (mattrs,ctx,t) = try List.assoc goal metasenv with _ -> assert false in
let mattrs = (`Name name) :: (List.filter (function `Name _ -> false | _ -> true) mattrs) in
let newconj = (mattrs,ctx,t) in
list_change_assoc goal newconj metasenv
* the new goals, when they are still under focus *)
match status#stack with
[] -> fail (lazy "Can not add names to an empty stack")
- | (g,_,_,_,_) :: tl ->
+ | (g,_,_,_,_) :: _tl ->
let rec sublist n = function
[] -> []
| hd :: tl -> if n = 0 then [] else hd :: (sublist (n-1) tl)
let has_focused_goal status =
match status#stack with
[] -> false
- | ([],_,_,_,_) :: tl -> false
+ | ([],_,_,_,_) :: _tl -> false
| _ -> true
;;
let p_name = mk_id "Q_" in
let params,ty = NCicReduction.split_prods status ~subst:[] [] leftno ty in
let params = List.rev_map (function name,_ -> mk_id name) params in
- let args,sort = NCicReduction.split_prods status ~subst:[] [] (-1) ty in
+ let args,_sort = NCicReduction.split_prods status ~subst:[] [] (-1) ty in
let args = List.rev_map (function name,_ -> mk_id name) args in
let rec_arg = mk_id (fresh_name ()) in
let mk_prods =
List.map
(function (_,name,ty) ->
let _,ty = NCicReduction.split_prods status ~subst:[] [] leftno ty in
- let cargs,ty= my_split_prods status ~subst:[] [] (-1) ty in
+ let cargs,_ty= my_split_prods status ~subst:[] [] (-1) ty in
let cargs_recargs_nih =
List.fold_left
(fun (acc,nih) -> function
in
let rec eat_branch n rels ty pat =
match (ty, pat) with
- | NCic.Prod (name, s, t), _ when n > 0 ->
+ | NCic.Prod (_name, _s, t), _ when n > 0 ->
eat_branch (pred n) rels t pat
| NCic.Prod (_, _, t), NCic.Lambda (name, s, t') ->
let cv, rhs = eat_branch 0 ((mk_id name)::rels) t t' in
let nargs it nleft consno =
pp (lazy (Printf.sprintf "nargs %d %d" nleft consno));
- let _,indname,_,cl = it in
+ let _,_indname,_,cl = it in
let _,_,t_k = List.nth cl consno in
List.length (arg_list nleft t_k) ;;
NotationPt.Theorem
(name, principle, Some (NotationPt.Implicit (`Tagged "inv")), attrs))
in
- let uri,height,nmenv,nsubst,nobj = theorem in
+ let _uri,_height,nmenv,_nsubst,_nobj = theorem in
let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in
let status = status#set_obj theorem in
let status = status#set_stack ninitial_stack in
let status = subst_metasenv_and_fix_names status in
(* PHASE 3: we finally prove the discrimination principle *)
- let dbranch it ~use_jmeq leftno consno =
+ let dbranch it ~use_jmeq:__ leftno consno =
let refl_id = mk_sym "refl" in
pp (lazy (Printf.sprintf "dbranch %d %d" leftno consno));
let nlist = HExtlib.list_seq 0 (nargs it leftno consno) in
else
let gen_tac x =
(fun s ->
- let x' = String.concat " " x in
+ (*let x' = String.concat " " x in*)
let x = List.map mk_id x in
(* let s = NTactics.print_tac false ("@generalize " ^ x') s in *)
generalize0_tac x s) in
| _ -> status, `NonEq
in match kind with
| `Identity ->
- let status, goalty = term_of_cic_term status (get_goalty status goal) ctx in
+ let status, _goalty = term_of_cic_term status (get_goalty status goal) ctx in
status, Some (List.length ctx - i), kind
| `Cycle | `Blob | `NonEq -> aux (i+1) (* XXX: skip cyclic/blob equations for now *)
| _ ->
let rec mk_arrows ~jmeq xs ys selection target =
match selection,xs,ys with
[],[],[] -> target
- | false :: l,x::xs,y::ys -> mk_arrows ~jmeq xs ys l target
+ | false :: l,_x::xs,_y::ys -> mk_arrows ~jmeq xs ys l target
| true :: l,x::xs,y::ys when jmeq ->
NotationPt.Binder (`Forall, (mk_id "_",
Some (mk_appl [mk_sym "jmsimeq" ;
status#set_obj(u,h,NCicUntrusted.apply_subst_metasenv status subst metasenv,subst,o)
;;
-let mk_inverter ~jmeq name is_ind it leftno ?selection outsort (status: #NCic.status) baseuri =
+let mk_inverter ~jmeq name _is_ind it leftno ?selection outsort (status: #NCic.status) baseuri =
pp (lazy ("leftno = " ^ string_of_int leftno));
let _,ind_name,ty,cl = it in
pp (lazy ("arity: " ^ status#ppterm ~metasenv:[] ~subst:[] ~context:[] ty));
in (hypaux 1 ncons)
in
- let outsort, suffix = NCicElim.ast_of_sort outsort in
+ let outsort, _suffix = NCicElim.ast_of_sort outsort in
let theorem =
mk_prods xs
(NotationPt.Binder (`Forall, (mk_id "Hterm", Some (mk_appl (List.map mk_id (ind_name::xs)))),
NotationPt.Theorem
(name,theorem, Some (NotationPt.Implicit (`Tagged "inv")), attrs))
in
- let uri,height,nmenv,nsubst,nobj = theorem in
+ let _uri,_height,nmenv,_nsubst,_nobj = theorem in
let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in
let status = status#set_obj theorem in
let status = status#set_stack ninitial_stack in
let mk_inverter name is_ind it leftno ?selection outsort status baseuri =
try mk_inverter ~jmeq:true name is_ind it leftno ?selection outsort status baseuri
- with NTacStatus.Error (s,_) ->
+ with NTacStatus.Error (_s,_) ->
mk_inverter ~jmeq:false name is_ind it leftno ?selection outsort status baseuri
;;
let mk_cic_term c t = c,t ;;
let ppterm (status:#pstatus) t =
- let uri,height,metasenv,subst,obj = status#obj in
+ let _uri,_height,metasenv,subst,_obj = status#obj in
let context,t = t in
status#ppterm ~metasenv ~subst ~context t
;;
let ppcontext (status: #pstatus) c =
- let uri,height,metasenv,subst,obj = status#obj in
+ let _uri,_height,metasenv,subst,_obj = status#obj in
status#ppcontext ~metasenv ~subst c
;;
let ppterm_and_context (status: #pstatus) t =
- let uri,height,metasenv,subst,obj = status#obj in
+ let _uri,_height,metasenv,subst,_obj = status#obj in
let context,t = t in
status#ppcontext ~metasenv ~subst context ^ "\n ⊢ "^
status#ppterm ~metasenv ~subst ~context t
;;
-let relocate status destination (source,t as orig) =
+let relocate status destination (source,_t as orig) =
pp(lazy("relocate:\n" ^ ppterm_and_context status orig));
pp(lazy("relocate in:\n" ^ ppcontext status destination));
let rc =
compute_ops (e::ctx) (cl1,cl2)
else
[ `Delift ctx; `Lift (List.rev ex) ]
- | (n1, NCic.Def (b1,t1) as e)::cl1 as ex, (n2, NCic.Decl t2)::cl2 ->
+ | (n1, NCic.Def (_b1,t1) as e)::cl1 as ex, (n2, NCic.Decl t2)::cl2 ->
if n1 = n2 &&
NCicReduction.are_convertible status ctx ~subst ~metasenv t1 t2 then
compute_ops (e::ctx) (cl1,cl2)
else
[ `Delift ctx; `Lift (List.rev ex) ]
- | (n1, NCic.Decl _)::cl1 as ex, (n2, NCic.Def _)::cl2 ->
+ | (_n1, NCic.Decl _)::_cl1 as ex, (_n2, NCic.Def _)::_cl2 ->
[ `Delift ctx; `Lift (List.rev ex) ]
| _::_ as ex, [] -> [ `Lift (List.rev ex) ]
| [], _::_ -> [ `Delift ctx ]
let are_convertible status ctx a b =
let status, (_,a) = relocate status ctx a in
let status, (_,b) = relocate status ctx b in
- let n,h,metasenv,subst,o = status#obj in
+ let _n,_h,metasenv,subst,_o = status#obj in
let res = NCicReduction.are_convertible status metasenv subst ctx a b in
status, res
;;
else
let _,_,_,subst,_ = status#obj in
match t with
- | NCic.Meta (i,lc) when List.mem_assoc i subst ->
+ | NCic.Meta (i,_lc) when List.mem_assoc i subst ->
let _,_,t,_ = NCicUtils.lookup_subst i subst in
aux ctx (status,already_found) t
| NCic.Meta _ -> (status,already_found),t
let find_in_context name context =
let rec aux acc = function
| [] -> raise Not_found
- | (hd,_) :: tl when hd = name -> acc
+ | (hd,_) :: _ when hd = name -> acc
| _ :: tl -> aux (acc + 1) tl
in
aux 1 context
let goalty = get_goalty status goal in
let status, what = disambiguate status (ctx_of goalty) what `XTInd in
let status, ty_what = typeof status (ctx_of what) what in
- let status, (r,consno,lefts,rights,cl) = analyse_indty status ty_what in
+ let _status, (r,consno,lefts,rights,cl) = analyse_indty status ty_what in
let leftno = List.length lefts in
let rightno = List.length rights in
indtyref := Some {
let assert_tac seqs status =
match status#stack with
| [] -> assert false
- | (g,_,_,_,_) :: s ->
+ | (g,_,_,_,_) :: _s ->
assert (List.length g = List.length seqs);
(match seqs with
[] -> id_tac
let print ?(depth=0) s =
prerr_endline (String.make (2*depth) ' '^Lazy.force s)
-let noprint ?(depth=0) _ = ()
+let noprint ?depth:(_=0) _ = ()
let debug_print = noprint
open Continuationals.Stack
else true
with Not_found -> true
-let print_stat status tbl =
+let print_stat _status tbl =
let l = RefHash.fold (fun a v l -> (a,v)::l) tbl [] in
let relevance v = float !(v.uses) /. float !(v.nominations) in
let vcompare (_,v1) (_,v2) =
end
;;
-let index_local_equations2 eq_cache status open_goal lemmas ?(flag=false) nohyps =
+let index_local_equations2 eq_cache status open_goal lemmas ?flag:(_=false) nohyps =
noprint (lazy "indexing equations");
let eq_cache,lemmas =
match lemmas with
eq_cache lemmas
;;
-let fast_eq_check_tac ~params s =
+let fast_eq_check_tac ~params:_ s =
let unit_eq = index_local_equations s#eq_cache s in
dist_fast_eq_check unit_eq s
;;
| s::_ -> s
;;
-let paramod_tac ~params s =
+let paramod_tac ~params:_ s =
let unit_eq = index_local_equations s#eq_cache s in
NTactics.distribute_tac (paramod unit_eq) s
;;
(fun ty ctx_entry ->
match ctx_entry with
| name, NCic.Decl t -> NCic.Prod(name,t,ty)
- | name, NCic.Def(bo, _) -> NCicSubstitution.subst status bo ty)
+ | _name, NCic.Def(bo, _) -> NCicSubstitution.subst status bo ty)
;;
let args_for_context ?(k=1) ctx =
List.fold_left
(fun (n,l) ctx_entry ->
match ctx_entry with
- | name, NCic.Decl t -> n+1,NCic.Rel(n)::l
- | name, NCic.Def(bo, _) -> n+1,l)
+ | _name, NCic.Decl _t -> n+1,NCic.Rel(n)::l
+ | _name, NCic.Def(_bo, _) -> n+1,l)
(k,[]) ctx in
args
List.fold_left
(fun (metasenv,subst) (i,(iattr,ctx,ty)) ->
let ikind = NCicUntrusted.kind_of_meta iattr in
- let metasenv,j,instance,ty =
+ let metasenv,_j,instance,ty =
NCicMetaSubst.mk_meta ~attrs:iattr
metasenv ctx ~with_type:ty ikind in
let s_entry = i,(iattr, ctx, instance, ty) in
*)
let metasenv = NCicUntrusted.sort_metasenv status subst metasenv in
List.fold_left
- (fun (subst,objs) (i,(iattr,ctx,ty)) ->
+ (fun (subst,objs) (i,(_iattr,ctx,ty)) ->
let ty = NCicUntrusted.apply_subst status subst ctx ty in
let ctx =
NCicUntrusted.apply_subst_context status ~fix_projections:true
subst ctx in
- let (uri,_,_,_,obj) as okind =
+ let (uri,_,_,_,_obj) as okind =
constant_for_meta status ctx ty i in
try
NCicEnvironment.check_and_add_obj status okind;
| _ -> let args =
List.map (NCicSubstitution.subst_meta status lc) args in
NCic.Appl(NCic.Rel k::args))
- | NCic.Meta (j,lc) as m ->
+ | NCic.Meta (_j,lc) as m ->
(match lc with
_,NCic.Irl _ -> m
| n,NCic.Ctx l ->
let close_wrt_metasenv status subst =
List.fold_left
- (fun ty (i,(iattr,ctx,mty)) ->
+ (fun ty (i,(_iattr,ctx,mty)) ->
let mty = NCicUntrusted.apply_subst status subst ctx mty in
let ctx =
NCicUntrusted.apply_subst_context status ~fix_projections:true
aux metasenv ty []
let smart_apply t unit_eq status g =
- let n,h,metasenv,subst,o = status#obj in
- let gname, ctx, gty = List.assoc g metasenv in
+ let n,h,metasenv,_subst,o = status#obj in
+ let _gname, ctx, gty = List.assoc g metasenv in
(* let ggty = mk_cic_term context gty in *)
let status, t = disambiguate status ctx t `XTNone in
let status,t = term_of_cic_term status t ctx in
debug_print(lazy("ritorno da fast_eq_check"));
res
with
- | NCicEnvironment.ObjectNotFound s as e ->
+ | NCicEnvironment.ObjectNotFound _s as e ->
raise (Error (lazy "eq_coerc non yet defined",Some e))
| Error _ as e -> debug_print (lazy "error"); raise e
(* FG: for now we catch TypeCheckerFailure; to be understood *)
unit_eq = unit_eq;
trace = trace}
-let only signature _context candidate = true
+let only _signature _context _candidate = true
(*
(* TASSI: nel trie ci mettiamo solo il body, non il ty *)
let candidate_ty =
let open_goals level status = stack_goals level status#stack
;;
-let try_candidate ?(smart=0) flags depth status eq_cache ctx t =
+let try_candidate ?(smart=0) _flags depth status eq_cache _ctx t =
try
- let old_og_no = List.length (open_goals (depth+1) status) in
+ (*let old_og_no = List.length (open_goals (depth+1) status) in*)
debug_print ~depth (lazy ("try " ^ (string_of_int smart) ^ " : "
^ (NotationPp.pp_term status) t));
let status =
debug_print ~depth (lazy "strange application"); None)
else
*) (incr candidate_no; Some ((!candidate_no,t),status))
- with Error (msg,exn) -> debug_print ~depth (lazy "failed"); None
+ with Error _ -> debug_print ~depth (lazy "failed"); None
;;
let sort_of status subst metasenv ctx t =
s = "cic:/matita/basics/logic/eq_f2.con" ||
s = "cic:/matita/basics/logic/eq_f.con"
-let get_candidates ?(smart=true) ~pfailed depth flags status cache signature gty =
+let get_candidates ?(smart=true) ~pfailed depth flags status cache _signature gty =
let universe = status#auto_cache in
let _,_,metasenv,subst,_ = status#obj in
let context = ctx_of gty in
let _, raw_gty = term_of_cic_term status gty context in
- let is_prod, is_eq =
+ let is_prod, _is_eq =
let status, t = term_of_cic_term status gty context in
let t = NCicReduction.whd status subst context t in
match t with
flags status tcache signature gty
in
let sm = if is_eq || is_prod then 0 else 2 in
- let sm1 = if flags.last then 2 else 0 in
+ (*let sm1 = if flags.last then 2 else 0 in *)
let maxd = (depth + 1 = flags.maxdepth) in
let try_candidates only_one sm acc candidates =
List.fold_left
let intro ~depth status facts name =
let status = NTactics.intro_tac name status in
- let _, ctx, ngty = current_goal status in
+ let _, ctx, _ngty = current_goal status in
let t = mk_cic_term ctx (NCic.Rel 1) in
let status, keys = keys_of_term status t in
let facts = List.fold_left (add_to_th t) facts keys in
List.for_all (fun i -> IntSet.mem i others)
(HExtlib.filter_map is_open g)
-let top_cache ~depth top status ?(use_given_only=false) cache =
+let top_cache ~depth:_ top status ?(use_given_only=false) cache =
if top then
let unit_eq = index_local_equations status#eq_cache status ~flag:use_given_only in
{cache with unit_eq = unit_eq}
and
(* BRAND NEW VERSION *)
-auto_main flags signature cache depth status ?(use_given_only=false): unit=
+auto_main flags signature cache depth ?(use_given_only=false) status: unit=
debug_print ~depth (lazy "entering auto main");
debug_print ~depth (pptrace status cache.trace);
debug_print ~depth (lazy ("stack length = " ^
match goals with
| [] when depth = 0 -> raise (Proved (status,cache.trace))
| [] ->
- let status = NTactics.merge_tac status in
- let cache =
- let l,tree = cache.under_inspection in
- match l with
- | [] -> cache (* possible because of intros that cleans the cache *)
- | a::tl -> let tree = rm_from_th a tree a in
- {cache with under_inspection = tl,tree}
- in
- auto_clusters flags signature cache (depth-1) status ~use_given_only
- | orig::_ ->
- if depth > 0 && move_to_side depth status
- then
- let status = NTactics.merge_tac status in
- let cache =
- let l,tree = cache.under_inspection in
- match l with
- | [] -> cache (* possible because of intros that cleans the cache*)
- | a::tl -> let tree = rm_from_th a tree a in
- {cache with under_inspection = tl,tree}
- in
- auto_clusters flags signature cache (depth-1) status ~use_given_only
- else
+ let status = NTactics.merge_tac status in
+ let cache =
+ let l,tree = cache.under_inspection in
+ match l with
+ | [] -> cache (* possible because of intros that cleans the cache *)
+ | a::tl -> let tree = rm_from_th a tree a in
+ {cache with under_inspection = tl,tree}
+ in
+ auto_clusters flags signature cache (depth-1) status ~use_given_only
+ | _orig::_ ->
+ if depth > 0 && move_to_side depth status
+ then
+ let status = NTactics.merge_tac status in
+ let cache =
+ let l,tree = cache.under_inspection in
+ match l with
+ | [] -> cache (* possible because of intros that cleans the cache*)
+ | a::tl -> let tree = rm_from_th a tree a in
+ {cache with under_inspection = tl,tree}
+ in
+ auto_clusters flags signature cache (depth-1) status ~use_given_only
+ else
let ng = List.length goals in
(* moved inside auto_clusters *)
if ng > flags.maxwidth then begin
Ast.Ident("rewrite_r",None); Ast.Ident("rewrite_l",None)
])
-let auto_lowtac ~params:(univ,flags as params) status goal =
+let auto_lowtac ~params:(univ,flags) status goal =
let gty = get_goalty status goal in
let ctx = ctx_of gty in
let candidates = candidates_from_ctx univ ctx status in
+helm_registry.cmo : \
+ helm_registry.cmi
+helm_registry.cmx : \
+ helm_registry.cmi
helm_registry.cmi :
-helm_registry.cmo : helm_registry.cmi
-helm_registry.cmx : helm_registry.cmi
+helm_registry.cmx : \
+ helm_registry.cmi
helm_registry.cmi :
-helm_registry.cmo : helm_registry.cmi
-helm_registry.cmx : helm_registry.cmi
String.sub s 0 prefix_len = prefix
with Invalid_argument _ -> false
-let hashtbl_keys tbl = Hashtbl.fold (fun k _ acc -> k :: acc) tbl []
+(*let hashtbl_keys tbl = Hashtbl.fold (fun k _ acc -> k :: acc) tbl []*)
let hashtbl_pairs tbl = Hashtbl.fold (fun k v acc -> (k,v) :: acc) tbl []
(** </helpers> *)
let interpolated_key_rex = Str.regexp ("\\$(" ^ valid_key_rex_raw ^ ")")
let dot_rex = Str.regexp "\\."
let spaces_rex = Str.regexp "[ \t\n\r]+"
-let heading_spaces_rex = Str.regexp "^[ \t\n\r]+"
+(*let heading_spaces_rex = Str.regexp "^[ \t\n\r]+"*)
let margin_blanks_rex =
Str.regexp "^\\([ \t\n\r]*\\)\\([^ \t\n\r]*\\)\\([ \t\n\r]*\\)$"
let strip_blanks s = Str.global_replace margin_blanks_rex "\\2" s
-let split s =
+(*let split s =
(* trailing blanks are removed per default by split *)
- Str.split spaces_rex (Str.global_replace heading_spaces_rex "" s)
-let merge l = String.concat " " l
+ Str.split spaces_rex (Str.global_replace heading_spaces_rex "" s)*)
+(*let merge l = String.concat " " l*)
let handle_type_error f x =
try f x with exn -> raise (Type_error (Printexc.to_string exn))
| _ -> raise (Type_error "not a quad")
(* escapes for xml configuration file *)
-let (escape, unescape) =
+(*let (escape, unescape) =
let (in_enc, out_enc) = (`Enc_utf8, `Enc_utf8) in
(Netencoding.Html.encode ~in_enc ~out_enc (),
- Netencoding.Html.decode ~in_enc ~out_enc ~entity_base:`Xml ())
+ Netencoding.Html.decode ~in_enc ~out_enc ~entity_base:`Xml ())*)
let key_is_valid key =
if not (Str.string_match valid_key_rex key 0) then
let unset registry = Hashtbl.remove registry
-let env_var_of_key s = String.uppercase (Str.global_replace dot_rex "_" s)
+let env_var_of_key s = String.uppercase_ascii (Str.global_replace dot_rex "_" s)
let singleton = function
| [] ->
+utf8Macro.cmx : \
+ utf8MacroTable.cmx \
+ utf8Macro.cmi
utf8Macro.cmi :
-utf8MacroTable.cmo :
utf8MacroTable.cmx :
-utf8Macro.cmo : utf8MacroTable.cmx utf8Macro.cmi
-utf8Macro.cmx : utf8MacroTable.cmx utf8Macro.cmi
-threadSafe.cmi :
+extThread.cmo : \
+ extThread.cmi
+extThread.cmx : \
+ extThread.cmi
extThread.cmi :
-threadSafe.cmo : threadSafe.cmi
-threadSafe.cmx : threadSafe.cmi
-extThread.cmo : extThread.cmi
-extThread.cmx : extThread.cmi
+threadSafe.cmo : \
+ threadSafe.cmi
+threadSafe.cmx : \
+ threadSafe.cmi
+threadSafe.cmi :
-threadSafe.cmi :
+extThread.cmx : \
+ extThread.cmi
extThread.cmi :
-threadSafe.cmo : threadSafe.cmi
-threadSafe.cmx : threadSafe.cmi
-extThread.cmo : extThread.cmi
-extThread.cmx : extThread.cmi
+threadSafe.cmx : \
+ threadSafe.cmi
+threadSafe.cmi :
+xml.cmo : \
+ xml.cmi
+xml.cmx : \
+ xml.cmi
xml.cmi :
+xmlPushParser.cmo : \
+ xmlPushParser.cmi
+xmlPushParser.cmx : \
+ xmlPushParser.cmi
xmlPushParser.cmi :
-xml.cmo : xml.cmi
-xml.cmx : xml.cmi
-xmlPushParser.cmo : xmlPushParser.cmi
-xmlPushParser.cmx : xmlPushParser.cmi
+xml.cmx : \
+ xml.cmi
xml.cmi :
+xmlPushParser.cmx : \
+ xmlPushParser.cmi
xmlPushParser.cmi :
-xml.cmo : xml.cmi
-xml.cmx : xml.cmi
-xmlPushParser.cmo : xmlPushParser.cmi
-xmlPushParser.cmx : xmlPushParser.cmi
pp_r m s
| [< >] -> ()
and print_spaces m =
- for i = 1 to m do f " " done
+ for _i = 1 to m do f " " done
in
pp_r 0 strm
;;
;;
let pp_to_gzipchan strm oc =
- pp_gen (fun s -> Gzip.output oc s 0 (String.length s)) strm
+ pp_gen (fun s -> Gzip.output oc (Bytes.of_string s) 0 (String.length s)) strm
;;
(** pretty printer to string *)
aux (`Channel ic);
close_in ic
| `Gzip_channel ic ->
- let buf = String.create gzip_bufsize in
+ let buf = Bytes.create gzip_bufsize in
(try
while true do
let bytes = Gzip.input ic buf 0 gzip_bufsize in
if bytes = 0 then raise End_of_file;
- parse_fun (String.sub buf 0 bytes)
+ parse_fun (Bytes.to_string (Bytes.sub buf 0 bytes))
done
with End_of_file -> final expat_parser)
| `Gzip_file fname ->
DEBUG_DEFAULT="true"
DEFAULT_DBHOST="mysql://mowgli.cs.unibo.it"
RT_BASE_DIR_DEFAULT="`pwd`/matita"
-MATITA_VERSION="0.99.3"
+MATITA_VERSION="0.99.4"
DISTRIBUTED="yes" # "yes" for distributed tarballs
# End of distribution settings
else
AC_MSG_ERROR(could not find ocamlfind)
fi
-AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc2, yes, no)
+AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc3, yes, no)
if test $HAVE_LABLGLADECC = "yes"; then
- LABLGLADECC="lablgladecc2"
+ LABLGLADECC="lablgladecc3"
else
- AC_MSG_ERROR(could not find lablgladecc2)
+ AC_MSG_ERROR(could not find lablgladecc3)
fi
AC_CHECK_PROG(HAVE_CAMLP5O, camlp5o, yes, no)
if test $HAVE_CAMLP5O = "yes"; then
# look for METAS dir
LIBSPATH="`pwd`/components"
-OCAMLPATH="$LIBSPATH/METAS"
+OCAMLPATHL="$LIBSPATH/METAS"
+OCAMLPATH="$OCAMLPATHL:$OCAMLPATH"
# creating META.*
echo -n "creating METAs ... "
-for f in $OCAMLPATH/meta.*.src; do
+for f in $OCAMLPATHL/meta.*.src; do
basename=`basename $f`
metaname=`echo $basename | sed 's/meta\.\(.*\)\.src/\1/'`
dirname=`echo $metaname | sed 's/^helm-//'`
- metafile="$OCAMLPATH/META.$metaname"
+ metafile="$OCAMLPATHL/META.$metaname"
cp $f $metafile
echo "directory=\"$LIBSPATH/$dirname\"" >> $metafile
done
# (libs) findlib requisites
+#gdome2 \
+#mysql \
FINDLIB_LIBSREQUIRES="\
expat \
-gdome2 \
http \
-lablgtk2 \
-lablgtk2.sourceview2 \
-mysql \
+pcre \
+str \
+unix \
+lablgtk3 \
+lablgtk3-sourceview3 \
netstring \
-ulex08 \
+ulex-camlp5 \
zip \
"
# (Matita) findlib requisites
+#lablgtk3.glade \
FINDLIB_COMREQUIRES="\
helm-disambiguation \
helm-grafite \
"
FINDLIB_REQUIRES="\
$FINDLIB_CREQUIRES \
-lablgtk2.glade \
-lablgtk2.sourceview2 \
+lablgtk3-sourceview3 \
"
+
for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES
do
AC_MSG_CHECKING(for $r ocaml library)
lablGraphviz.cmx : lablGraphviz.cmi
lablGraphviz.cmi :
matita.cmo : predefined_virtuals.cmi matitaScript.cmi matitaMisc.cmi \
- matitaInit.cmi matitaGui.cmi matitaGtkMisc.cmi buildTimeConf.cmo \
- applyTransformation.cmi
+ matitaInit.cmi matitaGui.cmi buildTimeConf.cmo applyTransformation.cmi
matita.cmx : predefined_virtuals.cmx matitaScript.cmx matitaMisc.cmx \
- matitaInit.cmx matitaGui.cmx matitaGtkMisc.cmx buildTimeConf.cmx \
- applyTransformation.cmx
+ matitaInit.cmx matitaGui.cmx buildTimeConf.cmx applyTransformation.cmx
matitaEngine.cmo : applyTransformation.cmi matitaEngine.cmi
matitaEngine.cmx : applyTransformation.cmx matitaEngine.cmi
matitaEngine.cmi : applyTransformation.cmi
matitaExcPp.cmi :
matitaGeneratedGui.cmo :
matitaGeneratedGui.cmx :
-matitaGtkMisc.cmo : matitaTypes.cmi matitaGeneratedGui.cmo buildTimeConf.cmo \
+matitaGtkMisc.cmo : matitaGeneratedGui.cmo buildTimeConf.cmo \
matitaGtkMisc.cmi
-matitaGtkMisc.cmx : matitaTypes.cmx matitaGeneratedGui.cmx buildTimeConf.cmx \
+matitaGtkMisc.cmx : matitaGeneratedGui.cmx buildTimeConf.cmx \
matitaGtkMisc.cmi
matitaGtkMisc.cmi : matitaGeneratedGui.cmo
matitaGui.cmo : matitaTypes.cmi matitaScript.cmi matitaMisc.cmi \
matitaMathView.cmx matitaGuiTypes.cmi matitaGtkMisc.cmx \
matitaGeneratedGui.cmx matitaExcPp.cmx buildTimeConf.cmx matitaGui.cmi
matitaGui.cmi : matitaGuiTypes.cmi
+matitaGuiInit.cmo :
+matitaGuiInit.cmx :
matitaGuiTypes.cmi : matitaGeneratedGui.cmo applyTransformation.cmi
matitaInit.cmo : matitaExcPp.cmi buildTimeConf.cmo matitaInit.cmi
matitaInit.cmx : matitaExcPp.cmx buildTimeConf.cmx matitaInit.cmi
matitaMisc.cmx \
matitaInit.cmx \
matitaGui.cmx \
- matitaGtkMisc.cmx \
buildTimeConf.cmx \
applyTransformation.cmx
matitaEngine.cmx : \
matitaExcPp.cmi :
matitaGeneratedGui.cmx :
matitaGtkMisc.cmx : \
- matitaTypes.cmx \
matitaGeneratedGui.cmx \
buildTimeConf.cmx \
matitaGtkMisc.cmi
matitaGui.cmi
matitaGui.cmi : \
matitaGuiTypes.cmi
+matitaGuiInit.cmx :
matitaGuiTypes.cmi : \
matitaGeneratedGui.cmx \
applyTransformation.cmi
ANNOTOPTION =
endif
-OCAML_FLAGS = -pp $(CAMLP5O) -rectypes $(ANNOTOPTION)
+OCAML_FLAGS = -pp $(CAMLP5O) -rectypes $(ANNOTOPTION) -w @A-52-4-34-37-45-9-44-48-6-32-20-58-7
OCAMLDEP_FLAGS = -pp $(CAMLP5O)
PKGS = -package "$(MATITA_REQUIRES)"
CPKGS = -package "$(MATITA_CREQUIRES)"
matitaclean.mli \
$(NULL)
# objects for matita (GTK GUI)
-ML = buildTimeConf.ml matitaGeneratedGui.ml $(MLI:%.mli=%.ml)
+ML = buildTimeConf.ml matitaGuiInit.ml matitaGeneratedGui.ml $(MLI:%.mli=%.ml)
# objects for matitac (batch compiler)
CML = buildTimeConf.ml $(CMLI:%.mli=%.ml)
MAINCML = $(MAINCMLI:%.mli=%.ml)
matitaclean.opt: matitac.opt
$(H)test -f $@ || ln -s $< $@
-matitaGeneratedGui.ml: matita.glade.utf8
+matitaGeneratedGui.ml: matita.ui
$(H)$(LABLGLADECC) -embed $< > matitaGeneratedGui.ml
-matita.glade.utf8: matita.glade
- $(H)xmllint --encode UTF8 $< > $@
.PHONY: clean
clean:
.PHONY: distclean
distclean: clean
$(H)$(MAKE) -C dist/ clean
- $(H)rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli
$(H)rm -f buildTimeConf.ml
$(H)rm -f matita.glade.bak matita.gladep.bak
$(H)rm -f matita.conf.xml.sample
# {{{ Distribution stuff
-dist_pre: matitaGeneratedGui.ml
+dist_pre:
$(MAKE) -C dist/ dist_pre
WHERE = $(DESTDIR)/$(RT_BASE_DIR)
Content2pres.ncontext2pres
((new NCicPp.status)#ppcontext ~metasenv ~subst)
-let ntxt_of_cic_subst ~map_unicode_to_tex size status ~metasenv ?use_subst subst =
+let ntxt_of_cic_subst ~map_unicode_to_tex:_ _size _status ~metasenv ?use_subst subst =
[],
"<<<high level printer for subst not implemented; low-level printing:>>>\n" ^
(new NCicPp.status)#ppsubst ~metasenv ?use_subst subst
object(self)
inherit Interpretations.status
inherit TermContentPres.status
- method ppterm ~context ~subst ~metasenv ?margin ?inside_fix t =
+ method ppterm ~context ~subst ~metasenv ?margin:(_) ?inside_fix:(_) t =
snd (ntxt_of_cic_term ~map_unicode_to_tex:false 80 self ~metasenv ~subst
~context t)
- method ppcontext ?sep ~subst ~metasenv context =
+ method ppcontext ?sep:(_) ~subst ~metasenv context =
snd (ntxt_of_cic_context ~map_unicode_to_tex:false 80 self ~metasenv ~subst
context)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basics/lists/list.ma".
+
+axiom alpha : Type[0].
+notation "𝔸" non associative with precedence 90 for @{'alphabet}.
+interpretation "set of names" 'alphabet = alpha.
+
+inductive tp : Type[0] ≝
+| top : tp
+| arr : tp → tp → tp.
+inductive tm : Type[0] ≝
+| var : nat → tm
+| par : 𝔸 → tm
+| abs : tp → tm → tm
+| app : tm → tm → tm.
+
+let rec Nth T n (l:list T) on n ≝
+ match l with
+ [ nil ⇒ None ?
+ | cons hd tl ⇒ match n with
+ [ O ⇒ Some ? hd
+ | S n0 ⇒ Nth T n0 tl ] ].
+
+inductive judg : list tp → tm → tp → Prop ≝
+| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t
+| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u
+| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u).
+
+definition Env := list (𝔸 × tp).
+
+axiom vclose_env : Env → list tp.
+axiom vclose_tm : Env → tm → tm.
+axiom Lam : 𝔸 → tp → tm → tm.
+definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T.
+definition dom ≝ λG:Env.map ?? (fst ??) G.
+
+definition sctx ≝ 𝔸 × tm.
+axiom swap_tm : 𝔸 → 𝔸 → tm → tm.
+definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M.
+
+axiom in_list : ∀A:Type[0].A → list A → Prop.
+interpretation "list membership" 'mem x l = (in_list ? x l).
+interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)).
+
+axiom in_Env : 𝔸 × tp → Env → Prop.
+notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
+interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
+
+let rec FV M ≝ match M with
+ [ par X ⇒ [X]
+ | app M1 M2 ⇒ FV M1@FV M2
+ | abs T M0 ⇒ FV M0
+ | _ ⇒ [ ] ].
+
+(* axiom Lookup : 𝔸 → Env → option tp. *)
+
+(* forma alto livello del judgment
+ t_abs* : ∀G,T,X,M,U.
+ (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) →
+ Judg G (Lam X T (M[X])) (arr T U) *)
+
+(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *)
+
+axiom Judg_ind : ∀P:Env → tm → tp → Prop.
+ (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) →
+ (∀G,M,N,T,U.
+ Judg G M (arr T U) → Judg G N T →
+ P G M (arr T U) → P G N T → P G (app M N) U) →
+ (∀G,T1,T2,X,M1.
+ (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
+ (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
+ P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) →
+ ∀G,M,T.Judg G M T → P G M T.
+
+axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T.
+axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U.
+axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U).
+
+definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2.
+interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2).
+
+axiom daemon : ∀P:Prop.P.
+
+theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T.
+#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?)
+@(Judg_ind … HJ)
+[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub //
+| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2
+ [| @IH1 // | @IH2 // ]
+| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH
+ [ (* trivial property of Lam *) @daemon
+ | (* trivial property of subenv *) @daemon ]
+]
+qed.
+
+(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e
+ ricorsione *)
\ No newline at end of file
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "binding/names.ma".
+
+(* permutations *)
+definition finite_perm : ∀X:Nset.(X → X) → Prop ≝
+ λX,f.injective X X f ∧ surjective X X f ∧ ∃l.∀x.x ∉ l → f x = x.
+
+(* maps a permutation to a list of parameters *)
+definition Pi_list : ∀X:Nset.(X → X) → list X → list X ≝
+ λX,p,xl.map ?? (λx.p x) xl.
+
+interpretation "permutation of X list" 'middot p x = (Pi_list p x).
+
+definition swap : ∀N:Nset.N → N → N → N ≝
+ λN,u,v,x.match (x == u) with
+ [true ⇒ v
+ |false ⇒ match (x == v) with
+ [true ⇒ u
+ |false ⇒ x]].
+
+axiom swap_right : ∀N,x,y.swap N x y y = x.
+(*
+#N x y;nnormalize;nrewrite > (p_eqb3 ? y y …);//;
+nlapply (refl ? (y ≟ x));ncases (y ≟ x) in ⊢ (???% → %);nnormalize;//;
+#H1;napply p_eqb1;//;
+nqed.
+*)
+
+axiom swap_left : ∀N,x,y.swap N x y x = y.
+(*
+#N x y;nnormalize;nrewrite > (p_eqb3 ? x x …);//;
+nqed.
+*)
+
+axiom swap_other : ∀N,x,y,z.x ≠ z → y ≠ z → swap N x y z = z.
+(*
+#N x y z H1 H2;nnormalize;nrewrite > (p_eqb4 …);
+##[nrewrite > (p_eqb4 …);//;@;ncases H2;/2/;
+##|@;ncases H1;/2/
+##]
+nqed.
+*)
+
+axiom swap_inv : ∀N,x,y,z.swap N x y (swap N x y z) = z.
+(*
+#N x y z;nlapply (refl ? (x ≟ z));ncases (x ≟ z) in ⊢ (???% → ?);#H1
+##[nrewrite > (p_eqb1 … H1);nrewrite > (swap_left …);//;
+##|nlapply (refl ? (y ≟ z));ncases (y ≟ z) in ⊢ (???% → ?);#H2
+ ##[nrewrite > (p_eqb1 … H2);nrewrite > (swap_right …);//;
+ ##|nrewrite > (swap_other …) in ⊢ (??(????%)?);/2/;
+ nrewrite > (swap_other …);/2/;
+ ##]
+##]
+nqed.
+*)
+
+axiom swap_fp : ∀N,x1,x2.finite_perm ? (swap N x1 x2).
+(*
+#N x1 x2;@
+##[@
+ ##[nwhd;#xa xb;nnormalize;nlapply (refl ? (xa ≟ x1));
+ ncases (xa ≟ x1) in ⊢ (???% → %);#H1
+ ##[nrewrite > (p_eqb1 … H1);nlapply (refl ? (xb ≟ x1));
+ ncases (xb ≟ x1) in ⊢ (???% → %);#H2
+ ##[nrewrite > (p_eqb1 … H2);//
+ ##|nlapply (refl ? (xb ≟ x2));
+ ncases (xb ≟ x2) in ⊢ (???% → %);#H3
+ ##[nnormalize;#H4;nrewrite > H4 in H3;
+ #H3;nrewrite > H3 in H2;#H2;ndestruct (H2)
+ ##|nnormalize;#H4;nrewrite > H4 in H3;
+ nrewrite > (p_eqb3 …);//;#H5;ndestruct (H5)
+ ##]
+ ##]
+ ##|nlapply (refl ? (xa ≟ x2));
+ ncases (xa ≟ x2) in ⊢ (???% → %);#H2
+ ##[nrewrite > (p_eqb1 … H2);nlapply (refl ? (xb ≟ x1));
+ ncases (xb ≟ x1) in ⊢ (???% → %);#H3
+ ##[nnormalize;#H4;nrewrite > H4 in H3;
+ #H3;nrewrite > (p_eqb1 … H3);@
+ ##|nnormalize;nlapply (refl ? (xb ≟ x2));
+ ncases (xb ≟ x2) in ⊢ (???% → %);#H4
+ ##[nrewrite > (p_eqb1 … H4);//
+ ##|nnormalize;#H5;nrewrite > H5 in H3;
+ nrewrite > (p_eqb3 …);//;#H6;ndestruct (H6);
+ ##]
+ ##]
+ ##|nnormalize;nlapply (refl ? (xb ≟ x1));
+ ncases (xb ≟ x1) in ⊢ (???% → %);#H3
+ ##[nnormalize;#H4;nrewrite > H4 in H2;nrewrite > (p_eqb3 …);//;
+ #H5;ndestruct (H5)
+ ##|nlapply (refl ? (xb ≟ x2));
+ ncases (xb ≟ x2) in ⊢ (???% → %);#H4
+ ##[nnormalize;#H5;nrewrite > H5 in H1;nrewrite > (p_eqb3 …);//;
+ #H6;ndestruct (H6)
+ ##|nnormalize;//
+ ##]
+ ##]
+ ##]
+ ##]
+ ##|nwhd;#z;nnormalize;nlapply (refl ? (z ≟ x1));
+ ncases (z ≟ x1) in ⊢ (???% → %);#H1
+ ##[nlapply (refl ? (z ≟ x2));
+ ncases (z ≟ x2) in ⊢ (???% → %);#H2
+ ##[@ z;nrewrite > H1;nrewrite > H2;napply p_eqb1;//
+ ##|@ x2;nrewrite > (p_eqb4 …);
+ ##[nrewrite > (p_eqb3 …);//;
+ nnormalize;napply p_eqb1;//
+ ##|nrewrite < (p_eqb1 … H1);@;#H3;nrewrite > H3 in H2;
+ nrewrite > (p_eqb3 …);//;#H2;ndestruct (H2)
+ ##]
+ ##]
+ ##|nlapply (refl ? (z ≟ x2));
+ ncases (z ≟ x2) in ⊢ (???% → %);#H2
+ ##[@ x1;nrewrite > (p_eqb3 …);//;
+ napply p_eqb1;nnormalize;//
+ ##|@ z;nrewrite > H1;nrewrite > H2;@;
+ ##]
+ ##]
+ ##]
+##|@ [x1;x2];#x0 H1;nrewrite > (swap_other …)
+ ##[@
+ ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;/2/;
+ ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;//;
+ ##]
+##]
+nqed.
+*)
+
+axiom inj_swap : ∀N,u,v.injective ?? (swap N u v).
+(*
+#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//;
+nqed.
+*)
+
+axiom surj_swap : ∀N,u,v.surjective ?? (swap N u v).
+(*
+#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//;
+nqed.
+*)
+
+axiom finite_swap : ∀N,u,v.∃l.∀x.x ∉ l → swap N u v x = x.
+(*
+#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//;
+nqed.
+*)
+
+(* swaps two lists of parameters
+definition Pi_swap_list : ∀xl,xl':list X.X → X ≝
+ λxl,xl',x.foldr2 ??? (λu,v,r.swap ? u v r) x xl xl'.
+
+nlemma fp_swap_list :
+ ∀xl,xl'.finite_perm ? (Pi_swap_list xl xl').
+#xl xl';@
+##[@;
+ ##[ngeneralize in match xl';nelim xl
+ ##[nnormalize;//;
+ ##|#x0 xl0;#IH xl'';nelim xl''
+ ##[nnormalize;//
+ ##|#x1 xl1 IH1 y0 y1;nchange in ⊢ (??%% → ?) with (swap ????);
+ #H1;nlapply (inj_swap … H1);#H2;
+ nlapply (IH … H2);//
+ ##]
+ ##]
+ ##|ngeneralize in match xl';nelim xl
+ ##[nnormalize;#_;#z;@z;@
+ ##|#x' xl0 IH xl'';nelim xl''
+ ##[nnormalize;#z;@z;@
+ ##|#x1 xl1 IH1 z;
+ nchange in ⊢ (??(λ_.???%)) with (swap ????);
+ ncases (surj_swap X x' x1 z);#x2 H1;
+ ncases (IH xl1 x2);#x3 H2;@ x3;
+ nrewrite < H2;napply H1
+ ##]
+ ##]
+ ##]
+##|ngeneralize in match xl';nelim xl
+ ##[#;@ [];#;@
+ ##|#x0 xl0 IH xl'';ncases xl''
+ ##[@ [];#;@
+ ##|#x1 xl1;ncases (IH xl1);#xl2 H1;
+ ncases (finite_swap X x0 x1);#xl3 H2;
+ @ (xl2@xl3);#x2 H3;
+ nchange in ⊢ (??%?) with (swap ????);
+ nrewrite > (H1 …);
+ ##[nrewrite > (H2 …);//;@;#H4;ncases H3;#H5;napply H5;
+ napply in_list_to_in_list_append_r;//
+ ##|@;#H4;ncases H3;#H5;napply H5;
+ napply in_list_to_in_list_append_l;//
+ ##]
+ ##]
+ ##]
+##]
+nqed.
+
+(* the 'reverse' swap of lists of parameters
+ composing Pi_swap_list and Pi_swap_list_r yields the identity function
+ (see the Pi_swap_list_inv lemma) *)
+ndefinition Pi_swap_list_r : ∀xl,xl':list X. Pi ≝
+ λxl,xl',x.foldl2 ??? (λr,u,v.swap ? u v r ) x xl xl'.
+
+nlemma fp_swap_list_r :
+ ∀xl,xl'.finite_perm ? (Pi_swap_list_r xl xl').
+#xl xl';@
+##[@;
+ ##[ngeneralize in match xl';nelim xl
+ ##[nnormalize;//;
+ ##|#x0 xl0;#IH xl'';nelim xl''
+ ##[nnormalize;//
+ ##|#x1 xl1 IH1 y0 y1;nwhd in ⊢ (??%% → ?);
+ #H1;nlapply (IH … H1);#H2;
+ napply (inj_swap … H2);
+ ##]
+ ##]
+ ##|ngeneralize in match xl';nelim xl
+ ##[nnormalize;#_;#z;@z;@
+ ##|#x' xl0 IH xl'';nelim xl''
+ ##[nnormalize;#z;@z;@
+ ##|#x1 xl1 IH1 z;nwhd in ⊢ (??(λ_.???%));
+ ncases (IH xl1 z);#x2 H1;
+ ncases (surj_swap X x' x1 x2);#x3 H2;
+ @ x3;nrewrite < H2;napply H1;
+ ##]
+ ##]
+ ##]
+##|ngeneralize in match xl';nelim xl
+ ##[#;@ [];#;@
+ ##|#x0 xl0 IH xl'';ncases xl''
+ ##[@ [];#;@
+ ##|#x1 xl1;
+ ncases (IH xl1);#xl2 H1;
+ ncases (finite_swap X x0 x1);#xl3 H2;
+ @ (xl2@xl3);#x2 H3;nwhd in ⊢ (??%?);
+ nrewrite > (H2 …);
+ ##[nrewrite > (H1 …);//;@;#H4;ncases H3;#H5;napply H5;
+ napply in_list_to_in_list_append_l;//
+ ##|@;#H4;ncases H3;#H5;napply H5;
+ napply in_list_to_in_list_append_r;//
+ ##]
+ ##]
+ ##]
+##]
+nqed.
+
+nlemma Pi_swap_list_inv :
+ ∀xl1,xl2,x.
+ Pi_swap_list xl1 xl2 (Pi_swap_list_r xl1 xl2 x) = x.
+#xl;nelim xl
+##[#;@
+##|#x1 xl1 IH xl';ncases xl'
+ ##[#;@
+ ##|#x2 xl2;#x;
+ nchange in ⊢ (??%?) with
+ (swap ??? (Pi_swap_list ??
+ (Pi_swap_list_r ?? (swap ????))));
+ nrewrite > (IH xl2 ?);napply swap_inv;
+ ##]
+##]
+nqed.
+
+nlemma Pi_swap_list_fresh :
+ ∀x,xl1,xl2.x ∉ xl1 → x ∉ xl2 → Pi_swap_list xl1 xl2 x = x.
+#x xl1;nelim xl1
+##[#;@
+##|#x3 xl3 IH xl2' H1;ncases xl2'
+ ##[#;@
+ ##|#x4 xl4 H2;ncut (x ∉ xl3 ∧ x ∉ xl4);
+ ##[@
+ ##[@;#H3;ncases H1;#H4;napply H4;/2/;
+ ##|@;#H3;ncases H2;#H4;napply H4;/2/
+ ##]
+ ##] *; #H1' H2';
+ nchange in ⊢ (??%?) with (swap ????);
+ nrewrite > (swap_other …)
+ ##[napply IH;//;
+ ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???);
+ nrewrite > (IH …);//;@;#H3;ncases H2;#H4;napply H4;//;
+ ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???);
+ nrewrite > (IH …);//;@;#H3;ncases H1;#H4;napply H4;//
+ ##]
+ ##]
+##]
+nqed.
+*)
\ No newline at end of file
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basics/lists/list.ma".
+include "basics/deqsets.ma".
+include "binding/names.ma".
+include "binding/fp.ma".
+
+axiom alpha : Nset.
+notation "𝔸" non associative with precedence 90 for @{'alphabet}.
+interpretation "set of names" 'alphabet = alpha.
+
+inductive tp : Type[0] ≝
+| top : tp
+| arr : tp → tp → tp.
+inductive pretm : Type[0] ≝
+| var : nat → pretm
+| par : 𝔸 → pretm
+| abs : tp → pretm → pretm
+| app : pretm → pretm → pretm.
+
+let rec Nth T n (l:list T) on n ≝
+ match l with
+ [ nil ⇒ None ?
+ | cons hd tl ⇒ match n with
+ [ O ⇒ Some ? hd
+ | S n0 ⇒ Nth T n0 tl ] ].
+
+let rec vclose_tm_aux u x k ≝ match u with
+ [ var n ⇒ if (leb k n) then var (S n) else u
+ | par x0 ⇒ if (x0 == x) then (var k) else u
+ | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k)
+ | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ].
+definition vclose_tm ≝ λu,x.vclose_tm_aux u x O.
+
+definition vopen_var ≝ λn,x,k.match eqb n k with
+ [ true ⇒ par x
+ | false ⇒ match leb n k with
+ [ true ⇒ var n
+ | false ⇒ var (pred n) ] ].
+
+let rec vopen_tm_aux u x k ≝ match u with
+ [ var n ⇒ vopen_var n x k
+ | par x0 ⇒ u
+ | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k)
+ | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ].
+definition vopen_tm ≝ λu,x.vopen_tm_aux u x O.
+
+let rec FV u ≝ match u with
+ [ par x ⇒ [x]
+ | app v1 v2 ⇒ FV v1@FV v2
+ | abs s v ⇒ FV v
+ | _ ⇒ [ ] ].
+
+definition lam ≝ λx,s,u.abs s (vclose_tm u x).
+
+let rec Pi_map_tm p u on u ≝ match u with
+[ par x ⇒ par (p x)
+| var _ ⇒ u
+| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2)
+| abs s v ⇒ abs s (Pi_map_tm p v) ].
+
+interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x).
+
+notation "hvbox(u⌈x⌉)"
+ with precedence 45
+ for @{ 'open $u $x }.
+
+(*
+notation "hvbox(u⌈x⌉)"
+ with precedence 45
+ for @{ 'open $u $x }.
+notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }.
+*)
+interpretation "ln term variable open" 'open u x = (vopen_tm u x).
+notation < "hvbox(ν x break . u)"
+ with precedence 20
+for @{'nu $x $u }.
+notation > "ν list1 x sep , . term 19 u" with precedence 20
+ for ${ fold right @{$u} rec acc @{'nu $x $acc)} }.
+interpretation "ln term variable close" 'nu x u = (vclose_tm u x).
+
+let rec tm_height u ≝ match u with
+[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2))
+| abs s v ⇒ S (tm_height v)
+| _ ⇒ O ].
+
+theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n.
+#n (cases n) // #a #abs cases (?:False) /2/ qed.
+
+theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0].
+(∀m.(∀p. p < m → P p) → P m) → P n.
+#n #P #H
+cut (∀q:nat. q ≤ n → P q) /2/
+(elim n)
+ [#q #HleO (* applica male *)
+ @(le_n_O_rect_Type0 ? HleO)
+ @H #p #ltpO cases (?:False) /2/ (* 3 *)
+ |#p #Hind #q #HleS
+ @H #a #lta @Hind @le_S_S_to_le /2/
+ ]
+qed.
+
+lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n.
+#n elim n
+[ #m normalize #H destruct(H)
+| #n0 #IH * // #m normalize #H @le_S_S @IH // ]
+qed.
+
+lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u.
+#x #u elim u
+[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk
+ [ >Hnk >eqb_n_n normalize >(\b ?) //
+ | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb
+ [ >Hleb normalize >(?:leb k n = false) //
+ @lt_to_leb_false @not_eq_to_le_to_lt /2/
+ | >Hleb normalize >(?:leb k (pred n) = true) normalize
+ [ cases (leb_false_to_lt … Hleb) //
+ | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ]
+| #y normalize #Hy >(\bf ?) // @(not_to_not … Hy) //
+| #s #v #IH normalize #Hv #k >IH // @Hv
+| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k
+ >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ]
+ @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ]
+qed.
+
+corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u.
+#x #u #Hu @nominal_eta_aux //
+qed.
+
+lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v.
+#v #x elim v
+[ #n #k normalize cases (eqb n k) // cases (leb n k) //
+| #u #k %
+| #s #u #IH #k normalize >IH %
+| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ]
+qed.
+
+corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v.
+#v #x @eq_height_vopen_aux
+qed.
+
+theorem pretm_ind_plus_aux :
+ ∀P:pretm → Type[0].
+ (∀x:𝔸.P (par x)) →
+ (∀n:ℕ.P (var n)) →
+ (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
+ ∀n,u.tm_height u ≤ n → P u.
+#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??)
+#m cases m
+[ #_ * /2/
+ [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/
+ | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (max ??))
+ [ #H @H @Hfalse|*:skip] ] ]
+-m #m #IH * /2/
+[ #s #v whd in ⊢ (?%?→?); #Hv
+ lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy
+ >(?:abs s v = lam y s (v⌈y⌉))
+ [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ]
+ @Hlam
+ [ @(not_to_not … Hy) @in_list_to_in_list_append_r
+ | @(not_to_not … Hy) @in_list_to_in_list_append_l ]
+ @IH [| @Hv | >eq_height_vopen % ]
+| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ
+ [ @IH [| @Hv | @le_max_1 ] | @IH [| @Hv | @le_max_2 ] ] ]
+qed.
+
+corollary pretm_ind_plus :
+ ∀P:pretm → Type[0].
+ (∀x:𝔸.P (par x)) →
+ (∀n:ℕ.P (var n)) →
+ (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
+ ∀u.P u.
+#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/
+qed.
+
+(* maps a permutation to a list of terms *)
+definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 .
+
+(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*)
+
+(*
+inductive tm : pretm → Prop ≝
+| tm_par : ∀x:𝔸.tm (par x)
+| tm_app : ∀u,v.tm u → tm v → tm (app u v)
+| tm_lam : ∀x,s,u.tm u → tm (lam x s u).
+
+inductive ctx_aux : nat → pretm → Prop ≝
+| ctx_var : ∀n,k.n < k → ctx_aux k (var n)
+| ctx_par : ∀x,k.ctx_aux k (par x)
+| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v)
+(* è sostituibile da ctx_lam ? *)
+| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u).
+*)
+
+inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝
+| toc_var : ∀n.n < k → tm_or_ctx k (var n)
+| toc_par : ∀x.tm_or_ctx k (par x)
+| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v)
+| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u).
+
+definition tm ≝ λt.tm_or_ctx O t.
+definition ctx ≝ λt.tm_or_ctx 1 t.
+
+definition check_tm ≝ λu,k.
+ pretm_ind_plus ?
+ (λ_.true)
+ (λn.leb (S n) k)
+ (λv1,v2,rv1,rv2.rv1 ∧ rv2)
+ [] (λx,s,v,px,pC,rv.rv)
+ u.
+
+axiom pretm_ind_plus_app : ∀P,u,v,C,H1,H2,H3,H4.
+ pretm_ind_plus P H1 H2 H3 C H4 (app u v) =
+ H3 u v (pretm_ind_plus P H1 H2 H3 C H4 u) (pretm_ind_plus P H1 H2 H3 C H4 v).
+
+axiom pretm_ind_plus_lam : ∀P,x,s,u,C,px,pC,H1,H2,H3,H4.
+ pretm_ind_plus P H1 H2 H3 C H4 (lam x s (u⌈x⌉)) =
+ H4 x s u px pC (pretm_ind_plus P H1 H2 H3 C H4 (u⌈x⌉)).
+
+record TM : Type[0] ≝ {
+ pretm_of_TM :> pretm;
+ tm_of_TM : check_tm pretm_of_TM O = true
+}.
+
+record CTX : Type[0] ≝ {
+ pretm_of_CTX :> pretm;
+ ctx_of_CTX : check_tm pretm_of_CTX 1 = true
+}.
+
+inductive tm2 : pretm → Type[0] ≝
+| tm_par : ∀x.tm2 (par x)
+| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v)
+| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)).
+
+(*
+inductive tm' : pretm → Prop ≝
+| tm_par : ∀x.tm' (par x)
+| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v)
+| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)).
+*)
+
+lemma pi_vclose_tm :
+ ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u).
+#z1 #z2 #x #u
+change with (vclose_tm_aux ???) in match (vclose_tm ??);
+change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u normalize //
+[ #n #k cases (leb k n) normalize %
+| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 normalize
+ [ cases (true_or_false (x0==x)) #H2 >H2 normalize
+ [ <(\P H2) >H1 normalize >(\b (refl ? z2)) %
+ | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize
+ [ >(\P H3) in H2; >H1 #Hfalse destruct (Hfalse)
+ | cases (true_or_false (x==z2)) #H4 >H4 normalize
+ [ cases (true_or_false (z2==z1)) #H5 >H5 normalize //
+ >(\P H5) in H4; >H3 #Hfalse destruct (Hfalse)
+ | >(\bf ?) // @sym_not_eq @(\Pf H4) ]
+ ]
+ ]
+ | cases (true_or_false (x0==x)) #H2 >H2 normalize
+ [ <(\P H2) >H1 normalize >(\b (refl ??)) %
+ | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize
+ [ cases (true_or_false (x0==z2)) #H4 >H4 normalize
+ [ cases (true_or_false (z1==z2)) #H5 >H5 normalize //
+ <(\P H5) in H4; <(\P H3) >H2 #Hfalse destruct (Hfalse)
+ | >H4 % ]
+ | cases (true_or_false (x0==z2)) #H4 >H4 normalize
+ [ cases (true_or_false (x==z2)) #H5 >H5 normalize
+ [ <(\P H5) in H4; >H2 #Hfalse destruct (Hfalse)
+ | >(\bf ?) // @sym_not_eq @(\Pf H3) ]
+ | cases (true_or_false (x==z2)) #H5 >H5 normalize
+ [ >H1 %
+ | >H2 % ]
+ ]
+ ]
+ ]
+ ]
+]
+qed.
+
+lemma pi_vopen_tm :
+ ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉).
+#z1 #z2 #x #u
+change with (vopen_tm_aux ???) in match (vopen_tm ??);
+change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u normalize //
+#n #k cases (true_or_false (eqb n k)) #H1 >H1 normalize //
+cases (true_or_false (leb n k)) #H2 >H2 normalize //
+qed.
+
+lemma pi_lam :
+ ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u).
+#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) %
+qed.
+
+lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u).
+#z1 #z2 #u elim u //
+[ #s #v normalize //
+| #v1 #v2 normalize /2/ ]
+qed.
+
+lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u.
+#z1 #z2 #u elim u [1,3,4:normalize //]
+#x whd in ⊢ (??%?); >swap_inv %
+qed.
+
+lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l.
+#x #l #z1 #z2 #Hin elim Hin
+[ #x0 #l0 %
+| #x1 #x2 #l0 #Hin #IH %2 @IH ]
+qed.
+
+lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u).
+#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/
+#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3
+[ @(not_to_not … Hx) -Hx #Hx
+ <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list //
+| #y #Hy <(swap_inv ? z1 z2 y)
+ <pi_vopen_tm @IH @(not_to_not … Hy) -Hy #Hy <(swap_inv ? z1 z2 y)
+ >eqv_FV @eqv_in_list //
+]
+qed.
+
+lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u.
+#x #u elim u normalize //
+[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?);
+ [ cases (true_or_false (eqb (S n) k)) #H1 >H1
+ [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H
+ cases (le_to_not_lt … H) -H #H cases (H ?) %
+ | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ]
+ | cases (true_or_false (eqb n k)) #H1 >H1 normalize
+ [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H
+ * #H cases (H ?) %
+ | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H;
+ [ #H destruct (H) | /2/ ]
+ ]
+ ]
+| #x0 #k cases (true_or_false (x0==x)) #H1 >H1 normalize // >(\P H1) >eqb_n_n % ]
+qed.
+
+lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux
+qed.
+
+(*
+theorem tm_to_tm : ∀t.tm' t → tm t.
+#t #H elim H
+*)
+
+lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2.
+#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/
+qed.
+
+lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k).
+#u #x elim u //
+[ #n #k normalize cases (leb k n) normalize //
+| #x0 #k normalize cases (true_or_false (x0==x)) #H >H normalize //
+ lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) %
+| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) /2/ ]
+qed.
+
+lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). //
+qed.
+
+lemma check_tm_true_to_toc : ∀u,k.check_tm u k = true → tm_or_ctx k u.
+#u @(pretm_ind_plus ???? [ ] ? u)
+[ #x #k #_ %2
+| #n #k change with (leb (S n) k) in ⊢ (??%?→?); #H % @leb_true_to_le //
+| #v1 #v2 #rv1 #rv2 #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?);
+ >pretm_ind_plus_app #H cases (andb_true ?? H) -H #Hv1 #Hv2 %3
+ [ @rv1 @Hv1 | @rv2 @Hv2 ]
+| #x #s #v #Hx #_ #rv #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?);
+ >pretm_ind_plus_lam // #Hv %4 @rv @Hv ]
+qed.
+
+lemma toc_to_check_tm_true : ∀u,k.tm_or_ctx k u → check_tm u k = true.
+#u #k #Hu elim Hu //
+[ #n #Hn change with (leb (S n) k) in ⊢ (??%?); @le_to_leb_true @Hn
+| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 change with (pretm_ind_plus ???????) in ⊢ (??%?);
+ >pretm_ind_plus_app change with (check_tm v1 k ∧ check_tm v2 k) in ⊢ (??%?); /2/
+| #x #s #v #Hv #IH <(vclose_vopen x v) change with (pretm_ind_plus ???????) in ⊢ (??%?);
+ >pretm_ind_plus_lam [| // | @fresh_vclose_tm ] >(vclose_vopen x v) @IH ]
+qed.
+
+lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u.
+#z1 #z2 #u elim u
+[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other //
+ [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] //
+|1: //
+| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1]
+| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2
+ >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ]
+ >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ]
+]
+qed.
+
+theorem tm_to_tm2 : ∀u.tm u → tm2 u.
+#t #Ht elim Ht
+[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn)
+| @tm_par
+| #u #v #Hu #Hv @tm_app
+| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam
+ [ @fresh_vclose_tm
+ | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ]
+]
+qed.
+
+theorem tm2_to_tm : ∀u.tm2 u → tm u.
+#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH //
+qed.
+
+(* define PAR APP LAM *)
+definition PAR ≝ λx.mk_TM (par x) ?. // qed.
+definition APP ≝ λu,v:TM.mk_TM (app u v) ?.
+change with (pretm_ind_plus ???????) in match (check_tm ??); >pretm_ind_plus_app
+change with (check_tm ??) in match (pretm_ind_plus ???????); change with (check_tm ??) in match (pretm_ind_plus ???????) in ⊢ (??(??%)?);
+@andb_elim >(tm_of_TM u) >(tm_of_TM v) % qed.
+definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?.
+change with (pretm_ind_plus ???????) in match (check_tm ??); <(vclose_vopen x u)
+>pretm_ind_plus_lam [| // | @fresh_vclose_tm ]
+change with (check_tm ??) in match (pretm_ind_plus ???????); >vclose_vopen
+@(tm_of_TM u) qed.
+
+axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉).
+(* needs true_plus_false
+
+#u #x #k #Hu elim Hu
+[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2]
+ normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ]
+ normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ]
+ #n0 #_ #Hn0 % @le_S_S_to_le //
+| #x0 %2
+| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 //
+| #x0 #s #v #Hv #IH normalize @daemon
+]
+qed.
+*)
+
+definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) ?.
+@toc_to_check_tm_true @vopen_tm_down @check_tm_true_to_toc @ctx_of_CTX qed.
+
+axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u).
+
+definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) ?.
+@toc_to_check_tm_true @vclose_tm_up @check_tm_true_to_toc @tm_of_TM qed.
+
+interpretation "ln wf term variable open" 'open u x = (vopen_TM u x).
+interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x).
+
+theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉).
+#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta //
+qed.
+
+lemma TM_to_tm2 : ∀u:TM.tm2 u.
+#u @tm_to_tm2 @check_tm_true_to_toc @tm_of_TM qed.
+
+theorem TM_ind_plus_weak :
+ ∀P:pretm → Type[0].
+ (∀x:𝔸.P (PAR x)) →
+ (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C →
+ (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) →
+ ∀u:TM.P u.
+#P #Hpar #Happ #C #Hlam #u elim (TM_to_tm2 u) //
+[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2)
+ @toc_to_check_tm_true @tm2_to_tm //
+| #x #s #v #Hx #pv #IH
+ lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0
+ >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉))
+ [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ]
+ @(Hlam x0 s (mk_CTX v ?) ??)
+ [ <(nominal_eta … Hx) @toc_to_check_tm_true @vclose_tm_up @tm2_to_tm @pv //
+ | @(not_to_not … Hx0) @in_list_to_in_list_append_r
+ | @(not_to_not … Hx0) @in_list_to_in_list_append_l
+ | @IH ]
+]
+qed.
+
+lemma eq_mk_TM : ∀u,v.u = v → ∀pu,pv.mk_TM u pu = mk_TM v pv.
+#u #v #Heq >Heq #pu #pv %
+qed.
+
+lemma eq_P : ∀T:Type[0].∀t1,t2:T.t1 = t2 → ∀P:T → Type[0].P t1 → P t2. // qed.
+
+theorem TM_ind_plus :
+ ∀P:TM → Type[0].
+ (∀x:𝔸.P (PAR x)) →
+ (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C →
+ (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) →
+ ∀u:TM.P u.
+#P #Hpar #Happ #C #Hlam * #u #pu
+>(?:mk_TM u pu =
+ mk_TM u (toc_to_check_tm_true … (tm2_to_tm … (tm_to_tm2 … (check_tm_true_to_toc … pu))))) [|%]
+elim (tm_to_tm2 u ?) //
+[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2)
+| #x #s #v #Hx #pv #IH
+ lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0
+ lapply (Hlam x0 s (mk_CTX v ?) ???)
+ [2: @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0
+ |4: @toc_to_check_tm_true <(nominal_eta x v) // @vclose_tm_up @tm2_to_tm @pv //
+ | #y #Hy whd in match (vopen_TM ??);
+ >(?:mk_TM (v⌈y⌉) ? = mk_TM (v⌈y⌉) (toc_to_check_tm_true (v⌈y⌉) O (tm2_to_tm (v⌈y⌉) (pv y Hy))))
+ [@IH|%]
+ | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0
+ | @eq_P @eq_mk_TM whd in match (vopen_TM ??); @tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ]
+]
+qed.
+
+notation
+"hvbox('nominal' u 'return' out 'with'
+ [ 'xpar' ident x ⇒ f1
+ | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2
+ | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])"
+with precedence 48
+for @{ TM_ind_plus $out (λ${ident x}:?.$f1)
+ (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2)
+ $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3)
+ $u }.
+
+(* include "basics/jmeq.ma".*)
+
+definition subst ≝ (λu:TM.λx,v.
+ nominal u return (λ_.TM) with
+ [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ] (* u instead of PAR x0 does not work, u stays the same at every rec call! *)
+ | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2
+ | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]).
+
+lemma subst_def : ∀u,x,v.subst u x v =
+ nominal u return (λ_.TM) with
+ [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ]
+ | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2
+ | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]. //
+qed.
+
+axiom TM_ind_plus_LAM :
+ ∀x,s,u,out,f1,f2,C,f3,Hx1,Hx2.
+ TM_ind_plus out f1 f2 C f3 (LAM x s (u⌈x⌉)) =
+ f3 x s u Hx1 Hx2 (λy,Hy.TM_ind_plus ? f1 f2 C f3 ?).
+
+axiom TM_ind_plus_APP :
+ ∀u1,u2,out,f1,f2,C,f3.
+ TM_ind_plus out f1 f2 C f3 (APP u1 u2) =
+ f2 u1 u2 (TM_ind_plus out f1 f2 C f3 ?) (TM_ind_plus out f1 f2 C f3 ?).
+
+lemma eq_mk_CTX : ∀u,v.u = v → ∀pu,pv.mk_CTX u pu = mk_CTX v pv.
+#u #v #Heq >Heq #pu #pv %
+qed.
+
+lemma vclose_vopen_TM : ∀x.∀u:TM.((νx.u)⌈x⌉) = u.
+#x * #u #pu @eq_mk_TM @vclose_vopen qed.
+
+lemma nominal_eta_CTX : ∀x.∀u:CTX.x ∉ FV u → (νx.(u⌈x⌉)) = u.
+#x * #u #pu #Hx @eq_mk_CTX @nominal_eta // qed.
+
+theorem TM_alpha : ∀x,y,s.∀u:CTX.x ∉ FV u → y ∉ FV u → LAM x s (u⌈x⌉) = LAM y s (u⌈y⌉).
+#x #y #s #u #Hx #Hy @eq_mk_TM @tm_alpha // qed.
+
+axiom in_vopen_CTX : ∀x,y.∀v:CTX.x ∈ FV (v⌈y⌉) → x = y ∨ x ∈ FV v.
+
+theorem subst_fresh : ∀u,v:TM.∀x.x ∉ FV u → subst u x v = u.
+#u #v #x @(TM_ind_plus … (x::FV v) … u)
+[ #x0 normalize in ⊢ (%→?); #Hx normalize in ⊢ (??%?);
+ >(\bf ?) [| @(not_to_not … Hx) #Heq >Heq % ] %
+| #u1 #u2 #IH1 #IH2 normalize in ⊢ (%→?); #Hx
+ >subst_def >TM_ind_plus_APP @eq_mk_TM @eq_f2 @eq_f
+ [ <subst_def @IH1 @(not_to_not … Hx) @in_list_to_in_list_append_l
+ | <subst_def @IH2 @(not_to_not … Hx) @in_list_to_in_list_append_r ]
+| #x0 #s #v0 #Hx0 #HC #IH #Hx >subst_def >TM_ind_plus_LAM [|@HC|@Hx0]
+ @eq_f <subst_def @IH // @(not_to_not … Hx) -Hx #Hx
+ change with (FV (νx0.(v0⌈x0⌉))) in ⊢ (???%); >nominal_eta_CTX //
+ cases (in_vopen_CTX … Hx) // #Heq >Heq in HC; * #HC @False_ind @HC %
+]
+qed.
+
+example subst_LAM_same : ∀x,s,u,v. subst (LAM x s u) x v = LAM x s u.
+#x #s #u #v >subst_def <(vclose_vopen_TM x u)
+lapply (p_fresh … (FV (νx.u)@x::FV v)) letin x0 ≝ (N_fresh … (FV (νx.u)@x::FV v)) #Hx0
+>(TM_alpha x x0)
+[| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 | @fresh_vclose_tm ]
+>TM_ind_plus_LAM [| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0 | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 ]
+@eq_f change with (subst ((νx.u)⌈x0⌉) x v) in ⊢ (??%?); @subst_fresh
+@(not_to_not … Hx0) #Hx0' cases (in_vopen_CTX … Hx0')
+[ #Heq >Heq @in_list_to_in_list_append_r %
+| #Hfalse @False_ind cases (fresh_vclose_tm u x) #H @H @Hfalse ]
+qed.
+
+(*
+notation > "Λ ident x. ident T [ident x] ↦ P"
+ with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}.
+
+notation < "Λ ident x. ident T [ident x] ↦ P"
+ with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}.
+*)
+
+(*
+notation
+"hvbox('nominal' u 'with'
+ [ 'xpar' ident x ⇒ f1
+ | 'xapp' ident v1 ident v2 ⇒ f2
+ | 'xlam' ident x # C s w ⇒ f3 ])"
+with precedence 48
+for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
+ (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
+ $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
+*)
+
+(*
+notation
+"hvbox('nominal' u 'with'
+ [ 'xpar' ident x ^ f1
+ | 'xapp' ident v1 ident v2 ^ f2 ])"
+(* | 'xlam' ident x # C s w ^ f3 ]) *)
+with precedence 48
+for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
+ (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
+ $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
+*)
+notation
+"hvbox('nominal' u 'with'
+ [ 'xpar' ident x ^ f1
+ | 'xapp' ident v1 ident v2 ^ f2 ])"
+with precedence 48
+for @{ tm2_ind_plus ? (λ${ident x}:?.$f1)
+ (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
+ $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
+
+axiom in_Env : 𝔸 × tp → Env → Prop.
+notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
+interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
+
+
+
+inductive judg : list tp → tm → tp → Prop ≝
+| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t
+| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u
+| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u).
+
+definition Env := list (𝔸 × tp).
+
+axiom vclose_env : Env → list tp.
+axiom vclose_tm : Env → tm → tm.
+axiom Lam : 𝔸 → tp → tm → tm.
+definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T.
+definition dom ≝ λG:Env.map ?? (fst ??) G.
+
+definition sctx ≝ 𝔸 × tm.
+axiom swap_tm : 𝔸 → 𝔸 → tm → tm.
+definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M.
+
+axiom in_list : ∀A:Type[0].A → list A → Prop.
+interpretation "list membership" 'mem x l = (in_list ? x l).
+interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)).
+
+axiom in_Env : 𝔸 × tp → Env → Prop.
+notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
+interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
+
+(* axiom Lookup : 𝔸 → Env → option tp. *)
+
+(* forma alto livello del judgment
+ t_abs* : ∀G,T,X,M,U.
+ (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) →
+ Judg G (Lam X T (M[X])) (arr T U) *)
+
+(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *)
+
+axiom Judg_ind : ∀P:Env → tm → tp → Prop.
+ (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) →
+ (∀G,M,N,T,U.
+ Judg G M (arr T U) → Judg G N T →
+ P G M (arr T U) → P G N T → P G (app M N) U) →
+ (∀G,T1,T2,X,M1.
+ (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
+ (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
+ P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) →
+ ∀G,M,T.Judg G M T → P G M T.
+
+axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T.
+axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U.
+axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U).
+
+definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2.
+interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2).
+
+axiom daemon : ∀P:Prop.P.
+
+theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T.
+#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?)
+@(Judg_ind … HJ)
+[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub //
+| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2
+ [| @IH1 // | @IH2 // ]
+| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH
+ [ (* trivial property of Lam *) @daemon
+ | (* trivial property of subenv *) @daemon ]
+]
+qed.
+
+(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e
+ ricorsione *)
\ No newline at end of file
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basics/lists/list.ma".
+include "basics/deqsets.ma".
+include "binding/names.ma".
+include "binding/fp.ma".
+
+definition alpha : Nset ≝ X. check alpha
+notation "𝔸" non associative with precedence 90 for @{'alphabet}.
+interpretation "set of names" 'alphabet = alpha.
+
+inductive tp : Type[0] ≝
+| top : tp
+| arr : tp → tp → tp.
+inductive pretm : Type[0] ≝
+| var : nat → pretm
+| par : 𝔸 → pretm
+| abs : tp → pretm → pretm
+| app : pretm → pretm → pretm.
+
+let rec Nth T n (l:list T) on n ≝
+ match l with
+ [ nil ⇒ None ?
+ | cons hd tl ⇒ match n with
+ [ O ⇒ Some ? hd
+ | S n0 ⇒ Nth T n0 tl ] ].
+
+let rec vclose_tm_aux u x k ≝ match u with
+ [ var n ⇒ if (leb k n) then var (S n) else u
+ | par x0 ⇒ if (x0 == x) then (var k) else u
+ | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k)
+ | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ].
+definition vclose_tm ≝ λu,x.vclose_tm_aux u x O.
+
+definition vopen_var ≝ λn,x,k.match eqb n k with
+ [ true ⇒ par x
+ | false ⇒ match leb n k with
+ [ true ⇒ var n
+ | false ⇒ var (pred n) ] ].
+
+let rec vopen_tm_aux u x k ≝ match u with
+ [ var n ⇒ vopen_var n x k
+ | par x0 ⇒ u
+ | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k)
+ | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ].
+definition vopen_tm ≝ λu,x.vopen_tm_aux u x O.
+
+let rec FV u ≝ match u with
+ [ par x ⇒ [x]
+ | app v1 v2 ⇒ FV v1@FV v2
+ | abs s v ⇒ FV v
+ | _ ⇒ [ ] ].
+
+definition lam ≝ λx,s,u.abs s (vclose_tm u x).
+
+let rec Pi_map_tm p u on u ≝ match u with
+[ par x ⇒ par (p x)
+| var _ ⇒ u
+| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2)
+| abs s v ⇒ abs s (Pi_map_tm p v) ].
+
+interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x).
+
+notation "hvbox(u⌈x⌉)"
+ with precedence 45
+ for @{ 'open $u $x }.
+
+(*
+notation "hvbox(u⌈x⌉)"
+ with precedence 45
+ for @{ 'open $u $x }.
+notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }.
+*)
+interpretation "ln term variable open" 'open u x = (vopen_tm u x).
+notation < "hvbox(ν x break . u)"
+ with precedence 20
+for @{'nu $x $u }.
+notation > "ν list1 x sep , . term 19 u" with precedence 20
+ for ${ fold right @{$u} rec acc @{'nu $x $acc)} }.
+interpretation "ln term variable close" 'nu x u = (vclose_tm u x).
+
+let rec tm_height u ≝ match u with
+[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2))
+| abs s v ⇒ S (tm_height v)
+| _ ⇒ O ].
+
+theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n.
+#n (cases n) // #a #abs cases (?:False) /2/ qed.
+
+theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0].
+(∀m.(∀p. p < m → P p) → P m) → P n.
+#n #P #H
+cut (∀q:nat. q ≤ n → P q) /2/
+(elim n)
+ [#q #HleO (* applica male *)
+ @(le_n_O_rect_Type0 ? HleO)
+ @H #p #ltpO cases (?:False) /2/ (* 3 *)
+ |#p #Hind #q #HleS
+ @H #a #lta @Hind @le_S_S_to_le /2/
+ ]
+qed.
+
+lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n.
+#n elim n
+[ #m normalize #H destruct(H)
+| #n0 #IH * // #m normalize #H @le_S_S @IH // ]
+qed.
+
+lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u.
+#x #u elim u
+[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk
+ [ >Hnk >eqb_n_n whd in ⊢ (??%?); >(\b ?) //
+ | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb
+ [ >Hleb normalize >(?:leb k n = false) //
+ @lt_to_leb_false @not_eq_to_le_to_lt /2/
+ | >Hleb normalize >(?:leb k (pred n) = true) normalize
+ [ cases (leb_false_to_lt … Hleb) //
+ | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ]
+| #y normalize in ⊢ (%→?→?); #Hy whd in ⊢ (?→??%?); >(\bf ?) // @(not_to_not … Hy) //
+| #s #v #IH normalize #Hv #k >IH // @Hv
+| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k
+ >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ]
+ @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ]
+qed.
+
+corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u.
+#x #u #Hu @nominal_eta_aux //
+qed.
+
+lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v.
+#v #x elim v
+[ #n #k normalize cases (eqb n k) // cases (leb n k) //
+| #u #k %
+| #s #u #IH #k normalize >IH %
+| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ]
+qed.
+
+corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v.
+#v #x @eq_height_vopen_aux
+qed.
+
+theorem pretm_ind_plus_aux :
+ ∀P:pretm → Type[0].
+ (∀x:𝔸.P (par x)) →
+ (∀n:ℕ.P (var n)) →
+ (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
+ ∀n,u.tm_height u ≤ n → P u.
+#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??)
+#m cases m
+[ #_ * /2/
+ [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/
+ | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (S (max ??))) /2/ ] ]
+-m #m #IH * /2/
+[ #s #v whd in ⊢ (?%?→?); #Hv
+ lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy
+ >(?:abs s v = lam y s (v⌈y⌉))
+ [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ]
+ @Hlam
+ [ @(not_to_not … Hy) @in_list_to_in_list_append_r
+ | @(not_to_not … Hy) @in_list_to_in_list_append_l ]
+ @IH [| @Hv | >eq_height_vopen % ]
+| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ
+ [ @IH [| @Hv | // ] | @IH [| @Hv | // ] ] ]
+qed.
+
+corollary pretm_ind_plus :
+ ∀P:pretm → Type[0].
+ (∀x:𝔸.P (par x)) →
+ (∀n:ℕ.P (var n)) →
+ (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
+ ∀u.P u.
+#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/
+qed.
+
+(* maps a permutation to a list of terms *)
+definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 .
+
+(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*)
+
+(*
+inductive tm : pretm → Prop ≝
+| tm_par : ∀x:𝔸.tm (par x)
+| tm_app : ∀u,v.tm u → tm v → tm (app u v)
+| tm_lam : ∀x,s,u.tm u → tm (lam x s u).
+
+inductive ctx_aux : nat → pretm → Prop ≝
+| ctx_var : ∀n,k.n < k → ctx_aux k (var n)
+| ctx_par : ∀x,k.ctx_aux k (par x)
+| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v)
+(* è sostituibile da ctx_lam ? *)
+| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u).
+*)
+
+inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝
+| toc_var : ∀n.n < k → tm_or_ctx k (var n)
+| toc_par : ∀x.tm_or_ctx k (par x)
+| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v)
+| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u).
+
+definition tm ≝ λt.tm_or_ctx O t.
+definition ctx ≝ λt.tm_or_ctx 1 t.
+
+record TM : Type[0] ≝ {
+ pretm_of_TM :> pretm;
+ tm_of_TM : tm pretm_of_TM
+}.
+
+record CTX : Type[0] ≝ {
+ pretm_of_CTX :> pretm;
+ ctx_of_CTX : ctx pretm_of_CTX
+}.
+
+inductive tm2 : pretm → Type[0] ≝
+| tm_par : ∀x.tm2 (par x)
+| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v)
+| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)).
+
+(*
+inductive tm' : pretm → Prop ≝
+| tm_par : ∀x.tm' (par x)
+| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v)
+| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)).
+*)
+
+axiom swap_inj : ∀N.∀z1,z2,x,y.swap N z1 z2 x = swap N z1 z2 y → x = y.
+
+lemma pi_vclose_tm :
+ ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u).
+#z1 #z2 #x #u
+change with (vclose_tm_aux ???) in match (vclose_tm ??);
+change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u
+[3:whd in ⊢ (?→?→(?→ ??%%)→?→??%%); //
+|4:whd in ⊢ (?→?→(?→??%%)→(?→??%%)→?→??%%); //
+| #n #k whd in ⊢ (??(??%)%); cases (leb k n) normalize %
+| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 whd in ⊢ (??%%);
+ [ cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%);
+ [ <(\P H2) >H1 whd in ⊢ (??(??%)%); >(\b ?) // >(\b ?) //
+ | >H2 whd in match (swap ????); >H1
+ whd in match (if false then var k else ?);
+ whd in match (if true then z2 else ?); >(\bf ?)
+ [ >(\P H1) >swap_left %
+ | <(swap_inv ? z1 z2 z2) in ⊢ (?(??%?)); % #H3
+ lapply (swap_inj … H3) >swap_right #H4 <H4 in H2; >H1 #H destruct (H) ]
+ ]
+ | >(?:(swap ? z1 z2 x0 == swap ? z1 z2 x) = (x0 == x))
+ [| cases (true_or_false (x0==x)) #H2 >H2
+ [ >(\P H2) @(\b ?) %
+ | @(\bf ?) % #H >(swap_inj … H) in H2; >(\b ?) // #H0 destruct (H0) ] ]
+ cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%);
+ [ <(\P H2) >H1 >(\b (refl ??)) %
+ | >H1 >H2 % ]
+ ]
+ ]
+qed.
+
+lemma pi_vopen_tm :
+ ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉).
+#z1 #z2 #x #u
+change with (vopen_tm_aux ???) in match (vopen_tm ??);
+change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u //
+[2: #s #v whd in ⊢ ((?→??%%)→?→??%%); //
+|3: #v1 #v2 whd in ⊢ ((?→??%%)→(?→??%%)→?→??%%); /2/ ]
+#n #k whd in ⊢ (??(??%)%); cases (true_or_false (eqb n k)) #H1 >H1 //
+cases (true_or_false (leb n k)) #H2 >H2 normalize //
+qed.
+
+lemma pi_lam :
+ ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u).
+#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) %
+qed.
+
+lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u).
+#z1 #z2 #u elim u //
+[ #s #v #H @H
+| #v1 #v2 whd in ⊢ (??%%→??%%→??%%); #H1 #H2 >H1 >H2
+ whd in ⊢ (???(????%)); /2/ ]
+qed.
+
+lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u.
+#z1 #z2 #u elim u
+[1: #n %
+|3: #s #v whd in ⊢ (?→??%%); //
+|4: #v1 #v2 #Hv1 #Hv2 whd in ⊢ (??%%); // ]
+#x whd in ⊢ (??%?); >swap_inv %
+qed.
+
+lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l.
+#x #l #z1 #z2 #Hin elim Hin
+[ #x0 #l0 %
+| #x1 #x2 #l0 #Hin #IH %2 @IH ]
+qed.
+
+lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u).
+#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/
+#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3
+[ @(not_to_not … Hx) -Hx #Hx
+ <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list //
+| #y #Hy <(swap_inv ? z1 z2 y)
+ <pi_vopen_tm @IH @(not_to_not … Hy) -Hy #Hy <(swap_inv ? z1 z2 y)
+ >eqv_FV @eqv_in_list //
+]
+qed.
+
+lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u.
+#x #u elim u [1,3,4:normalize //]
+[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?);
+ [ cases (true_or_false (eqb (S n) k)) #H1 >H1
+ [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H
+ cases (le_to_not_lt … H) -H #H cases (H ?) %
+ | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ]
+ | cases (true_or_false (eqb n k)) #H1 >H1 normalize
+ [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H
+ * #H cases (H ?) %
+ | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H;
+ [ #H destruct (H) | /2/ ]
+ ]
+ ]
+| #x0 #k whd in ⊢ (??(?%??)?); cases (true_or_false (x0==x))
+ #H1 >H1 normalize // >(\P H1) >eqb_n_n % ]
+qed.
+
+lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux
+qed.
+
+(*
+theorem tm_to_tm : ∀t.tm' t → tm t.
+#t #H elim H
+*)
+
+lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2.
+#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/
+qed.
+
+lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k).
+#u #x elim u //
+[ #n #k normalize cases (leb k n) normalize //
+| #x0 #k whd in ⊢ (?(???(?%))); cases (true_or_false (x0==x)) #H >H normalize //
+ lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) %
+| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) -Hin #Hin
+ [ cases (IH1 k) -IH1 #IH1 @IH1 @Hin | cases (IH2 k) -IH2 #IH2 @IH2 @Hin ]
+qed.
+
+lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). //
+qed.
+
+lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u.
+#z1 #z2 #u elim u
+[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other //
+ [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] //
+|1: //
+| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1]
+| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2
+ >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ]
+ >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ]
+]
+qed.
+
+theorem tm_to_tm2 : ∀u.tm u → tm2 u.
+#t #Ht elim Ht
+[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn)
+| @tm_par
+| #u #v #Hu #Hv @tm_app
+| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam
+ [ @fresh_vclose_tm
+ | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ]
+]
+qed.
+
+theorem tm2_to_tm : ∀u.tm2 u → tm u.
+#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH //
+qed.
+
+definition PAR ≝ λx.mk_TM (par x) ?. // qed.
+definition APP ≝ λu,v:TM.mk_TM (app u v) ?./2/ qed.
+definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?./2/ qed.
+
+axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉).
+(* needs true_plus_false
+
+#u #x #k #Hu elim Hu
+[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2]
+ normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ]
+ normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ]
+ #n0 #_ #Hn0 % @le_S_S_to_le //
+| #x0 %2
+| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 //
+| #x0 #s #v #Hv #IH normalize @daemon
+]
+qed.
+*)
+
+definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) (vopen_tm_down …). @ctx_of_CTX qed.
+
+axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u).
+
+definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) (vclose_tm_up …). @tm_of_TM qed.
+
+interpretation "ln wf term variable open" 'open u x = (vopen_TM u x).
+interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x).
+
+theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉).
+#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta //
+qed.
+
+theorem TM_ind_plus :
+(* non si può dare il principio in modo dipendente (almeno utilizzando tm2)
+ la "prova" purtroppo è in Type e non si può garantire che sia esattamente
+ quella che ci aspetteremmo
+ *)
+ ∀P:pretm → Type[0].
+ (∀x:𝔸.P (PAR x)) →
+ (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C →
+ (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) →
+ ∀u:TM.P u.
+#P #Hpar #Happ #C #Hlam * #u #pu elim (tm_to_tm2 u pu) //
+[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …)) /2/
+| #x #s #v #Hx #pv #IH
+ lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0
+ >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉))
+ [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ]
+ @(Hlam x0 s (mk_CTX v ?) ??)
+ [ <(nominal_eta … Hx) @vclose_tm_up @tm2_to_tm @pv //
+ | @(not_to_not … Hx0) @in_list_to_in_list_append_r
+ | @(not_to_not … Hx0) @in_list_to_in_list_append_l
+ | @IH ]
+]
+qed.
+
+notation
+"hvbox('nominal' u 'return' out 'with'
+ [ 'xpar' ident x ⇒ f1
+ | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2
+ | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])"
+with precedence 48
+for @{ TM_ind_plus $out (λ${ident x}:?.$f1)
+ (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2)
+ $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3)
+ $u }.
+
+(* include "basics/jmeq.ma".*)
+
+definition subst ≝ (λu:TM.λx,v.
+ nominal u return (λ_.TM) with
+ [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ]
+ | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2
+ | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]).
+
+lemma fasfd : ∀s,v. pretm_of_TM (subst (LAM O s (PAR 1)) O v) = pretm_of_TM (LAM O s (PAR 1)).
+#s #v normalize in ⊢ (??%?);
+
+
+theorem tm2_ind_plus :
+(* non si può dare il principio in modo dipendente (almeno utilizzando tm2) *)
+ ∀P:pretm → Type[0].
+ (∀x:𝔸.P (par x)) →
+ (∀v1,v2.tm2 v1 → tm2 v2 → P v1 → P v2 → P (app v1 v2)) →
+ ∀C:list 𝔸.
+ (∀x,s,v.x ∉ FV v → x ∉ C → (∀y.y ∉ FV v → tm2 (v⌈y⌉)) →
+ (∀y.y ∉ FV v → P (v⌈y⌉)) → P (lam x s (v⌈x⌉))) →
+ ∀u.tm2 u → P u.
+#P #Hpar #Happ #C #Hlam #u #pu elim pu /2/
+#x #s #v #px #pv #IH
+lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy
+>(?:lam x s (v⌈x⌉) = lam y s (v⌈y⌉)) [| @tm_alpha // @(not_to_not … Hy) @in_list_to_in_list_append_r ]
+@Hlam /2/ lapply Hy -Hy @not_to_not #Hy
+[ @in_list_to_in_list_append_r @Hy | @in_list_to_in_list_append_l @Hy ]
+qed.
+
+definition check_tm ≝
+ λu.pretm_ind_plus ? (λ_.true) (λ_.false)
+ (λv1,v2,r1,r2.r1 ∧ r2) [ ] (λx,s,v,pv1,pv2,rv.rv) u.
+
+(*
+lemma check_tm_complete : ∀u.tm u → check_tm u = true.
+#u #pu @(tm2_ind_plus … [ ] … (tm_to_tm2 ? pu)) //
+[ #v1 #v2 #pv1 #pv2 #IH1 #IH2
+| #x #s #v #Hx1 #Hx2 #Hv #IH
+*)
+
+notation
+"hvbox('nominal' u 'return' out 'with'
+ [ 'xpar' ident x ⇒ f1
+ | 'xapp' ident v1 ident v2 ident pv1 ident pv2 ident recv1 ident recv2 ⇒ f2
+ | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident pw ident recw ⇒ f3 ])"
+with precedence 48
+for @{ tm2_ind_plus $out (λ${ident x}:?.$f1)
+ (λ${ident v1}:?.λ${ident v2}:?.λ${ident pv1}:?.λ${ident pv2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2)
+ $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident pw}:?.λ${ident recw}:?.$f3)
+ ? (tm_to_tm2 ? $u) }.
+(* notation
+"hvbox('nominal' u 'with'
+ [ 'xlam' ident x # C ident s ident w ⇒ f3 ])"
+with precedence 48
+for @{ tm2_ind_plus ???
+ $C (λ${ident x}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.
+ λ${ident pw}:?.λ${ident recw}:?.$f3) $u (tm_to_tm2 ??) }.
+*)
+
+
+definition subst ≝ (λu.λpu:tm u.λx,v.
+ nominal pu return (λ_.pretm) with
+ [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ]
+ | xapp v1 v2 pv1 pv2 recv1 recv2 ⇒ app recv1 recv2
+ | xlam ❨y # x::FV v❩ s w py1 py2 pw recw ⇒ lam y s (recw y py1) ]).
+
+lemma fasfd : ∀x,s,u,p1,v. subst (lam x s u) p1 x v = lam x s u.
+#x #s #u #p1 #v
+
+
+definition subst ≝ λu.λpu:tm u.λx,y.
+ tm2_ind_plus ?
+ (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ])
+ (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2)
+ (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1))
+ u (tm_to_tm2 … pu).
+check subst
+definition subst ≝ λu.λpu:tm u.λx,v.
+ nominal u with
+ [ xlam y # (x::FV v) s w ^ ? ].
+
+(*
+notation > "Λ ident x. ident T [ident x] ↦ P"
+ with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}.
+
+notation < "Λ ident x. ident T [ident x] ↦ P"
+ with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}.
+*)
+
+(*
+notation
+"hvbox('nominal' u 'with'
+ [ 'xpar' ident x ⇒ f1
+ | 'xapp' ident v1 ident v2 ⇒ f2
+ | 'xlam' ident x # C s w ⇒ f3 ])"
+with precedence 48
+for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
+ (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
+ $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
+*)
+
+(*
+notation
+"hvbox('nominal' u 'with'
+ [ 'xpar' ident x ^ f1
+ | 'xapp' ident v1 ident v2 ^ f2 ])"
+(* | 'xlam' ident x # C s w ^ f3 ]) *)
+with precedence 48
+for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
+ (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
+ $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
+*)
+notation
+"hvbox('nominal' u 'with'
+ [ 'xpar' ident x ^ f1
+ | 'xapp' ident v1 ident v2 ^ f2 ])"
+with precedence 48
+for @{ tm2_ind_plus ? (λ${ident x}:?.$f1)
+ (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
+ $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
+
+
+definition subst ≝ λu.λpu:tm u.λx,v.
+ nominal u with
+ [ xpar x0 ^ match x == x0 with [ true ⇒ v | false ⇒ u ]
+ | xapp v1 v2 ^ ? ].
+ | xlam y # (x::FV v) s w ^ ? ].
+
+
+ (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ])
+ (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2)
+ (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1))
+ u (tm_to_tm2 … pu).
+
+
+*)
+definition subst ≝ λu.λpu:tm u.λx,v.
+ tm2_ind_plus ?
+ (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ])
+ (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2)
+ (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1))
+ u (tm_to_tm2 … pu).
+
+check subst
+
+
+axiom in_Env : 𝔸 × tp → Env → Prop.
+notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
+interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
+
+
+
+inductive judg : list tp → tm → tp → Prop ≝
+| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t
+| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u
+| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u).
+
+definition Env := list (𝔸 × tp).
+
+axiom vclose_env : Env → list tp.
+axiom vclose_tm : Env → tm → tm.
+axiom Lam : 𝔸 → tp → tm → tm.
+definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T.
+definition dom ≝ λG:Env.map ?? (fst ??) G.
+
+definition sctx ≝ 𝔸 × tm.
+axiom swap_tm : 𝔸 → 𝔸 → tm → tm.
+definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M.
+
+axiom in_list : ∀A:Type[0].A → list A → Prop.
+interpretation "list membership" 'mem x l = (in_list ? x l).
+interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)).
+
+axiom in_Env : 𝔸 × tp → Env → Prop.
+notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
+interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
+
+let rec FV M ≝ match M with
+ [ par X ⇒ [X]
+ | app M1 M2 ⇒ FV M1@FV M2
+ | abs T M0 ⇒ FV M0
+ | _ ⇒ [ ] ].
+
+(* axiom Lookup : 𝔸 → Env → option tp. *)
+
+(* forma alto livello del judgment
+ t_abs* : ∀G,T,X,M,U.
+ (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) →
+ Judg G (Lam X T (M[X])) (arr T U) *)
+
+(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *)
+
+axiom Judg_ind : ∀P:Env → tm → tp → Prop.
+ (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) →
+ (∀G,M,N,T,U.
+ Judg G M (arr T U) → Judg G N T →
+ P G M (arr T U) → P G N T → P G (app M N) U) →
+ (∀G,T1,T2,X,M1.
+ (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
+ (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
+ P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) →
+ ∀G,M,T.Judg G M T → P G M T.
+
+axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T.
+axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U.
+axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U).
+
+definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2.
+interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2).
+
+axiom daemon : ∀P:Prop.P.
+
+theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T.
+#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?)
+@(Judg_ind … HJ)
+[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub //
+| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2
+ [| @IH1 // | @IH2 // ]
+| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH
+ [ (* trivial property of Lam *) @daemon
+ | (* trivial property of subenv *) @daemon ]
+]
+qed.
+
+(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e
+ ricorsione *)
\ No newline at end of file
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basics/logic.ma".
+include "basics/lists/in.ma".
+include "basics/types.ma".
+
+(*interpretation "list membership" 'mem x l = (in_list ? x l).*)
+
+record Nset : Type[1] ≝
+{
+ (* carrier is specified as a coercion: when an object X of type Nset is
+ given, but something of type Type is expected, Matita will insert a
+ hidden coercion: the user sees "X", but really means "carrier X" *)
+ carrier :> DeqSet;
+ N_fresh : list carrier → carrier;
+ p_fresh : ∀l.N_fresh l ∉ l
+}.
+
+definition maxlist ≝
+ λl.foldr ?? (λx,acc.max x acc) 0 l.
+
+definition natfresh ≝ λl.S (maxlist l).
+
+lemma le_max_1 : ∀x,y.x ≤ max x y. /2/
+qed.
+
+lemma le_max_2 : ∀x,y.y ≤ max x y. /2/
+qed.
+
+lemma le_maxlist : ∀l,x.x ∈ l → x ≤ maxlist l.
+#l elim l
+[#x #Hx @False_ind cases (not_in_list_nil ? x) #H1 /2/
+|#y #tl #IH #x #H1 change with (max ??) in ⊢ (??%);
+ cases (in_list_cons_case ???? H1);#H2;
+ [ >H2 @le_max_1
+ | whd in ⊢ (??%); lapply (refl ? (leb y (maxlist tl)));
+ cases (leb y (maxlist tl)) in ⊢ (???% → %);#H3
+ [ @IH //
+ | lapply (IH ? H2) #H4
+ lapply (leb_false_to_not_le … H3) #H5
+ lapply (not_le_to_lt … H5) #H6
+ @(transitive_le … H4)
+ @(transitive_le … H6) %2 %
+ ]
+ ]
+]
+qed.
+
+(* prove freshness for nat *)
+lemma lt_l_natfresh_l : ∀l,x.x ∈ l → x < natfresh l.
+#l #x #H1 @le_S_S /2/
+qed.
+
+(*naxiom p_Xfresh : ∀l.∀x:Xcarr.x ∈ l → x ≠ ntm (Xfresh l) ∧ x ≠ ntp (Xfresh l).*)
+lemma p_natfresh : ∀l.natfresh l ∉ l.
+#l % #H1 lapply (lt_l_natfresh_l … H1) #H2
+cases (lt_to_not_eq … H2) #H3 @H3 %
+qed.
+
+include "basics/finset.ma".
+
+definition X : Nset ≝ mk_Nset DeqNat ….
+[ @natfresh
+| @p_natfresh
+]
+qed.
\ No newline at end of file
--- /dev/null
+include "turing/auxiliary_machines1.ma".
+include "turing/multi_to_mono/shift_trace_machines.ma".
+
+(******************************************************************************)
+(* mtiL: complete move L for tape i. We reaching the left border of trace i, *)
+(* add a blank if there is no more tape, then move the i-trace and finally *)
+(* come back to the head position. *)
+(******************************************************************************)
+
+(* we say that a tape is regular if for any trace after the first blank we
+ only have other blanks *)
+
+definition all_blanks_in ≝ λsig,l.
+ ∀x. mem ? x l → x = blank sig.
+
+definition regular_i ≝ λsig,n.λl:list (multi_sig sig n).λi.
+ all_blanks_in ? (after_blank ? (trace sig n i l)).
+
+definition regular_trace ≝ λsig,n,a.λls,rs:list (multi_sig sig n).λi.
+ Or (And (regular_i sig n (a::ls) i) (regular_i sig n rs i))
+ (And (regular_i sig n ls i) (regular_i sig n (a::rs) i)).
+
+axiom regular_tail: ∀sig,n,l,i.
+ regular_i sig n l i → regular_i sig n (tail ? l) i.
+
+axiom regular_extend: ∀sig,n,l,i.
+ regular_i sig n l i → regular_i sig n (l@[all_blank sig n]) i.
+
+axiom all_blank_after_blank: ∀sig,n,l1,b,l2,i.
+ nth i ? (vec … b) (blank ?) = blank ? →
+ regular_i sig n (l1@b::l2) i → all_blanks_in ? (trace sig n i l2).
+
+lemma regular_trace_extl: ∀sig,n,a,ls,rs,i.
+ regular_trace sig n a ls rs i →
+ regular_trace sig n a (ls@[all_blank sig n]) rs i.
+#sig #n #a #ls #rs #i *
+ [* #H1 #H2 % % // @(regular_extend … H1)
+ |* #H1 #H2 %2 % // @(regular_extend … H1)
+ ]
+qed.
+
+lemma regular_cons_hd_rs: ∀sig,n.∀a:multi_sig sig n.∀ls,rs1,rs2,i.
+ regular_trace sig n a ls (rs1@rs2) i →
+ regular_trace sig n a ls (rs1@((hd ? rs2 (all_blank …))::(tail ? rs2))) i.
+#sig #n #a #ls #rs1 #rs2 #i cases rs2 [2: #b #tl #H @H]
+*[* #H1 >append_nil #H2 %1 %
+ [@H1 | whd in match (hd ???); @(regular_extend … rs1) //]
+ |* #H1 >append_nil #H2 %2 %
+ [@H1 | whd in match (hd ???); @(regular_extend … (a::rs1)) //]
+ ]
+qed.
+
+lemma eq_trace_to_regular : ∀sig,n.∀a1,a2:multi_sig sig n.∀ls1,ls2,rs1,rs2,i.
+ nth i ? (vec … a1) (blank ?) = nth i ? (vec … a2) (blank ?) →
+ trace sig n i ls1 = trace sig n i ls2 →
+ trace sig n i rs1 = trace sig n i rs2 →
+ regular_trace sig n a1 ls1 rs1 i →
+ regular_trace sig n a2 ls2 rs2 i.
+#sig #n #a1 #a2 #ls1 #ls2 #rs1 #rs2 #i #H1 #H2 #H3 #H4
+whd in match (regular_trace ??????); whd in match (regular_i ????);
+whd in match (regular_i ?? rs2 ?); whd in match (regular_i ?? ls2 ?);
+whd in match (regular_i ?? (a2::rs2) ?); whd in match (trace ????);
+<trace_def whd in match (trace ??? (a2::rs2)); <trace_def
+<H1 <H2 <H3 @H4
+qed.
+
+(******************************* move_to_blank_L ******************************)
+(* we compose machines together to reduce the number of output cases, and
+ improve semantics *)
+
+definition move_to_blank_L ≝ λsig,n,i.
+ (move_until ? L (no_blank sig n i)) · extend ? (all_blank sig n).
+
+(*
+definition R_move_to_blank_L ≝ λsig,n,i,t1,t2.
+(current ? t1 = None ? →
+ t2 = midtape (multi_sig sig n) (left ? t1) (all_blank …) (right ? t1)) ∧
+∀ls,a,rs.t1 = midtape ? ls a rs →
+ ((no_blank sig n i a = false) ∧ t2 = t1) ∨
+ (∃b,ls1,ls2.
+ (no_blank sig n i b = false) ∧
+ (∀j.j ≤n → to_blank_i ?? j (ls1@b::ls2) = to_blank_i ?? j ls) ∧
+ t2 = midtape ? ls2 b ((reverse ? (a::ls1))@rs)).
+*)
+
+definition R_move_to_blank_L ≝ λsig,n,i,t1,t2.
+(current ? t1 = None ? →
+ t2 = midtape (multi_sig sig n) (left ? t1) (all_blank …) (right ? t1)) ∧
+∀ls,a,rs.
+ t1 = midtape (multi_sig sig n) ls a rs →
+ regular_i sig n (a::ls) i →
+ (∀j. j ≠ i → regular_trace … a ls rs j) →
+ (∃b,ls1,ls2.
+ (regular_i sig n (ls1@b::ls2) i) ∧
+ (∀j. j ≠ i → regular_trace …
+ (hd ? (ls1@b::ls2) (all_blank …)) (tail ? (ls1@b::ls2)) rs j) ∧
+ (no_blank sig n i b = false) ∧
+ (hd (multi_sig sig n) (ls1@[b]) (all_blank …) = a) ∧ (* not implied by the next fact *)
+ (∀j.j ≤n → to_blank_i ?? j (ls1@b::ls2) = to_blank_i ?? j (a::ls)) ∧
+ t2 = midtape ? ls2 b ((reverse ? ls1)@rs)).
+
+theorem sem_move_to_blank_L: ∀sig,n,i.
+ move_to_blank_L sig n i ⊨ R_move_to_blank_L sig n i.
+#sig #n #i
+@(sem_seq_app ??????
+ (ssem_move_until_L ? (no_blank sig n i)) (sem_extend ? (all_blank sig n)))
+#tin #tout * #t1 * * #Ht1a #Ht1b * #Ht2a #Ht2b %
+ [#Hcur >(Ht1a Hcur) in Ht2a; /2 by /
+ |#ls #a #rs #Htin #Hreg #Hreg2 -Ht1a cases (Ht1b … Htin)
+ [* #Hnb #Ht1 -Ht1b -Ht2a >Ht1 in Ht2b; >Htin #H
+ %{a} %{[ ]} %{ls}
+ %[%[%[%[%[@Hreg|@Hreg2]|@Hnb]|//]|//]|@H normalize % #H1 destruct (H1)]
+ |*
+ [(* we find the blank *)
+ * #ls1 * #b * #ls2 * * * #H1 #H2 #H3 #Ht1
+ >Ht1 in Ht2b; #Hout -Ht1b
+ %{b} %{(a::ls1)} %{ls2}
+ %[%[%[%[%[>H1 in Hreg; #H @H
+ |#j #jneqi whd in match (hd ???); whd in match (tail ??);
+ <H1 @(Hreg2 j jneqi)]|@H2] |//]|>H1 //]
+ |@Hout normalize % normalize #H destruct (H)
+ ]
+ |* #b * #lss * * #H1 #H2 #Ht1 -Ht1b >Ht1 in Ht2a;
+ whd in match (left ??); whd in match (right ??); #Hout
+ %{(all_blank …)} %{(lss@[b])} %{[]}
+ %[%[%[%[%[<H2 @regular_extend //
+ |<H2 #j #jneqi whd in match (hd ???); whd in match (tail ??);
+ @regular_trace_extl @Hreg2 //]
+ |whd in match (no_blank ????); >blank_all_blank //]
+ |<H2 //]
+ |#j #lejn <H2 @sym_eq @to_blank_i_ext]
+ |>reverse_append >reverse_single @Hout normalize //
+ ]
+ ]
+ ]
+qed.
+
+(******************************************************************************)
+
+definition shift_i_L ≝ λsig,n,i.
+ ncombf_r (multi_sig …) (shift_i sig n i) (all_blank sig n) ·
+ mti sig n i ·
+ extend ? (all_blank sig n).
+
+definition R_shift_i_L ≝ λsig,n,i,t1,t2.
+ (∀a,ls,rs.
+ t1 = midtape ? ls a rs →
+ ((∃rs1,b,rs2,a1,rss.
+ rs = rs1@b::rs2 ∧
+ nth i ? (vec … b) (blank ?) = (blank ?) ∧
+ (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧
+ shift_l sig n i (a::rs1) (a1::rss) ∧
+ t2 = midtape (multi_sig sig n) ((reverse ? (a1::rss))@ls) b rs2) ∨
+ (∃b,rss.
+ (∀x. mem ? x rs → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧
+ shift_l sig n i (a::rs) (rss@[b]) ∧
+ t2 = midtape (multi_sig sig n)
+ ((reverse ? (rss@[b]))@ls) (all_blank sig n) [ ]))).
+
+definition R_shift_i_L_new ≝ λsig,n,i,t1,t2.
+ (∀a,ls,rs.
+ t1 = midtape ? ls a rs →
+ ∃rs1,b,rs2,rss.
+ b = hd ? rs2 (all_blank sig n) ∧
+ nth i ? (vec … b) (blank ?) = (blank ?) ∧
+ rs = rs1@rs2 ∧
+ (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧
+ shift_l sig n i (a::rs1) rss ∧
+ t2 = midtape (multi_sig sig n) ((reverse ? rss)@ls) b (tail ? rs2)).
+
+theorem sem_shift_i_L: ∀sig,n,i. shift_i_L sig n i ⊨ R_shift_i_L sig n i.
+#sig #n #i
+@(sem_seq_app ??????
+ (sem_ncombf_r (multi_sig sig n) (shift_i sig n i)(all_blank sig n))
+ (sem_seq ????? (ssem_mti sig n i)
+ (sem_extend ? (all_blank sig n))))
+#tin #tout * #t1 * * #Ht1a #Ht1b * #t2 * * #Ht2a #Ht2b * #Htout1 #Htout2
+#a #ls #rs cases rs
+ [#Htin %2 %{(shift_i sig n i a (all_blank sig n))} %{[ ]}
+ %[%[#x @False_ind | @daemon]
+ |lapply (Ht1a … Htin) -Ht1a -Ht1b #Ht1
+ lapply (Ht2a … Ht1) -Ht2a -Ht2b #Ht2 >Ht2 in Htout1;
+ >Ht1 whd in match (left ??); whd in match (right ??); #Htout @Htout //
+ ]
+ |#a1 #rs1 #Htin
+ lapply (Ht1b … Htin) -Ht1a -Ht1b #Ht1
+ lapply (Ht2b … Ht1) -Ht2a -Ht2b *
+ [(* a1 is blank *) * #H1 #H2 %1
+ %{[ ]} %{a1} %{rs1} %{(shift_i sig n i a a1)} %{[ ]}
+ %[%[%[%[// |//] |#x @False_ind] | @daemon]
+ |>Htout2 [>H2 >reverse_single @Ht1 |>H2 >Ht1 normalize % #H destruct (H)]
+ ]
+ |*
+ [* #rs10 * #b * #rs2 * #rss * * * * #H1 #H2 #H3 #H4
+ #Ht2 %1
+ %{(a1::rs10)} %{b} %{rs2} %{(shift_i sig n i a a1)} %{rss}
+ %[%[%[%[>H1 //|//] |@H3] |@daemon ]
+ |>reverse_cons >associative_append
+ >H2 in Htout2; #Htout >Htout [@Ht2| >Ht2 normalize % #H destruct (H)]
+ ]
+ |* #b * #rss * * #H1 #H2
+ #Ht2 %2
+ %{(shift_i sig n i b (all_blank sig n))} %{(shift_i sig n i a a1::rss)}
+ %[%[@H1 |@daemon ]
+ |>Ht2 in Htout1; #Htout >Htout //
+ whd in match (left ??); whd in match (right ??);
+ >reverse_append >reverse_single >associative_append >reverse_cons
+ >associative_append //
+ ]
+ ]
+ ]
+ ]
+qed.
+
+theorem sem_shift_i_L_new: ∀sig,n,i.
+ shift_i_L sig n i ⊨ R_shift_i_L_new sig n i.
+#sig #n #i
+@(Realize_to_Realize … (sem_shift_i_L sig n i))
+#t1 #t2 #H #a #ls #rs #Ht1 lapply (H a ls rs Ht1) *
+ [* #rs1 * #b * #rs2 * #a1 * #rss * * * * #H1 #H2 #H3 #H4 #Ht2
+ %{rs1} %{b} %{(b::rs2)} %{(a1::rss)}
+ %[%[%[%[%[//|@H2]|@H1]|@H3]|@H4] | whd in match (tail ??); @Ht2]
+ |* #b * #rss * * #H1 #H2 #Ht2
+ %{rs} %{(all_blank sig n)} %{[]} %{(rss@[b])}
+ %[%[%[%[%[//|@blank_all_blank]|//]|@H1]|@H2] | whd in match (tail ??); @Ht2]
+ ]
+qed.
+
+
+(*******************************************************************************
+The following machine implements a full move of for a trace: we reach the left
+border, shift the i-th trace and come back to the head position. *)
+
+(* this exclude the possibility that traces do not overlap: the head must
+remain inside all traces *)
+
+definition mtiL ≝ λsig,n,i.
+ move_to_blank_L sig n i ·
+ shift_i_L sig n i ·
+ move_until ? L (no_head sig n).
+
+definition Rmtil ≝ λsig,n,i,t1,t2.
+ ∀ls,a,rs.
+ t1 = midtape (multi_sig sig n) ls a rs →
+ nth n ? (vec … a) (blank ?) = head ? →
+ (∀i.regular_trace sig n a ls rs i) →
+ (* next: we cannot be on rightof on trace i *)
+ (nth i ? (vec … a) (blank ?) = (blank ?)
+ → nth i ? (vec … (hd ? rs (all_blank …))) (blank ?) ≠ (blank ?)) →
+ no_head_in … ls →
+ no_head_in … rs →
+ (∃ls1,a1,rs1.
+ t2 = midtape (multi_sig …) ls1 a1 rs1 ∧
+ (∀i.regular_trace … a1 ls1 rs1 i) ∧
+ (∀j. j ≤ n → j ≠ i → to_blank_i ? n j (a1::ls1) = to_blank_i ? n j (a::ls)) ∧
+ (∀j. j ≤ n → j ≠ i → to_blank_i ? n j rs1 = to_blank_i ? n j rs) ∧
+ (to_blank_i ? n i ls1 = to_blank_i ? n i (a::ls)) ∧
+ (to_blank_i ? n i (a1::rs1)) = to_blank_i ? n i rs).
+
+theorem sem_Rmtil: ∀sig,n,i. i < n → mtiL sig n i ⊨ Rmtil sig n i.
+#sig #n #i #lt_in
+@(sem_seq_app ??????
+ (sem_move_to_blank_L … )
+ (sem_seq ????? (sem_shift_i_L_new …)
+ (ssem_move_until_L ? (no_head sig n))))
+#tin #tout * #t1 * * #_ #Ht1 * #t2 * #Ht2 * #_ #Htout
+(* we start looking into Rmitl *)
+#ls #a #rs #Htin (* tin is a midtape *)
+#Hhead #Hreg #no_rightof #Hnohead_ls #Hnohead_rs
+cut (regular_i sig n (a::ls) i)
+ [cases (Hreg i) * //
+ cases (true_or_false (nth i ? (vec … a) (blank ?) == (blank ?))) #Htest
+ [#_ @daemon (* absurd, since hd rs non e' blank *)
+ |#H #_ @daemon]] #Hreg1
+lapply (Ht1 … Htin Hreg1 ?) [#j #_ @Hreg] -Ht1 -Htin
+* #b * #ls1 * #ls2 * * * * * #reg_ls1_i #reg_ls1_j #Hno_blankb #Hhead #Hls1 #Ht1
+lapply (Ht2 … Ht1) -Ht2 -Ht1
+* #rs1 * #b0 * #rs2 * #rss * * * * * #Hb0 #Hb0blank #Hrs1 #Hrs1b #Hrss #Ht2
+(* we need to recover the position of the head of the emulated machine
+ that is the head of ls1. This is somewhere inside rs1 *)
+cut (∃rs11. rs1 = (reverse ? ls1)@rs11)
+ [cut (ls1 = [ ] ∨ ∃aa,tlls1. ls1 = aa::tlls1)
+ [cases ls1 [%1 // | #aa #tlls1 %2 %{aa} %{tlls1} //]] *
+ [#H1ls1 %{rs1} >H1ls1 //
+ |* #aa * #tlls1 #H1ls1 >H1ls1 in Hrs1;
+ cut (aa = a) [>H1ls1 in Hls1; #H @(to_blank_hd … H)] #eqaa >eqaa
+ #Hrs1_aux cases (compare_append … (sym_eq … Hrs1_aux)) #l *
+ [* #H1 #H2 %{l} @H1
+ |(* this is absurd : if l is empty, the case is as before.
+ if l is not empty then it must start with a blank, since it is the
+ first character in rs2. But in this case we would have a blank
+ inside ls1=a::tls1 that is absurd *)
+ @daemon
+ ]]]
+ * #rs11 #H1
+cut (rs = rs11@rs2)
+ [@(injective_append_l … (reverse … ls1)) >Hrs1 <associative_append <H1 //] #H2
+lapply (Htout … Ht2) -Htout -Ht2 *
+ [(* the current character on trace i holds the head-mark.
+ The case is absurd, since b0 is the head of rs2, that is a sublist of rs,
+ and the head-mark is not in rs *)
+ * #H3 @False_ind @(absurd (nth n ? (vec … b0) (blank sig) = head ?))
+ [@(\P ?) @injective_notb @H3 ]
+ @Hnohead_rs >H2 >trace_append @mem_append_l2
+ lapply Hb0 cases rs2
+ [whd in match (hd ???); #H >H in H3; whd in match (no_head ???);
+ >all_blank_n normalize -H #H destruct (H); @False_ind
+ |#c #r #H4 %1 >H4 //
+ ]
+ |*
+ [(* we reach the head position *)
+ (* cut (trace sig n j (a1::ls20)=trace sig n j (ls1@b::ls2)) *)
+ * #ls10 * #a1 * #ls20 * * * #Hls20 #Ha1 #Hnh #Htout
+ cut (∀j.j ≠ i →
+ trace sig n j (reverse (multi_sig sig n) rs1@b::ls2) =
+ trace sig n j (ls10@a1::ls20))
+ [#j #ineqj >append_cons <reverse_cons >trace_def <map_append <reverse_map
+ lapply (trace_shift_neq …lt_in ? (sym_not_eq … ineqj) … Hrss) [//] #Htr
+ <(trace_def … (b::rs1)) <Htr >reverse_map >map_append @eq_f @Hls20 ]
+ #Htracej
+ cut (trace sig n i (reverse (multi_sig sig n) (rs1@[b0])@ls2) =
+ trace sig n i (ls10@a1::ls20))
+ [>trace_def <map_append <reverse_map <map_append <(trace_def … [b0])
+ cut (trace sig n i [b0] = [blank ?]) [@daemon] #Hcut >Hcut
+ lapply (trace_shift … lt_in … Hrss) [//] whd in match (tail ??); #Htr <Htr
+ >reverse_map >map_append <trace_def <Hls20 %
+ ]
+ #Htracei
+ cut (∀j. j ≠ i →
+ (trace sig n j (reverse (multi_sig sig n) rs11) = trace sig n j ls10) ∧
+ (trace sig n j (ls1@b::ls2) = trace sig n j (a1::ls20)))
+ [@daemon (* si fa
+ #j #ineqj @(first_P_to_eq ? (λx. x ≠ head ?))
+ [lapply (Htracej … ineqj) >trace_def in ⊢ (%→?); <map_append
+ >trace_def in ⊢ (%→?); <map_append #H @H
+ | *) ] #H2
+ cut ((trace sig n i (b0::reverse ? rs11) = trace sig n i (ls10@[a1])) ∧
+ (trace sig n i (ls1@ls2) = trace sig n i ls20))
+ [>H1 in Htracei; >reverse_append >reverse_single >reverse_append
+ >reverse_reverse >associative_append >associative_append
+ @daemon
+ ] #H3
+ cut (∀j. j ≠ i →
+ trace sig n j (reverse (multi_sig sig n) ls10@rs2) = trace sig n j rs)
+ [#j #jneqi @(injective_append_l … (trace sig n j (reverse ? ls1)))
+ >map_append >map_append >Hrs1 >H1 >associative_append
+ <map_append <map_append in ⊢ (???%); @eq_f
+ <map_append <map_append @eq_f2 // @sym_eq
+ <(reverse_reverse … rs11) <reverse_map <reverse_map in ⊢ (???%);
+ @eq_f @(proj1 … (H2 j jneqi))] #Hrs_j
+ %{ls20} %{a1} %{(reverse ? (b0::ls10)@tail (multi_sig sig n) rs2)}
+ %[%[%[%[%[@Htout
+ |#j cases (decidable_eq_nat j i)
+ [#eqji >eqji (* by cases wether a1 is blank *)
+ @daemon
+ |#jneqi lapply (reg_ls1_j … jneqi) #H4
+ >reverse_cons >associative_append >Hb0 @regular_cons_hd_rs
+ @(eq_trace_to_regular … H4)
+ [<hd_trace >(proj2 … (H2 … jneqi)) >hd_trace %
+ |<tail_trace >(proj2 … (H2 … jneqi)) >tail_trace %
+ |@sym_eq @Hrs_j //
+ ]
+ ]]
+ |#j #lejn #jneqi <(Hls1 … lejn)
+ >to_blank_i_def >to_blank_i_def @eq_f @sym_eq @(proj2 … (H2 j jneqi))]
+ |#j #lejn #jneqi >reverse_cons >associative_append >Hb0
+ <to_blank_hd_cons >to_blank_i_def >to_blank_i_def @eq_f @Hrs_j //]
+ |<(Hls1 i) [2:@lt_to_le //]
+ lapply (all_blank_after_blank … reg_ls1_i)
+ [@(\P ?) @daemon] #allb_ls2
+ whd in match (to_blank_i ????); <(proj2 … H3)
+ @daemon ]
+ |>reverse_cons >associative_append
+ cut (to_blank_i sig n i rs = to_blank_i sig n i (rs11@[b0])) [@daemon]
+ #Hcut >Hcut >(to_blank_i_chop … b0 (a1::reverse …ls10)) [2: @Hb0blank]
+ >to_blank_i_def >to_blank_i_def @eq_f
+ >trace_def >trace_def @injective_reverse >reverse_map >reverse_cons
+ >reverse_reverse >reverse_map >reverse_append >reverse_single @sym_eq
+ @(proj1 … H3)
+ ]
+ |(*we do not find the head: this is absurd *)
+ * #b1 * #lss * * #H2 @False_ind
+ cut (∀x0. mem ? x0 (trace sig n n (b0::reverse ? rss@ls2)) → x0 ≠ head ?)
+ [@daemon] -H2 #H2
+ lapply (trace_shift_neq sig n i n … lt_in … Hrss)
+ [@lt_to_not_eq @lt_in | // ]
+ #H3 @(absurd
+ (nth n ? (vec … (hd ? (ls1@[b]) (all_blank sig n))) (blank ?) = head ?))
+ [>Hhead //
+ |@H2 >trace_def %2 <map_append @mem_append_l1 <reverse_map <trace_def
+ >H3 >H1 >trace_def >reverse_map >reverse_cons >reverse_append
+ >reverse_reverse >associative_append <map_append @mem_append_l2
+ cases ls1 [%1 % |#x #ll %1 %]
+ ]
+ ]
+ ]
+qed.
open Printf
-open GrafiteTypes
-open MatitaGtkMisc
open MatitaGuiTypes
-open GtkSourceView2
+open GtkSourceView3
let matita_script_current = ref (fun _ -> (assert false : < advance: ?statement:string -> unit -> unit; status: GrafiteTypes.status >));;
let register_matita_script_current f = matita_script_current := f;;
*)
class clickableMathView obj =
-let text_width = 80 in
+(*let text_width = 80 in*)
object (self)
- inherit GSourceView2.source_view obj
+ inherit GSourceView3.source_view obj
method strings_of_selection = (assert false : (paste_kind * string) list)
self#buffer#apply_tag all_tag ~start:(self#buffer#get_iter `START)
~stop:(self#buffer#get_iter `END);
ignore(all_tag#connect#event
- ~callback:(fun ~origin event pos ->
+ ~callback:(fun ~origin:_ event _pos ->
match GdkEvent.get_type event with
| `MOTION_NOTIFY ->
Gdk.Window.set_cursor
| _ -> false));
let hyperlink_tag = self#buffer#create_tag [] in
ignore(hyperlink_tag#connect#event
- ~callback:(fun ~origin event pos ->
+ ~callback:(fun ~origin:_ event pos ->
let offset = (new GText.iter pos)#offset in
let _,_,href =
try
List.find
- (fun (start,stop,href) -> start <= offset && offset <= stop
+ (fun (start,stop,_href) -> start <= offset && offset <= stop
) hyperlinks
with
Not_found -> assert false
false
| _ -> false));
List.iter
- ( fun (start,stop,(href : string)) ->
+ ( fun (start,stop,(_href : string)) ->
self#buffer#apply_tag hyperlink_tag
~start:(self#buffer#get_iter_at_char start)
~stop:(self#buffer#get_iter_at_char (stop+1));
Gobject.set_params (Gobject.try_cast obj "GtkSourceView") pl;
new _cicMathView obj)(*)) ?auto_indent ?highlight_current_line ?indent_on_tab ?indent_width ?insert_spaces_instead_of_tabs ?right_margin_position ?show_line_marks ?show_line_numbers ?show_right_margin ?smart_home_end ?tab_width ?editable ?cursor_visible ?justification ?wrap_mode ?accepts_tab ?border_width*) [] ?width ?height ?packing ?show () :> cicMathView)
-let screenshot status sequents metasenv subst (filename as ofn) =
+let screenshot _status _sequents _metasenv _subst (_filename (*as ofn*)) =
() (*MATITA 1.0
let w = GWindow.window ~title:"screenshot" () in
let width = 500 in
$(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 ########################################################################
(* 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/
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/
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
(* 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
]
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 #_ #_ #_
⬆*[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): â¦\83G,L,ApplOmega4 s0 sâ¦\84 â\8a\90+ ⦃G,L,ApplOmega1 s0 s⦄.
+lemma fqup_ApplOmega_41 (G) (L) (s0) (s): â¦\83G,L,ApplOmega4 s0 sâ¦\84 â¬\82+ ⦃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.
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
(* 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
(* 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).
(* 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
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
(* 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 ≝ {
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.
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/
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 ]
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-.
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
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
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 →
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
(* 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
(* *)
(**************************************************************************)
+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
]
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/
]
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
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
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
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
]
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
*)
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/
(* 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* *)
(**************************************************************************)
-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 <minus_n_n #T #HT1 #HT2
-/2 width=3 by cprs_div/
-qed-.
-
-lemma cnv_cpms_fwd_appl_sn_decompose (a) (h) (G) (L):
- ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T ![a,h] → ∀n,X. ⦃G,L⦄ ⊢ ⓐV.T ➡*[n,h] X →
- ∃∃U. ⦃G,L⦄ ⊢ T ![a,h] & ⦃G,L⦄ ⊢ T ➡*[n,h] U & ⦃G,L⦄ ⊢ ⓐV.U ⬌*[h] X.
-#a #h #G #L #V #T #H0 #n #X #HX
-elim (cnv_inv_appl … H0) #m #p #W #U #_ #_ #HT #_ #_ -m -p -W -U
-elim (cnv_fwd_cpms_total … h n … HT) #U #HTU
-lapply (cpms_appl_dx … V V … HTU) [ // ] #H
-/3 width=8 by cnv_cpms_conf_eq, ex3_intro/
+lemma cnv_cpcs_dec (h) (a) (G) (L):
+ ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → ∀T2. ⦃G,L⦄ ⊢ T2 ![h,a] →
+ Decidable … (⦃G,L⦄ ⊢ T1 ⬌*[h] T2).
+#h #a #G #L #T1 #HT1 #T2 #HT2
+elim (cnv_fwd_aaa … HT1) -HT1 #A1 #HA1
+elim (cnv_fwd_aaa … HT2) -HT2 #A2 #HA2
+/3 width=2 by csx_cpcs_dec, aaa_csx/
qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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_equivalence/cpes.ma".
+include "basic_2/dynamic/cnv.ma".
+
+(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
+
+(* Properties with t-bound rt-equivalence for terms *************************)
+
+lemma cnv_appl_cpes (h) (a) (G) (L):
+ ∀n. ad a n →
+ ∀V. ⦃G,L⦄ ⊢ V ![h,a] → ∀T. ⦃G,L⦄ ⊢ T ![h,a] →
+ ∀W. ⦃G,L⦄ ⊢ V ⬌*[h,1,0] W →
+ ∀p,U. ⦃G,L⦄ ⊢ T ➡*[n,h] ⓛ{p}W.U → ⦃G,L⦄ ⊢ ⓐV.T ![h,a].
+#h #a #G #L #n #Hn #V #HV #T #HT #W *
+/4 width=11 by cnv_appl, cpms_cprs_trans, cpms_bind/
+qed.
+
+lemma cnv_cast_cpes (h) (a) (G) (L):
+ ∀U. ⦃G,L⦄ ⊢ U ![h,a] →
+ ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ⦃G,L⦄ ⊢ U ⬌*[h,0,1] T → ⦃G,L⦄ ⊢ ⓝU.T ![h,a].
+#h #a #G #L #U #HU #T #HT * /2 width=3 by cnv_cast/
+qed.
+
+(* Inversion lemmas with t-bound rt-equivalence for terms *******************)
+
+lemma cnv_inv_appl_cpes (h) (a) (G) (L):
+ ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T ![h,a] →
+ ∃∃n,p,W,U. ad a n & ⦃G,L⦄ ⊢ V ![h,a] & ⦃G,L⦄ ⊢ T ![h,a] &
+ ⦃G,L⦄ ⊢ V ⬌*[h,1,0] W & ⦃G,L⦄ ⊢ T ➡*[n,h] ⓛ{p}W.U.
+#h #a #G #L #V #T #H
+elim (cnv_inv_appl … H) -H #n #p #W #U #Hn #HV #HT #HVW #HTU
+/3 width=7 by cpms_div, ex5_4_intro/
+qed-.
+
+lemma cnv_inv_cast_cpes (h) (a) (G) (L):
+ ∀U,T. ⦃G,L⦄ ⊢ ⓝU.T ![h,a] →
+ ∧∧ ⦃G,L⦄ ⊢ U ![h,a] & ⦃G,L⦄ ⊢ T ![h,a] & ⦃G,L⦄ ⊢ U ⬌*[h,0,1] T.
+#h #a #G #L #U #T #H
+elim (cnv_inv_cast … H) -H
+/3 width=3 by cpms_div, and3_intro/
+qed-.
+
+(* Eliminators with t-bound rt-equivalence for terms ************************)
+
+lemma cnv_ind_cpes (h) (a) (Q:relation3 genv lenv term):
+ (∀G,L,s. Q G L (⋆s)) →
+ (∀I,G,K,V. ⦃G,K⦄ ⊢ V![h,a] → Q G K V → Q G (K.ⓑ{I}V) (#O)) →
+ (∀I,G,K,i. ⦃G,K⦄ ⊢ #i![h,a] → Q G K (#i) → Q G (K.ⓘ{I}) (#(↑i))) →
+ (∀p,I,G,L,V,T. ⦃G,L⦄ ⊢ V![h,a] → ⦃G,L.ⓑ{I}V⦄⊢T![h,a] →
+ Q G L V →Q G (L.ⓑ{I}V) T →Q G L (ⓑ{p,I}V.T)
+ ) →
+ (∀n,p,G,L,V,W,T,U. ad a n → ⦃G,L⦄ ⊢ V![h,a] → ⦃G,L⦄ ⊢ T![h,a] →
+ ⦃G,L⦄ ⊢ V ⬌*[h,1,0]W → ⦃G,L⦄ ⊢ T ➡*[n,h] ⓛ{p}W.U →
+ Q G L V → Q G L T → Q G L (ⓐV.T)
+ ) →
+ (∀G,L,U,T. ⦃G,L⦄⊢ U![h,a] → ⦃G,L⦄ ⊢ T![h,a] → ⦃G,L⦄ ⊢ U ⬌*[h,0,1] T →
+ Q G L U → Q G L T → Q G L (ⓝU.T)
+ ) →
+ ∀G,L,T. ⦃G,L⦄⊢ T![h,a] → Q G L T.
+#h #a #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #G #L #T #H
+elim H -G -L -T [5,6: /3 width=7 by cpms_div/ |*: /2 width=1 by/ ]
+qed-.
(* Sub diamond propery with t-bound rt-transition for terms *****************)
fact cnv_cpm_conf_lpr_atom_atom_aux (h) (G) (L1) (L2) (I):
- ∃∃T. ⦃G,L1⦄ ⊢ ⓪{I} ➡*[0,h] T & ⦃G, L2⦄ ⊢ ⓪{I} ➡*[O,h] T.
+ ∃∃T. ⦃G,L1⦄ ⊢ ⓪{I} ➡*[0,h] T & ⦃G,L2⦄ ⊢ ⓪{I} ➡*[O,h] T.
/2 width=3 by ex2_intro/ qed-.
fact cnv_cpm_conf_lpr_atom_ess_aux (h) (G) (L1) (L2) (s):
- ∃∃T. ⦃G,L1⦄ ⊢ ⋆s ➡*[1,h] T & ⦃G,L2⦄ ⊢ ⋆(next h s) ➡*[h] T.
+ ∃∃T. ⦃G,L1⦄ ⊢ ⋆s ➡*[1,h] T & ⦃G,L2⦄ ⊢ ⋆(⫯[h]s) ➡*[h] T.
/3 width=3 by cpm_cpms, ex2_intro/ qed-.
-fact cnv_cpm_conf_lpr_atom_delta_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_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
/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
/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
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
/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
/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
/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
/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
/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
]
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
/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
/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
/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
/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
/3 width=3 by cpms_eps, ex2_intro/
qed-.
-fact cnv_cpm_conf_lpr_epsilon_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_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
/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
/2 width=3 by ex2_intro/
qed-.
-fact cnv_cpm_conf_lpr_ee_ee_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_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
/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_O_n
/2 width=1 by cnv_cpm_conf_lpr_atom_atom_aux/
- | #s2 #H21 #H22 #H23 #H11 #H12 destruct -a -o -L
+ | #s2 #H21 #H22 #H23 #H11 #H12 destruct -a -L
<minus_O_n <minus_n_O
/2 width=1 by cnv_cpm_conf_lpr_atom_ess_aux/
| #K2 #V2 #XV2 #i #HLK2 #HVX2 #HXV2 #H21 #H11 #H12 destruct -IH2
| #m2 #K2 #W2 #XW2 #i #HLK2 #HWX2 #HXW2 #H21 #H22 #H11 #H12 destruct -IH2
<minus_O_n <minus_n_O
@(cnv_cpm_conf_lpr_atom_ell_aux … IH1) -IH1 /1 width=6 by/
- | #H21 #H22 #s1 #H11 #H12 #H13 destruct -a -o -L
+ | #H21 #H22 #s1 #H11 #H12 #H13 destruct -a -L
<minus_O_n <minus_n_O
/3 width=1 by cnv_cpm_conf_lpr_atom_ess_aux, ex2_commute/
- | #s2 #H21 #H22 #H23 #s1 #H11 #H12 #H13 destruct -a -o -L
+ | #s2 #H21 #H22 #H23 #s1 #H11 #H12 #H13 destruct -a -L
<minus_n_n
/2 width=1 by cnv_cpm_conf_lpr_atom_atom_aux/
| #K2 #V2 #XV2 #i2 #_ #_ #_ #H21 #s1 #H11 #H12 #H13 destruct
| #s2 #H21 #H22 #H23 #K1 #V1 #XV1 #i1 #_ #_ #_ #H11 destruct
| #K2 #V2 #XV2 #i2 #HLK2 #HVX2 #HXV2 #H21 #K1 #V1 #XV1 #i1 #HLK1 #HVX1 #HXV1 #H11 destruct -IH2
@(cnv_cpm_conf_lpr_delta_delta_aux … IH1) -IH1 /1 width=13 by/
- | #m2 #K2 #W2 #XW2 #i2 #HLK2 #_ #_ #H21 #H22 #K1 #V1 #XV1 #i1 #HLK1 #_ #_ #H11 destruct -a -o -XW2 -XV1 -HL2 -HL1
+ | #m2 #K2 #W2 #XW2 #i2 #HLK2 #_ #_ #H21 #H22 #K1 #V1 #XV1 #i1 #HLK1 #_ #_ #H11 destruct -a -XW2 -XV1 -HL2 -HL1
elim cnv_cpm_conf_lpr_delta_ell_aux /1 width=8 by/
| #H21 #H22 #m1 #K1 #W1 #XW1 #i1 #HLK1 #HWX1 #HXW1 #H11 #H12 destruct -IH2
<minus_O_n <minus_n_O
@ex2_commute @(cnv_cpm_conf_lpr_atom_ell_aux … IH1) -IH1 /1 width=6 by/
| #s2 #H21 #H22 #H23 #m1 #K1 #W1 #XW1 #i1 #_ #_ #_ #H11 #H12 destruct
- | #K2 #V2 #XV2 #i2 #HLK2 #_ #_ #H21 #m1 #K1 #W1 #XW1 #i1 #HLK1 #_ #_ #H11 #H12 destruct -a -o -XV2 -XW1 -HL2 -HL1
+ | #K2 #V2 #XV2 #i2 #HLK2 #_ #_ #H21 #m1 #K1 #W1 #XW1 #i1 #HLK1 #_ #_ #H11 #H12 destruct -a -XV2 -XW1 -HL2 -HL1
elim cnv_cpm_conf_lpr_delta_ell_aux /1 width=8 by/
| #m2 #K2 #W2 #XW2 #i2 #HLK2 #HWX2 #HXW2 #H21 #H22 #m1 #K1 #W1 #XW1 #i1 #HLK1 #HWX1 #HXW1 #H11 #H12 destruct -IH2
>minus_S_S >minus_S_S
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".
(* 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 //
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 #_
]
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
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
]
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/
(* 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
(* 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
(* 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-.
(* 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):
- (â\88\80G,L,T. â¦\83G0,L0,â\93\91{p,I}V0.T0â¦\84 â\8a\90+ â¦\83G,L,Tâ¦\84 â\86\92 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):
+ (â\88\80G,L,T. â¦\83G0,L0,â\93\91{p,I}V0.T0â¦\84 â¬\82+ â¦\83G,L,Tâ¦\84 â\86\92 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
/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):
- (â\88\80G,L,T. â¦\83G0,L0,â\93\90V0.T0â¦\84 â\8a\90+ â¦\83G,L,Tâ¦\84 â\86\92 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):
+ (â\88\80G,L,T. â¦\83G0,L0,â\93\90V0.T0â¦\84 â¬\82+ â¦\83G,L,Tâ¦\84 â\86\92 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
/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):
- (â\88\80G,L,T. â¦\83G0,L0,â\93\9dV0.T0â¦\84 â\8a\90+ â¦\83G,L,Tâ¦\84 â\86\92 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):
+ (â\88\80G,L,T. â¦\83G0,L0,â\93\9dV0.T0â¦\84 â¬\82+ â¦\83G,L,Tâ¦\84 â\86\92 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
/3 width=7 by cpm_cast, tdeq_pair, ex4_intro/
qed-.
-fact cnv_cpm_tdeq_conf_lpr_aux (a) (h) (o) (G0) (L0) (T0):
- (â\88\80G,L,T. â¦\83G0,L0,T0â¦\84 â\8a\90+ â¦\83G,L,Tâ¦\84 â\86\92 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):
+ (â\88\80G,L,T. â¦\83G0,L0,T0â¦\84 â¬\82+ â¦\83G,L,Tâ¦\84 â\86\92 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
<minus_O_n
/2 width=1 by cnv_cpm_tdeq_conf_lpr_atom_atom_aux/
- | #s2 #H21 #H22 #H23 #Hs2 #H11 #H12 destruct -a -L
+ | #s2 #H21 #H22 #H23 #H11 #H12 destruct -a -L
<minus_O_n <minus_n_O
/2 width=1 by cnv_cpm_tdeq_conf_lpr_atom_ess_aux/
- | #H21 #H22 #s1 #H11 #H12 #H13 #Hs1 destruct -a -L
+ | #H21 #H22 #s1 #H11 #H12 #H13 destruct -a -L
<minus_O_n <minus_n_O
@ex4_commute /2 width=1 by cnv_cpm_tdeq_conf_lpr_atom_ess_aux/
- | #s2 #H21 #H22 #H23 #_ #s1 #H11 #H12 #H13 #_ destruct -a -L
+ | #s2 #H21 #H22 #H23 #s1 #H11 #H12 #H13 destruct -a -L
<minus_n_n
/2 width=1 by cnv_cpm_tdeq_conf_lpr_atom_atom_aux/
]
]
qed-.
-lemma cnv_cpm_tdeq_conf_lpr (a) (h) (o) (G0) (L0) (T0):
- IH_cnv_cpm_tdeq_conf_lpr a h o G0 L0 T0.
-#a #h #o #G0 #L0 #T0
+lemma cnv_cpm_tdeq_conf_lpr (h) (a) (G0) (L0) (T0):
+ IH_cnv_cpm_tdeq_conf_lpr h a G0 L0 T0.
+#h #a #G0 #L0 #T0
@(fqup_wf_ind (Ⓣ) … G0 L0 T0) -G0 -L0 -T0 #G0 #L0 #T0 #IH
/3 width=17 by cnv_cpm_tdeq_conf_lpr_aux/
qed-.
(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
-definition IH_cnv_cpm_tdeq_cpm_trans (a) (h) (o): relation3 genv lenv term ≝
- λG,L,T1. ⦃G, L⦄ ⊢ T1 ![a,h] →
- ∀n1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → T1 ≛[h,o] T →
+definition IH_cnv_cpm_tdeq_cpm_trans (h) (a): relation3 genv lenv term ≝
+ λG,L,T1. ⦃G,L⦄ ⊢ T1 ![h,a] →
+ ∀n1,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T → T1 ≛ T →
∀n2,T2. ⦃G,L⦄ ⊢ T ➡[n2,h] T2 →
- ∃∃T0. ⦃G,L⦄ ⊢ T1 ➡[n2,h] T0 & ⦃G,L⦄ ⊢ T0 ➡[n1,h] T2 & T0 ≛[h,o] T2.
+ ∃∃T0. ⦃G,L⦄ ⊢ T1 ➡[n2,h] T0 & ⦃G,L⦄ ⊢ T0 ➡[n1,h] T2 & T0 ≛ T2.
(* Transitive properties restricted rt-transition for terms *****************)
-fact cnv_cpm_tdeq_cpm_trans_sub (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) →
- (â\88\80G,L,T. â¦\83G0,L0,T0â¦\84 â\8a\90+ â¦\83G,L,Tâ¦\84 â\86\92 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) →
+ (â\88\80G,L,T. â¦\83G0,L0,T0â¦\84 â¬\82+ â¦\83G,L,Tâ¦\84 â\86\92 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
]
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-.
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
elim (cnv_cpms_strip_lpr_sub … IH2 … HVW1 … HV12 … HL12 … HL12) [|*: /2 width=2 by fqup_fpbg/ ] -HVW1 -HV12
<minus_n_O <minus_O_n #XW1 #HXW1 #HXV2
elim (cnv_cpms_strip_lpr_sub … IH2 … HTU1 … HT12 … HL12 … HL12) [|*: /2 width=2 by fqup_fpbg/ ] -HTU1 -HT12
- #X #H #HTU2 -IH2 -IH1 -L1 -V1 -T1
- elim (cpms_inv_abst_sn … H) -H #W2 #U2 #HW12 #_ #H destruct
+ #X #H #HTX2 -IH2 -IH1 -L1 -V1 -T1
+ elim (cpms_inv_abst_sn … H) -H #W2 #X2 #HW12 #_ #H destruct
elim (cprs_conf … HXW1 … HW12) -W1 #W1 #HXW1 #HW21
lapply (cpms_trans … HXV2 … HXW1) -XW1 <plus_n_O #HV2W1
- lapply (cpms_trans … HTU2 … (ⓛ{p}W1.U2) ?)
- [3:|*: /2 width=2 by cpms_bind/ ] -W2 <plus_n_O #HTU2
- /4 width=7 by cnv_appl, minus_le_trans_sn/
+ lapply (cpms_trans … HTX2 … (ⓛ{p}W1.X2) ?)
+ [3:|*: /2 width=2 by cpms_bind/ ] -W2 <plus_n_O #HTX2
+ elim (cnv_fwd_cpms_abst_dx_le … HT2 … HTX2 n) -HTX2 [| // ] #U2 #HTU2 #_ -X2
+ /2 width=7 by cnv_appl/
| #q #V2 #W10 #W20 #T10 #T20 #HV12 #HW120 #HT120 #H1 #H2 destruct
elim (cnv_inv_bind … HT1) -HT1 #HW10 #HT10
elim (cpms_inv_abst_sn … HTU1) -HTU1 #W30 #T30 #HW130 #_ #H destruct -T30
elim (cnv_cpms_strip_lpr_sub … IH2 … HVW1 … HV10 … HL12 … HL12) [|*: /2 width=2 by fqup_fpbg/ ] -HVW1 -HV10
<minus_n_O <minus_O_n #XW1 #HXW1 #HXV0
elim (cnv_cpms_strip_lpr_sub … IH2 … HTU0 … HT02 … (L2.ⓓW2) … (L2.ⓓW2)) [|*: /2 width=2 by fqup_fpbg, lpr_pair/ ] -HTU0 -HT02 -HW02
- #X #H #HTU2 -IH2 -IH1 -L1 -W0 -T0 -U1
- elim (cpms_inv_abst_sn … H) -H #W #U2 #HW3 #_ #H destruct -U3
+ #X #H #HTX2 -IH2 -IH1 -L1 -W0 -T0 -U1
+ elim (cpms_inv_abst_sn … H) -H #W #X2 #HW3 #_ #H destruct -U3
lapply (cnv_lifts … HV0 (Ⓣ) … (L2.ⓓW2) … HV02) /3 width=1 by drops_refl, drops_drop/ -HV0 #HV2
elim (cpms_lifts_sn … HXV0 (Ⓣ) … (L2.ⓓW2) … HV02) /3 width=1 by drops_refl, drops_drop/ -V0 #XW2 #HXW12 #HXVW2
lapply (cpms_lifts_bi … HXW1 (Ⓣ) … (L2.ⓓW2) … HW13 … HXW12) /3 width=1 by drops_refl, drops_drop/ -W1 -XW1 #HXW32
elim (cprs_conf … HXW32 … HW3) -W3 #W3 #HXW23 #HW3
lapply (cpms_trans … HXVW2 … HXW23) -XW2 <plus_n_O #H1
- lapply (cpms_trans … HTU2 ? (ⓛ{p}W3.U2) ?) [3:|*:/2 width=2 by cpms_bind/ ] -W #H2
- /5 width=7 by cnv_appl, cnv_bind, minus_le_trans_sn/
+ lapply (cpms_trans … HTX2 ? (ⓛ{p}W3.X2) ?) [3:|*:/2 width=2 by cpms_bind/ ] -W #H2
+ elim (cnv_fwd_cpms_abst_dx_le … HT2 … H2 n) -H2 [| // ] #U2 #HTU2 #_ -X2
+ /3 width=7 by cnv_appl, cnv_bind/
]
| #W1 #T1 #HG0 #HL0 #HT0 #H1 #x #X #H2 #L2 #HL12 destruct
elim (cnv_inv_cast … H1) -H1 #U1 #HW1 #HT1 #HWU1 #HTU1
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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/cpre.ma".
+include "basic_2/dynamic/cnv_preserve.ma".
+
+(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
+
+(* Properties with t-bound evaluation on terms ******************************)
+
+lemma cnv_cpme_trans (h) (a) (n) (G) (L):
+ ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] →
+ ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h,n] 𝐍⦃T2⦄ → ⦃G,L⦄ ⊢ T2 ![h,a].
+#h #a #n #G #L #T1 #HT1 #T2 * #HT12 #_
+/2 width=4 by cnv_cpms_trans/
+qed-.
+
+lemma cnv_cpme_cpms_conf (h) (a) (n) (G) (L):
+ ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∀T1. ⦃G,L⦄ ⊢ T ➡*[n,h] T1 →
+ ∀T2. ⦃G,L⦄ ⊢ T ➡*[h,n] 𝐍⦃T2⦄ → ⦃G,L⦄ ⊢ T1 ➡*[h] 𝐍⦃T2⦄.
+#h #a #n #G #L #T0 #HT0 #T1 #HT01 #T2 * #HT02 #HT2
+elim (cnv_cpms_conf … HT0 … HT01 … HT02) -T0 <minus_n_n #T0 #HT10 #HT20
+lapply (cprs_inv_cnr_sn … HT20 HT2) -HT20 #H destruct
+/2 width=1 by cpme_intro/
+qed-.
+
+(* Main properties with evaluation for t-bound rt-transition on terms *****)
+
+theorem cnv_cpme_mono (h) (a) (n) (G) (L):
+ ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∀T1. ⦃G,L⦄ ⊢ T ➡*[h,n] 𝐍⦃T1⦄ →
+ ∀T2. ⦃G,L⦄ ⊢ T ➡*[h,n] 𝐍⦃T2⦄ → T1 = T2.
+#h #a #n #G #L #T0 #HT0 #T1 * #HT01 #HT1 #T2 * #HT02 #HT2
+elim (cnv_cpms_conf … HT0 … HT01 … HT02) -T0 <minus_n_n #T0 #HT10 #HT20
+/3 width=7 by cprs_inv_cnr_sn, canc_dx_eq/
+qed-.
(* Sub confluence propery with t-bound rt-computation for terms *************)
-fact cnv_cpms_conf_lpr_tdeq_tdeq_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) →
- ⦃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
elim (cnv_cpms_strip_lpr_sub … IH1 … HXT2 0 X2 … HL02 L0) [|*: /4 width=2 by fpb_fpbg, cpm_fpb/ ]
<minus_n_O <minus_O_n #Y2 #HTY2 #HXY2 -HXT2
elim (IH1 … HXY1 … HXY2 … HL01 … HL02) [|*: /4 width=2 by fpb_fpbg, cpm_fpb/ ]
--a -o -L0 -X2 <minus_n_O <minus_O_n #Y #HY1 #HY2
+-a -L0 -X2 <minus_n_O <minus_O_n #Y #HY1 #HY2
lapply (cpms_trans … HTY1 … HY1) -Y1 #HT0Y
lapply (cpms_trans … HTY2 … HY2) -Y2 #HT2Y
/2 width=3 by ex2_intro/
qed-.
-fact cnv_cpms_conf_lpr_step_tdneq_sub (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 → 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
/2 width=3 by ex2_intro/
qed-.
-fact cnv_cpms_conf_lpr_tdeq_tdneq_aux (a) (h) (o) (G0) (L0) (T0) (n1) (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] →
- ∀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;
]
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
/2 width=3 by ex2_intro/
qed-.
-fact cnv_cpms_conf_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) →
- ∀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
(* 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 (**)
]
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/
]
]
(* 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
<minus_O_n <minus_n_O
]
qed-.
-fact cnv_cpms_tdeq_conf_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_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
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
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/
(* 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/
]
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 //
(* 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 //
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
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
| 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
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-.
(* 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-.
(* 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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 <minus_n_n #T #HT1 #HT2
+/2 width=3 by cprs_div/
+qed-.
+
+lemma cnv_cpms_fwd_appl_sn_decompose (h) (a) (G) (L):
+ ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T ![h,a] → ∀n,X. ⦃G,L⦄ ⊢ ⓐV.T ➡*[n,h] X →
+ ∃∃U. ⦃G,L⦄ ⊢ T ![h,a] & ⦃G,L⦄ ⊢ T ➡*[n,h] U & ⦃G,L⦄ ⊢ ⓐV.U ⬌*[h] X.
+#h #a #G #L #V #T #H0 #n #X #HX
+elim (cnv_inv_appl … H0) #m #p #W #U #_ #_ #HT #_ #_ -m -p -W -U
+elim (cnv_fwd_cpms_total h … n … HT) #U #HTU
+lapply (cpms_appl_dx … V V … HTU) [ // ] #H
+/3 width=8 by cnv_cpms_conf_eq, ex3_intro/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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/cpre_cpre.ma".
+include "basic_2/rt_equivalence/cpes.ma".
+include "basic_2/dynamic/cnv_cpme.ma".
+
+(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
+
+(* Properties with t-bound rt-equivalence for terms *************************)
+
+lemma cnv_cpes_dec (h) (a) (n1) (n2) (G) (L):
+ ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → ∀T2. ⦃G,L⦄ ⊢ T2 ![h,a] →
+ Decidable … (⦃G,L⦄ ⊢ T1 ⬌*[h,n1,n2] T2).
+#h #a #n1 #n2 #G #L #T1 #HT1 #T2 #HT2
+elim (cnv_fwd_aaa … HT1) #A1 #HA1
+elim (cnv_fwd_aaa … HT2) #A2 #HA2
+elim (cpme_total_aaa h n1 … HA1) -HA1 #U1 #HTU1
+elim (cpme_total_aaa h n2 … HA2) -HA2 #U2 #HTU2
+elim (eq_term_dec U1 U2) [ #H destruct | #HnU12 ]
+[ cases HTU1 -HTU1 #HTU1 #_
+ cases HTU2 -HTU2 #HTU2 #_
+ /3 width=3 by cpms_div, or_introl/
+| @or_intror * #T0 #HT10 #HT20
+ lapply (cnv_cpme_cpms_conf … HT1 … HT10 … HTU1) -T1 #H1
+ lapply (cnv_cpme_cpms_conf … HT2 … HT20 … HTU2) -T2 #H2
+ /3 width=6 by cpre_mono/
+]
+qed-.
(* Inductive premises for the preservation results **************************)
-definition IH_cnv_cpm_trans_lpr (a) (h): relation3 genv lenv term ≝
- λG,L1,T1. ⦃G, L1⦄ ⊢ T1 ![a,h] →
- ∀n,T2. ⦃G, L1⦄ ⊢ T1 ➡[n,h] T2 →
- ∀L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L2⦄ ⊢ T2 ![a,h].
+definition IH_cnv_cpm_trans_lpr (h) (a): relation3 genv lenv term ≝
+ λG,L1,T1. ⦃G,L1⦄ ⊢ T1 ![h,a] →
+ ∀n,T2. ⦃G,L1⦄ ⊢ T1 ➡[n,h] T2 →
+ ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T2 ![h,a].
-definition IH_cnv_cpms_trans_lpr (a) (h): relation3 genv lenv term ≝
- λG,L1,T1. ⦃G, L1⦄ ⊢ T1 ![a,h] →
- ∀n,T2. ⦃G, L1⦄ ⊢ T1 ➡*[n,h] T2 →
- ∀L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L2⦄ ⊢ T2 ![a,h].
+definition IH_cnv_cpms_trans_lpr (h) (a): relation3 genv lenv term ≝
+ λG,L1,T1. ⦃G,L1⦄ ⊢ T1 ![h,a] →
+ ∀n,T2. ⦃G,L1⦄ ⊢ T1 ➡*[n,h] T2 →
+ ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T2 ![h,a].
-definition IH_cnv_cpm_conf_lpr (a) (h): relation3 genv lenv term ≝
- λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
- ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡[n2,h] T2 →
- ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
+definition IH_cnv_cpm_conf_lpr (h) (a): relation3 genv lenv term ≝
+ λG,L0,T0. ⦃G,L0⦄ ⊢ T0 ![h,a] →
+ ∀n1,T1. ⦃G,L0⦄ ⊢ T0 ➡[n1,h] T1 → ∀n2,T2. ⦃G,L0⦄ ⊢ T0 ➡[n2,h] T2 →
+ ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
-definition IH_cnv_cpms_strip_lpr (a) (h): relation3 genv lenv term ≝
- λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
- ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡[n2,h] T2 →
- ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
+definition IH_cnv_cpms_strip_lpr (h) (a): relation3 genv lenv term ≝
+ λG,L0,T0. ⦃G,L0⦄ ⊢ T0 ![h,a] →
+ ∀n1,T1. ⦃G,L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G,L0⦄ ⊢ T0 ➡[n2,h] T2 →
+ ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
-definition IH_cnv_cpms_conf_lpr (a) (h): relation3 genv lenv term ≝
- λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
- ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡*[n2,h] T2 →
- ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
+definition IH_cnv_cpms_conf_lpr (h) (a): relation3 genv lenv term ≝
+ λG,L0,T0. ⦃G,L0⦄ ⊢ T0 ![h,a] →
+ ∀n1,T1. ⦃G,L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G,L0⦄ ⊢ T0 ➡*[n2,h] T2 →
+ ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G,L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G,L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
(* Auxiliary properties for preservation ************************************)
-fact cnv_cpms_trans_lpr_sub (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_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-.
(* 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
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/
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
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/
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-.
(* 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:
(* 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
(* 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-.
(* 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-.
(* 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 *
(* 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 *
(* 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
(* 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-.
(* 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/
(**************************************************************************)
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/
(* 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-.
(* 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/
(* 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
(* 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
(* 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-.
(* 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 *
(**************************************************************************)
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/
]
(* 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-.
(* 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
/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
(* 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
(* 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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-.
(* 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
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
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
(**************************************************************************)
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
<minus_O_n <minus_n_O #X #HX0 #H
elim (cpms_inv_abst_sn … H) -H #X3 #X4 #HX13 #HX24 #H destruct
-@(cnv_cast … (ⓐV.X0)) [2:|*: /2 width=1 by cpms_appl_dx/ ]
-@(cnv_appl … X3) [4: |*: /2 width=7 by cpms_trans, cpms_cprs_trans/ ]
-#H destruct
+@(cnv_cast … (ⓐV.X0)) [2:|*: /2 width=1 by cpms_appl_dx/ ] (**) (* full auto a bit slow *)
+/3 width=10 by cnv_appl, cpms_trans, cpms_cprs_trans/
qed.
(* Basic_1: uses: ty3_sred_wcpr0_pr0 *)
-lemma nta_cpr_conf_lpr (a) (h) (G):
- ∀L1,T1,U. ⦃G,L1⦄ ⊢ T1 :[a,h] U → ∀T2. ⦃G,L1⦄ ⊢ T1 ➡[h] T2 →
- ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T2 :[a,h] U.
-#a #h #G #L1 #T1 #U #H #T2 #HT12 #L2 #HL12
+lemma nta_cpr_conf_lpr (h) (a) (G):
+ ∀L1,T1,U. ⦃G,L1⦄ ⊢ T1 :[h,a] U → ∀T2. ⦃G,L1⦄ ⊢ T1 ➡[h] T2 →
+ ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T2 :[h,a] U.
+#h #a #G #L1 #T1 #U #H #T2 #HT12 #L2 #HL12
/3 width=6 by cnv_cpm_trans_lpr, cpm_cast/
qed-.
(* Basic_1: uses: ty3_sred_pr2 ty3_sred_pr0 *)
-lemma nta_cpr_conf (a) (h) (G) (L):
- ∀T1,U. ⦃G,L⦄ ⊢ T1 :[a,h] U →
- ∀T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → ⦃G,L⦄ ⊢ T2 :[a,h] U.
-#a #h #G #L #T1 #U #H #T2 #HT12
+lemma nta_cpr_conf (h) (a) (G) (L):
+ ∀T1,U. ⦃G,L⦄ ⊢ T1 :[h,a] U →
+ ∀T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → ⦃G,L⦄ ⊢ T2 :[h,a] U.
+#h #a #G #L #T1 #U #H #T2 #HT12
/3 width=6 by cnv_cpm_trans, cpm_cast/
qed-.
(* Note: this is the preservation property *)
(* Basic_1: uses: ty3_sred_pr3 ty3_sred_pr1 *)
-lemma nta_cprs_conf (a) (h) (G) (L):
- ∀T1,U. ⦃G,L⦄ ⊢ T1 :[a,h] U →
- ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → ⦃G,L⦄ ⊢ T2 :[a,h] U.
-#a #h #G #L #T1 #U #H #T2 #HT12
+lemma nta_cprs_conf (h) (a) (G) (L):
+ ∀T1,U. ⦃G,L⦄ ⊢ T1 :[h,a] U →
+ ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 → ⦃G,L⦄ ⊢ T2 :[h,a] U.
+#h #a #G #L #T1 #U #H #T2 #HT12
/3 width=6 by cnv_cpms_trans, cpms_cast/
qed-.
(* Basic_1: uses: ty3_cred_pr2 *)
-lemma nta_lpr_conf (a) (h) (G):
- ∀L1,T,U. ⦃G,L1⦄ ⊢ T :[a,h] U →
- ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T :[a,h] U.
-#a #h #G #L1 #T #U #HTU #L2 #HL12
+lemma nta_lpr_conf (h) (a) (G):
+ ∀L1,T,U. ⦃G,L1⦄ ⊢ T :[h,a] U →
+ ∀L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L2⦄ ⊢ T :[h,a] U.
+#h #a #G #L1 #T #U #HTU #L2 #HL12
/2 width=3 by cnv_lpr_trans/
qed-.
(* Basic_1: uses: ty3_cred_pr3 *)
-lemma nta_lprs_conf (a) (h) (G):
- ∀L1,T,U. ⦃G,L1⦄ ⊢ T :[a,h] U →
- ∀L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → ⦃G,L2⦄ ⊢ T :[a,h] U.
-#a #h #G #L1 #T #U #HTU #L2 #HL12
+lemma nta_lprs_conf (h) (a) (G):
+ ∀L1,T,U. ⦃G,L1⦄ ⊢ T :[h,a] U →
+ ∀L2. ⦃G,L1⦄ ⊢ ➡*[h] L2 → ⦃G,L2⦄ ⊢ T :[h,a] U.
+#h #a #G #L1 #T #U #HTU #L2 #HL12
/2 width=3 by cnv_lprs_trans/
qed-.
(* Inversion lemmas based on preservation ***********************************)
-lemma nta_inv_ldef_sn (a) (h) (G) (K) (V):
- ∀X2. ⦃G,K.ⓓV⦄ ⊢ #0 :[a,h] X2 →
- ∃∃W,U. ⦃G,K⦄ ⊢ V :[a,h] W & ⬆*[1] W ≘ U & ⦃G,K.ⓓV⦄ ⊢ U ⬌*[h] X2 & ⦃G,K.ⓓV⦄ ⊢ X2 ![a,h].
-#a #h #G #Y #X #X2 #H
+lemma nta_inv_ldef_sn (h) (a) (G) (K) (V):
+ ∀X2. ⦃G,K.ⓓV⦄ ⊢ #0 :[h,a] X2 →
+ ∃∃W,U. ⦃G,K⦄ ⊢ V :[h,a] W & ⬆*[1] W ≘ 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_delta_sn … H2) -H2 *
]
qed-.
-lemma nta_inv_lref_sn (a) (h) (G) (L):
- ∀X2,i. ⦃G,L⦄ ⊢ #↑i :[a,h] X2 →
- ∃∃I,K,T2,U2. ⦃G,K⦄ ⊢ #i :[a,h] T2 & ⬆*[1] T2 ≘ U2 & ⦃G,K.ⓘ{I}⦄ ⊢ U2 ⬌*[h] X2 & ⦃G,K.ⓘ{I}⦄ ⊢ X2 ![a,h] & L = K.ⓘ{I}.
-#a #h #G #L #X2 #i #H
+lemma nta_inv_lref_sn (h) (a) (G) (L):
+ ∀X2,i. ⦃G,L⦄ ⊢ #↑i :[h,a] X2 →
+ ∃∃I,K,T2,U2. ⦃G,K⦄ ⊢ #i :[h,a] T2 & ⬆*[1] T2 ≘ U2 & ⦃G,K.ⓘ{I}⦄ ⊢ U2 ⬌*[h] X2 & ⦃G,K.ⓘ{I}⦄ ⊢ X2 ![h,a] & L = K.ⓘ{I}.
+#h #a #G #L #X2 #i #H
elim (cnv_inv_cast … H) -H #X1 #HX2 #H1 #HX21 #H2
elim (cnv_inv_lref … H1) -H1 #I #K #Hi #H destruct
elim (cpms_inv_lref_sn … H2) -H2 *
]
qed-.
-lemma nta_inv_lref_sn_drops_cnv (a) (h) (G) (L):
- ∀X2, i. ⦃G,L⦄ ⊢ #i :[a,h] X2 →
- ∨∨ ∃∃K,V,W,U. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V :[a,h] W & ⬆*[↑i] W ≘ U & ⦃G,L⦄ ⊢ U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![a,h]
- | ∃∃K,W,U. ⬇*[i] L ≘ K. ⓛW & ⦃G,K⦄ ⊢ W ![a,h] & ⬆*[↑i] W ≘ U & ⦃G,L⦄ ⊢ U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![a,h].
-#a #h #G #L #X2 #i #H
+lemma nta_inv_lref_sn_drops_cnv (h) (a) (G) (L):
+ ∀X2,i. ⦃G,L⦄ ⊢ #i :[h,a] X2 →
+ ∨∨ ∃∃K,V,W,U. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V :[h,a] W & ⬆*[↑i] W ≘ U & ⦃G,L⦄ ⊢ U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,a]
+ | ∃∃K,W,U. ⬇*[i] L ≘ K. ⓛW & ⦃G,K⦄ ⊢ W ![h,a] & ⬆*[↑i] W ≘ U & ⦃G,L⦄ ⊢ U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,a].
+#h #a #G #L #X2 #i #H
elim (cnv_inv_cast … H) -H #X1 #HX2 #H1 #HX21 #H2
elim (cnv_inv_lref_drops … H1) -H1 #I #K #V #HLK #HV
elim (cpms_inv_lref1_drops … H2) -H2 *
]
qed-.
-lemma nta_inv_bind_sn_cnv (a) (h) (p) (I) (G) (K) (X2):
- ∀V,T. ⦃G,K⦄ ⊢ ⓑ{p,I}V.T :[a,h] X2 →
- ∃∃U. ⦃G,K⦄ ⊢ V ![a,h] & ⦃G,K.ⓑ{I}V⦄ ⊢ T :[a,h] U & ⦃G,K⦄ ⊢ ⓑ{p,I}V.U ⬌*[h] X2 & ⦃G,K⦄ ⊢ X2 ![a,h].
-#a #h #p * #G #K #X2 #V #T #H
+lemma nta_inv_bind_sn_cnv (h) (a) (p) (I) (G) (K) (X2):
+ ∀V,T. ⦃G,K⦄ ⊢ ⓑ{p,I}V.T :[h,a] X2 →
+ ∃∃U. ⦃G,K⦄ ⊢ V ![h,a] & ⦃G,K.ⓑ{I}V⦄ ⊢ T :[h,a] U & ⦃G,K⦄ ⊢ ⓑ{p,I}V.U ⬌*[h] X2 & ⦃G,K⦄ ⊢ X2 ![h,a].
+#h #a #p * #G #K #X2 #V #T #H
elim (cnv_inv_cast … H) -H #X1 #HX2 #H1 #HX21 #H2
elim (cnv_inv_bind … H1) -H1 #HV #HT
[ elim (cpms_inv_abbr_sn_dx … H2) -H2 *
(* Basic_1: uses: ty3_gen_appl *)
lemma nta_inv_appl_sn (h) (G) (L) (X2):
- ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T :[h] X2 →
- ∃∃p,W,U. ⦃G,L⦄ ⊢ V :[h] W & ⦃G,L⦄ ⊢ T :[h] ⓛ{p}W.U & ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h].
+ ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T :[h,𝟐] X2 →
+ ∃∃p,W,U. ⦃G,L⦄ ⊢ V :[h,𝟐] W & ⦃G,L⦄ ⊢ T :[h,𝟐] ⓛ{p}W.U & ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,𝟐].
#h #G #L #X2 #V #T #H
elim (cnv_inv_cast … H) -H #X #HX2 #H1 #HX2 #H2
-elim (cnv_inv_appl … H1) * [ | #n ] #p #W #U #Hn #HV #HT #HVW #HTU
-[ lapply (cnv_cpms_trans … HT … HTU) #H
- elim (cnv_inv_bind … H) -H #_ #HU
- elim (cnv_fwd_cpm_SO … HU) #U0 #HU0 -HU
- lapply (cpms_step_dx … HTU 1 (ⓛ{p}W.U0) ?) -HTU [ /2 width=1 by cpm_bind/ ] #HTU
-| lapply (le_n_O_to_eq n ?) [ /3 width=1 by le_S_S_to_le/ ] -Hn #H destruct
-]
+elim (cnv_inv_appl … H1) #n #p #W #U #H <H -n #HV #HT #HVW #HTU
/5 width=11 by cnv_cpms_nta, cnv_cpms_conf_eq, cpcs_cprs_div, cpms_appl_dx, ex4_3_intro/
qed-.
(* Basic_2A1: uses: nta_fwd_pure1 *)
lemma nta_inv_pure_sn_cnv (h) (G) (L) (X2):
- ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T :*[h] X2 →
- ∨∨ ∃∃p,W,U. ⦃G,L⦄ ⊢ V :*[h] W & ⦃G,L⦄ ⊢ T :*[h] ⓛ{p}W.U & ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 !*[h]
- | ∃∃U. ⦃G,L⦄ ⊢ T :*[h] U & ⦃G,L⦄ ⊢ ⓐV.U !*[h] & ⦃G,L⦄ ⊢ ⓐV.U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 !*[h].
+ ∀V,T. ⦃G,L⦄ ⊢ ⓐV.T :[h,𝛚] X2 →
+ ∨∨ ∃∃p,W,U. ⦃G,L⦄ ⊢ V :[h,𝛚] W & ⦃G,L⦄ ⊢ T :[h,𝛚] ⓛ{p}W.U & ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,𝛚]
+ | ∃∃U. ⦃G,L⦄ ⊢ T :[h,𝛚] U & ⦃G,L⦄ ⊢ ⓐV.U ![h,𝛚] & ⦃G,L⦄ ⊢ ⓐV.U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,𝛚].
#h #G #L #X2 #V #T #H
elim (cnv_inv_cast … H) -H #X1 #HX2 #H1 #HX21 #H
elim (cnv_inv_appl … H1) * [| #n ] #p #W0 #T0 #Hn #HV #HT #HW0 #HT0
qed-.
(* Basic_2A1: uses: nta_inv_cast1 *)
-lemma nta_inv_cast_sn (a) (h) (G) (L) (X2):
- ∀U,T. ⦃G,L⦄ ⊢ ⓝU.T :[a,h] X2 →
- ∧∧ ⦃G,L⦄ ⊢ T :[a,h] U & ⦃G,L⦄ ⊢ U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![a,h].
-#a #h #G #L #X2 #U #T #H
+lemma nta_inv_cast_sn (h) (a) (G) (L) (X2):
+ ∀U,T. ⦃G,L⦄ ⊢ ⓝU.T :[h,a] X2 →
+ ∧∧ ⦃G,L⦄ ⊢ T :[h,a] U & ⦃G,L⦄ ⊢ U ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,a].
+#h #a #G #L #X2 #U #T #H
elim (cnv_inv_cast … H) -H #X0 #HX2 #H1 #HX20 #H2
elim (cnv_inv_cast … H1) #X #HU #HT #HUX #HTX
elim (cpms_inv_cast1 … H2) -H2 [ * || * ]
qed-.
(* Basic_1: uses: ty3_gen_cast *)
-lemma nta_inv_cast_sn_old (a) (h) (G) (L) (X2):
- ∀T0,T1. ⦃G,L⦄ ⊢ ⓝT1.T0 :[a,h] X2 →
- ∃∃T2. ⦃G,L⦄ ⊢ T0 :[a,h] T1 & ⦃G,L⦄ ⊢ T1 :[a,h] T2 & ⦃G,L⦄ ⊢ ⓝT2.T1 ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![a,h].
-#a #h #G #L #X2 #T0 #T1 #H
+lemma nta_inv_cast_sn_old (h) (a) (G) (L) (X2):
+ ∀T0,T1. ⦃G,L⦄ ⊢ ⓝT1.T0 :[h,a] X2 →
+ ∃∃T2. ⦃G,L⦄ ⊢ T0 :[h,a] T1 & ⦃G,L⦄ ⊢ T1 :[h,a] T2 & ⦃G,L⦄ ⊢ ⓝT2.T1 ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,a].
+#h #a #G #L #X2 #T0 #T1 #H
elim (cnv_inv_cast … H) -H #X0 #HX2 #H1 #HX20 #H2
elim (cnv_inv_cast … H1) #X #HT1 #HT0 #HT1X #HT0X
elim (cpms_inv_cast1 … H2) -H2 [ * || * ]
qed-.
(* Basic_1: uses: ty3_gen_lift *)
-(* Note: "⦃G,L⦄ ⊢ U2 ⬌*[h] X2" can be "⦃G,L⦄ ⊢ X2 ➡*[h] U2" *)
-lemma nta_inv_lifts_sn (a) (h) (G):
- ∀L,T2,X2. ⦃G,L⦄ ⊢ T2 :[a,h] X2 →
+(* Note: "⦃G, L⦄ ⊢ U2 ⬌*[h] X2" can be "⦃G, L⦄ ⊢ X2 ➡*[h] U2" *)
+lemma nta_inv_lifts_sn (h) (a) (G):
+ ∀L,T2,X2. ⦃G,L⦄ ⊢ T2 :[h,a] X2 →
∀b,f,K. ⬇*[b,f] L ≘ K → ∀T1. ⬆*[f] T1 ≘ T2 →
- ∃∃U1,U2. ⦃G,K⦄ ⊢ T1 :[a,h] U1 & ⬆*[f] U1 ≘ U2 & ⦃G,L⦄ ⊢ U2 ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![a,h].
-#a #h #G #L #T2 #X2 #H #b #f #K #HLK #T1 #HT12
+ ∃∃U1,U2. ⦃G,K⦄ ⊢ T1 :[h,a] U1 & ⬆*[f] U1 ≘ U2 & ⦃G,L⦄ ⊢ U2 ⬌*[h] X2 & ⦃G,L⦄ ⊢ X2 ![h,a].
+#h #a #G #L #T2 #X2 #H #b #f #K #HLK #T1 #HT12
elim (cnv_inv_cast … H) -H #U2 #HX2 #HT2 #HXU2 #HTU2
lapply (cnv_inv_lifts … HT2 … HLK … HT12) -HT2 #HT1
elim (cpms_inv_lifts_sn … HTU2 … HLK … HT12) -T2 -HLK #U1 #HU12 #HTU1
(* Forward lemmas based on preservation *************************************)
(* Basic_1: was: ty3_unique *)
-theorem nta_mono (a) (h) (G) (L) (T):
- ∀U1. ⦃G,L⦄ ⊢ T :[a,h] U1 → ∀U2. ⦃G,L⦄ ⊢ T :[a,h] U2 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2.
-#a #h #G #L #T #U1 #H1 #U2 #H2
+theorem nta_mono (h) (a) (G) (L) (T):
+ ∀U1. ⦃G,L⦄ ⊢ T :[h,a] U1 → ∀U2. ⦃G,L⦄ ⊢ T :[h,a] U2 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2.
+#h #a #G #L #T #U1 #H1 #U2 #H2
elim (cnv_inv_cast … H1) -H1 #X1 #_ #_ #HUX1 #HTX1
elim (cnv_inv_cast … H2) -H2 #X2 #_ #HT #HUX2 #HTX2
lapply (cnv_cpms_conf_eq … HT … HTX1 … HTX2) -T #HX12
(* Advanced properties ******************************************************)
(* Basic_1: uses: ty3_sconv_pc3 *)
-lemma nta_cpcs_bi (a) (h) (G) (L):
- ∀T1,U1. ⦃G,L⦄ ⊢ T1 :[a,h] U1 → ∀T2,U2. ⦃G,L⦄ ⊢ T2 :[a,h] U2 →
+lemma nta_cpcs_bi (h) (a) (G) (L):
+ ∀T1,U1. ⦃G,L⦄ ⊢ T1 :[h,a] U1 → ∀T2,U2. ⦃G,L⦄ ⊢ T2 :[h,a] U2 →
⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2.
-#a #h #G #L #T1 #U1 #HTU1 #T2 #U2 #HTU2 #HT12
+#h #a #G #L #T1 #U1 #HTU1 #T2 #U2 #HTU2 #HT12
elim (cpcs_inv_cprs … HT12) -HT12 #T0 #HT10 #HT02
/3 width=6 by nta_mono, nta_cprs_conf/
qed-.
(* Properties based on type equivalence and preservation *******************)
(* Basic_1: uses: ty3_tred *)
-lemma nta_cprs_trans (a) (h) (G) (L):
- ∀T,U1. ⦃G,L⦄ ⊢ T :[a,h] U1 → ∀U2. ⦃G,L⦄ ⊢ U1 ➡*[h] U2 → ⦃G,L⦄ ⊢ T :[a,h] U2.
-#a #h #G #L #T #U1 #H #U2 #HU12
+lemma nta_cprs_trans (h) (a) (G) (L):
+ ∀T,U1. ⦃G,L⦄ ⊢ T :[h,a] U1 → ∀U2. ⦃G,L⦄ ⊢ U1 ➡*[h] U2 → ⦃G,L⦄ ⊢ T :[h,a] U2.
+#h #a #G #L #T #U1 #H #U2 #HU12
/4 width=4 by nta_conv_cnv, nta_fwd_cnv_dx, cnv_cpms_trans, cpcs_cprs_dx/
qed-.
(* Basic_1: uses: ty3_sred_back *)
-lemma cprs_nta_trans (a) (h) (G) (L):
- ∀T1,U0. ⦃G,L⦄ ⊢ T1 :[a,h] U0 → ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 →
- ∀U. ⦃G,L⦄ ⊢ T2 :[a,h] U → ⦃G,L⦄ ⊢ T1 :[a,h] U.
-#a #h #G #L #T1 #U0 #HT1 #T2 #HT12 #U #H
+lemma cprs_nta_trans (h) (a) (G) (L):
+ ∀T1,U0. ⦃G,L⦄ ⊢ T1 :[h,a] U0 → ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 →
+ ∀U. ⦃G,L⦄ ⊢ T2 :[h,a] U → ⦃G,L⦄ ⊢ T1 :[h,a] U.
+#h #a #G #L #T1 #U0 #HT1 #T2 #HT12 #U #H
lapply (nta_cprs_conf … HT1 … HT12) -HT12 #HT2
/4 width=6 by nta_mono, nta_conv_cnv, nta_fwd_cnv_dx/
qed-.
-lemma cprs_nta_trans_cnv (a) (h) (G) (L):
- ∀T1. ⦃G,L⦄ ⊢ T1 ![a,h] → ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 →
- ∀U. ⦃G,L⦄ ⊢ T2 :[a,h] U → ⦃G,L⦄ ⊢ T1 :[a,h] U.
-#a #h #G #L #T1 #HT1 #T2 #HT12 #U #H
+lemma cprs_nta_trans_cnv (h) (a) (G) (L):
+ ∀T1. ⦃G,L⦄ ⊢ T1 ![h,a] → ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 →
+ ∀U. ⦃G,L⦄ ⊢ T2 :[h,a] U → ⦃G,L⦄ ⊢ T1 :[h,a] U.
+#h #a #G #L #T1 #HT1 #T2 #HT12 #U #H
elim (cnv_nta_sn … HT1) -HT1 #U0 #HT1
/2 width=3 by cprs_nta_trans/
qed-.
(* Basic_1: uses: ty3_sconv *)
-lemma nta_cpcs_conf (a) (h) (G) (L):
- ∀T1,U. ⦃G,L⦄ ⊢ T1 :[a,h] U → ∀T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 →
- ∀U0. ⦃G,L⦄ ⊢ T2 :[a,h] U0 → ⦃G,L⦄ ⊢ T2 :[a,h] U.
-#a #h #G #L #T1 #U #HT1 #T2 #HT12 #U0 #HT2
+lemma nta_cpcs_conf (h) (a) (G) (L):
+ ∀T1,U. ⦃G,L⦄ ⊢ T1 :[h,a] U → ∀T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 →
+ ∀U0. ⦃G,L⦄ ⊢ T2 :[h,a] U0 → ⦃G,L⦄ ⊢ T2 :[h,a] U.
+#h #a #G #L #T1 #U #HT1 #T2 #HT12 #U0 #HT2
elim (cpcs_inv_cprs … HT12) -HT12 #T0 #HT10 #HT02
/3 width=5 by cprs_nta_trans, nta_cprs_conf/
qed-.
(* Note: type preservation by valid r-equivalence *)
-lemma nta_cpcs_conf_cnv (a) (h) (G) (L):
- ∀T1,U. ⦃G,L⦄ ⊢ T1 :[a,h] U →
- ∀T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → ⦃G,L⦄ ⊢ T2 ![a,h] → ⦃G,L⦄ ⊢ T2 :[a,h] U.
-#a #h #G #L #T1 #U #HT1 #T2 #HT12 #HT2
+lemma nta_cpcs_conf_cnv (h) (a) (G) (L):
+ ∀T1,U. ⦃G,L⦄ ⊢ T1 :[h,a] U →
+ ∀T2. ⦃G,L⦄ ⊢ T1 ⬌*[h] T2 → ⦃G,L⦄ ⊢ T2 ![h,a] → ⦃G,L⦄ ⊢ T2 :[h,a] U.
+#h #a #G #L #T1 #U #HT1 #T2 #HT12 #HT2
elim (cnv_nta_sn … HT2) -HT2 #U0 #HT2
/2 width=3 by nta_cpcs_conf/
qed-.
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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_3.ma".
-include "basic_2/reduction/cpr.ma".
-
-(* NORMAL TERMS FOR CONTEXT-SENSITIVE REDUCTION *****************************)
-
-definition cnr: relation3 genv lenv term ≝ λG,L. NF … (cpr G L) (eq …).
-
-interpretation
- "normality for context-sensitive reduction (term)"
- 'PRedNormal G L T = (cnr G L T).
-
-(* Basic inversion lemmas ***************************************************)
-
-lemma cnr_inv_delta: ∀G,L,K,V,i. ⬇[i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄ → ⊥.
-#G #L #K #V #i #HLK #H
-elim (lift_total V 0 (i+1)) #W #HVW
-lapply (H W ?) -H [ /3 width=6 by cpr_delta/ ] -HLK #H destruct
-elim (lift_inv_lref2_be … HVW) -HVW /2 width=1 by ylt_inj/
-qed-.
-
-lemma cnr_inv_abst: ∀a,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓛ{a}V.T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃V⦄ ∧ ⦃G, L.ⓛV⦄ ⊢ ➡ 𝐍⦃T⦄.
-#a #G #L #V1 #T1 #HVT1 @conj
-[ #V2 #HV2 lapply (HVT1 (ⓛ{a}V2.T1) ?) -HVT1 /2 width=2 by cpr_pair_sn/ -HV2 #H destruct //
-| #T2 #HT2 lapply (HVT1 (ⓛ{a}V1.T2) ?) -HVT1 /2 width=2 by cpr_bind/ -HT2 #H destruct //
-]
-qed-.
-
-lemma cnr_inv_abbr: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃-ⓓV.T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃V⦄ ∧ ⦃G, L.ⓓV⦄ ⊢ ➡ 𝐍⦃T⦄.
-#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 cpr_bind/ -HT2 #H destruct //
-]
-qed-.
-
lemma cnr_inv_zeta: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃+ⓓV.T⦄ → ⊥.
#G #L #V #T #H elim (is_lift_dec T 0 1)
[ * #U #HTU
]
qed-.
-lemma cnr_inv_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓐV.T⦄ → ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐍⦃V⦄ & ⦃G, L⦄ ⊢ ➡ 𝐍⦃T⦄ & 𝐒⦃T⦄.
-#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 (lift_total V1 0 1) #V2 #HV12
- lapply (H (ⓓ{a}W1.ⓐV2.U1) ?) -H /3 width=3 by tpr_cpr, cpr_theta/ -HV12 #H destruct
- | lapply (H (ⓓ{a}ⓝW1.V1.U1) ?) -H /3 width=1 by tpr_cpr, cpr_beta/ #H destruct
-]
-qed-.
-
-lemma cnr_inv_eps: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓝV.T⦄ → ⊥.
-#G #L #V #T #H lapply (H T ?) -H
-/2 width=4 by cpr_eps, discr_tpair_xy_y/
-qed-.
-
-(* Basic properties *********************************************************)
-
-(* Basic_1: was: nf2_sort *)
-lemma cnr_sort: ∀G,L,s. ⦃G, L⦄ ⊢ ➡ 𝐍⦃⋆s⦄.
-#G #L #s #X #H
->(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 *)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
(* 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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).
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
(* 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
--- /dev/null
+(* 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
+
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
(* 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
+*)
(* *)
(**************************************************************************)
-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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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/
-*)
-*)
(* *)
(**************************************************************************)
-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
+ [ <minus_n_O in HU; #HU -Hn
+ /4 width=8 by ntas_inv_nta, ex6_4_intro, or_introl/
+ | lapply (le_to_le_to_eq … Hn H) -Hn -H #H destruct
+ <minus_n_n in HU; #HU
+ @or_intror
+ @(ex6_5_intro … Ha … HUX HX) -Ha -X
+ [2,4: /2 width=2 by ntas_inv_nta/
+ |6: @ntas_refl
+*)
+elim (cnv_inv_cast … H) -H #X0 #HX #HVT #HX0 #HTX0
+elim (cnv_inv_appl … HVT) #n #p #W #U0 #Ha #HV #HT #HVW #HTU0
+elim (eq_or_gt n) #Hn destruct
+[ elim (cnv_fwd_cpms_abst_dx_le … HT … HTU0 1) [| // ] <minus_n_O #U #H #HU0
+ lapply (cpms_appl_dx … V V … H) [ // ] -H #H
+ elim (cnv_cpms_conf … HVT … HTX0 … H) -HVT -HTX0 -H <minus_n_n #X1 #HX01 #HUX1
+ lapply (cpms_trans … HX0 … HX01) -X0 #HX1
+ lapply (cprs_div … HUX1 … HX1) -X1 #HUX
+ lapply (cnv_cpms_trans … HT … HTU0) #H
+ elim (cnv_inv_bind … H) -H #_ #HU0
+ /4 width=8 by cnv_cpms_ntas, cnv_cpms_nta, ex6_4_intro, or_introl/
+| >(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 <minus_n_n #X1 #HX01 #HUX1
+ lapply (cpms_trans … HX0 … HX01) -X0 #HX1
+ lapply (cprs_div … HUX1 … HX1) -X1 #HUX
+ <(S_pred … Hn) in Ha; -Hn #Ha
+ /5 width=10 by cnv_cpms_ntas, cnv_cpms_nta, cnv_cpms_trans, ex6_5_intro, or_intror/
+]
+qed-.
+
(*
definition ntas: sh → lenv → relation term ≝
(* Basic eliminators ********************************************************)
axiom ntas_ind_dx: ∀h,L,T2. ∀R:predicate term. R T2 →
- (∀T1,T. ⦃h, L⦄ ⊢ T1 : T → ⦃h, L⦄ ⊢ T :* T2 → R T → R T1) →
- ∀T1. ⦃h, L⦄ ⊢ T1 :* T2 → R T1.
+ (∀T1,T. ⦃h,L⦄ ⊢ T1 : T → ⦃h,L⦄ ⊢ T :* T2 → R T → R T1) →
+ ∀T1. ⦃h,L⦄ ⊢ T1 :* T2 → R T1.
(*
#h #L #T2 #R #HT2 #IHT2 #T1 #HT12
@(star_ind_dx … HT2 IHT2 … HT12) //
(* Basic properties *********************************************************)
lemma ntas_strap1: ∀h,L,T1,T,T2.
- ⦃h, L⦄ ⊢ T1 :* T → ⦃h, L⦄ ⊢ T : T2 → ⦃h, L⦄ ⊢ T1 :* T2.
+ ⦃h,L⦄ ⊢ T1 :* T → ⦃h,L⦄ ⊢ T : T2 → ⦃h,L⦄ ⊢ T1 :* T2.
/2 width=3/ qed.
lemma ntas_strap2: ∀h,L,T1,T,T2.
- ⦃h, L⦄ ⊢ T1 : T → ⦃h, L⦄ ⊢ T :* T2 → ⦃h, L⦄ ⊢ T1 :* T2.
+ ⦃h,L⦄ ⊢ T1 : T → ⦃h,L⦄ ⊢ T :* T2 → ⦃h,L⦄ ⊢ T1 :* T2.
/2 width=3/ qed.
*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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".
+include "basic_2/i_dynamic/ntas.ma".
+
+(* ITERATED NATIVE TYPE ASSIGNMENT FOR TERMS ********************************)
+
+(* Properties based on preservation *****************************************)
+
+lemma cnv_cpms_ntas (h) (a) (G) (L):
+ ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∀n,U.⦃G,L⦄ ⊢ T ➡*[n,h] U → ⦃G,L⦄ ⊢ T :*[h,a,n] U.
+/3 width=4 by ntas_intro, cnv_cpms_trans/ qed.
+
+(* Inversion lemmas based on preservation ***********************************)
+
+lemma ntas_inv_appl_sn (h) (a) (m) (G) (L) (V) (T):
+ ∀X. ⦃G,L⦄ ⊢ ⓐV.T :*[h,a,m] X →
+ ∨∨ ∃∃n,p,W,U,U0. n ≤ m & ad a n & ⦃G,L⦄ ⊢ V :*[h,a,1] W & ⦃G,L⦄ ⊢ T :*[h,a,n] ⓛ{p}W.U0 & ⦃G,L.ⓛW⦄ ⊢ U0 :*[h,a,m-n] U & ⦃G,L⦄ ⊢ ⓐV.ⓛ{p}W.U ⬌*[h] X & ⦃G,L⦄ ⊢ X ![h,a]
+ | ∃∃n,p,W,U,U0. m ≤ n & ad a n & ⦃G,L⦄ ⊢ V :*[h,a,1] W & ⦃G,L⦄ ⊢ T :*[h,a,m] U & ⦃G,L⦄ ⊢ U :*[h,a,n-m] ⓛ{p}W.U0 & ⦃G,L⦄ ⊢ ⓐV.U ⬌*[h] X & ⦃G,L⦄ ⊢ X ![h,a].
+#h #a #m #G #L #V #T #X
+* #X0 #HX #HVT #HX0 #HTX0
+elim (cnv_inv_appl … HVT) #n #p #W #U0 #Ha #HV #HT #HVW #HTU0
+elim (le_or_ge n m) #Hnm
+[ elim (cnv_fwd_cpms_abst_dx_le … HT … HTU0 … Hnm) #U #H #HU0
+ lapply (cpms_appl_dx … V V … H) [ // ] -H #H
+ elim (cnv_cpms_conf … HVT … HTX0 … H) -HVT -HTX0 -H <minus_n_n #X1 #HX01 #HUX1
+ lapply (cpms_trans … HX0 … HX01) -X0 #HX1
+ lapply (cprs_div … HUX1 … HX1) -X1 #HUX
+ lapply (cnv_cpms_trans … HT … HTU0) #H
+ elim (cnv_inv_bind … H) -H #_ #HU0
+ /4 width=11 by cnv_cpms_ntas, ex7_5_intro, or_introl/
+| >(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 <minus_n_n #X1 #HX01 #HUX1
+ lapply (cpms_trans … HX0 … HX01) -X0 #HX1
+ lapply (cprs_div … HUX1 … HX1) -X1 #HUX
+ /5 width=11 by cnv_cpms_ntas, cnv_cpms_trans, ex7_5_intro, or_intror/
+]
+qed-.
+
+(*
+(* 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/
+*)
+*)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 @{ 'Colon $h $G $L $T1 $T2 }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 :[ break term 46 a, break term 46 h ] break term 46 T2 )"
+notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 :[ break term 46 h, break term 46 a ] break term 46 T2 )"
non associative with precedence 45
- for @{ 'Colon $a $h $G $L $T1 $T2 }.
+ for @{ 'Colon $h $a $G $L $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 a, break term 46 h, break term 46 n ] break term 46 T2 )"
- non associative with precedence 45
- for @{ 'Colon $a $h $n $G $L $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 @{ 'ColonStar $h $G $L $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 n ] break term 46 T2 )"
- non associative with precedence 45
- for @{ 'ColonStar $h $n $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 a, break term 46 n ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'ColonStar $h $a $n $G $L $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 ![ break term 46 h ] )"
- non associative with precedence 45
- for @{ 'Exclaim $h $G $L $T }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T ![ break term 46 a, break term 46 h ] )"
+notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T ![ break term 46 h, break term 46 a ] )"
non associative with precedence 45
- for @{ 'Exclaim $a $h $G $L $T }.
+ for @{ 'Exclaim $h $a $G $L $T }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 !*[ break term 46 h ] )"
- non associative with precedence 45
- for @{ 'ExclaimStar $h $G $L $T }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( G ⊢ break term 46 L1 ⫃![ break term 46 a, break term 46 h ] break term 46 L2 )"
+notation "hvbox( G ⊢ break term 46 L1 ⫃![ break term 46 h, break term 46 a ] break term 46 L2 )"
non associative with precedence 45
- for @{ 'LRSubEqV $a $h $G $L1 $L2 }.
+ for @{ 'LRSubEqV $h $a $G $L1 $L2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 o, break term 46 f ] break term 46 L2 )"
- non associative with precedence 45
- for @{ 'LSubEqX $h $o $f $G $L1 $L2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 n1, break term 46 n2 ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'PConvStar $h $n1 $n2 $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 @{ 'PRedEval $h $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 n ] 𝐍 ⦃ break term 46 T2 ⦄ )"
+ non associative with precedence 45
+ for @{ 'PRedEval $h $n $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 n ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'PRedEvalWStar $h $n $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 @{ 'PRedITNormal $h $G $L $T }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 @{ 'PRedNormal $h $G $L $T }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 L1 ⦄ ⊢ ➡* break term 46 L2 )"
- non associative with precedence 45
- for @{ 'PRedSnStar $G $L1 $L2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 G2, break term 46 L2, break term 46 T2 ⦄ )"
+ non associative with precedence 45
+ for @{ 'PRedSubTy $h $G1 $L1 $T1 $G2 $L2 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 @{ 'PRedSubTy $h $o $G1 $L1 $T1 $G2 $L2 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 G2, break term 46 L2, break term 46 T2 ⦄ )"
+ non associative with precedence 45
+ for @{ 'PRedSubTyProper $h $G1 $L1 $T1 $G2 $L2 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 @{ 'PRedSubTyProper $h $o $G1 $L1 $T1 $G2 $L2 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 G2, break term 46 L2, break term 46 T2 ⦄ )"
+ non associative with precedence 45
+ for @{ 'PRedSubTyStar $h $G1 $L1 $T1 $G2 $L2 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 @{ 'PRedSubTyStar $h $o $G1 $L1 $T1 $G2 $L2 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 G2, break term 46 L2, break term 46 T2 ⦄ )"
+ non associative with precedence 45
+ for @{ 'PRedSubTyStarProper $h $G1 $L1 $T1 $G2 $L2 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
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-.
(* 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.
(* 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
(* 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.
(* 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 #_ * [ * || * ]
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 **************)
(* 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_SO
/3 width=4 by cpms_step_dx, ex_intro/
]
qed-.
+
+lemma cpms_abst_dx_le_aaa (h) (G) (L) (T) (W) (p):
+ ∀A. ⦃G,L⦄ ⊢ T ⁝ 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 #G #L #T #W #p #A #HA #n1 #U1 #HTU1 #n2 #Hn12
+lapply (cpms_aaa_conf … HA … HTU1) -HA #HA
+elim (cpms_total_aaa h … (n2-n1) … HA) -HA #X #H
+elim (cpms_inv_abst_sn … H) -H #W0 #U2 #_ #HU12 #H destruct -W0
+>(plus_minus_m_m_commutative … Hn12) in ⊢ (??%?); -Hn12
+/4 width=5 by cpms_trans, cpms_bind_dx, ex2_intro/
+qed-.
(* 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
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
(* 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
(* 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
(* 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
(* 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
(* 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/
]
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 <plus_S1 #H
elim (cpms_inv_succ_sn … H) -H #T0 #HT10 #HT02
(* Advanced main properties *************************************************)
theorem cpms_cast (n) (h) (G) (L):
- ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 →
- ∀U1,U2. ⦃G, L⦄ ⊢ U1 ➡*[n, h] U2 →
- ⦃G, L⦄ ⊢ ⓝU1.T1 ➡*[n, h] ⓝU2.T2.
+ ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 →
+ ∀U1,U2. ⦃G,L⦄ ⊢ U1 ➡*[n,h] U2 →
+ ⦃G,L⦄ ⊢ ⓝU1.T1 ➡*[n,h] ⓝU2.T2.
#n #h #G #L #T1 #T2 #H @(cpms_ind_sn … H) -T1 -n
[ /3 width=3 by cpms_cast_sn/
| #n1 #n2 #T1 #T #HT1 #_ #IH #U1 #U2 #H
(* Forward lemmas with unbound context-sensitive rt-computation for terms ***)
(* Basic_2A1: includes: scpds_fwd_cpxs cprs_cpxs *)
-lemma cpms_fwd_cpxs (n) (h): ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2.
+lemma cpms_fwd_cpxs (n) (h): ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → ⦃G,L⦄ ⊢ T1 ⬈*[h] T2.
#n #h #G #L #T1 #T2 #H @(cpms_ind_dx … H) -T2
/3 width=4 by cpxs_strap1, cpm_fwd_cpx/
qed-.
(* Advanced properties ******************************************************)
-lemma cpms_delta (n) (h) (G): ∀K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡*[n, h] V2 →
- ∀W2. ⬆*[1] V2 ≘ W2 → ⦃G, K.ⓓV1⦄ ⊢ #0 ➡*[n, h] W2.
+lemma cpms_delta (n) (h) (G): ∀K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡*[n,h] V2 →
+ ∀W2. ⬆*[1] V2 ≘ W2 → ⦃G,K.ⓓV1⦄ ⊢ #0 ➡*[n,h] W2.
#n #h #G #K #V1 #V2 #H @(cpms_ind_dx … H) -V2
[ /3 width=3 by cpm_cpms, cpm_delta/
| #n1 #n2 #V #V2 #_ #IH #HV2 #W2 #HVW2
]
qed.
-lemma cpms_ell (n) (h) (G): ∀K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡*[n, h] V2 →
- ∀W2. ⬆*[1] V2 ≘ W2 → ⦃G, K.ⓛV1⦄ ⊢ #0 ➡*[↑n, h] W2.
+lemma cpms_ell (n) (h) (G): ∀K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡*[n,h] V2 →
+ ∀W2. ⬆*[1] V2 ≘ W2 → ⦃G,K.ⓛV1⦄ ⊢ #0 ➡*[↑n,h] W2.
#n #h #G #K #V1 #V2 #H @(cpms_ind_dx … H) -V2
[ /3 width=3 by cpm_cpms, cpm_ell/
| #n1 #n2 #V #V2 #_ #IH #HV2 #W2 #HVW2
]
qed.
-lemma cpms_lref (n) (h) (I) (G): ∀K,T,i. ⦃G, K⦄ ⊢ #i ➡*[n, h] T →
- ∀U. ⬆*[1] T ≘ U → ⦃G, K.ⓘ{I}⦄ ⊢ #↑i ➡*[n, h] U.
+lemma cpms_lref (n) (h) (I) (G): ∀K,T,i. ⦃G,K⦄ ⊢ #i ➡*[n,h] T →
+ ∀U. ⬆*[1] T ≘ U → ⦃G,K.ⓘ{I}⦄ ⊢ #↑i ➡*[n,h] U.
#n #h #I #G #K #T #i #H @(cpms_ind_dx … H) -T
[ /3 width=3 by cpm_cpms, cpm_lref/
| #n1 #n2 #T #T2 #_ #IH #HT2 #U2 #HTU2
qed.
lemma cpms_cast_sn (n) (h) (G) (L):
- ∀U1,U2. ⦃G, L⦄ ⊢ U1 ➡*[n, h] U2 →
- ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
- ⦃G, L⦄ ⊢ ⓝU1.T1 ➡*[n, h] ⓝU2.T2.
+ ∀U1,U2. ⦃G,L⦄ ⊢ U1 ➡*[n,h] U2 →
+ ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
+ ⦃G,L⦄ ⊢ ⓝU1.T1 ➡*[n,h] ⓝU2.T2.
#n #h #G #L #U1 #U2 #H @(cpms_ind_sn … H) -U1 -n
[ /3 width=3 by cpm_cpms, cpm_cast/
| #n1 #n2 #U1 #U #HU1 #_ #IH #T1 #T2 #H
(* Basic_2A1: uses: cprs_delta *)
lemma cpms_delta_drops (n) (h) (G):
∀L,K,V,i. ⬇*[i] L ≘ K.ⓓV →
- ∀V2. ⦃G, K⦄ ⊢ V ➡*[n, h] V2 →
- ∀W2. ⬆*[↑i] V2 ≘ W2 → ⦃G, L⦄ ⊢ #i ➡*[n, h] W2.
+ ∀V2. ⦃G,K⦄ ⊢ V ➡*[n,h] V2 →
+ ∀W2. ⬆*[↑i] V2 ≘ W2 → ⦃G,L⦄ ⊢ #i ➡*[n,h] W2.
#n #h #G #L #K #V #i #HLK #V2 #H @(cpms_ind_dx … H) -V2
[ /3 width=6 by cpm_cpms, cpm_delta_drops/
| #n1 #n2 #V1 #V2 #_ #IH #HV12 #W2 #HVW2
lemma cpms_ell_drops (n) (h) (G):
∀L,K,W,i. ⬇*[i] L ≘ K.ⓛW →
- ∀W2. ⦃G, K⦄ ⊢ W ➡*[n, h] W2 →
- ∀V2. ⬆*[↑i] W2 ≘ V2 → ⦃G, L⦄ ⊢ #i ➡*[↑n, h] V2.
+ ∀W2. ⦃G,K⦄ ⊢ W ➡*[n,h] W2 →
+ ∀V2. ⬆*[↑i] W2 ≘ V2 → ⦃G,L⦄ ⊢ #i ➡*[↑n,h] V2.
#n #h #G #L #K #W #i #HLK #W2 #H @(cpms_ind_dx … H) -W2
[ /3 width=6 by cpm_cpms, cpm_ell_drops/
| #n1 #n2 #W1 #W2 #_ #IH #HW12 #V2 #HWV2
(* Advanced inversion lemmas ************************************************)
lemma cpms_inv_lref1_drops (n) (h) (G):
- ∀L,T2,i. ⦃G, L⦄ ⊢ #i ➡*[n, h] T2 →
+ ∀L,T2,i. ⦃G,L⦄ ⊢ #i ➡*[n,h] T2 →
∨∨ ∧∧ T2 = #i & n = 0
- | ∃∃K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G, K⦄ ⊢ V ➡*[n, h] V2 &
+ | ∃∃K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V ➡*[n,h] V2 &
⬆*[↑i] V2 ≘ T2
- | ∃∃m,K,V,V2. ⬇*[i] L ≘ K.ⓛV & ⦃G, K⦄ ⊢ V ➡*[m, h] V2 &
+ | ∃∃m,K,V,V2. ⬇*[i] L ≘ K.ⓛV & ⦃G,K⦄ ⊢ V ➡*[m,h] V2 &
⬆*[↑i] V2 ≘ T2 & n = ↑m.
#n #h #G #L #T2 #i #H @(cpms_ind_dx … H) -T2
[ /3 width=1 by or3_intro0, conj/
qed-.
fact cpms_inv_succ_sn (n) (h) (G) (L):
- ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[↑n, h] T2 →
- ∃∃T. ⦃G, L⦄ ⊢ T1 ➡*[1, h] T & ⦃G, L⦄ ⊢ T ➡*[n, h] T2.
+ ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[↑n,h] T2 →
+ ∃∃T. ⦃G,L⦄ ⊢ T1 ➡*[1,h] T & ⦃G,L⦄ ⊢ T ➡*[n,h] T2.
#n #h #G #L #T1 #T2
@(insert_eq_0 … (↑n)) #m #H
@(cpms_ind_sn … H) -T1 -m
(**************************************************************************)
include "basic_2/rt_computation/fpbg_fqup.ma".
-include "basic_2/rt_computation/fpbg_fpbs.ma".
+include "basic_2/rt_computation/fpbg_cpxs.ma".
include "basic_2/rt_computation/cpms_fpbs.ma".
(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************)
(* Forward lemmas with proper parallel rst-computation for closures *********)
-lemma fpbg_cpms_trans (h) (o) (n): ∀G1,G2,L1,L2,T1,T. ⦃G1, L1, T1⦄ >[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-.
(* 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-.
(* 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/
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-.
(* 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.
(* 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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).
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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 //
(* 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 //
(* 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.
(* 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/
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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/
(* 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
(* 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/
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
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/
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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.
(* 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.
(* 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
@(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
(* 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-.
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
(* 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
]
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
(* 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
(* 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 *
]
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
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 *
(* 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
(* 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/
(* 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/
[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/
]
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/
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
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/
(* 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/
(* 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/
(* 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-.
(* 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
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* *)
(**************************************************************************)
-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:
(* 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-.
(* 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.
(* 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".
(* 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.
(* 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
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-.
(* 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
(* 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
(* 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-.
(* *)
(**************************************************************************)
-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".
(* 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/
]
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/
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/
(* 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
(* 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
(* 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-.
(* 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-.
(* 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/
]
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-.
(* 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/
]
(* 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.
(* 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
]
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
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
]
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.
(* 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-.
(* 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 *
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-.
(* 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-.
(* 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
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
(* 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
(* *)
(**************************************************************************)
-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.
(* 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-.
(* 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-.
(* 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):
- â\88\80G1,G,L1,L,T1,T. â¦\83G1,L1,T1â¦\84 â\8a\90+ ⦃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):
+ â\88\80G1,G,L1,L,T1,T. â¦\83G1,L1,T1â¦\84 â¬\82+ ⦃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
(* 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
(* 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.
(* 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.
(**************************************************************************)
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:
(* 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-.
(* 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/
(* 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.
(* 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-.
(* 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.
(* 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-.
(* 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-.
(* 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-.
(* 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/
(* 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
(* *)
(**************************************************************************)
-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-.
(* 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-.
(* *)
(**************************************************************************)
-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".
(* 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/
[ /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
]
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-.
(* 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
(* 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/
(* 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/
]
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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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 ********************************************************)
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-.
(* 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 *)
(* 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/
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 #_ * *
(* 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
(* 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
/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-.
(* 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-.
(* 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-.
(* 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).
(* 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-.
(* 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-.
(* 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).
(* 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 ********************************************************)
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-.
(* 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
(* 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 * *
(* 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/
(* 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-.
(* 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 *******)
(* 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.
(* 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
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
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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
-*)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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
-*)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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)"
(* 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-.
(* 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-.
(* *)
(**************************************************************************)
+include "ground_2/xoa/ex_5_7.ma".
include "basic_2/notation/relations/pconveta_5.ma".
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.â\93\9bV) (#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.â\93\98{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)
#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
]
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
]
#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/
]
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
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):
(* 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-.
/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:
(* 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
(* 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-.
(* 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
(* 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 //
(* 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
(* 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
(* 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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-.
(* 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
/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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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 *)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* *)
(**************************************************************************)
-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
]
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
]
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
-<minus_n_n /2 width=6 by cnx_sort/
+lemma cnx_sort: ∀h,G,L,s. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃⋆s⦄.
+#h #G #L #s #X #H elim (cpx_inv_sort1 … H) -H
+/2 width=1 by tdeq_sort/
qed.
-lemma cnx_abst: ∀h,o,p,G,L,W,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃W⦄ → ⦃G, L.ⓛW⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ →
- ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃ⓛ{p}W.T⦄.
-#h #o #p #G #L #W #T #HW #HT #X #H
+lemma cnx_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 (cpx_inv_abst1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct
@tdeq_pair [ @HW | @HT ] // (**) (* auto fails because δ-expansion gets in the way *)
qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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/cpx_drops_basic.ma".
+include "basic_2/rt_transition/cnx.ma".
+
+(* NORMAL TERMS FOR UNBOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION ********)
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma cnx_inv_abbr_pos (h) (G) (L): ∀V,T. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃+ⓓV.T⦄ → ⊥.
+#h #G #L #V #U1 #H
+elim (cpx_subst h G (L.ⓓV) U1 … 0) [|*: /2 width=4 by drops_refl/ ] #U2 #T2 #HU12 #HTU2
+elim (tdeq_dec U1 U2) #HnU12 [ -HU12 | -HTU2 ]
+[ elim (tdeq_inv_lifts_dx … HnU12 … HTU2) -U2 #T1 #HTU1 #_ -T2
+ lapply (H T1 ?) -H [ /2 width=3 by cpx_zeta/ ] #H
+ /2 width=9 by tdeq_lifts_inv_pair_sn/
+| lapply (H (+ⓓV.U2) ?) -H [ /2 width=1 by cpx_bind/ ] -HU12 #H
+ elim (tdeq_inv_pair … H) -H #_ #_ /2 width=1 by/
+]
+qed-.
(* Advanced properties ******************************************************)
-lemma cnx_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 #HT1 #T2 #HT12 #T #HT2
+lemma cnx_tdeq_trans: ∀h,G,L,T1. ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T1⦄ →
+ ∀T2. T1 ≛ T2 → ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃T2⦄.
+#h #G #L #T1 #HT1 #T2 #HT12 #T #HT2
elim (tdeq_cpx_trans … HT12 … HT2) -HT2 #T0 #HT10 #HT0
lapply (HT1 … HT10) -HT1 -HT10 /2 width=5 by tdeq_repl/ (**) (* full auto fails *)
qed-.
(* Properties with generic slicing ******************************************)
-lemma cnx_lref_atom: ∀h,o,G,L,i. ⬇*[i] L ≘ ⋆ → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃#i⦄.
-#h #o #G #L #i #Hi #X #H elim (cpx_inv_lref1_drops … H) -H // *
+lemma cnx_lref_atom: ∀h,G,L,i. ⬇*[i] L ≘ ⋆ → ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃#i⦄.
+#h #G #L #i #Hi #X #H elim (cpx_inv_lref1_drops … H) -H // *
#I #K #V1 #V2 #HLK lapply (drops_mono … Hi … HLK) -L #H destruct
qed.
-lemma cnx_lref_unit: ∀h,o,I,G,L,K,i. ⬇*[i] L ≘ K.ⓤ{I} → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃#i⦄.
-#h #o #I #G #L #K #i #HLK #X #H elim (cpx_inv_lref1_drops … H) -H // *
+lemma cnx_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 (cpx_inv_lref1_drops … H) -H // *
#Z #Y #V1 #V2 #HLY lapply (drops_mono … HLK … HLY) -L #H destruct
qed.
(* Basic_2A1: includes: cnx_lift *)
-lemma cnx_lifts: ∀h,o,G. d_liftable1 … (cnx h o G).
-#h #o #G #K #T #HT #b #f #L #HLK #U #HTU #U0 #H
+lemma cnx_lifts: ∀h,G. d_liftable1 … (cnx h G).
+#h #G #K #T #HT #b #f #L #HLK #U #HTU #U0 #H
elim (cpx_inv_lifts_sn … H … HLK … HTU) -b -L #T0 #HTU0 #HT0
lapply (HT … HT0) -G -K /2 width=6 by tdeq_lifts_bi/
qed-.
(* Inversion lemmas with generic slicing ************************************)
(* Basic_2A1: was: cnx_inv_delta *)
-lemma cnx_inv_lref_pair: ∀h,o,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃#i⦄ → ⊥.
-#h #o #I #G #L #K #V #i #HLK #H
+lemma cnx_inv_lref_pair: ∀h,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G,L⦄ ⊢ ⬈[h] 𝐍⦃#i⦄ → ⊥.
+#h #I #G #L #K #V #i #HLK #H
elim (lifts_total V (𝐔❴↑i❵)) #W #HVW
lapply (H W ?) -H /2 width=7 by cpx_delta_drops/ -HLK
#H lapply (tdeq_inv_lref1 … H) -H #H destruct
qed-.
(* Basic_2A1: includes: cnx_inv_lift *)
-lemma cnx_inv_lifts: ∀h,o,G. d_deliftable1 … (cnx h o G).
-#h #o #G #L #U #HU #b #f #K #HLK #T #HTU #T0 #H
+lemma cnx_inv_lifts: ∀h,G. d_deliftable1 … (cnx h G).
+#h #G #L #U #HU #b #f #K #HLK #T #HTU #T0 #H
elim (cpx_lifts_sn … H … HLK … HTU) -b -K #U0 #HTU0 #HU0
lapply (HU … HU0) -G -L /2 width=6 by tdeq_inv_lifts_bi/
qed-.
(* Inversion lemmas with simple terms ***************************************)
-lemma cnx_inv_appl: ∀h,o,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃ⓐV.T⦄ →
- ∧∧ ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃V⦄ & ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ & 𝐒⦃T⦄.
-#h #o #G #L #V1 #T1 #HVT1 @and3_intro
+lemma cnx_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 cpx_pair_sn/ -HV2
#H elim (tdeq_inv_pair … H) -H //
| #T2 #HT2 lapply (HVT1 (ⓐV1.T2) ?) -HVT1 /2 width=1 by cpx_flat/ -HT2
(* Properties with simple terms *********************************************)
-lemma cnx_appl_simple: ∀h,o,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃V⦄ → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ → 𝐒⦃T⦄ →
- ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃ⓐV.T⦄.
-#h #o #G #L #V #T #HV #HT #HS #X #H elim (cpx_inv_appl1_simple … H) -H //
+lemma cnx_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 (cpx_inv_appl1_simple … H) -H //
#V0 #T0 #HV0 #HT0 #H destruct
@tdeq_pair [ @HV | @HT ] // (**) (* auto fails because δ-expansion gets in the way *)
qed.
include "ground_2/steps/rtc_max.ma".
include "ground_2/steps/rtc_plus.ma".
include "basic_2/notation/relations/predty_7.ma".
-include "static_2/syntax/item_sh.ma".
+include "static_2/syntax/sh.ma".
include "static_2/syntax/lenv.ma".
include "static_2/syntax/genv.ma".
include "static_2/relocation/lifts.ma".
(* avtivate genv *)
inductive cpg (Rt:relation rtc) (h): rtc → relation4 genv lenv term term ≝
| cpg_atom : ∀I,G,L. cpg Rt h (𝟘𝟘) G L (⓪{I}) (⓪{I})
-| cpg_ess : ∀G,L,s. cpg Rt h (𝟘𝟙) G L (⋆s) (⋆(next h s))
+| cpg_ess : ∀G,L,s. cpg Rt h (𝟘𝟙) G L (⋆s) (⋆(⫯[h]s))
| cpg_delta: ∀c,G,L,V1,V2,W2. cpg Rt h c G L V1 V2 →
⬆*[1] V2 ≘ W2 → cpg Rt h c G (L.ⓓV1) (#0) W2
| cpg_ell : ∀c,G,L,V1,V2,W2. cpg Rt h c G L V1 V2 →
(* Basic properties *********************************************************)
(* Note: this is "∀Rt. reflexive … Rt → ∀h,g,L. reflexive … (cpg Rt h (𝟘𝟘) L)" *)
-lemma cpg_refl: ∀Rt. reflexive … Rt → ∀h,G,T,L. ⦃G, L⦄ ⊢ T ⬈[Rt, 𝟘𝟘, h] T.
+lemma cpg_refl: ∀Rt. reflexive … Rt → ∀h,G,T,L. ⦃G,L⦄ ⊢ T ⬈[Rt,𝟘𝟘,h] T.
#Rt #HRt #h #G #T elim T -T // * /2 width=1 by cpg_bind/
* /2 width=1 by cpg_appl, cpg_cast/
qed.
(* Basic inversion lemmas ***************************************************)
-fact cpg_inv_atom1_aux: ∀Rt,c,h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[Rt, c, h] T2 → ∀J. T1 = ⓪{J} →
+fact cpg_inv_atom1_aux: ∀Rt,c,h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[Rt,c,h] T2 → ∀J. T1 = ⓪{J} →
∨∨ T2 = ⓪{J} ∧ c = 𝟘𝟘
- | ∃∃s. J = Sort s & T2 = ⋆(next h s) & c = 𝟘𝟙
- | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃s. J = Sort s & T2 = ⋆(⫯[h]s) & c = 𝟘𝟙
+ | ∃∃cV,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓓV1 & J = LRef 0 & c = cV
- | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃cV,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓛV1 & J = LRef 0 & c = cV+𝟘𝟙
- | ∃∃I,K,T,i. ⦃G, K⦄ ⊢ #i ⬈[Rt, c, h] T & ⬆*[1] T ≘ T2 &
+ | ∃∃I,K,T,i. ⦃G,K⦄ ⊢ #i ⬈[Rt,c,h] T & ⬆*[1] T ≘ T2 &
L = K.ⓘ{I} & J = LRef (↑i).
#Rt #c #h #G #L #T1 #T2 * -c -G -L -T1 -T2
[ #I #G #L #J #H destruct /3 width=1 by or5_intro0, conj/
]
qed-.
-lemma cpg_inv_atom1: ∀Rt,c,h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ⬈[Rt, c, h] T2 →
+lemma cpg_inv_atom1: ∀Rt,c,h,J,G,L,T2. ⦃G,L⦄ ⊢ ⓪{J} ⬈[Rt,c,h] T2 →
∨∨ T2 = ⓪{J} ∧ c = 𝟘𝟘
- | ∃∃s. J = Sort s & T2 = ⋆(next h s) & c = 𝟘𝟙
- | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃s. J = Sort s & T2 = ⋆(⫯[h]s) & c = 𝟘𝟙
+ | ∃∃cV,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓓV1 & J = LRef 0 & c = cV
- | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃cV,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓛV1 & J = LRef 0 & c = cV+𝟘𝟙
- | ∃∃I,K,T,i. ⦃G, K⦄ ⊢ #i ⬈[Rt, c, h] T & ⬆*[1] T ≘ T2 &
+ | ∃∃I,K,T,i. ⦃G,K⦄ ⊢ #i ⬈[Rt,c,h] T & ⬆*[1] T ≘ T2 &
L = K.ⓘ{I} & J = LRef (↑i).
/2 width=3 by cpg_inv_atom1_aux/ qed-.
-lemma cpg_inv_sort1: ∀Rt,c,h,G,L,T2,s. ⦃G, L⦄ ⊢ ⋆s ⬈[Rt, c, h] T2 →
- ∨∨ T2 = ⋆s ∧ c = 𝟘𝟘 | T2 = ⋆(next h s) ∧ c = 𝟘𝟙.
+lemma cpg_inv_sort1: ∀Rt,c,h,G,L,T2,s. ⦃G,L⦄ ⊢ ⋆s ⬈[Rt,c,h] T2 →
+ ∨∨ T2 = ⋆s ∧ c = 𝟘𝟘 | T2 = ⋆(⫯[h]s) ∧ c = 𝟘𝟙.
#Rt #c #h #G #L #T2 #s #H
elim (cpg_inv_atom1 … H) -H * /3 width=1 by or_introl, conj/
[ #s0 #H destruct /3 width=1 by or_intror, conj/
]
qed-.
-lemma cpg_inv_zero1: ∀Rt,c,h,G,L,T2. ⦃G, L⦄ ⊢ #0 ⬈[Rt, c, h] T2 →
+lemma cpg_inv_zero1: ∀Rt,c,h,G,L,T2. ⦃G,L⦄ ⊢ #0 ⬈[Rt,c,h] T2 →
∨∨ T2 = #0 ∧ c = 𝟘𝟘
- | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃cV,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓓV1 & c = cV
- | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃cV,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓛV1 & c = cV+𝟘𝟙.
#Rt #c #h #G #L #T2 #H
elim (cpg_inv_atom1 … H) -H * /3 width=1 by or3_intro0, conj/
]
qed-.
-lemma cpg_inv_lref1: ∀Rt,c,h,G,L,T2,i. ⦃G, L⦄ ⊢ #↑i ⬈[Rt, c, h] T2 →
+lemma cpg_inv_lref1: ∀Rt,c,h,G,L,T2,i. ⦃G,L⦄ ⊢ #↑i ⬈[Rt,c,h] T2 →
∨∨ T2 = #(↑i) ∧ c = 𝟘𝟘
- | ∃∃I,K,T. ⦃G, K⦄ ⊢ #i ⬈[Rt, c, h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}.
+ | ∃∃I,K,T. ⦃G,K⦄ ⊢ #i ⬈[Rt,c,h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}.
#Rt #c #h #G #L #T2 #i #H
elim (cpg_inv_atom1 … H) -H * /3 width=1 by or_introl, conj/
[ #s #H destruct
]
qed-.
-lemma cpg_inv_gref1: ∀Rt,c,h,G,L,T2,l. ⦃G, L⦄ ⊢ §l ⬈[Rt, c, h] T2 → T2 = §l ∧ c = 𝟘𝟘.
+lemma cpg_inv_gref1: ∀Rt,c,h,G,L,T2,l. ⦃G,L⦄ ⊢ §l ⬈[Rt,c,h] T2 → T2 = §l ∧ c = 𝟘𝟘.
#Rt #c #h #G #L #T2 #l #H
elim (cpg_inv_atom1 … H) -H * /2 width=1 by conj/
[ #s #H destruct
]
qed-.
-fact cpg_inv_bind1_aux: ∀Rt,c,h,G,L,U,U2. ⦃G, L⦄ ⊢ U ⬈[Rt, c, h] U2 →
+fact cpg_inv_bind1_aux: ∀Rt,c,h,G,L,U,U2. ⦃G,L⦄ ⊢ U ⬈[Rt,c,h] U2 →
∀p,J,V1,U1. U = ⓑ{p,J}V1.U1 →
- ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L.ⓑ{J}V1⦄ ⊢ U1 ⬈[Rt, cT, h] T2 &
+ ∨∨ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L.ⓑ{J}V1⦄ ⊢ U1 ⬈[Rt,cT,h] T2 &
U2 = ⓑ{p,J}V2.T2 & c = ((↕*cV)∨cT)
- | ∃∃cT,T. ⬆*[1] T ≘ U1 & ⦃G, L⦄ ⊢ T ⬈[Rt, cT, h] U2 &
+ | ∃∃cT,T. ⬆*[1] T ≘ U1 & ⦃G,L⦄ ⊢ T ⬈[Rt,cT,h] U2 &
p = true & J = Abbr & c = cT+𝟙𝟘.
#Rt #c #h #G #L #U #U2 * -c -G -L -U -U2
[ #I #G #L #q #J #W #U1 #H destruct
]
qed-.
-lemma cpg_inv_bind1: ∀Rt,c,h,p,I,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[Rt, c, h] U2 →
- ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+lemma cpg_inv_bind1: ∀Rt,c,h,p,I,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[Rt,c,h] U2 →
+ ∨∨ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U2 = ⓑ{p,I}V2.T2 & c = ((↕*cV)∨cT)
- | ∃∃cT,T. ⬆*[1] T ≘ T1 & ⦃G, L⦄ ⊢ T ⬈[Rt, cT, h] U2 &
+ | ∃∃cT,T. ⬆*[1] T ≘ T1 & ⦃G,L⦄ ⊢ T ⬈[Rt,cT,h] U2 &
p = true & I = Abbr & c = cT+𝟙𝟘.
/2 width=3 by cpg_inv_bind1_aux/ qed-.
-lemma cpg_inv_abbr1: ∀Rt,c,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{p}V1.T1 ⬈[Rt, c, h] U2 →
- ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+lemma cpg_inv_abbr1: ∀Rt,c,h,p,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓓ{p}V1.T1 ⬈[Rt,c,h] U2 →
+ ∨∨ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L.ⓓV1⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U2 = ⓓ{p}V2.T2 & c = ((↕*cV)∨cT)
- | ∃∃cT,T. ⬆*[1] T ≘ T1 & ⦃G, L⦄ ⊢ T ⬈[Rt, cT, h] U2 &
+ | ∃∃cT,T. ⬆*[1] T ≘ T1 & ⦃G,L⦄ ⊢ T ⬈[Rt,cT,h] U2 &
p = true & c = cT+𝟙𝟘.
#Rt #c #h #p #G #L #V1 #T1 #U2 #H elim (cpg_inv_bind1 … H) -H *
/3 width=8 by ex4_4_intro, ex4_2_intro, or_introl, or_intror/
qed-.
-lemma cpg_inv_abst1: ∀Rt,c,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{p}V1.T1 ⬈[Rt, c, h] U2 →
- ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+lemma cpg_inv_abst1: ∀Rt,c,h,p,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓛ{p}V1.T1 ⬈[Rt,c,h] U2 →
+ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L.ⓛV1⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U2 = ⓛ{p}V2.T2 & c = ((↕*cV)∨cT).
#Rt #c #h #p #G #L #V1 #T1 #U2 #H elim (cpg_inv_bind1 … H) -H *
[ /3 width=8 by ex4_4_intro/
]
qed-.
-fact cpg_inv_appl1_aux: ∀Rt,c,h,G,L,U,U2. ⦃G, L⦄ ⊢ U ⬈[Rt, c, h] U2 →
+fact cpg_inv_appl1_aux: ∀Rt,c,h,G,L,U,U2. ⦃G,L⦄ ⊢ U ⬈[Rt,c,h] U2 →
∀V1,U1. U = ⓐV1.U1 →
- ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[Rt, cT, h] T2 &
+ ∨∨ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L⦄ ⊢ U1 ⬈[Rt,cT,h] T2 &
U2 = ⓐV2.T2 & c = ((↕*cV)∨cT)
- | ∃∃cV,cW,cT,p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L⦄ ⊢ W1 ⬈[Rt, cW, h] W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+ | ∃∃cV,cW,cT,p,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L⦄ ⊢ W1 ⬈[Rt,cW,h] W2 & ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = ((↕*cV)∨(↕*cW)∨cT)+𝟙𝟘
- | ∃∃cV,cW,cT,p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V & ⬆*[1] V ≘ V2 & ⦃G, L⦄ ⊢ W1 ⬈[Rt, cW, h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+ | ∃∃cV,cW,cT,p,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V & ⬆*[1] V ≘ V2 & ⦃G,L⦄ ⊢ W1 ⬈[Rt,cW,h] W2 & ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = ((↕*cV)∨(↕*cW)∨cT)+𝟙𝟘.
#Rt #c #h #G #L #U #U2 * -c -G -L -U -U2
[ #I #G #L #W #U1 #H destruct
]
qed-.
-lemma cpg_inv_appl1: ∀Rt,c,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐV1.U1 ⬈[Rt, c, h] U2 →
- ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[Rt, cT, h] T2 &
+lemma cpg_inv_appl1: ∀Rt,c,h,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓐV1.U1 ⬈[Rt,c,h] U2 →
+ ∨∨ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L⦄ ⊢ U1 ⬈[Rt,cT,h] T2 &
U2 = ⓐV2.T2 & c = ((↕*cV)∨cT)
- | ∃∃cV,cW,cT,p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L⦄ ⊢ W1 ⬈[Rt, cW, h] W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+ | ∃∃cV,cW,cT,p,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L⦄ ⊢ W1 ⬈[Rt,cW,h] W2 & ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = ((↕*cV)∨(↕*cW)∨cT)+𝟙𝟘
- | ∃∃cV,cW,cT,p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V & ⬆*[1] V ≘ V2 & ⦃G, L⦄ ⊢ W1 ⬈[Rt, cW, h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+ | ∃∃cV,cW,cT,p,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V & ⬆*[1] V ≘ V2 & ⦃G,L⦄ ⊢ W1 ⬈[Rt,cW,h] W2 & ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = ((↕*cV)∨(↕*cW)∨cT)+𝟙𝟘.
/2 width=3 by cpg_inv_appl1_aux/ qed-.
-fact cpg_inv_cast1_aux: ∀Rt,c,h,G,L,U,U2. ⦃G, L⦄ ⊢ U ⬈[Rt, c, h] U2 →
+fact cpg_inv_cast1_aux: ∀Rt,c,h,G,L,U,U2. ⦃G,L⦄ ⊢ U ⬈[Rt,c,h] U2 →
∀V1,U1. U = ⓝV1.U1 →
- ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[Rt, cT, h] T2 &
+ ∨∨ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L⦄ ⊢ U1 ⬈[Rt,cT,h] T2 &
Rt cV cT & U2 = ⓝV2.T2 & c = (cV∨cT)
- | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[Rt, cT, h] U2 & c = cT+𝟙𝟘
- | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] U2 & c = cV+𝟘𝟙.
+ | ∃∃cT. ⦃G,L⦄ ⊢ U1 ⬈[Rt,cT,h] U2 & c = cT+𝟙𝟘
+ | ∃∃cV. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] U2 & c = cV+𝟘𝟙.
#Rt #c #h #G #L #U #U2 * -c -G -L -U -U2
[ #I #G #L #W #U1 #H destruct
| #G #L #s #W #U1 #H destruct
]
qed-.
-lemma cpg_inv_cast1: ∀Rt,c,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ⬈[Rt, c, h] U2 →
- ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[Rt, cT, h] T2 &
+lemma cpg_inv_cast1: ∀Rt,c,h,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓝV1.U1 ⬈[Rt,c,h] U2 →
+ ∨∨ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L⦄ ⊢ U1 ⬈[Rt,cT,h] T2 &
Rt cV cT & U2 = ⓝV2.T2 & c = (cV∨cT)
- | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[Rt, cT, h] U2 & c = cT+𝟙𝟘
- | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] U2 & c = cV+𝟘𝟙.
+ | ∃∃cT. ⦃G,L⦄ ⊢ U1 ⬈[Rt,cT,h] U2 & c = cT+𝟙𝟘
+ | ∃∃cV. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] U2 & c = cV+𝟘𝟙.
/2 width=3 by cpg_inv_cast1_aux/ qed-.
(* Advanced inversion lemmas ************************************************)
-lemma cpg_inv_zero1_pair: ∀Rt,c,h,I,G,K,V1,T2. ⦃G, K.ⓑ{I}V1⦄ ⊢ #0 ⬈[Rt, c, h] T2 →
+lemma cpg_inv_zero1_pair: ∀Rt,c,h,I,G,K,V1,T2. ⦃G,K.ⓑ{I}V1⦄ ⊢ #0 ⬈[Rt,c,h] T2 →
∨∨ T2 = #0 ∧ c = 𝟘𝟘
- | ∃∃cV,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃cV,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
I = Abbr & c = cV
- | ∃∃cV,V2. ⦃G, K⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃cV,V2. ⦃G,K⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⬆*[1] V2 ≘ T2 &
I = Abst & c = cV+𝟘𝟙.
#Rt #c #h #I #G #K #V1 #T2 #H elim (cpg_inv_zero1 … H) -H /2 width=1 by or3_intro0/
* #z #Y #X1 #X2 #HX12 #HXT2 #H1 #H2 destruct /3 width=5 by or3_intro1, or3_intro2, ex4_2_intro/
qed-.
-lemma cpg_inv_lref1_bind: ∀Rt,c,h,I,G,K,T2,i. ⦃G, K.ⓘ{I}⦄ ⊢ #↑i ⬈[Rt, c, h] T2 →
+lemma cpg_inv_lref1_bind: ∀Rt,c,h,I,G,K,T2,i. ⦃G,K.ⓘ{I}⦄ ⊢ #↑i ⬈[Rt,c,h] T2 →
∨∨ T2 = #(↑i) ∧ c = 𝟘𝟘
- | ∃∃T. ⦃G, K⦄ ⊢ #i ⬈[Rt, c, h] T & ⬆*[1] T ≘ T2.
+ | ∃∃T. ⦃G,K⦄ ⊢ #i ⬈[Rt,c,h] T & ⬆*[1] T ≘ T2.
#Rt #c #h #I #G #L #T2 #i #H elim (cpg_inv_lref1 … H) -H /2 width=1 by or_introl/
* #Z #Y #T #HT #HT2 #H destruct /3 width=3 by ex2_intro, or_intror/
qed-.
(* Basic forward lemmas *****************************************************)
-lemma cpg_fwd_bind1_minus: ∀Rt,c,h,I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ⬈[Rt, c, h] T → ∀p.
- ∃∃V2,T2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[Rt, c, h] ⓑ{p,I}V2.T2 &
+lemma cpg_fwd_bind1_minus: ∀Rt,c,h,I,G,L,V1,T1,T. ⦃G,L⦄ ⊢ -ⓑ{I}V1.T1 ⬈[Rt,c,h] T → ∀p.
+ ∃∃V2,T2. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[Rt,c,h] ⓑ{p,I}V2.T2 &
T = -ⓑ{I}V2.T2.
#Rt #c #h #I #G #L #V1 #T1 #T #H #p elim (cpg_inv_bind1 … H) -H *
[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct /3 width=4 by cpg_bind, ex2_2_intro/
(* Advanced properties ******************************************************)
-lemma cpg_delta_drops: ∀Rt,c,h,G,K,V,V2,i,L,T2. ⬇*[i] L ≘ K.ⓓV → ⦃G, K⦄ ⊢ V ⬈[Rt, c, h] V2 →
- ⬆*[↑i] V2 ≘ T2 → ⦃G, L⦄ ⊢ #i ⬈[Rt, c, h] T2.
+lemma cpg_delta_drops: ∀Rt,c,h,G,K,V,V2,i,L,T2. ⬇*[i] L ≘ K.ⓓV → ⦃G,K⦄ ⊢ V ⬈[Rt,c,h] V2 →
+ ⬆*[↑i] V2 ≘ T2 → ⦃G,L⦄ ⊢ #i ⬈[Rt,c,h] T2.
#Rt #c #h #G #K #V #V2 #i elim i -i
[ #L #T2 #HLK lapply (drops_fwd_isid … HLK ?) // #H destruct /3 width=3 by cpg_delta/
| #i #IH #L0 #T0 #H0 #HV2 #HVT2
]
qed.
-lemma cpg_ell_drops: ∀Rt,c,h,G,K,V,V2,i,L,T2. ⬇*[i] L ≘ K.ⓛV → ⦃G, K⦄ ⊢ V ⬈[Rt,c, h] V2 →
- ⬆*[↑i] V2 ≘ T2 → ⦃G, L⦄ ⊢ #i ⬈[Rt, c+𝟘𝟙, h] T2.
+lemma cpg_ell_drops: ∀Rt,c,h,G,K,V,V2,i,L,T2. ⬇*[i] L ≘ K.ⓛV → ⦃G,K⦄ ⊢ V ⬈[Rt,c,h] V2 →
+ ⬆*[↑i] V2 ≘ T2 → ⦃G,L⦄ ⊢ #i ⬈[Rt,c+𝟘𝟙,h] T2.
#Rt #c #h #G #K #V #V2 #i elim i -i
[ #L #T2 #HLK lapply (drops_fwd_isid … HLK ?) // #H destruct /3 width=3 by cpg_ell/
| #i #IH #L0 #T0 #H0 #HV2 #HVT2
(* Advanced inversion lemmas ************************************************)
-lemma cpg_inv_lref1_drops: ∀Rt,c,h,G,i,L,T2. ⦃G, L⦄ ⊢ #i ⬈[Rt,c, h] T2 →
+lemma cpg_inv_lref1_drops: ∀Rt,c,h,G,i,L,T2. ⦃G,L⦄ ⊢ #i ⬈[Rt,c,h] T2 →
∨∨ T2 = #i ∧ c = 𝟘𝟘
- | ∃∃cV,K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G, K⦄ ⊢ V ⬈[Rt, cV, h] V2 &
+ | ∃∃cV,K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V ⬈[Rt,cV,h] V2 &
⬆*[↑i] V2 ≘ T2 & c = cV
- | ∃∃cV,K,V,V2. ⬇*[i] L ≘ K.ⓛV & ⦃G, K⦄ ⊢ V ⬈[Rt, cV, h] V2 &
+ | ∃∃cV,K,V,V2. ⬇*[i] L ≘ K.ⓛV & ⦃G,K⦄ ⊢ V ⬈[Rt,cV,h] V2 &
⬆*[↑i] V2 ≘ T2 & c = cV + 𝟘𝟙.
#Rt #c #h #G #i elim i -i
[ #L #T2 #H elim (cpg_inv_zero1 … H) -H * /3 width=1 by or3_intro0, conj/
]
qed-.
-lemma cpg_inv_atom1_drops: ∀Rt,c,h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ⬈[Rt, c, h] T2 →
+lemma cpg_inv_atom1_drops: ∀Rt,c,h,I,G,L,T2. ⦃G,L⦄ ⊢ ⓪{I} ⬈[Rt,c,h] T2 →
∨∨ T2 = ⓪{I} ∧ c = 𝟘𝟘
- | ∃∃s. T2 = ⋆(next h s) & I = Sort s & c = 𝟘𝟙
- | ∃∃cV,i,K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G, K⦄ ⊢ V ⬈[Rt, cV, h] V2 &
+ | ∃∃s. T2 = ⋆(⫯[h]s) & I = Sort s & c = 𝟘𝟙
+ | ∃∃cV,i,K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V ⬈[Rt,cV,h] V2 &
⬆*[↑i] V2 ≘ T2 & I = LRef i & c = cV
- | ∃∃cV,i,K,V,V2. ⬇*[i] L ≘ K.ⓛV & ⦃G, K⦄ ⊢ V ⬈[Rt, cV, h] V2 &
+ | ∃∃cV,i,K,V,V2. ⬇*[i] L ≘ K.ⓛV & ⦃G,K⦄ ⊢ V ⬈[Rt,cV,h] V2 &
⬆*[↑i] V2 ≘ T2 & I = LRef i & c = cV + 𝟘𝟙.
#Rt #c #h * #n #G #L #T2 #H
[ elim (cpg_inv_sort1 … H) -H *
(* Properties with simple terms *********************************************)
(* Note: the main property of simple terms *)
-lemma cpg_inv_appl1_simple: ∀Rt,c,h,G,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1.T1 ⬈[Rt, c, h] U → 𝐒⦃T1⦄ →
- ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[Rt, cV, h] V2 & ⦃G, L⦄ ⊢ T1 ⬈[Rt, cT, h] T2 &
+lemma cpg_inv_appl1_simple: ∀Rt,c,h,G,L,V1,T1,U. ⦃G,L⦄ ⊢ ⓐV1.T1 ⬈[Rt,c,h] U → 𝐒⦃T1⦄ →
+ ∃∃cV,cT,V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[Rt,cV,h] V2 & ⦃G,L⦄ ⊢ T1 ⬈[Rt,cT,h] T2 &
U = ⓐV2.T2 & c = ((↕*cV)∨cT).
#Rt #c #h #G #L #V1 #T1 #U #H #HT1 elim (cpg_inv_appl1 … H) -H *
[ /2 width=8 by ex4_4_intro/
(* Basic_2A1: includes: cpr *)
definition cpm (h) (G) (L) (n): relation2 term term ≝
- λT1,T2. ∃∃c. 𝐑𝐓⦃n, c⦄ & ⦃G, L⦄ ⊢ T1 ⬈[eq_t, c, h] T2.
+ λT1,T2. ∃∃c. 𝐑𝐓⦃n,c⦄ & ⦃G,L⦄ ⊢ T1 ⬈[eq_t,c,h] T2.
interpretation
"t-bound context-sensitive parallel rt-transition (term)"
(* Basic properties *********************************************************)
-lemma cpm_ess: ∀h,G,L,s. ⦃G, L⦄ ⊢ ⋆s ➡[1, h] ⋆(next h s).
+lemma cpm_ess: ∀h,G,L,s. ⦃G,L⦄ ⊢ ⋆s ➡[1,h] ⋆(⫯[h]s).
/2 width=3 by cpg_ess, ex2_intro/ qed.
-lemma cpm_delta: ∀n,h,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 →
- ⬆*[1] V2 ≘ W2 → ⦃G, K.ⓓV1⦄ ⊢ #0 ➡[n, h] W2.
+lemma cpm_delta: ∀n,h,G,K,V1,V2,W2. ⦃G,K⦄ ⊢ V1 ➡[n,h] V2 →
+ ⬆*[1] V2 ≘ W2 → ⦃G,K.ⓓV1⦄ ⊢ #0 ➡[n,h] W2.
#n #h #G #K #V1 #V2 #W2 *
/3 width=5 by cpg_delta, ex2_intro/
qed.
-lemma cpm_ell: ∀n,h,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 →
- ⬆*[1] V2 ≘ W2 → ⦃G, K.ⓛV1⦄ ⊢ #0 ➡[↑n, h] W2.
+lemma cpm_ell: ∀n,h,G,K,V1,V2,W2. ⦃G,K⦄ ⊢ V1 ➡[n,h] V2 →
+ ⬆*[1] V2 ≘ W2 → ⦃G,K.ⓛV1⦄ ⊢ #0 ➡[↑n,h] W2.
#n #h #G #K #V1 #V2 #W2 *
/3 width=5 by cpg_ell, ex2_intro, isrt_succ/
qed.
-lemma cpm_lref: ∀n,h,I,G,K,T,U,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T →
- ⬆*[1] T ≘ U → ⦃G, K.ⓘ{I}⦄ ⊢ #↑i ➡[n, h] U.
+lemma cpm_lref: ∀n,h,I,G,K,T,U,i. ⦃G,K⦄ ⊢ #i ➡[n,h] T →
+ ⬆*[1] T ≘ U → ⦃G,K.ⓘ{I}⦄ ⊢ #↑i ➡[n,h] U.
#n #h #I #G #K #T #U #i *
/3 width=5 by cpg_lref, ex2_intro/
qed.
(* Basic_2A1: includes: cpr_bind *)
lemma cpm_bind: ∀n,h,p,I,G,L,V1,V2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[n, h] T2 →
- ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n, h] ⓑ{p,I}V2.T2.
+ ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ➡[n,h] T2 →
+ ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n,h] ⓑ{p,I}V2.T2.
#n #h #p #I #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
/5 width=5 by cpg_bind, isrt_max_O1, isr_shift, ex2_intro/
qed.
lemma cpm_appl: ∀n,h,G,L,V1,V2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
- ⦃G, L⦄ ⊢ ⓐV1.T1 ➡[n, h] ⓐV2.T2.
+ ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
+ ⦃G,L⦄ ⊢ ⓐV1.T1 ➡[n,h] ⓐV2.T2.
#n #h #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
/5 width=5 by isrt_max_O1, isr_shift, cpg_appl, ex2_intro/
qed.
lemma cpm_cast: ∀n,h,G,L,U1,U2,T1,T2.
- ⦃G, L⦄ ⊢ U1 ➡[n, h] U2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
- ⦃G, L⦄ ⊢ ⓝU1.T1 ➡[n, h] ⓝU2.T2.
+ ⦃G,L⦄ ⊢ U1 ➡[n,h] U2 → ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
+ ⦃G,L⦄ ⊢ ⓝU1.T1 ➡[n,h] ⓝU2.T2.
#n #h #G #L #U1 #U2 #T1 #T2 * #cU #HcU #HU12 *
/4 width=6 by cpg_cast, isrt_max_idem1, isrt_mono, ex2_intro/
qed.
(* Basic_2A1: includes: cpr_zeta *)
lemma cpm_zeta (n) (h) (G) (L):
- ∀T1,T. ⬆*[1] T ≘ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[n,h] T2 →
- ∀V. ⦃G, L⦄ ⊢ +ⓓV.T1 ➡[n, h] T2.
+ ∀T1,T. ⬆*[1] T ≘ T1 → ∀T2. ⦃G,L⦄ ⊢ T ➡[n,h] T2 →
+ ∀V. ⦃G,L⦄ ⊢ +ⓓV.T1 ➡[n,h] T2.
#n #h #G #L #T1 #T #HT1 #T2 *
/3 width=5 by cpg_zeta, isrt_plus_O2, ex2_intro/
qed.
(* Basic_2A1: includes: cpr_eps *)
-lemma cpm_eps: ∀n,h,G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → ⦃G, L⦄ ⊢ ⓝV.T1 ➡[n, h] T2.
+lemma cpm_eps: ∀n,h,G,L,V,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → ⦃G,L⦄ ⊢ ⓝV.T1 ➡[n,h] T2.
#n #h #G #L #V #T1 #T2 *
/3 width=3 by cpg_eps, isrt_plus_O2, ex2_intro/
qed.
-lemma cpm_ee: ∀n,h,G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 → ⦃G, L⦄ ⊢ ⓝV1.T ➡[↑n, h] V2.
+lemma cpm_ee: ∀n,h,G,L,V1,V2,T. ⦃G,L⦄ ⊢ V1 ➡[n,h] V2 → ⦃G,L⦄ ⊢ ⓝV1.T ➡[↑n,h] V2.
#n #h #G #L #V1 #V2 #T *
/3 width=3 by cpg_ee, isrt_succ, ex2_intro/
qed.
(* Basic_2A1: includes: cpr_beta *)
lemma cpm_beta: ∀n,h,p,G,L,V1,V2,W1,W2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ W1 ➡[h] W2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[n, h] T2 →
- ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡[n, h] ⓓ{p}ⓝW2.V2.T2.
+ ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L⦄ ⊢ W1 ➡[h] W2 → ⦃G,L.ⓛW1⦄ ⊢ T1 ➡[n,h] T2 →
+ ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡[n,h] ⓓ{p}ⓝW2.V2.T2.
#n #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV12 * #riW #rhW #HW12 *
/6 width=7 by cpg_beta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
qed.
(* Basic_2A1: includes: cpr_theta *)
lemma cpm_theta: ∀n,h,p,G,L,V1,V,V2,W1,W2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ➡[h] V → ⬆*[1] V ≘ V2 → ⦃G, L⦄ ⊢ W1 ➡[h] W2 →
- ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[n, h] T2 →
- ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡[n, h] ⓓ{p}W2.ⓐV2.T2.
+ ⦃G,L⦄ ⊢ V1 ➡[h] V → ⬆*[1] V ≘ V2 → ⦃G,L⦄ ⊢ W1 ➡[h] W2 →
+ ⦃G,L.ⓓW1⦄ ⊢ T1 ➡[n,h] T2 →
+ ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡[n,h] ⓓ{p}W2.ⓐV2.T2.
#n #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV1 #HV2 * #riW #rhW #HW12 *
/6 width=9 by cpg_theta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
qed.
(* Basic inversion lemmas ***************************************************)
-lemma cpm_inv_atom1: ∀n,h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[n, h] T2 →
+lemma cpm_inv_atom1: ∀n,h,J,G,L,T2. ⦃G,L⦄ ⊢ ⓪{J} ➡[n,h] T2 →
∨∨ T2 = ⓪{J} ∧ n = 0
- | ∃∃s. T2 = ⋆(next h s) & J = Sort s & n = 1
- | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃s. T2 = ⋆(⫯[h]s) & J = Sort s & n = 1
+ | ∃∃K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡[n,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓓV1 & J = LRef 0
- | ∃∃m,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[m, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃m,K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡[m,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓛV1 & J = LRef 0 & n = ↑m
- | ∃∃I,K,T,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T & ⬆*[1] T ≘ T2 &
+ | ∃∃I,K,T,i. ⦃G,K⦄ ⊢ #i ➡[n,h] T & ⬆*[1] T ≘ T2 &
L = K.ⓘ{I} & J = LRef (↑i).
#n #h #J #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1 … H) -H *
[ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or5_intro0, conj/
]
qed-.
-lemma cpm_inv_sort1: ∀n,h,G,L,T2,s. ⦃G, L⦄ ⊢ ⋆s ➡[n,h] T2 →
+lemma cpm_inv_sort1: ∀n,h,G,L,T2,s. ⦃G,L⦄ ⊢ ⋆s ➡[n,h] T2 →
∧∧ T2 = ⋆(((next h)^n) s) & n ≤ 1.
#n #h #G #L #T2 #s * #c #Hc #H
elim (cpg_inv_sort1 … H) -H * #H1 #H2 destruct
#H destruct /2 width=1 by conj/
qed-.
-lemma cpm_inv_zero1: ∀n,h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[n, h] T2 →
+lemma cpm_inv_zero1: ∀n,h,G,L,T2. ⦃G,L⦄ ⊢ #0 ➡[n,h] T2 →
∨∨ T2 = #0 ∧ n = 0
- | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡[n,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓓV1
- | ∃∃m,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[m, h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃m,K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡[m,h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓛV1 & n = ↑m.
#n #h #G #L #T2 * #c #Hc #H elim (cpg_inv_zero1 … H) -H *
[ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or3_intro0, conj/
]
qed-.
-lemma cpm_inv_lref1: ∀n,h,G,L,T2,i. ⦃G, L⦄ ⊢ #↑i ➡[n, h] T2 →
+lemma cpm_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
+elim (cpm_inv_zero1 … H) -H *
+[ #H1 #H2 destruct /2 width=1 by conj/
+| #Y #X1 #X2 #_ #_ #H destruct
+| #m #Y #X1 #X2 #_ #_ #H destruct
+]
+qed.
+
+lemma cpm_inv_lref1: ∀n,h,G,L,T2,i. ⦃G,L⦄ ⊢ #↑i ➡[n,h] T2 →
∨∨ T2 = #(↑i) ∧ n = 0
- | ∃∃I,K,T. ⦃G, K⦄ ⊢ #i ➡[n, h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}.
+ | ∃∃I,K,T. ⦃G,K⦄ ⊢ #i ➡[n,h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}.
#n #h #G #L #T2 #i * #c #Hc #H elim (cpg_inv_lref1 … H) -H *
[ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or_introl, conj/
| #I #K #V2 #HV2 #HVT2 #H destruct
]
qed-.
-lemma cpm_inv_gref1: ∀n,h,G,L,T2,l. ⦃G, L⦄ ⊢ §l ➡[n, h] T2 → T2 = §l ∧ n = 0.
+lemma cpm_inv_lref1_ctop (n) (h) (G):
+ ∀X2,i. ⦃G,⋆⦄ ⊢ #i ➡[n,h] X2 → ∧∧ X2 = #i & n = 0.
+#n #h #G #X2 * [| #i ] #H
+[ elim (cpm_inv_zero1 … H) -H *
+ [ #H1 #H2 destruct /2 width=1 by conj/
+ | #Y #X1 #X2 #_ #_ #H destruct
+ | #m #Y #X1 #X2 #_ #_ #H destruct
+ ]
+| elim (cpm_inv_lref1 … H) -H *
+ [ #H1 #H2 destruct /2 width=1 by conj/
+ | #Z #Y #X0 #_ #_ #H destruct
+ ]
+]
+qed.
+
+lemma cpm_inv_gref1: ∀n,h,G,L,T2,l. ⦃G,L⦄ ⊢ §l ➡[n,h] T2 → T2 = §l ∧ n = 0.
#n #h #G #L #T2 #l * #c #Hc #H elim (cpg_inv_gref1 … H) -H
#H1 #H2 destruct /3 width=1 by isrt_inv_00, conj/
qed-.
(* Basic_2A1: includes: cpr_inv_bind1 *)
-lemma cpm_inv_bind1: ∀n,h,p,I,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n, h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[n, h] T2 &
+lemma cpm_inv_bind1: ∀n,h,p,I,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n,h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ➡[n,h] T2 &
U2 = ⓑ{p,I}V2.T2
- | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G, L⦄ ⊢ T ➡[n, h] U2 &
+ | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G,L⦄ ⊢ T ➡[n,h] U2 &
p = true & I = Abbr.
#n #h #p #I #G #L #V1 #T1 #U2 * #c #Hc #H elim (cpg_inv_bind1 … H) -H *
[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
(* Basic_1: includes: pr0_gen_abbr pr2_gen_abbr *)
(* Basic_2A1: includes: cpr_inv_abbr1 *)
-lemma cpm_inv_abbr1: ∀n,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{p}V1.T1 ➡[n, h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[n, h] T2 &
+lemma cpm_inv_abbr1: ∀n,h,p,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓓ{p}V1.T1 ➡[n,h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L.ⓓV1⦄ ⊢ T1 ➡[n,h] T2 &
U2 = ⓓ{p}V2.T2
- | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G, L⦄ ⊢ T ➡[n, h] U2 & p = true.
+ | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G,L⦄ ⊢ T ➡[n,h] U2 & p = true.
#n #h #p #G #L #V1 #T1 #U2 #H
elim (cpm_inv_bind1 … H) -H
[ /3 width=1 by or_introl/
(* Basic_1: includes: pr0_gen_abst pr2_gen_abst *)
(* Basic_2A1: includes: cpr_inv_abst1 *)
-lemma cpm_inv_abst1: ∀n,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{p}V1.T1 ➡[n, h] U2 →
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ➡[n, h] T2 &
+lemma cpm_inv_abst1: ∀n,h,p,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓛ{p}V1.T1 ➡[n,h] U2 →
+ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L.ⓛV1⦄ ⊢ T1 ➡[n,h] T2 &
U2 = ⓛ{p}V2.T2.
#n #h #p #G #L #V1 #T1 #U2 #H
elim (cpm_inv_bind1 … H) -H
(* Basic_1: includes: pr0_gen_appl pr2_gen_appl *)
(* Basic_2A1: includes: cpr_inv_appl1 *)
-lemma cpm_inv_appl1: ∀n,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐ V1.U1 ➡[n, h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[n, h] T2 &
+lemma cpm_inv_appl1: ∀n,h,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓐ V1.U1 ➡[n,h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L⦄ ⊢ U1 ➡[n,h] T2 &
U2 = ⓐV2.T2
- | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ W1 ➡[h] W2 &
- ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[n, h] T2 &
+ | ∃∃p,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L⦄ ⊢ W1 ➡[h] W2 &
+ ⦃G,L.ⓛW1⦄ ⊢ T1 ➡[n,h] T2 &
U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2
- | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≘ V2 &
- ⦃G, L⦄ ⊢ W1 ➡[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[n, h] T2 &
+ | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≘ V2 &
+ ⦃G,L⦄ ⊢ W1 ➡[h] W2 & ⦃G,L.ⓓW1⦄ ⊢ T1 ➡[n,h] T2 &
U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2.
#n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_appl1 … H) -H *
[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
]
qed-.
-lemma cpm_inv_cast1: ∀n,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[n, h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 & ⦃G, L⦄ ⊢ U1 ➡[n, h] T2 &
+lemma cpm_inv_cast1: ∀n,h,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓝV1.U1 ➡[n,h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[n,h] V2 & ⦃G,L⦄ ⊢ U1 ➡[n,h] T2 &
U2 = ⓝV2.T2
- | ⦃G, L⦄ ⊢ U1 ➡[n, h] U2
- | ∃∃m. ⦃G, L⦄ ⊢ V1 ➡[m, h] U2 & n = ↑m.
+ | ⦃G,L⦄ ⊢ U1 ➡[n,h] U2
+ | ∃∃m. ⦃G,L⦄ ⊢ V1 ➡[m,h] U2 & n = ↑m.
#n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_cast1 … H) -H *
[ #cV #cT #V2 #T2 #HV12 #HT12 #HcVT #H1 #H2 destruct
elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
(* Basic forward lemmas *****************************************************)
(* Basic_2A1: includes: cpr_fwd_bind1_minus *)
-lemma cpm_fwd_bind1_minus: ∀n,h,I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡[n, h] T → ∀p.
- ∃∃V2,T2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n, h] ⓑ{p,I}V2.T2 &
+lemma cpm_fwd_bind1_minus: ∀n,h,I,G,L,V1,T1,T. ⦃G,L⦄ ⊢ -ⓑ{I}V1.T1 ➡[n,h] T → ∀p.
+ ∃∃V2,T2. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n,h] ⓑ{p,I}V2.T2 &
T = -ⓑ{I}V2.T2.
#n #h #I #G #L #V1 #T1 #T * #c #Hc #H #p elim (cpg_fwd_bind1_minus … H p) -H
/3 width=4 by ex2_2_intro, ex2_intro/
lemma cpm_ind (h): ∀Q:relation5 nat genv lenv term term.
(∀I,G,L. Q 0 G L (⓪{I}) (⓪{I})) →
- (∀G,L,s. Q 1 G L (⋆s) (⋆(next h s))) →
- (∀n,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 → Q n G K V1 V2 →
+ (∀G,L,s. Q 1 G L (⋆s) (⋆(⫯[h]s))) →
+ (∀n,G,K,V1,V2,W2. ⦃G,K⦄ ⊢ V1 ➡[n,h] V2 → Q n G K V1 V2 →
⬆*[1] V2 ≘ W2 → Q n G (K.ⓓV1) (#0) W2
- ) → (∀n,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 → Q n G K V1 V2 →
+ ) → (∀n,G,K,V1,V2,W2. ⦃G,K⦄ ⊢ V1 ➡[n,h] V2 → Q n G K V1 V2 →
⬆*[1] V2 ≘ W2 → Q (↑n) G (K.ⓛV1) (#0) W2
- ) → (∀n,I,G,K,T,U,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T → Q n G K (#i) T →
+ ) → (∀n,I,G,K,T,U,i. ⦃G,K⦄ ⊢ #i ➡[n,h] T → Q n G K (#i) T →
⬆*[1] T ≘ U → Q n G (K.ⓘ{I}) (#↑i) (U)
- ) → (∀n,p,I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[n, h] T2 →
+ ) → (∀n,p,I,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ➡[n,h] T2 →
Q 0 G L V1 V2 → Q n G (L.ⓑ{I}V1) T1 T2 → Q n G L (ⓑ{p,I}V1.T1) (ⓑ{p,I}V2.T2)
- ) → (∀n,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+ ) → (∀n,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
Q 0 G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓐV1.T1) (ⓐV2.T2)
- ) → (∀n,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+ ) → (∀n,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[n,h] V2 → ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
Q n G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓝV1.T1) (ⓝV2.T2)
- ) → (∀n,G,L,V,T1,T,T2. ⬆*[1] T ≘ T1 → ⦃G, L⦄ ⊢ T ➡[n, h] T2 →
+ ) → (∀n,G,L,V,T1,T,T2. ⬆*[1] T ≘ T1 → ⦃G,L⦄ ⊢ T ➡[n,h] T2 →
Q n G L T T2 → Q n G L (+ⓓV.T1) T2
- ) → (∀n,G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+ ) → (∀n,G,L,V,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
Q n G L T1 T2 → Q n G L (ⓝV.T1) T2
- ) → (∀n,G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 →
+ ) → (∀n,G,L,V1,V2,T. ⦃G,L⦄ ⊢ V1 ➡[n,h] V2 →
Q n G L V1 V2 → Q (↑n) G L (ⓝV1.T) V2
- ) → (∀n,p,G,L,V1,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ W1 ➡[h] W2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[n, h] T2 →
+ ) → (∀n,p,G,L,V1,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L⦄ ⊢ W1 ➡[h] W2 → ⦃G,L.ⓛW1⦄ ⊢ T1 ➡[n,h] T2 →
Q 0 G L V1 V2 → Q 0 G L W1 W2 → Q n G (L.ⓛW1) T1 T2 →
Q n G L (ⓐV1.ⓛ{p}W1.T1) (ⓓ{p}ⓝW2.V2.T2)
- ) → (∀n,p,G,L,V1,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V → ⦃G, L⦄ ⊢ W1 ➡[h] W2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[n, h] T2 →
+ ) → (∀n,p,G,L,V1,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V → ⦃G,L⦄ ⊢ W1 ➡[h] W2 → ⦃G,L.ⓓW1⦄ ⊢ T1 ➡[n,h] T2 →
Q 0 G L V1 V → Q 0 G L W1 W2 → Q n G (L.ⓓW1) T1 T2 →
⬆*[1] V ≘ V2 → Q n G L (ⓐV1.ⓓ{p}W1.T1) (ⓓ{p}W2.ⓐV2.T2)
) →
- ∀n,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → Q n G L T1 T2.
+ ∀n,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → Q n G L T1 T2.
#h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #IH10 #IH11 #IH12 #IH13 #n #G #L #T1 #T2
* #c #HC #H generalize in match HC; -HC generalize in match n; -n
elim H -c -G -L -T1 -T2
(* Note: one of these U is the inferred type of T *)
lemma aaa_cpm_SO (h) (G) (L) (A):
- ∀T. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G,L⦄ ⊢ T ➡[1,h] U.
+ ∀T. ⦃G,L⦄ ⊢ T ⁝ A → ∃U. ⦃G,L⦄ ⊢ T ➡[1,h] U.
#h #G #L #A #T #H elim H -G -L -T -A
[ /3 width=2 by ex_intro/
| * #G #L #V #B #_ * #V0 #HV0
(* Forward lemmas with unbound context-sensitive rt-transition for terms ****)
(* Basic_2A1: includes: cpr_cpx *)
-lemma cpm_fwd_cpx: ∀n,h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → ⦃G, L⦄ ⊢ T1 ⬈[h] T2.
+lemma cpm_fwd_cpx: ∀n,h,G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → ⦃G,L⦄ ⊢ T1 ⬈[h] T2.
#n #h #G #L #T1 #T2 * #c #Hc #H elim H -L -T1 -T2
/2 width=3 by cpx_theta, cpx_beta, cpx_ee, cpx_eps, cpx_zeta, cpx_flat, cpx_bind, cpx_lref, cpx_delta/
qed-.
(* Basic_1: includes: pr2_delta1 *)
(* Basic_2A1: includes: cpr_delta *)
lemma cpm_delta_drops: ∀n,h,G,L,K,V,V2,W2,i.
- ⬇*[i] L ≘ K.ⓓV → ⦃G, K⦄ ⊢ V ➡[n, h] V2 →
- ⬆*[↑i] V2 ≘ W2 → ⦃G, L⦄ ⊢ #i ➡[n, h] W2.
+ ⬇*[i] L ≘ K.ⓓV → ⦃G,K⦄ ⊢ V ➡[n,h] V2 →
+ ⬆*[↑i] V2 ≘ W2 → ⦃G,L⦄ ⊢ #i ➡[n,h] W2.
#n #h #G #L #K #V #V2 #W2 #i #HLK *
/3 width=8 by cpg_delta_drops, ex2_intro/
qed.
lemma cpm_ell_drops: ∀n,h,G,L,K,V,V2,W2,i.
- ⬇*[i] L ≘ K.ⓛV → ⦃G, K⦄ ⊢ V ➡[n, h] V2 →
- ⬆*[↑i] V2 ≘ W2 → ⦃G, L⦄ ⊢ #i ➡[↑n, h] W2.
+ ⬇*[i] L ≘ K.ⓛV → ⦃G,K⦄ ⊢ V ➡[n,h] V2 →
+ ⬆*[↑i] V2 ≘ W2 → ⦃G,L⦄ ⊢ #i ➡[↑n,h] W2.
#n #h #G #L #K #V #V2 #W2 #i #HLK *
/3 width=8 by cpg_ell_drops, isrt_succ, ex2_intro/
qed.
(* Advanced inversion lemmas ************************************************)
-lemma cpm_inv_atom1_drops: ∀n,h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ➡[n, h] T2 →
+lemma cpm_inv_atom1_drops: ∀n,h,I,G,L,T2. ⦃G,L⦄ ⊢ ⓪{I} ➡[n,h] T2 →
∨∨ T2 = ⓪{I} ∧ n = 0
- | ∃∃s. T2 = ⋆(next h s) & I = Sort s & n = 1
- | ∃∃K,V,V2,i. ⬇*[i] L ≘ K.ⓓV & ⦃G, K⦄ ⊢ V ➡[n, h] V2 &
+ | ∃∃s. T2 = ⋆(⫯[h]s) & I = Sort s & n = 1
+ | ∃∃K,V,V2,i. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V ➡[n,h] V2 &
⬆*[↑i] V2 ≘ T2 & I = LRef i
- | ∃∃m,K,V,V2,i. ⬇*[i] L ≘ K.ⓛV & ⦃G, K⦄ ⊢ V ➡[m, h] V2 &
+ | ∃∃m,K,V,V2,i. ⬇*[i] L ≘ K.ⓛV & ⦃G,K⦄ ⊢ V ➡[m,h] V2 &
⬆*[↑i] V2 ≘ T2 & I = LRef i & n = ↑m.
#n #h #I #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1_drops … H) -H *
[ #H1 #H2 destruct lapply (isrt_inv_00 … Hc) -Hc
]
qed-.
-lemma cpm_inv_lref1_drops: ∀n,h,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[n, h] T2 →
+lemma cpm_inv_lref1_drops: ∀n,h,G,L,T2,i. ⦃G,L⦄ ⊢ #i ➡[n,h] T2 →
∨∨ T2 = #i ∧ n = 0
- | ∃∃K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G, K⦄ ⊢ V ➡[n, h] V2 &
+ | ∃∃K,V,V2. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V ➡[n,h] V2 &
⬆*[↑i] V2 ≘ T2
- | ∃∃m,K,V,V2. ⬇*[i] L ≘ K. ⓛV & ⦃G, K⦄ ⊢ V ➡[m, h] V2 &
+ | ∃∃m,K,V,V2. ⬇*[i] L ≘ K. ⓛV & ⦃G,K⦄ ⊢ V ➡[m,h] V2 &
⬆*[↑i] V2 ≘ T2 & n = ↑m.
#n #h #G #L #T2 #i * #c #Hc #H elim (cpg_inv_lref1_drops … H) -H *
[ #H1 #H2 destruct lapply (isrt_inv_00 … Hc) -Hc
(* Advanced forward lemmas **************************************************)
-fact cpm_fwd_plus_aux (n) (h): ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+fact cpm_fwd_plus_aux (n) (h): ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
∀n1,n2. n1+n2 = n →
- ∃∃T. ⦃G, L⦄ ⊢ T1 ➡[n1, h] T & ⦃G, L⦄ ⊢ T ➡[n2, h] T2.
+ ∃∃T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T & ⦃G,L⦄ ⊢ T ➡[n2,h] T2.
#n #h #G #L #T1 #T2 #H @(cpm_ind … H) -G -L -T1 -T2 -n
[ #I #G #L #n1 #n2 #H
elim (plus_inv_O3 … H) -H #H1 #H2 destruct
]
qed-.
-lemma cpm_fwd_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 cpm_fwd_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.
/2 width=3 by cpm_fwd_plus_aux/ qed-.
#n #h #G #L1 #T1 #T2 * /3 width=5 by lsubr_cpg_trans, ex2_intro/
qed-.
-lemma cpm_bind_unit (n) (h) (G): ∀L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
- ∀J,T1,T2. ⦃G, L.ⓤ{J}⦄ ⊢ T1 ➡[n, h] T2 →
- ∀p,I. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n, h] ⓑ{p,I}V2.T2.
+lemma cpm_bind_unit (n) (h) (G): ∀L,V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 →
+ ∀J,T1,T2. ⦃G,L.ⓤ{J}⦄ ⊢ T1 ➡[n,h] T2 →
+ ∀p,I. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n,h] ⓑ{p,I}V2.T2.
/4 width=4 by lsubr_cpm_trans, cpm_bind, lsubr_unit/ qed.
(* Properties with simple terms *********************************************)
(* Basic_2A1: includes: cpr_inv_appl1_simple *)
-lemma cpm_inv_appl1_simple: ∀n,h,G,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡[n, h] U → 𝐒⦃T1⦄ →
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 &
+lemma cpm_inv_appl1_simple: ∀n,h,G,L,V1,T1,U. ⦃G,L⦄ ⊢ ⓐV1.T1 ➡[n,h] U → 𝐒⦃T1⦄ →
+ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 &
U = ⓐV2.T2.
#n #h #G #L #V1 #T1 #U * #c #Hc #H #HT1 elim (cpg_inv_appl1_simple … H HT1) -H -HT1
#cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct elim (isrt_inv_max … Hc) -Hc
(* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
-(* Inversion lemmas with degree-based equivalence for terms *****************)
+(* Inversion lemmas with sort-irrelevant equivalence for terms **************)
-lemma cpm_tdeq_inv_lref_sn (n) (h) (o) (G) (L) (i):
- ∀X. ⦃G,L⦄ ⊢ #i ➡[n,h] X → #i ≛[h,o] X →
+lemma cpm_tdeq_inv_lref_sn (n) (h) (G) (L) (i):
+ ∀X. ⦃G,L⦄ ⊢ #i ➡[n,h] X → #i ≛ X →
∧∧ X = #i & n = 0.
-#n #h #o #G #L #i #X #H1 #H2
+#n #h #G #L #i #X #H1 #H2
lapply (tdeq_inv_lref1 … H2) -H2 #H destruct
elim (cpm_inv_lref1_drops … H1) -H1 // * [| #m ]
#K #V1 #V2 #_ #_ #H -V1
elim (lifts_inv_lref2_uni_lt … H) -H //
qed-.
-lemma cpm_tdeq_inv_atom_sn (n) (h) (o) (I) (G) (L):
- ∀X. ⦃G,L⦄ ⊢ ⓪{I} ➡[n,h] X → ⓪{I} ≛[h,o] X →
+lemma cpm_tdeq_inv_atom_sn (n) (h) (I) (G) (L):
+ ∀X. ⦃G,L⦄ ⊢ ⓪{I} ➡[n,h] X → ⓪{I} ≛ X →
∨∨ ∧∧ X = ⓪{I} & n = 0
- | ∃∃s. X = ⋆(next h s) & I = Sort s & n = 1 & deg h o s 0.
-#n #h #o * #s #G #L #X #H1 #H2
+ | ∃∃s. X = ⋆(⫯[h]s) & I = Sort s & n = 1.
+#n #h * #s #G #L #X #H1 #H2
[ elim (cpm_inv_sort1 … H1) -H1
- cases n -n [| #n ] #H #Hn destruct
+ cases n -n [| #n ] #H #Hn destruct -H2
[ /3 width=1 by or_introl, conj/
- | elim (tdeq_inv_sort1 … H2) -H2 #x #d #Hs
- <(le_n_O_to_eq n) [| /2 width=3 by le_S_S_to_le/ ] -n #Hx #H destruct
- lapply (deg_next … Hs) #H
- lapply (deg_mono … H Hx) -H -Hx #Hd
- lapply (pred_inv_fix_sn … Hd) -Hd #H destruct
- /3 width=4 by refl, ex4_intro, or_intror/
+ | <(le_n_O_to_eq n) [| /2 width=3 by le_S_S_to_le/ ] -n
+ /3 width=3 by ex3_intro, or_intror/
]
| elim (cpm_tdeq_inv_lref_sn … H1 H2) -H1 -H2 /3 width=1 by or_introl, conj/
| elim (cpm_inv_gref1 … H1) -H1 -H2 /3 width=1 by or_introl, conj/
(* Note: cpr_flat: does not hold in basic_1 *)
(* Basic_1: includes: pr2_thin_dx *)
lemma cpr_flat: ∀h,I,G,L,V1,V2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[h] T2 →
- ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡[h] ⓕ{I}V2.T2.
+ ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L⦄ ⊢ T1 ➡[h] T2 →
+ ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ➡[h] ⓕ{I}V2.T2.
#h * /2 width=1 by cpm_cast, cpm_appl/
qed.
(* Basic_1: was: pr2_head_1 *)
-lemma cpr_pair_sn: ∀h,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
- ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ➡[h] ②{I}V2.T.
+lemma cpr_pair_sn: ∀h,I,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 →
+ ∀T. ⦃G,L⦄ ⊢ ②{I}V1.T ➡[h] ②{I}V2.T.
#h * /2 width=1 by cpm_bind, cpr_flat/
qed.
(* Basic inversion properties ***********************************************)
-lemma cpr_inv_atom1: ∀h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[h] T2 →
+lemma cpr_inv_atom1: ∀h,J,G,L,T2. ⦃G,L⦄ ⊢ ⓪{J} ➡[h] T2 →
∨∨ T2 = ⓪{J}
- | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓓV1 & J = LRef 0
- | ∃∃I,K,T,i. ⦃G, K⦄ ⊢ #i ➡[h] T & ⬆*[1] T ≘ T2 &
+ | ∃∃I,K,T,i. ⦃G,K⦄ ⊢ #i ➡[h] T & ⬆*[1] T ≘ T2 &
L = K.ⓘ{I} & J = LRef (↑i).
#h #J #G #L #T2 #H elim (cpm_inv_atom1 … H) -H *
[2,4:|*: /3 width=8 by or3_intro0, or3_intro1, or3_intro2, ex4_4_intro, ex4_3_intro/ ]
qed-.
(* Basic_1: includes: pr0_gen_sort pr2_gen_sort *)
-lemma cpr_inv_sort1: ∀h,G,L,T2,s. ⦃G, L⦄ ⊢ ⋆s ➡[h] T2 → T2 = ⋆s.
+lemma cpr_inv_sort1: ∀h,G,L,T2,s. ⦃G,L⦄ ⊢ ⋆s ➡[h] T2 → T2 = ⋆s.
#h #G #L #T2 #s #H elim (cpm_inv_sort1 … H) -H //
qed-.
-lemma cpr_inv_zero1: ∀h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[h] T2 →
+lemma cpr_inv_zero1: ∀h,G,L,T2. ⦃G,L⦄ ⊢ #0 ➡[h] T2 →
∨∨ T2 = #0
- | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃K,V1,V2. ⦃G,K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓓV1.
#h #G #L #T2 #H elim (cpm_inv_zero1 … H) -H *
/3 width=6 by ex3_3_intro, or_introl, or_intror/
#n #K #V1 #V2 #_ #_ #_ #H destruct
qed-.
-lemma cpr_inv_lref1: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #↑i ➡[h] T2 →
+lemma cpr_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 elim (cpm_inv_lref1 … H) -H *
/3 width=6 by ex3_3_intro, or_introl, or_intror/
qed-.
-lemma cpr_inv_gref1: ∀h,G,L,T2,l. ⦃G, L⦄ ⊢ §l ➡[h] T2 → T2 = §l.
+lemma cpr_inv_gref1: ∀h,G,L,T2,l. ⦃G,L⦄ ⊢ §l ➡[h] T2 → T2 = §l.
#h #G #L #T2 #l #H elim (cpm_inv_gref1 … H) -H //
qed-.
(* Basic_1: includes: pr0_gen_cast pr2_gen_cast *)
-lemma cpr_inv_cast1: ∀h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝ V1.U1 ➡[h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[h] T2 &
+lemma cpr_inv_cast1: ∀h,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓝ V1.U1 ➡[h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L⦄ ⊢ U1 ➡[h] T2 &
U2 = ⓝV2.T2
- | ⦃G, L⦄ ⊢ U1 ➡[h] U2.
+ | ⦃G,L⦄ ⊢ U1 ➡[h] U2.
#h #G #L #V1 #U1 #U2 #H elim (cpm_inv_cast1 … H) -H
/2 width=1 by or_introl, or_intror/ * #n #_ #H destruct
qed-.
-lemma cpr_inv_flat1: ∀h,I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡[h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[h] T2 &
+lemma cpr_inv_flat1: ∀h,I,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓕ{I}V1.U1 ➡[h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L⦄ ⊢ U1 ➡[h] T2 &
U2 = ⓕ{I}V2.T2
- | (⦃G, L⦄ ⊢ U1 ➡[h] U2 ∧ I = Cast)
- | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ W1 ➡[h] W2 &
- ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[h] T2 & U1 = ⓛ{p}W1.T1 &
+ | (⦃G,L⦄ ⊢ U1 ➡[h] U2 ∧ I = Cast)
+ | ∃∃p,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 & ⦃G,L⦄ ⊢ W1 ➡[h] W2 &
+ ⦃G,L.ⓛW1⦄ ⊢ T1 ➡[h] T2 & U1 = ⓛ{p}W1.T1 &
U2 = ⓓ{p}ⓝW2.V2.T2 & I = Appl
- | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≘ V2 &
- ⦃G, L⦄ ⊢ W1 ➡[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h] T2 &
+ | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≘ V2 &
+ ⦃G,L⦄ ⊢ W1 ➡[h] W2 & ⦃G,L.ⓓW1⦄ ⊢ T1 ➡[h] T2 &
U1 = ⓓ{p}W1.T1 &
U2 = ⓓ{p}W2.ⓐV2.T2 & I = Appl.
#h * #G #L #V1 #U1 #U2 #H
lemma cpr_ind (h): ∀Q:relation4 genv lenv term term.
(∀I,G,L. Q G L (⓪{I}) (⓪{I})) →
- (∀G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 → Q G K V1 V2 →
+ (∀G,K,V1,V2,W2. ⦃G,K⦄ ⊢ V1 ➡[h] V2 → Q G K V1 V2 →
⬆*[1] V2 ≘ W2 → Q G (K.ⓓV1) (#0) W2
- ) → (∀I,G,K,T,U,i. ⦃G, K⦄ ⊢ #i ➡[h] T → Q G K (#i) T →
+ ) → (∀I,G,K,T,U,i. ⦃G,K⦄ ⊢ #i ➡[h] T → Q G K (#i) T →
⬆*[1] T ≘ U → Q G (K.ⓘ{I}) (#↑i) (U)
- ) → (∀p,I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[h] T2 →
+ ) → (∀p,I,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ➡[h] T2 →
Q G L V1 V2 → Q G (L.ⓑ{I}V1) T1 T2 → Q G L (ⓑ{p,I}V1.T1) (ⓑ{p,I}V2.T2)
- ) → (∀I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[h] T2 →
+ ) → (∀I,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L⦄ ⊢ T1 ➡[h] T2 →
Q G L V1 V2 → Q G L T1 T2 → Q G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2)
- ) → (∀G,L,V,T1,T,T2. ⬆*[1] T ≘ T1 → ⦃G, L⦄ ⊢ T ➡[h] T2 →
+ ) → (∀G,L,V,T1,T,T2. ⬆*[1] T ≘ T1 → ⦃G,L⦄ ⊢ T ➡[h] T2 →
Q G L T T2 → Q G L (+ⓓV.T1) T2
- ) → (∀G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 → Q G L T1 T2 →
+ ) → (∀G,L,V,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → Q G L T1 T2 →
Q G L (ⓝV.T1) T2
- ) → (∀p,G,L,V1,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ W1 ➡[h] W2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[h] T2 →
+ ) → (∀p,G,L,V1,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V2 → ⦃G,L⦄ ⊢ W1 ➡[h] W2 → ⦃G,L.ⓛW1⦄ ⊢ T1 ➡[h] T2 →
Q G L V1 V2 → Q G L W1 W2 → Q G (L.ⓛW1) T1 T2 →
Q G L (ⓐV1.ⓛ{p}W1.T1) (ⓓ{p}ⓝW2.V2.T2)
- ) → (∀p,G,L,V1,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V → ⦃G, L⦄ ⊢ W1 ➡[h] W2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h] T2 →
+ ) → (∀p,G,L,V1,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ➡[h] V → ⦃G,L⦄ ⊢ W1 ➡[h] W2 → ⦃G,L.ⓓW1⦄ ⊢ T1 ➡[h] T2 →
Q G L V1 V → Q G L W1 W2 → Q G (L.ⓓW1) T1 T2 →
⬆*[1] V ≘ V2 → Q G L (ⓐV1.ⓓ{p}W1.T1) (ⓓ{p}W2.ⓐV2.T2)
) →
- ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 → Q G L T1 T2.
+ ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ➡[h] T2 → Q G L T1 T2.
#h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #G #L #T1 #T2
@(insert_eq_0 … 0) #n #H
@(cpm_ind … H) -G -L -T1 -T2 -n [2,4,11:|*: /3 width=4 by/ ]
(* Advanced inversion lemmas ************************************************)
(* Basic_2A1: includes: cpr_inv_atom1 *)
-lemma cpr_inv_atom1_drops: ∀h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ➡[h] T2 →
+lemma cpr_inv_atom1_drops: ∀h,I,G,L,T2. ⦃G,L⦄ ⊢ ⓪{I} ➡[h] T2 →
∨∨ T2 = ⓪{I}
- | ∃∃K,V,V2,i. ⬇*[i] L ≘ K.ⓓV & ⦃G, K⦄ ⊢ V ➡[h] V2 &
+ | ∃∃K,V,V2,i. ⬇*[i] L ≘ K.ⓓV & ⦃G,K⦄ ⊢ V ➡[h] V2 &
⬆*[↑i] V2 ≘ T2 & I = LRef i.
#h #I #G #L #T2 #H elim (cpm_inv_atom1_drops … H) -H *
[ /2 width=1 by or_introl/
(* Basic_1: includes: pr0_gen_lref pr2_gen_lref *)
(* Basic_2A1: includes: cpr_inv_lref1 *)
-lemma cpr_inv_lref1_drops: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[h] T2 →
+lemma cpr_inv_lref1_drops: ∀h,G,L,T2,i. ⦃G,L⦄ ⊢ #i ➡[h] T2 →
∨∨ T2 = #i
- | ∃∃K,V,V2. ⬇*[i] L ≘ K. ⓓV & ⦃G, K⦄ ⊢ V ➡[h] V2 &
+ | ∃∃K,V,V2. ⬇*[i] L ≘ K. ⓓV & ⦃G,K⦄ ⊢ V ➡[h] V2 &
⬆*[↑i] V2 ≘ T2.
#h #G #L #T2 #i #H elim (cpm_inv_lref1_drops … H) -H *
[ /2 width=1 by or_introl/
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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_basic.ma".
+include "basic_2/rt_transition/cpm_drops.ma".
+include "basic_2/rt_transition/cpr.ma".
+
+(* CONTEXT-SENSITIVE PARALLEL R-TRANSITION FOR TERMS ************************)
+
+(* Properties with basic relocation *****************************************)
+
+lemma cpr_subst (h) (G) (L) (U1) (i):
+ ∀K,V. ⬇*[i] L ≘ K.ⓓV →
+ ∃∃U2,T2. ⦃G,L⦄ ⊢ U1 ➡[h] U2 & ⬆[i,1] T2 ≘ U2.
+#h #G #L #U1 @(fqup_wf_ind_eq (Ⓣ) … G L U1) -G -L -U1
+#G0 #L0 #U0 #IH #G #L * *
+[ #s #HG #HL #HT #i #K #V #_ destruct -IH
+ /2 width=4 by lifts_sort, ex2_2_intro/
+| #j #HG #HL #HT #i #K #V #HLK destruct -IH
+ elim (lt_or_eq_or_gt i j) #Hij
+ [ /3 width=4 by lifts_lref_ge_minus, cpr_refl, ex2_2_intro/
+ | elim (lifts_total V (𝐔❴↑i❵)) #U2 #HU2
+ elim (lifts_split_trans … HU2 (𝐔❴i❵) (𝐁❴i,1❵)) [2: @(after_basic_rc i 0) ]
+ /3 width=7 by cpm_delta_drops, ex2_2_intro/
+ | /3 width=4 by lifts_lref_lt, cpr_refl, ex2_2_intro/
+ ]
+| #l #HG #HL #HT #i #K #V #_ destruct -IH
+ /2 width=4 by lifts_gref, ex2_2_intro/
+| #p #J #W1 #U1 #HG #HL #HT #i #K #V #HLK destruct
+ elim (IH G L W1 … HLK) [| // ] #W2 #V2 #HW12 #HVW2
+ elim (IH G (L.ⓑ{J}W1) U1 … (↑i)) [|*: /3 width=4 by drops_drop/ ] #U2 #T2 #HU12 #HTU2
+ /3 width=9 by cpm_bind, lifts_bind, ex2_2_intro/
+| #J #W1 #U1 #HG #HL #HT #i #K #V #HLK destruct
+ elim (IH G L W1 … HLK) [| // ] #W2 #V2 #HW12 #HVW2
+ elim (IH G L U1 … HLK) [| // ] #U2 #T2 #HU12 #HTU2
+ /3 width=8 by cpr_flat, lifts_flat, ex2_2_intro/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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".
+
+(* CONTEXT-SENSITIVE PARALLEL R-TRANSITION FOR TERMS ************************)
+
+(* Properties with context-free sort-irrelevant equivalence *****************)
+
+lemma cpr_abbr_pos_tdneq (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 (tdeq_dec U1 U2) [ -HU12 #HU12 | -HTU2 #HnU12 ]
+[ elim (tdeq_inv_lifts_dx … HU12 … HTU2) -U2 #T1 #HTU1 #_ -T2
+ /3 width=9 by cpm_zeta, tdeq_lifts_inv_pair_sn, ex2_intro/
+| @(ex2_intro … (+ⓓV.U2)) [ /2 width=1 by cpm_bind/ ] -HU12 #H
+ elim (tdeq_inv_pair … H) -H #_ #_ /2 width=1 by/
+]
+qed-.
(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
definition cpx (h): relation4 genv lenv term term ≝
- λG,L,T1,T2. ∃c. ⦃G, L⦄ ⊢ T1 ⬈[eq_f, c, h] T2.
+ λG,L,T1,T2. ∃c. ⦃G,L⦄ ⊢ T1 ⬈[eq_f,c,h] T2.
interpretation
"unbound context-sensitive parallel rt-transition (term)"
(* Basic properties *********************************************************)
(* Basic_2A1: was: cpx_st *)
-lemma cpx_ess: ∀h,G,L,s. ⦃G, L⦄ ⊢ ⋆s ⬈[h] ⋆(next h s).
+lemma cpx_ess: ∀h,G,L,s. ⦃G,L⦄ ⊢ ⋆s ⬈[h] ⋆(⫯[h]s).
/2 width=2 by cpg_ess, ex_intro/ qed.
-lemma cpx_delta: ∀h,I,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ⬈[h] V2 →
- ⬆*[1] V2 ≘ W2 → ⦃G, K.ⓑ{I}V1⦄ ⊢ #0 ⬈[h] W2.
+lemma cpx_delta: ∀h,I,G,K,V1,V2,W2. ⦃G,K⦄ ⊢ V1 ⬈[h] V2 →
+ ⬆*[1] V2 ≘ W2 → ⦃G,K.ⓑ{I}V1⦄ ⊢ #0 ⬈[h] W2.
#h * #G #K #V1 #V2 #W2 *
/3 width=4 by cpg_delta, cpg_ell, ex_intro/
qed.
-lemma cpx_lref: ∀h,I,G,K,T,U,i. ⦃G, K⦄ ⊢ #i ⬈[h] T →
- ⬆*[1] T ≘ U → ⦃G, K.ⓘ{I}⦄ ⊢ #↑i ⬈[h] U.
+lemma cpx_lref: ∀h,I,G,K,T,U,i. ⦃G,K⦄ ⊢ #i ⬈[h] T →
+ ⬆*[1] T ≘ U → ⦃G,K.ⓘ{I}⦄ ⊢ #↑i ⬈[h] U.
#h #I #G #K #T #U #i *
/3 width=4 by cpg_lref, ex_intro/
qed.
lemma cpx_bind: ∀h,p,I,G,L,V1,V2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬈[h] T2 →
- ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] ⓑ{p,I}V2.T2.
+ ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ⬈[h] T2 →
+ ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] ⓑ{p,I}V2.T2.
#h #p #I #G #L #V1 #V2 #T1 #T2 * #cV #HV12 *
/3 width=2 by cpg_bind, ex_intro/
qed.
lemma cpx_flat: ∀h,I,G,L,V1,V2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L⦄ ⊢ T1 ⬈[h] T2 →
- ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈[h] ⓕ{I}V2.T2.
+ ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L⦄ ⊢ T1 ⬈[h] T2 →
+ ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ⬈[h] ⓕ{I}V2.T2.
#h * #G #L #V1 #V2 #T1 #T2 * #cV #HV12 *
/3 width=5 by cpg_appl, cpg_cast, ex_intro/
qed.
lemma cpx_zeta (h) (G) (L):
- ∀T1,T. ⬆*[1] T ≘ T1 → ∀T2. ⦃G, L⦄ ⊢ T ⬈[h] T2 →
- ∀V. ⦃G, L⦄ ⊢ +ⓓV.T1 ⬈[h] T2.
+ ∀T1,T. ⬆*[1] T ≘ T1 → ∀T2. ⦃G,L⦄ ⊢ T ⬈[h] T2 →
+ ∀V. ⦃G,L⦄ ⊢ +ⓓV.T1 ⬈[h] T2.
#h #G #L #T1 #T #HT1 #T2 *
/3 width=4 by cpg_zeta, ex_intro/
qed.
-lemma cpx_eps: ∀h,G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → ⦃G, L⦄ ⊢ ⓝV.T1 ⬈[h] T2.
+lemma cpx_eps: ∀h,G,L,V,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → ⦃G,L⦄ ⊢ ⓝV.T1 ⬈[h] T2.
#h #G #L #V #T1 #T2 *
/3 width=2 by cpg_eps, ex_intro/
qed.
(* Basic_2A1: was: cpx_ct *)
-lemma cpx_ee: ∀h,G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L⦄ ⊢ ⓝV1.T ⬈[h] V2.
+lemma cpx_ee: ∀h,G,L,V1,V2,T. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L⦄ ⊢ ⓝV1.T ⬈[h] V2.
#h #G #L #V1 #V2 #T *
/3 width=2 by cpg_ee, ex_intro/
qed.
lemma cpx_beta: ∀h,p,G,L,V1,V2,W1,W2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L⦄ ⊢ W1 ⬈[h] W2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 →
- ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈[h] ⓓ{p}ⓝW2.V2.T2.
+ ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L⦄ ⊢ W1 ⬈[h] W2 → ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 →
+ ⦃G,L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈[h] ⓓ{p}ⓝW2.V2.T2.
#h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 * #cV #HV12 * #cW #HW12 *
/3 width=2 by cpg_beta, ex_intro/
qed.
lemma cpx_theta: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2.
- ⦃G, L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≘ V2 → ⦃G, L⦄ ⊢ W1 ⬈[h] W2 →
- ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 →
- ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈[h] ⓓ{p}W2.ⓐV2.T2.
+ ⦃G,L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≘ V2 → ⦃G,L⦄ ⊢ W1 ⬈[h] W2 →
+ ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 →
+ ⦃G,L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈[h] ⓓ{p}W2.ⓐV2.T2.
#h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 * #cV #HV1 #HV2 * #cW #HW12 *
/3 width=4 by cpg_theta, ex_intro/
qed.
(* Advanced properties ******************************************************)
-lemma cpx_pair_sn: ∀h,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 →
- ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ⬈[h] ②{I}V2.T.
+lemma cpx_pair_sn: ∀h,I,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 →
+ ∀T. ⦃G,L⦄ ⊢ ②{I}V1.T ⬈[h] ②{I}V2.T.
#h * /2 width=2 by cpx_flat, cpx_bind/
qed.
(* Basic inversion lemmas ***************************************************)
-lemma cpx_inv_atom1: ∀h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ⬈[h] T2 →
+lemma cpx_inv_atom1: ∀h,J,G,L,T2. ⦃G,L⦄ ⊢ ⓪{J} ⬈[h] T2 →
∨∨ T2 = ⓪{J}
- | ∃∃s. T2 = ⋆(next h s) & J = Sort s
- | ∃∃I,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[h] V2 & ⬆*[1] V2 ≘ T2 &
+ | ∃∃s. T2 = ⋆(⫯[h]s) & J = Sort s
+ | ∃∃I,K,V1,V2. ⦃G,K⦄ ⊢ V1 ⬈[h] V2 & ⬆*[1] V2 ≘ T2 &
L = K.ⓑ{I}V1 & J = LRef 0
- | ∃∃I,K,T,i. ⦃G, K⦄ ⊢ #i ⬈[h] T & ⬆*[1] T ≘ T2 &
+ | ∃∃I,K,T,i. ⦃G,K⦄ ⊢ #i ⬈[h] T & ⬆*[1] T ≘ T2 &
L = K.ⓘ{I} & J = LRef (↑i).
#h #J #G #L #T2 * #c #H elim (cpg_inv_atom1 … H) -H *
/4 width=8 by or4_intro0, or4_intro1, or4_intro2, or4_intro3, ex4_4_intro, ex2_intro, ex_intro/
qed-.
-lemma cpx_inv_sort1: ∀h,G,L,T2,s. ⦃G, L⦄ ⊢ ⋆s ⬈[h] T2 →
- ∨∨ T2 = ⋆s | T2 = ⋆(next h s).
+lemma cpx_inv_sort1: ∀h,G,L,T2,s. ⦃G,L⦄ ⊢ ⋆s ⬈[h] T2 →
+ ∨∨ T2 = ⋆s | T2 = ⋆(⫯[h]s).
#h #G #L #T2 #s * #c #H elim (cpg_inv_sort1 … H) -H *
/2 width=1 by or_introl, or_intror/
qed-.
-lemma cpx_inv_zero1: ∀h,G,L,T2. ⦃G, L⦄ ⊢ #0 ⬈[h] T2 →
+lemma cpx_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 * #c #H elim (cpg_inv_zero1 … H) -H *
/4 width=7 by ex3_4_intro, ex_intro, or_introl, or_intror/
qed-.
-lemma cpx_inv_lref1: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #↑i ⬈[h] T2 →
+lemma cpx_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 * #c #H elim (cpg_inv_lref1 … H) -H *
/4 width=6 by ex3_3_intro, ex_intro, or_introl, or_intror/
qed-.
-lemma cpx_inv_gref1: ∀h,G,L,T2,l. ⦃G, L⦄ ⊢ §l ⬈[h] T2 → T2 = §l.
+lemma cpx_inv_gref1: ∀h,G,L,T2,l. ⦃G,L⦄ ⊢ §l ⬈[h] T2 → T2 = §l.
#h #G #L #T2 #l * #c #H elim (cpg_inv_gref1 … H) -H //
qed-.
-lemma cpx_inv_bind1: ∀h,p,I,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬈[h] T2 &
+lemma cpx_inv_bind1: ∀h,p,I,G,L,V1,T1,U2. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 & ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ⬈[h] T2 &
U2 = ⓑ{p,I}V2.T2
- | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G, L⦄ ⊢ T ⬈[h] U2 &
+ | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G,L⦄ ⊢ T ⬈[h] U2 &
p = true & I = Abbr.
#h #p #I #G #L #V1 #T1 #U2 * #c #H elim (cpg_inv_bind1 … H) -H *
/4 width=5 by ex4_intro, ex3_2_intro, ex_intro, or_introl, or_intror/
qed-.
-lemma cpx_inv_abbr1: ∀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 &
+lemma cpx_inv_abbr1: ∀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 &
U2 = ⓓ{p}V2.T2
- | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G, L⦄ ⊢ T ⬈[h] U2 & p = true.
+ | ∃∃T. ⬆*[1] T ≘ T1 & ⦃G,L⦄ ⊢ T ⬈[h] U2 & p = true.
#h #p #G #L #V1 #T1 #U2 * #c #H elim (cpg_inv_abbr1 … H) -H *
/4 width=5 by ex3_2_intro, ex3_intro, ex_intro, or_introl, or_intror/
qed-.
-lemma cpx_inv_abst1: ∀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 &
+lemma cpx_inv_abst1: ∀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 &
U2 = ⓛ{p}V2.T2.
#h #p #G #L #V1 #T1 #U2 * #c #H elim (cpg_inv_abst1 … H) -H
/3 width=5 by ex3_2_intro, ex_intro/
qed-.
-lemma cpx_inv_appl1: ∀h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐ V1.U1 ⬈[h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[h] T2 &
+lemma cpx_inv_appl1: ∀h,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓐ V1.U1 ⬈[h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 & ⦃G,L⦄ ⊢ U1 ⬈[h] T2 &
U2 = ⓐV2.T2
- | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 & ⦃G, L⦄ ⊢ W1 ⬈[h] W2 &
- ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 &
+ | ∃∃p,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 & ⦃G,L⦄ ⊢ W1 ⬈[h] W2 &
+ ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 &
U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2
- | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V & ⬆*[1] V ≘ V2 &
- ⦃G, L⦄ ⊢ W1 ⬈[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 &
+ | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V & ⬆*[1] V ≘ V2 &
+ ⦃G,L⦄ ⊢ W1 ⬈[h] W2 & ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 &
U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2.
#h #G #L #V1 #U1 #U2 * #c #H elim (cpg_inv_appl1 … H) -H *
/4 width=13 by or3_intro0, or3_intro1, or3_intro2, ex6_7_intro, ex5_6_intro, ex3_2_intro, ex_intro/
qed-.
-lemma cpx_inv_cast1: ∀h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ⬈[h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[h] T2 &
+lemma cpx_inv_cast1: ∀h,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓝV1.U1 ⬈[h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 & ⦃G,L⦄ ⊢ U1 ⬈[h] T2 &
U2 = ⓝV2.T2
- | ⦃G, L⦄ ⊢ U1 ⬈[h] U2
- | ⦃G, L⦄ ⊢ V1 ⬈[h] U2.
+ | ⦃G,L⦄ ⊢ U1 ⬈[h] U2
+ | ⦃G,L⦄ ⊢ V1 ⬈[h] U2.
#h #G #L #V1 #U1 #U2 * #c #H elim (cpg_inv_cast1 … H) -H *
/4 width=5 by or3_intro0, or3_intro1, or3_intro2, ex3_2_intro, ex_intro/
qed-.
(* Advanced inversion lemmas ************************************************)
-lemma cpx_inv_zero1_pair: ∀h,I,G,K,V1,T2. ⦃G, K.ⓑ{I}V1⦄ ⊢ #0 ⬈[h] T2 →
+lemma cpx_inv_zero1_pair: ∀h,I,G,K,V1,T2. ⦃G,K.ⓑ{I}V1⦄ ⊢ #0 ⬈[h] T2 →
∨∨ T2 = #0
- | ∃∃V2. ⦃G, K⦄ ⊢ V1 ⬈[h] V2 & ⬆*[1] V2 ≘ T2.
+ | ∃∃V2. ⦃G,K⦄ ⊢ V1 ⬈[h] V2 & ⬆*[1] V2 ≘ T2.
#h #I #G #L #V1 #T2 * #c #H elim (cpg_inv_zero1_pair … H) -H *
/4 width=3 by ex2_intro, ex_intro, or_intror, or_introl/
qed-.
-lemma cpx_inv_lref1_bind: ∀h,I,G,K,T2,i. ⦃G, K.ⓘ{I}⦄ ⊢ #↑i ⬈[h] T2 →
+lemma cpx_inv_lref1_bind: ∀h,I,G,K,T2,i. ⦃G,K.ⓘ{I}⦄ ⊢ #↑i ⬈[h] T2 →
∨∨ T2 = #(↑i)
- | ∃∃T. ⦃G, K⦄ ⊢ #i ⬈[h] T & ⬆*[1] T ≘ T2.
+ | ∃∃T. ⦃G,K⦄ ⊢ #i ⬈[h] T & ⬆*[1] T ≘ T2.
#h #I #G #L #T2 #i * #c #H elim (cpg_inv_lref1_bind … H) -H *
/4 width=3 by ex2_intro, ex_intro, or_introl, or_intror/
qed-.
-lemma cpx_inv_flat1: ∀h,I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ⬈[h] U2 →
- ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[h] T2 &
+lemma cpx_inv_flat1: ∀h,I,G,L,V1,U1,U2. ⦃G,L⦄ ⊢ ⓕ{I}V1.U1 ⬈[h] U2 →
+ ∨∨ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 & ⦃G,L⦄ ⊢ U1 ⬈[h] T2 &
U2 = ⓕ{I}V2.T2
- | (⦃G, L⦄ ⊢ U1 ⬈[h] U2 ∧ I = Cast)
- | (⦃G, L⦄ ⊢ V1 ⬈[h] U2 ∧ I = Cast)
- | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 & ⦃G, L⦄ ⊢ W1 ⬈[h] W2 &
- ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 &
+ | (⦃G,L⦄ ⊢ U1 ⬈[h] U2 ∧ I = Cast)
+ | (⦃G,L⦄ ⊢ V1 ⬈[h] U2 ∧ I = Cast)
+ | ∃∃p,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 & ⦃G,L⦄ ⊢ W1 ⬈[h] W2 &
+ ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 &
U1 = ⓛ{p}W1.T1 &
U2 = ⓓ{p}ⓝW2.V2.T2 & I = Appl
- | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V & ⬆*[1] V ≘ V2 &
- ⦃G, L⦄ ⊢ W1 ⬈[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 &
+ | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V & ⬆*[1] V ≘ V2 &
+ ⦃G,L⦄ ⊢ W1 ⬈[h] W2 & ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 &
U1 = ⓓ{p}W1.T1 &
U2 = ⓓ{p}W2.ⓐV2.T2 & I = Appl.
#h * #G #L #V1 #U1 #U2 #H
(* Basic forward lemmas *****************************************************)
-lemma cpx_fwd_bind1_minus: ∀h,I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ⬈[h] T → ∀p.
- ∃∃V2,T2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] ⓑ{p,I}V2.T2 &
+lemma cpx_fwd_bind1_minus: ∀h,I,G,L,V1,T1,T. ⦃G,L⦄ ⊢ -ⓑ{I}V1.T1 ⬈[h] T → ∀p.
+ ∃∃V2,T2. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] ⓑ{p,I}V2.T2 &
T = -ⓑ{I}V2.T2.
#h #I #G #L #V1 #T1 #T * #c #H #p elim (cpg_fwd_bind1_minus … H p) -H
/3 width=4 by ex2_2_intro, ex_intro/
lemma cpx_ind: ∀h. ∀Q:relation4 genv lenv term term.
(∀I,G,L. Q G L (⓪{I}) (⓪{I})) →
- (∀G,L,s. Q G L (⋆s) (⋆(next h s))) →
- (∀I,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ⬈[h] V2 → Q G K V1 V2 →
+ (∀G,L,s. Q G L (⋆s) (⋆(⫯[h]s))) →
+ (∀I,G,K,V1,V2,W2. ⦃G,K⦄ ⊢ V1 ⬈[h] V2 → Q G K V1 V2 →
⬆*[1] V2 ≘ W2 → Q G (K.ⓑ{I}V1) (#0) W2
- ) → (∀I,G,K,T,U,i. ⦃G, K⦄ ⊢ #i ⬈[h] T → Q G K (#i) T →
+ ) → (∀I,G,K,T,U,i. ⦃G,K⦄ ⊢ #i ⬈[h] T → Q G K (#i) T →
⬆*[1] T ≘ U → Q G (K.ⓘ{I}) (#↑i) (U)
- ) → (∀p,I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬈[h] T2 →
+ ) → (∀p,I,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L.ⓑ{I}V1⦄ ⊢ T1 ⬈[h] T2 →
Q G L V1 V2 → Q G (L.ⓑ{I}V1) T1 T2 → Q G L (ⓑ{p,I}V1.T1) (ⓑ{p,I}V2.T2)
- ) → (∀I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L⦄ ⊢ T1 ⬈[h] T2 →
+ ) → (∀I,G,L,V1,V2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L⦄ ⊢ T1 ⬈[h] T2 →
Q G L V1 V2 → Q G L T1 T2 → Q G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2)
- ) → (∀G,L,V,T1,T,T2. ⬆*[1] T ≘ T1 → ⦃G, L⦄ ⊢ T ⬈[h] T2 → Q G L T T2 →
+ ) → (∀G,L,V,T1,T,T2. ⬆*[1] T ≘ T1 → ⦃G,L⦄ ⊢ T ⬈[h] T2 → Q G L T T2 →
Q G L (+ⓓV.T1) T2
- ) → (∀G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → Q G L T1 T2 →
+ ) → (∀G,L,V,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → Q G L T1 T2 →
Q G L (ⓝV.T1) T2
- ) → (∀G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → Q G L V1 V2 →
+ ) → (∀G,L,V1,V2,T. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → Q G L V1 V2 →
Q G L (ⓝV1.T) V2
- ) → (∀p,G,L,V1,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L⦄ ⊢ W1 ⬈[h] W2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 →
+ ) → (∀p,G,L,V1,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L⦄ ⊢ W1 ⬈[h] W2 → ⦃G,L.ⓛW1⦄ ⊢ T1 ⬈[h] T2 →
Q G L V1 V2 → Q G L W1 W2 → Q G (L.ⓛW1) T1 T2 →
Q G L (ⓐV1.ⓛ{p}W1.T1) (ⓓ{p}ⓝW2.V2.T2)
- ) → (∀p,G,L,V1,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V → ⦃G, L⦄ ⊢ W1 ⬈[h] W2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 →
+ ) → (∀p,G,L,V1,V,V2,W1,W2,T1,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V → ⦃G,L⦄ ⊢ W1 ⬈[h] W2 → ⦃G,L.ⓓW1⦄ ⊢ T1 ⬈[h] T2 →
Q G L V1 V → Q G L W1 W2 → Q G (L.ⓓW1) T1 T2 →
⬆*[1] V ≘ V2 → Q G L (ⓐV1.ⓓ{p}W1.T1) (ⓓ{p}W2.ⓐV2.T2)
) →
- ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → Q G L T1 T2.
+ ∀G,L,T1,T2. ⦃G,L⦄ ⊢ T1 ⬈[h] T2 → Q G L T1 T2.
#h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #IH10 #IH11 #G #L #T1 #T2
* #c #H elim H -c -G -L -T1 -T2 /3 width=4 by ex_intro/
qed-.
(* Basic_2A1: was: cpx_delta *)
lemma cpx_delta_drops: ∀h,I,G,L,K,V,V2,W2,i.
- ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ⬈[h] V2 →
- ⬆*[↑i] V2 ≘ W2 → ⦃G, L⦄ ⊢ #i ⬈[h] W2.
+ ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G,K⦄ ⊢ V ⬈[h] V2 →
+ ⬆*[↑i] V2 ≘ W2 → ⦃G,L⦄ ⊢ #i ⬈[h] W2.
#h * #G #L #K #V #V2 #W2 #i #HLK *
/3 width=7 by cpg_ell_drops, cpg_delta_drops, ex_intro/
qed.
(* Advanced inversion lemmas ************************************************)
(* Basic_2A1: was: cpx_inv_atom1 *)
-lemma cpx_inv_atom1_drops: ∀h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ⬈[h] T2 →
+lemma cpx_inv_atom1_drops: ∀h,I,G,L,T2. ⦃G,L⦄ ⊢ ⓪{I} ⬈[h] T2 →
∨∨ T2 = ⓪{I}
- | ∃∃s. T2 = ⋆(next h s) & I = Sort s
- | ∃∃J,K,V,V2,i. ⬇*[i] L ≘ K.ⓑ{J}V & ⦃G, K⦄ ⊢ V ⬈[h] V2 &
+ | ∃∃s. T2 = ⋆(⫯[h]s) & I = Sort s
+ | ∃∃J,K,V,V2,i. ⬇*[i] L ≘ K.ⓑ{J}V & ⦃G,K⦄ ⊢ V ⬈[h] V2 &
⬆*[↑i] V2 ≘ T2 & I = LRef i.
#h #I #G #L #T2 * #c #H elim (cpg_inv_atom1_drops … H) -H *
/4 width=9 by or3_intro0, or3_intro1, or3_intro2, ex4_5_intro, ex2_intro, ex_intro/
qed-.
(* Basic_2A1: was: cpx_inv_lref1 *)
-lemma cpx_inv_lref1_drops: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #i ⬈[h] T2 →
+lemma cpx_inv_lref1_drops: ∀h,G,L,T2,i. ⦃G,L⦄ ⊢ #i ⬈[h] T2 →
T2 = #i ∨
- ∃∃J,K,V,V2. ⬇*[i] L ≘ K. ⓑ{J}V & ⦃G, K⦄ ⊢ V ⬈[h] V2 &
+ ∃∃J,K,V,V2. ⬇*[i] L ≘ K. ⓑ{J}V & ⦃G,K⦄ ⊢ V ⬈[h] V2 &
⬆*[↑i] V2 ≘ T2.
#h #G #L #T1 #i * #c #H elim (cpg_inv_lref1_drops … H) -H *
/4 width=7 by ex3_4_intro, ex_intro, or_introl, or_intror/
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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_basic.ma".
+include "basic_2/rt_transition/cpx_drops.ma".
+
+(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
+
+(* Properties with basic relocation *****************************************)
+
+lemma cpx_subst (h) (G) (L) (U1) (i):
+ ∀I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V →
+ ∃∃U2,T2. ⦃G,L⦄ ⊢ U1 ⬈[h] U2 & ⬆[i,1] T2 ≘ U2.
+#h #G #L #U1 @(fqup_wf_ind_eq (Ⓣ) … G L U1) -G -L -U1
+#G0 #L0 #U0 #IH #G #L * *
+[ #s #HG #HL #HT #i #I #K #V #_ destruct -IH
+ /2 width=4 by lifts_sort, ex2_2_intro/
+| #j #HG #HL #HT #i #I #K #V #HLK destruct -IH
+ elim (lt_or_eq_or_gt i j) #Hij
+ [ /3 width=4 by lifts_lref_ge_minus, cpx_refl, ex2_2_intro/
+ | elim (lifts_total V (𝐔❴↑i❵)) #U2 #HU2
+ elim (lifts_split_trans … HU2 (𝐔❴i❵) (𝐁❴i,1❵)) [2: @(after_basic_rc i 0) ]
+ /3 width=7 by cpx_delta_drops, ex2_2_intro/
+ | /3 width=4 by lifts_lref_lt, cpx_refl, ex2_2_intro/
+ ]
+| #l #HG #HL #HT #i #I #K #V #_ destruct -IH
+ /2 width=4 by lifts_gref, ex2_2_intro/
+| #p #J #W1 #U1 #HG #HL #HT #i #I #K #V #HLK destruct
+ elim (IH G L W1 … HLK) [| // ] #W2 #V2 #HW12 #HVW2
+ elim (IH G (L.ⓑ{J}W1) U1 … (↑i)) [|*: /3 width=4 by drops_drop/ ] #U2 #T2 #HU12 #HTU2
+ /3 width=9 by cpx_bind, lifts_bind, ex2_2_intro/
+| #J #W1 #U1 #HG #HL #HT #i #I #K #V #HLK destruct
+ elim (IH G L W1 … HLK) [| // ] #W2 #V2 #HW12 #HVW2
+ elim (IH G L U1 … HLK) [| // ] #U2 #T2 #HU12 #HTU2
+ /3 width=8 by cpx_flat, lifts_flat, ex2_2_intro/
+]
+qed-.
(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
-(* Properties with degree-based equivalence for closures ********************)
+(* Properties with sort-irrelevant equivalence for closures *****************)
-lemma fdeq_cpx_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_cpx_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_cpx_trans … HL12 … HT2) #T0 #HT0 #HT02
lapply (cpx_rdeq_conf_dx … HT2 … HL12) -HL12 #HL12
(* Properties on supclosure *************************************************)
-lemma fqu_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, L2, U2⦄.
+lemma fqu_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈[h] 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
/3 width=3 by cpx_pair_sn, cpx_bind, cpx_flat, fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, ex2_intro/
[ #I #G #L2 #V2 #X2 #HVX2
]
qed-.
-lemma fquq_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐⸮[b] ⦃G2, L2, U2⦄.
+lemma fquq_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1,L1,U1⦄ ⬂⸮[b] ⦃G2,L2,U2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -H
[ #HT12 #U2 #HTU2 elim (fqu_cpx_trans … HT12 … HTU2) /3 width=3 by fqu_fquq, ex2_intro/
| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
]
qed-.
-lemma fqup_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐+[b] ⦃G2, L2, U2⦄.
+lemma fqup_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂+[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1,L1,U1⦄ ⬂+[b] ⦃G2,L2,U2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2
[ #G2 #L2 #T2 #H12 #U2 #HTU2 elim (fqu_cpx_trans … H12 … HTU2) -T2
/3 width=3 by fqu_fqup, ex2_intro/
]
qed-.
-lemma fqus_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐*[b] ⦃G2, L2, U2⦄.
+lemma fqus_cpx_trans: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂*[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1,L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1,L1,U1⦄ ⬂*[b] ⦃G2,L2,U2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqus_inv_fqup … H) -H
[ #HT12 #U2 #HTU2 elim (fqup_cpx_trans … HT12 … HTU2) /3 width=3 by fqup_fqus, ex2_intro/
| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
]
qed-.
-lemma fqu_cpx_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_cpx_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 cpx_delta, fqu_drop/
[1,3: /2 width=4 by fqu_pair_sn, cpx_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, cpx_bind/
| #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
]
]
qed-.
-lemma fquq_cpx_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_cpx_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_cpx_trans_tdneq … H12 … HTU2 H) -T2
/3 width=4 by fqu_fquq, ex3_intro/
| * #HG #HL #HT destruct /3 width=4 by ex3_intro/
]
qed-.
-lemma fqup_cpx_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_cpx_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_cpx_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
]
qed-.
-lemma fqus_cpx_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_cpx_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_cpx_trans_tdneq … H12 … HTU2 H) -T2
/3 width=4 by fqup_fqus, ex3_intro/
| * #HG #HL #HT destruct /3 width=4 by ex3_intro/
#h #G #L1 #T1 #T2 * /3 width=4 by lsubr_cpg_trans, ex_intro/
qed-.
-lemma cpx_bind_unit (h) (G): ∀L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 →
- ∀J,T1,T2. ⦃G, L.ⓤ{J}⦄ ⊢ T1 ⬈[h] T2 →
- ∀p,I. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] ⓑ{p,I}V2.T2.
+lemma cpx_bind_unit (h) (G): ∀L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 →
+ ∀J,T1,T2. ⦃G,L.ⓤ{J}⦄ ⊢ T1 ⬈[h] T2 →
+ ∀p,I. ⦃G,L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[h] ⓑ{p,I}V2.T2.
/4 width=4 by lsubr_cpx_trans, cpx_bind, lsubr_unit/ qed.
(* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
-(* Properties with degree-based equivalence for local environments **********)
+(* Properties with sort-irrelevant equivalence for local environments *******)
(* Basic_2A1: was just: cpx_lleq_conf_sn *)
-lemma cpx_rdeq_conf_sn: ∀h,o,G. s_r_confluent1 … (cpx h G) (rdeq h o).
+lemma cpx_rdeq_conf_sn: ∀h,G. s_r_confluent1 … (cpx h G) rdeq.
/3 width=6 by cpx_rex_conf/ qed-.
(* Basic_2A1: was just: cpx_lleq_conf_dx *)
-lemma cpx_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.
-/4 width=4 by cpx_rdeq_conf_sn, rdeq_sym/ qed-.
+lemma cpx_rdeq_conf_dx: ∀h,G,L2,T1,T2. ⦃G,L2⦄ ⊢ T1 ⬈[h] T2 →
+ ∀L1. L1 ≛[T1] L2 → L1 ≛[T2] L2.
+/4 width=5 by cpx_rdeq_conf_sn, rdeq_sym/ qed-.
qed-.
(*
(* Basic_2A1: was: cpx_lleq_conf *)
-lemma cpx_req_conf: ∀h,G,L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ⬈[h] T2 →
- ∀L1. L2 ≘[T1] L1 → ⦃G, L1⦄ ⊢ T1 ⬈[h] T2.
+lemma cpx_req_conf: ∀h,G,L2,T1,T2. ⦃G,L2⦄ ⊢ T1 ⬈[h] T2 →
+ ∀L1. L2 ≘[T1] L1 → ⦃G,L1⦄ ⊢ T1 ⬈[h] T2.
/3 width=3 by req_cpx_trans, req_sym/ qed-.
*)
(* Basic_2A1: was: cpx_lleq_conf_sn *)
/2 width=5 by cpx_rex_conf/ qed-.
(*
(* Basic_2A1: was: cpx_lleq_conf_dx *)
-lemma cpx_req_conf_dx: ∀h,G,L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ⬈[h] T2 →
+lemma cpx_req_conf_dx: ∀h,G,L2,T1,T2. ⦃G,L2⦄ ⊢ T1 ⬈[h] T2 →
∀L1. L1 ≘[T1] L2 → L1 ≘[T2] L2.
/4 width=6 by cpx_req_conf_sn, req_sym/ qed-.
*)
(* Inversion lemmas with simple terms ***************************************)
-lemma cpx_inv_appl1_simple: ∀h,G,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1.T1 ⬈[h] U → 𝐒⦃T1⦄ →
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 & ⦃G, L⦄ ⊢ T1 ⬈[h] T2 &
+lemma cpx_inv_appl1_simple: ∀h,G,L,V1,T1,U. ⦃G,L⦄ ⊢ ⓐV1.T1 ⬈[h] U → 𝐒⦃T1⦄ →
+ ∃∃V2,T2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 & ⦃G,L⦄ ⊢ T1 ⬈[h] T2 &
U = ⓐV2.T2.
#h #G #L #V1 #T1 #U * #c #H #HT1 elim (cpg_inv_appl1_simple … H) -H
/3 width=5 by ex3_2_intro, ex_intro/
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/predsubtyproper_8.ma".
+include "basic_2/notation/relations/predsubtyproper_7.ma".
include "static_2/s_transition/fqu.ma".
include "static_2/static/rdeq.ma".
include "basic_2/rt_transition/lpr_lpx.ma".
(* PROPER PARALLEL RST-TRANSITION FOR CLOSURES ******************************)
-inductive fpb (h) (o) (G1) (L1) (T1): relation3 genv lenv term ≝
-| fpb_fqu: ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ → fpb h o G1 L1 T1 G2 L2 T2
-| fpb_cpx: ∀T2. ⦃G1, L1⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛[h, o] T2 → ⊥) → fpb h o G1 L1 T1 G1 L1 T2
-| fpb_lpx: ∀L2. ⦃G1, L1⦄ ⊢ ⬈[h] L2 → (L1 ≛[h, o, T1] L2 → ⊥) → fpb h o G1 L1 T1 G1 L2 T1
+inductive fpb (h) (G1) (L1) (T1): relation3 genv lenv term ≝
+| fpb_fqu: ∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂ ⦃G2,L2,T2⦄ → fpb h G1 L1 T1 G2 L2 T2
+| fpb_cpx: ∀T2. ⦃G1,L1⦄ ⊢ T1 ⬈[h] T2 → (T1 ≛ T2 → ⊥) → fpb h G1 L1 T1 G1 L1 T2
+| fpb_lpx: ∀L2. ⦃G1,L1⦄ ⊢ ⬈[h] L2 → (L1 ≛[T1] L2 → ⊥) → fpb h G1 L1 T1 G1 L2 T1
.
interpretation
"proper parallel rst-transition (closure)"
- 'PRedSubTyProper h o G1 L1 T1 G2 L2 T2 = (fpb h o G1 L1 T1 G2 L2 T2).
+ 'PRedSubTyProper h G1 L1 T1 G2 L2 T2 = (fpb h G1 L1 T1 G2 L2 T2).
(* Basic properties *********************************************************)
(* Basic_2A1: includes: cpr_fpb *)
-lemma cpm_fpb (n) (h) (o) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → (T1 ≛[h, o] T2 → ⊥) →
- ⦃G, L, T1⦄ ≻[h, o] ⦃G, L, T2⦄.
+lemma cpm_fpb (n) (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → (T1 ≛ T2 → ⊥) →
+ ⦃G,L,T1⦄ ≻[h] ⦃G,L,T2⦄.
/3 width=2 by fpb_cpx, cpm_fwd_cpx/ qed.
-lemma lpr_fpb (h) (o) (G) (T): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) →
- ⦃G, L1, T⦄ ≻[h, o] ⦃G, L2, T⦄.
+lemma lpr_fpb (h) (G) (T): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → (L1 ≛[T] L2 → ⊥) →
+ ⦃G,L1,T⦄ ≻[h] ⦃G,L2,T⦄.
/3 width=1 by fpb_lpx, lpr_fwd_lpx/ qed.
(* Properties with degree-based equivalence for closures ********************)
(* Basic_2A1: uses: fleq_fpb_trans *)
-lemma fdeq_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 * -F2 -K2 -T2
+lemma fdeq_fpb_trans: ∀h,F1,F2,K1,K2,T1,T2. ⦃F1,K1,T1⦄ ≛ ⦃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⦄ ≛ ⦃G2,L2,U2⦄.
+#h #F1 #F2 #K1 #K2 #T1 #T2 * -F2 -K2 -T2
#K2 #T2 #HK12 #HT12 #G2 #L2 #U2 #H12
elim (tdeq_fpb_trans … HT12 … H12) -T2 #K0 #T0 #H #HT0 #HK0
elim (rdeq_fpb_trans … HK12 … H) -K2 #L0 #U0 #H #HUT0 #HLK0
(* Inversion lemmas with degree-based equivalence for closures **************)
(* Basic_2A1: uses: fpb_inv_fleq *)
-lemma fpb_inv_fdeq: ∀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 * -G2 -L2 -T2
+lemma fpb_inv_fdeq: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ →
+ ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → ⊥.
+#h #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2
[ #G2 #L2 #T2 #H12 #H elim (fdeq_inv_gen_sn … H) -H
/3 width=11 by rdeq_fwd_length, fqu_inv_tdeq/
| #T2 #_ #HnT #H elim (fdeq_inv_gen_sn … H) -H /2 width=1 by/
(* PROPER PARALLEL RST-TRANSITION FOR CLOSURES ******************************)
-(* Properties with degree-based equivalence for local environments **********)
+(* Properties with sort-irrelevant equivalence for local environments *******)
-lemma tdeq_fpb_trans: ∀h,o,U2,U1. U2 ≛[h, o] U1 →
- ∀G1,G2,L1,L2,T1. ⦃G1, L1, U1⦄ ≻[h, o] ⦃G2, L2, T1⦄ →
- ∃∃L,T2. ⦃G1, L1, U2⦄ ≻[h, o] ⦃G2, L, T2⦄ & T2 ≛[h, o] T1 & L ≛[h, o, T1] L2.
-#h #o #U2 #U1 #HU21 #G1 #G2 #L1 #L2 #T1 * -G2 -L2 -T1
+lemma tdeq_fpb_trans: ∀h,U2,U1. U2 ≛ U1 →
+ ∀G1,G2,L1,L2,T1. ⦃G1,L1,U1⦄ ≻[h] ⦃G2,L2,T1⦄ →
+ ∃∃L,T2. ⦃G1,L1,U2⦄ ≻[h] ⦃G2,L,T2⦄ & T2 ≛ T1 & L ≛[T1] L2.
+#h #U2 #U1 #HU21 #G1 #G2 #L1 #L2 #T1 * -G2 -L2 -T1
[ #G2 #L2 #T1 #H
elim (tdeq_fqu_trans … H … HU21) -H
/3 width=5 by fpb_fqu, ex3_2_intro/
qed-.
(* Basic_2A1: was just: lleq_fpb_trans *)
-lemma rdeq_fpb_trans: ∀h,o,F,K1,K2,T. K1 ≛[h, o, T] K2 →
- ∀G,L2,U. ⦃F, K2, T⦄ ≻[h, o] ⦃G, L2, U⦄ →
- ∃∃L1,U0. ⦃F, K1, T⦄ ≻[h, o] ⦃G, L1, U0⦄ & U0 ≛[h, o] U & L1 ≛[h, o, U] L2.
-#h #o #F #K1 #K2 #T #HT #G #L2 #U * -G -L2 -U
+lemma rdeq_fpb_trans: ∀h,F,K1,K2,T. K1 ≛[T] K2 →
+ ∀G,L2,U. ⦃F,K2,T⦄ ≻[h] ⦃G,L2,U⦄ →
+ ∃∃L1,U0. ⦃F,K1,T⦄ ≻[h] ⦃G,L1,U0⦄ & U0 ≛ U & L1 ≛[U] L2.
+#h #F #K1 #K2 #T #HT #G #L2 #U * -G -L2 -U
[ #G #L2 #U #H2 elim (rdeq_fqu_trans … H2 … HT) -K2
/3 width=5 by fpb_fqu, ex3_2_intro/
| #U #HTU #HnTU elim (rdeq_cpx_trans … HT … HTU) -HTU
- /5 width=10 by fpb_cpx, cpx_rdeq_conf_sn, tdeq_trans, tdeq_rdeq_conf, ex3_2_intro/
+ /5 width=11 by fpb_cpx, cpx_rdeq_conf_sn, tdeq_trans, tdeq_rdeq_conf, ex3_2_intro/ (**) (* time: 36s on dev *)
| #L2 #HKL2 #HnKL2 elim (rdeq_lpx_trans … HKL2 … HT) -HKL2
/6 width=5 by fpb_lpx, (* 2x *) rdeq_canc_sn, ex3_2_intro/
]
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/predsubty_8.ma".
+include "basic_2/notation/relations/predsubty_7.ma".
include "static_2/static/fdeq.ma".
include "static_2/s_transition/fquq.ma".
include "basic_2/rt_transition/lpr_lpx.ma".
(* PARALLEL RST-TRANSITION FOR CLOSURES *************************************)
(* Basic_2A1: includes: fleq_fpbq fpbq_lleq *)
-inductive fpbq (h) (o) (G1) (L1) (T1): relation3 genv lenv term ≝
-| fpbq_fquq: ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ → fpbq h o G1 L1 T1 G2 L2 T2
-| fpbq_cpx : ∀T2. ⦃G1, L1⦄ ⊢ T1 ⬈[h] T2 → fpbq h o G1 L1 T1 G1 L1 T2
-| fpbq_lpx : ∀L2. ⦃G1, L1⦄ ⊢ ⬈[h] L2 → fpbq h o G1 L1 T1 G1 L2 T1
-| fpbq_fdeq: ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≛[h, o] ⦃G2, L2, T2⦄ → fpbq h o G1 L1 T1 G2 L2 T2
+inductive fpbq (h) (G1) (L1) (T1): relation3 genv lenv term ≝
+| fpbq_fquq: ∀G2,L2,T2. ⦃G1,L1,T1⦄ ⬂⸮ ⦃G2,L2,T2⦄ → fpbq h G1 L1 T1 G2 L2 T2
+| fpbq_cpx : ∀T2. ⦃G1,L1⦄ ⊢ T1 ⬈[h] T2 → fpbq h G1 L1 T1 G1 L1 T2
+| fpbq_lpx : ∀L2. ⦃G1,L1⦄ ⊢ ⬈[h] L2 → fpbq h G1 L1 T1 G1 L2 T1
+| fpbq_fdeq: ∀G2,L2,T2. ⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → fpbq h G1 L1 T1 G2 L2 T2
.
interpretation
"parallel rst-transition (closure)"
- 'PRedSubTy h o G1 L1 T1 G2 L2 T2 = (fpbq h o G1 L1 T1 G2 L2 T2).
+ 'PRedSubTy h G1 L1 T1 G2 L2 T2 = (fpbq h G1 L1 T1 G2 L2 T2).
(* Basic properties *********************************************************)
-lemma fpbq_refl (h) (o): tri_reflexive … (fpbq h o).
+lemma fpbq_refl (h): tri_reflexive … (fpbq h).
/2 width=1 by fpbq_cpx/ qed.
(* Basic_2A1: includes: cpr_fpbq *)
-lemma cpm_fpbq (n) (h) (o) (G) (L): ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → ⦃G, L, T1⦄ ≽[h, o] ⦃G, L, T2⦄.
+lemma cpm_fpbq (n) (h) (G) (L): ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → ⦃G,L,T1⦄ ≽[h] ⦃G,L,T2⦄.
/3 width=2 by fpbq_cpx, cpm_fwd_cpx/ qed.
-lemma lpr_fpbq (h) (o) (G) (T): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L1, T⦄ ≽[h, o] ⦃G, L2, T⦄.
+lemma lpr_fpbq (h) (G) (T): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L1,T⦄ ≽[h] ⦃G,L2,T⦄.
/3 width=1 by fpbq_lpx, lpr_fwd_lpx/ qed.
(* Basic_2A1: removed theorems 2:
(* Properties with atomic arity assignment for terms ************************)
-lemma fpbq_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 * -G2 -L2 -T2
+lemma fpbq_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 * -G2 -L2 -T2
/3 width=8 by lpx_aaa_conf, cpx_aaa_conf, aaa_fdeq_conf, aaa_fquq_conf, ex_intro/
qed-.
(* Properties with proper parallel rst-transition for closures **************)
-lemma fpb_fpbq: ∀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 * -G2 -L2 -T2
+lemma fpb_fpbq: ∀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 * -G2 -L2 -T2
/3 width=1 by fpbq_fquq, fpbq_cpx, fpbq_lpx, fqu_fquq/
qed.
(* Basic_2A1: fpb_fpbq_alt *)
-lemma fpb_fpbq_ffdneq: ∀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⦄ → ⊥).
+lemma fpb_fpbq_ffdneq: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ≻[h] ⦃G2,L2,T2⦄ →
+ ∧∧ ⦃G1,L1,T1⦄ ≽[h] ⦃G2,L2,T2⦄ & (⦃G1,L1,T1⦄ ≛ ⦃G2,L2,T2⦄ → ⊥).
/3 width=10 by fpb_fpbq, fpb_inv_fdeq, conj/ qed-.
(* Inversrion lemmas with proper parallel rst-transition for closures *******)
(* Basic_2A1: uses: fpbq_ind_alt *)
-lemma fpbq_inv_fpb: ∀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 * -G2 -L2 -T2
+lemma fpbq_inv_fpb: ∀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 * -G2 -L2 -T2
[ #G2 #L2 #T2 * [2: * #H1 #H2 #H3 destruct ]
/3 width=1 by fpb_fqu, fdeq_intro_sn, or_intror, or_introl/
-| #T2 #H elim (tdeq_dec h o T1 T2)
+| #T2 #H elim (tdeq_dec T1 T2)
/4 width=1 by fpb_cpx, fdeq_intro_sn, or_intror, or_introl/
-| #L2 elim (rdeq_dec h o L1 L2 T1)
+| #L2 elim (rdeq_dec L1 L2 T1)
/4 width=1 by fpb_lpx, fdeq_intro_sn, or_intror, or_introl/
| /2 width=1 by or_introl/
]
qed-.
(* Basic_2A1: fpbq_inv_fpb_alt *)
-lemma fpbq_ffdneq_inv_fpb: ∀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 #H0
+lemma fpbq_ffdneq_inv_fpb: ∀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 #H0
elim (fpbq_inv_fpb … H) -H // #H elim H0 -H0 //
qed-.
(* Basic properties *********************************************************)
-lemma lpr_bind (h) (G): ∀K1,K2. ⦃G, K1⦄ ⊢ ➡[h] K2 →
- ∀I1,I2. ⦃G, K1⦄ ⊢ I1 ➡[h] I2 → ⦃G, K1.ⓘ{I1}⦄ ⊢ ➡[h] K2.ⓘ{I2}.
+lemma lpr_bind (h) (G): ∀K1,K2. ⦃G,K1⦄ ⊢ ➡[h] K2 →
+ ∀I1,I2. ⦃G,K1⦄ ⊢ I1 ➡[h] I2 → ⦃G,K1.ⓘ{I1}⦄ ⊢ ➡[h] K2.ⓘ{I2}.
/2 width=1 by lex_bind/ qed.
(* Note: lemma 250 *)
(* Advanced properties ******************************************************)
-lemma lpr_bind_refl_dx (h) (G): ∀K1,K2. ⦃G, K1⦄ ⊢ ➡[h] K2 →
- ∀I. ⦃G, K1.ⓘ{I}⦄ ⊢ ➡[h] K2.ⓘ{I}.
+lemma lpr_bind_refl_dx (h) (G): ∀K1,K2. ⦃G,K1⦄ ⊢ ➡[h] K2 →
+ ∀I. ⦃G,K1.ⓘ{I}⦄ ⊢ ➡[h] K2.ⓘ{I}.
/2 width=1 by lex_bind_refl_dx/ qed.
-lemma lpr_pair (h) (G): ∀K1,K2,V1,V2. ⦃G, K1⦄ ⊢ ➡[h] K2 → ⦃G, K1⦄ ⊢ V1 ➡[h] V2 →
- ∀I. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡[h] K2.ⓑ{I}V2.
+lemma lpr_pair (h) (G): ∀K1,K2,V1,V2. ⦃G,K1⦄ ⊢ ➡[h] K2 → ⦃G,K1⦄ ⊢ V1 ➡[h] V2 →
+ ∀I. ⦃G,K1.ⓑ{I}V1⦄ ⊢ ➡[h] K2.ⓑ{I}V2.
/2 width=1 by lex_pair/ qed.
(* Basic inversion lemmas ***************************************************)
(* Basic_2A1: was: lpr_inv_atom1 *)
(* Basic_1: includes: wcpr0_gen_sort *)
-lemma lpr_inv_atom_sn (h) (G): ∀L2. ⦃G, ⋆⦄ ⊢ ➡[h] L2 → L2 = ⋆.
+lemma lpr_inv_atom_sn (h) (G): ∀L2. ⦃G,⋆⦄ ⊢ ➡[h] L2 → L2 = ⋆.
/2 width=2 by lex_inv_atom_sn/ qed-.
-lemma lpr_inv_bind_sn (h) (G): ∀I1,L2,K1. ⦃G, K1.ⓘ{I1}⦄ ⊢ ➡[h] L2 →
- ∃∃I2,K2. ⦃G, K1⦄ ⊢ ➡[h] K2 & ⦃G, K1⦄ ⊢ I1 ➡[h] I2 &
+lemma lpr_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: lpr_inv_atom2 *)
-lemma lpr_inv_atom_dx (h) (G): ∀L1. ⦃G, L1⦄ ⊢ ➡[h] ⋆ → L1 = ⋆.
+lemma lpr_inv_atom_dx (h) (G): ∀L1. ⦃G,L1⦄ ⊢ ➡[h] ⋆ → L1 = ⋆.
/2 width=2 by lex_inv_atom_dx/ qed-.
-lemma lpr_inv_bind_dx (h) (G): ∀I2,L1,K2. ⦃G, L1⦄ ⊢ ➡[h] K2.ⓘ{I2} →
- ∃∃I1,K1. ⦃G, K1⦄ ⊢ ➡[h] K2 & ⦃G, K1⦄ ⊢ I1 ➡[h] I2 &
+lemma lpr_inv_bind_dx (h) (G): ∀I2,L1,K2. ⦃G,L1⦄ ⊢ ➡[h] K2.ⓘ{I2} →
+ ∃∃I1,K1. ⦃G,K1⦄ ⊢ ➡[h] K2 & ⦃G,K1⦄ ⊢ I1 ➡[h] I2 &
L1 = K1.ⓘ{I1}.
/2 width=1 by lex_inv_bind_dx/ qed-.
(* Advanced inversion lemmas ************************************************)
-lemma lpr_inv_unit_sn (h) (G): ∀I,L2,K1. ⦃G, K1.ⓤ{I}⦄ ⊢ ➡[h] L2 →
- ∃∃K2. ⦃G, K1⦄ ⊢ ➡[h] K2 & L2 = K2.ⓤ{I}.
+lemma lpr_inv_unit_sn (h) (G): ∀I,L2,K1. ⦃G,K1.ⓤ{I}⦄ ⊢ ➡[h] L2 →
+ ∃∃K2. ⦃G,K1⦄ ⊢ ➡[h] K2 & L2 = K2.ⓤ{I}.
/2 width=1 by lex_inv_unit_sn/ qed-.
(* Basic_2A1: was: lpr_inv_pair1 *)
(* Basic_1: includes: wcpr0_gen_head *)
-lemma lpr_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 &
+lemma lpr_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-.
-lemma lpr_inv_unit_dx (h) (G): ∀I,L1,K2. ⦃G, L1⦄ ⊢ ➡[h] K2.ⓤ{I} →
- ∃∃K1. ⦃G, K1⦄ ⊢ ➡[h] K2 & L1 = K1.ⓤ{I}.
+lemma lpr_inv_unit_dx (h) (G): ∀I,L1,K2. ⦃G,L1⦄ ⊢ ➡[h] K2.ⓤ{I} →
+ ∃∃K1. ⦃G,K1⦄ ⊢ ➡[h] K2 & L1 = K1.ⓤ{I}.
/2 width=1 by lex_inv_unit_dx/ qed-.
(* Basic_2A1: was: lpr_inv_pair2 *)
-lemma lpr_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 &
+lemma lpr_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-.
-lemma lpr_inv_pair (h) (G): ∀I1,I2,L1,L2,V1,V2. ⦃G, L1.ⓑ{I1}V1⦄ ⊢ ➡[h] L2.ⓑ{I2}V2 →
- ∧∧ ⦃G, L1⦄ ⊢ ➡[h] L2 & ⦃G, L1⦄ ⊢ V1 ➡[h] V2 & I1 = I2.
+lemma lpr_inv_pair (h) (G): ∀I1,I2,L1,L2,V1,V2. ⦃G,L1.ⓑ{I1}V1⦄ ⊢ ➡[h] L2.ⓑ{I2}V2 →
+ ∧∧ ⦃G,L1⦄ ⊢ ➡[h] L2 & ⦃G,L1⦄ ⊢ V1 ➡[h] V2 & I1 = I2.
/2 width=1 by lex_inv_pair/ qed-.
(* Basic_1: removed theorems 3: wcpr0_getl wcpr0_getl_back
(* Properties with extended structural successor for closures ***************)
-lemma fqu_cpr_trans_sn (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h] U2 →
- ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[h] L & ⦃G1, L1⦄ ⊢ T1 ➡[h] U1 & ⦃G1, L, U1⦄ ⊐[b] ⦃G2, L2, U2⦄.
+lemma fqu_cpr_trans_sn (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ➡[h] U2 →
+ ∃∃L,U1. ⦃G1,L1⦄ ⊢ ➡[h] L & ⦃G1,L1⦄ ⊢ T1 ➡[h] U1 & ⦃G1,L,U1⦄ ⬂[b] ⦃G2,L2,U2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
[ /3 width=5 by lpr_pair, fqu_lref_O, ex3_2_intro/
| /3 width=5 by cpr_pair_sn, fqu_pair_sn, ex3_2_intro/
]
qed-.
-lemma fqu_cpr_trans_dx (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h] U2 →
- ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[h] L & ⦃G1, L⦄ ⊢ T1 ➡[h] U1 & ⦃G1, L, U1⦄ ⊐[b] ⦃G2, L2, U2⦄.
+lemma fqu_cpr_trans_dx (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ➡[h] U2 →
+ ∃∃L,U1. ⦃G1,L1⦄ ⊢ ➡[h] L & ⦃G1,L⦄ ⊢ T1 ➡[h] U1 & ⦃G1,L,U1⦄ ⬂[b] ⦃G2,L2,U2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
[ /3 width=5 by lpr_pair, fqu_lref_O, ex3_2_intro/
| /3 width=5 by cpr_pair_sn, fqu_pair_sn, ex3_2_intro/
]
qed-.
-lemma fqu_lpr_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
- ∀K2. ⦃G2, L2⦄ ⊢ ➡[h] K2 →
- ∃∃K1,T. ⦃G1, L1⦄ ⊢ ➡[h] K1 & ⦃G1, L1⦄ ⊢ T1 ➡[h] T & ⦃G1, K1, T⦄ ⊐[b] ⦃G2, K2, T2⦄.
+lemma fqu_lpr_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ →
+ ∀K2. ⦃G2,L2⦄ ⊢ ➡[h] K2 →
+ ∃∃K1,T. ⦃G1,L1⦄ ⊢ ➡[h] K1 & ⦃G1,L1⦄ ⊢ T1 ➡[h] T & ⦃G1,K1,T⦄ ⬂[b] ⦃G2,K2,T2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
[ /3 width=5 by lpr_bind_refl_dx, fqu_lref_O, ex3_2_intro/
| /3 width=5 by cpr_pair_sn, fqu_pair_sn, ex3_2_intro/
-| #p #I #G2 #L2 #V2 #T2 #X #H
+| #p #I #G2 #L2 #V2 #T2 #Hb #X #H
elim (lpr_inv_pair_sn … H) -H #K2 #W2 #HLK2 #HVW2 #H destruct
/3 width=5 by cpr_pair_sn, fqu_bind_dx, ex3_2_intro/
| #p #I #G2 #L2 #V2 #T2 #Hb #X #H
(* Note: does not hold in Basic_2A1 because it requires cpm *)
(* Note: L1 = K0.ⓛV0 and T1 = #0 require n = 1 *)
-lemma lpr_fqu_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
- ∀K1. ⦃G1, K1⦄ ⊢ ➡[h] L1 →
- ∃∃n,K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[n, h] T & ⦃G1, K1, T⦄ ⊐[b] ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h] L2 & n ≤ 1.
+lemma lpr_fqu_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ →
+ ∀K1. ⦃G1,K1⦄ ⊢ ➡[h] L1 →
+ ∃∃n,K2,T. ⦃G1,K1⦄ ⊢ T1 ➡[n,h] T & ⦃G1,K1,T⦄ ⬂[b] ⦃G2,K2,T2⦄ & ⦃G2,K2⦄ ⊢ ➡[h] L2 & n ≤ 1.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
[ * #G #K #V #K1 #H
elim (lpr_inv_pair_dx … H) -H #K0 #V0 #HK0 #HV0 #H destruct
(* Properties with extended optional structural successor for closures ******)
-lemma fquq_cpr_trans_sn (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h] U2 →
- ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[h] L & ⦃G1, L1⦄ ⊢ T1 ➡[h] U1 & ⦃G1, L, U1⦄ ⊐⸮[b] ⦃G2, L2, U2⦄.
+lemma fquq_cpr_trans_sn (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ➡[h] U2 →
+ ∃∃L,U1. ⦃G1,L1⦄ ⊢ ➡[h] L & ⦃G1,L1⦄ ⊢ T1 ➡[h] U1 & ⦃G1,L,U1⦄ ⬂⸮[b] ⦃G2,L2,U2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 cases H -H
[ #HT12 elim (fqu_cpr_trans_sn … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/
| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
]
qed-.
-lemma fquq_cpr_trans_dx (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h] U2 →
- ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[h] L & ⦃G1, L⦄ ⊢ T1 ➡[h] U1 & ⦃G1, L, U1⦄ ⊐⸮[b] ⦃G2, L2, U2⦄.
+lemma fquq_cpr_trans_dx (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ →
+ ∀U2. ⦃G2,L2⦄ ⊢ T2 ➡[h] U2 →
+ ∃∃L,U1. ⦃G1,L1⦄ ⊢ ➡[h] L & ⦃G1,L⦄ ⊢ T1 ➡[h] U1 & ⦃G1,L,U1⦄ ⬂⸮[b] ⦃G2,L2,U2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 cases H -H
[ #HT12 elim (fqu_cpr_trans_dx … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/
| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
]
qed-.
-lemma fquq_lpr_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
- ∀K2. ⦃G2, L2⦄ ⊢ ➡[h] K2 →
- ∃∃K1,T. ⦃G1, L1⦄ ⊢ ➡[h] K1 & ⦃G1, L1⦄ ⊢ T1 ➡[h] T & ⦃G1, K1, T⦄ ⊐⸮[b] ⦃G2, K2, T2⦄.
+lemma fquq_lpr_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ →
+ ∀K2. ⦃G2,L2⦄ ⊢ ➡[h] K2 →
+ ∃∃K1,T. ⦃G1,L1⦄ ⊢ ➡[h] K1 & ⦃G1,L1⦄ ⊢ T1 ➡[h] T & ⦃G1,K1,T⦄ ⬂⸮[b] ⦃G2,K2,T2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H #K2 #HLK2 cases H -H
[ #H12 elim (fqu_lpr_trans … H12 … HLK2) /3 width=5 by fqu_fquq, ex3_2_intro/
| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
]
qed-.
-lemma lpr_fquq_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
- ∀K1. ⦃G1, K1⦄ ⊢ ➡[h] L1 →
- ∃∃n,K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[n, h] T & ⦃G1, K1, T⦄ ⊐⸮[b] ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h] L2 & n ≤ 1.
+lemma lpr_fquq_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ →
+ ∀K1. ⦃G1,K1⦄ ⊢ ➡[h] L1 →
+ ∃∃n,K2,T. ⦃G1,K1⦄ ⊢ T1 ➡[n,h] T & ⦃G1,K1,T⦄ ⬂⸮[b] ⦃G2,K2,T2⦄ & ⦃G2,K2⦄ ⊢ ➡[h] L2 & n ≤ 1.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H #K1 #HKL1 cases H -H
[ #H12 elim (lpr_fqu_trans … H12 … HKL1) -L1 /3 width=7 by fqu_fquq, ex4_3_intro/
| * #H1 #H2 #H3 destruct /2 width=7 by ex4_3_intro/
(* PARALLEL R-TRANSITION FOR FULL LOCAL ENVIRONMENTS ************************)
-lemma lpr_fwd_length (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → |L1| = |L2|.
+lemma lpr_fwd_length (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → |L1| = |L2|.
/2 width=2 by lex_fwd_length/ qed-.
(* PARALLEL R-TRANSITION FOR FULL LOCAL ENVIRONMENTS ************************)
definition IH_cpr_conf_lpr (h): relation3 genv lenv term ≝ λG,L,T.
- ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
- ∀L1. ⦃G, L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h] L2 →
- ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0.
+ ∀T1. ⦃G,L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G,L⦄ ⊢ T ➡[h] T2 →
+ ∀L1. ⦃G,L⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L⦄ ⊢ ➡[h] L2 →
+ ∃∃T0. ⦃G,L1⦄ ⊢ T1 ➡[h] T0 & ⦃G,L2⦄ ⊢ T2 ➡[h] T0.
(* Main properties with context-sensitive parallel reduction for terms ******)
fact cpr_conf_lpr_atom_atom (h):
- ∀I,G,L1,L2. ∃∃T. ⦃G, L1⦄ ⊢ ⓪{I} ➡[h] T & ⦃G, L2⦄ ⊢ ⓪{I} ➡[h] T.
+ ∀I,G,L1,L2. ∃∃T. ⦃G,L1⦄ ⊢ ⓪{I} ➡[h] T & ⦃G,L2⦄ ⊢ ⓪{I} ➡[h] T.
/2 width=3 by cpr_refl, ex2_intro/ qed-.
fact cpr_conf_lpr_atom_delta (h):
∀G0,L0,i. (
- ∀G,L,T. ⦃G0, L0, #i⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,#i⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
∀K0,V0. ⬇*[i] L0 ≘ K0.ⓓV0 →
- ∀V2. ⦃G0, K0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⬆*[↑i] V2 ≘ T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ #i ➡[h] T & ⦃G0, L2⦄ ⊢ T2 ➡[h] T.
+ ∀V2. ⦃G0,K0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⬆*[↑i] V2 ≘ T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ #i ➡[h] T & ⦃G0,L2⦄ ⊢ T2 ➡[h] T.
#h #G0 #L0 #i #IH #K0 #V0 #HLK0 #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02
elim (lpr_drops_conf … HLK0 … HL01) -HL01 // #X1 #H1 #HLK1
elim (lpr_inv_pair_sn … H1) -H1 #K1 #V1 #HK01 #HV01 #H destruct
(* Basic_1: includes: pr0_delta_delta pr2_delta_delta *)
fact cpr_conf_lpr_delta_delta (h):
∀G0,L0,i. (
- ∀G,L,T. ⦃G0, L0, #i⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,#i⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
∀K0,V0. ⬇*[i] L0 ≘ K0.ⓓV0 →
- ∀V1. ⦃G0, K0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⬆*[↑i] V1 ≘ T1 →
+ ∀V1. ⦃G0,K0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⬆*[↑i] V1 ≘ T1 →
∀KX,VX. ⬇*[i] L0 ≘ KX.ⓓVX →
- ∀V2. ⦃G0, KX⦄ ⊢ VX ➡[h] V2 → ∀T2. ⬆*[↑i] V2 ≘ T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ T1 ➡[h] T & ⦃G0, L2⦄ ⊢ T2 ➡[h] T.
+ ∀V2. ⦃G0,KX⦄ ⊢ VX ➡[h] V2 → ∀T2. ⬆*[↑i] V2 ≘ T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡[h] T & ⦃G0,L2⦄ ⊢ T2 ➡[h] T.
#h #G0 #L0 #i #IH #K0 #V0 #HLK0 #V1 #HV01 #T1 #HVT1
#KX #VX #H #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02
lapply (drops_mono … H … HLK0) -H #H destruct
fact cpr_conf_lpr_bind_bind (h):
∀p,I,G0,L0,V0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓑ{p,I}V0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓑ{p,I}V0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1. ⦃G0, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0, L0.ⓑ{I}V0⦄ ⊢ T0 ➡[h] T1 →
- ∀V2. ⦃G0, L0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⦃G0, L0.ⓑ{I}V0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ ⓑ{p,I}V1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ ⓑ{p,I}V2.T2 ➡[h] T.
+ ∀V1. ⦃G0,L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0,L0.ⓑ{I}V0⦄ ⊢ T0 ➡[h] T1 →
+ ∀V2. ⦃G0,L0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⦃G0,L0.ⓑ{I}V0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ ⓑ{p,I}V1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ ⓑ{p,I}V2.T2 ➡[h] T.
#h #p #I #G0 #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
#V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HV01 … HV02 … HL01 … HL02) //
fact cpr_conf_lpr_bind_zeta (h):
∀G0,L0,V0,T0. (
- ∀G,L,T. ⦃G0, L0, +ⓓV0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,+ⓓV0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1. ⦃G0, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0, L0.ⓓV0⦄ ⊢ T0 ➡[h] T1 →
- ∀T2. ⬆*[1]T2 ≘ T0 → ∀X2. ⦃G0, L0⦄ ⊢ T2 ➡[h] X2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ +ⓓV1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ X2 ➡[h] T.
+ ∀V1. ⦃G0,L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0,L0.ⓓV0⦄ ⊢ T0 ➡[h] T1 →
+ ∀T2. ⬆*[1]T2 ≘ T0 → ∀X2. ⦃G0,L0⦄ ⊢ T2 ➡[h] X2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ +ⓓV1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ X2 ➡[h] T.
#h #G0 #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
#T2 #HT20 #X2 #HTX2 #L1 #HL01 #L2 #HL02
elim (cpm_inv_lifts_sn … HT01 (Ⓣ) … L0 … HT20) -HT01 [| /3 width=1 by drops_refl, drops_drop/ ] #T #HT1 #HT2
fact cpr_conf_lpr_zeta_zeta (h):
∀G0,L0,V0,T0. (
- ∀G,L,T. ⦃G0, L0, +ⓓV0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,+ⓓV0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀T1. ⬆*[1] T1 ≘ T0 → ∀X1. ⦃G0, L0⦄ ⊢ T1 ➡[h] X1 →
- ∀T2. ⬆*[1] T2 ≘ T0 → ∀X2. ⦃G0, L0⦄ ⊢ T2 ➡[h] X2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ X1 ➡[h] T & ⦃G0, L2⦄ ⊢ X2 ➡[h] T.
+ ∀T1. ⬆*[1] T1 ≘ T0 → ∀X1. ⦃G0,L0⦄ ⊢ T1 ➡[h] X1 →
+ ∀T2. ⬆*[1] T2 ≘ T0 → ∀X2. ⦃G0,L0⦄ ⊢ T2 ➡[h] X2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ X1 ➡[h] T & ⦃G0,L2⦄ ⊢ X2 ➡[h] T.
#h #G0 #L0 #V0 #T0 #IH #T1 #HT10 #X1 #HTX1
#T2 #HT20 #X2 #HTX2 #L1 #HL01 #L2 #HL02
lapply (lifts_inj … HT20 … HT10) -HT20 #H destruct
fact cpr_conf_lpr_flat_flat (h):
∀I,G0,L0,V0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓕ{I}V0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓕ{I}V0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1. ⦃G0, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0, L0⦄ ⊢ T0 ➡[h] T1 →
- ∀V2. ⦃G0, L0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⦃G0, L0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ ⓕ{I}V1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ ⓕ{I}V2.T2 ➡[h] T.
+ ∀V1. ⦃G0,L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0,L0⦄ ⊢ T0 ➡[h] T1 →
+ ∀V2. ⦃G0,L0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⦃G0,L0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ ⓕ{I}V1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ ⓕ{I}V2.T2 ➡[h] T.
#h #I #G0 #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
#V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HV01 … HV02 … HL01 … HL02) //
fact cpr_conf_lpr_flat_eps (h):
∀G0,L0,V0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓝV0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓝV0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1,T1. ⦃G0, L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G0, L0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ ⓝV1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ T2 ➡[h] T.
+ ∀V1,T1. ⦃G0,L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G0,L0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ ⓝV1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ T2 ➡[h] T.
#h #G0 #L0 #V0 #T0 #IH #V1 #T1 #HT01
#T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HT01 … HT02 … HL01 … HL02) // -L0 -V0 -T0
fact cpr_conf_lpr_eps_eps (h):
∀G0,L0,V0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓝV0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓝV0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀T1. ⦃G0, L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G0, L0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ T1 ➡[h] T & ⦃G0, L2⦄ ⊢ T2 ➡[h] T.
+ ∀T1. ⦃G0,L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G0,L0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ T1 ➡[h] T & ⦃G0,L2⦄ ⊢ T2 ➡[h] T.
#h #G0 #L0 #V0 #T0 #IH #T1 #HT01
#T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HT01 … HT02 … HL01 … HL02) // -L0 -V0 -T0
fact cpr_conf_lpr_flat_beta (h):
∀p,G0,L0,V0,W0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓐV0.ⓛ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓐV0.ⓛ{p}W0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1. ⦃G0, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0, L0⦄ ⊢ ⓛ{p}W0.T0 ➡[h] T1 →
- ∀V2. ⦃G0, L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G0, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0, L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
+ ∀V1. ⦃G0,L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0,L0⦄ ⊢ ⓛ{p}W0.T0 ➡[h] T1 →
+ ∀V2. ⦃G0,L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G0,L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0,L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
#h #p #G0 #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
#V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
elim (cpm_inv_abst1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
*)
fact cpr_conf_lpr_flat_theta (h):
∀p,G0,L0,V0,W0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓐV0.ⓓ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓐV0.ⓓ{p}W0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1. ⦃G0, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0, L0⦄ ⊢ ⓓ{p}W0.T0 ➡[h] T1 →
- ∀V2. ⦃G0, L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≘ U2 →
- ∀W2. ⦃G0, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0, L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
+ ∀V1. ⦃G0,L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G0,L0⦄ ⊢ ⓓ{p}W0.T0 ➡[h] T1 →
+ ∀V2. ⦃G0,L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≘ U2 →
+ ∀W2. ⦃G0,L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0,L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
#h #p #G0 #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
#V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
fact cpr_conf_lpr_beta_beta (h):
∀p,G0,L0,V0,W0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓐV0.ⓛ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓐV0.ⓛ{p}W0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1. ⦃G0, L0⦄ ⊢ V0 ➡[h] V1 → ∀W1. ⦃G0, L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G0, L0.ⓛW0⦄ ⊢ T0 ➡[h] T1 →
- ∀V2. ⦃G0, L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G0, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0, L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ ⓓ{p}ⓝW1.V1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
+ ∀V1. ⦃G0,L0⦄ ⊢ V0 ➡[h] V1 → ∀W1. ⦃G0,L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G0,L0.ⓛW0⦄ ⊢ T0 ➡[h] T1 →
+ ∀V2. ⦃G0,L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G0,L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0,L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ ⓓ{p}ⓝW1.V1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
#h #p #G0 #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01
#V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
(* Basic_1: was: pr0_upsilon_upsilon *)
fact cpr_conf_lpr_theta_theta (h):
∀p,G0,L0,V0,W0,T0. (
- ∀G,L,T. ⦃G0, L0, ⓐV0.ⓓ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ → IH_cpr_conf_lpr h G L T
+ ∀G,L,T. ⦃G0,L0,ⓐV0.ⓓ{p}W0.T0⦄ ⬂+ ⦃G,L,T⦄ → IH_cpr_conf_lpr h G L T
) →
- ∀V1. ⦃G0, L0⦄ ⊢ V0 ➡[h] V1 → ∀U1. ⬆*[1] V1 ≘ U1 →
- ∀W1. ⦃G0, L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G0, L0.ⓓW0⦄ ⊢ T0 ➡[h] T1 →
- ∀V2. ⦃G0, L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≘ U2 →
- ∀W2. ⦃G0, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0, L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
- ∀L1. ⦃G0, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0, L0⦄ ⊢ ➡[h] L2 →
- ∃∃T. ⦃G0, L1⦄ ⊢ ⓓ{p}W1.ⓐU1.T1 ➡[h] T & ⦃G0, L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
+ ∀V1. ⦃G0,L0⦄ ⊢ V0 ➡[h] V1 → ∀U1. ⬆*[1] V1 ≘ U1 →
+ ∀W1. ⦃G0,L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G0,L0.ⓓW0⦄ ⊢ T0 ➡[h] T1 →
+ ∀V2. ⦃G0,L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≘ U2 →
+ ∀W2. ⦃G0,L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G0,L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
+ ∀L1. ⦃G0,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G0,L0⦄ ⊢ ➡[h] L2 →
+ ∃∃T. ⦃G0,L1⦄ ⊢ ⓓ{p}W1.ⓐU1.T1 ➡[h] T & ⦃G0,L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
#h #p #G0 #L0 #V0 #W0 #T0 #IH #V1 #HV01 #U1 #HVU1 #W1 #HW01 #T1 #HT01
#V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
(* Properties with context-sensitive parallel reduction for terms ***********)
-lemma lpr_cpr_conf_dx (h) (G): ∀L0. ∀T0,T1:term. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 →
- ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡[h] T & ⦃G, L1⦄ ⊢ T1 ➡[h] T.
+lemma lpr_cpr_conf_dx (h) (G): ∀L0. ∀T0,T1:term. ⦃G,L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 →
+ ∃∃T. ⦃G,L1⦄ ⊢ T0 ➡[h] T & ⦃G,L1⦄ ⊢ T1 ➡[h] T.
#h #G #L0 #T0 #T1 #HT01 #L1 #HL01
elim (cpr_conf_lpr … HT01 T0 … HL01 … HL01) -HT01 -HL01
/2 width=3 by ex2_intro/
qed-.
-lemma lpr_cpr_conf_sn (h) (G): ∀L0. ∀T0,T1:term. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 →
- ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡[h] T & ⦃G, L0⦄ ⊢ T1 ➡[h] T.
+lemma lpr_cpr_conf_sn (h) (G): ∀L0. ∀T0,T1:term. ⦃G,L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 →
+ ∃∃T. ⦃G,L1⦄ ⊢ T0 ➡[h] T & ⦃G,L0⦄ ⊢ T1 ➡[h] T.
#h #G #L0 #T0 #T1 #HT01 #L1 #HL01
elim (cpr_conf_lpr … HT01 T0 … L0 … HL01) -HT01 -HL01
/2 width=3 by ex2_intro/
(* Forward lemmas with unbound parallel rt-transition for ref local envs ****)
(* Basic_2A1: was: lpr_lpx *)
-lemma lpr_fwd_lpx (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L1⦄ ⊢ ⬈[h] L2.
+lemma lpr_fwd_lpx (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ➡[h] L2 → ⦃G,L1⦄ ⊢ ⬈[h] L2.
/3 width=3 by cpm_fwd_cpx, lex_co/ qed-.
(* Basic properties *********************************************************)
-lemma lpx_bind (h) (G): ∀K1,K2. ⦃G, K1⦄ ⊢ ⬈[h] K2 →
- ∀I1,I2. ⦃G, K1⦄ ⊢ I1 ⬈[h] I2 → ⦃G, K1.ⓘ{I1}⦄ ⊢ ⬈[h] K2.ⓘ{I2}.
+lemma lpx_bind (h) (G): ∀K1,K2. ⦃G,K1⦄ ⊢ ⬈[h] K2 →
+ ∀I1,I2. ⦃G,K1⦄ ⊢ I1 ⬈[h] I2 → ⦃G,K1.ⓘ{I1}⦄ ⊢ ⬈[h] K2.ⓘ{I2}.
/2 width=1 by lex_bind/ qed.
lemma lpx_refl (h) (G): reflexive … (lpx h G).
(* Advanced properties ******************************************************)
-lemma lpx_bind_refl_dx (h) (G): ∀K1,K2. ⦃G, K1⦄ ⊢ ⬈[h] K2 →
- ∀I. ⦃G, K1.ⓘ{I}⦄ ⊢ ⬈[h] K2.ⓘ{I}.
+lemma lpx_bind_refl_dx (h) (G): ∀K1,K2. ⦃G,K1⦄ ⊢ ⬈[h] K2 →
+ ∀I. ⦃G,K1.ⓘ{I}⦄ ⊢ ⬈[h] K2.ⓘ{I}.
/2 width=1 by lex_bind_refl_dx/ qed.
-lemma lpx_pair (h) (G): ∀K1,K2. ⦃G, K1⦄ ⊢ ⬈[h] K2 → ∀V1,V2. ⦃G, K1⦄ ⊢ V1 ⬈[h] V2 →
- ∀I.⦃G, K1.ⓑ{I}V1⦄ ⊢ ⬈[h] K2.ⓑ{I}V2.
+lemma lpx_pair (h) (G): ∀K1,K2. ⦃G,K1⦄ ⊢ ⬈[h] K2 → ∀V1,V2. ⦃G,K1⦄ ⊢ V1 ⬈[h] V2 →
+ ∀I.⦃G,K1.ⓑ{I}V1⦄ ⊢ ⬈[h] K2.ⓑ{I}V2.
/2 width=1 by lex_pair/ qed.
(* Basic inversion lemmas ***************************************************)
(* Basic_2A1: was: lpx_inv_atom1 *)
-lemma lpx_inv_atom_sn (h) (G): ∀L2. ⦃G, ⋆⦄ ⊢ ⬈[h] L2 → L2 = ⋆.
+lemma lpx_inv_atom_sn (h) (G): ∀L2. ⦃G,⋆⦄ ⊢ ⬈[h] L2 → L2 = ⋆.
/2 width=2 by lex_inv_atom_sn/ qed-.
-lemma lpx_inv_bind_sn (h) (G): ∀I1,L2,K1. ⦃G, K1.ⓘ{I1}⦄ ⊢ ⬈[h] L2 →
- ∃∃I2,K2. ⦃G, K1⦄ ⊢ ⬈[h] K2 & ⦃G, K1⦄ ⊢ I1 ⬈[h] I2 &
+lemma lpx_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: lpx_inv_atom2 *)
-lemma lpx_inv_atom_dx: ∀h,G,L1. ⦃G, L1⦄ ⊢ ⬈[h] ⋆ → L1 = ⋆.
+lemma lpx_inv_atom_dx: ∀h,G,L1. ⦃G,L1⦄ ⊢ ⬈[h] ⋆ → L1 = ⋆.
/2 width=2 by lex_inv_atom_dx/ qed-.
-lemma lpx_inv_bind_dx (h) (G): ∀I2,L1,K2. ⦃G, L1⦄ ⊢ ⬈[h] K2.ⓘ{I2} →
- ∃∃I1,K1. ⦃G, K1⦄ ⊢ ⬈[h] K2 & ⦃G, K1⦄ ⊢ I1 ⬈[h] I2 &
+lemma lpx_inv_bind_dx (h) (G): ∀I2,L1,K2. ⦃G,L1⦄ ⊢ ⬈[h] K2.ⓘ{I2} →
+ ∃∃I1,K1. ⦃G,K1⦄ ⊢ ⬈[h] K2 & ⦃G,K1⦄ ⊢ I1 ⬈[h] I2 &
L1 = K1.ⓘ{I1}.
/2 width=1 by lex_inv_bind_dx/ qed-.
(* Advanced inversion lemmas ************************************************)
-lemma lpx_inv_unit_sn (h) (G): ∀I,L2,K1. ⦃G, K1.ⓤ{I}⦄ ⊢ ⬈[h] L2 →
- ∃∃K2. ⦃G, K1⦄ ⊢ ⬈[h] K2 & L2 = K2.ⓤ{I}.
+lemma lpx_inv_unit_sn (h) (G): ∀I,L2,K1. ⦃G,K1.ⓤ{I}⦄ ⊢ ⬈[h] L2 →
+ ∃∃K2. ⦃G,K1⦄ ⊢ ⬈[h] K2 & L2 = K2.ⓤ{I}.
/2 width=1 by lex_inv_unit_sn/ qed-.
(* Basic_2A1: was: lpx_inv_pair1 *)
-lemma lpx_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 &
+lemma lpx_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-.
-lemma lpx_inv_unit_dx (h) (G): ∀I,L1,K2. ⦃G, L1⦄ ⊢ ⬈[h] K2.ⓤ{I} →
- ∃∃K1. ⦃G, K1⦄ ⊢ ⬈[h] K2 & L1 = K1.ⓤ{I}.
+lemma lpx_inv_unit_dx (h) (G): ∀I,L1,K2. ⦃G,L1⦄ ⊢ ⬈[h] K2.ⓤ{I} →
+ ∃∃K1. ⦃G,K1⦄ ⊢ ⬈[h] K2 & L1 = K1.ⓤ{I}.
/2 width=1 by lex_inv_unit_dx/ qed-.
(* Basic_2A1: was: lpx_inv_pair2 *)
-lemma lpx_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 &
+lemma lpx_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-.
-lemma lpx_inv_pair (h) (G): ∀I1,I2,L1,L2,V1,V2. ⦃G, L1.ⓑ{I1}V1⦄ ⊢ ⬈[h] L2.ⓑ{I2}V2 →
- ∧∧ ⦃G, L1⦄ ⊢ ⬈[h] L2 & ⦃G, L1⦄ ⊢ V1 ⬈[h] V2 & I1 = I2.
+lemma lpx_inv_pair (h) (G): ∀I1,I2,L1,L2,V1,V2. ⦃G,L1.ⓑ{I1}V1⦄ ⊢ ⬈[h] L2.ⓑ{I2}V2 →
+ ∧∧ ⦃G,L1⦄ ⊢ ⬈[h] L2 & ⦃G,L1⦄ ⊢ V1 ⬈[h] V2 & I1 = I2.
/2 width=1 by lex_inv_pair/ qed-.
(* Note: lemma 500 *)
(* Basic_2A1: was: cpx_lpx_aaa_conf *)
-lemma cpx_aaa_conf_lpx (h): ∀G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A →
- ∀T2. ⦃G, L1⦄ ⊢ T1 ⬈[h] T2 →
- ∀L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → ⦃G, L2⦄ ⊢ T2 ⁝ A.
+lemma cpx_aaa_conf_lpx (h): ∀G,L1,T1,A. ⦃G,L1⦄ ⊢ T1 ⁝ A →
+ ∀T2. ⦃G,L1⦄ ⊢ T1 ⬈[h] T2 →
+ ∀L2. ⦃G,L1⦄ ⊢ ⬈[h] L2 → ⦃G,L2⦄ ⊢ T2 ⁝ A.
#h #G #L1 #T1 #A #H elim H -G -L1 -T1 -A
[ #G #L1 #s #X #H
elim (cpx_inv_sort1 … H) -H #H destruct //
(* Properties with extended structural successor for closures ***************)
-lemma lpx_fqu_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_fqu_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 elim H -G1 -G2 -L1 -L2 -T1 -T2
[ #I #G #K #V #K1 #H
elim (lpx_inv_pair_dx … H) -H #K0 #V0 #HK0 #HV0 #H destruct
]
qed-.
-lemma fqu_lpx_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
- ∀K2. ⦃G2, L2⦄ ⊢ ⬈[h] K2 →
- ∃∃K1,T. ⦃G1, L1⦄ ⊢ ⬈[h] K1 & ⦃G1, L1⦄ ⊢ T1 ⬈[h] T & ⦃G1, K1, T⦄ ⊐[b] ⦃G2, K2, T2⦄.
+lemma fqu_lpx_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂[b] ⦃G2,L2,T2⦄ →
+ ∀K2. ⦃G2,L2⦄ ⊢ ⬈[h] K2 →
+ ∃∃K1,T. ⦃G1,L1⦄ ⊢ ⬈[h] K1 & ⦃G1,L1⦄ ⊢ T1 ⬈[h] T & ⦃G1,K1,T⦄ ⬂[b] ⦃G2,K2,T2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
[ /3 width=5 by lpx_bind_refl_dx, fqu_lref_O, ex3_2_intro/
| /3 width=5 by cpx_pair_sn, fqu_pair_sn, ex3_2_intro/
-| #p #I #G2 #L2 #V2 #T2 #X #H
+| #p #I #G2 #L2 #V2 #T2 #Hb #X #H
elim (lpx_inv_pair_sn … H) -H #K2 #W2 #HLK2 #HVW2 #H destruct
/3 width=5 by cpx_pair_sn, fqu_bind_dx, ex3_2_intro/
| #p #I #G2 #L2 #V2 #T2 #Hb #X #H
(* Properties with extended optional structural successor for closures ******)
-lemma lpx_fquq_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_fquq_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 cases H -H
[ #H12 elim (lpx_fqu_trans … H12 … HKL1) -L1 /3 width=5 by fqu_fquq, ex3_2_intro/
| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
]
qed-.
-lemma fquq_lpx_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
- ∀K2. ⦃G2, L2⦄ ⊢ ⬈[h] K2 →
- ∃∃K1,T. ⦃G1, L1⦄ ⊢ ⬈[h] K1 & ⦃G1, L1⦄ ⊢ T1 ⬈[h] T & ⦃G1, K1, T⦄ ⊐⸮[b] ⦃G2, K2, T2⦄.
+lemma fquq_lpx_trans (h) (b): ∀G1,G2,L1,L2,T1,T2. ⦃G1,L1,T1⦄ ⬂⸮[b] ⦃G2,L2,T2⦄ →
+ ∀K2. ⦃G2,L2⦄ ⊢ ⬈[h] K2 →
+ ∃∃K1,T. ⦃G1,L1⦄ ⊢ ⬈[h] K1 & ⦃G1,L1⦄ ⊢ T1 ⬈[h] T & ⦃G1,K1,T⦄ ⬂⸮[b] ⦃G2,K2,T2⦄.
#h #b #G1 #G2 #L1 #L2 #T1 #T2 #H #K2 #HLK2 cases H -H
[ #H12 elim (fqu_lpx_trans … H12 … HLK2) /3 width=5 by fqu_fquq, ex3_2_intro/
| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/
(* Forward lemmas with free variables inclusion for restricted closures *****)
(* Basic_2A1: uses: lpx_cpx_frees_trans *)
-lemma lpx_cpx_conf_fsge (h) (G): ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ⬈[h] T1 →
- ∀L2. ⦃G, L0⦄ ⊢ ⬈[h] L2 → ⦃L2, T1⦄ ⊆ ⦃L0, T0⦄.
+lemma lpx_cpx_conf_fsge (h) (G): ∀L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ⬈[h] T1 →
+ ∀L2. ⦃G,L0⦄ ⊢ ⬈[h] L2 → ⦃L2,T1⦄ ⊆ ⦃L0,T0⦄.
/3 width=4 by rpx_cpx_conf_fsge, lpx_rpx/ qed-.
(* Basic_2A1: uses: lpx_frees_trans *)
-lemma lpx_fsge_comp (h) (G): ∀L0,L2,T0. ⦃G, L0⦄ ⊢ ⬈[h] L2 → ⦃L2, T0⦄ ⊆ ⦃L0, T0⦄.
+lemma lpx_fsge_comp (h) (G): ∀L0,L2,T0. ⦃G,L0⦄ ⊢ ⬈[h] L2 → ⦃L2,T0⦄ ⊆ ⦃L0,T0⦄.
/2 width=4 by lpx_cpx_conf_fsge/ qed-.
(* Forward lemmas with length for local environments ************************)
-lemma lpx_fwd_length (h) (G): ∀L1,L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → |L1| = |L2|.
+lemma lpx_fwd_length (h) (G): ∀L1,L2. ⦃G,L1⦄ ⊢ ⬈[h] L2 → |L1| = |L2|.
/2 width=2 by lex_fwd_length/ qed-.
(* UNBOUND PARALLEL RT-TRANSITION FOR FULL LOCAL ENVIRONMENTS ***************)
-(* Properties with degree-based equivalence for local environments **********)
+(* Properties with sort-irrelevant equivalence for local environments *******)
(* Basic_2A1: uses: lleq_lpx_trans *)
-lemma rdeq_lpx_trans (h) (o) (G): ∀L2,K2. ⦃G, L2⦄ ⊢ ⬈[h] K2 →
- ∀L1. ∀T:term. L1 ≛[h, o, T] L2 →
- ∃∃K1. ⦃G, L1⦄ ⊢ ⬈[h] K1 & K1 ≛[h, o, T] K2.
-#h #o #G #L2 #K2 #HLK2 #L1 #T #HL12
+lemma rdeq_lpx_trans (h) (G): ∀L2,K2. ⦃G,L2⦄ ⊢ ⬈[h] K2 →
+ ∀L1. ∀T:term. L1 ≛[T] L2 →
+ ∃∃K1. ⦃G,L1⦄ ⊢ ⬈[h] K1 & K1 ≛[T] K2.
+#h #G #L2 #K2 #HLK2 #L1 #T #HL12
lapply (lpx_rpx … T HLK2) -HLK2 #HLK2
elim (rdeq_rpx_trans … HLK2 … HL12) -L2 #K #H #HK2
elim (rpx_inv_lpx_req … H) -H #K1 #HLK1 #HK1
(* Basic properties ***********************************************************)
-lemma rpx_atom: ∀h,I,G. ⦃G, ⋆⦄ ⊢ ⬈[h, ⓪{I}] ⋆.
+lemma rpx_atom: ∀h,I,G. ⦃G,⋆⦄ ⊢ ⬈[h,⓪{I}] ⋆.
/2 width=1 by rex_atom/ qed.
lemma rpx_sort: ∀h,I1,I2,G,L1,L2,s.
- ⦃G, L1⦄ ⊢ ⬈[h, ⋆s] L2 → ⦃G, L1.ⓘ{I1}⦄ ⊢ ⬈[h, ⋆s] L2.ⓘ{I2}.
+ ⦃G,L1⦄ ⊢ ⬈[h,⋆s] L2 → ⦃G,L1.ⓘ{I1}⦄ ⊢ ⬈[h,⋆s] L2.ⓘ{I2}.
/2 width=1 by rex_sort/ qed.
lemma rpx_pair: ∀h,I,G,L1,L2,V1,V2.
- ⦃G, L1⦄ ⊢ ⬈[h, V1] L2 → ⦃G, L1⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L1.ⓑ{I}V1⦄ ⊢ ⬈[h, #0] L2.ⓑ{I}V2.
+ ⦃G,L1⦄ ⊢ ⬈[h,V1] L2 → ⦃G,L1⦄ ⊢ V1 ⬈[h] V2 → ⦃G,L1.ⓑ{I}V1⦄ ⊢ ⬈[h,#0] L2.ⓑ{I}V2.
/2 width=1 by rex_pair/ qed.
lemma rpx_lref: ∀h,I1,I2,G,L1,L2,i.
- ⦃G, L1⦄ ⊢ ⬈[h, #i] L2 → ⦃G, L1.ⓘ{I1}⦄ ⊢ ⬈[h, #↑i] L2.ⓘ{I2}.
+ ⦃G,L1⦄ ⊢ ⬈[h,#i] L2 → ⦃G,L1.ⓘ{I1}⦄ ⊢ ⬈[h,#↑i] L2.ⓘ{I2}.
/2 width=1 by rex_lref/ qed.
lemma rpx_gref: ∀h,I1,I2,G,L1,L2,l.
- ⦃G, L1⦄ ⊢ ⬈[h, §l] L2 → ⦃G, L1.ⓘ{I1}⦄ ⊢ ⬈[h, §l] L2.ⓘ{I2}.
+ ⦃G,L1⦄ ⊢ ⬈[h,§l] L2 → ⦃G,L1.ⓘ{I1}⦄ ⊢ ⬈[h,§l] L2.ⓘ{I2}.
/2 width=1 by rex_gref/ qed.
lemma rpx_bind_repl_dx: ∀h,I,I1,G,L1,L2,T.
- ⦃G, L1.ⓘ{I}⦄ ⊢ ⬈[h, T] L2.ⓘ{I1} →
- ∀I2. ⦃G, L1⦄ ⊢ I ⬈[h] I2 →
- ⦃G, L1.ⓘ{I}⦄ ⊢ ⬈[h, T] L2.ⓘ{I2}.
+ ⦃G,L1.ⓘ{I}⦄ ⊢ ⬈[h,T] L2.ⓘ{I1} →
+ ∀I2. ⦃G,L1⦄ ⊢ I ⬈[h] I2 →
+ ⦃G,L1.ⓘ{I}⦄ ⊢ ⬈[h,T] L2.ⓘ{I2}.
/2 width=2 by rex_bind_repl_dx/ qed-.
(* Basic inversion lemmas ***************************************************)
-lemma rpx_inv_atom_sn: ∀h,G,Y2,T. ⦃G, ⋆⦄ ⊢ ⬈[h, T] Y2 → Y2 = ⋆.
+lemma rpx_inv_atom_sn: ∀h,G,Y2,T. ⦃G,⋆⦄ ⊢ ⬈[h,T] Y2 → Y2 = ⋆.
/2 width=3 by rex_inv_atom_sn/ qed-.
-lemma rpx_inv_atom_dx: ∀h,G,Y1,T. ⦃G, Y1⦄ ⊢ ⬈[h, T] ⋆ → Y1 = ⋆.
+lemma rpx_inv_atom_dx: ∀h,G,Y1,T. ⦃G,Y1⦄ ⊢ ⬈[h,T] ⋆ → Y1 = ⋆.
/2 width=3 by rex_inv_atom_dx/ qed-.
-lemma rpx_inv_sort: ∀h,G,Y1,Y2,s. ⦃G, Y1⦄ ⊢ ⬈[h, ⋆s] Y2 →
+lemma rpx_inv_sort: ∀h,G,Y1,Y2,s. ⦃G,Y1⦄ ⊢ ⬈[h,⋆s] Y2 →
∨∨ Y1 = ⋆ ∧ Y2 = ⋆
- | ∃∃I1,I2,L1,L2. ⦃G, L1⦄ ⊢ ⬈[h, ⋆s] L2 &
+ | ∃∃I1,I2,L1,L2. ⦃G,L1⦄ ⊢ ⬈[h,⋆s] L2 &
Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}.
/2 width=1 by rex_inv_sort/ qed-.
-lemma rpx_inv_lref: ∀h,G,Y1,Y2,i. ⦃G, Y1⦄ ⊢ ⬈[h, #↑i] Y2 →
+lemma rpx_inv_lref: ∀h,G,Y1,Y2,i. ⦃G,Y1⦄ ⊢ ⬈[h,#↑i] Y2 →
∨∨ Y1 = ⋆ ∧ Y2 = ⋆
- | ∃∃I1,I2,L1,L2. ⦃G, L1⦄ ⊢ ⬈[h, #i] L2 &
+ | ∃∃I1,I2,L1,L2. ⦃G,L1⦄ ⊢ ⬈[h,#i] L2 &
Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}.
/2 width=1 by rex_inv_lref/ qed-.
-lemma rpx_inv_gref: ∀h,G,Y1,Y2,l. ⦃G, Y1⦄ ⊢ ⬈[h, §l] Y2 →
+lemma rpx_inv_gref: ∀h,G,Y1,Y2,l. ⦃G,Y1⦄ ⊢ ⬈[h,§l] Y2 →
∨∨ Y1 = ⋆ ∧ Y2 = ⋆
- | ∃∃I1,I2,L1,L2. ⦃G, L1⦄ ⊢ ⬈[h, §l] L2 &
+ | ∃∃I1,I2,L1,L2. ⦃G,L1⦄ ⊢ ⬈[h,§l] L2 &
Y1 = L1.ⓘ{I1} & Y2 = L2.ⓘ{I2}.
/2 width=1 by rex_inv_gref/ qed-.
-lemma rpx_inv_bind: ∀h,p,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ⬈[h, ⓑ{p,I}V.T] L2 →
- ∧∧ ⦃G, L1⦄ ⊢ ⬈[h, V] L2 & ⦃G, L1.ⓑ{I}V⦄ ⊢ ⬈[h, T] L2.ⓑ{I}V.
+lemma rpx_inv_bind: ∀h,p,I,G,L1,L2,V,T. ⦃G,L1⦄ ⊢ ⬈[h,ⓑ{p,I}V.T] L2 →
+ ∧∧ ⦃G,L1⦄ ⊢ ⬈[h,V] L2 & ⦃G,L1.ⓑ{I}V⦄ ⊢ ⬈[h,T] L2.ⓑ{I}V.
/2 width=2 by rex_inv_bind/ qed-.
-lemma rpx_inv_flat: ∀h,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ⬈[h, ⓕ{I}V.T] L2 →
- ∧∧ ⦃G, L1⦄ ⊢ ⬈[h, V] L2 & ⦃G, L1⦄ ⊢ ⬈[h, T] L2.
+lemma rpx_inv_flat: ∀h,I,G,L1,L2,V,T. ⦃G,L1⦄ ⊢ ⬈[h,ⓕ{I}V.T] L2 →
+ ∧∧ ⦃G,L1⦄ ⊢ ⬈[h,V] L2 & ⦃G,L1⦄ ⊢ ⬈[h,T] L2.
/2 width=2 by rex_inv_flat/ qed-.
(* Advanced inversion lemmas ************************************************)
-lemma rpx_inv_sort_bind_sn: ∀h,I1,G,Y2,L1,s. ⦃G, L1.ⓘ{I1}⦄ ⊢ ⬈[h, ⋆s] Y2 →
- ∃∃I2,L2. ⦃G, L1⦄ ⊢ ⬈[h, ⋆s] L2 & Y2 = L2.ⓘ{I2}.
+lemma rpx_inv_sort_bind_sn: ∀h,I1,G,Y2,L1,s. ⦃G,L1.ⓘ{I1}⦄ ⊢ ⬈[h,⋆s] Y2 →
+ ∃∃I2,L2. ⦃G,L1⦄ ⊢ ⬈[h,⋆s] L2 & Y2 = L2.ⓘ{I2}.
/2 width=2 by rex_inv_sort_bind_sn/ qed-.
-lemma rpx_inv_sort_bind_dx: ∀h,I2,G,Y1,L2,s. ⦃G, Y1⦄ ⊢ ⬈[h, ⋆s] L2.ⓘ{I2} →
- ∃∃I1,L1. ⦃G, L1⦄ ⊢ ⬈[h, ⋆s] L2 & Y1 = L1.ⓘ{I1}.
+lemma rpx_inv_sort_bind_dx: ∀h,I2,G,Y1,L2,s. ⦃G,Y1⦄ ⊢ ⬈[h,⋆s] L2.ⓘ{I2} →
+ ∃∃I1,L1. ⦃G,L1⦄ ⊢ ⬈[h,⋆s] L2 & Y1 = L1.ⓘ{I1}.
/2 width=2 by rex_inv_sort_bind_dx/ qed-.
-lemma rpx_inv_zero_pair_sn: ∀h,I,G,Y2,L1,V1. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ⬈[h, #0] Y2 →
- ∃∃L2,V2. ⦃G, L1⦄ ⊢ ⬈[h, V1] L2 & ⦃G, L1⦄ ⊢ V1 ⬈[h] V2 &
+lemma rpx_inv_zero_pair_sn: ∀h,I,G,Y2,L1,V1. ⦃G,L1.ⓑ{I}V1⦄ ⊢ ⬈[h,#0] Y2 →
+ ∃∃L2,V2. ⦃G,L1⦄ ⊢ ⬈[h,V1] L2 & ⦃G,L1⦄ ⊢ V1 ⬈[h] V2 &
Y2 = L2.ⓑ{I}V2.
/2 width=1 by rex_inv_zero_pair_sn/ qed-.
-lemma rpx_inv_zero_pair_dx: ∀h,I,G,Y1,L2,V2. ⦃G, Y1⦄ ⊢ ⬈[h, #0] L2.ⓑ{I}V2 →
- ∃∃L1,V1. ⦃G, L1⦄ ⊢ ⬈[h, V1] L2 & ⦃G, L1⦄ ⊢ V1 ⬈[h] V2 &
+lemma rpx_inv_zero_pair_dx: ∀h,I,G,Y1,L2,V2. ⦃G,Y1⦄ ⊢ ⬈[h,#0] L2.ⓑ{I}V2 →
+ ∃∃L1,V1. ⦃G,L1⦄ ⊢ ⬈[h,V1] L2 & ⦃G,L1⦄ ⊢ V1 ⬈[h] V2 &
Y1 = L1.ⓑ{I}V1.
/2 width=1 by rex_inv_zero_pair_dx/ qed-.
-lemma rpx_inv_lref_bind_sn: ∀h,I1,G,Y2,L1,i. ⦃G, L1.ⓘ{I1}⦄ ⊢ ⬈[h, #↑i] Y2 →
- ∃∃I2,L2. ⦃G, L1⦄ ⊢ ⬈[h, #i] L2 & Y2 = L2.ⓘ{I2}.
+lemma rpx_inv_lref_bind_sn: ∀h,I1,G,Y2,L1,i. ⦃G,L1.ⓘ{I1}⦄ ⊢ ⬈[h,#↑i] Y2 →
+ ∃∃I2,L2. ⦃G,L1⦄ ⊢ ⬈[h,#i] L2 & Y2 = L2.ⓘ{I2}.
/2 width=2 by rex_inv_lref_bind_sn/ qed-.
-lemma rpx_inv_lref_bind_dx: ∀h,I2,G,Y1,L2,i. ⦃G, Y1⦄ ⊢ ⬈[h, #↑i] L2.ⓘ{I2} →
- ∃∃I1,L1. ⦃G, L1⦄ ⊢ ⬈[h, #i] L2 & Y1 = L1.ⓘ{I1}.
+lemma rpx_inv_lref_bind_dx: ∀h,I2,G,Y1,L2,i. ⦃G,Y1⦄ ⊢ ⬈[h,#↑i] L2.ⓘ{I2} →
+ ∃∃I1,L1. ⦃G,L1⦄ ⊢ ⬈[h,#i] L2 & Y1 = L1.ⓘ{I1}.
/2 width=2 by rex_inv_lref_bind_dx/ qed-.
-lemma rpx_inv_gref_bind_sn: ∀h,I1,G,Y2,L1,l. ⦃G, L1.ⓘ{I1}⦄ ⊢ ⬈[h, §l] Y2 →
- ∃∃I2,L2. ⦃G, L1⦄ ⊢ ⬈[h, §l] L2 & Y2 = L2.ⓘ{I2}.
+lemma rpx_inv_gref_bind_sn: ∀h,I1,G,Y2,L1,l. ⦃G,L1.ⓘ{I1}⦄ ⊢ ⬈[h,§l] Y2 →
+ ∃∃I2,L2. ⦃G,L1⦄ ⊢ ⬈[h,§l] L2 & Y2 = L2.ⓘ{I2}.
/2 width=2 by rex_inv_gref_bind_sn/ qed-.
-lemma rpx_inv_gref_bind_dx: ∀h,I2,G,Y1,L2,l. ⦃G, Y1⦄ ⊢ ⬈[h, §l] L2.ⓘ{I2} →
- ∃∃I1,L1. ⦃G, L1⦄ ⊢ ⬈[h, §l] L2 & Y1 = L1.ⓘ{I1}.
+lemma rpx_inv_gref_bind_dx: ∀h,I2,G,Y1,L2,l. ⦃G,Y1⦄ ⊢ ⬈[h,§l] L2.ⓘ{I2} →
+ ∃∃I1,L1. ⦃G,L1⦄ ⊢ ⬈[h,§l] L2 & Y1 = L1.ⓘ{I1}.
/2 width=2 by rex_inv_gref_bind_dx/ qed-.
(* Basic forward lemmas *****************************************************)
lemma rpx_fwd_pair_sn: ∀h,I,G,L1,L2,V,T.
- ⦃G, L1⦄ ⊢ ⬈[h, ②{I}V.T] L2 → ⦃G, L1⦄ ⊢ ⬈[h, V] L2.
+ ⦃G,L1⦄ ⊢ ⬈[h,②{I}V.T] L2 → ⦃G,L1⦄ ⊢ ⬈[h,V] L2.
/2 width=3 by rex_fwd_pair_sn/ qed-.
lemma rpx_fwd_bind_dx: ∀h,p,I,G,L1,L2,V,T.
- ⦃G, L1⦄ ⊢ ⬈[h, ⓑ{p,I}V.T] L2 → ⦃G, L1.ⓑ{I}V⦄ ⊢ ⬈[h, T] L2.ⓑ{I}V.
+ ⦃G,L1⦄ ⊢ ⬈[h,ⓑ{p,I}V.T] L2 → ⦃G,L1.ⓑ{I}V⦄ ⊢ ⬈[h,T] L2.ⓑ{I}V.
/2 width=2 by rex_fwd_bind_dx/ qed-.
lemma rpx_fwd_flat_dx: ∀h,I,G,L1,L2,V,T.
- ⦃G, L1⦄ ⊢ ⬈[h, ⓕ{I}V.T] L2 → ⦃G, L1⦄ ⊢ ⬈[h, T] L2.
+ ⦃G,L1⦄ ⊢ ⬈[h,ⓕ{I}V.T] L2 → ⦃G,L1⦄ ⊢ ⬈[h,T] L2.
/2 width=3 by rex_fwd_flat_dx/ qed-.
lemma rpx_refl: ∀h,G,T. reflexive … (rpx h G T).
/2 width=1 by rex_refl/ qed.
-lemma rpx_pair_refl: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 →
- ∀I,T. ⦃G, L.ⓑ{I}V1⦄ ⊢ ⬈[h, T] L.ⓑ{I}V2.
+lemma rpx_pair_refl: ∀h,G,L,V1,V2. ⦃G,L⦄ ⊢ V1 ⬈[h] V2 →
+ ∀I,T. ⦃G,L.ⓑ{I}V1⦄ ⊢ ⬈[h,T] L.ⓑ{I}V2.
/2 width=1 by rex_pair_refl/ qed.
(* Advanced inversion lemmas ************************************************)
-lemma rpx_inv_bind_void: ∀h,p,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ⬈[h, ⓑ{p,I}V.T] L2 →
- ∧∧ ⦃G, L1⦄ ⊢ ⬈[h, V] L2 & ⦃G, L1.ⓧ⦄ ⊢ ⬈[h, T] L2.ⓧ.
+lemma rpx_inv_bind_void: ∀h,p,I,G,L1,L2,V,T. ⦃G,L1⦄ ⊢ ⬈[h,ⓑ{p,I}V.T] L2 →
+ ∧∧ ⦃G,L1⦄ ⊢ ⬈[h,V] L2 & ⦃G,L1.ⓧ⦄ ⊢ ⬈[h,T] L2.ⓧ.
/2 width=3 by rex_inv_bind_void/ qed-.
(* Advanced forward lemmas **************************************************)
lemma rpx_fwd_bind_dx_void: ∀h,p,I,G,L1,L2,V,T.
- ⦃G, L1⦄ ⊢ ⬈[h, ⓑ{p,I}V.T] L2 → ⦃G, L1.ⓧ⦄ ⊢ ⬈[h, T] L2.ⓧ.
+ ⦃G,L1⦄ ⊢ ⬈[h,ⓑ{p,I}V.T] L2 → ⦃G,L1.ⓧ⦄ ⊢ ⬈[h,T] L2.ⓧ.
/2 width=4 by rex_fwd_bind_dx_void/ qed-.
(* Note: "⦃L2, T1⦄ ⊆ ⦃L2, T0⦄" does not hold *)
(* Note: Take L0 = K0.ⓓ(ⓝW.V), L2 = K0.ⓓW, T0 = #0, T1 = ⬆*[1]V *)
-(* Note: This invalidates rpxs_cpx_conf: "∀h,G. s_r_confluent1 … (cpx h G) (rpxs h G)" *)
-lemma rpx_cpx_conf_fsge (h) (G): ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ⬈[h] T1 →
- ∀L2. ⦃G, L0⦄ ⊢⬈[h, T0] L2 → ⦃L2, T1⦄ ⊆ ⦃L0, T0⦄.
-#h #G0 #L0 #T0 @(fqup_wf_ind_eq (â\92») … G0 L0 T0) -G0 -L0 -T0
+(* Note: This invalidates rpxs_cpx_conf: "∀h, G. s_r_confluent1 … (cpx h G) (rpxs h G)" *)
+lemma rpx_cpx_conf_fsge (h) (G): ∀L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ⬈[h] T1 →
+ ∀L2. ⦃G,L0⦄ ⊢⬈[h,T0] L2 → ⦃L2,T1⦄ ⊆ ⦃L0,T0⦄.
+#h #G0 #L0 #T0 @(fqup_wf_ind_eq (â\93\89) … G0 L0 T0) -G0 -L0 -T0
#G #L #T #IH #G0 #L0 * *
[ #s #HG #HL #HT #X #HX #Y #HY destruct -IH
elim (cpx_inv_sort1 … HX) -HX #H destruct
lemma rpx_cpx_conf (h) (G): s_r_confluent1 … (cpx h G) (rpx h G).
/2 width=5 by cpx_rex_conf/ qed-.
-lemma rpx_cpx_conf_fsge_dx (h) (G): ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ⬈[h] T1 →
- ∀L2. ⦃G, L0⦄ ⊢⬈[h, T0] L2 → ⦃L2, T1⦄ ⊆ ⦃L0, T1⦄.
+lemma rpx_cpx_conf_fsge_dx (h) (G): ∀L0,T0,T1. ⦃G,L0⦄ ⊢ T0 ⬈[h] T1 →
+ ∀L2. ⦃G,L0⦄ ⊢⬈[h,T0] L2 → ⦃L2,T1⦄ ⊆ ⦃L0,T1⦄.
/3 width=5 by rpx_cpx_conf, rpx_fsge_comp/ qed-.
(* Forward lemmas with length for local environments ************************)
-lemma rpx_fwd_length: ∀h,G,L1,L2,T. ⦃G, L1⦄ ⊢ ⬈[h, T] L2 → |L1| = |L2|.
+lemma rpx_fwd_length: ∀h,G,L1,L2,T. ⦃G,L1⦄ ⊢ ⬈[h,T] L2 → |L1| = |L2|.
/2 width=3 by rex_fwd_length/ qed-.
(* Inversion lemmas with length for local environments **********************)
-lemma rpx_inv_zero_length: ∀h,G,Y1,Y2. ⦃G, Y1⦄ ⊢ ⬈[h, #0] Y2 →
+lemma rpx_inv_zero_length: ∀h,G,Y1,Y2. ⦃G,Y1⦄ ⊢ ⬈[h,#0] Y2 →
∨∨ ∧∧ Y1 = ⋆ & Y2 = ⋆
- | ∃∃I,L1,L2,V1,V2. ⦃G, L1⦄ ⊢ ⬈[h, V1] L2 &
- ⦃G, L1⦄ ⊢ V1 ⬈[h] V2 &
+ | ∃∃I,L1,L2,V1,V2. ⦃G,L1⦄ ⊢ ⬈[h,V1] L2 &
+ ⦃G,L1⦄ ⊢ V1 ⬈[h] V2 &
Y1 = L1.ⓑ{I}V1 & Y2 = L2.ⓑ{I}V2
| ∃∃I,L1,L2. |L1| = |L2| & Y1 = L1.ⓤ{I} & Y2 = L2.ⓤ{I}.
/2 width=1 by rex_inv_zero_length/ qed-.
(* Properties with syntactic equivalence for referred local environments ****)
-lemma fleq_rpx (h) (G): ∀L1,L2,T. L1 ≡[T] L2 → ⦃G, L1⦄ ⊢ ⬈[h, T] L2.
+lemma fleq_rpx (h) (G): ∀L1,L2,T. L1 ≡[T] L2 → ⦃G,L1⦄ ⊢ ⬈[h,T] L2.
/2 width=1 by req_fwd_rex/ qed.
(* Properties with unbound parallel rt-transition for full local envs *******)
-lemma lpx_rpx: ∀h,G,L1,L2,T. ⦃G, L1⦄ ⊢ ⬈[h] L2 → ⦃G, L1⦄ ⊢ ⬈[h, T] L2.
+lemma lpx_rpx: ∀h,G,L1,L2,T. ⦃G,L1⦄ ⊢ ⬈[h] L2 → ⦃G,L1⦄ ⊢ ⬈[h,T] L2.
/2 width=1 by rex_lex/ qed.
(* Inversion lemmas with unbound parallel rt-transition for full local envs *)
-lemma rpx_inv_lpx_req: ∀h,G,L1,L2,T. ⦃G, L1⦄ ⊢ ⬈[h, T] L2 →
- ∃∃L. ⦃G, L1⦄ ⊢ ⬈[h] L & L ≡[T] L2.
+lemma rpx_inv_lpx_req: ∀h,G,L1,L2,T. ⦃G,L1⦄ ⊢ ⬈[h,T] L2 →
+ ∃∃L. ⦃G,L1⦄ ⊢ ⬈[h] L & L ≡[T] L2.
/3 width=3 by rpx_fsge_comp, rex_inv_lex_req/ qed-.
(* UNBOUND PARALLEL RT-TRANSITION FOR REFERRED LOCAL ENVIRONMENTS ***********)
-(* Properties with degree-based equivalence for local environments **********)
+(* Properties with sort-irrelevant equivalence for local environments *******)
-lemma rpx_pair_sn_split: ∀h,G,L1,L2,V. ⦃G, L1⦄ ⊢ ⬈[h, V] L2 → ∀o,I,T.
- ∃∃L. ⦃G, L1⦄ ⊢ ⬈[h, ②{I}V.T] L & L ≛[h, o, V] L2.
+lemma rpx_pair_sn_split: ∀h,G,L1,L2,V. ⦃G,L1⦄ ⊢ ⬈[h,V] L2 → ∀I,T.
+ ∃∃L. ⦃G,L1⦄ ⊢ ⬈[h,②{I}V.T] L & L ≛[V] L2.
/3 width=5 by rpx_fsge_comp, rex_pair_sn_split/ qed-.
-lemma rpx_flat_dx_split: ∀h,G,L1,L2,T. ⦃G, L1⦄ ⊢ ⬈[h, T] L2 → ∀o,I,V.
- ∃∃L. ⦃G, L1⦄ ⊢ ⬈[h, ⓕ{I}V.T] L & L ≛[h, o, T] L2.
+lemma rpx_flat_dx_split: ∀h,G,L1,L2,T. ⦃G,L1⦄ ⊢ ⬈[h,T] L2 → ∀I,V.
+ ∃∃L. ⦃G,L1⦄ ⊢ ⬈[h,ⓕ{I}V.T] L & L ≛[T] L2.
/3 width=5 by rpx_fsge_comp, rex_flat_dx_split/ qed-.
-lemma rpx_bind_dx_split: ∀h,I,G,L1,L2,V1,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ⬈[h, T] L2 → ∀o,p.
- ∃∃L,V. ⦃G, L1⦄ ⊢ ⬈[h, ⓑ{p,I}V1.T] L & L.ⓑ{I}V ≛[h, o, T] L2 & ⦃G, L1⦄ ⊢ V1 ⬈[h] V.
+lemma rpx_bind_dx_split: ∀h,I,G,L1,L2,V1,T. ⦃G,L1.ⓑ{I}V1⦄ ⊢ ⬈[h,T] L2 → ∀p.
+ ∃∃L,V. ⦃G,L1⦄ ⊢ ⬈[h,ⓑ{p,I}V1.T] L & L.ⓑ{I}V ≛[T] L2 & ⦃G,L1⦄ ⊢ V1 ⬈[h] V.
/3 width=5 by rpx_fsge_comp, rex_bind_dx_split/ qed-.
-lemma rpx_bind_dx_split_void: ∀h,G,K1,L2,T. ⦃G, K1.ⓧ⦄ ⊢ ⬈[h, T] L2 → ∀o,p,I,V.
- ∃∃K2. ⦃G, K1⦄ ⊢ ⬈[h, ⓑ{p,I}V.T] K2 & K2.ⓧ ≛[h, o, T] L2.
+lemma rpx_bind_dx_split_void: ∀h,G,K1,L2,T. ⦃G,K1.ⓧ⦄ ⊢ ⬈[h,T] L2 → ∀p,I,V.
+ ∃∃K2. ⦃G,K1⦄ ⊢ ⬈[h,ⓑ{p,I}V.T] K2 & K2.ⓧ ≛[T] L2.
/3 width=5 by rpx_fsge_comp, rex_bind_dx_split_void/ qed-.
-lemma rpx_tdeq_conf: ∀h,o,G. s_r_confluent1 … (cdeq h o) (rpx h G).
+lemma rpx_tdeq_conf: ∀h,G. s_r_confluent1 … cdeq (rpx h G).
/2 width=5 by tdeq_rex_conf/ qed-.
-lemma rpx_tdeq_div: ∀h,o,T1,T2. T1 ≛[h, o] T2 →
- ∀G,L1,L2. ⦃G, L1⦄ ⊢ ⬈[h, T2] L2 → ⦃G, L1⦄ ⊢ ⬈[h, T1] L2.
+lemma rpx_tdeq_div: ∀h,T1,T2. T1 ≛ T2 →
+ ∀G,L1,L2. ⦃G,L1⦄ ⊢ ⬈[h,T2] L2 → ⦃G,L1⦄ ⊢ ⬈[h,T1] L2.
/2 width=5 by tdeq_rex_div/ qed-.
-lemma cpx_tdeq_conf_sex: ∀h,o,G. R_confluent2_rex … (cpx h G) (cdeq h o) (cpx h G) (cdeq h o).
-#h #o #G #L0 #T0 #T1 #H @(cpx_ind … H) -G -L0 -T0 -T1 /2 width=3 by ex2_intro/
+lemma cpx_tdeq_conf_rex: ∀h,G. R_confluent2_rex … (cpx h G) cdeq (cpx h G) cdeq.
+#h #G #L0 #T0 #T1 #H @(cpx_ind … H) -G -L0 -T0 -T1 /2 width=3 by ex2_intro/
[ #G #L0 #s0 #X0 #H0 #L1 #HL01 #L2 #HL02
- elim (tdeq_inv_sort1 … H0) -H0 #s1 #d1 #Hs0 #Hs1 #H destruct
- /4 width=3 by tdeq_sort, deg_next, ex2_intro/
+ elim (tdeq_inv_sort1 … H0) -H0 #s1 #H destruct
+ /3 width=3 by tdeq_sort, ex2_intro/
| #I #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #T2 #H0 #L1 #H1 #L2 #H2
>(tdeq_inv_lref1 … H0) -H0
elim (rpx_inv_zero_pair_sn … H1) -H1 #K1 #X1 #HK01 #HX1 #H destruct
]
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-.
(* 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.
<table name="basic_2_sum"/>
<subsection name="B">Stage "B"</subsection>
+ <news class="beta" date="2019 September 3.">
+ Applicability condition is now parametrized
+ with a generic subset of numbers.
+ </news>
+ <news class="beta" date="2019 June 2.">
+ Applicability condition parametrized
+ with an initial interval of numbers
+ allows λδ-2B to generalize both λδ-2A and λδ-1B.
+ </news>
+ <news class="beta" date="2019 April 16.">
+ Extended (λδ-2A) and restricted (λδ-1B) validity is decidable
+ (anniversary milestone).
+ </news>
+ <news class="beta" date="2019 March 25.">
+ Preservation of validity for rt-computation
+ does not need the sort degree parameter
+ (i.e. no induction on the degree).
+ </news>
<news class="beta" date="2018 November 1.">
- Extended (λδ-2) and restricted (λδ-1) type rules justified.
+ Extended (λδ-2A) and restricted (λδ-1A) type rules justified.
</news>
<news class="alpha" date="2018 September 21.">
λδ-2A completed with
class "wine"
[ { "iterated dynamic typing" * } {
[ { "context-sensitive iterated native type assignment" * } {
- [ [ "for terms" ] "ntas" + "( ⦃?,?⦄ ⊢ ? :[?,?,?] ? )" + "( ⦃?,?⦄ ⊢ ? :[?,?] ? )" + "( ⦃?,?⦄ ⊢ ? :*[?,?] ? )" * ]
+ [ [ "for terms" ] "ntas" + "( ⦃?,?⦄ ⊢ ? :*[?,?,?] ? )" "ntas_nta" + "ntas_preserve" * ]
}
]
}
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" * ]
}
]
}
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" * ]
}
]
}
[ { "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" * } {
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" * } {
]
[ [ "" ] "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" * ]
[ [ "" ] "cpxe ( ⦃?,?⦄ ⊢ ➡*[?,?] 𝐍⦃?⦄ )" * ]
}
]
- [ { "evaluation for context-sensitive reduction" * } {
- [ [ "" ] "cpre ( ⦃?,?⦄ ⊢ ➡* 𝐍⦃?⦄ )" "cpre_cpre" * ]
- }
- ]
[ { "normal forms for context-sensitive rt-reduction" * } {
[ [ "" ] "cnx_crx" + "cnx_cix" * ]
}
}
]
[ { "normal forms for context-sensitive reduction" * } {
- [ [ "" ] "cnr ( ⦃?,?⦄ ⊢ ➡ 𝐍⦃?⦄ )" "cnr_lift" + "cnr_crr" + "cnr_cir" * ]
+ "cnr_crr" + "cnr_cir"
}
]
[ { "irreducible forms for context-sensitive reduction" * } {
-../../matitac.opt `cat partial.txt`
+../../matitac.opt ground_2
+../../matitac.opt static_2
+../../matitac.opt basic_2
+../../matitac.opt apps_2
#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 [|*: // ] <minus_Sn_n //
+qed-.
lemma minus_plus_m_m_commutative: ∀n,m:nat. n = m + n - m.
// qed-.
+lemma plus_minus_m_m_commutative (n) (m): m ≤ n → n = m+(n-m).
+/2 width=1 by plus_minus_associative/ qed-.
+
lemma plus_to_minus_2: ∀m1,m2,n1,n2. n1 ≤ m1 → n2 ≤ m2 →
m1+n2 = m2+n1 → m1-n1 = m2-n2.
#m1 #m2 #n1 #n2 #H1 #H2 #H
lemma le_plus_to_minus_comm: ∀n,m,p. n ≤ p+m → n-p ≤ m.
/2 width=1 by le_plus_to_minus/ qed-.
+lemma le_inv_S1: ∀m,n. ↑m ≤ n → ∃∃p. m ≤ p & ↑p = n.
+#m *
+[ #H lapply (le_n_O_to_eq … H) -H
+ #H destruct
+| /3 width=3 by monotonic_pred, ex2_intro/
+]
+qed-.
+
(* Note: this might interfere with nat.ma *)
lemma monotonic_lt_pred: ∀m,n. m < n → 0 < m → pred m < pred n.
#m #n #Hmn #Hm whd >(S_pred … Hm)
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-.
| #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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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 ****************************************************************)
(* 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/
(* 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
(* 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 }.
(* 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 }.
(* 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 }.
(* 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 }.
(* 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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) }.
+
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)"
(* 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 ***************************************************)
#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
(**************************************************************************)
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 ******************************************************)
'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/
]
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)
(* 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)
]
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
]
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
]
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/
(* 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 * //
]
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
(* 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/
]
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
]
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 //
]
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 //
]
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-.
(* 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
<tls_xn /2 width=1 by/
qed.
-lemma at_tls: ∀i2,f. ⫯⫱*[↑i2]f ≡ ⫱*[i2]f → ∃i1. @⦃i1, f⦄ ≘ i2.
+lemma at_tls: ∀i2,f. ⫯⫱*[↑i2]f ≡ ⫱*[i2]f → ∃i1. @⦃i1,f⦄ ≘ i2.
#i2 elim i2 -i2
[ /4 width=4 by at_eq_repl_back, at_refl, ex_intro/
| #i2 #IH #f <tls_xn <tls_xn in ⊢ (??%→?); #H
(* Inversion lemmas with tls ************************************************)
-lemma at_inv_nxx: ∀n,g,i1,j2. @⦃↑i1, g⦄ ≘ j2 → @⦃0, g⦄ ≘ n →
- ∃∃i2. @⦃i1, ⫱*[↑n]g⦄ ≘ i2 & ↑(n+i2) = j2.
+lemma at_inv_nxx: ∀n,g,i1,j2. @⦃↑i1,g⦄ ≘ j2 → @⦃0,g⦄ ≘ n →
+ ∃∃i2. @⦃i1,⫱*[↑n]g⦄ ≘ i2 & ↑(n+i2) = j2.
#n elim n -n
[ #g #i1 #j2 #Hg #H
elim (at_inv_pxp … H) -H [ |*: // ] #f #H0
]
qed-.
-lemma at_inv_tls: ∀i2,i1,f. @⦃i1, f⦄ ≘ i2 → ⫯⫱*[↑i2]f ≡ ⫱*[i2]f.
+lemma at_inv_tls: ∀i2,i1,f. @⦃i1,f⦄ ≘ i2 → ⫯⫱*[↑i2]f ≡ ⫱*[i2]f.
#i2 elim i2 -i2
[ #i1 #f #Hf elim (at_inv_xxp … Hf) -Hf // #g #H1 #H destruct
/2 width=1 by eq_refl/
(* Advanced inversion lemmas on isid ****************************************)
-lemma isid_inv_at: ∀i,f. 𝐈⦃f⦄ → @⦃i, f⦄ ≘ i.
+lemma isid_inv_at: ∀i,f. 𝐈⦃f⦄ → @⦃i,f⦄ ≘ i.
#i elim i -i
[ #f #H elim (isid_inv_gen … H) -H /2 width=2 by at_refl/
| #i #IH #f #H elim (isid_inv_gen … H) -H /3 width=7 by at_push/
]
qed.
-lemma isid_inv_at_mono: ∀f,i1,i2. 𝐈⦃f⦄ → @⦃i1, f⦄ ≘ i2 → i1 = i2.
+lemma isid_inv_at_mono: ∀f,i1,i2. 𝐈⦃f⦄ → @⦃i1,f⦄ ≘ i2 → i1 = i2.
/3 width=6 by isid_inv_at, at_mono/ qed-.
(* Advanced properties on isid **********************************************)
-corec lemma isid_at: ∀f. (∀i. @⦃i, f⦄ ≘ i) → 𝐈⦃f⦄.
+corec lemma isid_at: ∀f. (∀i. @⦃i,f⦄ ≘ i) → 𝐈⦃f⦄.
#f #Hf lapply (Hf 0)
#H cases (at_fwd_id_ex … H) -H
#g #H @(isid_push … H) /3 width=7 by at_inv_npn/
(* Advanced properties on id ************************************************)
-lemma id_inv_at: ∀f. (∀i. @⦃i, f⦄ ≘ i) → 𝐈𝐝 ≡ f.
+lemma id_inv_at: ∀f. (∀i. @⦃i,f⦄ ≘ i) → 𝐈𝐝 ≡ f.
/3 width=1 by isid_at, eq_id_inv_isid/ qed-.
-lemma id_at: ∀i. @⦃i, 𝐈𝐝⦄ ≘ i.
+lemma id_at: ∀i. @⦃i,𝐈𝐝⦄ ≘ i.
/2 width=1 by isid_inv_at/ qed.
(* Advanced forward lemmas on id ********************************************)
-lemma at_id_fwd: ∀i1,i2. @⦃i1, 𝐈𝐝⦄ ≘ i2 → i1 = i2.
+lemma at_id_fwd: ∀i1,i2. @⦃i1,𝐈𝐝⦄ ≘ i2 → i1 = i2.
/2 width=4 by at_mono/ qed.
(* Main properties on id ****************************************************)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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_after.ma".
+include "ground_2/relocation/rtmap_basic.ma".
+
+(* RELOCATION MAP ***********************************************************)
+
+(* Properties with composition **********************************************)
+
+lemma after_basic_rc (m2,m1,n2,n1):
+ m1 ≤ m2 → m2 ≤ m1+n1 → 𝐁❴m2,n2❵ ⊚ 𝐁❴m1,n1❵ ≘ 𝐁❴m1,n2+n1❵.
+#m2 elim m2 -m2
+[ #m1 #n2 #n1 #Hm21 #_
+ <(le_n_O_to_eq … Hm21) -m1 //
+| #m2 #IH *
+ [ #n2 #n1 #_ < plus_O_n #H
+ elim (le_inv_S1 … H) -H #x #Hx #H destruct
+ <plus_n_Sm
+ @after_push [4:|*: // ]
+ @(IH 0 … Hx) -IH -n2 -x //
+ | #m1 #n2 #n1 #H1 #H2
+ lapply (le_S_S_to_le … H1) -H1 #H1
+ lapply (le_S_S_to_le … H2) -H2 #H2
+ /3 width=7 by after_refl/
+ ]
+]
+qed.
(* RELOCATION MAP ***********************************************************)
-definition istot: predicate rtmap ≝ λf. ∀i. ∃j. @⦃i, f⦄ ≘ j.
+definition istot: predicate rtmap ≝ λf. ∀i. ∃j. @⦃i,f⦄ ≘ j.
interpretation "test for totality (rtmap)"
'IsTotal f = (istot f).
(* Main forward lemmas on at ************************************************)
corec theorem at_ext: ∀f1,f2. 𝐓⦃f1⦄ → 𝐓⦃f2⦄ →
- (∀i,i1,i2. @⦃i, f1⦄ ≘ i1 → @⦃i, f2⦄ ≘ i2 → i1 = i2) →
+ (∀i,i1,i2. @⦃i,f1⦄ ≘ i1 → @⦃i,f2⦄ ≘ i2 → i1 = i2) →
f1 ≡ f2.
#f1 cases (pn_split f1) * #g1 #H1
#f2 cases (pn_split f2) * #g2 #H2
(* Advanced properties on at ************************************************)
-lemma at_dec: ∀f,i1,i2. 𝐓⦃f⦄ → Decidable (@⦃i1, f⦄ ≘ i2).
+lemma at_dec: ∀f,i1,i2. 𝐓⦃f⦄ → Decidable (@⦃i1,f⦄ ≘ i2).
#f #i1 #i2 #Hf lapply (Hf i1) -Hf *
#j2 #Hf elim (eq_nat_dec i2 j2)
[ #H destruct /2 width=1 by or_introl/
]
qed-.
-lemma is_at_dec_le: ∀f,i2,i. 𝐓⦃f⦄ → (∀i1. i1 + i ≤ i2 → @⦃i1, f⦄ ≘ i2 → ⊥) →
- Decidable (∃i1. @⦃i1, f⦄ ≘ i2).
+lemma is_at_dec_le: ∀f,i2,i. 𝐓⦃f⦄ → (∀i1. i1 + i ≤ i2 → @⦃i1,f⦄ ≘ i2 → ⊥) →
+ Decidable (∃i1. @⦃i1,f⦄ ≘ i2).
#f #i2 #i #Hf elim i -i
[ #Ht @or_intror * /3 width=3 by at_increasing/
| #i #IH #Ht elim (at_dec f (i2-i) i2) /3 width=2 by ex_intro, or_introl/
]
qed-.
-lemma is_at_dec: ∀f,i2. 𝐓⦃f⦄ → Decidable (∃i1. @⦃i1, f⦄ ≘ i2).
+lemma is_at_dec: ∀f,i2. 𝐓⦃f⦄ → Decidable (∃i1. @⦃i1,f⦄ ≘ i2).
#f #i2 #Hf @(is_at_dec_le ?? (↑i2)) /2 width=4 by lt_le_false/
qed-.
(* Advanced properties on isid **********************************************)
-lemma isid_at_total: ∀f. 𝐓⦃f⦄ → (∀i1,i2. @⦃i1, f⦄ ≘ i2 → i1 = i2) → 𝐈⦃f⦄.
+lemma isid_at_total: ∀f. 𝐓⦃f⦄ → (∀i1,i2. @⦃i1,f⦄ ≘ i2 → i1 = i2) → 𝐈⦃f⦄.
#f #H1f #H2f @isid_at
#i lapply (H1f i) -H1f *
#j #Hf >(H2f … Hf) in ⊢ (???%); -H2f //
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 *********************************************************)
(* 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-.
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〉
]
].
(* 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.
(* 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
(* 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
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〉
]
].
(**) (* 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.
(* 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
(* 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.
(* 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 <shift_rew #H destruct
/2 width=7 by ex5_4_intro/
qed-.
(* Properties with test for costrained rt-transition counter ****************)
-lemma isr_shift: ∀c. 𝐑𝐓⦃0, c⦄ → 𝐑𝐓⦃0, ↕*c⦄.
+lemma isr_shift: ∀c. 𝐑𝐓⦃0,c⦄ → 𝐑𝐓⦃0,↕*c⦄.
#c * #ri #rs #H destruct /2 width=3 by ex1_2_intro/
qed.
(* Inversion properties with test for costrained rt-counter *****************)
-lemma isrt_inv_shift: ∀n,c. 𝐑𝐓⦃n, ↕*c⦄ → 𝐑𝐓⦃0, c⦄ ∧ 0 = n.
+lemma isrt_inv_shift: ∀n,c. 𝐑𝐓⦃n,↕*c⦄ → 𝐑𝐓⦃0,c⦄ ∧ 0 = n.
#n #c * #ri #rs #H
elim (shift_inv_dx … H) -H #rt0 #rs0 #ti0 #ts0 #_ #_ #H1 #H2 #H3
elim (max_inv_O3 … H1) -H1 /3 width=3 by ex1_2_intro, conj/
qed-.
-lemma isr_inv_shift: ∀c. 𝐑𝐓⦃0, ↕*c⦄ → 𝐑𝐓⦃0, c⦄.
+lemma isr_inv_shift: ∀c. 𝐑𝐓⦃0,↕*c⦄ → 𝐑𝐓⦃0,c⦄.
#c #H elim (isrt_inv_shift … H) -H //
qed-.
"rtmap_fcla ( 𝐂⦃?⦄ ≘ ? )" "rtmap_isfin ( 𝐅⦃?⦄ )" "rtmap_isuni ( 𝐔⦃?⦄ )" "rtmap_uni ( 𝐔❴?❵ )"
"rtmap_sle ( ? ⊆ ? )" "rtmap_sdj ( ? ∥ ? )" "rtmap_sand ( ? ⋒ ? ≘ ? )" "rtmap_sor ( ? ⋓ ? ≘ ? )"
"rtmap_at ( @⦃?,?⦄ ≘ ? )" "rtmap_istot ( 𝐓⦃?⦄ )" "rtmap_after ( ? ⊚ ? ≘ ? )" "rtmap_coafter ( ? ~⊚ ? ≘ ? )"
- "rtmap_basic ( 𝐁❴?,?❵ )"
+ "rtmap_basic ( 𝐁❴?,?❵ )" "rtmap_basic_after"
* ]
[ "nstream ( ⫯? ) ( ↑? )" "nstream_eq" "" ""
"" "" "nstream_isid" "nstream_id ( 𝐈𝐝 )" ""
"" "" "" ""
"" "" "" "nstream_sor"
"" "nstream_istot ( ?@❴?❵ )" "nstream_after ( ? ∘ ? )" "nstream_coafter ( ? ~∘ ? )"
- "nstream_basic"
+ "nstream_basic" ""
* ]
(*
[ "trace ( ∥?∥ )" "trace_at ( @⦃?,?⦄ ≘ ? )" "trace_after ( ? ⊚ ? ≘ ? )" "trace_isid ( 𝐈⦃?⦄ )" "trace_isun ( 𝐔⦃?⦄ )"
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 *********************)
+
+include "basics/pts.ma".
+
+include "ground_2/notation/xoa/ex_1_4.ma".
+
+(* multiple existental quantifier (1, 4) *)
+
+inductive ex1_4 (A0,A1,A2,A3:Type[0]) (P0:A0→A1→A2→A3→Prop) : Prop ≝
+ | ex1_4_intro: ∀x0,x1,x2,x3. P0 x0 x1 x2 x3 → ex1_4 ? ? ? ? ?
+.
+
+interpretation "multiple existental quantifier (1, 4)" 'Ex4 P0 = (ex1_4 ? ? ? ? P0).
+
include "ground_2/xoa/xoa.ma".
-(* Properties with multiple existental quantifier (5, 1) ********************)
+(* Properties with multiple existental quantifier (4, 1) ********************)
lemma ex4_commute (A0) (P0,P1,P2,P3:A0→Prop):
(∃∃x0. P0 x0 & P1 x0 & P2 x0 & P3 x0) → ∃∃x0. P2 x0 & P3 x0 & P0 x0 & P1 x0.
<key name="objects">ground_2/xoa</key>
<key name="notations">ground_2/notation/xoa</key>
<key name="include">basics/pts.ma</key>
+ <key name="ex">1 4</key>
<key name="ex">5 1</key>
<key name="ex">5 7</key>
<key name="ex">9 3</key>
]
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-.
]
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.
+++ /dev/null
-ground_2
-static_2
-basic_2
-apps_2
#!/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};
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+definition sh_N: sh ≝ mk_sh S ….
+// defined.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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-.
(* 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 *
]
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 *
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/
(* 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/
(* 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-.
(* 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 *******************)
(* 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/
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-.
(* 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/
(* 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-.
(* 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
(* 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 **)
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
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( L. break ⓓ T1 )"
+notation "hvbox( L. ⓓ break T1 )"
left associative with precedence 50
for @{ 'DxAbbr $L $T1 }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( L. break ⓛ T1 )"
+notation "hvbox( L. ⓛ break T1 )"
left associative with precedence 51
for @{ 'DxAbst $L $T1 }.
(* 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 }.
(* 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
(* 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â\8a\90 ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )"
+notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â¬\82 ⦃ 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 }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â\8a\90 [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )"
+notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â¬\82 [ 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 }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â\8a\90⸮ ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )"
+notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â¬\82⸮ ⦃ 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 }.
(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â\8a\90⸮ [ break term 46 b ] ⦃ break term 46 G2, break term 46 L2, break term 46 T2 ⦄ )"
+notation "hvbox( â¦\83 term 46 G1, break term 46 L1, break term 46 T1 â¦\84 â¬\82⸮ [ 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 }.
(* 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 }.
(* 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 }.
(* 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 }.
(* 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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 }.
'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
]
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-.
(* 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/
(* 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 //
(* 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)
(* 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)
(* 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
]
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/
(* 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/
(* 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/
(* 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/
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
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 *
]
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
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-.
(* 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
(* 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/
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
]
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: // ]
⬇*[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
(* 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
(* 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
(* 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/
(* 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
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-.
(* 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
(* 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/
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/
(* 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 <HL12 -L2 #H lapply (discr_plus_x_xy … H) -H
/2 width=3 by fcla_inv_xp/
qed-.
(* Basic_2A1: includes: drop_fwd_length_eq2 *)
-theorem drops_fwd_length_eq2: ∀f,L1,L2,K1,K2. ⬇*[Ⓣ, f] L1 ≘ K1 → ⬇*[Ⓣ, f] L2 ≘ K2 →
+theorem drops_fwd_length_eq2: ∀f,L1,L2,K1,K2. ⬇*[Ⓣ,f] L1 ≘ K1 → ⬇*[Ⓣ,f] L2 ≘ K2 →
|K1| = |K2| → |L1| = |L2|.
#f #L1 #L2 #K1 #K2 #HLK1 #HLK2 #HL12
elim (drops_fwd_fcla … HLK1) -HLK1 #n1 #Hn1 #H1 >H1 -L1
<(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
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
(* 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 ****************************************)
(* 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
(* 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
(* 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
(* 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/
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
]
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/
/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
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
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
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 //
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 **********************)
(* 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
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/
(* 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-.
(* 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).
*)
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 →
λ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.
/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/
(* 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.
/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/
(* 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.
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)
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)
(* 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/
]
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).
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
(* 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
]
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
]
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
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
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 →
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
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)
]
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
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)
]
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-.
(* 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 //
(* 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/
]
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-.
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 //
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: // ]
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) * ]
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) * ]
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
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
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
(* 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
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
∀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
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
/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
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
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/
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.
(* 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
(* 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.
(* 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-.
(* 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-.
(* Advanced properties ******************************************************)
lemma fqup_zeta (b) (p) (I) (G) (K) (V):
- â\88\80T1,T2. â¬\86*[1]T2 â\89\98 T1 â\86\92 â¦\83G,K,â\93\91{p,I}V.T1â¦\84 â\8a\90+[b] ⦃G,K,T2⦄.
-/4 width=5 by fqup_strap2, fqu_fqup, fqu_drop/ qed.
+ â\88\80T1,T2. â¬\86*[1]T2 â\89\98 T1 â\86\92 â¦\83G,K,â\93\91{p,I}V.T1â¦\84 â¬\82+[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 *)
(* 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 //
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 //
]
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.
(* 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-.
(* 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
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
(* 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-.
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⦄
- | â¦\83G1, L1.â\93\91{I}V1, T1â¦\84 â\8a\90*[b] â¦\83G2, L2, T2â¦\84
- | â¦\83G1, L1.â\93§, T1â¦\84 â\8a\90*[b] â¦\83G2, L2, T2â¦\84 â\88§ 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⦄
+ | â\88§â\88§ â¦\83G1,L1.â\93\91{I}V1,T1â¦\84 â¬\82*[b] â¦\83G2,L2,T2â¦\84 & b = â\93\89
+ | â\88§â\88§ â¦\83G1,L1.â\93§,T1â¦\84 â¬\82*[b] â¦\83G2,L2,T2â¦\84 & 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
(* 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/
(* 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.
(* 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/
(* 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-.
(* 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
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
(* 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
]
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
]
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
]
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
#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.
(* 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/
(* 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-.
(* 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)
]
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-.
(* 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/
(* 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/
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:
(* 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/
(* 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-.
(* 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
]
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
]
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
]
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
]
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
]
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
]
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
]
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
]
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-.
(* 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
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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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/
(* 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
]
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
(* 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
(* 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-.
(* 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/
| 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/
]
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-.
(* 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
(* *)
(**************************************************************************)
-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-.
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.
- â¦\83G, L, Tâ¦\84 â\89\9b[h, o] â¦\83G1, L1, T1â¦\84â\86\92 â¦\83G, L, Tâ¦\84 â\89\9b[h, o] â¦\83G2, L2, T2â¦\84 â\86\92 â¦\83G1, L1, T1â¦\84 â\89\9b[h, o] â¦\83G2, L2, T2⦄.
+theorem fdeq_canc_sn: ∀G,G1,L,L1,T,T1. ⦃G,L,T⦄ ≛ ⦃G1,L1,T1⦄→
+ â\88\80G2,L2,T2. â¦\83G,L,Tâ¦\84 â\89\9b â¦\83G2,L2,T2â¦\84 â\86\92 â¦\83G1,L1,T1â¦\84 â\89\9b â¦\83G2,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.
- â¦\83G1, L1, T1â¦\84 â\89\9b[h, o] â¦\83G, L, Tâ¦\84 â\86\92 â¦\83G2, L2, T2â¦\84 â\89\9b[h, o] â¦\83G, L, Tâ¦\84 â\86\92 â¦\83G1, L1, T1â¦\84 â\89\9b[h, o] â¦\83G2, L2, T2⦄.
+theorem fdeq_canc_dx: ∀G1,G,L1,L,T1,T. ⦃G1,L1,T1⦄ ≛ ⦃G,L,T⦄ →
+ â\88\80G2,L2,T2. â¦\83G2,L2,T2â¦\84 â\89\9b â¦\83G,L,Tâ¦\84 â\86\92 â¦\83G1,L1,T1â¦\84 â\89\9b â¦\83G2,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/
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.
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
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-.
(**************************************************************************)
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 *****************************************)
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
]
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/
]
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
]
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
]
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
]
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
]
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
]
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
]
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
]
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/
(* 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-.
(* 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/
(* 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
]
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-.
(* 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
]
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
]
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
]
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/
*)
(* 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
(* 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
]
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 <H1 -f1 #Hf1
(* Advanced properties ******************************************************)
(* Note: this replaces lemma 1400 concluding the "big tree" theorem *)
-lemma frees_total: ∀L,T. ∃f. L ⊢ 𝐅*⦃T⦄ ≘ f.
+lemma frees_total: ∀L,T. ∃f. L ⊢ 𝐅+⦃T⦄ ≘ f.
#L #T @(fqup_wf_ind_eq (Ⓣ) … (⋆) L T) -L -T
#G0 #L0 #T0 #IH #G #L * *
[ /3 width=2 by frees_sort, ex_intro/
(* Advanced main properties *************************************************)
-theorem frees_bind_void: ∀f1,L,V. L ⊢ 𝐅*⦃V⦄ ≘ f1 → ∀f2,T. L.ⓧ ⊢ 𝐅*⦃T⦄ ≘ f2 →
- ∀f. f1 ⋓ ⫱f2 ≘ f → ∀p,I. L ⊢ 𝐅*⦃ⓑ{p,I}V.T⦄ ≘ f.
+theorem frees_bind_void:
+ ∀f1,L,V. L ⊢ 𝐅+⦃V⦄ ≘ f1 → ∀f2,T. L.ⓧ ⊢ 𝐅+⦃T⦄ ≘ f2 →
+ ∀f. f1 ⋓ ⫱f2 ≘ f → ∀p,I. L ⊢ 𝐅+⦃ⓑ{p,I}V.T⦄ ≘ f.
#f1 #L #V #Hf1 #f2 #T #Hf2 #f #Hf #p #I
elim (frees_total (L.ⓑ{I}V) T) #f0 #Hf0
lapply (lsubr_lsubf … Hf2 … Hf0) -Hf2 /2 width=5 by lsubr_unit/ #H02
(* Advanced inversion lemmas ************************************************)
-lemma frees_inv_bind_void: ∀f,p,I,L,V,T. L ⊢ 𝐅*⦃ⓑ{p,I}V.T⦄ ≘ f →
- ∃∃f1,f2. L ⊢ 𝐅*⦃V⦄ ≘ f1 & L.ⓧ ⊢ 𝐅*⦃T⦄ ≘ f2 & f1 ⋓ ⫱f2 ≘ f.
+lemma frees_inv_bind_void:
+ ∀f,p,I,L,V,T. L ⊢ 𝐅+⦃ⓑ{p,I}V.T⦄ ≘ f →
+ ∃∃f1,f2. L ⊢ 𝐅+⦃V⦄ ≘ f1 & L.ⓧ ⊢ 𝐅+⦃T⦄ ≘ f2 & f1 ⋓ ⫱f2 ≘ f.
#f #p #I #L #V #T #H
elim (frees_inv_bind … H) -H #f1 #f2 #Hf1 #Hf2 #Hf
elim (frees_total (L.ⓧ) T) #f0 #Hf0
]
qed-.
-lemma frees_ind_void: ∀Q:relation3 ….
- (
- ∀f,L,s. 𝐈⦃f⦄ → Q L (⋆s) f
- ) → (
- ∀f,i. 𝐈⦃f⦄ → Q (⋆) (#i) (⫯*[i]↑f)
- ) → (
- ∀f,I,L,V.
- L ⊢ 𝐅*⦃V⦄ ≘ f → Q L V f→ Q (L.ⓑ{I}V) (#O) (↑f)
- ) → (
- ∀f,I,L. 𝐈⦃f⦄ → Q (L.ⓤ{I}) (#O) (↑f)
- ) → (
- ∀f,I,L,i.
- L ⊢ 𝐅*⦃#i⦄ ≘ f → Q L (#i) f → Q (L.ⓘ{I}) (#(↑i)) (⫯f)
- ) → (
- ∀f,L,l. 𝐈⦃f⦄ → Q L (§l) f
- ) → (
- ∀f1,f2,f,p,I,L,V,T.
- L ⊢ 𝐅*⦃V⦄ ≘ f1 → L.ⓧ ⊢𝐅*⦃T⦄≘ f2 → f1 ⋓ ⫱f2 ≘ f →
- Q L V f1 → Q (L.ⓧ) T f2 → Q L (ⓑ{p,I}V.T) f
- ) → (
- ∀f1,f2,f,I,L,V,T.
- L ⊢ 𝐅*⦃V⦄ ≘ f1 → L ⊢𝐅*⦃T⦄ ≘ f2 → f1 ⋓ f2 ≘ f →
- Q L V f1 → Q L T f2 → Q L (ⓕ{I}V.T) f
- ) →
- ∀L,T,f. L ⊢ 𝐅*⦃T⦄ ≘ f → Q L T f.
+lemma frees_ind_void (Q:relation3 …):
+ (
+ ∀f,L,s. 𝐈⦃f⦄ → Q L (⋆s) f
+ ) → (
+ ∀f,i. 𝐈⦃f⦄ → Q (⋆) (#i) (⫯*[i]↑f)
+ ) → (
+ ∀f,I,L,V.
+ L ⊢ 𝐅+⦃V⦄ ≘ f → Q L V f→ Q (L.ⓑ{I}V) (#O) (↑f)
+ ) → (
+ ∀f,I,L. 𝐈⦃f⦄ → Q (L.ⓤ{I}) (#O) (↑f)
+ ) → (
+ ∀f,I,L,i.
+ L ⊢ 𝐅+⦃#i⦄ ≘ f → Q L (#i) f → Q (L.ⓘ{I}) (#(↑i)) (⫯f)
+ ) → (
+ ∀f,L,l. 𝐈⦃f⦄ → Q L (§l) f
+ ) → (
+ ∀f1,f2,f,p,I,L,V,T.
+ L ⊢ 𝐅+⦃V⦄ ≘ f1 → L.ⓧ ⊢𝐅+⦃T⦄≘ f2 → f1 ⋓ ⫱f2 ≘ f →
+ Q L V f1 → Q (L.ⓧ) T f2 → Q L (ⓑ{p,I}V.T) f
+ ) → (
+ ∀f1,f2,f,I,L,V,T.
+ L ⊢ 𝐅+⦃V⦄ ≘ f1 → L ⊢𝐅+⦃T⦄ ≘ f2 → f1 ⋓ f2 ≘ f →
+ Q L V f1 → Q L T f2 → Q L (ⓕ{I}V.T) f
+ ) →
+ ∀L,T,f. L ⊢ 𝐅+⦃T⦄ ≘ f → Q L T f.
#Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #L #T
@(fqup_wf_ind_eq (Ⓕ) … (⋆) L T) -L -T #G0 #L0 #T0 #IH #G #L * *
[ #s #HG #HL #HT #f #H destruct -IH
(* Main inversion lemmas ****************************************************)
-theorem frees_mono: ∀f1,L,T. L ⊢ 𝐅*⦃T⦄ ≘ f1 → ∀f2. L ⊢ 𝐅*⦃T⦄ ≘ f2 → f1 ≡ f2.
+theorem frees_mono: ∀f1,L,T. L ⊢ 𝐅+⦃T⦄ ≘ f1 → ∀f2. L ⊢ 𝐅+⦃T⦄ ≘ f2 → f1 ≡ f2.
#f1 #L #T #H elim H -f1 -L -T
[ /3 width=3 by frees_inv_sort, isid_inv_eq_repl/
| #f1 #i #Hf1 #g2 #H
(* FREE VARIABLES INCLUSION FOR RESTRICTED CLOSURES *************************)
definition fsle: bi_relation lenv term ≝ λL1,T1,L2,T2.
- ∃∃n1,n2,f1,f2. L1 ⊢ 𝐅*⦃T1⦄ ≘ f1 & L2 ⊢ 𝐅*⦃T2⦄ ≘ f2 &
- L1 ≋ⓧ*[n1, n2] L2 & ⫱*[n1]f1 ⊆ ⫱*[n2]f2.
+ ∃∃n1,n2,f1,f2. L1 ⊢ 𝐅+⦃T1⦄ ≘ f1 & L2 ⊢ 𝐅+⦃T2⦄ ≘ f2 &
+ L1 ≋ⓧ*[n1,n2] L2 & ⫱*[n1]f1 ⊆ ⫱*[n2]f2.
interpretation "free variables inclusion (restricted closure)"
'SubSetEq L1 T1 L2 T2 = (fsle L1 T1 L2 T2).
(* Basic properties *********************************************************)
-lemma fsle_sort: ∀L,s1,s2. ⦃L, ⋆s1⦄ ⊆ ⦃L, ⋆s2⦄.
+lemma fsle_sort: ∀L,s1,s2. ⦃L,⋆s1⦄ ⊆ ⦃L,⋆s2⦄.
/3 width=8 by frees_sort, sle_refl, ex4_4_intro/ qed.
-lemma fsle_gref: ∀L,l1,l2. ⦃L, §l1⦄ ⊆ ⦃L, §l2⦄.
+lemma fsle_gref: ∀L,l1,l2. ⦃L,§l1⦄ ⊆ ⦃L,§l2⦄.
/3 width=8 by frees_gref, sle_refl, ex4_4_intro/ qed.
(* Advanced properties ******************************************************)
lemma fsle_lifts_sn: ∀T1,U1. ⬆*[1] T1 ≘ U1 → ∀L1,L2. |L2| ≤ |L1| →
- ∀T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ → ⦃L1.ⓧ, U1⦄ ⊆ ⦃L2, T2⦄.
+ ∀T2. ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄ → ⦃L1.ⓧ,U1⦄ ⊆ ⦃L2,T2⦄.
#T1 #U1 #HTU1 #L1 #L2 #H1L #T2
* #n #m #f #g #Hf #Hg #H2L #Hfg
lapply (lveq_length_fwd_dx … H2L ?) // -H1L #H destruct
@(ex4_4_intro … Hf Hg) /2 width=4 by lveq_void_dx/ (**) (* explict constructor *)
qed-.
-lemma fsle_lifts_SO_sn: ∀K1,K2. |K1| = |K2| → ∀V1,V2. ⦃K1, V1⦄ ⊆ ⦃K2, V2⦄ →
- ∀W1. ⬆*[1] V1 ≘ W1 → ∀I1,I2. ⦃K1.ⓘ{I1}, W1⦄ ⊆ ⦃K2.ⓑ{I2}V2, #O⦄.
+lemma fsle_lifts_SO_sn: ∀K1,K2. |K1| = |K2| → ∀V1,V2. ⦃K1,V1⦄ ⊆ ⦃K2,V2⦄ →
+ ∀W1. ⬆*[1] V1 ≘ W1 → ∀I1,I2. ⦃K1.ⓘ{I1},W1⦄ ⊆ ⦃K2.ⓑ{I2}V2,#O⦄.
#K1 #K2 #HK #V1 #V2
* #n1 #n2 #f1 #f2 #Hf1 #Hf2 #HK12 #Hf12
#W1 #HVW1 #I1 #I2
/5 width=12 by frees_lifts_SO, frees_pair, drops_refl, drops_drop, lveq_bind, sle_weak, ex4_4_intro/
qed.
-lemma fsle_lifts_SO: ∀K1,K2. |K1| = |K2| → ∀T1,T2. ⦃K1, T1⦄ ⊆ ⦃K2, T2⦄ →
+lemma fsle_lifts_SO: ∀K1,K2. |K1| = |K2| → ∀T1,T2. ⦃K1,T1⦄ ⊆ ⦃K2,T2⦄ →
∀U1,U2. ⬆*[1] T1 ≘ U1 → ⬆*[1] T2 ≘ U2 →
- ∀I1,I2. ⦃K1.ⓘ{I1}, U1⦄ ⊆ ⦃K2.ⓘ{I2}, U2⦄.
+ ∀I1,I2. ⦃K1.ⓘ{I1},U1⦄ ⊆ ⦃K2.ⓘ{I2},U2⦄.
#K1 #K2 #HK #T1 #T2
* #n1 #n2 #f1 #f2 #Hf1 #Hf2 #HK12 #Hf12
#U1 #U2 #HTU1 #HTU2 #I1 #I2
(* Advanced inversion lemmas ************************************************)
lemma fsle_inv_lifts_sn: ∀T1,U1. ⬆*[1] T1 ≘ U1 →
- ∀I1,I2,L1,L2,V1,V2,U2. ⦃L1.ⓑ{I1}V1,U1⦄ ⊆ ⦃L2.ⓑ{I2}V2, U2⦄ →
- ∀p. ⦃L1, T1⦄ ⊆ ⦃L2, ⓑ{p,I2}V2.U2⦄.
+ ∀I1,I2,L1,L2,V1,V2,U2. ⦃L1.ⓑ{I1}V1,U1⦄ ⊆ ⦃L2.ⓑ{I2}V2,U2⦄ →
+ ∀p. ⦃L1,T1⦄ ⊆ ⦃L2,ⓑ{p,I2}V2.U2⦄.
#T1 #U1 #HTU1 #I1 #I2 #L1 #L2 #V1 #V2 #U2
* #n #m #f2 #g2 #Hf2 #Hg2 #HL #Hfg2 #p
elim (lveq_inv_pair_pair … HL) -HL #HL #H1 #H2 destruct
qed.
lemma fsle_shift: ∀L1,L2. |L1| = |L2| →
- ∀I,T1,T2,V. ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2.ⓑ{I}V, T2⦄ →
- ∀p. ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2, ⓑ{p,I}V.T2⦄.
+ ∀I,T1,T2,V. ⦃L1.ⓧ,T1⦄ ⊆ ⦃L2.ⓑ{I}V,T2⦄ →
+ ∀p. ⦃L1.ⓧ,T1⦄ ⊆ ⦃L2,ⓑ{p,I}V.T2⦄.
#L1 #L2 #H1L #I #T1 #T2 #V
* #n #m #f2 #g2 #Hf2 #Hg2 #H2L #Hfg2 #p
elim (lveq_inj_length … H2L) // -H1L #H1 #H2 destruct
/4 width=10 by frees_bind, lveq_void_sn, sle_tl, sle_trans, ex4_4_intro/
qed.
-lemma fsle_bind_dx_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
- ∀p,I,T2. ⦃L1, V1⦄ ⊆ ⦃L2, ⓑ{p,I}V2.T2⦄.
+lemma fsle_bind_dx_sn: ∀L1,L2,V1,V2. ⦃L1,V1⦄ ⊆ ⦃L2,V2⦄ →
+ ∀p,I,T2. ⦃L1,V1⦄ ⊆ ⦃L2,ⓑ{p,I}V2.T2⦄.
#L1 #L2 #V1 #V2 * #n1 #m1 #f1 #g1 #Hf1 #Hg1 #HL12 #Hfg1 #p #I #T2
elim (frees_total (L2.ⓧ) T2) #g2 #Hg2
elim (sor_isfin_ex g1 (⫱g2)) /3 width=3 by frees_fwd_isfin, isfin_tl/ #g #Hg #_
/4 width=5 by frees_bind_void, sor_inv_sle_sn, sor_tls, sle_trans/
qed.
-lemma fsle_bind_dx_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2.ⓧ, T2⦄ → |L1| ≤ |L2| →
- ∀p,I,V2. ⦃L1, T1⦄ ⊆ ⦃L2, ⓑ{p,I}V2.T2⦄.
+lemma fsle_bind_dx_dx: ∀L1,L2,T1,T2. ⦃L1,T1⦄ ⊆ ⦃L2.ⓧ,T2⦄ → |L1| ≤ |L2| →
+ ∀p,I,V2. ⦃L1,T1⦄ ⊆ ⦃L2,ⓑ{p,I}V2.T2⦄.
#L1 #L2 #T1 #T2 * #n1 #x1 #f2 #g2 #Hf2 #Hg2 #H #Hfg2 #HL12 #p #I #V2
elim (lveq_inv_void_dx_length … H HL12) -H -HL12 #m1 #HL12 #H1 #H2 destruct
<tls_xn in Hfg2; #Hfg2
/4 width=5 by frees_bind_void, sor_inv_sle_dx, sor_tls, sle_trans/
qed.
-lemma fsle_flat_dx_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
- ∀I,T2. ⦃L1, V1⦄ ⊆ ⦃L2, ⓕ{I}V2.T2⦄.
+lemma fsle_flat_dx_sn: ∀L1,L2,V1,V2. ⦃L1,V1⦄ ⊆ ⦃L2,V2⦄ →
+ ∀I,T2. ⦃L1,V1⦄ ⊆ ⦃L2,ⓕ{I}V2.T2⦄.
#L1 #L2 #V1 #V2 * #n1 #m1 #f1 #g1 #Hf1 #Hg1 #HL12 #Hfg1 #I #T2
elim (frees_total L2 T2) #g2 #Hg2
elim (sor_isfin_ex g1 g2) /2 width=3 by frees_fwd_isfin/ #g #Hg #_
/4 width=5 by frees_flat, sor_inv_sle_sn, sor_tls, sle_trans/
qed.
-lemma fsle_flat_dx_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ →
- ∀I,V2. ⦃L1, T1⦄ ⊆ ⦃L2, ⓕ{I}V2.T2⦄.
+lemma fsle_flat_dx_dx: ∀L1,L2,T1,T2. ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄ →
+ ∀I,V2. ⦃L1,T1⦄ ⊆ ⦃L2,ⓕ{I}V2.T2⦄.
#L1 #L2 #T1 #T2 * #n1 #m1 #f2 #g2 #Hf2 #Hg2 #HL12 #Hfg2 #I #V2
elim (frees_total L2 V2) #g1 #Hg1
elim (sor_isfin_ex g1 g2) /2 width=3 by frees_fwd_isfin/ #g #Hg #_
(* Advanced forward lemmas ***************************************************)
-lemma fsle_fwd_pair_sn: ∀I1,I2,L1,L2,V1,V2,T1,T2. ⦃L1.ⓑ{I1}V1, T1⦄ ⊆ ⦃L2.ⓑ{I2}V2, T2⦄ →
- ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2.ⓑ{I2}V2, T2⦄.
+lemma fsle_fwd_pair_sn: ∀I1,I2,L1,L2,V1,V2,T1,T2. ⦃L1.ⓑ{I1}V1,T1⦄ ⊆ ⦃L2.ⓑ{I2}V2,T2⦄ →
+ ⦃L1.ⓧ,T1⦄ ⊆ ⦃L2.ⓑ{I2}V2,T2⦄.
#I1 #I2 #L1 #L2 #V1 #V2 #T1 #T2 *
#n1 #n2 #f1 #f2 #Hf1 #Hf2 #HL12 #Hf12
elim (lveq_inv_pair_pair … HL12) -HL12 #HL12 #H1 #H2 destruct
(* Advanced inversion lemmas ************************************************)
-lemma fsle_frees_trans: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ →
- ∀f2. L2 ⊢ 𝐅*⦃T2⦄ ≘ f2 →
- ∃∃n1,n2,f1. L1 ⊢ 𝐅*⦃T1⦄ ≘ f1 &
- L1 ≋ⓧ*[n1, n2] L2 & ⫱*[n1]f1 ⊆ ⫱*[n2]f2.
+lemma fsle_frees_trans:
+ ∀L1,L2,T1,T2. ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄ →
+ ∀f2. L2 ⊢ 𝐅+⦃T2⦄ ≘ f2 →
+ ∃∃n1,n2,f1. L1 ⊢ 𝐅+⦃T1⦄ ≘ f1 & L1 ≋ⓧ*[n1,n2] L2 & ⫱*[n1]f1 ⊆ ⫱*[n2]f2.
#L1 #L2 #T1 #T2 * #n1 #n2 #f1 #g2 #Hf1 #Hg2 #HL #Hn #f2 #Hf2
lapply (frees_mono … Hg2 … Hf2) -Hg2 -Hf2 #Hgf2
lapply (tls_eq_repl n2 … Hgf2) -Hgf2 #Hgf2
/2 width=6 by ex3_3_intro/
qed-.
-lemma fsle_frees_trans_eq: ∀L1,L2. |L1| = |L2| →
- ∀T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ → ∀f2. L2 ⊢ 𝐅*⦃T2⦄ ≘ f2 →
- ∃∃f1. L1 ⊢ 𝐅*⦃T1⦄ ≘ f1 & f1 ⊆ f2.
+lemma fsle_frees_trans_eq:
+ ∀L1,L2. |L1| = |L2| →
+ ∀T1,T2. ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄ → ∀f2. L2 ⊢ 𝐅+⦃T2⦄ ≘ f2 →
+ ∃∃f1. L1 ⊢ 𝐅+⦃T1⦄ ≘ f1 & f1 ⊆ f2.
#L1 #L2 #H1L #T1 #T2 #H2L #f2 #Hf2
elim (fsle_frees_trans … H2L … Hf2) -T2 #n1 #n2 #f1 #Hf1 #H2L #Hf12
elim (lveq_inj_length … H2L) // -L2 #H1 #H2 destruct
/2 width=3 by ex2_intro/
qed-.
-lemma fsle_inv_frees_eq: ∀L1,L2. |L1| = |L2| →
- ∀T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ →
- ∀f1. L1 ⊢ 𝐅*⦃T1⦄ ≘ f1 → ∀f2. L2 ⊢ 𝐅*⦃T2⦄ ≘ f2 →
- f1 ⊆ f2.
+lemma fsle_inv_frees_eq:
+ ∀L1,L2. |L1| = |L2| →
+ ∀T1,T2. ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄ →
+ ∀f1. L1 ⊢ 𝐅+⦃T1⦄ ≘ f1 → ∀f2. L2 ⊢ 𝐅+⦃T2⦄ ≘ f2 →
+ f1 ⊆ f2.
#L1 #L2 #H1L #T1 #T2 #H2L #f1 #Hf1 #f2 #Hf2
elim (fsle_frees_trans_eq … H2L … Hf2) // -L2 -T2
/3 width=6 by frees_mono, sle_eq_repl_back1/
(* Main properties **********************************************************)
-theorem fsle_trans_sn: ∀L1,L2,T1,T. ⦃L1, T1⦄ ⊆ ⦃L2, T⦄ →
- ∀T2. ⦃L2, T⦄ ⊆ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄.
+theorem fsle_trans_sn:
+ ∀L1,L2,T1,T. ⦃L1,T1⦄ ⊆ ⦃L2,T⦄ →
+ ∀T2. ⦃L2,T⦄ ⊆ ⦃L2,T2⦄ → ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄.
#L1 #L2 #T1 #T
* #m1 #m0 #g1 #g0 #Hg1 #Hg0 #Hm #Hg
#T2
/4 width=10 by sle_tls, sle_trans, ex4_4_intro/
qed-.
-theorem fsle_trans_dx: ∀L1,T1,T. ⦃L1, T1⦄ ⊆ ⦃L1, T⦄ →
- ∀L2,T2. ⦃L1, T⦄ ⊆ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄.
+theorem fsle_trans_dx:
+ ∀L1,T1,T. ⦃L1,T1⦄ ⊆ ⦃L1,T⦄ →
+ ∀L2,T2. ⦃L1,T⦄ ⊆ ⦃L2,T2⦄ → ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄.
#L1 #T1 #T
* #m1 #m0 #g1 #g0 #Hg1 #Hg0 #Hm #Hg
#L2 #T2
/4 width=10 by sle_tls, sle_trans, ex4_4_intro/
qed-.
-theorem fsle_trans_rc: ∀L1,L,T1,T. |L1| = |L| → ⦃L1, T1⦄ ⊆ ⦃L, T⦄ →
- ∀L2,T2. |L| = |L2| → ⦃L, T⦄ ⊆ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄.
+theorem fsle_trans_rc:
+ ∀L1,L,T1,T. |L1| = |L| → ⦃L1,T1⦄ ⊆ ⦃L,T⦄ →
+ ∀L2,T2. |L| = |L2| → ⦃L,T⦄ ⊆ ⦃L2,T2⦄ → ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄.
#L1 #L #T1 #T #HL1
* #m1 #m0 #g1 #g0 #Hg1 #Hg0 #Hm #Hg
#L2 #T2 #HL2
/3 width=10 by lveq_length_eq, sle_trans, ex4_4_intro/
qed-.
-theorem fsle_bind_sn_ge: ∀L1,L2. |L2| ≤ |L1| →
- ∀V1,T1,T. ⦃L1, V1⦄ ⊆ ⦃L2, T⦄ → ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2, T⦄ →
- ∀p,I. ⦃L1, ⓑ{p,I}V1.T1⦄ ⊆ ⦃L2, T⦄.
+theorem fsle_bind_sn_ge:
+ ∀L1,L2. |L2| ≤ |L1| →
+ ∀V1,T1,T. ⦃L1,V1⦄ ⊆ ⦃L2,T⦄ → ⦃L1.ⓧ,T1⦄ ⊆ ⦃L2,T⦄ →
+ ∀p,I. ⦃L1,ⓑ{p,I}V1.T1⦄ ⊆ ⦃L2,T⦄.
#L1 #L2 #HL #V1 #T1 #T * #n1 #x #f1 #g #Hf1 #Hg #H1n1 #H2n1 #H #p #I
elim (fsle_frees_trans … H … Hg) -H #n2 #n #f2 #Hf2 #H1n2 #H2n2
elim (lveq_inj_void_sn_ge … H1n1 … H1n2) -H1n2 // #H1 #H2 #H3 destruct
/4 width=12 by frees_bind_void, sor_inv_sle, sor_tls, ex4_4_intro/
qed.
-theorem fsle_flat_sn: ∀L1,L2,V1,T1,T. ⦃L1, V1⦄ ⊆ ⦃L2, T⦄ → ⦃L1, T1⦄ ⊆ ⦃L2, T⦄ →
- ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ⊆ ⦃L2, T⦄.
+theorem fsle_flat_sn:
+ ∀L1,L2,V1,T1,T. ⦃L1,V1⦄ ⊆ ⦃L2,T⦄ → ⦃L1,T1⦄ ⊆ ⦃L2,T⦄ →
+ ∀I. ⦃L1,ⓕ{I}V1.T1⦄ ⊆ ⦃L2,T⦄.
#L1 #L2 #V1 #T1 #T * #n1 #x #f1 #g #Hf1 #Hg #H1n1 #H2n1 #H #I
elim (fsle_frees_trans … H … Hg) -H #n2 #n #f2 #Hf2 #H1n2 #H2n2
elim (lveq_inj … H1n1 … H1n2) -H1n2 #H1 #H2 destruct
/4 width=12 by frees_flat, sor_inv_sle, sor_tls, ex4_4_intro/
qed.
-theorem fsle_bind_eq: ∀L1,L2. |L1| = |L2| → ∀V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
- ∀I2,T1,T2. ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2.ⓑ{I2}V2, T2⦄ →
- ∀p,I1. ⦃L1, ⓑ{p,I1}V1.T1⦄ ⊆ ⦃L2, ⓑ{p,I2}V2.T2⦄.
+theorem fsle_bind_eq:
+ ∀L1,L2. |L1| = |L2| → ∀V1,V2. ⦃L1,V1⦄ ⊆ ⦃L2,V2⦄ →
+ ∀I2,T1,T2. ⦃L1.ⓧ,T1⦄ ⊆ ⦃L2.ⓑ{I2}V2,T2⦄ →
+ ∀p,I1. ⦃L1,ⓑ{p,I1}V1.T1⦄ ⊆ ⦃L2,ⓑ{p,I2}V2.T2⦄.
#L1 #L2 #HL #V1 #V2
* #n1 #m1 #f1 #g1 #Hf1 #Hg1 #H1L #Hfg1 #I2 #T1 #T2
* #n2 #m2 #f2 #g2 #Hf2 #Hg2 #H2L #Hfg2 #p #I1
/4 width=15 by frees_bind_void, frees_bind, monotonic_sle_sor, sle_tl, ex4_4_intro/
qed.
-theorem fsle_bind: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
- ∀I1,I2,T1,T2. ⦃L1.ⓑ{I1}V1, T1⦄ ⊆ ⦃L2.ⓑ{I2}V2, T2⦄ →
- ∀p. ⦃L1, ⓑ{p,I1}V1.T1⦄ ⊆ ⦃L2, ⓑ{p,I2}V2.T2⦄.
+theorem fsle_bind:
+ ∀L1,L2,V1,V2. ⦃L1,V1⦄ ⊆ ⦃L2,V2⦄ →
+ ∀I1,I2,T1,T2. ⦃L1.ⓑ{I1}V1,T1⦄ ⊆ ⦃L2.ⓑ{I2}V2,T2⦄ →
+ ∀p. ⦃L1,ⓑ{p,I1}V1.T1⦄ ⊆ ⦃L2,ⓑ{p,I2}V2.T2⦄.
#L1 #L2 #V1 #V2
* #n1 #m1 #f1 #g1 #Hf1 #Hg1 #H1L #Hfg1 #I1 #I2 #T1 #T2
* #n2 #m2 #f2 #g2 #Hf2 #Hg2 #H2L #Hfg2 #p
/4 width=15 by frees_bind, monotonic_sle_sor, sle_tl, ex4_4_intro/
qed.
-theorem fsle_flat: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
- ∀T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ →
- ∀I1,I2. ⦃L1, ⓕ{I1}V1.T1⦄ ⊆ ⦃L2, ⓕ{I2}V2.T2⦄.
+theorem fsle_flat:
+ ∀L1,L2,V1,V2. ⦃L1,V1⦄ ⊆ ⦃L2,V2⦄ →
+ ∀T1,T2. ⦃L1,T1⦄ ⊆ ⦃L2,T2⦄ →
+ ∀I1,I2. ⦃L1,ⓕ{I1}V1.T1⦄ ⊆ ⦃L2,ⓕ{I2}V2.T2⦄.
/3 width=1 by fsle_flat_sn, fsle_flat_dx_dx, fsle_flat_dx_sn/ qed-.
(* Properties with length for local environments ****************************)
-lemma fsle_sort_bi: ∀L1,L2,s1,s2. |L1| = |L2| → ⦃L1, ⋆s1⦄ ⊆ ⦃L2, ⋆s2⦄.
+lemma fsle_sort_bi: ∀L1,L2,s1,s2. |L1| = |L2| → ⦃L1,⋆s1⦄ ⊆ ⦃L2,⋆s2⦄.
/3 width=8 by lveq_length_eq, frees_sort, sle_refl, ex4_4_intro/ qed.
-lemma fsle_gref_bi: ∀L1,L2,l1,l2. |L1| = |L2| → ⦃L1, §l1⦄ ⊆ ⦃L2, §l2⦄.
+lemma fsle_gref_bi: ∀L1,L2,l1,l2. |L1| = |L2| → ⦃L1,§l1⦄ ⊆ ⦃L2,§l2⦄.
/3 width=8 by lveq_length_eq, frees_gref, sle_refl, ex4_4_intro/ qed.
-lemma fsle_pair_bi: ∀K1,K2. |K1| = |K2| → ∀V1,V2. ⦃K1, V1⦄ ⊆ ⦃K2, V2⦄ →
- ∀I1,I2. ⦃K1.ⓑ{I1}V1, #O⦄ ⊆ ⦃K2.ⓑ{I2}V2, #O⦄.
+lemma fsle_pair_bi: ∀K1,K2. |K1| = |K2| → ∀V1,V2. ⦃K1,V1⦄ ⊆ ⦃K2,V2⦄ →
+ ∀I1,I2. ⦃K1.ⓑ{I1}V1,#O⦄ ⊆ ⦃K2.ⓑ{I2}V2,#O⦄.
#K1 #K2 #HK #V1 #V2
* #n1 #n2 #f1 #f2 #Hf1 #Hf2 #HK12 #Hf12
#I1 #I2
qed.
lemma fsle_unit_bi: ∀K1,K2. |K1| = |K2| →
- ∀I1,I2. ⦃K1.ⓤ{I1}, #O⦄ ⊆ ⦃K2.ⓤ{I2}, #O⦄.
+ ∀I1,I2. ⦃K1.ⓤ{I1},#O⦄ ⊆ ⦃K2.ⓤ{I2},#O⦄.
/3 width=8 by frees_unit, lveq_length_eq, sle_refl, ex4_4_intro/
qed.
(* GENERIC COMPUTATION PROPERTIES *******************************************)
-definition nf ≝ λRR:relation4 genv lenv term term. λRS:relation term.
- λG,L,T. NF … (RR G L) RS T.
+definition nf (RR:relation4 genv lenv term term) (RS:relation term) ≝
+ λG,L,T. NF … (RR G L) RS T.
definition candidate: Type[0] ≝ relation3 genv lenv term.
-definition CP0 ≝ λRR:relation4 genv lenv term term. λRS:relation term.
- ∀G. d_liftable1 (nf RR RS G).
+definition CP0 (RR) (RS) ≝ ∀G. d_liftable1 (nf RR RS G).
-definition CP1 ≝ λRR:relation4 genv lenv term term. λRS:relation term.
- ∀G,L. ∃s. NF … (RR G L) RS (⋆s).
+definition CP1 (RR) (RS) ≝ ∀G,L,s. nf RR RS G L (⋆s).
-definition CP2 ≝ λRP:candidate. ∀G. d_liftable1 (RP G).
+definition CP2 (RP:candidate) ≝ ∀G. d_liftable1 (RP G).
-definition CP3 ≝ λRP:candidate.
- ∀G,L,T,s. RP G L (ⓐ⋆s.T) → RP G L T.
+definition CP3 (RP:candidate) ≝ ∀G,L,T,s. RP G L (ⓐ⋆s.T) → RP G L T.
(* requirements for generic computation properties *)
(* Basic_1: includes: nf2_lift1 *)
(* Basic_1: was: sc3_arity_csubc *)
theorem acr_aaa_csubc_lifts: ∀RR,RS,RP.
gcp RR RS RP → gcr RR RS RP RP →
- ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀b,f,L0. ⬇*[b, f] L0 ≘ L1 →
+ ∀G,L1,T,A. ⦃G,L1⦄ ⊢ T ⁝ A → ∀b,f,L0. ⬇*[b,f] L0 ≘ L1 →
∀T0. ⬆*[f] T ≘ T0 → ∀L2. G ⊢ L2 ⫃[RP] L0 →
- ⦃G, L2, T0⦄ ϵ[RP] 〚A〛.
+ ⦃G,L2,T0⦄ ϵ[RP] 〚A〛.
#RR #RS #RP #H1RP #H2RP #G #L1 #T @(fqup_wf_ind_eq (Ⓣ) … G L1 T) -G -L1 -T
#Z #Y #X #IH #G #L1 * [ * | * [ #p ] * ]
[ #s #HG #HL #HT #A #HA #b #f #L0 #HL01 #X0 #H0 #L2 #HL20 destruct -IH
lapply (aaa_inv_sort … HA) -HA #H destruct
>(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
(* 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/
(* 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).
{ 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
(* 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 ≝
(* 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/
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
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
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)
.
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
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-.
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
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-.
(* 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
]
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
(* 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
(* 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
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)
.
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
(* 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-.
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
(* 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-.
(* 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
(* 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/
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)
.
(* 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
]
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
]
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)
]
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)
]
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
]
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
]
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)
]
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)
]
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/
]
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
]
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
]
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
(* 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/
]
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/
]
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-.
/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/
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
(* 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
(* 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
(* 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
(* 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
/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/
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/
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 = ⋆.
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/
]
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-.
(* 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
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
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-.
(* *)
(**************************************************************************)
-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
]
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-.
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-.
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-.
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
]
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/
| 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
(* 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/
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/
]
(* 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
]
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
(* 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/
]
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-.
(* 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-.
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-.
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-.
(* 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
(* 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-.
(* 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-.
(* 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).
(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
]
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
]
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
]
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
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
]
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
]
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
]
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
]
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/
(* 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/
(* 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/
(* 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
/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
(* 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
(* 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
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/
(* 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
(* 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-.
(* 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/
(* 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
/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
/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
/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
(* 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
]
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
(* 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
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
]
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
(* 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-.
(* 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/
(* 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
(* 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)
(* 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/
(* 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-.
]
]
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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
(* 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.
(* 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
(* 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.
(* 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/
]
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
]
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
]
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
]
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
]
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
]
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
(* 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-.
(* 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
(* 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
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
(* 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
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
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 *)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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).
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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)
+}.
(* *)
(**************************************************************************)
-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/
]
(* 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
(* 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-.
(* *)
(**************************************************************************)
-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).
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
]
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-.
(* 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 ]
(* *)
(**************************************************************************)
+include "ground_2/xoa/ex_1_4.ma".
include "static_2/notation/relations/simple_1.ma".
include "static_2/syntax/term.ma".
* /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-.
#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
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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
-*)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM 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-.
]
[ { "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" * } {
]
[ { "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" * } {
class "grass"
[ { "s-computation" * } {
[ { "iterated structural successor" * } {
- [ [ "for closures" ] "fqus" + "( â¦\83?,?,?â¦\84 â\8a\90*[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â\8a\90* ⦃?,?,?⦄ )" "fqus_weight" + "fqus_drops" + "fqus_fqup" + "fqus_fqus" * ]
- [ [ "proper for closures" ] "fqup" + "( â¦\83?,?,?â¦\84 â\8a\90+[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â\8a\90+ ⦃?,?,?⦄ )" "fqup_weight" + "fqup_drops" + "fqup_fqup" * ]
+ [ [ "for closures" ] "fqus" + "( â¦\83?,?,?â¦\84 â¬\82*[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â¬\82* ⦃?,?,?⦄ )" "fqus_weight" + "fqus_drops" + "fqus_fqup" + "fqus_fqus" * ]
+ [ [ "proper for closures" ] "fqup" + "( â¦\83?,?,?â¦\84 â¬\82+[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â¬\82+ ⦃?,?,?⦄ )" "fqup_weight" + "fqup_drops" + "fqup_fqup" * ]
}
]
}
class "yellow"
[ { "s-transition" * } {
[ { "structural successor" * } {
- [ [ "for closures" ] "fquq" + "( â¦\83?,?,?â¦\84 â\8a\90⸮[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â\8a\90⸮ ⦃?,?,?⦄ )" "fquq_length" + "fquq_weight" * ]
- [ [ "proper for closures" ] "fqu" + "( â¦\83?,?,?â¦\84 â\8a\90[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â\8a\90 ⦃?,?,?⦄ )" "fqu_length" + "fqu_weight" + "fqu_tdeq" * ]
+ [ [ "for closures" ] "fquq" + "( â¦\83?,?,?â¦\84 â¬\82⸮[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â¬\82⸮ ⦃?,?,?⦄ )" "fquq_length" + "fquq_weight" * ]
+ [ [ "proper for closures" ] "fqu" + "( â¦\83?,?,?â¦\84 â¬\82[?] â¦\83?,?,?â¦\84 )" + "( â¦\83?,?,?â¦\84 â¬\82 ⦃?,?,?⦄ )" "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" * } {
]
class "red"
[ { "syntax" * } {
+ [ { "applicability condition" * } {
+ [ [ "preorder" ] "acle" + "( ? ⊆ ? )" "acle_acle" * ]
+ [ [ "properties" ] "ac" + "( 𝟏 )" + "( 𝟐 )" + "( 𝛚 )" * ]
+ }
+ ]
[ { "equivalence up to exclusion binders" * } {
[ [ "for lenvs" ] "lveq" + "( ? ≋ⓧ*[?,?] ? )" "lveq_length" + "lveq_lveq" * ]
}
[ [ "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" * } {
}
]
[ { "items" * } {
- [ [ "" ] "item_sd" * ]
- [ [ "" ] "item_sh" * ]
[ [ "" ] "item" * ]
}
]
+ [ { "sorts" * } {
+ [ [ "degree" ] "sd" "sd_d" + "sd_lt" * ]
+ [ [ "hierarchy" ] "sh" + "( ⫯[?]? )" "sh_props" + "sh_lt" * ]
+ }
+ ]
[ { "atomic arities" * } {
[ [ "" ] "aarity" * ]
}
+0.99.4 - 26/12/2018 - beta version for the 1.x series
+ * ported to lablgkt3, ulex-camlp5 1.2, ocaml 4.07
+ * bug fix: aliases were no longer added automatically to the script
+
0.99.3 - 06/05/2016 - beta version for the 1.x series
- * cyclic sort hierarchies are now allowed through the "cyclic" keyword
- * new syntax for let rec/corec with flavor specifier
- * optional parameters added to the syntax of definitions
- * new attribute "Implied" put beside "Generated" and "Provided";
- it denotes an object provided not as defined by the user, but as generated by another ITP
- * the command "defined" is added as a presentational alternative to "qed" for definitions
- * improved standard library and contributions
- * improved binaries using matita components
- * source code updated for the latest version of OCaml and related tools
+ * cyclic sort hierarchies are now allowed through the "cyclic" keyword
+ * new syntax for let rec/corec with flavor specifier
+ * optional parameters added to the syntax of definitions
+ * new attribute "Implied" put beside "Generated" and "Provided";
+ it denotes an object provided not as defined by the user, but as
+ generated by another ITP
+ * the command "defined" is added as a presentational alternative to
+ "qed" for definitions
+ * improved standard library and contributions
+ * improved binaries using matita components
+ * source code updated for the latest version of OCaml and related
+ tools
* several bug fixes
0.99.1 - 17/11/2011 - alpha version for the 1.x series
method load_graph_from_file ?(gviz_cmd = "dot") fname =
let tmp_png = tempfile () in
let rc = Sys.command (mk_gviz_cmd gviz_cmd png_flags fname tmp_png) in
- if rc <> 0 then
+ if rc <> 0 || (Unix.stat tmp_png).Unix.st_size = 0 then begin
eprintf
("Graphviz command failed (exit code: %d) on the following graph:\n"
^^ "%s\n%!")
rc (HExtlib.input_file fname);
- image#set_file tmp_png;
- HExtlib.safe_remove tmp_png;
- let tmp_map = tempfile () in
- ignore (Sys.command (mk_gviz_cmd gviz_cmd map_flags fname tmp_map));
- self#load_map tmp_map;
- HExtlib.safe_remove tmp_map
+ (* CSC: it would be better to show something explaining that the
+ graph is empty *)
+ image#clear ()
+ end else begin
+ image#set_file tmp_png;
+ HExtlib.safe_remove tmp_png;
+ let tmp_map = tempfile () in
+ ignore (Sys.command (mk_gviz_cmd gviz_cmd map_flags fname tmp_map));
+ self#load_map tmp_map;
+ HExtlib.safe_remove tmp_map
+ end
method private load_map fname =
let areas = ref [] in
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 *)
(* 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}.
--- /dev/null
+(*
+ ||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}.
--- /dev/null
+(*
+ ||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}.
--- /dev/null
+(*
+ ||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 *)
--- /dev/null
+(*
+ ||M|| This file is part of HELM, an Hypertextual, Electronic
+ ||A|| Library of Mathematics, developed at the Computer Science
+ ||T|| Department of the University of Bologna, Italy.
+ ||I||
+ ||T||
+ ||A||
+ \ / This file is distributed under the terms of the
+ \ / GNU General Public License Version 2
+ V_______________________________________________________________ *)
+
+include "basics/deqsets.ma".
+include "basics/lists/listb.ma".
+
+(*
+
+record DeqSet : Type[1] ≝ {
+ carr :> Type[0];
+ eqb: carr → carr → bool;
+ eqb_true: ∀x,y. (eqb x y = true) ↔ (x = y)
+}. *)
+
+
+(* list *)
+
+let rec eq_list (A:DeqSet) (l1,l2:list A) on l1 ≝
+ match l1 with
+ [ nil ⇒ match l2 with [nil ⇒ true | _ ⇒ false]
+ | cons a1 tl1 ⇒
+ match l2 with [nil ⇒ false | cons a2 tl2 ⇒ a1 ==a2 ∧ eq_list A tl1 tl2]].
+
+lemma eq_list_true: ∀A:DeqSet.∀l1,l2:list A.
+ eq_list A l1 l2 = true ↔ l1 = l2.
+#A #l1 elim l1
+ [* [% // |#a #tl % normalize #H destruct ]
+ |#a1 #tl1 #Hind *
+ [normalize % #H destruct
+ |#a2 #tl2 normalize %
+ [cases (true_or_false (a1==a2)) #Heq >Heq normalize
+ [#Htl >(\P Heq) >(proj1 … (Hind tl2) Htl) // | #H destruct ]
+ |#H destruct >(\b (refl … )) >(proj2 … (Hind tl2) (refl …)) //
+ ]
+ ]
+ ]
+qed.
+
+definition DeqList ≝ λA:DeqSet.
+ mk_DeqSet (list A) (eq_list A) (eq_list_true A).
+
+unification hint 0 ≔ C;
+ T ≟ carr C,
+ X ≟ DeqList C
+(* ---------------------------------------- *) ⊢
+ list T ≡ carr X.
+
+alias id "eqb" = "cic:/matita/basics/deqsets/eqb#fix:0:0:3".
+alias symbol "hint_decl" (instance 1) = "hint_decl_Type0".
+unification hint 0 ≔ T,a1,a2;
+ X ≟ DeqList T
+(* ---------------------------------------- *) ⊢
+ eq_list T a1 a2 ≡ eqb X a1 a2.
+
+
\ / GNU General Public License Version 2
V_______________________________________________________________ *)
-include "basics/lists/listb.ma".
+include "basics/deqlist.ma".
(****** DeqSet: a set with a decidable equality ******)
#A #B #f #a #b #eqf @memb_filter_l [@(\b eqf)]
@enum_prod_complete //
qed.
+
+(* FinFun *)
+
+definition enum_fun_raw: ∀A,B:DeqSet.list A → list B → list (list (DeqProd A B)) ≝
+ λA,B,lA,lB.foldr A (list (list (DeqProd A B)))
+ (λa.compose ??? (λb. cons ? 〈a,b〉) lB) [[]] lA.
+
+lemma enum_fun_raw_cons: ∀A,B,a,lA,lB.
+ enum_fun_raw A B (a::lA) lB =
+ compose ??? (λb. cons ? 〈a,b〉) lB (enum_fun_raw A B lA lB).
+//
+qed.
+
+definition is_functional ≝ λA,B:DeqSet.λlA:list A.λl: list (DeqProd A B).
+ map ?? (fst A B) l = lA.
+
+definition carr_fun ≝ λA,B:FinSet.
+ DeqSig (DeqList (DeqProd A B)) (is_functional A B (enum A)).
+
+definition carr_fun_l ≝ λA,B:DeqSet.λl.
+ DeqSig (DeqList (DeqProd A B)) (is_functional A B l).
+
+lemma compose_spec1 : ∀A,B,C:DeqSet.∀f:A→B→C.∀a:A.∀b:B.∀lA:list A.∀lB:list B.
+ a ∈ lA = true → b ∈ lB = true → ((f a b) ∈ (compose A B C f lA lB)) = true.
+#A #B #C #f #a #b #lA elim lA
+ [normalize #lB #H destruct
+ |#a1 #tl #Hind #lB #Ha #Hb cases (orb_true_l ?? Ha) #Hcase
+ [>(\P Hcase) normalize @memb_append_l1 @memb_map //
+ |@memb_append_l2 @Hind //
+ ]
+ ]
+qed.
+
+lemma compose_cons: ∀A,B,C.∀f:A→B→C.∀l1,l2,a.
+ compose A B C f (a::l1) l2 =
+ (map ?? (f a) l2)@(compose A B C f l1 l2).
+// qed.
+
+lemma compose_spec2 : ∀A,B,C:DeqSet.∀f:A→B→C.∀c:C.∀lA:list A.∀lB:list B.
+ c ∈ (compose A B C f lA lB) = true →
+ ∃a,b.a ∈ lA = true ∧ b ∈ lB = true ∧ c = f a b.
+#A #B #C #f #c #lA elim lA
+ [normalize #lB #H destruct
+ |#a1 #tl #Hind #lB >compose_cons #Hc cases (memb_append … Hc) #Hcase
+ [lapply(memb_map_to_exists … Hcase) * #b * #Hb #Hf
+ %{a1} %{b} /3/
+ |lapply(Hind ? Hcase) * #a2 * #b * * #Ha #Hb #Hf %{a2} %{b} % // % //
+ @orb_true_r2 //
+ ]
+ ]
+qed.
+
+definition compose2 ≝
+ λA,B:DeqSet.λa:A.λl. compose B (carr_fun_l A B l) (carr_fun_l A B (a::l))
+ (λb,tl. mk_Sig ?? (〈a,b〉::(pi1 … tl)) ?).
+normalize @eq_f @(pi2 … tl)
+qed.
+
+let rec Dfoldr (A:Type[0]) (B:list A → Type[0])
+ (f:∀a:A.∀l.B l → B (a::l)) (b:B [ ]) (l:list A) on l : B l ≝
+ match l with [ nil ⇒ b | cons a l ⇒ f a l (Dfoldr A B f b l)].
+
+definition empty_graph: ∀A,B:DeqSet. carr_fun_l A B [].
+#A #B %{[]} // qed.
+
+definition enum_fun: ∀A,B:DeqSet.∀lA:list A.list B → list (carr_fun_l A B lA) ≝
+ λA,B,lA,lB.Dfoldr A (λl.list (carr_fun_l A B l))
+ (λa,l.compose2 ?? a l lB) [empty_graph A B] lA.
+
+lemma mem_enum_fun: ∀A,B:DeqSet.∀lA,lB.∀x:carr_fun_l A B lA.
+ pi1 … x ∈ map ?? (pi1 … ) (enum_fun A B lA lB) = true →
+ x ∈ enum_fun A B lA lB = true .
+#A #B #lA #lB #x @(memb_map_inj
+ (DeqSig (DeqList (DeqProd A B))
+ (λx0:DeqList (DeqProd A B).is_functional A B lA x0))
+ (DeqList (DeqProd A B)) (pi1 …))
+* #l1 #H1 * #l2 #H2 #Heq lapply H1 lapply H2 >Heq //
+qed.
+
+lemma enum_fun_cons: ∀A,B,a,lA,lB.
+ enum_fun A B (a::lA) lB =
+ compose ??? (λb,tl. mk_Sig ?? (〈a,b〉::(pi1 … tl)) ?) lB (enum_fun A B lA lB).
+//
+qed.
+
+lemma map_map: ∀A,B,C.∀f:A→B.∀g:B→C.∀l.
+ map ?? g (map ?? f l) = map ?? (g ∘ f) l.
+#A #B #C #f #g #l elim l [//]
+#a #tl #Hind normalize @eq_f @Hind
+qed.
+
+lemma map_compose: ∀A,B,C,D.∀f:A→B→C.∀g:C→D.∀l1,l2.
+ map ?? g (compose A B C f l1 l2) = compose A B D (λa,b. g (f a b)) l1 l2.
+#A #B #C #D #f #g #l1 elim l1 [//]
+#a #tl #Hind #l2 >compose_cons >compose_cons <map_append @eq_f2
+ [@map_map |@Hind]
+qed.
+
+definition enum_fun_graphs: ∀A,B,lA,lB.
+ map ?? (pi1 … ) (enum_fun A B lA lB) = enum_fun_raw A B lA lB.
+#A #B #lA elim lA [normalize //]
+#a #tl #Hind #lB >(enum_fun_cons A B a tl lB) >enum_fun_raw_cons >map_compose
+cut (∀lB2. compose B (Σx:DeqList (DeqProd A B).is_functional A B tl x)
+ (DeqList (DeqProd A B))
+ (λa0:B
+ .λb:Σx:DeqList (DeqProd A B).is_functional A B tl x
+ .〈a,a0〉
+ ::pi1 (list (A×B)) (λx:DeqList (DeqProd A B).is_functional A B tl x) b) lB
+ (enum_fun A B tl lB2)
+ =compose B (list (A×B)) (list (A×B)) (λb:B.cons (A×B) 〈a,b〉) lB
+ (enum_fun_raw A B tl lB2))
+ [#lB2 elim lB
+ [normalize //
+ |#b #tlb #Hindb >compose_cons in ⊢ (???%); >compose_cons
+ @eq_f2 [<Hind >map_map // |@Hindb]]]
+#Hcut @Hcut
+qed.
+
+lemma uniqueb_compose: ∀A,B,C:DeqSet.∀f,l1,l2.
+ (∀a1,a2,b1,b2. f a1 b1 = f a2 b2 → a1 = a2 ∧ b1 = b2) →
+ uniqueb ? l1 = true → uniqueb ? l2 = true →
+ uniqueb ? (compose A B C f l1 l2) = true.
+#A #B #C #f #l1 #l2 #Hinj elim l1 //
+#a #tl #Hind #HuA #HuB >compose_cons @uniqueb_append
+ [@(unique_map_inj … HuB) #b1 #b2 #Hb1b2 @(proj2 … (Hinj … Hb1b2))
+ |@Hind // @(andb_true_r … HuA)
+ |#c #Hc lapply(memb_map_to_exists … Hc) * #b * #Hb2 #Hfab % #Hc
+ lapply(compose_spec2 … Hc) * #a1 * #b1 * * #Ha1 #Hb1 <Hfab #H
+ @(absurd (a=a1))
+ [@(proj1 … (Hinj … H))
+ |% #eqa @(absurd … Ha1) % <eqa #H lapply(andb_true_l … HuA) >H
+ normalize #H1 destruct (H1)
+ ]
+ ]
+qed.
+
+lemma enum_fun_unique: ∀A,B:DeqSet.∀lA,lB.
+ uniqueb ? lA = true → uniqueb ? lB = true →
+ uniqueb ? (enum_fun A B lA lB) = true.
+#A #B #lA elim lA
+ [#lB #_ #ulB //
+ |#a #tlA #Hind #lB #uA #uB lapply (enum_fun_cons A B a tlA lB) #H >H
+ @(uniqueb_compose B (carr_fun_l A B tlA) (carr_fun_l A B (a::tlA)))
+ [#b1 #b2 * #l1 #funl1 * #l2 #funl2 #H1 destruct (H1) /2/
+ |//
+ |@(Hind … uB) @(andb_true_r … uA)
+ ]
+ ]
+qed.
+
+lemma enum_fun_complete: ∀A,B:FinSet.∀l1,l2.
+ (∀x:A. memb A x l1 = true) →
+ (∀x:B. memb B x l2 = true) →
+ ∀x:carr_fun_l A B l1. memb ? x (enum_fun A B l1 l2) = true.
+#A #B #l1 #l2 #H1 #H2 * #g #H @mem_enum_fun >enum_fun_graphs
+lapply H -H lapply g -g elim l1
+ [* // #p #tlg normalize #H destruct (H)
+ |#a #tl #Hind #g cases g
+ [normalize in ⊢ (%→?); #H destruct (H)
+ |* #a1 #b #tl1 normalize in ⊢ (%→?); #H
+ cut (is_functional A B tl tl1) [destruct (H) //] #Hfun
+ >(cons_injective_l ????? H)
+ >(enum_fun_raw_cons … ) @(compose_spec1 … (λb. cons ? 〈a,b〉))
+ [@H2 |@Hind @Hfun]
+ ]
+ ]
+qed.
+
+definition FinFun ≝
+λA,B:FinSet.mk_FinSet (carr_fun A B)
+ (enum_fun A B (enum A) (enum B))
+ (enum_fun_unique A B … (enum_unique A) (enum_unique B))
+ (enum_fun_complete A B … (enum_complete A) (enum_complete B)).
+
+(*
+unification hint 0 ≔ C1,C2;
+ T1 ≟ FinSetcarr C1,
+ T2 ≟ FinSetcarr C2,
+ X ≟ FinProd C1 C2
+(* ---------------------------------------- *) ⊢
+ T1×T2 ≡ FinSetcarr X. *)
\ No newline at end of file
include "basics/logic.ma".
include "basics/core_notation/compose_2.ma".
+include "basics/core_notation/subseteq_2.ma".
(********** predicates *********)
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 ****)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basics/lists/list.ma".
-
-axiom alpha : Type[0].
-notation "𝔸" non associative with precedence 90 for @{'alphabet}.
-interpretation "set of names" 'alphabet = alpha.
-
-inductive tp : Type[0] ≝
-| top : tp
-| arr : tp → tp → tp.
-inductive tm : Type[0] ≝
-| var : nat → tm
-| par : 𝔸 → tm
-| abs : tp → tm → tm
-| app : tm → tm → tm.
-
-let rec Nth T n (l:list T) on n ≝
- match l with
- [ nil ⇒ None ?
- | cons hd tl ⇒ match n with
- [ O ⇒ Some ? hd
- | S n0 ⇒ Nth T n0 tl ] ].
-
-inductive judg : list tp → tm → tp → Prop ≝
-| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t
-| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u
-| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u).
-
-definition Env := list (𝔸 × tp).
-
-axiom vclose_env : Env → list tp.
-axiom vclose_tm : Env → tm → tm.
-axiom Lam : 𝔸 → tp → tm → tm.
-definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T.
-definition dom ≝ λG:Env.map ?? (fst ??) G.
-
-definition sctx ≝ 𝔸 × tm.
-axiom swap_tm : 𝔸 → 𝔸 → tm → tm.
-definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M.
-
-axiom in_list : ∀A:Type[0].A → list A → Prop.
-interpretation "list membership" 'mem x l = (in_list ? x l).
-interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)).
-
-axiom in_Env : 𝔸 × tp → Env → Prop.
-notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
-interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
-
-let rec FV M ≝ match M with
- [ par X ⇒ [X]
- | app M1 M2 ⇒ FV M1@FV M2
- | abs T M0 ⇒ FV M0
- | _ ⇒ [ ] ].
-
-(* axiom Lookup : 𝔸 → Env → option tp. *)
-
-(* forma alto livello del judgment
- t_abs* : ∀G,T,X,M,U.
- (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) →
- Judg G (Lam X T (M[X])) (arr T U) *)
-
-(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *)
-
-axiom Judg_ind : ∀P:Env → tm → tp → Prop.
- (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) →
- (∀G,M,N,T,U.
- Judg G M (arr T U) → Judg G N T →
- P G M (arr T U) → P G N T → P G (app M N) U) →
- (∀G,T1,T2,X,M1.
- (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
- (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
- P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) →
- ∀G,M,T.Judg G M T → P G M T.
-
-axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T.
-axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U.
-axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U).
-
-definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2.
-interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2).
-
-axiom daemon : ∀P:Prop.P.
-
-theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T.
-#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?)
-@(Judg_ind … HJ)
-[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub //
-| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2
- [| @IH1 // | @IH2 // ]
-| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH
- [ (* trivial property of Lam *) @daemon
- | (* trivial property of subenv *) @daemon ]
-]
-qed.
-
-(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e
- ricorsione *)
\ No newline at end of file
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "binding/names.ma".
-
-(* permutations *)
-definition finite_perm : ∀X:Nset.(X → X) → Prop ≝
- λX,f.injective X X f ∧ surjective X X f ∧ ∃l.∀x.x ∉ l → f x = x.
-
-(* maps a permutation to a list of parameters *)
-definition Pi_list : ∀X:Nset.(X → X) → list X → list X ≝
- λX,p,xl.map ?? (λx.p x) xl.
-
-interpretation "permutation of X list" 'middot p x = (Pi_list p x).
-
-definition swap : ∀N:Nset.N → N → N → N ≝
- λN,u,v,x.match (x == u) with
- [true ⇒ v
- |false ⇒ match (x == v) with
- [true ⇒ u
- |false ⇒ x]].
-
-axiom swap_right : ∀N,x,y.swap N x y y = x.
-(*
-#N x y;nnormalize;nrewrite > (p_eqb3 ? y y …);//;
-nlapply (refl ? (y ≟ x));ncases (y ≟ x) in ⊢ (???% → %);nnormalize;//;
-#H1;napply p_eqb1;//;
-nqed.
-*)
-
-axiom swap_left : ∀N,x,y.swap N x y x = y.
-(*
-#N x y;nnormalize;nrewrite > (p_eqb3 ? x x …);//;
-nqed.
-*)
-
-axiom swap_other : ∀N,x,y,z.x ≠ z → y ≠ z → swap N x y z = z.
-(*
-#N x y z H1 H2;nnormalize;nrewrite > (p_eqb4 …);
-##[nrewrite > (p_eqb4 …);//;@;ncases H2;/2/;
-##|@;ncases H1;/2/
-##]
-nqed.
-*)
-
-axiom swap_inv : ∀N,x,y,z.swap N x y (swap N x y z) = z.
-(*
-#N x y z;nlapply (refl ? (x ≟ z));ncases (x ≟ z) in ⊢ (???% → ?);#H1
-##[nrewrite > (p_eqb1 … H1);nrewrite > (swap_left …);//;
-##|nlapply (refl ? (y ≟ z));ncases (y ≟ z) in ⊢ (???% → ?);#H2
- ##[nrewrite > (p_eqb1 … H2);nrewrite > (swap_right …);//;
- ##|nrewrite > (swap_other …) in ⊢ (??(????%)?);/2/;
- nrewrite > (swap_other …);/2/;
- ##]
-##]
-nqed.
-*)
-
-axiom swap_fp : ∀N,x1,x2.finite_perm ? (swap N x1 x2).
-(*
-#N x1 x2;@
-##[@
- ##[nwhd;#xa xb;nnormalize;nlapply (refl ? (xa ≟ x1));
- ncases (xa ≟ x1) in ⊢ (???% → %);#H1
- ##[nrewrite > (p_eqb1 … H1);nlapply (refl ? (xb ≟ x1));
- ncases (xb ≟ x1) in ⊢ (???% → %);#H2
- ##[nrewrite > (p_eqb1 … H2);//
- ##|nlapply (refl ? (xb ≟ x2));
- ncases (xb ≟ x2) in ⊢ (???% → %);#H3
- ##[nnormalize;#H4;nrewrite > H4 in H3;
- #H3;nrewrite > H3 in H2;#H2;ndestruct (H2)
- ##|nnormalize;#H4;nrewrite > H4 in H3;
- nrewrite > (p_eqb3 …);//;#H5;ndestruct (H5)
- ##]
- ##]
- ##|nlapply (refl ? (xa ≟ x2));
- ncases (xa ≟ x2) in ⊢ (???% → %);#H2
- ##[nrewrite > (p_eqb1 … H2);nlapply (refl ? (xb ≟ x1));
- ncases (xb ≟ x1) in ⊢ (???% → %);#H3
- ##[nnormalize;#H4;nrewrite > H4 in H3;
- #H3;nrewrite > (p_eqb1 … H3);@
- ##|nnormalize;nlapply (refl ? (xb ≟ x2));
- ncases (xb ≟ x2) in ⊢ (???% → %);#H4
- ##[nrewrite > (p_eqb1 … H4);//
- ##|nnormalize;#H5;nrewrite > H5 in H3;
- nrewrite > (p_eqb3 …);//;#H6;ndestruct (H6);
- ##]
- ##]
- ##|nnormalize;nlapply (refl ? (xb ≟ x1));
- ncases (xb ≟ x1) in ⊢ (???% → %);#H3
- ##[nnormalize;#H4;nrewrite > H4 in H2;nrewrite > (p_eqb3 …);//;
- #H5;ndestruct (H5)
- ##|nlapply (refl ? (xb ≟ x2));
- ncases (xb ≟ x2) in ⊢ (???% → %);#H4
- ##[nnormalize;#H5;nrewrite > H5 in H1;nrewrite > (p_eqb3 …);//;
- #H6;ndestruct (H6)
- ##|nnormalize;//
- ##]
- ##]
- ##]
- ##]
- ##|nwhd;#z;nnormalize;nlapply (refl ? (z ≟ x1));
- ncases (z ≟ x1) in ⊢ (???% → %);#H1
- ##[nlapply (refl ? (z ≟ x2));
- ncases (z ≟ x2) in ⊢ (???% → %);#H2
- ##[@ z;nrewrite > H1;nrewrite > H2;napply p_eqb1;//
- ##|@ x2;nrewrite > (p_eqb4 …);
- ##[nrewrite > (p_eqb3 …);//;
- nnormalize;napply p_eqb1;//
- ##|nrewrite < (p_eqb1 … H1);@;#H3;nrewrite > H3 in H2;
- nrewrite > (p_eqb3 …);//;#H2;ndestruct (H2)
- ##]
- ##]
- ##|nlapply (refl ? (z ≟ x2));
- ncases (z ≟ x2) in ⊢ (???% → %);#H2
- ##[@ x1;nrewrite > (p_eqb3 …);//;
- napply p_eqb1;nnormalize;//
- ##|@ z;nrewrite > H1;nrewrite > H2;@;
- ##]
- ##]
- ##]
-##|@ [x1;x2];#x0 H1;nrewrite > (swap_other …)
- ##[@
- ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;/2/;
- ##|@;#H2;nrewrite > H2 in H1;*;#H3;napply H3;//;
- ##]
-##]
-nqed.
-*)
-
-axiom inj_swap : ∀N,u,v.injective ?? (swap N u v).
-(*
-#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//;
-nqed.
-*)
-
-axiom surj_swap : ∀N,u,v.surjective ?? (swap N u v).
-(*
-#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//;
-nqed.
-*)
-
-axiom finite_swap : ∀N,u,v.∃l.∀x.x ∉ l → swap N u v x = x.
-(*
-#N u v;ncases (swap_fp N u v);*;#H1 H2 H3;//;
-nqed.
-*)
-
-(* swaps two lists of parameters
-definition Pi_swap_list : ∀xl,xl':list X.X → X ≝
- λxl,xl',x.foldr2 ??? (λu,v,r.swap ? u v r) x xl xl'.
-
-nlemma fp_swap_list :
- ∀xl,xl'.finite_perm ? (Pi_swap_list xl xl').
-#xl xl';@
-##[@;
- ##[ngeneralize in match xl';nelim xl
- ##[nnormalize;//;
- ##|#x0 xl0;#IH xl'';nelim xl''
- ##[nnormalize;//
- ##|#x1 xl1 IH1 y0 y1;nchange in ⊢ (??%% → ?) with (swap ????);
- #H1;nlapply (inj_swap … H1);#H2;
- nlapply (IH … H2);//
- ##]
- ##]
- ##|ngeneralize in match xl';nelim xl
- ##[nnormalize;#_;#z;@z;@
- ##|#x' xl0 IH xl'';nelim xl''
- ##[nnormalize;#z;@z;@
- ##|#x1 xl1 IH1 z;
- nchange in ⊢ (??(λ_.???%)) with (swap ????);
- ncases (surj_swap X x' x1 z);#x2 H1;
- ncases (IH xl1 x2);#x3 H2;@ x3;
- nrewrite < H2;napply H1
- ##]
- ##]
- ##]
-##|ngeneralize in match xl';nelim xl
- ##[#;@ [];#;@
- ##|#x0 xl0 IH xl'';ncases xl''
- ##[@ [];#;@
- ##|#x1 xl1;ncases (IH xl1);#xl2 H1;
- ncases (finite_swap X x0 x1);#xl3 H2;
- @ (xl2@xl3);#x2 H3;
- nchange in ⊢ (??%?) with (swap ????);
- nrewrite > (H1 …);
- ##[nrewrite > (H2 …);//;@;#H4;ncases H3;#H5;napply H5;
- napply in_list_to_in_list_append_r;//
- ##|@;#H4;ncases H3;#H5;napply H5;
- napply in_list_to_in_list_append_l;//
- ##]
- ##]
- ##]
-##]
-nqed.
-
-(* the 'reverse' swap of lists of parameters
- composing Pi_swap_list and Pi_swap_list_r yields the identity function
- (see the Pi_swap_list_inv lemma) *)
-ndefinition Pi_swap_list_r : ∀xl,xl':list X. Pi ≝
- λxl,xl',x.foldl2 ??? (λr,u,v.swap ? u v r ) x xl xl'.
-
-nlemma fp_swap_list_r :
- ∀xl,xl'.finite_perm ? (Pi_swap_list_r xl xl').
-#xl xl';@
-##[@;
- ##[ngeneralize in match xl';nelim xl
- ##[nnormalize;//;
- ##|#x0 xl0;#IH xl'';nelim xl''
- ##[nnormalize;//
- ##|#x1 xl1 IH1 y0 y1;nwhd in ⊢ (??%% → ?);
- #H1;nlapply (IH … H1);#H2;
- napply (inj_swap … H2);
- ##]
- ##]
- ##|ngeneralize in match xl';nelim xl
- ##[nnormalize;#_;#z;@z;@
- ##|#x' xl0 IH xl'';nelim xl''
- ##[nnormalize;#z;@z;@
- ##|#x1 xl1 IH1 z;nwhd in ⊢ (??(λ_.???%));
- ncases (IH xl1 z);#x2 H1;
- ncases (surj_swap X x' x1 x2);#x3 H2;
- @ x3;nrewrite < H2;napply H1;
- ##]
- ##]
- ##]
-##|ngeneralize in match xl';nelim xl
- ##[#;@ [];#;@
- ##|#x0 xl0 IH xl'';ncases xl''
- ##[@ [];#;@
- ##|#x1 xl1;
- ncases (IH xl1);#xl2 H1;
- ncases (finite_swap X x0 x1);#xl3 H2;
- @ (xl2@xl3);#x2 H3;nwhd in ⊢ (??%?);
- nrewrite > (H2 …);
- ##[nrewrite > (H1 …);//;@;#H4;ncases H3;#H5;napply H5;
- napply in_list_to_in_list_append_l;//
- ##|@;#H4;ncases H3;#H5;napply H5;
- napply in_list_to_in_list_append_r;//
- ##]
- ##]
- ##]
-##]
-nqed.
-
-nlemma Pi_swap_list_inv :
- ∀xl1,xl2,x.
- Pi_swap_list xl1 xl2 (Pi_swap_list_r xl1 xl2 x) = x.
-#xl;nelim xl
-##[#;@
-##|#x1 xl1 IH xl';ncases xl'
- ##[#;@
- ##|#x2 xl2;#x;
- nchange in ⊢ (??%?) with
- (swap ??? (Pi_swap_list ??
- (Pi_swap_list_r ?? (swap ????))));
- nrewrite > (IH xl2 ?);napply swap_inv;
- ##]
-##]
-nqed.
-
-nlemma Pi_swap_list_fresh :
- ∀x,xl1,xl2.x ∉ xl1 → x ∉ xl2 → Pi_swap_list xl1 xl2 x = x.
-#x xl1;nelim xl1
-##[#;@
-##|#x3 xl3 IH xl2' H1;ncases xl2'
- ##[#;@
- ##|#x4 xl4 H2;ncut (x ∉ xl3 ∧ x ∉ xl4);
- ##[@
- ##[@;#H3;ncases H1;#H4;napply H4;/2/;
- ##|@;#H3;ncases H2;#H4;napply H4;/2/
- ##]
- ##] *; #H1' H2';
- nchange in ⊢ (??%?) with (swap ????);
- nrewrite > (swap_other …)
- ##[napply IH;//;
- ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???);
- nrewrite > (IH …);//;@;#H3;ncases H2;#H4;napply H4;//;
- ##|nchange in ⊢ (?(???%)) with (Pi_swap_list ???);
- nrewrite > (IH …);//;@;#H3;ncases H1;#H4;napply H4;//
- ##]
- ##]
-##]
-nqed.
-*)
\ No newline at end of file
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basics/lists/list.ma".
-include "basics/deqsets.ma".
-include "binding/names.ma".
-include "binding/fp.ma".
-
-axiom alpha : Nset.
-notation "𝔸" non associative with precedence 90 for @{'alphabet}.
-interpretation "set of names" 'alphabet = alpha.
-
-inductive tp : Type[0] ≝
-| top : tp
-| arr : tp → tp → tp.
-inductive pretm : Type[0] ≝
-| var : nat → pretm
-| par : 𝔸 → pretm
-| abs : tp → pretm → pretm
-| app : pretm → pretm → pretm.
-
-let rec Nth T n (l:list T) on n ≝
- match l with
- [ nil ⇒ None ?
- | cons hd tl ⇒ match n with
- [ O ⇒ Some ? hd
- | S n0 ⇒ Nth T n0 tl ] ].
-
-let rec vclose_tm_aux u x k ≝ match u with
- [ var n ⇒ if (leb k n) then var (S n) else u
- | par x0 ⇒ if (x0 == x) then (var k) else u
- | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k)
- | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ].
-definition vclose_tm ≝ λu,x.vclose_tm_aux u x O.
-
-definition vopen_var ≝ λn,x,k.match eqb n k with
- [ true ⇒ par x
- | false ⇒ match leb n k with
- [ true ⇒ var n
- | false ⇒ var (pred n) ] ].
-
-let rec vopen_tm_aux u x k ≝ match u with
- [ var n ⇒ vopen_var n x k
- | par x0 ⇒ u
- | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k)
- | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ].
-definition vopen_tm ≝ λu,x.vopen_tm_aux u x O.
-
-let rec FV u ≝ match u with
- [ par x ⇒ [x]
- | app v1 v2 ⇒ FV v1@FV v2
- | abs s v ⇒ FV v
- | _ ⇒ [ ] ].
-
-definition lam ≝ λx,s,u.abs s (vclose_tm u x).
-
-let rec Pi_map_tm p u on u ≝ match u with
-[ par x ⇒ par (p x)
-| var _ ⇒ u
-| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2)
-| abs s v ⇒ abs s (Pi_map_tm p v) ].
-
-interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x).
-
-notation "hvbox(u⌈x⌉)"
- with precedence 45
- for @{ 'open $u $x }.
-
-(*
-notation "hvbox(u⌈x⌉)"
- with precedence 45
- for @{ 'open $u $x }.
-notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }.
-*)
-interpretation "ln term variable open" 'open u x = (vopen_tm u x).
-notation < "hvbox(ν x break . u)"
- with precedence 20
-for @{'nu $x $u }.
-notation > "ν list1 x sep , . term 19 u" with precedence 20
- for ${ fold right @{$u} rec acc @{'nu $x $acc)} }.
-interpretation "ln term variable close" 'nu x u = (vclose_tm u x).
-
-let rec tm_height u ≝ match u with
-[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2))
-| abs s v ⇒ S (tm_height v)
-| _ ⇒ O ].
-
-theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n.
-#n (cases n) // #a #abs cases (?:False) /2/ qed.
-
-theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0].
-(∀m.(∀p. p < m → P p) → P m) → P n.
-#n #P #H
-cut (∀q:nat. q ≤ n → P q) /2/
-(elim n)
- [#q #HleO (* applica male *)
- @(le_n_O_rect_Type0 ? HleO)
- @H #p #ltpO cases (?:False) /2/ (* 3 *)
- |#p #Hind #q #HleS
- @H #a #lta @Hind @le_S_S_to_le /2/
- ]
-qed.
-
-lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n.
-#n elim n
-[ #m normalize #H destruct(H)
-| #n0 #IH * // #m normalize #H @le_S_S @IH // ]
-qed.
-
-lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u.
-#x #u elim u
-[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk
- [ >Hnk >eqb_n_n normalize >(\b ?) //
- | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb
- [ >Hleb normalize >(?:leb k n = false) //
- @lt_to_leb_false @not_eq_to_le_to_lt /2/
- | >Hleb normalize >(?:leb k (pred n) = true) normalize
- [ cases (leb_false_to_lt … Hleb) //
- | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ]
-| #y normalize #Hy >(\bf ?) // @(not_to_not … Hy) //
-| #s #v #IH normalize #Hv #k >IH // @Hv
-| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k
- >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ]
- @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ]
-qed.
-
-corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u.
-#x #u #Hu @nominal_eta_aux //
-qed.
-
-lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v.
-#v #x elim v
-[ #n #k normalize cases (eqb n k) // cases (leb n k) //
-| #u #k %
-| #s #u #IH #k normalize >IH %
-| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ]
-qed.
-
-corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v.
-#v #x @eq_height_vopen_aux
-qed.
-
-theorem pretm_ind_plus_aux :
- ∀P:pretm → Type[0].
- (∀x:𝔸.P (par x)) →
- (∀n:ℕ.P (var n)) →
- (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
- ∀n,u.tm_height u ≤ n → P u.
-#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??)
-#m cases m
-[ #_ * /2/
- [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/
- | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (max ??))
- [ #H @H @Hfalse|*:skip] ] ]
--m #m #IH * /2/
-[ #s #v whd in ⊢ (?%?→?); #Hv
- lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy
- >(?:abs s v = lam y s (v⌈y⌉))
- [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ]
- @Hlam
- [ @(not_to_not … Hy) @in_list_to_in_list_append_r
- | @(not_to_not … Hy) @in_list_to_in_list_append_l ]
- @IH [| @Hv | >eq_height_vopen % ]
-| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ
- [ @IH [| @Hv | @le_max_1 ] | @IH [| @Hv | @le_max_2 ] ] ]
-qed.
-
-corollary pretm_ind_plus :
- ∀P:pretm → Type[0].
- (∀x:𝔸.P (par x)) →
- (∀n:ℕ.P (var n)) →
- (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
- ∀u.P u.
-#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/
-qed.
-
-(* maps a permutation to a list of terms *)
-definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 .
-
-(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*)
-
-(*
-inductive tm : pretm → Prop ≝
-| tm_par : ∀x:𝔸.tm (par x)
-| tm_app : ∀u,v.tm u → tm v → tm (app u v)
-| tm_lam : ∀x,s,u.tm u → tm (lam x s u).
-
-inductive ctx_aux : nat → pretm → Prop ≝
-| ctx_var : ∀n,k.n < k → ctx_aux k (var n)
-| ctx_par : ∀x,k.ctx_aux k (par x)
-| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v)
-(* è sostituibile da ctx_lam ? *)
-| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u).
-*)
-
-inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝
-| toc_var : ∀n.n < k → tm_or_ctx k (var n)
-| toc_par : ∀x.tm_or_ctx k (par x)
-| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v)
-| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u).
-
-definition tm ≝ λt.tm_or_ctx O t.
-definition ctx ≝ λt.tm_or_ctx 1 t.
-
-definition check_tm ≝ λu,k.
- pretm_ind_plus ?
- (λ_.true)
- (λn.leb (S n) k)
- (λv1,v2,rv1,rv2.rv1 ∧ rv2)
- [] (λx,s,v,px,pC,rv.rv)
- u.
-
-axiom pretm_ind_plus_app : ∀P,u,v,C,H1,H2,H3,H4.
- pretm_ind_plus P H1 H2 H3 C H4 (app u v) =
- H3 u v (pretm_ind_plus P H1 H2 H3 C H4 u) (pretm_ind_plus P H1 H2 H3 C H4 v).
-
-axiom pretm_ind_plus_lam : ∀P,x,s,u,C,px,pC,H1,H2,H3,H4.
- pretm_ind_plus P H1 H2 H3 C H4 (lam x s (u⌈x⌉)) =
- H4 x s u px pC (pretm_ind_plus P H1 H2 H3 C H4 (u⌈x⌉)).
-
-record TM : Type[0] ≝ {
- pretm_of_TM :> pretm;
- tm_of_TM : check_tm pretm_of_TM O = true
-}.
-
-record CTX : Type[0] ≝ {
- pretm_of_CTX :> pretm;
- ctx_of_CTX : check_tm pretm_of_CTX 1 = true
-}.
-
-inductive tm2 : pretm → Type[0] ≝
-| tm_par : ∀x.tm2 (par x)
-| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v)
-| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)).
-
-(*
-inductive tm' : pretm → Prop ≝
-| tm_par : ∀x.tm' (par x)
-| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v)
-| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)).
-*)
-
-lemma pi_vclose_tm :
- ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u).
-#z1 #z2 #x #u
-change with (vclose_tm_aux ???) in match (vclose_tm ??);
-change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u normalize //
-[ #n #k cases (leb k n) normalize %
-| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 normalize
- [ cases (true_or_false (x0==x)) #H2 >H2 normalize
- [ <(\P H2) >H1 normalize >(\b (refl ? z2)) %
- | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize
- [ >(\P H3) in H2; >H1 #Hfalse destruct (Hfalse)
- | cases (true_or_false (x==z2)) #H4 >H4 normalize
- [ cases (true_or_false (z2==z1)) #H5 >H5 normalize //
- >(\P H5) in H4; >H3 #Hfalse destruct (Hfalse)
- | >(\bf ?) // @sym_not_eq @(\Pf H4) ]
- ]
- ]
- | cases (true_or_false (x0==x)) #H2 >H2 normalize
- [ <(\P H2) >H1 normalize >(\b (refl ??)) %
- | >H1 normalize cases (true_or_false (x==z1)) #H3 >H3 normalize
- [ cases (true_or_false (x0==z2)) #H4 >H4 normalize
- [ cases (true_or_false (z1==z2)) #H5 >H5 normalize //
- <(\P H5) in H4; <(\P H3) >H2 #Hfalse destruct (Hfalse)
- | >H4 % ]
- | cases (true_or_false (x0==z2)) #H4 >H4 normalize
- [ cases (true_or_false (x==z2)) #H5 >H5 normalize
- [ <(\P H5) in H4; >H2 #Hfalse destruct (Hfalse)
- | >(\bf ?) // @sym_not_eq @(\Pf H3) ]
- | cases (true_or_false (x==z2)) #H5 >H5 normalize
- [ >H1 %
- | >H2 % ]
- ]
- ]
- ]
- ]
-]
-qed.
-
-lemma pi_vopen_tm :
- ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉).
-#z1 #z2 #x #u
-change with (vopen_tm_aux ???) in match (vopen_tm ??);
-change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u normalize //
-#n #k cases (true_or_false (eqb n k)) #H1 >H1 normalize //
-cases (true_or_false (leb n k)) #H2 >H2 normalize //
-qed.
-
-lemma pi_lam :
- ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u).
-#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) %
-qed.
-
-lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u).
-#z1 #z2 #u elim u //
-[ #s #v normalize //
-| #v1 #v2 normalize /2/ ]
-qed.
-
-lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u.
-#z1 #z2 #u elim u [1,3,4:normalize //]
-#x whd in ⊢ (??%?); >swap_inv %
-qed.
-
-lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l.
-#x #l #z1 #z2 #Hin elim Hin
-[ #x0 #l0 %
-| #x1 #x2 #l0 #Hin #IH %2 @IH ]
-qed.
-
-lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u).
-#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/
-#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3
-[ @(not_to_not … Hx) -Hx #Hx
- <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list //
-| #y #Hy <(swap_inv ? z1 z2 y)
- <pi_vopen_tm @IH @(not_to_not … Hy) -Hy #Hy <(swap_inv ? z1 z2 y)
- >eqv_FV @eqv_in_list //
-]
-qed.
-
-lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u.
-#x #u elim u normalize //
-[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?);
- [ cases (true_or_false (eqb (S n) k)) #H1 >H1
- [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H
- cases (le_to_not_lt … H) -H #H cases (H ?) %
- | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ]
- | cases (true_or_false (eqb n k)) #H1 >H1 normalize
- [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H
- * #H cases (H ?) %
- | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H;
- [ #H destruct (H) | /2/ ]
- ]
- ]
-| #x0 #k cases (true_or_false (x0==x)) #H1 >H1 normalize // >(\P H1) >eqb_n_n % ]
-qed.
-
-lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux
-qed.
-
-(*
-theorem tm_to_tm : ∀t.tm' t → tm t.
-#t #H elim H
-*)
-
-lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2.
-#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/
-qed.
-
-lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k).
-#u #x elim u //
-[ #n #k normalize cases (leb k n) normalize //
-| #x0 #k normalize cases (true_or_false (x0==x)) #H >H normalize //
- lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) %
-| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) /2/ ]
-qed.
-
-lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). //
-qed.
-
-lemma check_tm_true_to_toc : ∀u,k.check_tm u k = true → tm_or_ctx k u.
-#u @(pretm_ind_plus ???? [ ] ? u)
-[ #x #k #_ %2
-| #n #k change with (leb (S n) k) in ⊢ (??%?→?); #H % @leb_true_to_le //
-| #v1 #v2 #rv1 #rv2 #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?);
- >pretm_ind_plus_app #H cases (andb_true ?? H) -H #Hv1 #Hv2 %3
- [ @rv1 @Hv1 | @rv2 @Hv2 ]
-| #x #s #v #Hx #_ #rv #k change with (pretm_ind_plus ???????) in ⊢ (??%?→?);
- >pretm_ind_plus_lam // #Hv %4 @rv @Hv ]
-qed.
-
-lemma toc_to_check_tm_true : ∀u,k.tm_or_ctx k u → check_tm u k = true.
-#u #k #Hu elim Hu //
-[ #n #Hn change with (leb (S n) k) in ⊢ (??%?); @le_to_leb_true @Hn
-| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 change with (pretm_ind_plus ???????) in ⊢ (??%?);
- >pretm_ind_plus_app change with (check_tm v1 k ∧ check_tm v2 k) in ⊢ (??%?); /2/
-| #x #s #v #Hv #IH <(vclose_vopen x v) change with (pretm_ind_plus ???????) in ⊢ (??%?);
- >pretm_ind_plus_lam [| // | @fresh_vclose_tm ] >(vclose_vopen x v) @IH ]
-qed.
-
-lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u.
-#z1 #z2 #u elim u
-[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other //
- [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] //
-|1: //
-| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1]
-| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2
- >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ]
- >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ]
-]
-qed.
-
-theorem tm_to_tm2 : ∀u.tm u → tm2 u.
-#t #Ht elim Ht
-[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn)
-| @tm_par
-| #u #v #Hu #Hv @tm_app
-| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam
- [ @fresh_vclose_tm
- | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ]
-]
-qed.
-
-theorem tm2_to_tm : ∀u.tm2 u → tm u.
-#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH //
-qed.
-
-(* define PAR APP LAM *)
-definition PAR ≝ λx.mk_TM (par x) ?. // qed.
-definition APP ≝ λu,v:TM.mk_TM (app u v) ?.
-change with (pretm_ind_plus ???????) in match (check_tm ??); >pretm_ind_plus_app
-change with (check_tm ??) in match (pretm_ind_plus ???????); change with (check_tm ??) in match (pretm_ind_plus ???????) in ⊢ (??(??%)?);
-@andb_elim >(tm_of_TM u) >(tm_of_TM v) % qed.
-definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?.
-change with (pretm_ind_plus ???????) in match (check_tm ??); <(vclose_vopen x u)
->pretm_ind_plus_lam [| // | @fresh_vclose_tm ]
-change with (check_tm ??) in match (pretm_ind_plus ???????); >vclose_vopen
-@(tm_of_TM u) qed.
-
-axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉).
-(* needs true_plus_false
-
-#u #x #k #Hu elim Hu
-[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2]
- normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ]
- normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ]
- #n0 #_ #Hn0 % @le_S_S_to_le //
-| #x0 %2
-| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 //
-| #x0 #s #v #Hv #IH normalize @daemon
-]
-qed.
-*)
-
-definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) ?.
-@toc_to_check_tm_true @vopen_tm_down @check_tm_true_to_toc @ctx_of_CTX qed.
-
-axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u).
-
-definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) ?.
-@toc_to_check_tm_true @vclose_tm_up @check_tm_true_to_toc @tm_of_TM qed.
-
-interpretation "ln wf term variable open" 'open u x = (vopen_TM u x).
-interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x).
-
-theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉).
-#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta //
-qed.
-
-lemma TM_to_tm2 : ∀u:TM.tm2 u.
-#u @tm_to_tm2 @check_tm_true_to_toc @tm_of_TM qed.
-
-theorem TM_ind_plus_weak :
- ∀P:pretm → Type[0].
- (∀x:𝔸.P (PAR x)) →
- (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C →
- (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) →
- ∀u:TM.P u.
-#P #Hpar #Happ #C #Hlam #u elim (TM_to_tm2 u) //
-[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2)
- @toc_to_check_tm_true @tm2_to_tm //
-| #x #s #v #Hx #pv #IH
- lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0
- >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉))
- [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ]
- @(Hlam x0 s (mk_CTX v ?) ??)
- [ <(nominal_eta … Hx) @toc_to_check_tm_true @vclose_tm_up @tm2_to_tm @pv //
- | @(not_to_not … Hx0) @in_list_to_in_list_append_r
- | @(not_to_not … Hx0) @in_list_to_in_list_append_l
- | @IH ]
-]
-qed.
-
-lemma eq_mk_TM : ∀u,v.u = v → ∀pu,pv.mk_TM u pu = mk_TM v pv.
-#u #v #Heq >Heq #pu #pv %
-qed.
-
-lemma eq_P : ∀T:Type[0].∀t1,t2:T.t1 = t2 → ∀P:T → Type[0].P t1 → P t2. // qed.
-
-theorem TM_ind_plus :
- ∀P:TM → Type[0].
- (∀x:𝔸.P (PAR x)) →
- (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C →
- (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) →
- ∀u:TM.P u.
-#P #Hpar #Happ #C #Hlam * #u #pu
->(?:mk_TM u pu =
- mk_TM u (toc_to_check_tm_true … (tm2_to_tm … (tm_to_tm2 … (check_tm_true_to_toc … pu))))) [|%]
-elim (tm_to_tm2 u ?) //
-[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …) IH1 IH2)
-| #x #s #v #Hx #pv #IH
- lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0
- lapply (Hlam x0 s (mk_CTX v ?) ???)
- [2: @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0
- |4: @toc_to_check_tm_true <(nominal_eta x v) // @vclose_tm_up @tm2_to_tm @pv //
- | #y #Hy whd in match (vopen_TM ??);
- >(?:mk_TM (v⌈y⌉) ? = mk_TM (v⌈y⌉) (toc_to_check_tm_true (v⌈y⌉) O (tm2_to_tm (v⌈y⌉) (pv y Hy))))
- [@IH|%]
- | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0
- | @eq_P @eq_mk_TM whd in match (vopen_TM ??); @tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ]
-]
-qed.
-
-notation
-"hvbox('nominal' u 'return' out 'with'
- [ 'xpar' ident x ⇒ f1
- | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2
- | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])"
-with precedence 48
-for @{ TM_ind_plus $out (λ${ident x}:?.$f1)
- (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2)
- $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3)
- $u }.
-
-(* include "basics/jmeq.ma".*)
-
-definition subst ≝ (λu:TM.λx,v.
- nominal u return (λ_.TM) with
- [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ] (* u instead of PAR x0 does not work, u stays the same at every rec call! *)
- | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2
- | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]).
-
-lemma subst_def : ∀u,x,v.subst u x v =
- nominal u return (λ_.TM) with
- [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ PAR x0 ]
- | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2
- | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]. //
-qed.
-
-axiom TM_ind_plus_LAM :
- ∀x,s,u,out,f1,f2,C,f3,Hx1,Hx2.
- TM_ind_plus out f1 f2 C f3 (LAM x s (u⌈x⌉)) =
- f3 x s u Hx1 Hx2 (λy,Hy.TM_ind_plus ? f1 f2 C f3 ?).
-
-axiom TM_ind_plus_APP :
- ∀u1,u2,out,f1,f2,C,f3.
- TM_ind_plus out f1 f2 C f3 (APP u1 u2) =
- f2 u1 u2 (TM_ind_plus out f1 f2 C f3 ?) (TM_ind_plus out f1 f2 C f3 ?).
-
-lemma eq_mk_CTX : ∀u,v.u = v → ∀pu,pv.mk_CTX u pu = mk_CTX v pv.
-#u #v #Heq >Heq #pu #pv %
-qed.
-
-lemma vclose_vopen_TM : ∀x.∀u:TM.((νx.u)⌈x⌉) = u.
-#x * #u #pu @eq_mk_TM @vclose_vopen qed.
-
-lemma nominal_eta_CTX : ∀x.∀u:CTX.x ∉ FV u → (νx.(u⌈x⌉)) = u.
-#x * #u #pu #Hx @eq_mk_CTX @nominal_eta // qed.
-
-theorem TM_alpha : ∀x,y,s.∀u:CTX.x ∉ FV u → y ∉ FV u → LAM x s (u⌈x⌉) = LAM y s (u⌈y⌉).
-#x #y #s #u #Hx #Hy @eq_mk_TM @tm_alpha // qed.
-
-axiom in_vopen_CTX : ∀x,y.∀v:CTX.x ∈ FV (v⌈y⌉) → x = y ∨ x ∈ FV v.
-
-theorem subst_fresh : ∀u,v:TM.∀x.x ∉ FV u → subst u x v = u.
-#u #v #x @(TM_ind_plus … (x::FV v) … u)
-[ #x0 normalize in ⊢ (%→?); #Hx normalize in ⊢ (??%?);
- >(\bf ?) [| @(not_to_not … Hx) #Heq >Heq % ] %
-| #u1 #u2 #IH1 #IH2 normalize in ⊢ (%→?); #Hx
- >subst_def >TM_ind_plus_APP @eq_mk_TM @eq_f2 @eq_f
- [ <subst_def @IH1 @(not_to_not … Hx) @in_list_to_in_list_append_l
- | <subst_def @IH2 @(not_to_not … Hx) @in_list_to_in_list_append_r ]
-| #x0 #s #v0 #Hx0 #HC #IH #Hx >subst_def >TM_ind_plus_LAM [|@HC|@Hx0]
- @eq_f <subst_def @IH // @(not_to_not … Hx) -Hx #Hx
- change with (FV (νx0.(v0⌈x0⌉))) in ⊢ (???%); >nominal_eta_CTX //
- cases (in_vopen_CTX … Hx) // #Heq >Heq in HC; * #HC @False_ind @HC %
-]
-qed.
-
-example subst_LAM_same : ∀x,s,u,v. subst (LAM x s u) x v = LAM x s u.
-#x #s #u #v >subst_def <(vclose_vopen_TM x u)
-lapply (p_fresh … (FV (νx.u)@x::FV v)) letin x0 ≝ (N_fresh … (FV (νx.u)@x::FV v)) #Hx0
->(TM_alpha x x0)
-[| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 | @fresh_vclose_tm ]
->TM_ind_plus_LAM [| @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_r @Hx0 | @(not_to_not … Hx0) -Hx0 #Hx0 @in_list_to_in_list_append_l @Hx0 ]
-@eq_f change with (subst ((νx.u)⌈x0⌉) x v) in ⊢ (??%?); @subst_fresh
-@(not_to_not … Hx0) #Hx0' cases (in_vopen_CTX … Hx0')
-[ #Heq >Heq @in_list_to_in_list_append_r %
-| #Hfalse @False_ind cases (fresh_vclose_tm u x) #H @H @Hfalse ]
-qed.
-
-(*
-notation > "Λ ident x. ident T [ident x] ↦ P"
- with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}.
-
-notation < "Λ ident x. ident T [ident x] ↦ P"
- with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}.
-*)
-
-(*
-notation
-"hvbox('nominal' u 'with'
- [ 'xpar' ident x ⇒ f1
- | 'xapp' ident v1 ident v2 ⇒ f2
- | 'xlam' ident x # C s w ⇒ f3 ])"
-with precedence 48
-for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
- (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
- $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
-*)
-
-(*
-notation
-"hvbox('nominal' u 'with'
- [ 'xpar' ident x ^ f1
- | 'xapp' ident v1 ident v2 ^ f2 ])"
-(* | 'xlam' ident x # C s w ^ f3 ]) *)
-with precedence 48
-for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
- (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
- $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
-*)
-notation
-"hvbox('nominal' u 'with'
- [ 'xpar' ident x ^ f1
- | 'xapp' ident v1 ident v2 ^ f2 ])"
-with precedence 48
-for @{ tm2_ind_plus ? (λ${ident x}:?.$f1)
- (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
- $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
-
-axiom in_Env : 𝔸 × tp → Env → Prop.
-notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
-interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
-
-
-
-inductive judg : list tp → tm → tp → Prop ≝
-| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t
-| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u
-| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u).
-
-definition Env := list (𝔸 × tp).
-
-axiom vclose_env : Env → list tp.
-axiom vclose_tm : Env → tm → tm.
-axiom Lam : 𝔸 → tp → tm → tm.
-definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T.
-definition dom ≝ λG:Env.map ?? (fst ??) G.
-
-definition sctx ≝ 𝔸 × tm.
-axiom swap_tm : 𝔸 → 𝔸 → tm → tm.
-definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M.
-
-axiom in_list : ∀A:Type[0].A → list A → Prop.
-interpretation "list membership" 'mem x l = (in_list ? x l).
-interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)).
-
-axiom in_Env : 𝔸 × tp → Env → Prop.
-notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
-interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
-
-(* axiom Lookup : 𝔸 → Env → option tp. *)
-
-(* forma alto livello del judgment
- t_abs* : ∀G,T,X,M,U.
- (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) →
- Judg G (Lam X T (M[X])) (arr T U) *)
-
-(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *)
-
-axiom Judg_ind : ∀P:Env → tm → tp → Prop.
- (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) →
- (∀G,M,N,T,U.
- Judg G M (arr T U) → Judg G N T →
- P G M (arr T U) → P G N T → P G (app M N) U) →
- (∀G,T1,T2,X,M1.
- (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
- (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
- P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) →
- ∀G,M,T.Judg G M T → P G M T.
-
-axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T.
-axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U.
-axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U).
-
-definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2.
-interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2).
-
-axiom daemon : ∀P:Prop.P.
-
-theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T.
-#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?)
-@(Judg_ind … HJ)
-[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub //
-| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2
- [| @IH1 // | @IH2 // ]
-| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH
- [ (* trivial property of Lam *) @daemon
- | (* trivial property of subenv *) @daemon ]
-]
-qed.
-
-(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e
- ricorsione *)
\ No newline at end of file
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basics/lists/list.ma".
-include "basics/deqsets.ma".
-include "binding/names.ma".
-include "binding/fp.ma".
-
-definition alpha : Nset ≝ X. check alpha
-notation "𝔸" non associative with precedence 90 for @{'alphabet}.
-interpretation "set of names" 'alphabet = alpha.
-
-inductive tp : Type[0] ≝
-| top : tp
-| arr : tp → tp → tp.
-inductive pretm : Type[0] ≝
-| var : nat → pretm
-| par : 𝔸 → pretm
-| abs : tp → pretm → pretm
-| app : pretm → pretm → pretm.
-
-let rec Nth T n (l:list T) on n ≝
- match l with
- [ nil ⇒ None ?
- | cons hd tl ⇒ match n with
- [ O ⇒ Some ? hd
- | S n0 ⇒ Nth T n0 tl ] ].
-
-let rec vclose_tm_aux u x k ≝ match u with
- [ var n ⇒ if (leb k n) then var (S n) else u
- | par x0 ⇒ if (x0 == x) then (var k) else u
- | app v1 v2 ⇒ app (vclose_tm_aux v1 x k) (vclose_tm_aux v2 x k)
- | abs s v ⇒ abs s (vclose_tm_aux v x (S k)) ].
-definition vclose_tm ≝ λu,x.vclose_tm_aux u x O.
-
-definition vopen_var ≝ λn,x,k.match eqb n k with
- [ true ⇒ par x
- | false ⇒ match leb n k with
- [ true ⇒ var n
- | false ⇒ var (pred n) ] ].
-
-let rec vopen_tm_aux u x k ≝ match u with
- [ var n ⇒ vopen_var n x k
- | par x0 ⇒ u
- | app v1 v2 ⇒ app (vopen_tm_aux v1 x k) (vopen_tm_aux v2 x k)
- | abs s v ⇒ abs s (vopen_tm_aux v x (S k)) ].
-definition vopen_tm ≝ λu,x.vopen_tm_aux u x O.
-
-let rec FV u ≝ match u with
- [ par x ⇒ [x]
- | app v1 v2 ⇒ FV v1@FV v2
- | abs s v ⇒ FV v
- | _ ⇒ [ ] ].
-
-definition lam ≝ λx,s,u.abs s (vclose_tm u x).
-
-let rec Pi_map_tm p u on u ≝ match u with
-[ par x ⇒ par (p x)
-| var _ ⇒ u
-| app v1 v2 ⇒ app (Pi_map_tm p v1) (Pi_map_tm p v2)
-| abs s v ⇒ abs s (Pi_map_tm p v) ].
-
-interpretation "permutation of tm" 'middot p x = (Pi_map_tm p x).
-
-notation "hvbox(u⌈x⌉)"
- with precedence 45
- for @{ 'open $u $x }.
-
-(*
-notation "hvbox(u⌈x⌉)"
- with precedence 45
- for @{ 'open $u $x }.
-notation "❴ u ❵ x" non associative with precedence 90 for @{ 'open $u $x }.
-*)
-interpretation "ln term variable open" 'open u x = (vopen_tm u x).
-notation < "hvbox(ν x break . u)"
- with precedence 20
-for @{'nu $x $u }.
-notation > "ν list1 x sep , . term 19 u" with precedence 20
- for ${ fold right @{$u} rec acc @{'nu $x $acc)} }.
-interpretation "ln term variable close" 'nu x u = (vclose_tm u x).
-
-let rec tm_height u ≝ match u with
-[ app v1 v2 ⇒ S (max (tm_height v1) (tm_height v2))
-| abs s v ⇒ S (tm_height v)
-| _ ⇒ O ].
-
-theorem le_n_O_rect_Type0 : ∀n:nat. n ≤ O → ∀P: nat →Type[0]. P O → P n.
-#n (cases n) // #a #abs cases (?:False) /2/ qed.
-
-theorem nat_rect_Type0_1 : ∀n:nat.∀P:nat → Type[0].
-(∀m.(∀p. p < m → P p) → P m) → P n.
-#n #P #H
-cut (∀q:nat. q ≤ n → P q) /2/
-(elim n)
- [#q #HleO (* applica male *)
- @(le_n_O_rect_Type0 ? HleO)
- @H #p #ltpO cases (?:False) /2/ (* 3 *)
- |#p #Hind #q #HleS
- @H #a #lta @Hind @le_S_S_to_le /2/
- ]
-qed.
-
-lemma leb_false_to_lt : ∀n,m. leb n m = false → m < n.
-#n elim n
-[ #m normalize #H destruct(H)
-| #n0 #IH * // #m normalize #H @le_S_S @IH // ]
-qed.
-
-lemma nominal_eta_aux : ∀x,u.x ∉ FV u → ∀k.vclose_tm_aux (vopen_tm_aux u x k) x k = u.
-#x #u elim u
-[ #n #_ #k normalize cases (decidable_eq_nat n k) #Hnk
- [ >Hnk >eqb_n_n whd in ⊢ (??%?); >(\b ?) //
- | >(not_eq_to_eqb_false … Hnk) normalize cases (true_or_false (leb n k)) #Hleb
- [ >Hleb normalize >(?:leb k n = false) //
- @lt_to_leb_false @not_eq_to_le_to_lt /2/
- | >Hleb normalize >(?:leb k (pred n) = true) normalize
- [ cases (leb_false_to_lt … Hleb) //
- | @le_to_leb_true cases (leb_false_to_lt … Hleb) normalize /2/ ] ] ]
-| #y normalize in ⊢ (%→?→?); #Hy whd in ⊢ (?→??%?); >(\bf ?) // @(not_to_not … Hy) //
-| #s #v #IH normalize #Hv #k >IH // @Hv
-| #v1 #v2 #IH1 #IH2 normalize #Hv1v2 #k
- >IH1 [ >IH2 // | @(not_to_not … Hv1v2) @in_list_to_in_list_append_l ]
- @(not_to_not … Hv1v2) @in_list_to_in_list_append_r ]
-qed.
-
-corollary nominal_eta : ∀x,u.x ∉ FV u → (νx.u⌈x⌉) = u.
-#x #u #Hu @nominal_eta_aux //
-qed.
-
-lemma eq_height_vopen_aux : ∀v,x,k.tm_height (vopen_tm_aux v x k) = tm_height v.
-#v #x elim v
-[ #n #k normalize cases (eqb n k) // cases (leb n k) //
-| #u #k %
-| #s #u #IH #k normalize >IH %
-| #u1 #u2 #IH1 #IH2 #k normalize >IH1 >IH2 % ]
-qed.
-
-corollary eq_height_vopen : ∀v,x.tm_height (v⌈x⌉) = tm_height v.
-#v #x @eq_height_vopen_aux
-qed.
-
-theorem pretm_ind_plus_aux :
- ∀P:pretm → Type[0].
- (∀x:𝔸.P (par x)) →
- (∀n:ℕ.P (var n)) →
- (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
- ∀n,u.tm_height u ≤ n → P u.
-#P #Hpar #Hvar #Happ #C #Hlam #n change with ((λn.?) n); @(nat_rect_Type0_1 n ??)
-#m cases m
-[ #_ * /2/
- [ normalize #s #v #Hfalse cases (?:False) cases (not_le_Sn_O (tm_height v)) /2/
- | #v1 #v2 whd in ⊢ (?%?→?); #Hfalse cases (?:False) cases (not_le_Sn_O (S (max ??))) /2/ ] ]
--m #m #IH * /2/
-[ #s #v whd in ⊢ (?%?→?); #Hv
- lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy
- >(?:abs s v = lam y s (v⌈y⌉))
- [| whd in ⊢ (???%); >nominal_eta // @(not_to_not … Hy) @in_list_to_in_list_append_r ]
- @Hlam
- [ @(not_to_not … Hy) @in_list_to_in_list_append_r
- | @(not_to_not … Hy) @in_list_to_in_list_append_l ]
- @IH [| @Hv | >eq_height_vopen % ]
-| #v1 #v2 whd in ⊢ (?%?→?); #Hv @Happ
- [ @IH [| @Hv | // ] | @IH [| @Hv | // ] ] ]
-qed.
-
-corollary pretm_ind_plus :
- ∀P:pretm → Type[0].
- (∀x:𝔸.P (par x)) →
- (∀n:ℕ.P (var n)) →
- (∀v1,v2. P v1 → P v2 → P (app v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s,v.x ∉ FV v → x ∉ C → P (v⌈x⌉) → P (lam x s (v⌈x⌉))) →
- ∀u.P u.
-#P #Hpar #Hvar #Happ #C #Hlam #u @pretm_ind_plus_aux /2/
-qed.
-
-(* maps a permutation to a list of terms *)
-definition Pi_map_list : (𝔸 → 𝔸) → list 𝔸 → list 𝔸 ≝ map 𝔸 𝔸 .
-
-(* interpretation "permutation of name list" 'middot p x = (Pi_map_list p x).*)
-
-(*
-inductive tm : pretm → Prop ≝
-| tm_par : ∀x:𝔸.tm (par x)
-| tm_app : ∀u,v.tm u → tm v → tm (app u v)
-| tm_lam : ∀x,s,u.tm u → tm (lam x s u).
-
-inductive ctx_aux : nat → pretm → Prop ≝
-| ctx_var : ∀n,k.n < k → ctx_aux k (var n)
-| ctx_par : ∀x,k.ctx_aux k (par x)
-| ctx_app : ∀u,v,k.ctx_aux k u → ctx_aux k v → ctx_aux k (app u v)
-(* è sostituibile da ctx_lam ? *)
-| ctx_abs : ∀s,u.ctx_aux (S k) u → ctx_aux k (abs s u).
-*)
-
-inductive tm_or_ctx (k:nat) : pretm → Type[0] ≝
-| toc_var : ∀n.n < k → tm_or_ctx k (var n)
-| toc_par : ∀x.tm_or_ctx k (par x)
-| toc_app : ∀u,v.tm_or_ctx k u → tm_or_ctx k v → tm_or_ctx k (app u v)
-| toc_lam : ∀x,s,u.tm_or_ctx k u → tm_or_ctx k (lam x s u).
-
-definition tm ≝ λt.tm_or_ctx O t.
-definition ctx ≝ λt.tm_or_ctx 1 t.
-
-record TM : Type[0] ≝ {
- pretm_of_TM :> pretm;
- tm_of_TM : tm pretm_of_TM
-}.
-
-record CTX : Type[0] ≝ {
- pretm_of_CTX :> pretm;
- ctx_of_CTX : ctx pretm_of_CTX
-}.
-
-inductive tm2 : pretm → Type[0] ≝
-| tm_par : ∀x.tm2 (par x)
-| tm_app : ∀u,v.tm2 u → tm2 v → tm2 (app u v)
-| tm_lam : ∀x,s,u.x ∉ FV u → (∀y.y ∉ FV u → tm2 (u⌈y⌉)) → tm2 (lam x s (u⌈x⌉)).
-
-(*
-inductive tm' : pretm → Prop ≝
-| tm_par : ∀x.tm' (par x)
-| tm_app : ∀u,v.tm' u → tm' v → tm' (app u v)
-| tm_lam : ∀x,s,u,C.x ∉ FV u → x ∉ C → (∀y.y ∉ FV u → tm' (❴u❵y)) → tm' (lam x s (❴u❵x)).
-*)
-
-axiom swap_inj : ∀N.∀z1,z2,x,y.swap N z1 z2 x = swap N z1 z2 y → x = y.
-
-lemma pi_vclose_tm :
- ∀z1,z2,x,u.swap 𝔸 z1 z2·(νx.u) = (ν swap ? z1 z2 x.swap 𝔸 z1 z2 · u).
-#z1 #z2 #x #u
-change with (vclose_tm_aux ???) in match (vclose_tm ??);
-change with (vclose_tm_aux ???) in ⊢ (???%); lapply O elim u
-[3:whd in ⊢ (?→?→(?→ ??%%)→?→??%%); //
-|4:whd in ⊢ (?→?→(?→??%%)→(?→??%%)→?→??%%); //
-| #n #k whd in ⊢ (??(??%)%); cases (leb k n) normalize %
-| #x0 #k cases (true_or_false (x0==z1)) #H1 >H1 whd in ⊢ (??%%);
- [ cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%);
- [ <(\P H2) >H1 whd in ⊢ (??(??%)%); >(\b ?) // >(\b ?) //
- | >H2 whd in match (swap ????); >H1
- whd in match (if false then var k else ?);
- whd in match (if true then z2 else ?); >(\bf ?)
- [ >(\P H1) >swap_left %
- | <(swap_inv ? z1 z2 z2) in ⊢ (?(??%?)); % #H3
- lapply (swap_inj … H3) >swap_right #H4 <H4 in H2; >H1 #H destruct (H) ]
- ]
- | >(?:(swap ? z1 z2 x0 == swap ? z1 z2 x) = (x0 == x))
- [| cases (true_or_false (x0==x)) #H2 >H2
- [ >(\P H2) @(\b ?) %
- | @(\bf ?) % #H >(swap_inj … H) in H2; >(\b ?) // #H0 destruct (H0) ] ]
- cases (true_or_false (x0==x)) #H2 >H2 whd in ⊢ (??(??%)%);
- [ <(\P H2) >H1 >(\b (refl ??)) %
- | >H1 >H2 % ]
- ]
- ]
-qed.
-
-lemma pi_vopen_tm :
- ∀z1,z2,x,u.swap 𝔸 z1 z2·(u⌈x⌉) = (swap 𝔸 z1 z2 · u⌈swap 𝔸 z1 z2 x⌉).
-#z1 #z2 #x #u
-change with (vopen_tm_aux ???) in match (vopen_tm ??);
-change with (vopen_tm_aux ???) in ⊢ (???%); lapply O elim u //
-[2: #s #v whd in ⊢ ((?→??%%)→?→??%%); //
-|3: #v1 #v2 whd in ⊢ ((?→??%%)→(?→??%%)→?→??%%); /2/ ]
-#n #k whd in ⊢ (??(??%)%); cases (true_or_false (eqb n k)) #H1 >H1 //
-cases (true_or_false (leb n k)) #H2 >H2 normalize //
-qed.
-
-lemma pi_lam :
- ∀z1,z2,x,s,u.swap 𝔸 z1 z2 · lam x s u = lam (swap 𝔸 z1 z2 x) s (swap 𝔸 z1 z2 · u).
-#z1 #z2 #x #s #u whd in ⊢ (???%); <(pi_vclose_tm …) %
-qed.
-
-lemma eqv_FV : ∀z1,z2,u.FV (swap 𝔸 z1 z2 · u) = Pi_map_list (swap 𝔸 z1 z2) (FV u).
-#z1 #z2 #u elim u //
-[ #s #v #H @H
-| #v1 #v2 whd in ⊢ (??%%→??%%→??%%); #H1 #H2 >H1 >H2
- whd in ⊢ (???(????%)); /2/ ]
-qed.
-
-lemma swap_inv_tm : ∀z1,z2,u.swap 𝔸 z1 z2 · (swap 𝔸 z1 z2 · u) = u.
-#z1 #z2 #u elim u
-[1: #n %
-|3: #s #v whd in ⊢ (?→??%%); //
-|4: #v1 #v2 #Hv1 #Hv2 whd in ⊢ (??%%); // ]
-#x whd in ⊢ (??%?); >swap_inv %
-qed.
-
-lemma eqv_in_list : ∀x,l,z1,z2.x ∈ l → swap 𝔸 z1 z2 x ∈ Pi_map_list (swap 𝔸 z1 z2) l.
-#x #l #z1 #z2 #Hin elim Hin
-[ #x0 #l0 %
-| #x1 #x2 #l0 #Hin #IH %2 @IH ]
-qed.
-
-lemma eqv_tm2 : ∀u.tm2 u → ∀z1,z2.tm2 ((swap ? z1 z2)·u).
-#u #Hu #z1 #z2 letin p ≝ (swap ? z1 z2) elim Hu /2/
-#x #s #v #Hx #Hv #IH >pi_lam >pi_vopen_tm %3
-[ @(not_to_not … Hx) -Hx #Hx
- <(swap_inv ? z1 z2 x) <(swap_inv_tm z1 z2 v) >eqv_FV @eqv_in_list //
-| #y #Hy <(swap_inv ? z1 z2 y)
- <pi_vopen_tm @IH @(not_to_not … Hy) -Hy #Hy <(swap_inv ? z1 z2 y)
- >eqv_FV @eqv_in_list //
-]
-qed.
-
-lemma vclose_vopen_aux : ∀x,u,k.vopen_tm_aux (vclose_tm_aux u x k) x k = u.
-#x #u elim u [1,3,4:normalize //]
-[ #n #k cases (true_or_false (leb k n)) #H >H whd in ⊢ (??%?);
- [ cases (true_or_false (eqb (S n) k)) #H1 >H1
- [ <(eqb_true_to_eq … H1) in H; #H lapply (leb_true_to_le … H) -H #H
- cases (le_to_not_lt … H) -H #H cases (H ?) %
- | whd in ⊢ (??%?); >lt_to_leb_false // @le_S_S /2/ ]
- | cases (true_or_false (eqb n k)) #H1 >H1 normalize
- [ >(eqb_true_to_eq … H1) in H; #H lapply (leb_false_to_not_le … H) -H
- * #H cases (H ?) %
- | >le_to_leb_true // @not_lt_to_le % #H2 >le_to_leb_true in H;
- [ #H destruct (H) | /2/ ]
- ]
- ]
-| #x0 #k whd in ⊢ (??(?%??)?); cases (true_or_false (x0==x))
- #H1 >H1 normalize // >(\P H1) >eqb_n_n % ]
-qed.
-
-lemma vclose_vopen : ∀x,u.((νx.u)⌈x⌉) = u. #x #u @vclose_vopen_aux
-qed.
-
-(*
-theorem tm_to_tm : ∀t.tm' t → tm t.
-#t #H elim H
-*)
-
-lemma in_list_singleton : ∀T.∀t1,t2:T.t1 ∈ [t2] → t1 = t2.
-#T #t1 #t2 #H @(in_list_inv_ind ??? H) /2/
-qed.
-
-lemma fresh_vclose_tm_aux : ∀u,x,k.x ∉ FV (vclose_tm_aux u x k).
-#u #x elim u //
-[ #n #k normalize cases (leb k n) normalize //
-| #x0 #k whd in ⊢ (?(???(?%))); cases (true_or_false (x0==x)) #H >H normalize //
- lapply (\Pf H) @not_to_not #Hin >(in_list_singleton ??? Hin) %
-| #v1 #v2 #IH1 #IH2 #k normalize % #Hin cases (in_list_append_to_or_in_list ???? Hin) -Hin #Hin
- [ cases (IH1 k) -IH1 #IH1 @IH1 @Hin | cases (IH2 k) -IH2 #IH2 @IH2 @Hin ]
-qed.
-
-lemma fresh_vclose_tm : ∀u,x.x ∉ FV (νx.u). //
-qed.
-
-lemma fresh_swap_tm : ∀z1,z2,u.z1 ∉ FV u → z2 ∉ FV u → swap 𝔸 z1 z2 · u = u.
-#z1 #z2 #u elim u
-[2: normalize in ⊢ (?→%→%→?); #x #Hz1 #Hz2 whd in ⊢ (??%?); >swap_other //
- [ @(not_to_not … Hz2) | @(not_to_not … Hz1) ] //
-|1: //
-| #s #v #IH normalize #Hz1 #Hz2 >IH // [@Hz2|@Hz1]
-| #v1 #v2 #IH1 #IH2 normalize #Hz1 #Hz2
- >IH1 [| @(not_to_not … Hz2) @in_list_to_in_list_append_l | @(not_to_not … Hz1) @in_list_to_in_list_append_l ]
- >IH2 // [@(not_to_not … Hz2) @in_list_to_in_list_append_r | @(not_to_not … Hz1) @in_list_to_in_list_append_r ]
-]
-qed.
-
-theorem tm_to_tm2 : ∀u.tm u → tm2 u.
-#t #Ht elim Ht
-[ #n #Hn cases (not_le_Sn_O n) #Hfalse cases (Hfalse Hn)
-| @tm_par
-| #u #v #Hu #Hv @tm_app
-| #x #s #u #Hu #IHu <(vclose_vopen x u) @tm_lam
- [ @fresh_vclose_tm
- | #y #Hy <(fresh_swap_tm x y (νx.u)) /2/ @fresh_vclose_tm ]
-]
-qed.
-
-theorem tm2_to_tm : ∀u.tm2 u → tm u.
-#u #pu elim pu /2/ #x #s #v #Hx #Hv #IH %4 @IH //
-qed.
-
-definition PAR ≝ λx.mk_TM (par x) ?. // qed.
-definition APP ≝ λu,v:TM.mk_TM (app u v) ?./2/ qed.
-definition LAM ≝ λx,s.λu:TM.mk_TM (lam x s u) ?./2/ qed.
-
-axiom vopen_tm_down : ∀u,x,k.tm_or_ctx (S k) u → tm_or_ctx k (u⌈x⌉).
-(* needs true_plus_false
-
-#u #x #k #Hu elim Hu
-[ #n #Hn normalize cases (true_or_false (eqb n O)) #H >H [%2]
- normalize >(?: leb n O = false) [|cases n in H; // >eqb_n_n #H destruct (H) ]
- normalize lapply Hn cases n in H; normalize [ #Hfalse destruct (Hfalse) ]
- #n0 #_ #Hn0 % @le_S_S_to_le //
-| #x0 %2
-| #v1 #v2 #Hv1 #Hv2 #IH1 #IH2 %3 //
-| #x0 #s #v #Hv #IH normalize @daemon
-]
-qed.
-*)
-
-definition vopen_TM ≝ λu:CTX.λx.mk_TM (u⌈x⌉) (vopen_tm_down …). @ctx_of_CTX qed.
-
-axiom vclose_tm_up : ∀u,x,k.tm_or_ctx k u → tm_or_ctx (S k) (νx.u).
-
-definition vclose_TM ≝ λu:TM.λx.mk_CTX (νx.u) (vclose_tm_up …). @tm_of_TM qed.
-
-interpretation "ln wf term variable open" 'open u x = (vopen_TM u x).
-interpretation "ln wf term variable close" 'nu x u = (vclose_TM u x).
-
-theorem tm_alpha : ∀x,y,s,u.x ∉ FV u → y ∉ FV u → lam x s (u⌈x⌉) = lam y s (u⌈y⌉).
-#x #y #s #u #Hx #Hy whd in ⊢ (??%%); @eq_f >nominal_eta // >nominal_eta //
-qed.
-
-theorem TM_ind_plus :
-(* non si può dare il principio in modo dipendente (almeno utilizzando tm2)
- la "prova" purtroppo è in Type e non si può garantire che sia esattamente
- quella che ci aspetteremmo
- *)
- ∀P:pretm → Type[0].
- (∀x:𝔸.P (PAR x)) →
- (∀v1,v2:TM.P v1 → P v2 → P (APP v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s.∀v:CTX.x ∉ FV v → x ∉ C →
- (∀y.y ∉ FV v → P (v⌈y⌉)) → P (LAM x s (v⌈x⌉))) →
- ∀u:TM.P u.
-#P #Hpar #Happ #C #Hlam * #u #pu elim (tm_to_tm2 u pu) //
-[ #v1 #v2 #pv1 #pv2 #IH1 #IH2 @(Happ (mk_TM …) (mk_TM …)) /2/
-| #x #s #v #Hx #pv #IH
- lapply (p_fresh … (C@FV v)) letin x0 ≝ (N_fresh … (C@FV v)) #Hx0
- >(?:lam x s (v⌈x⌉) = lam x0 s (v⌈x0⌉))
- [|@tm_alpha // @(not_to_not … Hx0) @in_list_to_in_list_append_r ]
- @(Hlam x0 s (mk_CTX v ?) ??)
- [ <(nominal_eta … Hx) @vclose_tm_up @tm2_to_tm @pv //
- | @(not_to_not … Hx0) @in_list_to_in_list_append_r
- | @(not_to_not … Hx0) @in_list_to_in_list_append_l
- | @IH ]
-]
-qed.
-
-notation
-"hvbox('nominal' u 'return' out 'with'
- [ 'xpar' ident x ⇒ f1
- | 'xapp' ident v1 ident v2 ident recv1 ident recv2 ⇒ f2
- | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident recw ⇒ f3 ])"
-with precedence 48
-for @{ TM_ind_plus $out (λ${ident x}:?.$f1)
- (λ${ident v1}:?.λ${ident v2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2)
- $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident recw}:?.$f3)
- $u }.
-
-(* include "basics/jmeq.ma".*)
-
-definition subst ≝ (λu:TM.λx,v.
- nominal u return (λ_.TM) with
- [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ]
- | xapp v1 v2 recv1 recv2 ⇒ APP recv1 recv2
- | xlam ❨y # x::FV v❩ s w py1 py2 recw ⇒ LAM y s (recw y py1) ]).
-
-lemma fasfd : ∀s,v. pretm_of_TM (subst (LAM O s (PAR 1)) O v) = pretm_of_TM (LAM O s (PAR 1)).
-#s #v normalize in ⊢ (??%?);
-
-
-theorem tm2_ind_plus :
-(* non si può dare il principio in modo dipendente (almeno utilizzando tm2) *)
- ∀P:pretm → Type[0].
- (∀x:𝔸.P (par x)) →
- (∀v1,v2.tm2 v1 → tm2 v2 → P v1 → P v2 → P (app v1 v2)) →
- ∀C:list 𝔸.
- (∀x,s,v.x ∉ FV v → x ∉ C → (∀y.y ∉ FV v → tm2 (v⌈y⌉)) →
- (∀y.y ∉ FV v → P (v⌈y⌉)) → P (lam x s (v⌈x⌉))) →
- ∀u.tm2 u → P u.
-#P #Hpar #Happ #C #Hlam #u #pu elim pu /2/
-#x #s #v #px #pv #IH
-lapply (p_fresh … (C@FV v)) letin y ≝ (N_fresh … (C@FV v)) #Hy
->(?:lam x s (v⌈x⌉) = lam y s (v⌈y⌉)) [| @tm_alpha // @(not_to_not … Hy) @in_list_to_in_list_append_r ]
-@Hlam /2/ lapply Hy -Hy @not_to_not #Hy
-[ @in_list_to_in_list_append_r @Hy | @in_list_to_in_list_append_l @Hy ]
-qed.
-
-definition check_tm ≝
- λu.pretm_ind_plus ? (λ_.true) (λ_.false)
- (λv1,v2,r1,r2.r1 ∧ r2) [ ] (λx,s,v,pv1,pv2,rv.rv) u.
-
-(*
-lemma check_tm_complete : ∀u.tm u → check_tm u = true.
-#u #pu @(tm2_ind_plus … [ ] … (tm_to_tm2 ? pu)) //
-[ #v1 #v2 #pv1 #pv2 #IH1 #IH2
-| #x #s #v #Hx1 #Hx2 #Hv #IH
-*)
-
-notation
-"hvbox('nominal' u 'return' out 'with'
- [ 'xpar' ident x ⇒ f1
- | 'xapp' ident v1 ident v2 ident pv1 ident pv2 ident recv1 ident recv2 ⇒ f2
- | 'xlam' ❨ident y # C❩ ident s ident w ident py1 ident py2 ident pw ident recw ⇒ f3 ])"
-with precedence 48
-for @{ tm2_ind_plus $out (λ${ident x}:?.$f1)
- (λ${ident v1}:?.λ${ident v2}:?.λ${ident pv1}:?.λ${ident pv2}:?.λ${ident recv1}:?.λ${ident recv2}:?.$f2)
- $C (λ${ident y}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.λ${ident pw}:?.λ${ident recw}:?.$f3)
- ? (tm_to_tm2 ? $u) }.
-(* notation
-"hvbox('nominal' u 'with'
- [ 'xlam' ident x # C ident s ident w ⇒ f3 ])"
-with precedence 48
-for @{ tm2_ind_plus ???
- $C (λ${ident x}:?.λ${ident s}:?.λ${ident w}:?.λ${ident py1}:?.λ${ident py2}:?.
- λ${ident pw}:?.λ${ident recw}:?.$f3) $u (tm_to_tm2 ??) }.
-*)
-
-
-definition subst ≝ (λu.λpu:tm u.λx,v.
- nominal pu return (λ_.pretm) with
- [ xpar x0 ⇒ match x == x0 with [ true ⇒ v | false ⇒ u ]
- | xapp v1 v2 pv1 pv2 recv1 recv2 ⇒ app recv1 recv2
- | xlam ❨y # x::FV v❩ s w py1 py2 pw recw ⇒ lam y s (recw y py1) ]).
-
-lemma fasfd : ∀x,s,u,p1,v. subst (lam x s u) p1 x v = lam x s u.
-#x #s #u #p1 #v
-
-
-definition subst ≝ λu.λpu:tm u.λx,y.
- tm2_ind_plus ?
- (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ])
- (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2)
- (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1))
- u (tm_to_tm2 … pu).
-check subst
-definition subst ≝ λu.λpu:tm u.λx,v.
- nominal u with
- [ xlam y # (x::FV v) s w ^ ? ].
-
-(*
-notation > "Λ ident x. ident T [ident x] ↦ P"
- with precedence 48 for @{'foo (λ${ident x}.λ${ident T}.$P)}.
-
-notation < "Λ ident x. ident T [ident x] ↦ P"
- with precedence 48 for @{'foo (λ${ident x}:$Q.λ${ident T}:$R.$P)}.
-*)
-
-(*
-notation
-"hvbox('nominal' u 'with'
- [ 'xpar' ident x ⇒ f1
- | 'xapp' ident v1 ident v2 ⇒ f2
- | 'xlam' ident x # C s w ⇒ f3 ])"
-with precedence 48
-for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
- (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
- $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
-*)
-
-(*
-notation
-"hvbox('nominal' u 'with'
- [ 'xpar' ident x ^ f1
- | 'xapp' ident v1 ident v2 ^ f2 ])"
-(* | 'xlam' ident x # C s w ^ f3 ]) *)
-with precedence 48
-for @{ tm2_ind_plus ? (λ${ident x}:$Tx.$f1)
- (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
- $C (λ${ident x}:$Tx.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
-*)
-notation
-"hvbox('nominal' u 'with'
- [ 'xpar' ident x ^ f1
- | 'xapp' ident v1 ident v2 ^ f2 ])"
-with precedence 48
-for @{ tm2_ind_plus ? (λ${ident x}:?.$f1)
- (λ${ident v1}:$Tv1.λ${ident v2}:$Tv2.λ${ident pv1}:$Tpv1.λ${ident pv2}:$Tpv2.λ${ident recv1}:$Trv1.λ${ident recv2}:$Trv2.$f2)
- $C (λ${ident x}:?.λ${ident s}:$Ts.λ${ident w}:$Tw.λ${ident py1}:$Tpy1.λ${ident py2}:$Tpy2.λ${ident pw}:$Tpw.λ${ident recw}:$Trw.$f3) $u (tm_to_tm2 ??) }.
-
-
-definition subst ≝ λu.λpu:tm u.λx,v.
- nominal u with
- [ xpar x0 ^ match x == x0 with [ true ⇒ v | false ⇒ u ]
- | xapp v1 v2 ^ ? ].
- | xlam y # (x::FV v) s w ^ ? ].
-
-
- (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ])
- (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2)
- (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1))
- u (tm_to_tm2 … pu).
-
-
-*)
-definition subst ≝ λu.λpu:tm u.λx,v.
- tm2_ind_plus ?
- (* par x0 *) (λx0.match x == x0 with [ true ⇒ v | false ⇒ u ])
- (* app v1 v2 *) (λv1,v2,pv1,pv2,recv1,recv2.app recv1 recv2)
- (* lam y#(x::FV v) s w *) (x::FV v) (λy,s,w,py1,py2,pw,recw.lam y s (recw y py1))
- u (tm_to_tm2 … pu).
-
-check subst
-
-
-axiom in_Env : 𝔸 × tp → Env → Prop.
-notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
-interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
-
-
-
-inductive judg : list tp → tm → tp → Prop ≝
-| t_var : ∀g,n,t.Nth ? n g = Some ? t → judg g (var n) t
-| t_app : ∀g,m,n,t,u.judg g m (arr t u) → judg g n t → judg g (app m n) u
-| t_abs : ∀g,t,m,u.judg (t::g) m u → judg g (abs t m) (arr t u).
-
-definition Env := list (𝔸 × tp).
-
-axiom vclose_env : Env → list tp.
-axiom vclose_tm : Env → tm → tm.
-axiom Lam : 𝔸 → tp → tm → tm.
-definition Judg ≝ λG,M,T.judg (vclose_env G) (vclose_tm G M) T.
-definition dom ≝ λG:Env.map ?? (fst ??) G.
-
-definition sctx ≝ 𝔸 × tm.
-axiom swap_tm : 𝔸 → 𝔸 → tm → tm.
-definition sctx_app : sctx → 𝔸 → tm ≝ λM0,Y.let 〈X,M〉 ≝ M0 in swap_tm X Y M.
-
-axiom in_list : ∀A:Type[0].A → list A → Prop.
-interpretation "list membership" 'mem x l = (in_list ? x l).
-interpretation "list non-membership" 'notmem x l = (Not (in_list ? x l)).
-
-axiom in_Env : 𝔸 × tp → Env → Prop.
-notation "X ◃ G" non associative with precedence 45 for @{'lefttriangle $X $G}.
-interpretation "Env membership" 'lefttriangle x l = (in_Env x l).
-
-let rec FV M ≝ match M with
- [ par X ⇒ [X]
- | app M1 M2 ⇒ FV M1@FV M2
- | abs T M0 ⇒ FV M0
- | _ ⇒ [ ] ].
-
-(* axiom Lookup : 𝔸 → Env → option tp. *)
-
-(* forma alto livello del judgment
- t_abs* : ∀G,T,X,M,U.
- (∀Y ∉ supp(M).Judg (〈Y,T〉::G) (M[Y]) U) →
- Judg G (Lam X T (M[X])) (arr T U) *)
-
-(* prima dimostrare, poi perfezionare gli assiomi, poi dimostrarli *)
-
-axiom Judg_ind : ∀P:Env → tm → tp → Prop.
- (∀X,G,T.〈X,T〉 ◃ G → P G (par X) T) →
- (∀G,M,N,T,U.
- Judg G M (arr T U) → Judg G N T →
- P G M (arr T U) → P G N T → P G (app M N) U) →
- (∀G,T1,T2,X,M1.
- (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → Judg (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
- (∀Y.Y ∉ (FV (Lam X T1 (sctx_app M1 X))) → P (〈Y,T1〉::G) (sctx_app M1 Y) T2) →
- P G (Lam X T1 (sctx_app M1 X)) (arr T1 T2)) →
- ∀G,M,T.Judg G M T → P G M T.
-
-axiom t_par : ∀X,G,T.〈X,T〉 ◃ G → Judg G (par X) T.
-axiom t_app2 : ∀G,M,N,T,U.Judg G M (arr T U) → Judg G N T → Judg G (app M N) U.
-axiom t_Lam : ∀G,X,M,T,U.Judg (〈X,T〉::G) M U → Judg G (Lam X T M) (arr T U).
-
-definition subenv ≝ λG1,G2.∀x.x ◃ G1 → x ◃ G2.
-interpretation "subenv" 'subseteq G1 G2 = (subenv G1 G2).
-
-axiom daemon : ∀P:Prop.P.
-
-theorem weakening : ∀G1,G2,M,T.G1 ⊆ G2 → Judg G1 M T → Judg G2 M T.
-#G1 #G2 #M #T #Hsub #HJ lapply Hsub lapply G2 -G2 change with (∀G2.?)
-@(Judg_ind … HJ)
-[ #X #G #T0 #Hin #G2 #Hsub @t_par @Hsub //
-| #G #M0 #N #T0 #U #HM0 #HN #IH1 #IH2 #G2 #Hsub @t_app2
- [| @IH1 // | @IH2 // ]
-| #G #T1 #T2 #X #M1 #HM1 #IH #G2 #Hsub @t_Lam @IH
- [ (* trivial property of Lam *) @daemon
- | (* trivial property of subenv *) @daemon ]
-]
-qed.
-
-(* Serve un tipo Tm per i termini localmente chiusi e i suoi principi di induzione e
- ricorsione *)
\ No newline at end of file
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basics/logic.ma".
-include "basics/lists/in.ma".
-include "basics/types.ma".
-
-(*interpretation "list membership" 'mem x l = (in_list ? x l).*)
-
-record Nset : Type[1] ≝
-{
- (* carrier is specified as a coercion: when an object X of type Nset is
- given, but something of type Type is expected, Matita will insert a
- hidden coercion: the user sees "X", but really means "carrier X" *)
- carrier :> DeqSet;
- N_fresh : list carrier → carrier;
- p_fresh : ∀l.N_fresh l ∉ l
-}.
-
-definition maxlist ≝
- λl.foldr ?? (λx,acc.max x acc) 0 l.
-
-definition natfresh ≝ λl.S (maxlist l).
-
-lemma le_max_1 : ∀x,y.x ≤ max x y. /2/
-qed.
-
-lemma le_max_2 : ∀x,y.y ≤ max x y. /2/
-qed.
-
-lemma le_maxlist : ∀l,x.x ∈ l → x ≤ maxlist l.
-#l elim l
-[#x #Hx @False_ind cases (not_in_list_nil ? x) #H1 /2/
-|#y #tl #IH #x #H1 change with (max ??) in ⊢ (??%);
- cases (in_list_cons_case ???? H1);#H2;
- [ >H2 @le_max_1
- | whd in ⊢ (??%); lapply (refl ? (leb y (maxlist tl)));
- cases (leb y (maxlist tl)) in ⊢ (???% → %);#H3
- [ @IH //
- | lapply (IH ? H2) #H4
- lapply (leb_false_to_not_le … H3) #H5
- lapply (not_le_to_lt … H5) #H6
- @(transitive_le … H4)
- @(transitive_le … H6) %2 %
- ]
- ]
-]
-qed.
-
-(* prove freshness for nat *)
-lemma lt_l_natfresh_l : ∀l,x.x ∈ l → x < natfresh l.
-#l #x #H1 @le_S_S /2/
-qed.
-
-(*naxiom p_Xfresh : ∀l.∀x:Xcarr.x ∈ l → x ≠ ntm (Xfresh l) ∧ x ≠ ntp (Xfresh l).*)
-lemma p_natfresh : ∀l.natfresh l ∉ l.
-#l % #H1 lapply (lt_l_natfresh_l … H1) #H2
-cases (lt_to_not_eq … H2) #H3 @H3 %
-qed.
-
-include "basics/finset.ma".
-
-definition X : Nset ≝ mk_Nset DeqNat ….
-[ @natfresh
-| @p_natfresh
-]
-qed.
\ No newline at end of file
+FAILING FILES 2018-12-17
+
matitac.opt binding/fp.ma
matitac.opt binding/ln_concrete.ma
matitac.opt binding/ln.ma
matitac.opt binding/names.ma
+matitac.opt extraction.ma
matitac.opt finite_lambda/confluence.ma
matitac.opt finite_lambda/reduction.ma
matitac.opt finite_lambda/terms_and_types.ma
(**************************************************************************)
include "pts_dummy/rc_hsat.ma".
+include "basics/core_notation/napart_2.ma".
(*
(* THE EVALUATION *************************************************************)
(**************************************************************************)
include "pts_dummy/rc_hsat.ma".
+include "basics/core_notation/napart_2.ma".
(*
(* THE EVALUATION *************************************************************)
--- /dev/null
+include "reverse_complexity/speedup.ma".
+
+definition aes : (nat → nat) → (nat → nat) → Prop ≝ λf,g.
+ ∃n.∀m. n ≤ m → f m = g m.
+
+lemma CF_almost: ∀f,g,s. CF s g → aes g f → CF s f.
+#f #g #s #CFg * #n lapply CFg -CFg lapply g -g
+elim n
+ [#g #CFg #H @(ext_CF … g) [#m @H // |//]
+ |#i #Hind #g #CFg #H
+ @(Hind (λx. if eqb i x then f i else g x))
+ [@CF_if
+ [@(O_to_CF … MSC) [@le_to_O @(MSC_in … CFg)] @CF_eqb //
+ |@(O_to_CF … MSC) [@le_to_O @(MSC_in … CFg)] @CF_const
+ |@CFg
+ ]
+ |#m #leim cases (le_to_or_lt_eq … leim)
+ [#ltim lapply (lt_to_not_eq … ltim) #noteqim
+ >(not_eq_to_eqb_false … noteqim) @H @ltim
+ |#eqim >eqim >eqb_n_n //
+ ]
+ ]
+ ]
+qed.
\ No newline at end of file
--- /dev/null
+include "basics/types.ma".
+include "arithmetics/nat.ma".
+
+(********************************** pairing ***********************************)
+axiom pair: nat → nat → nat.
+axiom fst : nat → nat.
+axiom snd : nat → nat.
+
+interpretation "abstract pair" 'pair f g = (pair f g).
+
+axiom fst_pair: ∀a,b. fst 〈a,b〉 = a.
+axiom snd_pair: ∀a,b. snd 〈a,b〉 = b.
+axiom surj_pair: ∀x. ∃a,b. x = 〈a,b〉.
+
+axiom le_fst : ∀p. fst p ≤ p.
+axiom le_snd : ∀p. snd p ≤ p.
+axiom le_pair: ∀a,a1,b,b1. a ≤ a1 → b ≤ b1 → 〈a,b〉 ≤ 〈a1,b1〉.
+
+lemma expand_pair: ∀x. x = 〈fst x, snd x〉.
+#x lapply (surj_pair x) * #a * #b #Hx >Hx >fst_pair >snd_pair //
+qed.
+
+(************************************* U **************************************)
+axiom U: nat → nat →nat → option nat.
+
+axiom monotonic_U: ∀i,x,n,m,y.n ≤m →
+ U i x n = Some ? y → U i x m = Some ? y.
+
+lemma unique_U: ∀i,x,n,m,yn,ym.
+ U i x n = Some ? yn → U i x m = Some ? ym → yn = ym.
+#i #x #n #m #yn #ym #Hn #Hm cases (decidable_le n m)
+ [#lenm lapply (monotonic_U … lenm Hn) >Hm #HS destruct (HS) //
+ |#ltmn lapply (monotonic_U … n … Hm) [@lt_to_le @not_le_to_lt //]
+ >Hn #HS destruct (HS) //
+ ]
+qed.
+
+definition code_for ≝ λf,i.∀x.
+ ∃n.∀m. n ≤ m → U i x m = f x.
+
+definition terminate ≝ λi,x,r. ∃y. U i x r = Some ? y.
+
+notation "{i ⊙ x} ↓ r" with precedence 60 for @{terminate $i $x $r}.
+
+lemma terminate_dec: ∀i,x,n. {i ⊙ x} ↓ n ∨ ¬ {i ⊙ x} ↓ n.
+#i #x #n normalize cases (U i x n)
+ [%2 % * #y #H destruct|#y %1 %{y} //]
+qed.
+
+lemma monotonic_terminate: ∀i,x,n,m.
+ n ≤ m → {i ⊙ x} ↓ n → {i ⊙ x} ↓ m.
+#i #x #n #m #lenm * #z #H %{z} @(monotonic_U … H) //
+qed.
+
+definition termb ≝ λi,x,t.
+ match U i x t with [None ⇒ false |Some y ⇒ true].
+
+lemma termb_true_to_term: ∀i,x,t. termb i x t = true → {i ⊙ x} ↓ t.
+#i #x #t normalize cases (U i x t) normalize [#H destruct | #y #_ %{y} //]
+qed.
+
+lemma term_to_termb_true: ∀i,x,t. {i ⊙ x} ↓ t → termb i x t = true.
+#i #x #t * #y #H normalize >H //
+qed.
+
+definition out ≝ λi,x,r.
+ match U i x r with [ None ⇒ 0 | Some z ⇒ z].
+
+definition bool_to_nat: bool → nat ≝
+ λb. match b with [true ⇒ 1 | false ⇒ 0].
+
+coercion bool_to_nat.
+
+definition pU : nat → nat → nat → nat ≝ λi,x,r.〈termb i x r,out i x r〉.
+
+lemma pU_vs_U_Some : ∀i,x,r,y. pU i x r = 〈1,y〉 ↔ U i x r = Some ? y.
+#i #x #r #y % normalize
+ [cases (U i x r) normalize
+ [#H cut (0=1) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H @H]
+ #H1 destruct
+ |#a #H cut (a=y) [lapply (eq_f … snd … H) >snd_pair >snd_pair #H1 @H1]
+ #H1 //
+ ]
+ |#H >H //]
+qed.
+
+lemma pU_vs_U_None : ∀i,x,r. pU i x r = 〈0,0〉 ↔ U i x r = None ?.
+#i #x #r % normalize
+ [cases (U i x r) normalize //
+ #a #H cut (1=0) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H1 @H1]
+ #H1 destruct
+ |#H >H //]
+qed.
+
+lemma fst_pU: ∀i,x,r. fst (pU i x r) = termb i x r.
+#i #x #r normalize cases (U i x r) normalize >fst_pair //
+qed.
+
+lemma snd_pU: ∀i,x,r. snd (pU i x r) = out i x r.
+#i #x #r normalize cases (U i x r) normalize >snd_pair //
+qed.
+
+
+definition total ≝ λf.λx:nat. Some nat (f x).
+
+
--- /dev/null
+include "reverse_complexity/complexity.ma".
+include "reverse_complexity/sigma_diseq.ma".
+
+include alias "reverse_complexity/basics.ma".
+
+lemma bigop_prim_rec: ∀a,b,c,p,f,x.
+ bigop (b x-a x) (λi:ℕ.p 〈i+a x,x〉) ? (c 〈a x,x〉) plus (λi:ℕ.f 〈i+a x,x〉) =
+ prim_rec c
+ (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉
+ then plus (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (b x-a x) 〈a x ,x〉.
+#a #b #c #p #f #x normalize elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma bigop_prim_rec_dec: ∀a,b,c,p,f,x.
+ bigop (b x-a x) (λi:ℕ.p 〈b x -i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x-i,x〉) =
+ prim_rec c
+ (λi.if p 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉
+ then plus (f 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (b x-a x) 〈b x ,x〉.
+#a #b #c #p #f #x normalize elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma bigop_prim_rec_dec1: ∀a,b,c,p,f,x.
+ bigop (S(b x)-a x) (λi:ℕ.p 〈b x - i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x- i,x〉) =
+ prim_rec c
+ (λi.if p 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉
+ then plus (f 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (S(b x)-a x) 〈b x,x〉.
+#a #b #c #p #f #x elim (S(b x)-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma sum_prim_rec1: ∀a,b,p,f,x.
+ ∑_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉
+ then f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉 + fst (snd i)
+ else fst (snd i)) (b x-a x) 〈a x ,x〉.
+#a #b #p #f #x elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma bigop_plus_c: ∀k,p,f,c.
+ c k + bigop k (λi.p i) ? 0 plus (λi.f i) =
+ bigop k (λi.p i) ? (c k) plus (λi.f i).
+#k #p #f elim k [normalize //]
+#i #Hind #c cases (true_or_false (p i)) #Hcase
+[>bigop_Strue // >bigop_Strue // <associative_plus >(commutative_plus ? (f i))
+ >associative_plus @eq_f @Hind
+|>bigop_Sfalse // >bigop_Sfalse //
+]
+qed.
+
+
+(*********************************** maximum **********************************)
+
+lemma max_gen: ∀a,b,p,f,x. a ≤b →
+ max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) = max_{i < b | leb a i ∧ p 〈i,x〉 }(f 〈i,x〉).
+#a #b #p #f #x @(bigop_I_gen ????? MaxA)
+qed.
+
+lemma max_prim_rec_base: ∀a,b,p,f,x. a ≤b →
+ max_{i < b| p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x.
+#a #b #p #f #x #leab >max_gen // elim b
+ [normalize //
+ |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma max_prim_rec: ∀a,b,p,f,x. a ≤b →
+ max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if leb a (fst i) ∧ p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x.
+#a #b #p #f #x #leab >max_gen // elim b
+ [normalize //
+ |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair
+ cases (true_or_false (leb a i ∧ p 〈i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma max_prim_rec1: ∀a,b,p,f,x.
+ max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉
+ then max (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (b x-a x) 〈a x ,x〉.
+#a #b #p #f #x elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+(* the argument is 〈b-a,〈a,x〉〉 *)
+
+definition max_unary_pr ≝ λp,f.unary_pr (λx.0)
+ (λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let a ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ if p 〈k + a,x〉 then max (f 〈k+a,x〉) r else r).
+
+lemma max_unary_pr1: ∀a,b,p,f,x.
+ max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) =
+ ((max_unary_pr p f) ∘ (λx.〈b x - a x,〈a x,x〉〉)) x.
+#a #b #p #f #x normalize >fst_pair >snd_pair @max_prim_rec1
+qed.
+
+definition aux_compl ≝ λhp,hf.λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let a ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hp 〈k+a,x〉 + hf 〈k+a,x〉 + (* was MSC r*) MSC i .
+
+definition aux_compl1 ≝ λhp,hf.λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let a ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r.
+
+lemma aux_compl1_def: ∀k,r,m,hp,hf.
+ aux_compl1 hp hf 〈k,〈r,m〉〉 =
+ let a ≝ fst m in
+ let x ≝ snd m in
+ hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r.
+#k #r #m #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair //
+qed.
+
+lemma aux_compl1_def1: ∀k,r,a,x,hp,hf.
+ aux_compl1 hp hf 〈k,〈r,〈a,x〉〉〉 = hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r.
+#k #r #a #x #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair
+>fst_pair >snd_pair //
+qed.
+
+axiom Oaux_compl: ∀hp,hf. O (aux_compl1 hp hf) (aux_compl hp hf).
+
+lemma MSC_max: ∀f,h,x. CF h f → MSC (max_{i < x}(f i)) ≤ max_{i < x}(h i).
+#f #h #x #hf elim x // #i #Hind >bigop_Strue [|//] >bigop_Strue [|//]
+whd in match (max ??);
+cases (true_or_false (leb (f i) (bigop i (λi0:ℕ.true) ? 0 max(λi0:ℕ.f i0))))
+#Hcase >Hcase
+ [@(transitive_le … Hind) @le_maxr //
+ |@(transitive_le … (MSC_out … hf i)) @le_maxl //
+ ]
+qed.
+
+lemma CF_max: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s.
+ CF ha a → CF hb b → CF hp p → CF hf f →
+ O s (λx.ha x + hb x +
+ (∑_{i ∈[a x ,b x[ }
+ (hp 〈i,x〉 + hf 〈i,x〉 + max_{i ∈ [a x, b x [ }(hf 〈i,x〉)))) →
+ CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)).
+#a #b #p #f #ha #hb #hp #hf #s #CFa #CFb #CFp #CFf #HO
+@ext_CF1 [|#x @max_unary_pr1]
+@(CF_comp ??? (λx.ha x + hb x))
+ [|@CF_comp_pair
+ [@CF_minus [@(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //]
+ |@CF_comp_pair
+ [@(O_to_CF … CFa) @O_plus_l //
+ | @(O_to_CF … CF_id) @O_plus_r @le_to_O @(MSC_in … CFb)
+ ]
+ ]
+ |@(CF_prim_rec … MSC … (aux_compl1 hp hf))
+ [@CF_const
+ |@(O_to_CF … (Oaux_compl … ))
+ @CF_if
+ [@(CF_comp p … MSC … CFp)
+ [@CF_comp_pair
+ [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd]
+ |@CF_comp_snd @CF_comp_snd @CF_snd]
+ |@le_to_O #x normalize >commutative_plus >associative_plus @le_plus //
+ ]
+ |@CF_max1
+ [@(CF_comp f … MSC … CFf)
+ [@CF_comp_pair
+ [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd]
+ |@CF_comp_snd @CF_comp_snd @CF_snd]
+ |@le_to_O #x normalize >commutative_plus //
+ ]
+ |@CF_comp_fst @(monotonic_CF … CF_snd) normalize //
+ ]
+ |@CF_comp_fst @(monotonic_CF … CF_snd) normalize //
+ ]
+ |@O_refl
+ ]
+ |@(O_trans … HO) -HO
+ @(O_trans ? (λx:ℕ
+ .ha x+hb x
+ +bigop (b x-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus
+ (λi:ℕ
+ .(λi0:ℕ
+ .hp 〈i0,x〉+hf 〈i0,x〉
+ +bigop (b x-a x) (λi1:ℕ.true) ? 0 max
+ (λi1:ℕ.(λi2:ℕ.hf 〈i2,x〉) (i1+a x))) (i+a x))))
+ [
+ @le_to_O #n @le_plus // whd in match (unary_pr ???);
+ >fst_pair >snd_pair >bigop_prim_rec elim (b n - a n)
+ [normalize //
+ |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >aux_compl1_def1
+ >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus
+ [-Hind @le_plus // normalize >fst_pair >snd_pair
+ @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 )
+ (λi1:ℕ.hf 〈i1+a n,n〉)))
+ [elim x [normalize @MSC_le]
+ #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair
+ >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize
+ [cases (true_or_false (leb (f 〈x0+a n,n〉)
+ (prim_rec (λx00:ℕ.O)
+ (λi:ℕ
+ .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉)
+ (fst (snd i))
+ then fst (snd i)
+ else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize
+ [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ |@(transitive_le … (MSC_out … CFf …)) @(le_maxl … (le_n …))
+ ]
+ |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ ]
+ |@(le_maxr … (le_n …))
+ ]
+ |@(transitive_le … Hind) -Hind
+ generalize in match (bigop x (λi:ℕ.true) ? 0 max
+ (λi1:ℕ.(λi2:ℕ.hf 〈i2,n〉) (i1+a n))); #c
+ generalize in match (hf 〈x+a n,n〉); #c1
+ elim x [//] #x0 #Hind
+ >prim_rec_S >prim_rec_S normalize >fst_pair >fst_pair >snd_pair
+ >snd_pair >snd_pair >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair
+ >fst_pair @le_plus
+ [@le_plus // cases (true_or_false (leb c1 c)) #Hcase
+ >Hcase normalize // @lt_to_le @not_le_to_lt @(leb_false_to_not_le ?? Hcase)
+ |@Hind
+ ]
+ ]
+ ]
+ |@O_plus [@O_plus_l //] @le_to_O #x
+ <bigop_plus_c @le_plus // @(transitive_le … (MSC_pair …)) @le_plus
+ [@MSC_out @CFa | @MSC_out @(O_to_CF MSC … (CF_const x)) @le_to_O @(MSC_in … CFb)]
+ ]
+qed.
+
+axiom daemon : ∀P:Prop.P.
+axiom O_extl: ∀s1,s2,f. (∀x.s1 x = s2 x) → O s1 f → O s2 f.
+
+lemma CF_max2: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s.
+ CF ha a → CF hb b → CF hp p → CF hf f →
+ O s (λx.ha x + hb x +
+ (b x - a x)*max_{i ∈ [a x, b x [ }(hp 〈i,x〉 + hf 〈i,x〉)) →
+ CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)).
+#a #b #p #f #ha #hb #hp #hf #s #CFa #CFb #CFp #CFf #Os
+@(O_to_CF … Os (CF_max … CFa CFb CFp CFf ?)) @O_plus
+ [@O_plus_l @O_refl
+ |@O_plus_r @O_ext2 [|| #x @(bigop_op … plusAC)]
+ @O_plus
+ [@le_to_O normalize #x @sigma_to_Max
+ |@le_to_O #x @transitive_le [|@sigma_const] @le_times //
+ @Max_le #i #lti #_ @(transitive_le ???? (le_MaxI … ))
+ [@le_plus_n | // | @lt_minus_to_plus_r // | //]
+ ]
+ ]
+qed.
+
+(*
+lemma CF_max_monotonic: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s.
+ CF ha a → CF hb b → CF hp p → CF hf f →
+ O s (λx.ha x + hb x +
+ (b x - a x)*max_{i ∈ [a x, b x [ }(hp 〈i,x〉 + hf 〈i,x〉)) →
+ CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)).
+#a #b #p #f #ha #hb #hp #hf #s #CFa #CFb #CFp #CFf #Os
+@(O_to_CF … Os (CF_max … CFa CFb CFp CFf ?)) @O_plus
+ [@O_plus_l @O_refl
+ |@O_plus_r @O_ext2 [|| #x @(bigop_op … plusAC)]
+ @O_plus
+ [@le_to_O normalize #x @sigma_to_Max
+ |@le_to_O #x @transitive_le [|@sigma_const] @le_times //
+ @Max_le #i #lti #_ @(transitive_le ???? (le_MaxI … ))
+ [@le_plus_n | // | @lt_minus_to_plus_r // | //]
+ ]
+ ]
+qed.
+*)
+
+(* old
+axiom CF_max: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s.
+ CF ha a → CF hb b → CF hp p → CF hf f →
+ O s (λx.ha x + hb x + ∑_{i ∈[a x ,b x[ }(hp 〈i,x〉 + hf 〈i,x〉)) →
+ CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)). *)
+
+(******************************** minimization ********************************)
+
+let rec my_minim a f x k on k ≝
+ match k with
+ [O ⇒ a
+ |S p ⇒ if eqb (my_minim a f x p) (a+p)
+ then if f 〈a+p,x〉 then a+p else S(a+p)
+ else (my_minim a f x p) ].
+
+lemma my_minim_S : ∀a,f,x,k.
+ my_minim a f x (S k) =
+ if eqb (my_minim a f x k) (a+k)
+ then if f 〈a+k,x〉 then a+k else S(a+k)
+ else (my_minim a f x k) .
+// qed.
+
+lemma my_minim_fa : ∀a,f,x,k. f〈a,x〉 = true → my_minim a f x k = a.
+#a #f #x #k #H elim k // #i #Hind normalize >Hind
+cases (true_or_false (eqb a (a+i))) #Hcase >Hcase normalize //
+<(eqb_true_to_eq … Hcase) >H //
+qed.
+
+lemma my_minim_nfa : ∀a,f,x,k. f〈a,x〉 = false →
+my_minim a f x (S k) = my_minim (S a) f x k.
+#a #f #x #k #H elim k
+ [normalize <plus_n_O >H >eq_to_eqb_true //
+ |#i #Hind >my_minim_S >Hind >my_minim_S <plus_n_Sm //
+ ]
+qed.
+
+lemma my_min_eq : ∀a,f,x,k.
+ min k a (λi.f 〈i,x〉) = my_minim a f x k.
+#a #f #x #k lapply a -a elim k // #i #Hind #a normalize in ⊢ (??%?);
+cases (true_or_false (f 〈a,x〉)) #Hcase >Hcase
+ [>(my_minim_fa … Hcase) // | >Hind @sym_eq @(my_minim_nfa … Hcase) ]
+qed.
+
+(* cambiare qui: togliere S *)
+
+
+definition minim_unary_pr ≝ λf.unary_pr (λx.S(fst x))
+ (λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let b ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ if f 〈b-k,x〉 then b-k else r).
+
+definition compl_minim_unary ≝ λhf:nat → nat.λi.
+ let k ≝ fst i in
+ let b ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉.
+
+definition compl_minim_unary_aux ≝ λhf,i.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let b ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hf 〈b-k,x〉 + MSC i.
+
+lemma compl_minim_unary_aux_def : ∀hf,k,r,b,x.
+ compl_minim_unary_aux hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈r,〈b,x〉〉〉.
+#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair //
+qed.
+
+lemma compl_minim_unary_def : ∀hf,k,r,b,x.
+ compl_minim_unary hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉.
+#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair //
+qed.
+
+lemma compl_minim_unary_aux_def2 : ∀hf,k,r,x.
+ compl_minim_unary_aux hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈r,x〉〉.
+#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair //
+qed.
+
+lemma compl_minim_unary_def2 : ∀hf,k,r,x.
+ compl_minim_unary hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈S(fst x),snd x〉〉.
+#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair //
+qed.
+
+lemma min_aux: ∀a,f,x,k. min (S k) (a x) (λi:ℕ.f 〈i,x〉) =
+ ((minim_unary_pr f) ∘ (λx.〈S k,〈a x + k,x〉〉)) x.
+#a #f #x #k whd in ⊢ (???%); >fst_pair >snd_pair
+lapply a -a (* @max_prim_rec1 *)
+elim k
+ [normalize #a >fst_pair >snd_pair >fst_pair >snd_pair >snd_pair >fst_pair
+ <plus_n_O <minus_n_O >fst_pair //
+ |#i #Hind #a normalize in ⊢ (??%?); >prim_rec_S >fst_pair >snd_pair
+ >fst_pair >snd_pair >snd_pair >fst_pair <plus_n_Sm <(Hind (λx.S (a x)))
+ whd in ⊢ (???%); >minus_S_S <(minus_plus_m_m (a x) i) //
+qed.
+
+lemma minim_unary_pr1: ∀a,b,f,x.
+ μ_{i ∈[a x,b x]}(f 〈i,x〉) =
+ if leb (a x) (b x) then ((minim_unary_pr f) ∘ (λx.〈S (b x) - a x,〈b x,x〉〉)) x
+ else (a x).
+#a #b #f #x cases (true_or_false (leb (a x) (b x))) #Hcase >Hcase
+ [cut (b x = a x + (b x - a x))
+ [>commutative_plus <plus_minus_m_m // @leb_true_to_le // ]
+ #Hcut whd in ⊢ (???%); >minus_Sn_m [|@leb_true_to_le //]
+ >min_aux whd in ⊢ (??%?); <Hcut //
+ |>eq_minus_O // @not_le_to_lt @leb_false_to_not_le //
+ ]
+qed.
+
+axiom sum_inv: ∀a,b,f.∑_{i ∈ [a,S b[ }(f i) = ∑_{i ∈ [a,S b[ }(f (a + b - i)).
+
+(*
+#a #b #f @(bigop_iso … plusAC) whd %{(λi.b - a - i)} %{(λi.b - a -i)} %
+ [%[#i #lti #_ normalize @eq_f >commutative_plus <plus_minus_associative
+ [2: @le_minus_to_plus_r //
+ [// @eq_f @@sym_eq @plus_to_minus
+ |#i #Hi #_ % [% [@le_S_S
+*)
+
+example sum_inv_check : ∑_{i ∈ [3,6[ }(i*i) = ∑_{i ∈ [3,6[ }((8-i)*(8-i)).
+normalize // qed.
+
+(* rovesciamo la somma *)
+
+lemma CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s.
+ CF sa a → CF sb b → CF sf f →
+ O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉 + MSC 〈b x - i,〈S(b x),x〉〉)) →
+ CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)).
+#a #b #f #ha #hb #hf #s #CFa #CFb #CFf #HO
+@ext_CF1 [|#x @minim_unary_pr1]
+@CF_if
+ [@CF_le @(O_to_CF … HO)
+ [@(O_to_CF … CFa) @O_plus_l @O_plus_l @O_refl
+ |@(O_to_CF … CFb) @O_plus_l @O_plus_r @O_refl
+ ]
+ |@(CF_comp ??? (λx.ha x + hb x))
+ [|@CF_comp_pair
+ [@CF_minus [@CF_compS @(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //]
+ |@CF_comp_pair
+ [@(O_to_CF … CFb) @O_plus_r //
+ |@(O_to_CF … CF_id) @O_plus_r @le_to_O @(MSC_in … CFb)
+ ]
+ ]
+ |@(CF_prim_rec_gen … MSC … (compl_minim_unary_aux hf))
+ [@((λx:ℕ.fst (snd x)
+ +compl_minim_unary hf
+ 〈fst x,
+ 〈unary_pr fst
+ (λi:ℕ
+ .(let (k:ℕ) ≝fst i in
+ let (r:ℕ) ≝fst (snd i) in
+ let (b:ℕ) ≝fst (snd (snd i)) in
+ let (x:ℕ) ≝snd (snd (snd i)) in if f 〈b-S k,x〉 then b-S k else r ))
+ 〈fst x,snd (snd x)〉,
+ snd (snd x)〉〉))
+ |@CF_compS @CF_fst
+ |@CF_if
+ [@(CF_comp f … MSC … CFf)
+ [@CF_comp_pair
+ [@CF_minus [@CF_comp_fst @CF_comp_snd @CF_snd|@CF_fst]
+ |@CF_comp_snd @CF_comp_snd @CF_snd]
+ |@le_to_O #x normalize >commutative_plus //
+ ]
+ |@(O_to_CF … MSC)
+ [@le_to_O #x normalize //
+ |@CF_minus
+ [@CF_comp_fst @CF_comp_snd @CF_snd |@CF_fst]
+ ]
+ |@CF_comp_fst @(monotonic_CF … CF_snd) normalize //
+ ]
+ |@O_plus
+ [@O_plus_l @O_refl
+ |@O_plus_r @O_ext2 [||#x >compl_minim_unary_aux_def2 @refl]
+ @O_trans [||@le_to_O #x >compl_minim_unary_def2 @le_n]
+ @O_plus [@O_plus_l //]
+ @O_plus_r
+ @O_trans [|@le_to_O #x @MSC_pair] @O_plus
+ [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_fst …))
+ >fst_pair @le_n]
+ @O_trans [|@le_to_O #x @MSC_pair] @O_plus
+ [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …))
+ >snd_pair @(transitive_le ???? (le_fst …)) >fst_pair
+ normalize >snd_pair >fst_pair lapply (surj_pair x)
+ * #x1 * #x2 #Hx >Hx >fst_pair >snd_pair elim x1 //
+ #i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair
+ cases (f ?) [@le_S // | //]]
+ @le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …)) >snd_pair
+ >(expand_pair (snd (snd x))) in ⊢ (?%?); @le_pair //
+ ]
+ ]
+ |cut (O s (λx.ha x + hb x +
+ ∑_{i ∈[a x ,S(b x)[ }(hf 〈a x+b x-i,x〉 + MSC 〈b x -(a x+b x-i),〈S(b x),x〉〉)))
+ [@(O_ext2 … HO) #x @eq_f @sum_inv] -HO #HO
+ @(O_trans … HO) -HO
+ @(O_trans ? (λx:ℕ.ha x+hb x
+ +bigop (S(b x)-a x) (λi:ℕ.true) ?
+ (MSC 〈b x,x〉) plus (λi:ℕ.(λj.hf j + MSC 〈b x - fst j,〈S(b (snd j)),snd j〉〉) 〈b x- i,x〉)))
+ [@le_to_O #n @le_plus // whd in match (unary_pr ???);
+ >fst_pair >snd_pair >(bigop_prim_rec_dec1 a b ? (λi.true))
+ (* it is crucial to recall that the index is bound by S(b x) *)
+ cut (S (b n) - a n ≤ S (b n)) [//]
+ elim (S(b n) - a n)
+ [normalize //
+ |#x #Hind #lex >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair
+ >compl_minim_unary_def >prim_rec_S >fst_pair >snd_pair >fst_pair
+ >snd_pair >fst_pair >snd_pair >fst_pair whd in ⊢ (??%); >commutative_plus
+ @le_plus [2:@Hind @le_S @le_S_S_to_le @lex] -Hind >snd_pair
+ >minus_minus_associative // @le_S_S_to_le //
+ ]
+ |@O_plus [@O_plus_l //] @O_ext2 [||#x @bigop_plus_c]
+ @O_plus
+ [@O_plus_l @O_trans [|@le_to_O #x @MSC_pair]
+ @O_plus
+ [@O_plus_r @le_to_O @(MSC_out … CFb)
+ |@O_plus_r @le_to_O @(MSC_in … CFb)
+ ]
+ |@O_plus_r @(O_ext2 … (O_refl …)) #x @same_bigop
+ [//|#i #H #_ @eq_f2 [@eq_f @eq_f2 //|>fst_pair @eq_f @eq_f2 //]
+ ]
+ ]
+ ]
+ ]
+ |@(O_to_CF … CFa) @(O_trans … HO) @O_plus_l @O_plus_l @O_refl
+ ]
+
+qed.
+
+lemma CF_mu2: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s.
+ CF sa a → CF sb b → CF sf f →
+ O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉 + MSC〈S(b x),x〉)) →
+ CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)).
+#a #b #f #sa #sb #sf #s #CFa #CFb #CFf #HO
+@(O_to_CF … HO (CF_mu … CFa CFb CFf ?)) @O_plus [@O_plus_l @O_refl]
+@O_plus_r @O_ext2 [|| #x @(bigop_op … plusAC)]
+@O_plus [@le_to_O #x @le_sigma //]
+@(O_trans ? (λx.∑_{i ∈[a x ,S(b x)[ }(MSC(b x -i)+MSC 〈S(b x),x〉)))
+ [@le_to_O #x @le_sigma //]
+@O_ext2 [|| #x @(bigop_op … plusAC)] @O_plus
+ [@le_to_O #x @le_sigma // #i #lti #_ @(transitive_le … (MSC 〈S (b x),x〉)) //
+ @monotonic_MSC @(transitive_le … (S(b x))) // @le_S //
+ |@le_to_O #x @le_sigma //
+ ]
+qed.
+
+(* uses MSC_S *)
+
+lemma CF_mu3: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s. (∀x.sf x > 0) →
+ CF sa a → CF sb b → CF sf f →
+ O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉 + MSC〈b x,x〉)) →
+ CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)).
+#a #b #f #sa #sb #sf #s #sfpos #CFa #CFb #CFf #HO
+@(O_to_CF … HO (CF_mu2 … CFa CFb CFf ?)) @O_plus [@O_plus_l @O_refl]
+@O_plus_r @O_ext2 [|| #x @(bigop_op … plusAC)]
+@O_plus [@le_to_O #x @le_sigma //]
+@le_to_O #x @le_sigma // #x #lti #_ >MSC_pair_eq >MSC_pair_eq <associative_plus
+@le_plus // @(transitive_le … (MSC_sublinear … )) /2 by monotonic_lt_plus_l/
+qed.
+
+lemma CF_mu4: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s. (∀x.sf x > 0) →
+ CF sa a → CF sb b → CF sf f →
+ O s (λx.sa x + sb x + (S(b x) - a x)*Max_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉)) →
+ CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)).
+#a #b #f #sa #sb #sf #s #sfpos #CFa #CFb #CFf #HO
+@(O_to_CF … HO (CF_mu3 … sfpos CFa CFb CFf ?)) @O_plus [@O_plus_l @O_refl]
+@O_ext2 [|| #x @(bigop_op … plusAC)] @O_plus_r @O_plus
+ [@le_to_O #x @sigma_to_Max
+ |lapply (MSC_in … CFf) #Hle
+ %{1} %{0} #n #_ @(transitive_le … (sigma_const …))
+ >(commutative_times 1) <times_n_1
+ cases (decidable_le (S (b n)) (a n)) #H
+ [>(eq_minus_O … H) //
+ |lapply (le_S_S_to_le … (not_le_to_lt … H)) -H #H
+ @le_times // @(transitive_le … (Hle … ))
+ cut (b n = b n - a n + a n) [<plus_minus_m_m // ]
+ #Hcut >Hcut in ⊢ (?%?); @(le_Max (λi.sf 〈i+a n,n〉)) /2/
+ ]
+ ]
+qed.
+
+(*
+axiom CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s.
+ CF sa a → CF sb b → CF sf f →
+ O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉)) →
+ CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)). *)
+
+
+
\ No newline at end of file
--- /dev/null
+include "reverse_complexity/basics.ma".
+include "reverse_complexity/big_O.ma".
+
+(********************************* complexity *********************************)
+
+(* We assume operations have a minimal structural complexity MSC.
+For instance, for time complexity, MSC is equal to the size of input.
+For space complexity, MSC is typically 0, since we only measure the space
+required in addition to dimension of the input. *)
+
+axiom MSC : nat → nat.
+axiom MSC_sublinear : ∀n. MSC (S n) ≤ S (MSC n).
+(* axiom MSC_S: O MSC (λx.MSC (S x)) . *)
+axiom MSC_le: ∀n. MSC n ≤ n.
+
+axiom monotonic_MSC: monotonic ? le MSC.
+axiom MSC_pair_eq: ∀a,b. MSC 〈a,b〉 = MSC a + MSC b.
+
+
+lemma MSC_pair: ∀a,b. MSC 〈a,b〉 ≤ MSC a + MSC b. // qed.
+
+(* C s i means i is running in O(s) *)
+
+definition C ≝ λs,i.∃c.∃a.∀x.a ≤ x → ∃y.
+ U i x (c*(s x)) = Some ? y.
+
+(* C f s means f ∈ O(s) where MSC ∈O(s) *)
+definition CF ≝ λs,f.∃i.code_for (total f) i ∧ C s i.
+
+axiom MSC_in: ∀f,h. CF h f → ∀x. MSC x ≤ h x.
+axiom MSC_out: ∀f,h. CF h f → ∀x. MSC (f x) ≤ h x.
+
+
+lemma ext_CF : ∀f,g,s. (∀n. f n = g n) → CF s f → CF s g.
+#f #g #s #Hext * #i * #Hcode #HC %{i} %
+ [#x cases (Hcode x) #a #H %{a} whd in match (total ??); <Hext @H | //]
+qed.
+
+lemma ext_CF1 : ∀f,g,s. (∀n. f n = g n) → CF s g → CF s f.
+#f #g #s #Hext * #i * #Hcode #HC %{i} %
+ [#x cases (Hcode x) #a #H %{a} whd in match (total ??); >Hext @H | //]
+qed.
+
+lemma monotonic_CF: ∀s1,s2,f.(∀x. s1 x ≤ s2 x) → CF s1 f → CF s2 f.
+#s1 #s2 #f #H * #i * #Hcode #Hs1
+%{i} % [//] cases Hs1 #c * #a -Hs1 #Hs1 %{c} %{a} #n #lean
+cases(Hs1 n lean) #y #Hy %{y} @(monotonic_U …Hy) @le_times //
+qed.
+
+lemma O_to_CF: ∀s1,s2,f.O s2 s1 → CF s1 f → CF s2 f.
+#s1 #s2 #f #H * #i * #Hcode #Hs1
+%{i} % [//] cases Hs1 #c * #a -Hs1 #Hs1
+cases H #c1 * #a1 #Ha1 %{(c*c1)} %{(a+a1)} #n #lean
+cases(Hs1 n ?) [2:@(transitive_le … lean) //] #y #Hy %{y} @(monotonic_U …Hy)
+>associative_times @le_times // @Ha1 @(transitive_le … lean) //
+qed.
+
+lemma timesc_CF: ∀s,f,c.CF (λx.c*s x) f → CF s f.
+#s #f #c @O_to_CF @O_times_c
+qed.
+
+(********************************* composition ********************************)
+axiom CF_comp: ∀f,g,sf,sg,sh. CF sg g → CF sf f →
+ O sh (λx. sg x + sf (g x)) → CF sh (f ∘ g).
+
+lemma CF_comp_ext: ∀f,g,h,sh,sf,sg. CF sg g → CF sf f →
+ (∀x.f(g x) = h x) → O sh (λx. sg x + sf (g x)) → CF sh h.
+#f #g #h #sh #sf #sg #Hg #Hf #Heq #H @(ext_CF (f ∘ g))
+ [#n normalize @Heq | @(CF_comp … H) //]
+qed.
+
+(************************************* smn ************************************)
+axiom smn: ∀f,s. CF s f → ∀x. CF (λy.s 〈x,y〉) (λy.f 〈x,y〉).
+
+(****************************** constructibility ******************************)
+
+definition constructible ≝ λs. CF s s.
+
+lemma constr_comp : ∀s1,s2. constructible s1 → constructible s2 →
+ (∀x. x ≤ s2 x) → constructible (s2 ∘ s1).
+#s1 #s2 #Hs1 #Hs2 #Hle @(CF_comp … Hs1 Hs2) @O_plus @le_to_O #x [@Hle | //]
+qed.
+
+lemma ext_constr: ∀s1,s2. (∀x.s1 x = s2 x) →
+ constructible s1 → constructible s2.
+#s1 #s2 #Hext #Hs1 @(ext_CF … Hext) @(monotonic_CF … Hs1) #x >Hext //
+qed.
+
+
+(***************************** primitive recursion ****************************)
+
+(* no arguments *)
+
+let rec prim_rec0 (k:nat) (h:nat →nat) n on n ≝
+ match n with
+ [ O ⇒ k
+ | S a ⇒ h 〈a, prim_rec0 k h a〉].
+
+lemma prim_rec0_S: ∀k,h,n.
+ prim_rec0 k h (S n) = h 〈n, prim_rec0 k h n〉.
+// qed.
+
+let rec prim_rec0_compl (k,sk:nat) (h,sh:nat →nat) n on n ≝
+ match n with
+ [ O ⇒ sk
+ | S a ⇒ prim_rec0_compl k sk h sh a + sh (prim_rec0 k h a)].
+
+axiom CF_prim_rec0_gen: ∀k,h,sk,sh,sh1,sf. CF sh h →
+ O sh1 (λx.snd x + sh 〈fst x,prim_rec0 k h (fst x)〉) →
+ O sf (prim_rec0 sk sh1) →
+ CF sf (prim_rec0 k h).
+
+lemma CF_prim_rec0: ∀k,h,sk,sh,sf. CF sh h →
+ O sf (prim_rec0 sk (λx. snd x + sh 〈fst x,prim_rec0 k h (fst x)〉))
+ → CF sf (prim_rec0 k h).
+#k #h #sk #sh #sf #Hh #HO @(CF_prim_rec0_gen … Hh … HO) @O_refl
+qed.
+
+(* with arguments. m is a vector of arguments *)
+let rec prim_rec (k,h:nat →nat) n m on n ≝
+ match n with
+ [ O ⇒ k m
+ | S a ⇒ h 〈a,〈prim_rec k h a m, m〉〉].
+
+lemma prim_rec_S: ∀k,h,n,m.
+ prim_rec k h (S n) m = h 〈n,〈prim_rec k h n m, m〉〉.
+// qed.
+
+lemma prim_rec_le: ∀k1,k2,h1,h2. (∀x.k1 x ≤ k2 x) →
+(∀x,y.x ≤y → h1 x ≤ h2 y) →
+ ∀x,m. prim_rec k1 h1 x m ≤ prim_rec k2 h2 x m.
+#k1 #k2 #h1 #h2 #lek #leh #x #m elim x //
+#n #Hind normalize @leh @le_pair // @le_pair //
+qed.
+
+definition unary_pr ≝ λk,h,x. prim_rec k h (fst x) (snd x).
+
+lemma prim_rec_unary: ∀k,h,a,b.
+ prim_rec k h a b = unary_pr k h 〈a,b〉.
+#k #h #a #b normalize >fst_pair >snd_pair //
+qed.
+
+let rec prim_rec_compl (k,h,sk,sh:nat →nat) n m on n ≝
+ match n with
+ [ O ⇒ sk m
+ | S a ⇒ prim_rec_compl k h sk sh a m + sh 〈a,〈prim_rec k h a m,m〉〉].
+
+axiom CF_prim_rec_gen: ∀k,h,sk,sh,sh1. CF sk k → CF sh h →
+ O sh1 (λx. fst (snd x) +
+ sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉) →
+ CF (unary_pr sk sh1) (unary_pr k h).
+
+lemma CF_prim_rec: ∀k,h,sk,sh,sf. CF sk k → CF sh h →
+ O sf (unary_pr sk
+ (λx. fst (snd x) +
+ sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉))
+ → CF sf (unary_pr k h).
+#k #h #sk #sh #sf #Hk #Hh #Osf @(O_to_CF … Osf) @(CF_prim_rec_gen … Hk Hh)
+@O_refl
+qed.
+
+lemma constr_prim_rec: ∀s1,s2. constructible s1 → constructible s2 →
+ (∀n,r,m. 2 * r ≤ s2 〈n,〈r,m〉〉) → constructible (unary_pr s1 s2).
+#s1 #s2 #Hs1 #Hs2 #Hincr @(CF_prim_rec … Hs1 Hs2) whd %{2} %{0}
+#x #_ lapply (surj_pair x) * #a * #b #eqx >eqx whd in match (unary_pr ???);
+>fst_pair >snd_pair
+whd in match (unary_pr ???); >fst_pair >snd_pair elim a
+ [normalize //
+ |#n #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair
+ >prim_rec_S @transitive_le [| @(monotonic_le_plus_l … Hind)]
+ @transitive_le [| @(monotonic_le_plus_l … (Hincr n ? b))]
+ whd in match (unary_pr ???); >fst_pair >snd_pair //
+ ]
+qed.
+
+(**************************** primitive operations*****************************)
+
+definition id ≝ λx:nat.x.
+
+axiom CF_id: CF MSC id.
+axiom CF_const: ∀k.CF MSC (λx.k).
+axiom CF_comp_fst: ∀h,f. CF h f → CF h (fst ∘ f).
+axiom CF_comp_snd: ∀h,f. CF h f → CF h (snd ∘ f).
+axiom CF_comp_pair: ∀h,f,g. CF h f → CF h g → CF h (λx. 〈f x,g x〉).
+
+lemma CF_fst: CF MSC fst.
+@(ext_CF (fst ∘ id)) [#n //] @(CF_comp_fst … CF_id)
+qed.
+
+lemma CF_snd: CF MSC snd.
+@(ext_CF (snd ∘ id)) [#n //] @(CF_comp_snd … CF_id)
+qed.
+
+(**************************** arithmetic operations ***************************)
+
+axiom CF_compS: ∀h,f. CF h f → CF h (S ∘ f).
+axiom CF_le: ∀h,f,g. CF h f → CF h g → CF h (λx. leb (f x) (g x)).
+axiom CF_eqb: ∀h,f,g. CF h f → CF h g → CF h (λx.eqb (f x) (g x)).
+axiom CF_max1: ∀h,f,g. CF h f → CF h g → CF h (λx. max (f x) (g x)).
+axiom CF_plus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x + g x).
+axiom CF_minus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x - g x).
+
+(******************************** if then else ********************************)
+
+lemma if_prim_rec: ∀b:nat → bool. ∀f,g:nat → nat.∀x:nat.
+ if b x then f x else g x = prim_rec g (f ∘ snd ∘ snd) (b x) x.
+#b #f #g #x cases (b x) normalize //
+qed.
+
+lemma CF_if: ∀b:nat → bool. ∀f,g,s. CF s b → CF s f → CF s g →
+ CF s (λx. if b x then f x else g x).
+#b #f #g #s #CFb #CFf #CFg @(ext_CF (λx.unary_pr g (f ∘ snd ∘ snd) 〈b x,x〉))
+ [#n @sym_eq normalize >fst_pair >snd_pair @if_prim_rec
+ |@(CF_comp ??? s)
+ [|@CF_comp_pair // @(O_to_CF … CF_id) @le_to_O @MSC_in //
+ |@(CF_prim_rec_gen ??? (λx.MSC x + s(snd (snd x))) … CFg) [3:@O_refl|]
+ @(CF_comp … (λx.MSC x + s(snd x)) … CF_snd)
+ [@(CF_comp … s … CF_snd CFf) @O_refl
+ |@O_plus
+ [@O_plus_l @O_refl
+ |@O_plus
+ [@O_plus_l @le_to_O #x @monotonic_MSC //
+ |@O_plus_r @O_refl
+ ]
+ ]
+ ]
+ |%{6} %{0} #n #_ normalize in ⊢ (??%); <plus_n_O cases (b n) normalize
+ >snd_pair >fst_pair normalize
+ [@le_plus [//] >fst_pair >fst_pair >snd_pair >fst_pair
+ @le_plus [//] >snd_pair >snd_pair >snd_pair >snd_pair
+ <associative_plus <associative_plus @le_plus [|//]
+ @(transitive_le … (MSC_pair …)) >associative_plus @le_plus
+ [@(transitive_le ???? (MSC_in … CFf n)) @monotonic_MSC //
+ |@(transitive_le … (MSC_pair …)) @le_plus [|@(MSC_in … CFf)]
+ normalize @MSC_out @CFg
+ ]
+ |@le_plus //
+ ]
+ ]
+ ]
+qed.
+
+(********************************* simulation *********************************)
+
+definition pU_unary ≝ λp. pU (fst p) (fst (snd p)) (snd (snd p)).
+
+axiom sU : nat → nat.
+axiom CF_U : CF sU pU_unary.
+
+axiom monotonic_sU: ∀i1,i2,x1,x2,s1,s2. i1 ≤ i2 → x1 ≤ x2 → s1 ≤ s2 →
+ sU 〈i1,〈x1,s1〉〉 ≤ sU 〈i2,〈x2,s2〉〉.
+
+lemma monotonic_sU_aux : ∀x1,x2. fst x1 ≤ fst x2 → fst (snd x1) ≤ fst (snd x2) →
+snd (snd x1) ≤ snd (snd x2) → sU x1 ≤ sU x2.
+#x1 #x2 cases (surj_pair x1) #a1 * #y #eqx1 >eqx1 -eqx1 cases (surj_pair y)
+#b1 * #c1 #eqy >eqy -eqy
+cases (surj_pair x2) #a2 * #y2 #eqx2 >eqx2 -eqx2 cases (surj_pair y2)
+#b2 * #c2 #eqy2 >eqy2 -eqy2 >fst_pair >snd_pair >fst_pair >snd_pair
+>fst_pair >snd_pair >fst_pair >snd_pair @monotonic_sU
+qed.
+
+axiom sU_pos: ∀x. 0 < sU x.
+
+axiom sU_le: ∀i,x,s. s ≤ sU 〈i,〈x,s〉〉.
+
+lemma sU_le_i: ∀i,x,s. MSC i ≤ sU 〈i,〈x,s〉〉.
+#i #x #s @(transitive_le ???? (MSC_in … CF_U 〈i,〈x,s〉〉)) @monotonic_MSC //
+qed.
+
+lemma sU_le_x: ∀i,x,s. MSC x ≤ sU 〈i,〈x,s〉〉.
+#i #x #s @(transitive_le ???? (MSC_in … CF_U 〈i,〈x,s〉〉)) @monotonic_MSC
+@(transitive_le … 〈x,s〉) //
+qed.
+
+
+
+
+definition termb_unary ≝ λx:ℕ.termb (fst x) (fst (snd x)) (snd (snd x)).
+definition out_unary ≝ λx:ℕ.out (fst x) (fst (snd x)) (snd (snd x)).
+
+lemma CF_termb: CF sU termb_unary.
+@(ext_CF (fst ∘ pU_unary)) [2: @CF_comp_fst @CF_U]
+#n whd in ⊢ (??%?); whd in ⊢ (??(?%)?); >fst_pair %
+qed.
+
+lemma CF_out: CF sU out_unary.
+@(ext_CF (snd ∘ pU_unary)) [2: @CF_comp_snd @CF_U]
+#n whd in ⊢ (??%?); whd in ⊢ (??(?%)?); >snd_pair %
+qed.
+
include "arithmetics/nat.ma".
-include "arithmetics/log.ma".
-(* include "arithmetics/ord.ma". *)
+include "arithmetics/log.ma".
include "arithmetics/bigops.ma".
include "arithmetics/bounded_quantifiers.ma".
-include "arithmetics/pidgeon_hole.ma".
+include "arithmetics/pidgeon_hole.ma".
include "basics/sets.ma".
include "basics/types.ma".
#n >commutative_max //
qed.
+alias id "max" = "cic:/matita/arithmetics/nat/max#def:2".
+alias id "mk_Aop" = "cic:/matita/arithmetics/bigops/Aop#con:0:1:2".
definition MaxA ≝
mk_Aop nat 0 max Max0 Max0r (λa,b,c.sym_eq … (Max_assoc a b c)).
#f #g #s #Osf #Ofg @(O_plus … Osf) @(O_trans … Osf) //
qed.
-(*
-lemma O_ff: ∀f,s. O s f → O s (f+f).
-#f #s #Osf /2/
-qed. *)
-
lemma O_ext2: ∀f,g,s. O s f → (∀x.f x = g x) → O s g.
#f #g #s * #c * #a #Osf #eqfg %{c} %{a} #n #lean <eqfg @Osf //
qed.
-
definition not_O ≝ λf,g.∀c,n0.∃n. n0 ≤ n ∧ c* (f n) < g n .
-(* this is the only classical result *)
-axiom not_O_def: ∀f,g. ¬ O f g → not_O f g.
-
(******************************* small O notation *****************************)
(* o f g means g ∈ o(f) *)
(************************ basic complexity notions ****************************)
-(* u is the deterministic configuration relation of the universal machine (one
- step)
-
-axiom u: nat → option nat.
-
-let rec U c n on n ≝
- match n with
- [ O ⇒ None ?
- | S m ⇒ match u c with
- [ None ⇒ Some ? c (* halting case *)
- | Some c1 ⇒ U c1 m
- ]
- ].
-
-lemma halt_U: ∀i,n,y. u i = None ? → U i n = Some ? y → y = i.
-#i #n #y #H cases n
- [normalize #H1 destruct |#m normalize >H normalize #H1 destruct //]
-qed.
-
-lemma Some_to_halt: ∀n,i,y. U i n = Some ? y → u y = None ? .
-#n elim n
- [#i #y normalize #H destruct (H)
- |#m #Hind #i #y normalize
- cut (u i = None ? ∨ ∃c. u i = Some ? c)
- [cases (u i) [/2/ | #c %2 /2/ ]]
- *[#H >H normalize #H1 destruct (H1) // |* #c #H >H normalize @Hind ]
- ]
-qed. *)
-
axiom U: nat → nat → nat → option nat.
-(*
-lemma monotonici_U: ∀y,n,m,i.
- U i m = Some ? y → U i (n+m) = Some ? y.
-#y #n #m elim m
- [#i normalize #H destruct
- |#p #Hind #i <plus_n_Sm normalize
- cut (u i = None ? ∨ ∃c. u i = Some ? c)
- [cases (u i) [/2/ | #c %2 /2/ ]]
- *[#H1 >H1 normalize // |* #c #H >H normalize #H1 @Hind //]
- ]
-qed. *)
axiom monotonic_U: ∀i,x,n,m,y.n ≤m →
U i x n = Some ? y → U i x m = Some ? y.
-(* #i #n #m #y #lenm #H >(plus_minus_m_m m n) // @monotonici_U //
-qed. *)
-
-(* axiom U: nat → nat → option nat. *)
-(* axiom monotonic_U: ∀i,n,m,y.n ≤m →
- U i n = Some ? y → U i m = Some ? y. *)
lemma unique_U: ∀i,x,n,m,yn,ym.
U i x n = Some ? yn → U i x m = Some ? ym → yn = ym.
∃n.∀m. n ≤ m → U i x m = f x.
definition terminate ≝ λi,x,r. ∃y. U i x r = Some ? y.
-notation "[i,x] ↓ r" with precedence 60 for @{terminate $i $x $r}.
+notation "{i ⊙ x} ↓ r" with precedence 60 for @{terminate $i $x $r}.
definition lang ≝ λi,x.∃r,y. U i x r = Some ? y ∧ 0 < y.
Max_{i < S (of_size n) | eqb (|i|) n}|(f i)|.
// qed.
-(*
-definition Max_const : ∀f,p,n,a. a < n → p a →
- ∀n. f n = g n →
- Max_{i < n | p n}(f n) = *)
-
lemma size_f_size : ∀f,n. size_f (f ∘ size) n = |(f n)|.
#f #n @le_to_le_to_eq
[@Max_le #a #lta #Ha normalize >(eqb_true_to_eq … Ha) //
#n @Max_le #a #lta #Ha <(eqb_true_to_eq … Ha) //
qed.
-(* definition def ≝ λf:nat → option nat.λx.∃y. f x = Some ? y.*)
-
(* C s i means that the complexity of i is O(s) *)
-definition C ≝ λs,i.∃c.∃a.∀x.a ≤ |x| → ∃y.
- U i x (c*(s(|x|))) = Some ? y.
+definition C ≝ λs,i.∃c.∃a.∀x.a ≤ |x| → {i ⊙ x} ↓ (c*(s(|x|))).
definition CF ≝ λs,f.∃i.code_for f i ∧ C s i.
%{y} @(monotonic_U …Hy) >associative_times @le_times // @H @(le_maxl … Hmax)
qed.
+(*********************** The hierachy theorem (left) **************************)
+
+theorem hierarchy_theorem_left: ∀s1,s2:nat→nat.
+ O(s1) ⊆ O(s2) → CF s1 ⊆ CF s2.
+#s1 #s2 #HO #f * #i * #Hcode * #c * #a #Hs1_i %{i} % //
+cases (sub_O_to_O … HO) -HO #c1 * #b #Hs1s2
+%{(c*c1)} %{(max a b)} #x #lemax
+cases (Hs1_i x ?) [2: @(le_maxl …lemax)]
+#y #Hy %{y} @(monotonic_U … Hy) >associative_times
+@le_times // @Hs1s2 @(le_maxr … lemax)
+qed.
+
(************************** The diagonal language *****************************)
(* the diagonal language used for the hierarchy theorem *)
U (fst i) i (s (|i|)) = Some ? 0.
lemma equiv_diag: ∀s,i.
- diag s i ↔ [fst i,i] ↓ s (|i|) ∧ ¬lang (fst i) i.
+ diag s i ↔ {fst i ⊙ i} ↓ s(|i|) ∧ ¬lang (fst i) i.
#s #i %
[whd in ⊢ (%→?); #H % [%{0} //] % * #x * #y *
#H1 #Hy cut (0 = y) [@(unique_U … H H1)] #eqy /2/
#H3 @(absurd ?? H3) @H2 @H3
qed.
-(* axiom weak_pad : ∀a,∃a0.∀n. a0 < n → ∃b. |〈a,b〉| = n. *)
+let rec f_img (f:nat →nat) n on n ≝
+ match n with
+ [O ⇒ [ ]
+ |S m ⇒ f m::f_img f m
+ ].
+
+(* a few lemma to prove injective_to_exists. This is a general result; a nice
+example of the pidgeon hole pricniple *)
+
+lemma f_img_to_exists:
+ ∀f.∀n,a. a ∈ f_img f n → ∃b. b < n ∧ f b = a.
+#f #n #a elim n normalize [@False_ind]
+#m #Hind *
+ [#Ha %{m} /2/ |#H cases(Hind H) #b * #Hb #Ha %{b} % // @le_S //]
+qed.
+
+lemma length_f_img: ∀f,n. |f_img f n| = n.
+#f #n elim n // normalize //
+qed.
+
+lemma unique_f_img: ∀f,n. injective … f → unique ? (f_img f n).
+#f #n #Hinj elim n normalize //
+#m #Hind % // % #H lapply(f_img_to_exists …H) * #b * #ltbm
+#eqbm @(absurd … ltbm) @le_to_not_lt >(Hinj… eqbm) //
+qed.
+
+lemma injective_to_exists: ∀f. injective nat nat f →
+ ∀n.(∀i.i < n → f i < n) → ∀a. a < n → ∃b. b<n ∧ f b = a.
+#f #finj #n #H1 #a #ltan @(f_img_to_exists f n a)
+@(eq_length_to_mem_all … (length_f_img …) (unique_f_img …finj …) …ltan)
+#x #Hx cases(f_img_to_exists … Hx) #b * #ltbn #eqx <eqx @H1 //
+qed.
+
lemma weak_pad1 :∀n,a.∃b. n ≤ 〈a,b〉.
#n #a
cut (∀i.decidable (〈a,i〉 < n))
|#H lapply(not_forall_to_exists … Hdec H)
* #b * #H1 #H2 %{b} @not_lt_to_le @H2
]
-qed.
+qed.
lemma pad : ∀n,a. ∃b. n ≤ |〈a,b〉|.
#n #a cases (weak_pad1 (of_size n) a) #b #Hb
qed.
lemma o_to_ex: ∀s1,s2. o s1 s2 → ∀i. C s2 i →
- ∃b.[i, 〈i,b〉] ↓ s1 (|〈i,b〉|).
+ ∃b.{i ⊙ 〈i,b〉} ↓ s1 (|〈i,b〉|).
#s1 #s2 #H #i * #c * #x0 #H1
cases (H c) #n0 #H2 cases (pad (max x0 n0) i) #b #Hmax
%{b} cases (H1 〈i,b〉 ?)
[ None ⇒ None ?
| Some y ⇒ f y ].
-(* axiom CFU: ∀h,g,s. CF s (to_Some h) → CF s (to_Some (of_size ∘ g)) →
- CF (Slow s) (λx.U (h x) (g x)). *)
-
axiom sU2: nat → nat → nat.
axiom sU: nat → nat → nat → nat.
-(* axiom CFU: CF sU (λx.U (fst x) (snd x)). *)
-
axiom CFU_new: ∀h,g,f,s.
CF s (to_Some h) → CF s (to_Some g) → CF s (to_Some f) →
O s (λx. sU (size_f h x) (size_f g x) (size_f f x)) →
axiom superlinear_sU: ∀i,x,r. r ≤ sU i x r.
+(* not used *)
definition sU_space ≝ λi,x,r.i+x+r.
-definition sU_time ≝ λi,x,r.i+x+(i^2)*r*(log 2 r).
-
-(*
-axiom CF_comp: ∀f,g,s1, s2. CF s1 f → CF s2 g →
- CF (λx.s2 x + s1 (size (deopt (g x)))) (opt_comp f g).
-
-(* axiom CF_comp: ∀f,g,s1, s2. CF s1 f → CF s2 g →
- CF (s1 ∘ (λx. size (deopt (g x)))) (opt_comp f g). *)
-
-axiom CF_comp_strong: ∀f,g,s1,s2. CF s1 f → CF s2 g →
- CF (s1 ∘ s2) (opt_comp f g). *)
+definition sU_time ≝ λi,x,r.i+x+(i^2)*r*(log 2 r).
definition IF ≝ λb,f,g:nat →option nat. λx.
match b x with
axiom CF_fst: ∀f,s. CF s (λx.Some ? (f x)) → CF s (λx.Some ? (fst (f x))).
-definition minimal ≝ λs. CF s (λn. Some ? n) ∧ ∀c. CF s (λn. Some ? c).
-
-
-(*
-axiom le_snd: ∀n. |snd n| ≤ |n|.
-axiom daemon: ∀P:Prop.P. *)
+definition sufficiently_large ≝ λs. CF s (λn. Some ? n) ∧ ∀c. CF s (λn. Some ? c).
definition constructible ≝ λs. CF s (λx.Some ? (of_size (s (|x|)))).
-lemma diag_s: ∀s. minimal s → constructible s →
+lemma diag_s: ∀s. sufficiently_large s → constructible s →
CF (λx.sU x x (s x)) (diag_cf s).
#s * #Hs_id #Hs_c #Hs_constr
cut (O (λx:ℕ.sU x x (s x)) s) [%{1} %{0} #n //]
|%{1} %{0} #n #_ >commutative_times <times_n_1
@monotonic_sU // >size_f_size >size_of_size //
]
-qed.
-
-(*
-lemma diag_s: ∀s. minimal s → constructible s →
- CF (λx.s x + sU x x (s x)) (diag_cf s).
-#s * #Hs_id #Hs_c #Hs_constr
-@ext_CF [2: #n @sym_eq @diag_cf_def | skip]
-@IF_CF_new [2,3:@(monotonic_CF … (Hs_c ?)) @O_plus_l //]
-@CFU_new
- [@CF_fst @(monotonic_CF … Hs_id) @O_plus_l //
- |@(monotonic_CF … Hs_id) @O_plus_l //
- |@(monotonic_CF … Hs_constr) @O_plus_l //
- |@O_plus_r %{1} %{0} #n #_ >commutative_times <times_n_1
- @monotonic_sU // >size_f_size >size_of_size //
- ]
-qed. *)
-
-(* proof with old axioms
-lemma diag_s: ∀s. minimal s → constructible s →
- CF (λx.s x + sU x x (s x)) (diag_cf s).
-#s * #Hs_id #Hs_c #Hs_constr
-@ext_CF [2: #n @sym_eq @diag_cf_def | skip]
-@(monotonic_CF ???? (IF_CF (λi:ℕ.U (pair (fst i) i) (|of_size (s (|i|))|))
- … (λi.s i + s i + s i + (sU (size_f fst i) (size_f (λi.i) i) (size_f (λi.of_size (s (|i|))) i))) … (Hs_c 1) (Hs_c 0) … ))
- [2: @CFU [@CF_fst // | // |@Hs_constr]
- |@(O_ext2 (λn:ℕ.s n+sU (size_f fst n) n (s n) + (s n+s n+s n+s n)))
- [2: #i >size_f_size >size_of_size >size_f_id //]
- @O_absorbr
- [%{1} %{0} #n #_ >commutative_times <times_n_1 @le_plus //
- @monotonic_sU //
- |@O_plus_l @(O_plus … (O_refl s)) @(O_plus … (O_refl s))
- @(O_plus … (O_refl s)) //
- ]
-qed.
-*)
-
-(*************************** The hierachy theorem *****************************)
-
-(*
-theorem hierarchy_theorem_right: ∀s1,s2:nat→nat.
- O s1 idN → constructible s1 →
- not_O s2 s1 → ¬ CF s1 ⊆ CF s2.
-#s1 #s2 #Hs1 #monos1 #H % #H1
-@(absurd … (CF s2 (diag_cf s1)))
- [@H1 @diag_s // |@(diag1_not_s1 … H)]
-qed.
-*)
-
-theorem hierarchy_theorem_left: ∀s1,s2:nat→nat.
- O(s1) ⊆ O(s2) → CF s1 ⊆ CF s2.
-#s1 #s2 #HO #f * #i * #Hcode * #c * #a #Hs1_i %{i} % //
-cases (sub_O_to_O … HO) -HO #c1 * #b #Hs1s2
-%{(c*c1)} %{(max a b)} #x #lemax
-cases (Hs1_i x ?) [2: @(le_maxl …lemax)]
-#y #Hy %{y} @(monotonic_U … Hy) >associative_times
-@le_times // @Hs1s2 @(le_maxr … lemax)
-qed.
-
+qed.
\ No newline at end of file
--- /dev/null
+include "arithmetics/sigma_pi.ma".
+
+(************************* notation for minimization **************************)
+notation "μ_{ ident i < n } p"
+ with precedence 80 for @{min $n 0 (λ${ident i}.$p)}.
+
+notation "μ_{ ident i ≤ n } p"
+ with precedence 80 for @{min (S $n) 0 (λ${ident i}.$p)}.
+
+notation "μ_{ ident i ∈ [a,b[ } p"
+ with precedence 80 for @{min ($b-$a) $a (λ${ident i}.$p)}.
+
+notation "μ_{ ident i ∈ [a,b] } p"
+ with precedence 80 for @{min (S $b-$a) $a (λ${ident i}.$p)}.
+
+(************************************ MAX *************************************)
+notation "Max_{ ident i < n | p } f"
+ with precedence 80
+for @{'bigop $n max 0 (λ${ident i}. $p) (λ${ident i}. $f)}.
+
+notation "Max_{ ident i < n } f"
+ with precedence 80
+for @{'bigop $n max 0 (λ${ident i}.true) (λ${ident i}. $f)}.
+
+notation "Max_{ ident j ∈ [a,b[ } f"
+ with precedence 80
+for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.true) (${ident j}+$a)))
+ (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}.
+
+notation "Max_{ ident j ∈ [a,b[ | p } f"
+ with precedence 80
+for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.$p) (${ident j}+$a)))
+ (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}.
+
+lemma Max_assoc: ∀a,b,c. max (max a b) c = max a (max b c).
+#a #b #c normalize cases (true_or_false (leb a b)) #leab >leab normalize
+ [cases (true_or_false (leb b c )) #lebc >lebc normalize
+ [>(le_to_leb_true a c) // @(transitive_le ? b) @leb_true_to_le //
+ |>leab //
+ ]
+ |cases (true_or_false (leb b c )) #lebc >lebc normalize //
+ >leab normalize >(not_le_to_leb_false a c) // @lt_to_not_le
+ @(transitive_lt ? b) @not_le_to_lt @leb_false_to_not_le //
+ ]
+qed.
+
+lemma Max0 : ∀n. max 0 n = n.
+// qed.
+
+lemma Max0r : ∀n. max n 0 = n.
+#n >commutative_max //
+qed.
+
+definition MaxA ≝
+ mk_Aop nat 0 max Max0 Max0r (λa,b,c.sym_eq … (Max_assoc a b c)).
+
+definition MaxAC ≝ mk_ACop nat 0 MaxA commutative_max.
+
+lemma le_Max: ∀f,p,n,a. a < n → p a = true →
+ f a ≤ Max_{i < n | p i}(f i).
+#f #p #n #a #ltan #pa
+>(bigop_diff p ? 0 MaxAC f a n) // @(le_maxl … (le_n ?))
+qed.
+
+lemma le_MaxI: ∀f,p,n,m,a. m ≤ a → a < n → p a = true →
+ f a ≤ Max_{i ∈ [m,n[ | p i}(f i).
+#f #p #n #m #a #lema #ltan #pa
+>(bigop_diff ? ? 0 MaxAC (λi.f (i+m)) (a-m) (n-m))
+ [<plus_minus_m_m // @(le_maxl … (le_n ?))
+ |<plus_minus_m_m //
+ |/2 by monotonic_lt_minus_l/
+ ]
+qed.
+
+lemma Max_le: ∀f,p,n,b.
+ (∀a.a < n → p a = true → f a ≤ b) → Max_{i < n | p i}(f i) ≤ b.
+#f #p #n elim n #b #H //
+#b0 #H1 cases (true_or_false (p b)) #Hb
+ [>bigop_Strue [2:@Hb] @to_max [@H1 // | @H #a #ltab #pa @H1 // @le_S //]
+ |>bigop_Sfalse [2:@Hb] @H #a #ltab #pa @H1 // @le_S //
+ ]
+qed.
+
+
+(************************* a couple of technical lemmas ***********************)
+lemma minus_to_0: ∀a,b. a ≤ b → minus a b = 0.
+#a elim a // #n #Hind *
+ [#H @False_ind /2 by absurd/ | #b normalize #H @Hind @le_S_S_to_le /2/]
+qed.
+
+lemma sigma_const: ∀c,a,b.
+ ∑_{i ∈ [a,b[ }c ≤ (b-a)*c.
+#c #a #b elim (b-a) // #n #Hind normalize @le_plus //
+qed.
+
+lemma sigma_to_Max: ∀h,a,b.
+ ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*Max_{i ∈ [a,b[ }(h i).
+#h #a #b elim (b-a)
+ [//
+ |#n #Hind >bigop_Strue [2://] whd in ⊢ (??%);
+ @le_plus
+ [>bigop_Strue // @(le_maxl … (le_n …))
+ |@(transitive_le … Hind) @le_times // >bigop_Strue //
+ @(le_maxr … (le_n …))
+ ]
+ ]
+qed.
+
+lemma sigma_bound1: ∀h,a,b. monotonic nat le h →
+ ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*h b.
+#h #a #b #H
+@(transitive_le … (sigma_to_Max …)) @le_times //
+@Max_le #i #lti #_ @H @lt_to_le @lt_minus_to_plus_r //
+qed.
+
+lemma sigma_bound_decr1: ∀h,a,b. (∀a1,a2. a1 ≤ a2 → a2 < b → h a2 ≤ h a1) →
+ ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*h a.
+#h #a #b #H
+@(transitive_le … (sigma_to_Max …)) @le_times //
+@Max_le #i #lti #_ @H // @lt_minus_to_plus_r //
+qed.
+
+lemma sigma_bound: ∀h,a,b. monotonic nat le h →
+ ∑_{i ∈ [a,S b[ }(h i) ≤ (S b-a)*h b.
+#h #a #b #H cases (decidable_le a b)
+ [#leab cut (b = pred (S b - a + a))
+ [<plus_minus_m_m // @le_S //] #Hb >Hb in match (h b);
+ generalize in match (S b -a);
+ #n elim n
+ [//
+ |#m #Hind >bigop_Strue [2://] @le_plus
+ [@H @le_n |@(transitive_le … Hind) @le_times [//] @H //]
+ ]
+ |#ltba lapply (not_le_to_lt … ltba) -ltba #ltba
+ cut (S b -a = 0) [@minus_to_0 //] #Hcut >Hcut //
+ ]
+qed.
+
+lemma sigma_bound_decr: ∀h,a,b. (∀a1,a2. a1 ≤ a2 → a2 < b → h a2 ≤ h a1) →
+ ∑_{i ∈ [a,b[ }(h i) ≤ (b-a)*h a.
+#h #a #b #H cases (decidable_le a b)
+ [#leab cut ((b -a) +a ≤ b) [/2 by le_minus_to_plus_r/] generalize in match (b -a);
+ #n elim n
+ [//
+ |#m #Hind >bigop_Strue [2://] #Hm
+ cut (m+a ≤ b) [@(transitive_le … Hm) //] #Hm1
+ @le_plus [@H // |@(transitive_le … (Hind Hm1)) //]
+ ]
+ |#ltba lapply (not_le_to_lt … ltba) -ltba #ltba
+ cut (b -a = 0) [@minus_to_0 @lt_to_le @ltba] #Hcut >Hcut //
+ ]
+qed.
+
\ No newline at end of file
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"
@Hmono @(mono_h_of2 … Hr Hmono … ltin)
]
qed.
-
\ No newline at end of file
+
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"
@Hmono @(mono_h_of2 … Hr Hmono … ltin)
]
qed.
-
\ No newline at end of file
+
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"
@Hmono @(mono_h_of2 … Hr Hmono … ltin)
]
qed.
-
\ No newline at end of file
+
--- /dev/null
+(*
+<<<<<<< HEAD:matita/matita/broken_lib/reverse_complexity/toolkit.ma
+include "basics/types.ma".
+include "arithmetics/minimization.ma".
+include "arithmetics/bigops.ma".
+include "arithmetics/sigma_pi.ma".
+include "arithmetics/bounded_quantifiers.ma".
+include "reverse_complexity/big_O.ma".
+include "basics/core_notation/napart_2.ma".
+
+(************************* notation for minimization *****************************)
+notation "μ_{ ident i < n } p"
+ with precedence 80 for @{min $n 0 (λ${ident i}.$p)}.
+
+notation "μ_{ ident i ≤ n } p"
+ with precedence 80 for @{min (S $n) 0 (λ${ident i}.$p)}.
+
+notation "μ_{ ident i ∈ [a,b[ } p"
+ with precedence 80 for @{min ($b-$a) $a (λ${ident i}.$p)}.
+
+notation "μ_{ ident i ∈ [a,b] } p"
+ with precedence 80 for @{min (S $b-$a) $a (λ${ident i}.$p)}.
+
+(************************************ MAX *************************************)
+notation "Max_{ ident i < n | p } f"
+ with precedence 80
+for @{'bigop $n max 0 (λ${ident i}. $p) (λ${ident i}. $f)}.
+
+notation "Max_{ ident i < n } f"
+ with precedence 80
+for @{'bigop $n max 0 (λ${ident i}.true) (λ${ident i}. $f)}.
+
+notation "Max_{ ident j ∈ [a,b[ } f"
+ with precedence 80
+for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.true) (${ident j}+$a)))
+ (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}.
+
+notation "Max_{ ident j ∈ [a,b[ | p } f"
+ with precedence 80
+for @{'bigop ($b-$a) max 0 (λ${ident j}.((λ${ident j}.$p) (${ident j}+$a)))
+ (λ${ident j}.((λ${ident j}.$f)(${ident j}+$a)))}.
+
+lemma Max_assoc: ∀a,b,c. max (max a b) c = max a (max b c).
+#a #b #c normalize cases (true_or_false (leb a b)) #leab >leab normalize
+ [cases (true_or_false (leb b c )) #lebc >lebc normalize
+ [>(le_to_leb_true a c) // @(transitive_le ? b) @leb_true_to_le //
+ |>leab //
+ ]
+ |cases (true_or_false (leb b c )) #lebc >lebc normalize //
+ >leab normalize >(not_le_to_leb_false a c) // @lt_to_not_le
+ @(transitive_lt ? b) @not_le_to_lt @leb_false_to_not_le //
+ ]
+qed.
+
+lemma Max0 : ∀n. max 0 n = n.
+// qed.
+
+lemma Max0r : ∀n. max n 0 = n.
+#n >commutative_max //
+qed.
+
+definition MaxA ≝
+ mk_Aop nat 0 max Max0 Max0r (λa,b,c.sym_eq … (Max_assoc a b c)).
+
+definition MaxAC ≝ mk_ACop nat 0 MaxA commutative_max.
+
+lemma le_Max: ∀f,p,n,a. a < n → p a = true →
+ f a ≤ Max_{i < n | p i}(f i).
+#f #p #n #a #ltan #pa
+>(bigop_diff p ? 0 MaxAC f a n) // @(le_maxl … (le_n ?))
+qed.
+
+lemma le_MaxI: ∀f,p,n,m,a. m ≤ a → a < n → p a = true →
+ f a ≤ Max_{i ∈ [m,n[ | p i}(f i).
+#f #p #n #m #a #lema #ltan #pa
+>(bigop_diff ? ? 0 MaxAC (λi.f (i+m)) (a-m) (n-m))
+ [<plus_minus_m_m // @(le_maxl … (le_n ?))
+ |<plus_minus_m_m //
+ |/2 by monotonic_lt_minus_l/
+ ]
+qed.
+
+lemma Max_le: ∀f,p,n,b.
+ (∀a.a < n → p a = true → f a ≤ b) → Max_{i < n | p i}(f i) ≤ b.
+#f #p #n elim n #b #H //
+#b0 #H1 cases (true_or_false (p b)) #Hb
+ [>bigop_Strue [2:@Hb] @to_max [@H1 // | @H #a #ltab #pa @H1 // @le_S //]
+ |>bigop_Sfalse [2:@Hb] @H #a #ltab #pa @H1 // @le_S //
+ ]
+qed.
+
+(********************************** pairing ***********************************)
+axiom pair: nat → nat → nat.
+axiom fst : nat → nat.
+axiom snd : nat → nat.
+
+interpretation "abstract pair" 'pair f g = (pair f g).
+
+axiom fst_pair: ∀a,b. fst 〈a,b〉 = a.
+axiom snd_pair: ∀a,b. snd 〈a,b〉 = b.
+axiom surj_pair: ∀x. ∃a,b. x = 〈a,b〉.
+
+axiom le_fst : ∀p. fst p ≤ p.
+axiom le_snd : ∀p. snd p ≤ p.
+axiom le_pair: ∀a,a1,b,b1. a ≤ a1 → b ≤ b1 → 〈a,b〉 ≤ 〈a1,b1〉.
+
+(************************************* U **************************************)
+axiom U: nat → nat →nat → option nat.
+
+axiom monotonic_U: ∀i,x,n,m,y.n ≤m →
+ U i x n = Some ? y → U i x m = Some ? y.
+
+lemma unique_U: ∀i,x,n,m,yn,ym.
+ U i x n = Some ? yn → U i x m = Some ? ym → yn = ym.
+#i #x #n #m #yn #ym #Hn #Hm cases (decidable_le n m)
+ [#lenm lapply (monotonic_U … lenm Hn) >Hm #HS destruct (HS) //
+ |#ltmn lapply (monotonic_U … n … Hm) [@lt_to_le @not_le_to_lt //]
+ >Hn #HS destruct (HS) //
+ ]
+qed.
+
+definition code_for ≝ λf,i.∀x.
+ ∃n.∀m. n ≤ m → U i x m = f x.
+
+definition terminate ≝ λi,x,r. ∃y. U i x r = Some ? y.
+
+notation "{i ⊙ x} ↓ r" with precedence 60 for @{terminate $i $x $r}.
+
+lemma terminate_dec: ∀i,x,n. {i ⊙ x} ↓ n ∨ ¬ {i ⊙ x} ↓ n.
+#i #x #n normalize cases (U i x n)
+ [%2 % * #y #H destruct|#y %1 %{y} //]
+qed.
+
+lemma monotonic_terminate: ∀i,x,n,m.
+ n ≤ m → {i ⊙ x} ↓ n → {i ⊙ x} ↓ m.
+#i #x #n #m #lenm * #z #H %{z} @(monotonic_U … H) //
+qed.
+
+definition termb ≝ λi,x,t.
+ match U i x t with [None ⇒ false |Some y ⇒ true].
+
+lemma termb_true_to_term: ∀i,x,t. termb i x t = true → {i ⊙ x} ↓ t.
+#i #x #t normalize cases (U i x t) normalize [#H destruct | #y #_ %{y} //]
+qed.
+
+lemma term_to_termb_true: ∀i,x,t. {i ⊙ x} ↓ t → termb i x t = true.
+#i #x #t * #y #H normalize >H //
+qed.
+
+definition out ≝ λi,x,r.
+ match U i x r with [ None ⇒ 0 | Some z ⇒ z].
+
+definition bool_to_nat: bool → nat ≝
+ λb. match b with [true ⇒ 1 | false ⇒ 0].
+
+coercion bool_to_nat.
+
+definition pU : nat → nat → nat → nat ≝ λi,x,r.〈termb i x r,out i x r〉.
+
+lemma pU_vs_U_Some : ∀i,x,r,y. pU i x r = 〈1,y〉 ↔ U i x r = Some ? y.
+#i #x #r #y % normalize
+ [cases (U i x r) normalize
+ [#H cut (0=1) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H @H]
+ #H1 destruct
+ |#a #H cut (a=y) [lapply (eq_f … snd … H) >snd_pair >snd_pair #H1 @H1]
+ #H1 //
+ ]
+ |#H >H //]
+qed.
+
+lemma pU_vs_U_None : ∀i,x,r. pU i x r = 〈0,0〉 ↔ U i x r = None ?.
+#i #x #r % normalize
+ [cases (U i x r) normalize //
+ #a #H cut (1=0) [lapply (eq_f … fst … H) >fst_pair >fst_pair #H1 @H1]
+ #H1 destruct
+ |#H >H //]
+qed.
+
+lemma fst_pU: ∀i,x,r. fst (pU i x r) = termb i x r.
+#i #x #r normalize cases (U i x r) normalize >fst_pair //
+qed.
+
+lemma snd_pU: ∀i,x,r. snd (pU i x r) = out i x r.
+#i #x #r normalize cases (U i x r) normalize >snd_pair //
+qed.
+=======
+include "reverse_complexity/bigops_compl.ma".
+>>>>>>> reverse_complexity lib restored:matita/matita/lib/reverse_complexity/speedup.ma
+*)
+
+(********************************* the speedup ********************************)
+
+definition min_input ≝ λh,i,x. μ_{y ∈ [S i,x] } (termb i y (h (S i) y)).
+
+lemma min_input_def : ∀h,i,x.
+ min_input h i x = min (x -i) (S i) (λy.termb i y (h (S i) y)).
+// qed.
+
+lemma min_input_i: ∀h,i,x. x ≤ i → min_input h i x = S i.
+#h #i #x #lexi >min_input_def
+cut (x - i = 0) [@sym_eq /2 by eq_minus_O/] #Hcut //
+qed.
+
+lemma min_input_to_terminate: ∀h,i,x.
+ min_input h i x = x → {i ⊙ x} ↓ (h (S i) x).
+#h #i #x #Hminx
+cases (decidable_le (S i) x) #Hix
+ [cases (true_or_false (termb i x (h (S i) x))) #Hcase
+ [@termb_true_to_term //
+ |<Hminx in Hcase; #H lapply (fmin_false (λx.termb i x (h (S i) x)) (x-i) (S i) H)
+ >min_input_def in Hminx; #Hminx >Hminx in ⊢ (%→?);
+ <plus_n_Sm <plus_minus_m_m [2: @lt_to_le //]
+ #Habs @False_ind /2/
+ ]
+ |@False_ind >min_input_i in Hminx;
+ [#eqix >eqix in Hix; * /2/ | @le_S_S_to_le @not_le_to_lt //]
+ ]
+qed.
+
+lemma min_input_to_lt: ∀h,i,x.
+ min_input h i x = x → i < x.
+#h #i #x #Hminx cases (decidable_le (S i) x) //
+#ltxi @False_ind >min_input_i in Hminx;
+ [#eqix >eqix in ltxi; * /2/ | @le_S_S_to_le @not_le_to_lt //]
+qed.
+
+lemma le_to_min_input: ∀h,i,x,x1. x ≤ x1 →
+ min_input h i x = x → min_input h i x1 = x.
+#h #i #x #x1 #lex #Hminx @(min_exists … (le_S_S … lex))
+ [@(fmin_true … (sym_eq … Hminx)) //
+ |@(min_input_to_lt … Hminx)
+ |#j #H1 <Hminx @lt_min_to_false //
+ |@plus_minus_m_m @le_S_S @(transitive_le … lex) @lt_to_le
+ @(min_input_to_lt … Hminx)
+ ]
+qed.
+
+definition g ≝ λh,u,x.
+ S (max_{i ∈[u,x[ | eqb (min_input h i x) x} (out i x (h (S i) x))).
+
+lemma g_def : ∀h,u,x. g h u x =
+ S (max_{i ∈[u,x[ | eqb (min_input h i x) x} (out i x (h (S i) x))).
+// qed.
+
+lemma le_u_to_g_1 : ∀h,u,x. x ≤ u → g h u x = 1.
+#h #u #x #lexu >g_def cut (x-u = 0) [/2 by minus_le_minus_minus_comm/]
+#eq0 >eq0 normalize // qed.
+
+lemma g_lt : ∀h,i,x. min_input h i x = x →
+ out i x (h (S i) x) < g h 0 x.
+#h #i #x #H @le_S_S @(le_MaxI … i) /2 by min_input_to_lt/
+qed.
+
+lemma max_neq0 : ∀a,b. max a b ≠ 0 → a ≠ 0 ∨ b ≠ 0.
+#a #b whd in match (max a b); cases (true_or_false (leb a b)) #Hcase >Hcase
+ [#H %2 @H | #H %1 @H]
+qed.
+
+definition almost_equal ≝ λf,g:nat → nat. ¬ ∀nu.∃x. nu < x ∧ f x ≠ g x.
+interpretation "almost equal" 'napart f g = (almost_equal f g).
+
+lemma eventually_cancelled: ∀h,u.¬∀nu.∃x. nu < x ∧
+ max_{i ∈ [0,u[ | eqb (min_input h i x) x} (out i x (h (S i) x)) ≠ 0.
+#h #u elim u
+ [normalize % #H cases (H u) #x * #_ * #H1 @H1 //
+ |#u0 @not_to_not #Hind #nu cases (Hind nu) #x * #ltx
+ cases (true_or_false (eqb (min_input h (u0+O) x) x)) #Hcase
+ [>bigop_Strue [2:@Hcase] #Hmax cases (max_neq0 … Hmax) -Hmax
+ [2: #H %{x} % // <minus_n_O @H]
+ #Hneq0 (* if x is not enough we retry with nu=x *)
+ cases (Hind x) #x1 * #ltx1
+ >bigop_Sfalse
+ [#H %{x1} % [@transitive_lt //| <minus_n_O @H]
+ |@not_eq_to_eqb_false >(le_to_min_input … (eqb_true_to_eq … Hcase))
+ [@lt_to_not_eq @ltx1 | @lt_to_le @ltx1]
+ ]
+ |>bigop_Sfalse [2:@Hcase] #H %{x} % // <minus_n_O @H
+ ]
+ ]
+qed.
+
+lemma condition_1: ∀h,u.g h 0 ≈ g h u.
+#h #u @(not_to_not … (eventually_cancelled h u))
+#H #nu cases (H (max u nu)) #x * #ltx #Hdiff
+%{x} % [@(le_to_lt_to_lt … ltx) @(le_maxr … (le_n …))] @(not_to_not … Hdiff)
+#H @(eq_f ?? S) >(bigop_sumI 0 u x (λi:ℕ.eqb (min_input h i x) x) nat 0 MaxA)
+ [>H // |@lt_to_le @(le_to_lt_to_lt …ltx) /2 by le_maxr/ |//]
+qed.
+
+(******************************** Condition 2 *********************************)
+
+lemma exists_to_exists_min: ∀h,i. (∃x. i < x ∧ {i ⊙ x} ↓ h (S i) x) → ∃y. min_input h i y = y.
+#h #i * #x * #ltix #Hx %{(min_input h i x)} @min_spec_to_min @found //
+ [@(f_min_true (λy:ℕ.termb i y (h (S i) y))) %{x} % [% // | @term_to_termb_true //]
+ |#y #leiy #lty @(lt_min_to_false ????? lty) //
+ ]
+qed.
+
+lemma condition_2: ∀h,i. code_for (total (g h 0)) i → ¬∃x. i<x ∧ {i ⊙ x} ↓ h (S i) x.
+#h #i whd in ⊢(%→?); #H % #H1 cases (exists_to_exists_min … H1) #y #Hminy
+lapply (g_lt … Hminy)
+lapply (min_input_to_terminate … Hminy) * #r #termy
+cases (H y) -H #ny #Hy
+cut (r = g h 0 y) [@(unique_U … ny … termy) @Hy //] #Hr
+whd in match (out ???); >termy >Hr
+#H @(absurd ? H) @le_to_not_lt @le_n
+qed.
+
+(**************************** complexity of g *********************************)
+
+definition unary_g ≝ λh.λux. g h (fst ux) (snd ux).
+definition auxg ≝
+ λh,ux. max_{i ∈[fst ux,snd ux[ | eqb (min_input h i (snd ux)) (snd ux)}
+ (out i (snd ux) (h (S i) (snd ux))).
+
+lemma compl_g1 : ∀h,s. CF s (auxg h) → CF s (unary_g h).
+#h #s #H1 @(CF_compS ? (auxg h) H1)
+qed.
+
+definition aux1g ≝
+ λh,ux. max_{i ∈[fst ux,snd ux[ | (λp. eqb (min_input h (fst p) (snd (snd p))) (snd (snd p))) 〈i,ux〉}
+ ((λp.out (fst p) (snd (snd p)) (h (S (fst p)) (snd (snd p)))) 〈i,ux〉).
+
+lemma eq_aux : ∀h,x.aux1g h x = auxg h x.
+#h #x @same_bigop
+ [#n #_ >fst_pair >snd_pair // |#n #_ #_ >fst_pair >snd_pair //]
+qed.
+
+lemma compl_g2 : ∀h,s1,s2,s.
+ CF s1
+ (λp:ℕ.eqb (min_input h (fst p) (snd (snd p))) (snd (snd p))) →
+ CF s2
+ (λp:ℕ.out (fst p) (snd (snd p)) (h (S (fst p)) (snd (snd p)))) →
+ O s (λx.MSC x + (snd x - fst x)*Max_{i ∈[fst x ,snd x[ }(s1 〈i,x〉+s2 〈i,x〉)) →
+ CF s (auxg h).
+#h #s1 #s2 #s #Hs1 #Hs2 #HO @(ext_CF (aux1g h))
+ [#n whd in ⊢ (??%%); @eq_aux]
+@(CF_max2 … CF_fst CF_snd Hs1 Hs2 …) @(O_trans … HO)
+@O_plus [@O_plus @O_plus_l // | @O_plus_r //]
+qed.
+
+lemma compl_g3 : ∀h,s.
+ CF s (λp:ℕ.min_input h (fst p) (snd (snd p))) →
+ CF s (λp:ℕ.eqb (min_input h (fst p) (snd (snd p))) (snd (snd p))).
+#h #s #H @(CF_eqb … H) @(CF_comp … CF_snd CF_snd) @(O_trans … (le_to_O … (MSC_in … H)))
+@O_plus // %{1} %{0} #n #_ >commutative_times <times_n_1 @monotonic_MSC //
+qed.
+
+definition min_input_aux ≝ λh,p.
+ μ_{y ∈ [S (fst p),snd (snd p)] }
+ ((λx.termb (fst (snd x)) (fst x) (h (S (fst (snd x))) (fst x))) 〈y,p〉).
+
+lemma min_input_eq : ∀h,p.
+ min_input_aux h p =
+ min_input h (fst p) (snd (snd p)).
+#h #p >min_input_def whd in ⊢ (??%?); >minus_S_S @min_f_g #i #_ #_
+whd in ⊢ (??%%); >fst_pair >snd_pair //
+qed.
+
+definition termb_aux ≝ λh.
+ termb_unary ∘ λp.〈fst (snd p),〈fst p,h (S (fst (snd p))) (fst p)〉〉.
+
+lemma compl_g4 : ∀h,s1,s. (∀x. 0 < s1 x) →
+ (CF s1
+ (λp.termb (fst (snd p)) (fst p) (h (S (fst (snd p))) (fst p)))) →
+ (O s (λx.MSC x + ((snd(snd x) - (fst x)))*Max_{i ∈[S(fst x) ,S(snd (snd x))[ }(s1 〈i,x〉))) →
+ CF s (λp:ℕ.min_input h (fst p) (snd (snd p))).
+#h #s1 #s #pos_s1 #Hs1 #HO @(ext_CF (min_input_aux h))
+ [#n whd in ⊢ (??%%); @min_input_eq]
+@(CF_mu4 … MSC MSC … pos_s1 … Hs1)
+ [@CF_compS @CF_fst
+ |@CF_comp_snd @CF_snd
+ |@(O_trans … HO) @O_plus [@O_plus @O_plus_l // | @O_plus_r //]
+qed.
+
+(* ??? *)
+
+lemma coroll: ∀s1:nat→nat. (∀n. monotonic ℕ le (λa:ℕ.s1 〈a,n〉)) →
+O (λx.(snd (snd x)-fst x)*(s1 〈snd (snd x),x〉))
+ (λx.∑_{i ∈[S(fst x) ,S(snd (snd x))[ }(s1 〈i,x〉)).
+#s1 #Hs1 %{1} %{0} #n #_ >commutative_times <times_n_1
+@(transitive_le … (sigma_bound …)) [@Hs1|>minus_S_S //]
+qed.
+
+lemma coroll2: ∀s1:nat→nat. (∀n,a,b. a ≤ b → b < snd n → s1 〈b,n〉 ≤ s1 〈a,n〉) →
+O (λx.(snd x - fst x)*s1 〈fst x,x〉) (λx.∑_{i ∈[fst x,snd x[ }(s1 〈i,x〉)).
+#s1 #Hs1 %{1} %{0} #n #_ >commutative_times <times_n_1
+@(transitive_le … (sigma_bound_decr …)) [2://] @Hs1
+qed.
+
+lemma coroll3: ∀s1:nat→nat. (∀n,a,b. a ≤ b → b < snd n → s1 〈b,n〉 ≤ s1 〈a,n〉) →
+O (λx.(snd x - fst x)*s1 〈fst x,x〉)
+ (λx.(snd x - fst x)*Max_{i ∈[fst x,snd x[ }(s1 〈i,x〉)).
+#s1 #Hs1 @le_to_O #i @le_times // @Max_le #a #lta #_ @Hs1 //
+@lt_minus_to_plus_r //
+qed.
+
+(**************************** end of technical lemmas *************************)
+
+lemma compl_g5 : ∀h,s1.
+ (∀n. 0 < s1 n) →
+ (∀n. monotonic ℕ le (λa:ℕ.s1 〈a,n〉)) →
+ (CF s1
+ (λp.termb (fst (snd p)) (fst p) (h (S (fst (snd p))) (fst p)))) →
+ CF (λx.MSC x + (snd (snd x)-fst x)*s1 〈snd (snd x),x〉)
+ (λp:ℕ.min_input h (fst p) (snd (snd p))).
+#h #s1 #Hpos #Hmono #Hs1 @(compl_g4 … Hpos Hs1) @O_plus
+[@O_plus_l // |@O_plus_r @le_to_O #n @le_times //
+@Max_le #i #lti #_ @Hmono @le_S_S_to_le @lt_minus_to_plus_r @lti
+qed.
+
+lemma compl_g6: ∀h.
+ constructible (λx. h (fst x) (snd x)) →
+ (CF (λx. sU 〈max (fst (snd x)) (snd (snd x)),〈fst x,h (S (fst (snd x))) (fst x)〉〉)
+ (λp.termb (fst (snd p)) (fst p) (h (S (fst (snd p))) (fst p)))).
+#h #hconstr @(ext_CF (termb_aux h))
+ [#n normalize >fst_pair >snd_pair >fst_pair >snd_pair // ]
+@(CF_comp … (λx.MSC x + h (S (fst (snd x))) (fst x)) … CF_termb)
+ [@CF_comp_pair
+ [@CF_comp_fst @(monotonic_CF … CF_snd) #x //
+ |@CF_comp_pair
+ [@(monotonic_CF … CF_fst) #x //
+ |@(ext_CF ((λx.h (fst x) (snd x))∘(λx.〈S (fst (snd x)),fst x〉)))
+ [#n normalize >fst_pair >snd_pair %]
+ @(CF_comp … MSC …hconstr)
+ [@CF_comp_pair [@CF_compS @CF_comp_fst // |//]
+ |@O_plus @le_to_O [//|#n >fst_pair >snd_pair //]
+ ]
+ ]
+ ]
+ |@O_plus
+ [@O_plus
+ [@(O_trans … (λx.MSC (fst x) + MSC (max (fst (snd x)) (snd (snd x)))))
+ [%{2} %{0} #x #_ cases (surj_pair x) #a * #b #eqx >eqx
+ >fst_pair >snd_pair @(transitive_le … (MSC_pair …))
+ >distributive_times_plus @le_plus [//]
+ cases (surj_pair b) #c * #d #eqb >eqb
+ >fst_pair >snd_pair @(transitive_le … (MSC_pair …))
+ whd in ⊢ (??%); @le_plus
+ [@monotonic_MSC @(le_maxl … (le_n …))
+ |>commutative_times <times_n_1 @monotonic_MSC @(le_maxr … (le_n …))
+ ]
+ |@O_plus [@le_to_O #x @sU_le_x |@le_to_O #x @sU_le_i]
+ ]
+ |@le_to_O #n @sU_le
+ ]
+ |@le_to_O #x @monotonic_sU // @(le_maxl … (le_n …)) ]
+ ]
+qed.
+
+definition big : nat →nat ≝ λx.
+ let m ≝ max (fst x) (snd x) in 〈m,m〉.
+
+lemma big_def : ∀a,b. big 〈a,b〉 = 〈max a b,max a b〉.
+#a #b normalize >fst_pair >snd_pair // qed.
+
+lemma le_big : ∀x. x ≤ big x.
+#x cases (surj_pair x) #a * #b #eqx >eqx @le_pair >fst_pair >snd_pair
+[@(le_maxl … (le_n …)) | @(le_maxr … (le_n …))]
+qed.
+
+definition faux2 ≝ λh.
+ (λx.MSC x + (snd (snd x)-fst x)*
+ (λx.sU 〈max (fst(snd x)) (snd(snd x)),〈fst x,h (S (fst (snd x))) (fst x)〉〉) 〈snd (snd x),x〉).
+
+lemma compl_g7: ∀h.
+ constructible (λx. h (fst x) (snd x)) →
+ (∀n. monotonic ? le (h n)) →
+ CF (λx.MSC x + (snd (snd x)-fst x)*sU 〈max (fst x) (snd x),〈snd (snd x),h (S (fst x)) (snd (snd x))〉〉)
+ (λp:ℕ.min_input h (fst p) (snd (snd p))).
+#h #hcostr #hmono @(monotonic_CF … (faux2 h))
+ [#n normalize >fst_pair >snd_pair //]
+@compl_g5 [#n @sU_pos | 3:@(compl_g6 h hcostr)] #n #x #y #lexy >fst_pair >snd_pair
+>fst_pair >snd_pair @monotonic_sU // @hmono @lexy
+qed.
+
+lemma compl_g71: ∀h.
+ constructible (λx. h (fst x) (snd x)) →
+ (∀n. monotonic ? le (h n)) →
+ CF (λx.MSC (big x) + (snd (snd x)-fst x)*sU 〈max (fst x) (snd x),〈snd (snd x),h (S (fst x)) (snd (snd x))〉〉)
+ (λp:ℕ.min_input h (fst p) (snd (snd p))).
+#h #hcostr #hmono @(monotonic_CF … (compl_g7 h hcostr hmono)) #x
+@le_plus [@monotonic_MSC //]
+cases (decidable_le (fst x) (snd(snd x)))
+ [#Hle @le_times // @monotonic_sU
+ |#Hlt >(minus_to_0 … (lt_to_le … )) [// | @not_le_to_lt @Hlt]
+ ]
+qed.
+
+definition out_aux ≝ λh.
+ out_unary ∘ λp.〈fst p,〈snd(snd p),h (S (fst p)) (snd (snd p))〉〉.
+
+lemma compl_g8: ∀h.
+ constructible (λx. h (fst x) (snd x)) →
+ (CF (λx. sU 〈max (fst x) (snd x),〈snd(snd x),h (S (fst x)) (snd(snd x))〉〉)
+ (λp.out (fst p) (snd (snd p)) (h (S (fst p)) (snd (snd p))))).
+#h #hconstr @(ext_CF (out_aux h))
+ [#n normalize >fst_pair >snd_pair >fst_pair >snd_pair // ]
+@(CF_comp … (λx.h (S (fst x)) (snd(snd x)) + MSC x) … CF_out)
+ [@CF_comp_pair
+ [@(monotonic_CF … CF_fst) #x //
+ |@CF_comp_pair
+ [@CF_comp_snd @(monotonic_CF … CF_snd) #x //
+ |@(ext_CF ((λx.h (fst x) (snd x))∘(λx.〈S (fst x),snd(snd x)〉)))
+ [#n normalize >fst_pair >snd_pair %]
+ @(CF_comp … MSC …hconstr)
+ [@CF_comp_pair [@CF_compS // | @CF_comp_snd // ]
+ |@O_plus @le_to_O [//|#n >fst_pair >snd_pair //]
+ ]
+ ]
+ ]
+ |@O_plus
+ [@O_plus
+ [@le_to_O #n @sU_le
+ |@(O_trans … (λx.MSC (max (fst x) (snd x))))
+ [%{2} %{0} #x #_ cases (surj_pair x) #a * #b #eqx >eqx
+ >fst_pair >snd_pair @(transitive_le … (MSC_pair …))
+ whd in ⊢ (??%); @le_plus
+ [@monotonic_MSC @(le_maxl … (le_n …))
+ |>commutative_times <times_n_1 @monotonic_MSC @(le_maxr … (le_n …))
+ ]
+ |@le_to_O #x @(transitive_le ???? (sU_le_i … )) //
+ ]
+ ]
+ |@le_to_O #x @monotonic_sU [@(le_maxl … (le_n …))|//|//]
+ ]
+qed.
+
+lemma compl_g9 : ∀h.
+ constructible (λx. h (fst x) (snd x)) →
+ (∀n. monotonic ? le (h n)) →
+ (∀n,a,b. a ≤ b → b ≤ n → h b n ≤ h a n) →
+ CF (λx. (S (snd x-fst x))*MSC 〈x,x〉 +
+ (snd x-fst x)*(S(snd x-fst x))*sU 〈x,〈snd x,h (S (fst x)) (snd x)〉〉)
+ (auxg h).
+#h #hconstr #hmono #hantimono
+@(compl_g2 h ??? (compl_g3 … (compl_g71 h hconstr hmono)) (compl_g8 h hconstr))
+@O_plus
+ [@O_plus_l @le_to_O #x >(times_n_1 (MSC x)) >commutative_times @le_times
+ [// | @monotonic_MSC // ]]
+@(O_trans … (coroll3 ??))
+ [#n #a #b #leab #ltb >fst_pair >fst_pair >snd_pair >snd_pair
+ cut (b ≤ n) [@(transitive_le … (le_snd …)) @lt_to_le //] #lebn
+ cut (max a n = n)
+ [normalize >le_to_leb_true [//|@(transitive_le … leab lebn)]] #maxa
+ cut (max b n = n) [normalize >le_to_leb_true //] #maxb
+ @le_plus
+ [@le_plus [>big_def >big_def >maxa >maxb //]
+ @le_times
+ [/2 by monotonic_le_minus_r/
+ |@monotonic_sU // @hantimono [@le_S_S // |@ltb]
+ ]
+ |@monotonic_sU // @hantimono [@le_S_S // |@ltb]
+ ]
+ |@le_to_O #n >fst_pair >snd_pair
+ cut (max (fst n) n = n) [normalize >le_to_leb_true //] #Hmax >Hmax
+ >associative_plus >distributive_times_plus
+ @le_plus [@le_times [@le_S // |>big_def >Hmax //] |//]
+ ]
+qed.
+
+definition c ≝ λx.(S (snd x-fst x))*MSC 〈x,x〉.
+
+definition sg ≝ λh,x.
+ let a ≝ fst x in
+ let b ≝ snd x in
+ c x + (b-a)*(S(b-a))*sU 〈x,〈snd x,h (S a) b〉〉.
+
+lemma sg_def1 : ∀h,a,b.
+ sg h 〈a,b〉 = c 〈a,b〉 +
+ (b-a)*(S(b-a))*sU 〈〈a,b〉,〈b,h (S a) b〉〉.
+#h #a #b whd in ⊢ (??%?); >fst_pair >snd_pair //
+qed.
+
+lemma sg_def : ∀h,a,b.
+ sg h 〈a,b〉 =
+ S (b-a)*MSC 〈〈a,b〉,〈a,b〉〉 + (b-a)*(S(b-a))*sU 〈〈a,b〉,〈b,h (S a) b〉〉.
+#h #a #b normalize >fst_pair >snd_pair //
+qed.
+
+lemma compl_g11 : ∀h.
+ constructible (λx. h (fst x) (snd x)) →
+ (∀n. monotonic ? le (h n)) →
+ (∀n,a,b. a ≤ b → b ≤ n → h b n ≤ h a n) →
+ CF (sg h) (unary_g h).
+#h #hconstr #Hm #Ham @compl_g1 @(compl_g9 h hconstr Hm Ham)
+qed.
+
+(**************************** closing the argument ****************************)
+
+let rec h_of_aux (r:nat →nat) (c,d,b:nat) on d : nat ≝
+ match d with
+ [ O ⇒ c
+ | S d1 ⇒ (S d)*(MSC 〈〈b-d,b〉,〈b-d,b〉〉) +
+ d*(S d)*sU 〈〈b-d,b〉,〈b,r (h_of_aux r c d1 b)〉〉].
+
+lemma h_of_aux_O: ∀r,c,b.
+ h_of_aux r c O b = c.
+// qed.
+
+lemma h_of_aux_S : ∀r,c,d,b.
+ h_of_aux r c (S d) b =
+ (S (S d))*(MSC 〈〈b-(S d),b〉,〈b-(S d),b〉〉) +
+ (S d)*(S (S d))*sU 〈〈b-(S d),b〉,〈b,r(h_of_aux r c d b)〉〉.
+// qed.
+
+definition h_of ≝ λr,p.
+ let m ≝ max (fst p) (snd p) in
+ h_of_aux r (MSC 〈〈m,m〉,〈m,m〉〉) (snd p - fst p) (snd p).
+
+lemma h_of_O: ∀r,a,b. b ≤ a →
+ h_of r 〈a,b〉 = let m ≝ max a b in MSC 〈〈m,m〉,〈m,m〉〉.
+#r #a #b #Hle normalize >fst_pair >snd_pair >(minus_to_0 … Hle) //
+qed.
+
+lemma h_of_def: ∀r,a,b.h_of r 〈a,b〉 =
+ let m ≝ max a b in
+ h_of_aux r (MSC 〈〈m,m〉,〈m,m〉〉) (b - a) b.
+#r #a #b normalize >fst_pair >snd_pair //
+qed.
+
+lemma mono_h_of_aux: ∀r.(∀x. x ≤ r x) → monotonic ? le r →
+ ∀d,d1,c,c1,b,b1.c ≤ c1 → d ≤ d1 → b ≤ b1 →
+ h_of_aux r c d b ≤ h_of_aux r c1 d1 b1.
+#r #Hr #monor #d #d1 lapply d -d elim d1
+ [#d #c #c1 #b #b1 #Hc #Hd @(le_n_O_elim ? Hd) #leb
+ >h_of_aux_O >h_of_aux_O //
+ |#m #Hind #d #c #c1 #b #b1 #lec #led #leb cases (le_to_or_lt_eq … led)
+ [#ltd @(transitive_le … (Hind … lec ? leb)) [@le_S_S_to_le @ltd]
+ >h_of_aux_S @(transitive_le ???? (le_plus_n …))
+ >(times_n_1 (h_of_aux r c1 m b1)) in ⊢ (?%?);
+ >commutative_times @le_times [//|@(transitive_le … (Hr ?)) @sU_le]
+ |#Hd >Hd >h_of_aux_S >h_of_aux_S
+ cut (b-S m ≤ b1 - S m) [/2 by monotonic_le_minus_l/] #Hb1
+ @le_plus [@le_times //]
+ [@monotonic_MSC @le_pair @le_pair //
+ |@le_times [//] @monotonic_sU
+ [@le_pair // |// |@monor @Hind //]
+ ]
+ ]
+ ]
+qed.
+
+lemma mono_h_of2: ∀r.(∀x. x ≤ r x) → monotonic ? le r →
+ ∀i,b,b1. b ≤ b1 → h_of r 〈i,b〉 ≤ h_of r 〈i,b1〉.
+#r #Hr #Hmono #i #a #b #leab >h_of_def >h_of_def
+cut (max i a ≤ max i b)
+ [@to_max
+ [@(le_maxl … (le_n …))|@(transitive_le … leab) @(le_maxr … (le_n …))]]
+#Hmax @(mono_h_of_aux r Hr Hmono)
+ [@monotonic_MSC @le_pair @le_pair @Hmax |/2 by monotonic_le_minus_l/ |@leab]
+qed.
+
+axiom h_of_constr : ∀r:nat →nat.
+ (∀x. x ≤ r x) → monotonic ? le r → constructible r →
+ constructible (h_of r).
+
+lemma speed_compl: ∀r:nat →nat.
+ (∀x. x ≤ r x) → monotonic ? le r → constructible r →
+ CF (h_of r) (unary_g (λi,x. r(h_of r 〈i,x〉))).
+#r #Hr #Hmono #Hconstr @(monotonic_CF … (compl_g11 …))
+ [#x cases (surj_pair x) #a * #b #eqx >eqx
+ >sg_def cases (decidable_le b a)
+ [#leba >(minus_to_0 … leba) normalize in ⊢ (?%?);
+ <plus_n_O <plus_n_O >h_of_def
+ cut (max a b = a)
+ [normalize cases (le_to_or_lt_eq … leba)
+ [#ltba >(lt_to_leb_false … ltba) %
+ |#eqba <eqba >(le_to_leb_true … (le_n ?)) % ]]
+ #Hmax >Hmax normalize >(minus_to_0 … leba) normalize
+ @monotonic_MSC @le_pair @le_pair //
+ |#ltab >h_of_def >h_of_def
+ cut (max a b = b)
+ [normalize >(le_to_leb_true … ) [%] @lt_to_le @not_le_to_lt @ltab]
+ #Hmax >Hmax
+ cut (max (S a) b = b)
+ [whd in ⊢ (??%?); >(le_to_leb_true … ) [%] @not_le_to_lt @ltab]
+ #Hmax1 >Hmax1
+ cut (∃d.b - a = S d)
+ [%{(pred(b-a))} >S_pred [//] @lt_plus_to_minus_r @not_le_to_lt @ltab]
+ * #d #eqd >eqd
+ cut (b-S a = d) [//] #eqd1 >eqd1 >h_of_aux_S >eqd1
+ cut (b - S d = a)
+ [@plus_to_minus >commutative_plus @minus_to_plus
+ [@lt_to_le @not_le_to_lt // | //]] #eqd2 >eqd2
+ normalize //
+ ]
+ |#n #a #b #leab #lebn >h_of_def >h_of_def
+ cut (max a n = n)
+ [normalize >le_to_leb_true [%|@(transitive_le … leab lebn)]] #Hmaxa
+ cut (max b n = n)
+ [normalize >(le_to_leb_true … lebn) %] #Hmaxb
+ >Hmaxa >Hmaxb @Hmono @(mono_h_of_aux r … Hr Hmono) // /2 by monotonic_le_minus_r/
+ |#n #a #b #leab @Hmono @(mono_h_of2 … Hr Hmono … leab)
+ |@(constr_comp … Hconstr Hr) @(ext_constr (h_of r))
+ [#x cases (surj_pair x) #a * #b #eqx >eqx >fst_pair >snd_pair //]
+ @(h_of_constr r Hr Hmono Hconstr)
+ ]
+qed.
+
+lemma speed_compl_i: ∀r:nat →nat.
+ (∀x. x ≤ r x) → monotonic ? le r → constructible r →
+ ∀i. CF (λx.h_of r 〈i,x〉) (λx.g (λi,x. r(h_of r 〈i,x〉)) i x).
+#r #Hr #Hmono #Hconstr #i
+@(ext_CF (λx.unary_g (λi,x. r(h_of r 〈i,x〉)) 〈i,x〉))
+ [#n whd in ⊢ (??%%); @eq_f @sym_eq >fst_pair >snd_pair %]
+@smn @(ext_CF … (speed_compl r Hr Hmono Hconstr)) #n //
+qed.
+
+(**************************** the speedup theorem *****************************)
+theorem pseudo_speedup:
+ ∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r →
+ ∃f.∀sf. CF sf f → ∃g,sg. f ≈ g ∧ CF sg g ∧ O sf (r ∘ sg).
+(* ∃m,a.∀n. a≤n → r(sg a) < m * sf n. *)
+#r #Hr #Hmono #Hconstr
+(* f is (g (λi,x. r(h_of r 〈i,x〉)) 0) *)
+%{(g (λi,x. r(h_of r 〈i,x〉)) 0)} #sf * #i *
+#Hcodei #HCi
+(* g is (g (λi,x. r(h_of r 〈i,x〉)) (S i)) *)
+%{(g (λi,x. r(h_of r 〈i,x〉)) (S i))}
+(* sg is (λx.h_of r 〈i,x〉) *)
+%{(λx. h_of r 〈S i,x〉)}
+lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg
+%[%[@condition_1 |@Hg]
+ |cases Hg #H1 * #j * #Hcodej #HCj
+ lapply (condition_2 … Hcodei) #Hcond2 (* @not_to_not *)
+ cases HCi #m * #a #Ha %{m} %{(max (S i) a)} #n #ltin @lt_to_le @not_le_to_lt
+ @(not_to_not … Hcond2) -Hcond2 #Hlesf %{n} %
+ [@(transitive_le … ltin) @(le_maxl … (le_n …))]
+ cases (Ha n ?) [2: @(transitive_le … ltin) @(le_maxr … (le_n …))]
+ #y #Uy %{y} @(monotonic_U … Uy) @(transitive_le … Hlesf) //
+ ]
+qed.
+
+theorem pseudo_speedup':
+ ∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r →
+ ∃f.∀sf. CF sf f → ∃g,sg. f ≈ g ∧ CF sg g ∧
+ (* ¬ O (r ∘ sg) sf. *)
+ ∃m,a.∀n. a≤n → r(sg a) < m * sf n.
+#r #Hr #Hmono #Hconstr
+(* f is (g (λi,x. r(h_of r 〈i,x〉)) 0) *)
+%{(g (λi,x. r(h_of r 〈i,x〉)) 0)} #sf * #i *
+#Hcodei #HCi
+(* g is (g (λi,x. r(h_of r 〈i,x〉)) (S i)) *)
+%{(g (λi,x. r(h_of r 〈i,x〉)) (S i))}
+(* sg is (λx.h_of r 〈S i,x〉) *)
+%{(λx. h_of r 〈S i,x〉)}
+lapply (speed_compl_i … Hr Hmono Hconstr (S i)) #Hg
+%[%[@condition_1 |@Hg]
+ |cases Hg #H1 * #j * #Hcodej #HCj
+ lapply (condition_2 … Hcodei) #Hcond2 (* @not_to_not *)
+ cases HCi #m * #a #Ha
+ %{m} %{(max (S i) a)} #n #ltin @not_le_to_lt @(not_to_not … Hcond2) -Hcond2
+ #Hlesf %{n} % [@(transitive_le … ltin) @(le_maxl … (le_n …))]
+ cases (Ha n ?) [2: @(transitive_le … ltin) @(le_maxr … (le_n …))]
+ #y #Uy %{y} @(monotonic_U … Uy) @(transitive_le … Hlesf)
+ @Hmono @(mono_h_of2 … Hr Hmono … ltin)
+ ]
+qed.
+
include "arithmetics/bounded_quantifiers.ma".
include "reverse_complexity/big_O.ma".
-(************************* notation for minimization *****************************)
+(************************* notation for minimization **************************)
notation "μ_{ ident i < n } p"
with precedence 80 for @{min $n 0 (λ${ident i}.$p)}.
axiom le_snd : ∀p. snd p ≤ p.
axiom le_pair: ∀a,a1,b,b1. a ≤ a1 → b ≤ b1 → 〈a,b〉 ≤ 〈a1,b1〉.
+lemma expand_pair: ∀x. x = 〈fst x, snd x〉.
+#x lapply (surj_pair x) * #a * #b #Hx >Hx >fst_pair >snd_pair //
+qed.
+
(************************************* U **************************************)
axiom U: nat → nat →nat → option nat.
definition bool_to_nat: bool → nat ≝
λb. match b with [true ⇒ 1 | false ⇒ 0].
-
+
coercion bool_to_nat.
definition pU : nat → nat → nat → nat ≝ λi,x,r.〈termb i x r,out i x r〉.
#i #x #r normalize cases (U i x r) normalize >snd_pair //
qed.
-(********************************* the speedup ********************************)
-
-definition min_input ≝ λh,i,x. μ_{y ∈ [S i,x] } (termb i y (h (S i) y)).
-
-lemma min_input_def : ∀h,i,x.
- min_input h i x = min (x -i) (S i) (λy.termb i y (h (S i) y)).
-// qed.
-
-lemma min_input_i: ∀h,i,x. x ≤ i → min_input h i x = S i.
-#h #i #x #lexi >min_input_def
-cut (x - i = 0) [@sym_eq /2 by eq_minus_O/] #Hcut //
-qed.
-lemma min_input_to_terminate: ∀h,i,x.
- min_input h i x = x → {i ⊙ x} ↓ (h (S i) x).
-#h #i #x #Hminx
-cases (decidable_le (S i) x) #Hix
- [cases (true_or_false (termb i x (h (S i) x))) #Hcase
- [@termb_true_to_term //
- |<Hminx in Hcase; #H lapply (fmin_false (λx.termb i x (h (S i) x)) (x-i) (S i) H)
- >min_input_def in Hminx; #Hminx >Hminx in ⊢ (%→?);
- <plus_n_Sm <plus_minus_m_m [2: @lt_to_le //]
- #Habs @False_ind /2/
- ]
- |@False_ind >min_input_i in Hminx;
- [#eqix >eqix in Hix; * /2/ | @le_S_S_to_le @not_le_to_lt //]
- ]
-qed.
-
-lemma min_input_to_lt: ∀h,i,x.
- min_input h i x = x → i < x.
-#h #i #x #Hminx cases (decidable_le (S i) x) //
-#ltxi @False_ind >min_input_i in Hminx;
- [#eqix >eqix in ltxi; * /2/ | @le_S_S_to_le @not_le_to_lt //]
-qed.
-
-lemma le_to_min_input: ∀h,i,x,x1. x ≤ x1 →
- min_input h i x = x → min_input h i x1 = x.
-#h #i #x #x1 #lex #Hminx @(min_exists … (le_S_S … lex))
- [@(fmin_true … (sym_eq … Hminx)) //
- |@(min_input_to_lt … Hminx)
- |#j #H1 <Hminx @lt_min_to_false //
- |@plus_minus_m_m @le_S_S @(transitive_le … lex) @lt_to_le
- @(min_input_to_lt … Hminx)
- ]
-qed.
-
-definition g ≝ λh,u,x.
- S (max_{i ∈[u,x[ | eqb (min_input h i x) x} (out i x (h (S i) x))).
-
-lemma g_def : ∀h,u,x. g h u x =
- S (max_{i ∈[u,x[ | eqb (min_input h i x) x} (out i x (h (S i) x))).
-// qed.
-
-lemma le_u_to_g_1 : ∀h,u,x. x ≤ u → g h u x = 1.
-#h #u #x #lexu >g_def cut (x-u = 0) [/2 by minus_le_minus_minus_comm/]
-#eq0 >eq0 normalize // qed.
-
-lemma g_lt : ∀h,i,x. min_input h i x = x →
- out i x (h (S i) x) < g h 0 x.
-#h #i #x #H @le_S_S @(le_MaxI … i) /2 by min_input_to_lt/
-qed.
-
-lemma max_neq0 : ∀a,b. max a b ≠ 0 → a ≠ 0 ∨ b ≠ 0.
-#a #b whd in match (max a b); cases (true_or_false (leb a b)) #Hcase >Hcase
- [#H %2 @H | #H %1 @H]
-qed.
-
-definition almost_equal ≝ λf,g:nat → nat. ¬ ∀nu.∃x. nu < x ∧ f x ≠ g x.
-interpretation "almost equal" 'napart f g = (almost_equal f g).
-
-lemma eventually_cancelled: ∀h,u.¬∀nu.∃x. nu < x ∧
- max_{i ∈ [0,u[ | eqb (min_input h i x) x} (out i x (h (S i) x)) ≠ 0.
-#h #u elim u
- [normalize % #H cases (H u) #x * #_ * #H1 @H1 //
- |#u0 @not_to_not #Hind #nu cases (Hind nu) #x * #ltx
- cases (true_or_false (eqb (min_input h (u0+O) x) x)) #Hcase
- [>bigop_Strue [2:@Hcase] #Hmax cases (max_neq0 … Hmax) -Hmax
- [2: #H %{x} % // <minus_n_O @H]
- #Hneq0 (* if x is not enough we retry with nu=x *)
- cases (Hind x) #x1 * #ltx1
- >bigop_Sfalse
- [#H %{x1} % [@transitive_lt //| <minus_n_O @H]
- |@not_eq_to_eqb_false >(le_to_min_input … (eqb_true_to_eq … Hcase))
- [@lt_to_not_eq @ltx1 | @lt_to_le @ltx1]
- ]
- |>bigop_Sfalse [2:@Hcase] #H %{x} % // <minus_n_O @H
- ]
- ]
-qed.
-
-lemma condition_1: ∀h,u.g h 0 ≈ g h u.
-#h #u @(not_to_not … (eventually_cancelled h u))
-#H #nu cases (H (max u nu)) #x * #ltx #Hdiff
-%{x} % [@(le_to_lt_to_lt … ltx) @(le_maxr … (le_n …))] @(not_to_not … Hdiff)
-#H @(eq_f ?? S) >(bigop_sumI 0 u x (λi:ℕ.eqb (min_input h i x) x) nat 0 MaxA)
- [>H // |@lt_to_le @(le_to_lt_to_lt …ltx) /2 by le_maxr/ |//]
-qed.
-
-(******************************** Condition 2 *********************************)
definition total ≝ λf.λx:nat. Some nat (f x).
-
-lemma exists_to_exists_min: ∀h,i. (∃x. i < x ∧ {i ⊙ x} ↓ h (S i) x) → ∃y. min_input h i y = y.
-#h #i * #x * #ltix #Hx %{(min_input h i x)} @min_spec_to_min @found //
- [@(f_min_true (λy:ℕ.termb i y (h (S i) y))) %{x} % [% // | @term_to_termb_true //]
- |#y #leiy #lty @(lt_min_to_false ????? lty) //
- ]
-qed.
-
-lemma condition_2: ∀h,i. code_for (total (g h 0)) i → ¬∃x. i<x ∧ {i ⊙ x} ↓ h (S i) x.
-#h #i whd in ⊢(%→?); #H % #H1 cases (exists_to_exists_min … H1) #y #Hminy
-lapply (g_lt … Hminy)
-lapply (min_input_to_terminate … Hminy) * #r #termy
-cases (H y) -H #ny #Hy
-cut (r = g h 0 y) [@(unique_U … ny … termy) @Hy //] #Hr
-whd in match (out ???); >termy >Hr
-#H @(absurd ? H) @le_to_not_lt @le_n
-qed.
(********************************* complexity *********************************)
[#x cases (Hcode x) #a #H %{a} whd in match (total ??); <Hext @H | //]
qed.
+lemma ext_CF1 : ∀f,g,s. (∀n. f n = g n) → CF s g → CF s f.
+#f #g #s #Hext * #HO * #i * #Hcode #HC % // %{i} %
+ [#x cases (Hcode x) #a #H %{a} whd in match (total ??); >Hext @H | //]
+qed.
+
lemma monotonic_CF: ∀s1,s2,f.(∀x. s1 x ≤ s2 x) → CF s1 f → CF s2 f.
#s1 #s2 #f #H * #HO * #i * #Hcode #Hs1 %
[cases HO #c * #a -HO #HO %{c} %{a} #n #lean @(transitive_le … (HO n lean))
(* primitve recursion *)
+(* no arguments *)
+
+let rec prim_rec0 (k:nat) (h:nat →nat) n on n ≝
+ match n with
+ [ O ⇒ k
+ | S a ⇒ h 〈a, prim_rec0 k h a〉].
+
+lemma prim_rec0_S: ∀k,h,n.
+ prim_rec0 k h (S n) = h 〈n, prim_rec0 k h n〉.
+// qed.
+
+let rec prim_rec0_compl (k,sk:nat) (h,sh:nat →nat) n on n ≝
+ match n with
+ [ O ⇒ sk
+ | S a ⇒ prim_rec0_compl k sk h sh a + sh (prim_rec0 k h a)].
+
+axiom CF_prim_rec0_gen: ∀k,h,sk,sh,sh1,sf. CF sh h →
+ O sh1 (λx.snd x + sh 〈fst x,prim_rec0 k h (fst x)〉) →
+ O sf (prim_rec0 sk sh1) →
+ CF sf (prim_rec0 k h).
+
+lemma CF_prim_rec0: ∀k,h,sk,sh,sf. CF sh h →
+ O sf (prim_rec0 sk (λx. snd x + sh 〈fst x,prim_rec0 k h (fst x)〉))
+ → CF sf (prim_rec0 k h).
+#k #h #sk #sh #sf #Hh #HO @(CF_prim_rec0_gen … Hh … HO) @O_refl
+qed.
+
+(* with argument(s) m *)
let rec prim_rec (k,h:nat →nat) n m on n ≝
match n with
[ O ⇒ k m
prim_rec k h (S n) m = h 〈n,〈prim_rec k h n m, m〉〉.
// qed.
+lemma prim_rec_le: ∀k1,k2,h1,h2. (∀x.k1 x ≤ k2 x) →
+(∀x,y.x ≤y → h1 x ≤ h2 y) →
+ ∀x,m. prim_rec k1 h1 x m ≤ prim_rec k2 h2 x m.
+#k1 #k2 #h1 #h2 #lek #leh #x #m elim x //
+#n #Hind normalize @leh @le_pair // @le_pair //
+qed.
+
definition unary_pr ≝ λk,h,x. prim_rec k h (fst x) (snd x).
+lemma prim_rec_unary: ∀k,h,a,b.
+ prim_rec k h a b = unary_pr k h 〈a,b〉.
+#k #h #a #b normalize >fst_pair >snd_pair //
+qed.
+
+
let rec prim_rec_compl (k,h,sk,sh:nat →nat) n m on n ≝
match n with
[ O ⇒ sk m
| S a ⇒ prim_rec_compl k h sk sh a m + sh (prim_rec k h a m)].
-
-axiom CF_prim_rec: ∀k,h,sk,sh,sf. CF sk k → CF sh h →
- O sf (unary_pr sk (λx. fst (snd x) + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉))
- → CF sf (unary_pr k h).
-(* falso ????
-lemma prim_rec_O: ∀k1,h1,k2,h2. O k1 k2 → O h1 h2 →
- O (unary_pr k1 h1) (unary_pr k2 h2).
-#k1 #h1 #k2 #h2 #HO1 #HO2 whd *)
+axiom CF_prim_rec_gen: ∀k,h,sk,sh,sh1. CF sk k → CF sh h →
+ O sh1 (λx. fst (snd x) + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉) →
+ CF (unary_pr sk sh1) (unary_pr k h).
+lemma CF_prim_rec: ∀k,h,sk,sh,sf. CF sk k → CF sh h →
+ O sf (unary_pr sk (λx. fst (snd x) + sh 〈fst x,〈unary_pr k h 〈fst x,snd (snd x)〉,snd (snd x)〉〉))
+ → CF sf (unary_pr k h).
+#k #h #sk #sh #sf #Hk #Hh #Osf @(O_to_CF … Osf) @(CF_prim_rec_gen … Hk Hh) @O_refl
+qed.
(**************************** primitive operations*****************************)
definition id ≝ λx:nat.x.
axiom CF_id: CF MSC id.
+axiom CF_const: ∀k.CF MSC (λx.k).
axiom CF_compS: ∀h,f. CF h f → CF h (S ∘ f).
axiom CF_comp_fst: ∀h,f. CF h f → CF h (fst ∘ f).
axiom CF_comp_snd: ∀h,f. CF h f → CF h (snd ∘ f).
lemma CF_snd: CF MSC snd.
@(ext_CF (snd ∘ id)) [#n //] @(CF_comp_snd … CF_id)
-qed.
+qed.
(************************************** eqb ***********************************)
(*********************************** maximum **********************************)
+alias symbol "pair" (instance 13) = "abstract pair".
+alias symbol "pair" (instance 12) = "abstract pair".
+alias symbol "and" (instance 11) = "boolean and".
+alias symbol "plus" (instance 8) = "natural plus".
+alias symbol "pair" (instance 7) = "abstract pair".
+alias symbol "plus" (instance 6) = "natural plus".
+alias symbol "pair" (instance 5) = "abstract pair".
+alias id "max" = "cic:/matita/arithmetics/nat/max#def:2".
+alias symbol "minus" (instance 3) = "natural minus".
+lemma max_gen: ∀a,b,p,f,x. a ≤b →
+ max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) = max_{i < b | leb a i ∧ p 〈i,x〉 }(f 〈i,x〉).
+#a #b #p #f #x @(bigop_I_gen ????? MaxA)
+qed.
+
+lemma max_prim_rec_base: ∀a,b,p,f,x. a ≤b →
+ max_{i < b| p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x.
+#a #b #p #f #x #leab >max_gen // elim b
+ [normalize //
+ |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma max_prim_rec: ∀a,b,p,f,x. a ≤b →
+ max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if leb a (fst i) ∧ p 〈fst i,x〉 then max (f 〈fst i,snd (snd i)〉) (fst (snd i)) else fst (snd i)) b x.
+#a #b #p #f #x #leab >max_gen // elim b
+ [normalize //
+ |#i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair
+ cases (true_or_false (leb a i ∧ p 〈i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *)
+alias symbol "pair" (instance 15) = "abstract pair".
+alias symbol "minus" (instance 14) = "natural minus".
+alias symbol "plus" (instance 11) = "natural plus".
+alias symbol "pair" (instance 10) = "abstract pair".
+alias symbol "plus" (instance 13) = "natural plus".
+alias symbol "pair" (instance 12) = "abstract pair".
+alias symbol "plus" (instance 8) = "natural plus".
+alias symbol "pair" (instance 7) = "abstract pair".
+alias symbol "plus" (instance 6) = "natural plus".
+alias symbol "pair" (instance 5) = "abstract pair".
+alias id "max" = "cic:/matita/arithmetics/nat/max#def:2".
+alias symbol "minus" (instance 3) = "natural minus".
+lemma max_prim_rec1: ∀a,b,p,f,x.
+ max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉
+ then max (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (b x-a x) 〈a x ,x〉.
+#a #b #p #f #x elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma sum_prim_rec1: ∀a,b,p,f,x.
+ ∑_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉
+ then plus (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (b x-a x) 〈a x ,x〉.
+#a #b #p #f #x elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *)
+alias symbol "pair" (instance 15) = "abstract pair".
+alias symbol "minus" (instance 14) = "natural minus".
+alias symbol "plus" (instance 11) = "natural plus".
+alias symbol "pair" (instance 10) = "abstract pair".
+alias symbol "plus" (instance 13) = "natural plus".
+alias symbol "pair" (instance 12) = "abstract pair".
+alias symbol "plus" (instance 8) = "natural plus".
+alias symbol "pair" (instance 7) = "abstract pair".
+alias symbol "pair" (instance 6) = "abstract pair".
+alias symbol "plus" (instance 4) = "natural plus".
+alias symbol "pair" (instance 3) = "abstract pair".
+alias symbol "minus" (instance 2) = "natural minus".
+lemma bigop_prim_rec: ∀a,b,c,p,f,x.
+ bigop (b x-a x) (λi:ℕ.p 〈i+a x,x〉) ? (c 〈a x,x〉) plus (λi:ℕ.f 〈i+a x,x〉) =
+ prim_rec c
+ (λi.if p 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉
+ then plus (f 〈fst i +fst (snd (snd i)),snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (b x-a x) 〈a x ,x〉.
+#a #b #c #p #f #x normalize elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈i+a x,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *)
+alias symbol "pair" (instance 15) = "abstract pair".
+alias symbol "minus" (instance 14) = "natural minus".
+alias symbol "minus" (instance 11) = "natural minus".
+alias symbol "pair" (instance 10) = "abstract pair".
+alias symbol "minus" (instance 13) = "natural minus".
+alias symbol "pair" (instance 12) = "abstract pair".
+alias symbol "minus" (instance 8) = "natural minus".
+alias symbol "pair" (instance 7) = "abstract pair".
+alias symbol "pair" (instance 6) = "abstract pair".
+alias symbol "minus" (instance 4) = "natural minus".
+alias symbol "pair" (instance 3) = "abstract pair".
+alias symbol "minus" (instance 2) = "natural minus".
+lemma bigop_prim_rec_dec: ∀a,b,c,p,f,x.
+ bigop (b x-a x) (λi:ℕ.p 〈b x -i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x-i,x〉) =
+ prim_rec c
+ (λi.if p 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉
+ then plus (f 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (b x-a x) 〈b x ,x〉.
+#a #b #c #p #f #x normalize elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+lemma bigop_prim_rec_dec1: ∀a,b,c,p,f,x.
+ bigop (S(b x)-a x) (λi:ℕ.p 〈b x - i,x〉) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈b x- i,x〉) =
+ prim_rec c
+ (λi.if p 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉
+ then plus (f 〈fst (snd (snd i)) - (fst i),snd (snd (snd i))〉) (fst (snd i))
+ else fst (snd i)) (S(b x)-a x) 〈b x,x〉.
+#a #b #c #p #f #x elim (S(b x)-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ cases (true_or_false (p 〈b x - i,x〉)) #Hcase >Hcase
+ [<Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed.
+
+(*
+lemma bigop_aux_1: ∀k,c,f.
+ bigop (S k) (λi:ℕ.true) ? c plus (λi:ℕ.f i) =
+ f 0 + bigop k (λi:ℕ.true) ? c plus (λi:ℕ.f (S i)).
+#k #c #f elim k [normalize //] #i #Hind >bigop_Strue //
+
+lemma bigop_prim_rec_dec: ∀a,b,c,f,x.
+ bigop (b x-a x) (λi:ℕ.true) ? (c 〈b x,x〉) plus (λi:ℕ.f 〈i+a x,x〉) =
+ prim_rec c
+ (λi. plus (f 〈fst (snd (snd i)) - fst i,snd (snd (snd i))〉) (fst (snd i)))
+ (b x-a x) 〈b x ,x〉.
+#a #b #c #f #x normalize elim (b x-a x)
+ [normalize //
+ |#i #Hind >prim_rec_S
+ >fst_pair >snd_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ <Hind >bigop_Strue // |<Hind >bigop_Sfalse // ]
+ ]
+qed. *)
+
+lemma bigop_plus_c: ∀k,p,f,c.
+ c k + bigop k (λi.p i) ? 0 plus (λi.f i) =
+ bigop k (λi.p i) ? (c k) plus (λi.f i).
+#k #p #f elim k [normalize //]
+#i #Hind #c cases (true_or_false (p i)) #Hcase
+[>bigop_Strue // >bigop_Strue // <associative_plus >(commutative_plus ? (f i))
+ >associative_plus @eq_f @Hind
+|>bigop_Sfalse // >bigop_Sfalse //
+]
+qed.
+
+(* the argument is 〈b-a,〈a,x〉〉 *)
+
+(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *)
+alias symbol "plus" (instance 3) = "natural plus".
+alias symbol "pair" (instance 2) = "abstract pair".
+alias id "max" = "cic:/matita/arithmetics/nat/max#def:2".
+alias symbol "plus" (instance 5) = "natural plus".
+alias symbol "pair" (instance 4) = "abstract pair".
+definition max_unary_pr ≝ λp,f.unary_pr (λx.0)
+ (λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let a ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ if p 〈k + a,x〉 then max (f 〈k+a,x〉) r else r).
+
+lemma max_unary_pr1: ∀a,b,p,f,x.
+ max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉) =
+ ((max_unary_pr p f) ∘ (λx.〈b x - a x,〈a x,x〉〉)) x.
+#a #b #p #f #x normalize >fst_pair >snd_pair @max_prim_rec1
+qed.
+
+(*
+lemma max_unary_pr: ∀a,b,p,f,x.
+ max_{i ∈[a,b[ | p 〈i,x〉 }(f 〈i,x〉) =
+ prim_rec (λi.0)
+ (λi.if p 〈fst i +a,x〉 then max (f 〈fst i +a ,snd (snd i)〉) (fst (snd i)) else fst (snd i)) (b-a) x.
+*)
+
+(*
+definition unary_compl ≝ λp,f,hf.
+ unary_pr MSC
+ (λx:ℕ
+ .fst (snd x)
+ +hf
+ 〈fst x,
+ 〈unary_pr (λx0:ℕ.O)
+ (λi:ℕ
+ .(let (k:ℕ) ≝fst i in
+ let (r:ℕ) ≝fst (snd i) in
+ let (a:ℕ) ≝fst (snd (snd i)) in
+ let (x:ℕ) ≝snd (snd (snd i)) in
+ if p 〈k+a,x〉 then max (f 〈k+a,x〉) r else r )) 〈fst x,snd (snd x)〉,
+ snd (snd x)〉〉). *)
+
+(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *)
+alias symbol "plus" (instance 6) = "natural plus".
+alias symbol "pair" (instance 5) = "abstract pair".
+alias symbol "plus" (instance 4) = "natural plus".
+alias symbol "pair" (instance 3) = "abstract pair".
+alias symbol "plus" (instance 2) = "natural plus".
+alias symbol "plus" (instance 1) = "natural plus".
+definition aux_compl ≝ λhp,hf.λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let a ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hp 〈k+a,x〉 + hf 〈k+a,x〉 + (* was MSC r*) MSC i .
+
+definition aux_compl1 ≝ λhp,hf.λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let a ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r.
+
+lemma aux_compl1_def: ∀k,r,m,hp,hf.
+ aux_compl1 hp hf 〈k,〈r,m〉〉 =
+ let a ≝ fst m in
+ let x ≝ snd m in
+ hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r.
+#k #r #m #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair //
+qed.
+
+lemma aux_compl1_def1: ∀k,r,a,x,hp,hf.
+ aux_compl1 hp hf 〈k,〈r,〈a,x〉〉〉 = hp 〈k+a,x〉 + hf 〈k+a,x〉 + MSC r.
+#k #r #a #x #hp #hf normalize >fst_pair >snd_pair >snd_pair >fst_pair
+>fst_pair >snd_pair //
+qed.
+
+
+axiom Oaux_compl: ∀hp,hf. O (aux_compl1 hp hf) (aux_compl hp hf).
+
+(*
+definition IF ≝ λb,f,g:nat →option nat. λx.
+ match b x with
+ [None ⇒ None ?
+ |Some n ⇒ if (eqb n 0) then f x else g x].
+*)
+
+axiom CF_if: ∀b:nat → bool. ∀f,g,s. CF s b → CF s f → CF s g →
+ CF s (λx. if b x then f x else g x).
+
+(*
+lemma IF_CF: ∀b,f,g,sb,sf,sg. CF sb b → CF sf f → CF sg g →
+ CF (λn. sb n + sf n + sg n) (IF b f g).
+#b #f #g #sb #sf #sg #Hb #Hf #Hg @IF_CF_new
+ [@(monotonic_CF … Hb) @O_plus_l @O_plus_l //
+ |@(monotonic_CF … Hf) @O_plus_l @O_plus_r //
+ |@(monotonic_CF … Hg) @O_plus_r //
+ ]
+qed.
+*)
+
+axiom CF_le: ∀h,f,g. CF h f → CF h g → CF h (λx. leb (f x) (g x)).
+axiom CF_max1: ∀h,f,g. CF h f → CF h g → CF h (λx. max (f x) (g x)).
+axiom CF_plus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x + g x).
+axiom CF_minus: ∀h,f,g. CF h f → CF h g → CF h (λx. f x - g x).
+
+axiom MSC_prop: ∀f,h. CF h f → ∀x. MSC (f x) ≤ h x.
+
+lemma MSC_max: ∀f,h,x. CF h f → MSC (max_{i < x}(f i)) ≤ max_{i < x}(h i).
+#f #h #x #hf elim x // #i #Hind >bigop_Strue [|//] >bigop_Strue [|//]
+whd in match (max ??);
+cases (true_or_false (leb (f i) (bigop i (λi0:ℕ.true) ? 0 max(λi0:ℕ.f i0))))
+#Hcase >Hcase
+ [@(transitive_le … Hind) @le_maxr //
+ |@(transitive_le … (MSC_prop … hf i)) @le_maxl //
+ ]
+qed.
+
+lemma CF_max: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s.
+ CF ha a → CF hb b → CF hp p → CF hf f →
+ O s (λx.ha x + hb x +
+ (∑_{i ∈[a x ,b x[ }
+ (hp 〈i,x〉 + hf 〈i,x〉 + max_{i ∈ [a x, b x [ }(hf 〈i,x〉)))) →
+ CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)).
+#a #b #p #f #ha #hb #hp #hf #s #CFa #CFb #CFp #CFf #HO
+@ext_CF1 [|#x @max_unary_pr1]
+@(CF_comp ??? (λx.ha x + hb x))
+ [|@CF_comp_pair
+ [@CF_minus [@(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //]
+ |@CF_comp_pair
+ [@(O_to_CF … CFa) @O_plus_l //
+ | @(O_to_CF … CF_id) @O_plus_r @(proj1 … CFb)
+ ]
+ ]
+ |@(CF_prim_rec … MSC … (aux_compl1 hp hf))
+ [@CF_const
+ |@(O_to_CF … (Oaux_compl … ))
+ @CF_if
+ [@(CF_comp p … MSC … CFp)
+ [@CF_comp_pair
+ [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd]
+ |@CF_comp_snd @CF_comp_snd @CF_snd]
+ |@le_to_O #x normalize >commutative_plus >associative_plus @le_plus //
+ ]
+ |@CF_max1
+ [@(CF_comp f … MSC … CFf)
+ [@CF_comp_pair
+ [@CF_plus [@CF_fst| @CF_comp_fst @CF_comp_snd @CF_snd]
+ |@CF_comp_snd @CF_comp_snd @CF_snd]
+ |@le_to_O #x normalize >commutative_plus //
+ ]
+ |@CF_comp_fst @(monotonic_CF … CF_snd) normalize //
+ ]
+ |@CF_comp_fst @(monotonic_CF … CF_snd) normalize //
+ ]
+ |@O_refl
+ ]
+ |@(O_trans … HO) -HO
+ @(O_trans ? (λx:ℕ
+ .ha x+hb x
+ +bigop (b x-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus
+ (λi:ℕ
+ .(λi0:ℕ
+ .hp 〈i0,x〉+hf 〈i0,x〉
+ +bigop (b x-a x) (λi1:ℕ.true) ? 0 max
+ (λi1:ℕ.(λi2:ℕ.hf 〈i2,x〉) (i1+a x))) (i+a x))))
+ [
+ @le_to_O #n @le_plus // whd in match (unary_pr ???);
+ >fst_pair >snd_pair >bigop_prim_rec elim (b n - a n)
+ [normalize //
+ |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >aux_compl1_def1
+ >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus
+ [-Hind @le_plus // normalize >fst_pair >snd_pair
+ @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 )
+ (λi1:ℕ.hf 〈i1+a n,n〉)))
+ [elim x [normalize @MSC_le]
+ #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair
+ >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize
+ [cases (true_or_false (leb (f 〈x0+a n,n〉)
+ (prim_rec (λx00:ℕ.O)
+ (λi:ℕ
+ .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉)
+ (fst (snd i))
+ then fst (snd i)
+ else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize
+ [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ |@(transitive_le … (MSC_prop … CFf …)) @(le_maxl … (le_n …))
+ ]
+ |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ ]
+ |@(le_maxr … (le_n …))
+ ]
+ |@(transitive_le … Hind) -Hind
+ generalize in match (bigop x (λi:ℕ.true) ? 0 max
+ (λi1:ℕ.(λi2:ℕ.hf 〈i2,n〉) (i1+a n))); #c
+ generalize in match (hf 〈x+a n,n〉); #c1
+ elim x [//] #x0 #Hind
+ >prim_rec_S >prim_rec_S normalize >fst_pair >fst_pair >snd_pair
+ >snd_pair >snd_pair >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair
+ >fst_pair @le_plus
+ [@le_plus // cases (true_or_false (leb c1 c)) #Hcase
+ >Hcase normalize // @lt_to_le @not_le_to_lt @(leb_false_to_not_le ?? Hcase)
+ |@Hind
+ ]
+ ]
+ ]
+ |@O_plus [@O_plus_l //] @le_to_O #x
+ <bigop_plus_c @le_plus // @(transitive_le … (MSC_pair …)) @le_plus
+ [@MSC_prop @CFa | @MSC_prop @(O_to_CF MSC … (CF_const x)) @(proj1 … CFb)]
+ ]
+qed.
+
+(* old
axiom CF_max: ∀a,b.∀p:nat →bool.∀f,ha,hb,hp,hf,s.
CF ha a → CF hb b → CF hp p → CF hf f →
O s (λx.ha x + hb x + ∑_{i ∈[a x ,b x[ }(hp 〈i,x〉 + hf 〈i,x〉)) →
- CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)).
-
+ CF s (λx.max_{i ∈[a x,b x[ | p 〈i,x〉 }(f 〈i,x〉)). *)
+
(******************************** minimization ********************************)
-axiom CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s.
+alias symbol "plus" (instance 2) = "natural plus".
+alias symbol "plus" (instance 5) = "natural plus".
+alias symbol "plus" (instance 1) = "natural plus".
+alias symbol "plus" (instance 4) = "natural plus".
+alias symbol "pair" (instance 3) = "abstract pair".
+alias id "O" = "cic:/matita/arithmetics/nat/nat#con:0:1:0".
+let rec my_minim a f x k on k ≝
+ match k with
+ [O ⇒ a
+ |S p ⇒ if eqb (my_minim a f x p) (a+p)
+ then if f 〈a+p,x〉 then a+p else S(a+p)
+ else (my_minim a f x p) ].
+
+lemma my_minim_S : ∀a,f,x,k.
+ my_minim a f x (S k) =
+ if eqb (my_minim a f x k) (a+k)
+ then if f 〈a+k,x〉 then a+k else S(a+k)
+ else (my_minim a f x k) .
+// qed.
+
+lemma my_minim_fa : ∀a,f,x,k. f〈a,x〉 = true → my_minim a f x k = a.
+#a #f #x #k #H elim k // #i #Hind normalize >Hind
+cases (true_or_false (eqb a (a+i))) #Hcase >Hcase normalize //
+<(eqb_true_to_eq … Hcase) >H //
+qed.
+
+lemma my_minim_nfa : ∀a,f,x,k. f〈a,x〉 = false →
+my_minim a f x (S k) = my_minim (S a) f x k.
+#a #f #x #k #H elim k
+ [normalize <plus_n_O >H >eq_to_eqb_true //
+ |#i #Hind >my_minim_S >Hind >my_minim_S <plus_n_Sm //
+ ]
+qed.
+
+lemma my_min_eq : ∀a,f,x,k.
+ min k a (λi.f 〈i,x〉) = my_minim a f x k.
+#a #f #x #k lapply a -a elim k // #i #Hind #a normalize in ⊢ (??%?);
+cases (true_or_false (f 〈a,x〉)) #Hcase >Hcase
+ [>(my_minim_fa … Hcase) // | >Hind @sym_eq @(my_minim_nfa … Hcase) ]
+qed.
+
+(* cambiare qui: togliere S *)
+
+(* FG: aliases added by matita compiled with OCaml 4.0.5, bah ??? *)
+alias symbol "minus" (instance 1) = "natural minus".
+alias symbol "minus" (instance 3) = "natural minus".
+alias symbol "pair" (instance 2) = "abstract pair".
+definition minim_unary_pr ≝ λf.unary_pr (λx.S(fst x))
+ (λi.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let b ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ if f 〈b-k,x〉 then b-k else r).
+
+definition compl_minim_unary ≝ λhf:nat → nat.λi.
+ let k ≝ fst i in
+ let b ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉.
+
+definition compl_minim_unary_aux ≝ λhf,i.
+ let k ≝ fst i in
+ let r ≝ fst (snd i) in
+ let b ≝ fst (snd (snd i)) in
+ let x ≝ snd (snd (snd i)) in
+ hf 〈b-k,x〉 + MSC i.
+
+lemma compl_minim_unary_aux_def : ∀hf,k,r,b,x.
+ compl_minim_unary_aux hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈r,〈b,x〉〉〉.
+#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair //
+qed.
+
+lemma compl_minim_unary_def : ∀hf,k,r,b,x.
+ compl_minim_unary hf 〈k,〈r,〈b,x〉〉〉 = hf 〈b-k,x〉 + MSC 〈k,〈S b,x〉〉.
+#hf #k #r #b #x normalize >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair //
+qed.
+
+lemma compl_minim_unary_aux_def2 : ∀hf,k,r,x.
+ compl_minim_unary_aux hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈r,x〉〉.
+#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair //
+qed.
+
+lemma compl_minim_unary_def2 : ∀hf,k,r,x.
+ compl_minim_unary hf 〈k,〈r,x〉〉 = hf 〈fst x-k,snd x〉 + MSC 〈k,〈S(fst x),snd x〉〉.
+#hf #k #r #x normalize >snd_pair >snd_pair >fst_pair //
+qed.
+
+lemma min_aux: ∀a,f,x,k. min (S k) (a x) (λi:ℕ.f 〈i,x〉) =
+ ((minim_unary_pr f) ∘ (λx.〈S k,〈a x + k,x〉〉)) x.
+#a #f #x #k whd in ⊢ (???%); >fst_pair >snd_pair
+lapply a -a (* @max_prim_rec1 *)
+elim k
+ [normalize #a >fst_pair >snd_pair >fst_pair >snd_pair >snd_pair >fst_pair
+ <plus_n_O <minus_n_O >fst_pair //
+ |#i #Hind #a normalize in ⊢ (??%?); >prim_rec_S >fst_pair >snd_pair
+ >fst_pair >snd_pair >snd_pair >fst_pair <plus_n_Sm <(Hind (λx.S (a x)))
+ whd in ⊢ (???%); >minus_S_S <(minus_plus_m_m (a x) i) //
+qed.
+
+lemma minim_unary_pr1: ∀a,b,f,x.
+ μ_{i ∈[a x,b x]}(f 〈i,x〉) =
+ if leb (a x) (b x) then ((minim_unary_pr f) ∘ (λx.〈S (b x) - a x,〈b x,x〉〉)) x
+ else (a x).
+#a #b #f #x cases (true_or_false (leb (a x) (b x))) #Hcase >Hcase
+ [cut (b x = a x + (b x - a x))
+ [>commutative_plus <plus_minus_m_m // @leb_true_to_le // ]
+ #Hcut whd in ⊢ (???%); >minus_Sn_m [|@leb_true_to_le //]
+ >min_aux whd in ⊢ (??%?); <Hcut //
+ |>eq_minus_O // @not_le_to_lt @leb_false_to_not_le //
+ ]
+qed.
+
+axiom sum_inv: ∀a,b,f.∑_{i ∈ [a,S b[ }(f i) = ∑_{i ∈ [a,S b[ }(f (a + b - i)).
+
+(*
+#a #b #f @(bigop_iso … plusAC) whd %{(λi.b - a - i)} %{(λi.b - a -i)} %
+ [%[#i #lti #_ normalize @eq_f >commutative_plus <plus_minus_associative
+ [2: @le_minus_to_plus_r //
+ [// @eq_f @@sym_eq @plus_to_minus
+ |#i #Hi #_ % [% [@le_S_S
+*)
+
+example sum_inv_check : ∑_{i ∈ [3,6[ }(i*i) = ∑_{i ∈ [3,6[ }((8-i)*(8-i)).
+normalize // qed.
+
+(* provo rovesciando la somma *)
+
+axiom daemon: ∀P:Prop.P.
+
+lemma CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s.
+ CF sa a → CF sb b → CF sf f →
+ O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉 + MSC 〈b x - i,〈S(b x),x〉〉)) →
+ CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)).
+#a #b #f #ha #hb #hf #s #CFa #CFb #CFf #HO
+@ext_CF1 [|#x @minim_unary_pr1]
+@CF_if
+ [@CF_le @(O_to_CF … HO)
+ [@(O_to_CF … CFa) @O_plus_l @O_plus_l @O_refl
+ |@(O_to_CF … CFb) @O_plus_l @O_plus_r @O_refl
+ ]
+ |@(CF_comp ??? (λx.ha x + hb x))
+ [|@CF_comp_pair
+ [@CF_minus [@CF_compS @(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //]
+ |@CF_comp_pair
+ [@(O_to_CF … CFb) @O_plus_r //
+ |@(O_to_CF … CF_id) @O_plus_r @(proj1 … CFb)
+ ]
+ ]
+ |@(CF_prim_rec_gen … MSC … (compl_minim_unary_aux hf))
+ [@((λx:ℕ.fst (snd x)
+ +compl_minim_unary hf
+ 〈fst x,
+ 〈unary_pr fst
+ (λi:ℕ
+ .(let (k:ℕ) ≝fst i in
+ let (r:ℕ) ≝fst (snd i) in
+ let (b:ℕ) ≝fst (snd (snd i)) in
+ let (x:ℕ) ≝snd (snd (snd i)) in if f 〈b-S k,x〉 then b-S k else r ))
+ 〈fst x,snd (snd x)〉,
+ snd (snd x)〉〉))
+ |@CF_compS @CF_fst
+ |@CF_if
+ [@(CF_comp f … MSC … CFf)
+ [@CF_comp_pair
+ [@CF_minus [@CF_comp_fst @CF_comp_snd @CF_snd|@CF_fst]
+ |@CF_comp_snd @CF_comp_snd @CF_snd]
+ |@le_to_O #x normalize >commutative_plus //
+ ]
+ |@(O_to_CF … MSC)
+ [@le_to_O #x normalize //
+ |@CF_minus
+ [@CF_comp_fst @CF_comp_snd @CF_snd |@CF_fst]
+ ]
+ |@CF_comp_fst @(monotonic_CF … CF_snd) normalize //
+ ]
+ |@O_plus
+ [@O_plus_l @O_refl
+ |@O_plus_r @O_ext2 [||#x >compl_minim_unary_aux_def2 @refl]
+ @O_trans [||@le_to_O #x >compl_minim_unary_def2 @le_n]
+ @O_plus [@O_plus_l //]
+ @O_plus_r
+ @O_trans [|@le_to_O #x @MSC_pair] @O_plus
+ [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_fst …))
+ >fst_pair @le_n]
+ @O_trans [|@le_to_O #x @MSC_pair] @O_plus
+ [@le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …))
+ >snd_pair @(transitive_le ???? (le_fst …)) >fst_pair
+ normalize >snd_pair >fst_pair lapply (surj_pair x)
+ * #x1 * #x2 #Hx >Hx >fst_pair >snd_pair elim x1 //
+ #i #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >fst_pair
+ cases (f ?) [@le_S // | //]]
+ @le_to_O #x @monotonic_MSC @(transitive_le ???? (le_snd …)) >snd_pair
+ >(expand_pair (snd (snd x))) in ⊢ (?%?); @le_pair //
+ ]
+ ]
+ |cut (O s (λx.ha x + hb x +
+ ∑_{i ∈[a x ,S(b x)[ }(hf 〈a x+b x-i,x〉 + MSC 〈b x -(a x+b x-i),〈S(b x),x〉〉)))
+ [@(O_ext2 … HO) #x @eq_f @sum_inv] -HO #HO
+ @(O_trans … HO) -HO
+ @(O_trans ? (λx:ℕ.ha x+hb x
+ +bigop (S(b x)-a x) (λi:ℕ.true) ?
+ (MSC 〈b x,x〉) plus (λi:ℕ.(λj.hf j + MSC 〈b x - fst j,〈S(b (snd j)),snd j〉〉) 〈b x- i,x〉)))
+ [@le_to_O #n @le_plus // whd in match (unary_pr ???);
+ >fst_pair >snd_pair >(bigop_prim_rec_dec1 a b ? (λi.true))
+ (* it is crucial to recall that the index is bound by S(b x) *)
+ cut (S (b n) - a n ≤ S (b n)) [//]
+ elim (S(b n) - a n)
+ [normalize //
+ |#x #Hind #lex >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair
+ >compl_minim_unary_def >prim_rec_S >fst_pair >snd_pair >fst_pair
+ >snd_pair >fst_pair >snd_pair >fst_pair whd in ⊢ (??%); >commutative_plus
+ @le_plus [2:@Hind @le_S @le_S_S_to_le @lex] -Hind >snd_pair
+ >minus_minus_associative // @le_S_S_to_le //
+ ]
+ |@O_plus [@O_plus_l //] @O_ext2 [||#x @bigop_plus_c]
+ @O_plus
+ [@O_plus_l @O_trans [|@le_to_O #x @MSC_pair]
+ @O_plus [@O_plus_r @le_to_O @(MSC_prop … CFb)|@O_plus_r @(proj1 … CFb)]
+ |@O_plus_r @(O_ext2 … (O_refl …)) #x @same_bigop
+ [//|#i #H #_ @eq_f2 [@eq_f @eq_f2 //|>fst_pair @eq_f @eq_f2 //]
+ ]
+ ]
+ ]
+ ]
+ |@(O_to_CF … CFa) @(O_trans … HO) @O_plus_l @O_plus_l @O_refl
+ ]
+qed.
+
+(*
+lemma CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s.
CF sa a → CF sb b → CF sf f →
O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉)) →
CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)).
+#a #b #f #ha #hb #hf #s #CFa #CFb #CFf #HO
+@ext_CF1 [|#x @minim_unary_pr1]
+@(CF_comp ??? (λx.ha x + hb x))
+ [|@CF_comp_pair
+ [@CF_minus [@CF_compS @(O_to_CF … CFb) @O_plus_r // |@(O_to_CF … CFa) @O_plus_l //]
+ |@CF_comp_pair
+ [@CF_max1 [@(O_to_CF … CFa) @O_plus_l // | @CF_compS @(O_to_CF … CFb) @O_plus_r //]
+ | @(O_to_CF … CF_id) @O_plus_r @(proj1 … CFb)
+ ]
+ ]
+ |@(CF_prim_rec … MSC … (compl_minim_unary_aux hf))
+ [@CF_fst
+ |@CF_if
+ [@(CF_comp f … MSC … CFf)
+ [@CF_comp_pair
+ [@CF_minus [@CF_comp_fst @CF_comp_snd @CF_snd|@CF_compS @CF_fst]
+ |@CF_comp_snd @CF_comp_snd @CF_snd]
+ |@le_to_O #x normalize >commutative_plus //
+ ]
+ |@(O_to_CF … MSC)
+ [@le_to_O #x normalize //
+ |@CF_minus
+ [@CF_comp_fst @CF_comp_snd @CF_snd |@CF_compS @CF_fst]
+ ]
+ |@CF_comp_fst @(monotonic_CF … CF_snd) normalize //
+ ]
+ |@O_refl
+ ]
+ |@(O_trans … HO) -HO
+ @(O_trans ? (λx:ℕ
+ .ha x+hb x
+ +bigop (S(b x)-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus (λi:ℕ.hf 〈i+a x,x〉)))
+ [@le_to_O #n @le_plus // whd in match (unary_pr ???);
+ >fst_pair >snd_pair >(bigop_prim_rec ? (λn.S(b n)) ? (λi.true)) elim (S(b n) - a n)
+ [normalize @monotonic_MSC @le_pair
+ |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >compl_minim_unary_def
+ >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus
+ [-Hind @le_plus // normalize >fst_pair >snd_pair
+ @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 )
+ (λi1:ℕ.hf 〈i1+a n,n〉)))
+ [elim x [normalize @MSC_le]
+ #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair
+ >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize
+ [cases (true_or_false (leb (f 〈x0+a n,n〉)
+ (prim_rec (λx00:ℕ.O)
+ (λi:ℕ
+ .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉)
+ (fst (snd i))
+ then fst (snd i)
+ else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize
+ [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ |@(transitive_le … (MSC_prop … CFf …)) @(le_maxl … (le_n …))
+ ]
+ |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ ]
+ |@(le_maxr … (le_n …))
+ ]
+
+
+ @(O_trans ? (λx:ℕ
+ .ha x+hb x
+ +bigop (b x-a x) (λi:ℕ.true) ? (MSC 〈a x,x〉) plus
+ (λi:ℕ
+ .(λi0:ℕ
+ .hp 〈i0,x〉+hf 〈i0,x〉
+ +bigop (b x-a x) (λi1:ℕ.true) ? 0 max
+ (λi1:ℕ.(λi2:ℕ.hf 〈i2,x〉) (i1+a x))) (i+a x))))
+ [
+ @le_to_O #n @le_plus // whd in match (unary_pr ???);
+ >fst_pair >snd_pair >bigop_prim_rec elim (b n - a n)
+ [normalize //
+ |#x #Hind >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >aux_compl1_def1
+ >prim_rec_S >fst_pair >snd_pair >fst_pair >snd_pair >fst_pair
+ >snd_pair normalize in ⊢ (??%); >commutative_plus @le_plus
+ [-Hind @le_plus // normalize >fst_pair >snd_pair
+ @(transitive_le ? (bigop x (λi1:ℕ.true) ? 0 (λn0:ℕ.λm:ℕ.if leb n0 m then m else n0 )
+ (λi1:ℕ.hf 〈i1+a n,n〉)))
+ [elim x [normalize @MSC_le]
+ #x0 #Hind >prim_rec_S >fst_pair >snd_pair >snd_pair >snd_pair
+ >fst_pair >fst_pair cases (p 〈x0+a n,n〉) normalize
+ [cases (true_or_false (leb (f 〈x0+a n,n〉)
+ (prim_rec (λx00:ℕ.O)
+ (λi:ℕ
+ .if p 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ then if leb (f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉)
+ (fst (snd i))
+ then fst (snd i)
+ else f 〈fst i+fst (snd (snd i)),snd (snd (snd i))〉
+ else fst (snd i) ) x0 〈a n,n〉))) #Hcase >Hcase normalize
+ [@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ |@(transitive_le … (MSC_prop … CFf …)) @(le_maxl … (le_n …))
+ ]
+ |@(transitive_le … Hind) -Hind @(le_maxr … (le_n …))
+ ]
+ |@(le_maxr … (le_n …))
+ ]
+ |@(transitive_le … Hind) -Hind
+ generalize in match (bigop x (λi:ℕ.true) ? 0 max
+ (λi1:ℕ.(λi2:ℕ.hf 〈i2,n〉) (i1+a n))); #c
+ generalize in match (hf 〈x+a n,n〉); #c1
+ elim x [//] #x0 #Hind
+ >prim_rec_S >prim_rec_S normalize >fst_pair >fst_pair >snd_pair
+ >snd_pair >snd_pair >snd_pair >snd_pair >snd_pair >fst_pair >fst_pair
+ >fst_pair @le_plus
+ [@le_plus // cases (true_or_false (leb c1 c)) #Hcase
+ >Hcase normalize // @lt_to_le @not_le_to_lt @(leb_false_to_not_le ?? Hcase)
+ |@Hind
+ ]
+ ]
+ ]
+ |@O_plus [@O_plus_l //] @le_to_O #x
+ <bigop_plus_c @le_plus // @(transitive_le … (MSC_pair …)) @le_plus
+ [@MSC_prop @CFa | @MSC_prop @(O_to_CF MSC … (CF_const x)) @(proj1 … CFb)]
+ ]
+qed.
+
+axiom CF_mu: ∀a,b.∀f:nat →bool.∀sa,sb,sf,s.
+ CF sa a → CF sb b → CF sf f →
+ O s (λx.sa x + sb x + ∑_{i ∈[a x ,S(b x)[ }(sf 〈i,x〉)) →
+ CF s (λx.μ_{i ∈[a x,b x] }(f 〈i,x〉)).*)
(************************************* smn ************************************)
axiom smn: ∀f,s. CF s f → ∀x. CF (λy.s 〈x,y〉) (λy.f 〈x,y〉).
(******************** complexity of g ********************)
-definition unary_g ≝ λh.λux. g h (fst ux) (snd ux).
+(*definition unary_g ≝ λh.λux. g h (fst ux) (snd ux).
definition auxg ≝
λh,ux. max_{i ∈[fst ux,snd ux[ | eqb (min_input h i (snd ux)) (snd ux)}
(out i (snd ux) (h (S i) (snd ux))).
[@CF_compS @CF_fst
|@CF_comp_snd @CF_snd
|@(O_trans … HO) @O_plus [@O_plus @O_plus_l // | @O_plus_r //]
-qed.
+qed.*)
(************************* a couple of technical lemmas ***********************)
lemma minus_to_0: ∀a,b. a ≤ b → minus a b = 0.
(**************************** end of technical lemmas *************************)
-lemma compl_g5 : ∀h,s1.(∀n. monotonic ℕ le (λa:ℕ.s1 〈a,n〉)) →
+(*lemma compl_g5 : ∀h,s1.(∀n. monotonic ℕ le (λa:ℕ.s1 〈a,n〉)) →
(CF s1
(λp.termb (fst (snd p)) (fst p) (h (S (fst (snd p))) (fst p)))) →
CF (λx.MSC x + (snd (snd x)-fst x)*s1 〈snd (snd x),x〉)
]
|@le_to_O #x @monotonic_sU // @(le_maxl … (le_n …)) ]
]
-qed.
+qed. *)
definition big : nat →nat ≝ λx.
let m ≝ max (fst x) (snd x) in 〈m,m〉.
(λx.MSC x + (snd (snd x)-fst x)*
(λx.sU 〈max (fst(snd x)) (snd(snd x)),〈fst x,h (S (fst (snd x))) (fst x)〉〉) 〈snd (snd x),x〉).
-lemma compl_g7: ∀h.
+(*lemma compl_g7: ∀h.
constructible (λx. h (fst x) (snd x)) →
(∀n. monotonic ? le (h n)) →
CF (λx.MSC x + (snd (snd x)-fst x)*sU 〈max (fst x) (snd x),〈snd (snd x),h (S (fst x)) (snd (snd x))〉〉)
[#Hle @le_times // @monotonic_sU
|#Hlt >(minus_to_0 … (lt_to_le … )) [// | @not_le_to_lt @Hlt]
]
-qed.
+qed.*)
definition out_aux ≝ λh.
out_unary ∘ λp.〈fst p,〈snd(snd p),h (S (fst p)) (snd (snd p))〉〉.
]
qed.
-lemma compl_g9 : ∀h.
+(*lemma compl_g9 : ∀h.
constructible (λx. h (fst x) (snd x)) →
(∀n. monotonic ? le (h n)) →
(∀n,a,b. a ≤ b → b ≤ n → h b n ≤ h a n) →
>associative_plus >distributive_times_plus
@le_plus [@le_times [@le_S // |>big_def >Hmax //] |//]
]
-qed.
+qed.*)
definition sg ≝ λh,x.
(S (snd x-fst x))*MSC 〈x,x〉 + (snd x-fst x)*(S(snd x-fst x))*sU 〈x,〈snd x,h (S (fst x)) (snd x)〉〉.
#h #a #b whd in ⊢ (??%?); >fst_pair >snd_pair //
qed.
-lemma compl_g11 : ∀h.
+(*lemma compl_g11 : ∀h.
constructible (λx. h (fst x) (snd x)) →
(∀n. monotonic ? le (h n)) →
(∀n,a,b. a ≤ b → b ≤ n → h b n ≤ h a n) →
CF (sg h) (unary_g h).
#h #hconstr #Hm #Ham @compl_g1 @(compl_g9 h hconstr Hm Ham)
-qed.
+qed.*)
(**************************** closing the argument ****************************)
]
qed.
+(*
lemma h_of_aux_constr :
∀r,c. constructible (λx.h_of_aux r c (fst x) (snd x)).
#r #c
(S d)*(MSC 〈〈b-d,b〉,〈b-d,b〉〉) +
d*(S d)*sU 〈〈b-d,b〉,〈b,r (fst (snd x))〉〉)))
[#n @sym_eq whd in match (unary_pr ???); @h_of_aux_prim_rec
- |@constr_prim_rec
+ |@constr_prim_rec*)
definition h_of ≝ λr,p.
let m ≝ max (fst p) (snd p) in
(∀x. x ≤ r x) → monotonic ? le r → constructible r →
constructible (h_of r).
-lemma speed_compl: ∀r:nat →nat.
+(*lemma speed_compl: ∀r:nat →nat.
(∀x. x ≤ r x) → monotonic ? le r → constructible r →
CF (h_of r) (unary_g (λi,x. r(h_of r 〈i,x〉))).
#r #Hr #Hmono #Hconstr @(monotonic_CF … (compl_g11 …))
@(ext_CF (λx.unary_g (λi,x. r(h_of r 〈i,x〉)) 〈i,x〉))
[#n whd in ⊢ (??%%); @eq_f @sym_eq >fst_pair >snd_pair %]
@smn @(ext_CF … (speed_compl r Hr Hmono Hconstr)) #n //
-qed.
+qed.*)
(**************************** the speedup theorem *****************************)
-theorem pseudo_speedup:
+(*theorem pseudo_speedup:
∀r:nat →nat. (∀x. x ≤ r x) → monotonic ? le r → constructible r →
∃f.∀sf. CF sf f → ∃g,sg. f ≈ g ∧ CF sg g ∧ O sf (r ∘ sg).
(* ∃m,a.∀n. a≤n → r(sg a) < m * sf n. *)
#y #Uy %{y} @(monotonic_U … Uy) @(transitive_le … Hlesf)
@Hmono @(mono_h_of2 … Hr Hmono … ltin)
]
-qed.
+qed.*)
\ No newline at end of file
+++ /dev/null
-include "turing/auxiliary_machines1.ma".
-include "turing/multi_to_mono/shift_trace_machines.ma".
-
-(******************************************************************************)
-(* mtiL: complete move L for tape i. We reaching the left border of trace i, *)
-(* add a blank if there is no more tape, then move the i-trace and finally *)
-(* come back to the head position. *)
-(******************************************************************************)
-
-(* we say that a tape is regular if for any trace after the first blank we
- only have other blanks *)
-
-definition all_blanks_in ≝ λsig,l.
- ∀x. mem ? x l → x = blank sig.
-
-definition regular_i ≝ λsig,n.λl:list (multi_sig sig n).λi.
- all_blanks_in ? (after_blank ? (trace sig n i l)).
-
-definition regular_trace ≝ λsig,n,a.λls,rs:list (multi_sig sig n).λi.
- Or (And (regular_i sig n (a::ls) i) (regular_i sig n rs i))
- (And (regular_i sig n ls i) (regular_i sig n (a::rs) i)).
-
-axiom regular_tail: ∀sig,n,l,i.
- regular_i sig n l i → regular_i sig n (tail ? l) i.
-
-axiom regular_extend: ∀sig,n,l,i.
- regular_i sig n l i → regular_i sig n (l@[all_blank sig n]) i.
-
-axiom all_blank_after_blank: ∀sig,n,l1,b,l2,i.
- nth i ? (vec … b) (blank ?) = blank ? →
- regular_i sig n (l1@b::l2) i → all_blanks_in ? (trace sig n i l2).
-
-lemma regular_trace_extl: ∀sig,n,a,ls,rs,i.
- regular_trace sig n a ls rs i →
- regular_trace sig n a (ls@[all_blank sig n]) rs i.
-#sig #n #a #ls #rs #i *
- [* #H1 #H2 % % // @(regular_extend … H1)
- |* #H1 #H2 %2 % // @(regular_extend … H1)
- ]
-qed.
-
-lemma regular_cons_hd_rs: ∀sig,n.∀a:multi_sig sig n.∀ls,rs1,rs2,i.
- regular_trace sig n a ls (rs1@rs2) i →
- regular_trace sig n a ls (rs1@((hd ? rs2 (all_blank …))::(tail ? rs2))) i.
-#sig #n #a #ls #rs1 #rs2 #i cases rs2 [2: #b #tl #H @H]
-*[* #H1 >append_nil #H2 %1 %
- [@H1 | whd in match (hd ???); @(regular_extend … rs1) //]
- |* #H1 >append_nil #H2 %2 %
- [@H1 | whd in match (hd ???); @(regular_extend … (a::rs1)) //]
- ]
-qed.
-
-lemma eq_trace_to_regular : ∀sig,n.∀a1,a2:multi_sig sig n.∀ls1,ls2,rs1,rs2,i.
- nth i ? (vec … a1) (blank ?) = nth i ? (vec … a2) (blank ?) →
- trace sig n i ls1 = trace sig n i ls2 →
- trace sig n i rs1 = trace sig n i rs2 →
- regular_trace sig n a1 ls1 rs1 i →
- regular_trace sig n a2 ls2 rs2 i.
-#sig #n #a1 #a2 #ls1 #ls2 #rs1 #rs2 #i #H1 #H2 #H3 #H4
-whd in match (regular_trace ??????); whd in match (regular_i ????);
-whd in match (regular_i ?? rs2 ?); whd in match (regular_i ?? ls2 ?);
-whd in match (regular_i ?? (a2::rs2) ?); whd in match (trace ????);
-<trace_def whd in match (trace ??? (a2::rs2)); <trace_def
-<H1 <H2 <H3 @H4
-qed.
-
-(******************************* move_to_blank_L ******************************)
-(* we compose machines together to reduce the number of output cases, and
- improve semantics *)
-
-definition move_to_blank_L ≝ λsig,n,i.
- (move_until ? L (no_blank sig n i)) · extend ? (all_blank sig n).
-
-(*
-definition R_move_to_blank_L ≝ λsig,n,i,t1,t2.
-(current ? t1 = None ? →
- t2 = midtape (multi_sig sig n) (left ? t1) (all_blank …) (right ? t1)) ∧
-∀ls,a,rs.t1 = midtape ? ls a rs →
- ((no_blank sig n i a = false) ∧ t2 = t1) ∨
- (∃b,ls1,ls2.
- (no_blank sig n i b = false) ∧
- (∀j.j ≤n → to_blank_i ?? j (ls1@b::ls2) = to_blank_i ?? j ls) ∧
- t2 = midtape ? ls2 b ((reverse ? (a::ls1))@rs)).
-*)
-
-definition R_move_to_blank_L ≝ λsig,n,i,t1,t2.
-(current ? t1 = None ? →
- t2 = midtape (multi_sig sig n) (left ? t1) (all_blank …) (right ? t1)) ∧
-∀ls,a,rs.
- t1 = midtape (multi_sig sig n) ls a rs →
- regular_i sig n (a::ls) i →
- (∀j. j ≠ i → regular_trace … a ls rs j) →
- (∃b,ls1,ls2.
- (regular_i sig n (ls1@b::ls2) i) ∧
- (∀j. j ≠ i → regular_trace …
- (hd ? (ls1@b::ls2) (all_blank …)) (tail ? (ls1@b::ls2)) rs j) ∧
- (no_blank sig n i b = false) ∧
- (hd (multi_sig sig n) (ls1@[b]) (all_blank …) = a) ∧ (* not implied by the next fact *)
- (∀j.j ≤n → to_blank_i ?? j (ls1@b::ls2) = to_blank_i ?? j (a::ls)) ∧
- t2 = midtape ? ls2 b ((reverse ? ls1)@rs)).
-
-theorem sem_move_to_blank_L: ∀sig,n,i.
- move_to_blank_L sig n i ⊨ R_move_to_blank_L sig n i.
-#sig #n #i
-@(sem_seq_app ??????
- (ssem_move_until_L ? (no_blank sig n i)) (sem_extend ? (all_blank sig n)))
-#tin #tout * #t1 * * #Ht1a #Ht1b * #Ht2a #Ht2b %
- [#Hcur >(Ht1a Hcur) in Ht2a; /2 by /
- |#ls #a #rs #Htin #Hreg #Hreg2 -Ht1a cases (Ht1b … Htin)
- [* #Hnb #Ht1 -Ht1b -Ht2a >Ht1 in Ht2b; >Htin #H
- %{a} %{[ ]} %{ls}
- %[%[%[%[%[@Hreg|@Hreg2]|@Hnb]|//]|//]|@H normalize % #H1 destruct (H1)]
- |*
- [(* we find the blank *)
- * #ls1 * #b * #ls2 * * * #H1 #H2 #H3 #Ht1
- >Ht1 in Ht2b; #Hout -Ht1b
- %{b} %{(a::ls1)} %{ls2}
- %[%[%[%[%[>H1 in Hreg; #H @H
- |#j #jneqi whd in match (hd ???); whd in match (tail ??);
- <H1 @(Hreg2 j jneqi)]|@H2] |//]|>H1 //]
- |@Hout normalize % normalize #H destruct (H)
- ]
- |* #b * #lss * * #H1 #H2 #Ht1 -Ht1b >Ht1 in Ht2a;
- whd in match (left ??); whd in match (right ??); #Hout
- %{(all_blank …)} %{(lss@[b])} %{[]}
- %[%[%[%[%[<H2 @regular_extend //
- |<H2 #j #jneqi whd in match (hd ???); whd in match (tail ??);
- @regular_trace_extl @Hreg2 //]
- |whd in match (no_blank ????); >blank_all_blank //]
- |<H2 //]
- |#j #lejn <H2 @sym_eq @to_blank_i_ext]
- |>reverse_append >reverse_single @Hout normalize //
- ]
- ]
- ]
-qed.
-
-(******************************************************************************)
-
-definition shift_i_L ≝ λsig,n,i.
- ncombf_r (multi_sig …) (shift_i sig n i) (all_blank sig n) ·
- mti sig n i ·
- extend ? (all_blank sig n).
-
-definition R_shift_i_L ≝ λsig,n,i,t1,t2.
- (∀a,ls,rs.
- t1 = midtape ? ls a rs →
- ((∃rs1,b,rs2,a1,rss.
- rs = rs1@b::rs2 ∧
- nth i ? (vec … b) (blank ?) = (blank ?) ∧
- (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧
- shift_l sig n i (a::rs1) (a1::rss) ∧
- t2 = midtape (multi_sig sig n) ((reverse ? (a1::rss))@ls) b rs2) ∨
- (∃b,rss.
- (∀x. mem ? x rs → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧
- shift_l sig n i (a::rs) (rss@[b]) ∧
- t2 = midtape (multi_sig sig n)
- ((reverse ? (rss@[b]))@ls) (all_blank sig n) [ ]))).
-
-definition R_shift_i_L_new ≝ λsig,n,i,t1,t2.
- (∀a,ls,rs.
- t1 = midtape ? ls a rs →
- ∃rs1,b,rs2,rss.
- b = hd ? rs2 (all_blank sig n) ∧
- nth i ? (vec … b) (blank ?) = (blank ?) ∧
- rs = rs1@rs2 ∧
- (∀x. mem ? x rs1 → nth i ? (vec … x) (blank ?) ≠ (blank ?)) ∧
- shift_l sig n i (a::rs1) rss ∧
- t2 = midtape (multi_sig sig n) ((reverse ? rss)@ls) b (tail ? rs2)).
-
-theorem sem_shift_i_L: ∀sig,n,i. shift_i_L sig n i ⊨ R_shift_i_L sig n i.
-#sig #n #i
-@(sem_seq_app ??????
- (sem_ncombf_r (multi_sig sig n) (shift_i sig n i)(all_blank sig n))
- (sem_seq ????? (ssem_mti sig n i)
- (sem_extend ? (all_blank sig n))))
-#tin #tout * #t1 * * #Ht1a #Ht1b * #t2 * * #Ht2a #Ht2b * #Htout1 #Htout2
-#a #ls #rs cases rs
- [#Htin %2 %{(shift_i sig n i a (all_blank sig n))} %{[ ]}
- %[%[#x @False_ind | @daemon]
- |lapply (Ht1a … Htin) -Ht1a -Ht1b #Ht1
- lapply (Ht2a … Ht1) -Ht2a -Ht2b #Ht2 >Ht2 in Htout1;
- >Ht1 whd in match (left ??); whd in match (right ??); #Htout @Htout //
- ]
- |#a1 #rs1 #Htin
- lapply (Ht1b … Htin) -Ht1a -Ht1b #Ht1
- lapply (Ht2b … Ht1) -Ht2a -Ht2b *
- [(* a1 is blank *) * #H1 #H2 %1
- %{[ ]} %{a1} %{rs1} %{(shift_i sig n i a a1)} %{[ ]}
- %[%[%[%[// |//] |#x @False_ind] | @daemon]
- |>Htout2 [>H2 >reverse_single @Ht1 |>H2 >Ht1 normalize % #H destruct (H)]
- ]
- |*
- [* #rs10 * #b * #rs2 * #rss * * * * #H1 #H2 #H3 #H4
- #Ht2 %1
- %{(a1::rs10)} %{b} %{rs2} %{(shift_i sig n i a a1)} %{rss}
- %[%[%[%[>H1 //|//] |@H3] |@daemon ]
- |>reverse_cons >associative_append
- >H2 in Htout2; #Htout >Htout [@Ht2| >Ht2 normalize % #H destruct (H)]
- ]
- |* #b * #rss * * #H1 #H2
- #Ht2 %2
- %{(shift_i sig n i b (all_blank sig n))} %{(shift_i sig n i a a1::rss)}
- %[%[@H1 |@daemon ]
- |>Ht2 in Htout1; #Htout >Htout //
- whd in match (left ??); whd in match (right ??);
- >reverse_append >reverse_single >associative_append >reverse_cons
- >associative_append //
- ]
- ]
- ]
- ]
-qed.
-
-theorem sem_shift_i_L_new: ∀sig,n,i.
- shift_i_L sig n i ⊨ R_shift_i_L_new sig n i.
-#sig #n #i
-@(Realize_to_Realize … (sem_shift_i_L sig n i))
-#t1 #t2 #H #a #ls #rs #Ht1 lapply (H a ls rs Ht1) *
- [* #rs1 * #b * #rs2 * #a1 * #rss * * * * #H1 #H2 #H3 #H4 #Ht2
- %{rs1} %{b} %{(b::rs2)} %{(a1::rss)}
- %[%[%[%[%[//|@H2]|@H1]|@H3]|@H4] | whd in match (tail ??); @Ht2]
- |* #b * #rss * * #H1 #H2 #Ht2
- %{rs} %{(all_blank sig n)} %{[]} %{(rss@[b])}
- %[%[%[%[%[//|@blank_all_blank]|//]|@H1]|@H2] | whd in match (tail ??); @Ht2]
- ]
-qed.
-
-
-(*******************************************************************************
-The following machine implements a full move of for a trace: we reach the left
-border, shift the i-th trace and come back to the head position. *)
-
-(* this exclude the possibility that traces do not overlap: the head must
-remain inside all traces *)
-
-definition mtiL ≝ λsig,n,i.
- move_to_blank_L sig n i ·
- shift_i_L sig n i ·
- move_until ? L (no_head sig n).
-
-definition Rmtil ≝ λsig,n,i,t1,t2.
- ∀ls,a,rs.
- t1 = midtape (multi_sig sig n) ls a rs →
- nth n ? (vec … a) (blank ?) = head ? →
- (∀i.regular_trace sig n a ls rs i) →
- (* next: we cannot be on rightof on trace i *)
- (nth i ? (vec … a) (blank ?) = (blank ?)
- → nth i ? (vec … (hd ? rs (all_blank …))) (blank ?) ≠ (blank ?)) →
- no_head_in … ls →
- no_head_in … rs →
- (∃ls1,a1,rs1.
- t2 = midtape (multi_sig …) ls1 a1 rs1 ∧
- (∀i.regular_trace … a1 ls1 rs1 i) ∧
- (∀j. j ≤ n → j ≠ i → to_blank_i ? n j (a1::ls1) = to_blank_i ? n j (a::ls)) ∧
- (∀j. j ≤ n → j ≠ i → to_blank_i ? n j rs1 = to_blank_i ? n j rs) ∧
- (to_blank_i ? n i ls1 = to_blank_i ? n i (a::ls)) ∧
- (to_blank_i ? n i (a1::rs1)) = to_blank_i ? n i rs).
-
-theorem sem_Rmtil: ∀sig,n,i. i < n → mtiL sig n i ⊨ Rmtil sig n i.
-#sig #n #i #lt_in
-@(sem_seq_app ??????
- (sem_move_to_blank_L … )
- (sem_seq ????? (sem_shift_i_L_new …)
- (ssem_move_until_L ? (no_head sig n))))
-#tin #tout * #t1 * * #_ #Ht1 * #t2 * #Ht2 * #_ #Htout
-(* we start looking into Rmitl *)
-#ls #a #rs #Htin (* tin is a midtape *)
-#Hhead #Hreg #no_rightof #Hnohead_ls #Hnohead_rs
-cut (regular_i sig n (a::ls) i)
- [cases (Hreg i) * //
- cases (true_or_false (nth i ? (vec … a) (blank ?) == (blank ?))) #Htest
- [#_ @daemon (* absurd, since hd rs non e' blank *)
- |#H #_ @daemon]] #Hreg1
-lapply (Ht1 … Htin Hreg1 ?) [#j #_ @Hreg] -Ht1 -Htin
-* #b * #ls1 * #ls2 * * * * * #reg_ls1_i #reg_ls1_j #Hno_blankb #Hhead #Hls1 #Ht1
-lapply (Ht2 … Ht1) -Ht2 -Ht1
-* #rs1 * #b0 * #rs2 * #rss * * * * * #Hb0 #Hb0blank #Hrs1 #Hrs1b #Hrss #Ht2
-(* we need to recover the position of the head of the emulated machine
- that is the head of ls1. This is somewhere inside rs1 *)
-cut (∃rs11. rs1 = (reverse ? ls1)@rs11)
- [cut (ls1 = [ ] ∨ ∃aa,tlls1. ls1 = aa::tlls1)
- [cases ls1 [%1 // | #aa #tlls1 %2 %{aa} %{tlls1} //]] *
- [#H1ls1 %{rs1} >H1ls1 //
- |* #aa * #tlls1 #H1ls1 >H1ls1 in Hrs1;
- cut (aa = a) [>H1ls1 in Hls1; #H @(to_blank_hd … H)] #eqaa >eqaa
- #Hrs1_aux cases (compare_append … (sym_eq … Hrs1_aux)) #l *
- [* #H1 #H2 %{l} @H1
- |(* this is absurd : if l is empty, the case is as before.
- if l is not empty then it must start with a blank, since it is the
- first character in rs2. But in this case we would have a blank
- inside ls1=a::tls1 that is absurd *)
- @daemon
- ]]]
- * #rs11 #H1
-cut (rs = rs11@rs2)
- [@(injective_append_l … (reverse … ls1)) >Hrs1 <associative_append <H1 //] #H2
-lapply (Htout … Ht2) -Htout -Ht2 *
- [(* the current character on trace i holds the head-mark.
- The case is absurd, since b0 is the head of rs2, that is a sublist of rs,
- and the head-mark is not in rs *)
- * #H3 @False_ind @(absurd (nth n ? (vec … b0) (blank sig) = head ?))
- [@(\P ?) @injective_notb @H3 ]
- @Hnohead_rs >H2 >trace_append @mem_append_l2
- lapply Hb0 cases rs2
- [whd in match (hd ???); #H >H in H3; whd in match (no_head ???);
- >all_blank_n normalize -H #H destruct (H); @False_ind
- |#c #r #H4 %1 >H4 //
- ]
- |*
- [(* we reach the head position *)
- (* cut (trace sig n j (a1::ls20)=trace sig n j (ls1@b::ls2)) *)
- * #ls10 * #a1 * #ls20 * * * #Hls20 #Ha1 #Hnh #Htout
- cut (∀j.j ≠ i →
- trace sig n j (reverse (multi_sig sig n) rs1@b::ls2) =
- trace sig n j (ls10@a1::ls20))
- [#j #ineqj >append_cons <reverse_cons >trace_def <map_append <reverse_map
- lapply (trace_shift_neq …lt_in ? (sym_not_eq … ineqj) … Hrss) [//] #Htr
- <(trace_def … (b::rs1)) <Htr >reverse_map >map_append @eq_f @Hls20 ]
- #Htracej
- cut (trace sig n i (reverse (multi_sig sig n) (rs1@[b0])@ls2) =
- trace sig n i (ls10@a1::ls20))
- [>trace_def <map_append <reverse_map <map_append <(trace_def … [b0])
- cut (trace sig n i [b0] = [blank ?]) [@daemon] #Hcut >Hcut
- lapply (trace_shift … lt_in … Hrss) [//] whd in match (tail ??); #Htr <Htr
- >reverse_map >map_append <trace_def <Hls20 %
- ]
- #Htracei
- cut (∀j. j ≠ i →
- (trace sig n j (reverse (multi_sig sig n) rs11) = trace sig n j ls10) ∧
- (trace sig n j (ls1@b::ls2) = trace sig n j (a1::ls20)))
- [@daemon (* si fa
- #j #ineqj @(first_P_to_eq ? (λx. x ≠ head ?))
- [lapply (Htracej … ineqj) >trace_def in ⊢ (%→?); <map_append
- >trace_def in ⊢ (%→?); <map_append #H @H
- | *) ] #H2
- cut ((trace sig n i (b0::reverse ? rs11) = trace sig n i (ls10@[a1])) ∧
- (trace sig n i (ls1@ls2) = trace sig n i ls20))
- [>H1 in Htracei; >reverse_append >reverse_single >reverse_append
- >reverse_reverse >associative_append >associative_append
- @daemon
- ] #H3
- cut (∀j. j ≠ i →
- trace sig n j (reverse (multi_sig sig n) ls10@rs2) = trace sig n j rs)
- [#j #jneqi @(injective_append_l … (trace sig n j (reverse ? ls1)))
- >map_append >map_append >Hrs1 >H1 >associative_append
- <map_append <map_append in ⊢ (???%); @eq_f
- <map_append <map_append @eq_f2 // @sym_eq
- <(reverse_reverse … rs11) <reverse_map <reverse_map in ⊢ (???%);
- @eq_f @(proj1 … (H2 j jneqi))] #Hrs_j
- %{ls20} %{a1} %{(reverse ? (b0::ls10)@tail (multi_sig sig n) rs2)}
- %[%[%[%[%[@Htout
- |#j cases (decidable_eq_nat j i)
- [#eqji >eqji (* by cases wether a1 is blank *)
- @daemon
- |#jneqi lapply (reg_ls1_j … jneqi) #H4
- >reverse_cons >associative_append >Hb0 @regular_cons_hd_rs
- @(eq_trace_to_regular … H4)
- [<hd_trace >(proj2 … (H2 … jneqi)) >hd_trace %
- |<tail_trace >(proj2 … (H2 … jneqi)) >tail_trace %
- |@sym_eq @Hrs_j //
- ]
- ]]
- |#j #lejn #jneqi <(Hls1 … lejn)
- >to_blank_i_def >to_blank_i_def @eq_f @sym_eq @(proj2 … (H2 j jneqi))]
- |#j #lejn #jneqi >reverse_cons >associative_append >Hb0
- <to_blank_hd_cons >to_blank_i_def >to_blank_i_def @eq_f @Hrs_j //]
- |<(Hls1 i) [2:@lt_to_le //]
- lapply (all_blank_after_blank … reg_ls1_i)
- [@(\P ?) @daemon] #allb_ls2
- whd in match (to_blank_i ????); <(proj2 … H3)
- @daemon ]
- |>reverse_cons >associative_append
- cut (to_blank_i sig n i rs = to_blank_i sig n i (rs11@[b0])) [@daemon]
- #Hcut >Hcut >(to_blank_i_chop … b0 (a1::reverse …ls10)) [2: @Hb0blank]
- >to_blank_i_def >to_blank_i_def @eq_f
- >trace_def >trace_def @injective_reverse >reverse_map >reverse_cons
- >reverse_reverse >reverse_map >reverse_append >reverse_single @sym_eq
- @(proj1 … H3)
- ]
- |(*we do not find the head: this is absurd *)
- * #b1 * #lss * * #H2 @False_ind
- cut (∀x0. mem ? x0 (trace sig n n (b0::reverse ? rss@ls2)) → x0 ≠ head ?)
- [@daemon] -H2 #H2
- lapply (trace_shift_neq sig n i n … lt_in … Hrss)
- [@lt_to_not_eq @lt_in | // ]
- #H3 @(absurd
- (nth n ? (vec … (hd ? (ls1@[b]) (all_blank sig n))) (blank ?) = head ?))
- [>Hhead //
- |@H2 >trace_def %2 <map_append @mem_append_l1 <reverse_map <trace_def
- >H3 >H1 >trace_def >reverse_map >reverse_cons >reverse_append
- >reverse_reverse >associative_append <map_append @mem_append_l2
- cases ls1 [%1 % |#x #ll %1 %]
- ]
- ]
- ]
-qed.
+++ /dev/null
-<?xml version="1.0"?>
-<glade-interface>
- <!-- interface-requires gtk+ 2.16 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkWindow" id="BrowserWin">
- <property name="width_request">500</property>
- <property name="height_request">480</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Cic browser</property>
- <property name="window_position">center-on-parent</property>
- <property name="default_width">500</property>
- <property name="default_height">480</property>
- <property name="destroy_with_parent">True</property>
- <child>
- <widget class="GtkEventBox" id="BrowserWinEventBox">
- <property name="visible">True</property>
- <child>
- <widget class="GtkVBox" id="BrowserVBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkMenuBar" id="menubar2">
- <property name="visible">True</property>
- <child>
- <widget class="GtkMenuItem" id="BrowserFileMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_File</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="BrowserFileMenu_menu">
- <child>
- <widget class="GtkImageMenuItem" id="BrowserNewMenuItem">
- <property name="label">gtk-new</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="BrowserUrlMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Open _Location ...</property>
- <property name="use_underline">True</property>
- <accelerator key="L" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="BrowserCloseMenuItem">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="BrowserEditMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="BrowserEditMenu_menu">
- <child>
- <widget class="GtkImageMenuItem" id="BrowserCopyMenuItem">
- <property name="label">gtk-copy</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <widget class="GtkHBox" id="BrowserHBox">
- <property name="visible">True</property>
- <child>
- <widget class="GtkButton" id="BrowserNewButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image303">
- <property name="visible">True</property>
- <property name="stock">gtk-new</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="BrowserBackButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image304">
- <property name="visible">True</property>
- <property name="stock">gtk-go-back</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="BrowserForwardButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image305">
- <property name="visible">True</property>
- <property name="stock">gtk-go-forward</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="BrowserRefreshButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">refresh</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image229">
- <property name="visible">True</property>
- <property name="stock">gtk-refresh</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="BrowserHomeButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">home</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image190">
- <property name="visible">True</property>
- <property name="stock">gtk-home</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkImage" id="image301">
- <property name="visible">True</property>
- <property name="stock">gtk-jump-to</property>
- <property name="icon-size">2</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">3</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="UriHBox">
- <property name="visible">True</property>
- <child>
- <widget class="GtkEntry" id="browserUri">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="invisible_char">●</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">6</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkNotebook" id="mathOrListNotebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkScrolledWindow" id="ScrolledBrowser">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="mathLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">MathView</property>
- </widget>
- <packing>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow9">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTreeView" id="whelpResultTreeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="WhelpResult">
- <property name="visible">True</property>
- <property name="label" translatable="yes">WhelpResult</property>
- </widget>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow11">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <widget class="GtkViewport" id="viewport2">
- <property name="visible">True</property>
- <property name="shadow_type">none</property>
- <child>
- <widget class="GtkImage" id="BrowserImage">
- <property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="EasterEggLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">WhelpEasterEgg</property>
- </widget>
- <packing>
- <property name="position">2</property>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="GraphScrolledWin">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Graph</property>
- </widget>
- <packing>
- <property name="position">3</property>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox20">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwinContent">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">3</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox35">
- <property name="visible">True</property>
- <property name="border_width">4</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkVBox" id="vbox22">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="entrySearch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="buttonSearch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkAlignment" id="alignment21">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox36">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image1068">
- <property name="visible">True</property>
- <property name="stock">gtk-find</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Search</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="SearchText">
- <property name="visible">True</property>
- <property name="label" translatable="yes">SearchText</property>
- </widget>
- <packing>
- <property name="position">4</property>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="ConfirmationDialog">
- <property name="title" translatable="yes">DUMMY</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="window_position">center</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="ConfirmationDialogLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">DUMMY</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="ConfirmationDialogCancelButton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="ConfirmationDialogOkButton">
- <property name="label">gtk-ok</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="EmptyDialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">DUMMY</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="EmptyDialogVBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="EmptyDialogLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">DUMMY</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="EmptyDialogCancelButton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="EmptyDialogOkButton">
- <property name="label">gtk-ok</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkFileSelection" id="FileSelectionWin">
- <property name="border_width">10</property>
- <property name="title" translatable="yes">Select File</property>
- <property name="modal">True</property>
- <property name="window_position">center</property>
- <property name="type_hint">dialog</property>
- <child internal-child="cancel_button">
- <widget class="GtkButton" id="fileSelCancelButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- </widget>
- </child>
- <child internal-child="ok_button">
- <widget class="GtkButton" id="fileSelOkButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="MainWin">
- <property name="title" translatable="yes">Matita</property>
- <child>
- <widget class="GtkEventBox" id="MainWinEventBox">
- <property name="visible">True</property>
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkHandleBox" id="menuBarHandleBox">
- <property name="visible">True</property>
- <child>
- <widget class="GtkMenuBar" id="menubar1">
- <property name="visible">True</property>
- <child>
- <widget class="GtkMenuItem" id="fileMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_File</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="fileMenu_menu">
- <child>
- <widget class="GtkImageMenuItem" id="newMenuItem">
- <property name="label">gtk-new</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="openMenuItem">
- <property name="label">gtk-open</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="o" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="saveMenuItem">
- <property name="label">gtk-save</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="s" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="saveAsMenuItem">
- <property name="label">gtk-save-as</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="s" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator2">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="closeMenuItem">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="w" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="quitMenuItem">
- <property name="label">gtk-quit</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="editMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="editMenu_menu">
- <child>
- <widget class="GtkImageMenuItem" id="undoMenuItem">
- <property name="label">gtk-undo</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="redoMenuItem">
- <property name="label">gtk-redo</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="z" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator3">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="cutMenuItem">
- <property name="label">gtk-cut</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="x" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="copyMenuItem">
- <property name="label">gtk-copy</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="c" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="pasteMenuItem">
- <property name="label">gtk-paste</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="v" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="pastePatternMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Paste as pattern</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckMenuItem" id="unicodeAsTexMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Paste Unicode as TeX</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckMenuItem" id="menuitemAutoAltL">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Automatically expands TeX macros to their corresponding UTF-8 symbol</property>
- <property name="label" translatable="yes">Auto-expand TeX Macros</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="deleteMenuItem">
- <property name="label">gtk-delete</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator4">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="selectAllMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Select _All</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator7">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="findReplMenuItem">
- <property name="label">gtk-find-and-replace</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="f" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator8">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="LigatureButton">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Next ligature</property>
- <property name="use_underline">True</property>
- <accelerator key="l" signal="activate" modifiers="GDK_MOD1_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="externalEditorMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Edit with e_xternal editor</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="scriptMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Script</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="scriptMenu_menu">
- <child>
- <widget class="GtkImageMenuItem" id="scriptAdvanceMenuItem">
- <property name="label">gtk-go-down</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="Page_Down" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="scriptRetractMenuItem">
- <property name="label">gtk-go-up</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="Page_Up" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator9">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="scriptBottomMenuItem">
- <property name="label">gtk-goto-bottom</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="End" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="scriptTopMenuItem">
- <property name="label">gtk-goto-top</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="Home" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator10">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="scriptJumpMenuItem">
- <property name="label">gtk-jump-to</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="period" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="viewMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_View</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="viewMenu_menu">
- <child>
- <widget class="GtkMenuItem" id="newCicBrowserMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">New CIC _browser</property>
- <property name="use_underline">True</property>
- <accelerator key="F3" signal="activate"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator5">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckMenuItem" id="fullscreenMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Fullscreen</property>
- <property name="use_underline">True</property>
- <accelerator key="F11" signal="activate"/>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckMenuItem" id="menuitemPalette">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Shows a palette with natural deduction rules</property>
- <property name="label" translatable="yes">Natural deduction palette</property>
- <property name="use_underline">True</property>
- <accelerator key="F2" signal="activate"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator1">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="increaseFontSizeMenuItem">
- <property name="label">gtk-zoom-in</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="plus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="decreaseFontSizeMenuItem">
- <property name="label">gtk-zoom-out</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="minus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="normalFontSizeMenuItem">
- <property name="label">gtk-zoom-100</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="equal" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator12">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckMenuItem" id="ppNotationMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Pretty print notation</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckMenuItem" id="hideCoercionsMenuItem">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Hide coercions</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator13">
- <property name="visible">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="showCoercionsGraphMenuItem">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Displays the graph of coercions</property>
- <property name="label" translatable="yes">Coercions Graph</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="showHintsDbMenuItem">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Displays the database of hints</property>
- <property name="label" translatable="yes">Hints database</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="showTermGrammarMenuItem">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Displays the terms grammar as extended by the user</property>
- <property name="label" translatable="yes">Terms grammar</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="showUnicodeTable">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Show the conversion table from TeX like sequences to UTF-8</property>
- <property name="label" translatable="yes">TeX/UTF-8 table</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="debugMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Debug</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="debugMenu_menu">
- <child>
- <widget class="GtkSeparatorMenuItem" id="separator6">
- <property name="visible">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="helpMenu">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Help</property>
- <property name="use_underline">True</property>
- <child>
- <widget class="GtkMenu" id="helpMenu_menu">
- <child>
- <widget class="GtkImageMenuItem" id="contentsMenuItem">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="F1" signal="activate"/>
- </widget>
- </child>
- <child>
- <widget class="GtkImageMenuItem" id="aboutMenuItem">
- <property name="label">gtk-about</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox99">
- <property name="visible">True</property>
- <child>
- <widget class="GtkHPaned" id="hpaneScriptSequent">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkHBox" id="hbox18">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkHandleBox" id="TacticsButtonsHandlebox">
- <property name="visible">True</property>
- <property name="handle_position">top</property>
- <child>
- <widget class="GtkVBox" id="vboxTacticsPalette">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkExpander" id="expander1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkButton" id="butImpl_intro">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Implication (⇒<sub>i</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butAnd_intro">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Conjunction (∧<sub>i</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butOr_intro_left">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Disjunction left (∨<sub>i-l</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butOr_intro_right">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Disjunction right (∨<sub>i-r</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butNot_intro">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Negation (¬<sub>i</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butTop_intro">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Top (⊤<sub>i</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butForall_intro">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Universal (∀<sub>i</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butExists_intro">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Existential (∃<sub>i</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">7</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Introduction rules</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkExpander" id="expander2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkButton" id="butImpl_elim">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Implication (⇒<sub>e</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butAnd_elim_left">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Conjunction left (∧<sub>e-l</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butAnd_elim_right">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Conjunction right (∧<sub>e-r</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butOr_elim">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label27">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Disjunction (∨<sub>e</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butNot_elim">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Negation (¬<sub>e</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butBot_elim">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label33">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Bottom (⊥<sub>e</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butForall_elim">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label34">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Universal (∀<sub>e</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butExists_elim">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <widget class="GtkLabel" id="label35">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Existential (∃<sub>e</sub>)</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">7</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Elimination rules</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkExpander" id="expander3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkButton" id="butRAA">
- <property name="label" translatable="yes">Reduction to Absurdity (RAA)</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butUseLemma">
- <property name="label" translatable="yes">Use lemma (lem)</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="butDischarge">
- <property name="label" translatable="yes">Discharge (discharge)</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Misc rules</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vboxScript">
- <property name="width_request">400</property>
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkHBox" id="hbox28">
- <property name="visible">True</property>
- <child>
- <widget class="GtkToolbar" id="buttonsToolbar">
- <property name="visible">True</property>
- <property name="toolbar_style">both</property>
- <child>
- <widget class="GtkToolItem" id="toolitem41">
- <property name="visible">True</property>
- <child>
- <widget class="GtkButton" id="scriptTopButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Restart</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image920">
- <property name="visible">True</property>
- <property name="stock">gtk-goto-top</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolItem" id="toolitem42">
- <property name="visible">True</property>
- <child>
- <widget class="GtkButton" id="scriptRetractButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Retract 1 phrase</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image921">
- <property name="visible">True</property>
- <property name="stock">gtk-go-up</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolItem" id="toolitem43">
- <property name="visible">True</property>
- <child>
- <widget class="GtkButton" id="scriptJumpButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Execute until point</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image922">
- <property name="visible">True</property>
- <property name="stock">gtk-jump-to</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolItem" id="toolitem44">
- <property name="visible">True</property>
- <child>
- <widget class="GtkButton" id="scriptAdvanceButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Execute 1 phrase</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image923">
- <property name="visible">True</property>
- <property name="stock">gtk-go-down</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolItem" id="toolitem45">
- <property name="visible">True</property>
- <child>
- <widget class="GtkButton" id="scriptBottomButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Execute all</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image924">
- <property name="visible">True</property>
- <property name="stock">gtk-goto-bottom</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolbar" id="toolbar2">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="toolbar_style">both</property>
- <child>
- <widget class="GtkToolItem" id="toolitem46">
- <property name="visible">True</property>
- <child>
- <widget class="GtkButton" id="scriptAbortButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="relief">none</property>
- <child>
- <widget class="GtkImage" id="image927">
- <property name="visible">True</property>
- <property name="stock">gtk-stop</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkNotebook" id="scriptNotebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="scrollable">True</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVPaned" id="vpaned1">
- <property name="width_request">250</property>
- <property name="height_request">500</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="position">380</property>
- <child>
- <widget class="GtkNotebook" id="sequentsNotebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="scrollable">True</property>
- </widget>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
- <child>
- <widget class="GtkScrolledWindow" id="logScrolledWin">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTextView" id="logTextView">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">char</property>
- <property name="cursor_visible">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox10">
- <property name="visible">True</property>
- <child>
- <widget class="GtkStatusbar" id="StatusBar">
- <property name="visible">True</property>
- <property name="has_resize_grip">False</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkNotebook" id="HintNotebook">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <child>
- <widget class="GtkImage" id="HintLowImage">
- <property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label14</property>
- </widget>
- <packing>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="GtkImage" id="HintMediumImage">
- <property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label15</property>
- </widget>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="GtkImage" id="HintHighImage">
- <property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label16</property>
- </widget>
- <packing>
- <property name="position">2</property>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="TextDialog">
- <property name="title" translatable="yes">DUMMY</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="TextDialogLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">DUMMY</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTextView" id="TextDialogTextView">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="TextDialogCancelButton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="TextDialogOkButton">
- <property name="label">gtk-ok</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="UriChoiceDialog">
- <property name="height_request">280</property>
- <property name="title" translatable="yes">Uri choice</property>
- <property name="modal">True</property>
- <property name="window_position">center</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">3</property>
- <child>
- <widget class="GtkLabel" id="UriChoiceLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">some informative message here ...</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="width_request">400</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <widget class="GtkTreeView" id="UriChoiceTreeView">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="uriEntryHBox">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">URI: </property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="entry1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="UriChoiceAbortButton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="UriChoiceSelectedButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image19">
- <property name="visible">True</property>
- <property name="stock">gtk-index</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Try _Selected</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="UriChoiceConstantsButton">
- <property name="label" translatable="yes">Try Constants</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="copyButton">
- <property name="label">gtk-copy</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="uriChoiceAutoButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox16">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image302">
- <property name="visible">True</property>
- <property name="stock">gtk-ok</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="okLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">bla bla bla</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="uriChoiceForwardButton">
- <property name="label">gtk-go-forward</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="FindReplWin">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Find & Replace</property>
- <property name="resizable">False</property>
- <property name="window_position">mouse</property>
- <property name="type_hint">dialog</property>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="row_spacing">5</property>
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Find:</property>
- </widget>
- <packing>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Replace with: </property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="findEntry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="replaceEntry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox19">
- <property name="visible">True</property>
- <property name="spacing">5</property>
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="findButton">
- <property name="label">gtk-find</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="findReplButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkAlignment" id="alignment13">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox20">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image357">
- <property name="visible">True</property>
- <property name="stock">gtk-find-and-replace</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label">_Replace</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="cancelButton">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_padding">5</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="DisambiguationErrors">
- <property name="width_request">450</property>
- <property name="height_request">400</property>
- <property name="title" translatable="yes">title</property>
- <property name="modal">True</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox14">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkVBox" id="vbox15">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="disambiguationErrorsLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">some informative message here ...</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow12">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTreeView" id="treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox2">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="button6">
- <property name="label">gtk-help</property>
- <property name="response_id">-11</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="disambiguationErrorsMoreErrors">
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkAlignment" id="alignment18">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox29">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image926">
- <property name="visible">True</property>
- <property name="stock">gtk-zoom-in</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label28">
- <property name="visible">True</property>
- <property name="label">More</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="disambiguationErrorsCancelButton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="disambiguationErrorsOkButton">
- <property name="label">gtk-ok</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="AutoWin">
- <property name="width_request">600</property>
- <property name="height_request">400</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Auto</property>
- <property name="type_hint">dialog</property>
- <property name="gravity">south-east</property>
- <child>
- <widget class="GtkVBox" id="vbox17">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkHBox" id="hbox30">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindowAREA">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkViewport" id="viewportAREA">
- <property name="visible">True</property>
- <child>
- <widget class="GtkTable" id="table">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">3</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox18">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkButton" id="buttonUP">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkAlignment" id="alignment19">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox31">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image1066">
- <property name="visible">True</property>
- <property name="stock">gtk-go-up</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label30">
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="buttonDOWN">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkImage" id="image1065">
- <property name="visible">True</property>
- <property name="stock">gtk-go-down</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHSeparator" id="hseparator3">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="padding">3</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox32">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="labelLAST">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Last:</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHButtonBox" id="hbuttonbox3">
- <property name="visible">True</property>
- <property name="border_width">4</property>
- <property name="spacing">4</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="buttonPAUSE">
- <property name="label">gtk-media-pause</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="buttonPLAY">
- <property name="label">gtk-media-play</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="buttonNEXT">
- <property name="label">gtk-media-next</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="buttonCLOSE">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
(* $Id$ *)
-open Printf
-
-open MatitaGtkMisc
-open GrafiteTypes
-
(** {2 Initialization} *)
let _ =
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface>
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkWindow" id="AutoWin">
+ <property name="width_request">600</property>
+ <property name="height_request">400</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Auto</property>
+ <property name="type_hint">dialog</property>
+ <property name="gravity">south-east</property>
+ <child>
+ <object class="GtkBox" id="vbox17">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkBox" id="hbox30">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindowAREA">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport" id="viewportAREA">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="table">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="vbox18">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="buttonUP">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <child>
+ <object class="GtkAlignment" id="alignment19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkBox" id="hbox31">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image1066">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-up</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label30">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="buttonDOWN">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <child>
+ <object class="GtkImage" id="image1065">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-down</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparator" id="hseparator3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">3</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox32">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="labelLAST">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Last:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButtonBox" id="hbuttonbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">4</property>
+ <property name="spacing">4</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="buttonPAUSE">
+ <property name="label">gtk-media-pause</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="buttonPLAY">
+ <property name="label">gtk-media-play</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="buttonNEXT">
+ <property name="label">gtk-media-next</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="buttonCLOSE">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkWindow" id="BrowserWin">
+ <property name="width_request">500</property>
+ <property name="height_request">480</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Cic browser</property>
+ <property name="window_position">center-on-parent</property>
+ <property name="default_width">500</property>
+ <property name="default_height">480</property>
+ <property name="destroy_with_parent">True</property>
+ <child>
+ <object class="GtkEventBox" id="BrowserWinEventBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="BrowserVBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkMenuBar" id="menubar2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="BrowserFileMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_File</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="BrowserFileMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="BrowserNewMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_New</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="BrowserUrlMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Open _Location ...</property>
+ <property name="use_underline">True</property>
+ <accelerator key="L" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="BrowserCloseMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Quit</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="BrowserEditMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="BrowserEditMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="BrowserCopyMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Copy</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkBox" id="BrowserHBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="BrowserNewButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image303">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-new</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="BrowserBackButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image304">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-back</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="BrowserForwardButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image305">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-forward</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="BrowserRefreshButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">refresh</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image229">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-refresh</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="BrowserHomeButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">home</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image190">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-home</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="image301">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-jump-to</property>
+ <property name="icon_size">2</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">3</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="UriHBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkEntry" id="browserUri">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="mathOrListNotebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkScrolledWindow" id="ScrolledBrowser">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="mathLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">MathView</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow9">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="whelpResultTreeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="WhelpResult">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">WhelpResult</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow11">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkViewport" id="viewport2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkImage" id="BrowserImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="EasterEggLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">WhelpEasterEgg</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="GraphScrolledWin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label26">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Graph</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="vbox20">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwinContent">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">3</property>
+ <property name="shadow_type">in</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox35">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">4</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkBox" id="vbox22">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entrySearch">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="buttonSearch">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <child>
+ <object class="GtkAlignment" id="alignment21">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkBox" id="hbox36">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image1068">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-find</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label32">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Search</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="SearchText">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">SearchText</property>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkDialog" id="DisambiguationErrors">
+ <property name="width_request">450</property>
+ <property name="height_request">400</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">title</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="vbox14">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="hbuttonbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">spread</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="vbox15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="disambiguationErrorsLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">some informative message here ...</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow12">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="vexpand">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <property name="height_request">717</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkWindow" id="FindReplWin">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Find & Replace</property>
+ <property name="resizable">False</property>
+ <property name="window_position">mouse</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <object class="GtkGrid" id="table1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">9</property>
+ <child>
+ <object class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Find:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Replace with: </property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="findEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="replaceEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">5</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkButton" id="findButton">
+ <property name="label">gtk-find</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="findReplButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <child>
+ <object class="GtkAlignment" id="alignment13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkBox" id="hbox20">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image357">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-find-and-replace</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Replace</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancelButton">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkWindow" id="MainWin">
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Matita</property>
+ <child>
+ <object class="GtkEventBox" id="MainWinEventBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="vbox8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkMenuBar" id="menubar1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="fileMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_File</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="fileMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="newMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_New</property>
+ <property name="use_underline">True</property>
+ <accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="openMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Open...</property>
+ <property name="use_underline">True</property>
+ <accelerator key="o" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="saveMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Save</property>
+ <property name="use_underline">True</property>
+ <accelerator key="s" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="saveAsMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Save as...</property>
+ <property name="use_underline">True</property>
+ <accelerator key="s" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="closeMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Close</property>
+ <property name="use_underline">True</property>
+ <accelerator key="w" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="quitMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Quit</property>
+ <property name="use_underline">True</property>
+ <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="editMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="editMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="undoMenuItem">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Undo</property>
+ <property name="use_underline">True</property>
+ <accelerator key="z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="redoMenuItem">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">False</property>
+ <property name="label">_Redo</property>
+ <property name="use_underline">True</property>
+ <accelerator key="z" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="cutMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Cut</property>
+ <property name="use_underline">True</property>
+ <accelerator key="x" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="copyMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Copy</property>
+ <property name="use_underline">True</property>
+ <accelerator key="c" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="pasteMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Paste</property>
+ <property name="use_underline">True</property>
+ <accelerator key="v" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="pastePatternMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Paste as pattern</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="unicodeAsTexMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Paste Unicode as TeX</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="menuitemAutoAltL">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Auto-expand TeX Macros</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="deleteMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Delete</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="selectAllMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Select _All</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="findReplMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Find and replace...</property>
+ <property name="use_underline">True</property>
+ <accelerator key="f" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="LigatureButton">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Next ligature</property>
+ <property name="use_underline">True</property>
+ <accelerator key="l" signal="activate" modifiers="GDK_MOD1_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="externalEditorMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Edit with e_xternal editor</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="scriptMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Script</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="scriptMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="scriptAdvanceMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Execute 1 phrase</property>
+ <property name="use_underline">True</property>
+ <accelerator key="Page_Down" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="scriptRetractMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Retract 1 phrase</property>
+ <property name="use_underline">True</property>
+ <accelerator key="Page_Up" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="scriptBottomMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Execute all</property>
+ <property name="use_underline">True</property>
+ <accelerator key="End" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="scriptTopMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Retract all</property>
+ <property name="use_underline">True</property>
+ <accelerator key="Home" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="scriptJumpMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Execute until cursor</property>
+ <property name="use_underline">True</property>
+ <accelerator key="period" signal="activate" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="viewMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_View</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="viewMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="newCicBrowserMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">New CIC _browser</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F3" signal="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="fullscreenMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Fullscreen</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F11" signal="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="menuitemPalette">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Natural deduction palette</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F2" signal="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="increaseFontSizeMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Zoom in</property>
+ <property name="use_underline">True</property>
+ <accelerator key="plus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="decreaseFontSizeMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Zoom out</property>
+ <property name="use_underline">True</property>
+ <accelerator key="minus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="normalFontSizeMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Normal size</property>
+ <property name="use_underline">True</property>
+ <accelerator key="equal" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="ppNotationMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Pretty print notation</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="hideCoercionsMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Hide coercions</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="showCoercionsGraphMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Coercions Graph</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="showHintsDbMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Hints database</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="showTermGrammarMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Terms grammar</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="showUnicodeTable">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">TeX/UTF-8 table</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="debugMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Debug</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="debugMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="helpMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="helpMenu_menu">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="contentsMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Contents</property>
+ <property name="use_underline">True</property>
+ <accelerator key="F1" signal="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="aboutMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">About</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox99">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkPaned" id="hpaneScriptSequent">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox" id="hbox18">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkBox" id="TacticsButtonsHandlebox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="vboxTacticsPalette">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkExpander" id="expander1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="butImpl_intro">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Implication (⇒<sub>i</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butAnd_intro">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Conjunction (∧<sub>i</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butOr_intro_left">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Disjunction left (∨<sub>i-l</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butOr_intro_right">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Disjunction right (∨<sub>i-r</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butNot_intro">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Negation (¬<sub>i</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butTop_intro">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Top (⊤<sub>i</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butForall_intro">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Universal (∀<sub>i</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butExists_intro">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label21">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Existential (∃<sub>i</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Introduction rules</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkExpander" id="expander2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="butImpl_elim">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label22">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Implication (⇒<sub>e</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butAnd_elim_left">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Conjunction left (∧<sub>e-l</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butAnd_elim_right">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label24">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Conjunction right (∧<sub>e-r</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butOr_elim">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label27">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Disjunction (∨<sub>e</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butNot_elim">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label31">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Negation (¬<sub>e</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butBot_elim">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label33">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Bottom (⊥<sub>e</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butForall_elim">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label34">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Universal (∀<sub>e</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butExists_elim">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label35">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Existential (∃<sub>e</sub>)</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Elimination rules</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkExpander" id="expander3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="butRAA">
+ <property name="label" translatable="yes">Reduction to Absurdity (RAA)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butUseLemma">
+ <property name="label" translatable="yes">Use lemma (lem)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="butDischarge">
+ <property name="label" translatable="yes">Discharge (discharge)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Misc rules</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="vboxScript">
+ <property name="width_request">400</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkBox" id="hbox28">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkToolbar" id="buttonsToolbar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="toolbar_style">both</property>
+ <child>
+ <object class="GtkToolItem" id="toolitem41">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="scriptTopButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Retract all</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image920">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-goto-top</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolItem" id="toolitem42">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="scriptRetractButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Retract 1 phrase</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image921">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-up</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolItem" id="toolitem43">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="scriptJumpButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Execute until cursor</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image922">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-jump-to</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolItem" id="toolitem44">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="scriptAdvanceButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Execute 1 phrase</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image923">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-down</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolItem" id="toolitem45">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="scriptBottomButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Execute all</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image924">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-goto-bottom</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="toolbar2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="toolbar_style">both</property>
+ <child>
+ <object class="GtkToolItem" id="toolitem46">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="scriptAbortButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image927">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-stop</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="scriptNotebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="scrollable">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkPaned" id="vpaned1">
+ <property name="width_request">250</property>
+ <property name="height_request">500</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="orientation">vertical</property>
+ <property name="position">380</property>
+ <child>
+ <object class="GtkNotebook" id="sequentsNotebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="scrollable">True</property>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkScrolledWindow" id="logScrolledWin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="logTextView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">char</property>
+ <property name="cursor_visible">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkStatusbar" id="StatusBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="HintNotebook">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="show_tabs">False</property>
+ <child>
+ <object class="GtkImage" id="HintLowImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">label14</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="HintMediumImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">label15</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="HintHighImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">label16</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkDialog" id="UriChoiceDialog">
+ <property name="height_request">280</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Uri choice</property>
+ <property name="modal">True</property>
+ <property name="window_position">center</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">4</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="UriChoiceAbortButton">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="UriChoiceSelectedButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-index</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Try _Selected</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="UriChoiceConstantsButton">
+ <property name="label" translatable="yes">Try Constants</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="copyButton">
+ <property name="label">gtk-copy</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="uriChoiceAutoButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkBox" id="hbox16">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image302">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-ok</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="okLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">bla bla bla</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="uriChoiceForwardButton">
+ <property name="label">gtk-go-forward</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel" id="UriChoiceLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">some informative message here ...</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="width_request">400</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkTreeView" id="UriChoiceTreeView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="uriEntryHBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">URI: </property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">UriChoiceAbortButton</action-widget>
+ </action-widgets>
+ </object>
+</interface>
(* $Id$ *)
module G = GrafiteAst
-open GrafiteTypes
open Printf
class status baseuri =
let cases_or_induction_context stack =
match stack with
[] -> false
- | (g,t,k,tag,p)::tl -> try
+ | (_g,_t,_k,_tag,p)::_tl -> try
let s = List.assoc "context" p in
s = "cases" || s = "induction"
with
let has_focused_goal stack =
match stack with
[] -> false
- | (g,t,k,tag,p)::tl -> (List.length g) > 0
+ | (g,_t,_k,_tag,_p)::_tl -> (List.length g) > 0
;;
-let get_indentation status statement =
+let get_indentation status _statement =
let base_ind =
match status#stack with
[] -> 0
| G.NObj (_,obj,_) ->
(
match obj with
- Theorem _ -> "\n" ^ GrafiteAstPp.pp_statement status statement
+ NotationPt.Theorem _ -> "\n" ^ GrafiteAstPp.pp_statement status statement
~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex")
| _ -> ""
)
(* given a path to a ma file inside the include_paths, returns the
new include_paths associated to that file *)
-let read_include_paths ~include_paths file =
- try
- let root, _buri, _fname, _tgt =
- Librarian.baseuri_of_script ~include_paths:[] file in
- let includes =
- try
- Str.split (Str.regexp " ")
- (List.assoc "include_paths" (Librarian.load_root_file (root^"/root")))
- with Not_found -> []
- in
- let rc = root :: includes in
+let read_include_paths ~include_paths:_ file =
+ try
+ let root, _buri, _fname, _tgt =
+ Librarian.baseuri_of_script ~include_paths:[] file in
+ let includes =
+ try
+ Str.split (Str.regexp " ")
+ (List.assoc "include_paths" (Librarian.load_root_file (root^"/root")))
+ with Not_found -> []
+ in
+ let rc = root :: includes in
List.iter (HLog.debug) rc; rc
with Librarian.NoRootFor _ | Librarian.FileNotFound _ ->
[]
| GrafiteTypes.Command_error msg -> None, "Error: " ^ msg
| CicNotationParser.Parse_error err ->
None, sprintf "Parse error: %s" err
- | Unix.Unix_error (code, api, param) ->
+ | Unix.Unix_error (code, api, _param) ->
let err = Unix.error_message code in
None, "Unix Error (" ^ api ^ "): " ^ err
| HMarshal.Corrupt_file fname -> None, sprintf "file '%s' is corrupt" fname
(* $Id$ *)
-exception PopupClosed
open Printf
let wrap_callback0 f = fun _ -> try f () with Not_found -> assert false
(fun renderer -> GTree.view_column ~renderer ())
renderers
in
- object (self)
+ object
val text_columns = text_columns
initializer
let lookup_pixbuf tag =
try List.assoc tag tags with Not_found -> assert false
in
- object (self)
+ object
initializer
tree_view#set_model (Some (list_store :> GTree.model));
ignore (tree_view#append_column tag_vcolumn);
])
in
let toggle_vcol = GTree.view_column ~renderer:toggle_rend () in
- object (self)
+ object
initializer
tree_view#set_model (Some (list_store :> GTree.model));
ignore (tree_view#append_column text_vcol);
class type gui =
object
method newUriDialog: unit -> MatitaGeneratedGui.uriChoiceDialog
- method newConfirmationDialog: unit -> MatitaGeneratedGui.confirmationDialog
- method newEmptyDialog: unit -> MatitaGeneratedGui.emptyDialog
end
let popup_message
- ~title ~message ~buttons ~callback
+ ~title ~message ~buttons
?(message_type=`QUESTION) ?parent ?(use_markup=true)
- ?(destroy_with_parent=true) ?(allow_grow=false) ?(allow_shrink=false)
- ?icon ?(modal=true) ?(resizable=false) ?screen ?type_hint
- ?(position=`CENTER_ON_PARENT) ?wm_name ?wm_class ?border_width ?width
+ ?(destroy_with_parent=true) ?icon ?(modal=true) ?(resizable=false)
+ ?screen ?type_hint
+ ?(position=`CENTER_ON_PARENT) ?wmclass ?border_width ?width
?height ?(show=true) ()
=
let m =
GWindow.message_dialog
~message ~use_markup ~message_type ~buttons ?parent ~destroy_with_parent
- ~title ~allow_grow ~allow_shrink ?icon ~modal ~resizable ?screen
- ?type_hint ~position ?wm_name ?wm_class ?border_width ?width ?height
+ ~title ?icon ~modal ~resizable ?screen
+ ?type_hint ~position ?wmclass ?border_width ?width ?height
~show ()
in
- ignore(m#connect#response
- ~callback:(fun a -> GMain.Main.quit ();callback a));
- ignore(m#connect#close
- ~callback:(fun _ -> GMain.Main.quit ();raise PopupClosed));
- GtkThread.main ();
+ ignore(m#run ()) ;
m#destroy ()
let popup_message_lowlevel
- ~title ~message ?(no_separator=true) ~callback ~message_type ~buttons
- ?parent ?(destroy_with_parent=true) ?(allow_grow=false) ?(allow_shrink=false)
- ?icon ?(modal=true) ?(resizable=false) ?screen ?type_hint
- ?(position=`CENTER_ON_PARENT) ?wm_name ?wm_class ?border_width ?width
- ?height ?(show=true) ()
+ ~title ~message ?no_separator:(_=true) ~message_type ~buttons
+ ?parent ?(destroy_with_parent=true)
+ ?icon ?modal:(_=true) ?(resizable=false) ?screen ?type_hint
+ ?(position=`CENTER_ON_PARENT) ?wmclass ?border_width ?width
+ ?height ()
=
let m =
GWindow.dialog
- ~no_separator
- ?parent ~destroy_with_parent
- ~title ~allow_grow ~allow_shrink ?icon ~modal ~resizable ?screen
- ?type_hint ~position ?wm_name ?wm_class ?border_width ?width ?height
- ~show:false ()
+ ?parent ~destroy_with_parent
+ ~title ?icon ~resizable ?screen
+ ?type_hint ~position ?wmclass ?border_width ?width ?height ()
in
let stock =
match message_type with
m#vbox#pack ~from:`START
~padding:20 ~expand:true ~fill:true (hbox:>GObj.widget);
List.iter (fun (x, y) ->
- m#add_button_stock x y;
- if y = `CANCEL then
- m#set_default_response y
+ m#add_button_stock x y
) buttons;
- ignore(m#connect#response
- ~callback:(fun a -> GMain.Main.quit ();callback a));
- ignore(m#connect#close
- ~callback:(fun _ -> GMain.Main.quit ();callback `POPUPCLOSED));
- if show = true then
- m#show ();
- GtkThread.main ();
- m#destroy ()
+ let res = m#run () in
+ m#destroy () ;
+ res
let ask_confirmation ~title ~message ?parent () =
- let rc = ref `YES in
- let callback =
- function
- | `YES -> rc := `YES
- | `NO -> rc := `NO
- | `CANCEL -> rc := `CANCEL
- | `DELETE_EVENT -> rc := `CANCEL
- | `POPUPCLOSED -> rc := `CANCEL
- in
- let buttons = [`YES,`YES ; `NO,`NO ; `CANCEL,`CANCEL] in
- popup_message_lowlevel
- ~title ~message ~message_type:`WARNING ~callback ~buttons ?parent ();
- !rc
+ GtkThread.sync (fun _ ->
+ let buttons = [`YES,`YES ; `NO,`NO ; `CANCEL,`DELETE_EVENT] in
+ popup_message_lowlevel
+ ~title ~message ~message_type:`WARNING ~buttons ?parent ()
+ ) ()
let report_error ~title ~message ?parent () =
- let callback _ = () in
- let buttons = GWindow.Buttons.ok in
- try
- popup_message
- ~title ~message ~message_type:`ERROR ~callback ~buttons ?parent ()
- with
- | PopupClosed -> ()
-
-
-let ask_text ~(gui:#gui) ?(title = "") ?(message = "") ?(multiline = false)
- ?default ()
-=
- let dialog = gui#newEmptyDialog () in
- dialog#emptyDialog#set_title title;
- dialog#emptyDialogLabel#set_label message;
- let result = ref None in
- let return r =
- result := r;
- dialog#emptyDialog#destroy ();
- GMain.Main.quit ()
- in
- ignore (dialog#emptyDialog#event#connect#delete (fun _ -> true));
- if multiline then begin (* multiline input required: use a TextView widget *)
- let win =
- GBin.scrolled_window ~width:400 ~height:150 ~hpolicy:`NEVER
- ~vpolicy:`ALWAYS ~packing:dialog#emptyDialogVBox#add ()
- in
- let view = GText.view ~wrap_mode:`CHAR ~packing:win#add () in
- let buffer = view#buffer in
- (match default with
- | None -> ()
- | Some text ->
- buffer#set_text text;
- buffer#select_range buffer#start_iter buffer#end_iter);
- view#misc#grab_focus ();
- connect_button dialog#emptyDialogOkButton (fun _ ->
- return (Some (buffer#get_text ())))
- end else begin (* monoline input required: use a TextEntry widget *)
- let entry = GEdit.entry ~packing:dialog#emptyDialogVBox#add () in
- (match default with
- | None -> ()
- | Some text ->
- entry#set_text text;
- entry#select_region ~start:0 ~stop:max_int);
- entry#misc#grab_focus ();
- connect_button dialog#emptyDialogOkButton (fun _ ->
- return (Some entry#text))
- end;
- connect_button dialog#emptyDialogCancelButton (fun _ ->return None);
- dialog#emptyDialog#show ();
- GtkThread.main ();
- (match !result with None -> raise MatitaTypes.Cancel | Some r -> r)
+ let buttons = GWindow.Buttons.ok in
+ popup_message ~title ~message ~message_type:`ERROR ~buttons ?parent ()
let utf8_parsed_text s floc =
let start, stop = HExtlib.loc_of_floc floc in
let matita_lang =
let source_language_manager =
- GSourceView2.source_language_manager ~default:true in
+ GSourceView3.source_language_manager ~default:true in
source_language_manager#set_search_path
(BuildTimeConf.runtime_base_dir ::
source_language_manager#search_path);
class type gui =
object (* minimal gui object requirements *)
method newUriDialog: unit -> MatitaGeneratedGui.uriChoiceDialog
- method newConfirmationDialog: unit -> MatitaGeneratedGui.confirmationDialog
- method newEmptyDialog: unit -> MatitaGeneratedGui.emptyDialog
end
(** {3 Dialogs}
val ask_confirmation:
title:string -> message:string ->
?parent:#GWindow.window_skel ->
- unit ->
- [`YES | `NO | `CANCEL]
-
- (** @param multiline (default: false) if true a TextView widget will be used
- * for prompting the user otherwise a TextEntry widget will be
- * @return the string given by the user *)
-val ask_text:
- gui:#gui ->
- ?title:string -> ?message:string ->
- ?multiline:bool -> ?default:string -> unit ->
- string
+ unit -> [`YES | `NO | `DELETE_EVENT ]
val report_error:
title:string -> message:string ->
val escape_pango_markup: string -> string
-val matita_lang: GSourceView2.source_language
+val matita_lang: GSourceView3.source_language
open MatitaGtkMisc
open MatitaMisc
-exception Found of int
-
let all_disambiguation_passes = ref false
(* this is a shit and should be changed :-{ *)
?(msg = "") ?(nonvars_button = false) ?(hide_uri_entry=false)
?(hide_try=false) ?(ok_label="_Auto") ?(ok_action:[`SELECT|`AUTO] = `AUTO)
?copy_cb ()
- ~id uris
+ ~id:_ uris
=
if (selection_mode <> `SINGLE) &&
(Helm_registry.get_opt_default Helm_registry.get_bool ~default:true "matita.auto_disambiguation")
| uris -> return (Some (List.map NReference.reference_of_string uris)));
connect_button dialog#uriChoiceAbortButton (fun _ -> return None);
dialog#uriChoiceDialog#show ();
+ (* CSC: old Gtk2 code. Use #run instead. Look for similar code handling
+ other dialogs *)
GtkThread.main ();
(match !choices with
| None -> raise MatitaTypes.Cancel
(let loc_row = tree_store#append () in
begin
match lll with
- [passes,envs_and_diffs,_,_] ->
+ [passes,_envs_and_diffs,_,_] ->
tree_store#set ~row:loc_row ~column:id_col
("Error location " ^ string_of_int (!idx1+1) ^
", error message " ^ string_of_int (!idx1+1) ^ ".1" ^
exception UseLibrary;;
let interactive_error_interp ~all_passes
- (source_buffer:GSourceView2.source_buffer) notify_exn offset errorll filename
+ (source_buffer:GSourceView3.source_buffer) notify_exn offset errorll filename
=
(* hook to save a script for each disambiguation error *)
if false then
(MultiPassDisambiguator.DisambiguationError
(offset,[[env,diff,lazy (loffset,Lazy.force msg),significant]]));
| _::_ ->
+ GtkThread.sync (fun _ ->
let dialog = new disambiguationErrors () in
- if all_passes then
- dialog#disambiguationErrorsMoreErrors#misc#set_sensitive false;
+ dialog#toplevel#add_button "Fix this interpretation" `OK;
+ dialog#toplevel#add_button "Close" `DELETE_EVENT;
+ if not all_passes then
+ dialog#toplevel#add_button "More errors" `HELP; (* HELP means MORE *)
let model = new interpErrorModel dialog#treeview choices in
dialog#disambiguationErrors#set_title "Disambiguation error";
dialog#disambiguationErrorsLabel#set_label
(MultiPassDisambiguator.DisambiguationError
(offset,[[env,diff,lazy(loffset,Lazy.force msg),significant]]))
));
- let return _ =
- dialog#disambiguationErrors#destroy ();
- GMain.Main.quit ()
+ (match GtkThread.sync dialog#toplevel#run () with
+ | `OK ->
+ let tree_path =
+ match fst (dialog#treeview#get_cursor ()) with
+ None -> assert false
+ | Some tp -> tp in
+ let idx1,idx2,idx3 = model#get_interp_no tree_path in
+ let diff =
+ match idx2,idx3 with
+ Some idx2, Some idx3 ->
+ let _,lll = List.nth choices idx1 in
+ let _,envs_and_diffs,_,_ = List.nth lll idx2 in
+ let _,_,diff = List.nth envs_and_diffs idx3 in
+ diff
+ | _,_ -> assert false
in
- let fail _ = return () in
- ignore(dialog#disambiguationErrors#event#connect#delete (fun _ -> true));
- connect_button dialog#disambiguationErrorsOkButton
- (fun _ ->
- let tree_path =
- match fst (dialog#treeview#get_cursor ()) with
- None -> assert false
- | Some tp -> tp in
- let idx1,idx2,idx3 = model#get_interp_no tree_path in
- let diff =
- match idx2,idx3 with
- Some idx2, Some idx3 ->
- let _,lll = List.nth choices idx1 in
- let _,envs_and_diffs,_,_ = List.nth lll idx2 in
- let _,_,diff = List.nth envs_and_diffs idx3 in
- diff
- | _,_ -> assert false
- in
- let newtxt =
- String.concat "\n"
- ("" ::
- List.map
- (fun k,desc ->
- let alias =
- match k with
- | DisambiguateTypes.Id id ->
- GrafiteAst.Ident_alias (id, desc)
- | DisambiguateTypes.Symbol (symb, i)->
- GrafiteAst.Symbol_alias (symb, i, desc)
- | DisambiguateTypes.Num i ->
- GrafiteAst.Number_alias (i, desc)
- in
- GrafiteAstPp.pp_alias alias)
- diff) ^ "\n"
- in
- source_buffer#insert
- ~iter:
- (source_buffer#get_iter_at_mark
- (`NAME "beginning_of_statement")) newtxt ;
- return ()
- );
- connect_button dialog#disambiguationErrorsMoreErrors
- (fun _ -> return () ; raise UseLibrary);
- connect_button dialog#disambiguationErrorsCancelButton fail;
- dialog#disambiguationErrors#show ();
- GtkThread.main ()
-
+ let newtxt =
+ String.concat "\n"
+ ("" ::
+ List.map
+ (fun k,desc ->
+ let alias =
+ match k with
+ | DisambiguateTypes.Id id ->
+ GrafiteAst.Ident_alias (id, desc)
+ | DisambiguateTypes.Symbol (symb, i)->
+ GrafiteAst.Symbol_alias (symb, i, desc)
+ | DisambiguateTypes.Num i ->
+ GrafiteAst.Number_alias (i, desc)
+ in
+ GrafiteAstPp.pp_alias alias)
+ diff) ^ "\n"
+ in
+ source_buffer#insert
+ ~iter:
+ (source_buffer#get_iter_at_mark
+ (`NAME "beginning_of_statement")) newtxt
+ | `HELP (* HELP MEANS MORE *) ->
+ dialog#toplevel#destroy () ;
+ raise UseLibrary
+ | `DELETE_EVENT -> ()
+ | _ -> assert false) ;
+ dialog#toplevel#destroy ()
+ ) ()
class gui () =
(* creation order _is_ relevant for windows placement *)
let main = new mainWin () in
let sequents_viewer =
MatitaMathView.sequentsViewer_instance main#sequentsNotebook in
- let fileSel = new fileSelectionWin () in
let findRepl = new findReplWin () in
let keyBindingBoxes = (* event boxes which should receive global key events *)
[ main#mainWinEventBox ]
~website:"http://matita.cs.unibo.it"
()
in
+ ignore(about_dialog#event#connect#delete (fun _ -> true));
ignore(about_dialog#connect#response (fun _ ->about_dialog#misc#hide ()));
connect_menu_item main#contentsMenuItem (fun () ->
if 0 = Sys.command "which gnome-help" then
~callback:(fun _ -> hide_find_Repl ();true));
connect_menu_item main#undoMenuItem
(fun () -> (MatitaScript.current ())#safe_undo);
-(*CSC: XXX
- ignore(source_view#source_buffer#connect#can_undo
- ~callback:main#undoMenuItem#misc#set_sensitive);
-*) main#undoMenuItem#misc#set_sensitive true;
+ main#undoMenuItem#misc#set_sensitive false;
connect_menu_item main#redoMenuItem
(fun () -> (MatitaScript.current ())#safe_redo);
-(*CSC: XXX
- ignore(source_view#source_buffer#connect#can_redo
- ~callback:main#redoMenuItem#misc#set_sensitive);
-*) main#redoMenuItem#misc#set_sensitive true;
+ main#redoMenuItem#misc#set_sensitive false;
connect_menu_item main#editMenu (fun () ->
main#copyMenuItem#misc#set_sensitive
(MatitaScript.current ())#canCopy;
GtkThread.sync (fun () -> ()) ()
in
let worker_thread = ref None in
- let notify_exn (source_view : GSourceView2.source_view) exn =
+ let notify_exn (source_view : GSourceView3.source_view) exn =
let floc, msg = MatitaExcPp.to_string exn in
begin
match floc with
with
exc -> script#source_view#misc#grab_focus (); raise exc in
- (* file selection win *)
- ignore (fileSel#fileSelectionWin#event#connect#delete (fun _ -> true));
- ignore (fileSel#fileSelectionWin#connect#response (fun event ->
- let return r =
- chosen_file <- r;
- fileSel#fileSelectionWin#misc#hide ();
- GMain.Main.quit ()
- in
- match event with
- | `OK ->
- let fname = fileSel#fileSelectionWin#filename in
- if Sys.file_exists fname then
- begin
- if HExtlib.is_regular fname && not (_only_directory) then
- return (Some fname)
- else if _only_directory && HExtlib.is_dir fname then
- return (Some fname)
- end
- else
- begin
- if _ok_not_exists then
- return (Some fname)
- end
- | `CANCEL -> return None
- | `HELP -> ()
- | `DELETE_EVENT -> return None));
(* menus *)
List.iter (fun w -> w#misc#set_sensitive false) [ main#saveMenuItem ];
(* console *)
current_page <- page;
let script = MatitaScript.at_page page in
script#activate;
+ main#undoMenuItem#misc#set_sensitive
+ script#source_view#source_buffer#can_undo ;
+ main#redoMenuItem#misc#set_sensitive
+ script#source_view#source_buffer#can_redo ;
main#saveMenuItem#misc#set_sensitive script#has_name))
method private externalEditor () =
save_moo script#status;
true
| `NO -> true
- | `CANCEL -> false
+ | `DELETE_EVENT -> false
else
(save_moo script#status; true)
console#message ("'"^file^"' loaded.");
self#_enableSaveTo file
- method private _enableSaveTo file =
+ method private _enableSaveTo _file =
self#main#saveMenuItem#misc#set_sensitive true
method private console = console
- method private fileSel = fileSel
method private findRepl = findRepl
method main = main
(fun _ -> callback ();true));
self#addKeyBinding GdkKeysyms._q callback
+ method private chooseFileOrDir ok_not_exists only_directory =
+ let fileSel = GWindow.file_chooser_dialog
+ ~action:`OPEN
+ ~title:"Select file"
+ ~modal:true
+ ~type_hint:`DIALOG
+ ~position:`CENTER
+ () in
+ fileSel#add_select_button_stock `OPEN `OK;
+ fileSel#add_button_stock `CANCEL `CANCEL;
+ ignore (fileSel#set_current_folder(Sys.getcwd ())) ;
+ let res =
+ let rec aux () =
+ match fileSel#run () with
+ | `OK ->
+ (match fileSel#filename with
+ None -> aux ()
+ | Some fname ->
+ if Sys.file_exists fname then
+ begin
+ if HExtlib.is_regular fname && not (only_directory) then
+ Some fname
+ else if only_directory && HExtlib.is_dir fname then
+ Some fname
+ else
+ aux ()
+ end
+ else if ok_not_exists then Some fname else aux ())
+ | `CANCEL -> None
+ | `DELETE_EVENT -> None in
+ aux () in
+ fileSel#destroy () ;
+ res
+
method private chooseFile ?(ok_not_exists = false) () =
- _ok_not_exists <- ok_not_exists;
- _only_directory <- false;
- fileSel#fileSelectionWin#show ();
- GtkThread.main ();
- chosen_file
+ self#chooseFileOrDir ok_not_exists false
method private chooseDir ?(ok_not_exists = false) () =
- _ok_not_exists <- ok_not_exists;
- _only_directory <- true;
- fileSel#fileSelectionWin#show ();
- GtkThread.main ();
(* we should check that this is a directory *)
- chosen_file
+ self#chooseFileOrDir ok_not_exists true
end
let interactive_string_choice
- text prefix_len ?(title = "") ?(msg = "") () ~id locs uris
+ text prefix_len ?(title = "") ?msg:(_ = "") () ~id:_ locs uris
=
+ GtkThread.sync (fun _ ->
let dialog = new uriChoiceDialog () in
dialog#uriEntryHBox#misc#hide ();
dialog#uriChoiceSelectedButton#misc#hide ();
dialog#uriChoiceTreeView#selection#set_mode
(`SINGLE :> Gtk.Tags.selection_mode);
let model = new stringListModel dialog#uriChoiceTreeView in
- let choices = ref None in
+ let choices = ref [] in
dialog#uriChoiceDialog#set_title title;
let hack_len = MatitaGtkMisc.utf8_string_length text in
let rec colorize acc_len = function
in
dialog#uriChoiceLabel#set_label txt;
List.iter model#easy_append uris;
- let return v =
- choices := v;
- dialog#uriChoiceDialog#destroy ();
- GMain.Main.quit ()
- in
- ignore (dialog#uriChoiceDialog#event#connect#delete (fun _ -> true));
connect_button dialog#uriChoiceForwardButton (fun _ ->
match model#easy_selection () with
| [] -> ()
- | uris -> return (Some uris));
- connect_button dialog#uriChoiceAbortButton (fun _ -> return None);
+ | uris -> choices := uris; dialog#toplevel#response `OK);
+ connect_button dialog#uriChoiceAbortButton (fun _ -> dialog#toplevel#response `DELETE_EVENT);
dialog#uriChoiceDialog#show ();
- GtkThread.main ();
- (match !choices with
- | None -> raise MatitaTypes.Cancel
- | Some uris -> uris)
+ let res =
+ match dialog#toplevel#run () with
+ | `DELETE_EVENT -> dialog#toplevel#destroy() ; raise MatitaTypes.Cancel
+ | `OK -> !choices
+ | _ -> assert false in
+ dialog#toplevel#destroy () ;
+ res) ()
let interactive_interp_choice () text prefix_len choices =
(*List.iter (fun l -> prerr_endline "==="; List.iter (fun (_,id,dsc) -> prerr_endline (id ^ " = " ^ dsc)) l) choices;*)
let _ =
(* disambiguator callbacks *)
Disambiguate.set_choose_uris_callback
- (fun ~selection_mode ?ok ?(enable_button_for_non_vars=false) ~title ~msg ->
+ (fun ~selection_mode ?ok ?enable_button_for_non_vars:(_=false) ~title ~msg ->
interactive_uri_choice ~selection_mode ?ok_label:ok ~title ~msg ());
Disambiguate.set_choose_interp_callback (interactive_interp_choice ());
(* gtk initialization *)
- GtkMain.Rc.add_default_file BuildTimeConf.gtkrc_file; (* loads gtk rc *)
- ignore (GMain.Main.init ())
-
+ GtkMain.Rc.add_default_file BuildTimeConf.gtkrc_file (* loads gtk rc *)
--- /dev/null
+ignore (GMain.Main.init ())
open Printf
-open GrafiteTypes
open MatitaGtkMisc
-open MatitaGuiTypes
open CicMathView
module Stack = Continuationals.Stack
GtkSignal.disconnect notebook#as_widget id;
switch_page_callback <- None
| None -> ());
- for i = 0 to pages do notebook#remove_page 0 done;
+ for _i = 0 to pages do notebook#remove_page 0 done;
notebook#set_show_tabs true;
pages <- 0;
page2goal <- [];
scrolledWin <- Some w;
(match cicMathView#misc#parent with
| None -> ()
- | Some parent ->
- let parent =
- match cicMathView#misc#parent with
- None -> assert false
- | Some p -> GContainer.cast_container p
- in
+ | Some p ->
+ let parent = GContainer.cast_container p in
parent#remove cicMathView#coerce);
w#add cicMathView#coerce
in
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));
in
let add_switch _ _ (_, sw) = add_tab (render_switch sw) sw in
Stack.iter (** populate notebook with tabs *)
- ~env:(fun depth tag (pos, sw) ->
+ ~env:(fun depth _tag (pos, sw) ->
let markup =
match depth, pos with
| 0, 0 -> `Current (render_switch sw)
method private render_page:
'status. #ApplyTransformation.status as 'status -> page:int ->
goal_switch:Stack.switch -> unit
- = fun status ~page ~goal_switch ->
+ = fun status ~page:_ ~goal_switch ->
(match goal_switch with
| Stack.Open goal ->
let menv,subst = _metasenv in
cicMathView#nload_sequent status menv subst goal
- | Stack.Closed goal ->
+ | Stack.Closed _goal ->
let root = Lazy.force closed_goal_mathml in
cicMathView#load_root ~root);
(try
let dir_RE = Pcre.regexp "^cic:((/([^/]+/)*[^/]+(/)?)|/|)$" in
let is_uri txt = Pcre.pmatch ~rex:uri_RE txt in
let is_dir txt = Pcre.pmatch ~rex:dir_RE txt in
- let gui = MatitaMisc.get_gui () in
+ let _gui = MatitaMisc.get_gui () in
let win = new MatitaGeneratedGui.browserWin () in
let _ = win#browserUri#misc#grab_focus () in
let gviz = LablGraphviz.graphviz ~packing:win#graphScrolledWin#add () in
let searchText =
- GSourceView2.source_view ~auto_indent:false ~editable:false ()
+ GSourceView3.source_view ~auto_indent:false ~editable:false ()
in
let _ =
win#scrolledwinContent#add (searchText :> GObj.widget);
close_out oc;
if tred then
gviz#load_graph_from_file
- ~gviz_cmd:"dot -Txdot | tred |gvpack -gv | dot" filename
+ (* gvpack can no longer read the output of -Txdot :-( *)
+ (*~gviz_cmd:"dot -Txdot | tred |gvpack -gv | dot" filename*)
+ ~gviz_cmd:"dot -Txdot | tred | dot" filename
else
gviz#load_graph_from_file
- ~gviz_cmd:"dot -Txdot | gvpack -gv | dot" filename;
+ (* gvpack can no longer read the output of -Txdot :-( *)
+ (*~gviz_cmd:"dot -Txdot | gvpack -gv | dot" filename;*)
+ ~gviz_cmd:"dot -Txdot | dot" filename;
HExtlib.safe_remove filename
in
object (self)
self#_showMath;
mathView#load_root (Lazy.force empty_mathml)
- method private _loadCheck term =
+ method private _loadCheck _term =
failwith "not implemented _loadCheck";
(* self#_showMath *)
method private redraw_gviz ?center_on () =
if Sys.command "which dot" = 0 then
let tmpfile, oc = Filename.open_temp_file "matita" ".dot" in
- let fmt = Format.formatter_of_out_channel oc in
- (* MATITA 1.0 MetadataDeps.DepGraph.render fmt gviz_graph;*)
+ (* MATITA 1.0 let fmt = Format.formatter_of_out_channel oc in
+ MetadataDeps.DepGraph.render fmt gviz_graph;*)
close_out oc;
gviz#load_graph_from_file ~gviz_cmd:"tred | dot" tmpfile;
(match center_on with
"the graph of dependencies amoung objects. Please install it.")
~parent:win#toplevel ()
- method private dependencies direction uri () =
+ method private dependencies _direction _uri () =
assert false (* MATITA 1.0
let dbd = LibraryDb.instance () in
let graph =
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
| mv :: tl ->
(match mv#get_selections with
| [] -> aux tl
- | sel :: _ -> mv)
+ | _sel :: _ -> mv)
in
aux (get_math_views ())
let absolute_path file =
if file.[0] = '/' then file else Unix.getcwd () ^ "/" ^ file
-let is_proof_script fname = true (** TODO Zack *)
-let is_proof_object fname = true (** TODO Zack *)
+let is_proof_script _fname = true (** TODO Zack *)
+let is_proof_object _fname = true (** TODO Zack *)
let append_phrase_sep s =
if not (Pcre.pmatch ~pat:(sprintf "%s$" BuildTimeConf.phrase_sep) s) then
let size = size + 1 in
let decr x = let x' = x - 1 in if x' < 0 then size + x' else x' in
let incr x = (x + 1) mod size in
- object (self)
- val data = Array.create size ""
+ object
+ val data = Array.make size ""
inherit basic_history (0, -1 , -1)
class ['a] browser_history ?memento size init =
object (self)
initializer match memento with Some m -> self#load m | _ -> ()
- val data = Array.create size init
+ val data = Array.make size init
inherit basic_history (0, 0, 0)
let rec aux =
function
| [] -> raise Not_found
- | hd :: tl as l when equality hd e -> l
- | hd :: tl -> aux tl
+ | hd :: _ as l when equality hd e -> l
+ | _ :: tl -> aux tl
in
aux l
(* $Id$ *)
open Printf
-open GrafiteTypes
module TA = GrafiteAst
(fun (acc, to_prepend) (status,alias) ->
match alias with
| None -> (status,to_prepend ^ nonskipped_txt)::acc,""
- | Some (k,value) ->
+ | Some (_k,value) ->
let newtxt = GrafiteAstPp.pp_alias value in
(status,to_prepend ^ newtxt ^ "\n")::acc, "")
([],skipped_txt) enriched_history_fragment
let pp_eager_statement_ast = GrafiteAstPp.pp_statement
-let eval_nmacro include_paths (buffer : GText.buffer) status unparsed_text parsed_text script mac =
+let eval_nmacro _include_paths (_buffer : GText.buffer) status _unparsed_text parsed_text script mac =
let parsed_text_length = String.length parsed_text in
match mac with
| TA.Screenshot (_,name) ->
in
match st with
| GrafiteAst.Executable (loc, ex) ->
- let _, nonskipped, skipped, parsed_text_length = text_of_loc loc in
+ let _, nonskipped, skipped, _parsed_text_length = text_of_loc loc in
eval_executable include_paths buffer status unparsed_text
skipped nonskipped script ex loc
| GrafiteAst.Comment (loc, GrafiteAst.Code (_, ex))
when Helm_registry.get_bool "matita.execcomments" ->
- let _, nonskipped, skipped, parsed_text_length = text_of_loc loc in
+ let _, nonskipped, skipped, _parsed_text_length = text_of_loc loc in
eval_executable include_paths buffer status unparsed_text
skipped nonskipped script ex loc
| GrafiteAst.Comment (loc, _) ->
*)
class script ~(parent:GBin.scrolled_window) ~tab_label () =
let source_view =
- GSourceView2.source_view
+ GSourceView3.source_view
~auto_indent:true
~insert_spaces_instead_of_tabs:true ~tab_width:2
~right_margin_position:80 ~show_right_margin:true
() in
let buffer = source_view#buffer in
let source_buffer = source_view#source_buffer in
+let _ =
+ source_buffer#connect#notify_can_undo
+ ~callback:(MatitaMisc.get_gui ())#main#undoMenuItem#misc#set_sensitive in
+let _ =
+ source_buffer#connect#notify_can_redo
+ ~callback:(MatitaMisc.get_gui ())#main#redoMenuItem#misc#set_sensitive in
let similarsymbols_tag_name = "similarsymbolos" in
let similarsymbols_tag = `NAME similarsymbols_tag_name in
let initial_statuses current baseuri =
let status = new MatitaEngine.status baseuri in
(match current with
- Some current -> NCicLibrary.time_travel status;
+ Some _current -> NCicLibrary.time_travel status;
(*
(* MATITA 1.0: there is a known bug in invalidation; temporary fix here *)
NCicEnvironment.invalidate () *)
false
));
ignore(source_view#event#connect#button_release
- ~callback:(fun button -> clean_locked := false; false));
+ ~callback:(fun _button -> clean_locked := false; false));
ignore(source_view#buffer#connect#after#apply_tag
~callback:(
fun tag ~start:_ ~stop:_ ->
let menuItems = menu#children in
let undoMenuItem, redoMenuItem =
match menuItems with
- [undo;redo;sep1;cut;copy;paste;delete;sep2;
- selectall;sep3;inputmethod;insertunicodecharacter] ->
+ [undo;redo;_sep1;cut;copy;paste;delete;_sep2;
+ _selectall;_sep3;_inputmethod;_insertunicodecharacter] ->
List.iter menu#remove [ copy; cut; delete; paste ];
undo,redo
| _ -> assert false in
let add_menu_item =
let i = ref 2 in (* last occupied position *)
- fun ?label ?stock () ->
+ fun ~label ->
incr i;
- GMenu.image_menu_item ?label ?stock ~packing:(menu#insert ~pos:!i)
- ()
- in
- let copy = add_menu_item ~stock:`COPY () in
- let cut = add_menu_item ~stock:`CUT () in
- let delete = add_menu_item ~stock:`DELETE () in
- let paste = add_menu_item ~stock:`PASTE () in
- let paste_pattern = add_menu_item ~label:"Paste as pattern" () in
+ GMenu.menu_item ~label ~packing:(menu#insert ~pos:!i) () in
+ let copy = add_menu_item ~label:"Copy" in
+ let cut = add_menu_item ~label:"Cut" in
+ let delete = add_menu_item ~label:"Delete" in
+ let paste = add_menu_item ~label:"Paste" in
+ let paste_pattern = add_menu_item ~label:"Paste as pattern" in
copy#misc#set_sensitive self#canCopy;
cut#misc#set_sensitive self#canCut;
delete#misc#set_sensitive self#canDelete;
MatitaGtkMisc.connect_menu_item paste self#paste;
MatitaGtkMisc.connect_menu_item paste_pattern self#pastePattern;
let new_undoMenuItem =
- GMenu.image_menu_item
- ~image:(GMisc.image ~stock:`UNDO ())
+ GMenu.menu_item
~use_mnemonic:true
~label:"_Undo"
~packing:(menu#insert ~pos:0) () in
new_undoMenuItem#misc#set_sensitive
- (undoMenuItem#misc#get_flag `SENSITIVE);
+ undoMenuItem#misc#sensitive;
menu#remove (undoMenuItem :> GMenu.menu_item);
MatitaGtkMisc.connect_menu_item new_undoMenuItem
(fun () -> self#safe_undo);
let new_redoMenuItem =
- GMenu.image_menu_item
- ~image:(GMisc.image ~stock:`REDO ())
+ GMenu.menu_item
~use_mnemonic:true
~label:"_Redo"
~packing:(menu#insert ~pos:1) () in
new_redoMenuItem#misc#set_sensitive
- (redoMenuItem#misc#get_flag `SENSITIVE);
+ redoMenuItem#misc#sensitive;
menu#remove (redoMenuItem :> GMenu.menu_item);
MatitaGtkMisc.connect_menu_item new_redoMenuItem
(fun () -> self#safe_redo)));
(** misc *)
method clean_dirty_lock: unit
method set_star: bool -> unit
- method source_view: GSourceView2.source_view
+ method source_view: GSourceView3.source_view
method has_parent: GObj.widget -> bool
(* debug *)
(* $Id$ *)
-open Printf
-open GrafiteTypes
-
(** user hit the cancel button *)
exception Cancel
["+"; "⨭"; "⨮"; "⨁"; "⊕"; "⊞"; ];
["-"; "÷"; "⊢"; "⊩"; "⧟"; "⊟"; ];
["="; "≝"; "≡"; "≘"; "≗"; "≐"; "≑"; "≛"; "≚"; "≙"; "⌆"; "⧦"; "⊜"; "≋"; "⩳"; "≅"; "⩬"; "≂"; "≃"; "≈"; ];
- ["→"; "↦"; "⇝"; "⤞"; "⇾"; "⤍"; "⤏"; "⤳"; ] ;
- ["⇒"; "⤇"; "➾"; "⇨"; "➡"; "⬈"; "➤"; "➸"; "⇉"; "⥰"; ] ;
+ ["â\86\92"; "⥲"; "â\86¦"; "â\87\9d"; "â¤\9e"; "â\87¾"; "â¤\8d"; "â¤\8f"; "⤳"; ] ;
+ ["â\87\92"; "â¤\87"; "â\9e¾"; "â\87¨"; "â¬\80"; "â\9e¡"; "â¬\88"; "â\9e¤"; "â\9e¸"; "â\87\89"; "⥰"; ] ;
["^"; "↑"; "⇡"; ] ;
["⇑"; "⇧"; "⬆"; ] ;
- ["⇓"; "⇩"; "⬇"; "⬊"; "➷"; ] ;
+ ["â\87\93"; "â\87©"; "â¬\82"; "â¬\87"; "â¬\8a"; "â\9e·"; ] ;
["⇕"; "⇳"; "⬍"; "↕"; ];
["↔"; "⇔"; "⬄"; "⬌"; ] ;
["≤"; "≲"; "≼"; "≰"; "≴"; "⋠"; "⊆"; "⫃"; "⊑"; ] ;
["Y"; "ϒ"; "𝕐"; "𝐘"; "𝚼"; "Ⓨ"; ] ;
["z"; "ζ"; "𝕫"; "𝐳"; "𝛇"; "ⓩ"; ] ;
["Z"; "ℨ"; "ℤ"; "𝐙"; "Ⓩ"; ] ;
- ["0"; "𝟘"; "⓪"; ] ;
- ["1"; "𝟙"; "①"; "⓵"; ] ;
- ["2"; "𝟚"; "②"; "⓶"; ] ;
- ["3"; "𝟛"; "③"; "⓷"; ] ;
- ["4"; "𝟜"; "④"; "⓸"; ] ;
- ["5"; "𝟝"; "⑤"; "⓹"; ] ;
- ["6"; "𝟞"; "⑥"; "⓺"; ] ;
- ["7"; "𝟟"; "⑦"; "⓻"; ] ;
- ["8"; "𝟠"; "⑧"; "⓼"; "∞"; ] ;
- ["9"; "𝟡"; "⑨"; "⓽"; ] ;
+ ["0"; "𝟘"; "⓪"; "𝟎"; ] ;
+ ["1"; "𝟙"; "①"; "⓵"; "𝟏"; ] ;
+ ["2"; "𝟚"; "②"; "⓶"; "𝟐"; ] ;
+ ["3"; "𝟛"; "③"; "⓷"; "𝟑"; ] ;
+ ["4"; "𝟜"; "④"; "⓸"; "𝟒"; ] ;
+ ["5"; "𝟝"; "⑤"; "⓹"; "𝟓"; ] ;
+ ["6"; "𝟞"; "⑥"; "⓺"; "𝟔"; ] ;
+ ["7"; "𝟟"; "⑦"; "⓻"; "𝟕"; ] ;
+ ["8"; "𝟠"; "⑧"; "⓼"; "𝟖"; "∞"; ] ;
+ ["9"; "𝟡"; "⑨"; "⓽"; "𝟗"; ] ;
]
;;
let get_all_eqclass () =
let rc = ref [] in
Hashtbl.iter
- (fun k v ->
+ (fun _k v ->
if not (List.mem v !rc) then
rc := v :: !rc)
classes;