Built with Alectryon, running Coq+SerAPI v8.16.0+0.16.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
From Tealeaves.Theory Require Export
DecoratedTraversableMonad.From Tealeaves.Backends.Common Require Export
Names AtomSet AssocList.From Tealeaves.Backends.LN Require Export
LN Simplification.From Tealeaves.Simplification Require Export
Simplification.Import DecoratedTraversableMonad.UsefulInstances.Import Classes.Kleisli.Theory.DecoratedTraversableMonad.ModuleNotations.Export Categorical.Applicative.Notations. (* <⋆> *)Export Kleisli.Comonad.Notations.(* Export Kleisli.DecoratedFunctor.Notations. *)Export Kleisli.DecoratedMonad.Notations.Export Kleisli.TraversableFunctor.Notations.Export Kleisli.TraversableMonad.Notations.Export Kleisli.DecoratedTraversableFunctor.Notations.Export Kleisli.DecoratedTraversableMonad.Notations.Export Kleisli.DecoratedContainerFunctor.Notations. (* ∈d *)(* Export Kleisli.DecoratedContainerMonad.Notations. *)Export Categorical.ContainerFunctor.Notations. (* ∈ *)Export Product.Notations. (* × *)Export Monoid.Notations. (* Ƶ and ● *)Export Subset.Notations. (* ∪ *)Export List.ListNotations. (* [] :: *)(* Export LN.OpNotations. (* operations *) *)Export Common.AtomSet.Notations.Export Common.AssocList.Notations. (* one, ~ *)EndNotations.Module TypeSyntaxSIGHetero.Parameter (itermoterm : Type).Parameter (TU : Type -> Type).Parameterret_inst: Return T.Parameterbinddt_T_inst: Binddt nat T T.Parameterbinddt_U_inst: Binddt nat T U.Parametermodule_inst:
DecoratedTraversableRightModule nat T U
(Return_inst := ret_inst)
(Bindd_T_inst := binddt_T_inst)
(Bindd_U_inst := binddt_U_inst)
(unit := Monoid_unit_zero)
(op := Monoid_op_plus).Parameterto_T: iterm -> T LN.Parameterto_T_inv: T LN -> iterm.Parameterto_U: oterm -> U LN.Parameterto_U_inv: U LN -> oterm.Parameterto_T_iso : forall (t : iterm), to_T_inv (to_T t) = t.Parameterto_U_iso : forall (t : oterm), to_U_inv (to_U t) = t.Parameterto_T_iso_inv : forall (t : T LN), to_T (to_T_inv t) = t.Parameterto_U_iso_inv : forall (t : U LN), to_U (to_U_inv t) = t.Parameterfrom_atom: atom -> iterm.Parameterfrom_ix: nat -> iterm.Parameterfrom_atom_Ret:
from_atom = to_T_inv ○ @ret T ret_inst LN ○ Fr.Parameterfrom_ix_Ret:
from_ix = to_T_inv ○ @ret T ret_inst LN ○ Bd.EndSyntaxSIGHetero.Module TypeTheorySIG.Parametersitermoterm : Type.Parameters
(open : iterm -> oterm -> oterm)
(close : atom -> oterm -> oterm)
(subst : atom -> iterm -> oterm -> oterm)
(LCb : oterm -> bool).EndTheorySIG.ModuleMakeTheory_Hetero
(Syntax: SyntaxSIGHetero) <: TheorySIG.Import Syntax.Definitioniterm := Syntax.iterm.Definitionoterm := Syntax.oterm.Import DecoratedTraversableMonad.UsefulInstances.#[local] Existing InstanceSyntax.ret_inst.#[local] Existing InstanceSyntax.binddt_T_inst.#[local] Existing InstanceSyntax.binddt_U_inst.#[local] Existing InstanceSyntax.module_inst.#[local] Existing InstanceMap_Binddt.#[local] Existing InstanceMapd_Binddt.#[local] Existing InstanceTraverse_Binddt.#[local] Existing InstanceMapdt_Binddt.#[local] Existing InstanceBind_Binddt.#[local] Existing InstanceBindt_Binddt.#[local] Existing InstanceBindd_Binddt.#[local] Existing InstanceToBatch_Traverse.#[local] Existing InstanceToSubset_Traverse.Import AtomSet.Notations.Coercionto_T : Syntax.iterm >-> T.Coercionto_U : Syntax.oterm >-> U.Definitionopen : iterm -> oterm -> oterm :=
funtu => to_U_inv (open (T := T) (U := U) t u).Definitionclose : atom -> oterm -> oterm :=
funxu => to_U_inv (close (U := U) x u).Definitionsubst : atom -> iterm -> oterm -> oterm :=
funxtu => to_U_inv (subst (T := T) (U := U) x t u).Definitionfree : oterm -> list atom :=
funu => free (U := U) u.DefinitionFV : oterm -> AtomSet.t :=
funu => FV (U := U) u.DefinitionLC : oterm -> Prop :=
funu => LC (U := U) u.DefinitionLCb : oterm -> bool :=
funu => LCb (U := U) u.Definitionscoped : oterm -> AtomSet.t -> Prop :=
funtγ => FV t ⊆ γ.Definitionsubst_i : atom -> iterm -> iterm -> iterm :=
funxtu => to_T_inv (LN.subst (T := T) (U := T) x t u).DefinitionFV_i : iterm -> AtomSet.t :=
funt => LN.FV (U := T) t.DefinitionLC_i : iterm -> Prop :=
funu => LN.LC (U := T) u.ModuleNotations.Notation"t '{ x ~> u }" := (subst x u t) (at level35).Notation"t '( u )" := (open u t) (at level35).Notation"'[ x ] t" := (close x t) (at level35).EndNotations.Import Notations.Coercionfrom_atom : atom >-> Syntax.iterm.Coercionfrom_ix : nat >-> Syntax.iterm.Implicit Types (xy: atom) (t: iterm) (u: oterm).
foralltu, LC u -> u '( t) = u
foralltu, LC u -> u '( t) = u
t: iterm u: oterm H: LC u
u '( t) = u
t: iterm u: oterm H: LC u
u '( t) = u
t: iterm u: oterm H: LC u
to_U_inv (LN.open t u) = u
t: iterm u: oterm H: LC u
to_U_inv u = u
t: iterm u: oterm H: LC u
LN.LC u
t: iterm u: oterm H: LC u
to_U_inv u = u
apply to_U_iso.
t: iterm u: oterm H: LC u
LN.LC u
assumption.Qed.
forallxtu,
FV (u '{ x ~> t}) ⊆ FV u \\ {{x}} ∪ FV_i t
forallxtu,
FV (u '{ x ~> t}) ⊆ FV u \\ {{x}} ∪ FV_i t
x: atom t: iterm u: oterm
FV (u '{ x ~> t}) ⊆ FV u \\ {{x}} ∪ FV_i t
x: atom t: iterm u: oterm
LN.FV (to_U_inv (LN.subst x t u))
⊆ LN.FV u \\ {{x}} ∪ LN.FV t
x: atom t: iterm u: oterm
LN.FV (LN.subst x t u) ⊆ LN.FV u \\ {{x}} ∪ LN.FV t
x: atom t: iterm u: oterm
LN.FV u \\ {{x}} ∪ LN.FV t
⊆ LN.FV u \\ {{x}} ∪ LN.FV t
reflexivity.Qed.
foralltux, FV u \\ {{x}} ⊆ FV (u '{ x ~> t})
foralltux, FV u \\ {{x}} ⊆ FV (u '{ x ~> t})
t: iterm u: oterm x: atom
FV u \\ {{x}} ⊆ FV (u '{ x ~> t})
t: iterm u: oterm x: atom
LN.FV u \\ {{x}} ⊆ LN.FV (to_U_inv (LN.subst x t u))
t: iterm u: oterm x: atom
LN.FV u \\ {{x}} ⊆ LN.FV (LN.subst x t u)
apply FV_subst_lower.Qed.
forallxu, x `notin` FV u -> '[ x] (u '( x)) = u
forallxu, x `notin` FV u -> '[ x] (u '( x)) = u
x: atom u: oterm H: x `notin` FV u
'[ x] (u '( x)) = u
x: atom u: oterm H: x `notin` FV u
to_U_inv (LN.close x (to_U_inv (LN.open x u))) = u
x: atom u: oterm H: x `notin` FV u
to_U_inv
(LN.close x
(to_U_inv (LN.open (to_T_inv (ret (Fr x))) u))) =
u
x: atom u: oterm H: x `notin` FV u
to_U_inv
(LN.close x (LN.open (to_T_inv (ret (Fr x))) u)) = u
x: atom u: oterm H: x `notin` FV u
to_U_inv (LN.close x (LN.open (ret (Fr x)) u)) = u
x: atom u: oterm H: x `notin` FV u
to_U_inv u = u
x: atom u: oterm H: x `notin` FV u
~ element_of x (LN.free u)
x: atom u: oterm H: x `notin` FV u
to_U_inv u = u
x: atom u: oterm H: x `notin` FV u
u = u
reflexivity.
x: atom u: oterm H: x `notin` FV u
~ element_of x (LN.free u)
x: atom u: oterm H: x `notin` FV u
x `notin` LN.FV u
assumption.Qed.
forallxu, ('[ x] u) '( x) = u
forallxu, ('[ x] u) '( x) = u
x: atom u: oterm
('[ x] u) '( x) = u
x: atom u: oterm
to_U_inv (LN.open x (to_U_inv (LN.close x u))) = u
x: atom u: oterm
to_U_inv
(LN.open (to_T_inv (ret (Fr x)))
(to_U_inv (LN.close x u))) = u
x: atom u: oterm
to_U_inv
(LN.open (to_T_inv (ret (Fr x))) (LN.close x u)) = u
x: atom u: oterm
to_U_inv (LN.open (ret (Fr x)) (LN.close x u)) = u
x: atom u: oterm
to_U_inv u = u
x: atom u: oterm
u = u
reflexivity.Qed.
forallutxy,
x <> y ->
LC_i t -> (u '( y)) '{ x ~> t} = (u '{ x ~> t}) '( y)
forallutxy,
x <> y ->
LC_i t -> (u '( y)) '{ x ~> t} = (u '{ x ~> t}) '( y)
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
(u '( y)) '{ x ~> t} = (u '{ x ~> t}) '( y)
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
to_U_inv (LN.subst x t (to_U_inv (LN.open y u))) =
to_U_inv (LN.open y (to_U_inv (LN.subst x t u)))
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
to_U_inv (LN.subst x t (LN.open y u)) =
to_U_inv (LN.open y (to_U_inv (LN.subst x t u)))
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
to_U_inv (LN.subst x t (LN.open y u)) =
to_U_inv (LN.open y (LN.subst x t u))
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
to_U_inv
(LN.subst x t (LN.open (to_T_inv (ret (Fr y))) u)) =
to_U_inv
(LN.open (to_T_inv (ret (Fr y))) (LN.subst x t u))
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
to_U_inv (LN.subst x t (LN.open (ret (Fr y)) u)) =
to_U_inv (LN.open (ret (Fr y)) (LN.subst x t u))
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
to_U_inv (LN.open (ret (Fr y)) (LN.subst x t u)) =
to_U_inv (LN.open (ret (Fr y)) (LN.subst x t u))
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
x <> y
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
LN.LC t
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
to_U_inv (LN.open (ret (Fr y)) (LN.subst x t u)) =
to_U_inv (LN.open (ret (Fr y)) (LN.subst x t u))
reflexivity.
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
x <> y
assumption.
u: oterm t: iterm x, y: atom H: x <> y H0: LC_i t
LN.LC t
assumption.Qed.
forallutx,
x `notin` FV u -> u '( t) = (u '( x)) '{ x ~> t}
forallutx,
x `notin` FV u -> u '( t) = (u '( x)) '{ x ~> t}
u: oterm t: iterm x: atom H: x `notin` FV u
u '( t) = (u '( x)) '{ x ~> t}
u: oterm t: iterm x: atom H: x `notin` FV u
to_U_inv (LN.open t u) =
to_U_inv (LN.subst x t (to_U_inv (LN.open x u)))
u: oterm t: iterm x: atom H: x `notin` FV u
to_U_inv (LN.open t u) =
to_U_inv (LN.subst x t (LN.open x u))
u: oterm t: iterm x: atom H: x `notin` FV u
to_U_inv (LN.subst?x t (LN.open (ret (Fr ?x)) u)) =
to_U_inv (LN.subst x t (LN.open x u))
u: oterm t: iterm x: atom H: x `notin` FV u
?x `notin` LN.FV u
u: oterm t: iterm x: atom H: x `notin` FV u
to_U_inv (LN.subst?x t (LN.open (ret (Fr ?x)) u)) =
to_U_inv (LN.subst x t (LN.open x u))
u: oterm t: iterm x: atom H: x `notin` FV u
to_U_inv (LN.subst?x t (LN.open (ret (Fr ?x)) u)) =
to_U_inv
(LN.subst x t (LN.open (to_T_inv (ret (Fr x))) u))
u: oterm t: iterm x: atom H: x `notin` FV u
to_U_inv (LN.subst?x t (LN.open (ret (Fr ?x)) u)) =
to_U_inv (LN.subst x t (LN.open (ret (Fr x)) u))
reflexivity.
u: oterm t: iterm x: atom H: x `notin` FV u
x `notin` LN.FV u
assumption.Qed.
forallt1t2ux,
LC_i t2 ->
(u '( t1)) '{ x ~> t2} =
(u '{ x ~> t2}) '( subst_i x t2 t1)
forallt1t2ux,
LC_i t2 ->
(u '( t1)) '{ x ~> t2} =
(u '{ x ~> t2}) '( subst_i x t2 t1)
t1, t2: iterm u: oterm x: atom H: LC_i t2
(u '( t1)) '{ x ~> t2} =
(u '{ x ~> t2}) '( subst_i x t2 t1)
t1, t2: iterm u: oterm x: atom H: LC_i t2
to_U_inv (LN.subst x t2 (to_U_inv (LN.open t1 u))) =
to_U_inv
(LN.open (to_T_inv (LN.subst x t2 t1))
(to_U_inv (LN.subst x t2 u)))
t1, t2: iterm u: oterm x: atom H: LC_i t2
to_U_inv (LN.subst x t2 (LN.open t1 u)) =
to_U_inv
(LN.open (to_T_inv (LN.subst x t2 t1))
(to_U_inv (LN.subst x t2 u)))
t1, t2: iterm u: oterm x: atom H: LC_i t2
to_U_inv
(LN.open (LN.subst x t2 t1) (LN.subst x t2 u)) =
to_U_inv
(LN.open (to_T_inv (LN.subst x t2 t1))
(to_U_inv (LN.subst x t2 u)))
t1, t2: iterm u: oterm x: atom H: LC_i t2
LN.LC t2
t1, t2: iterm u: oterm x: atom H: LC_i t2
to_U_inv
(LN.open (LN.subst x t2 t1) (LN.subst x t2 u)) =
to_U_inv
(LN.open (to_T_inv (LN.subst x t2 t1))
(to_U_inv (LN.subst x t2 u)))
t1, t2: iterm u: oterm x: atom H: LC_i t2
to_U_inv
(LN.open (LN.subst x t2 t1) (LN.subst x t2 u)) =
to_U_inv
(LN.open (to_T_inv (LN.subst x t2 t1))
(LN.subst x t2 u))
t1, t2: iterm u: oterm x: atom H: LC_i t2
to_U_inv
(LN.open (LN.subst x t2 t1) (LN.subst x t2 u)) =
to_U_inv
(LN.open (LN.subst x t2 t1) (LN.subst x t2 u))
reflexivity.
t1, t2: iterm u: oterm x: atom H: LC_i t2
LN.LC t2
assumption.Qed.
forallut, FV (u '( t)) ⊆ FV u ∪ FV_i t
forallut, FV (u '( t)) ⊆ FV u ∪ FV_i t
u: oterm t: iterm
FV (u '( t)) ⊆ FV u ∪ FV_i t
u: oterm t: iterm
LN.FV (to_U_inv (LN.open t u)) ⊆ LN.FV u ∪ FV_i t
u: oterm t: iterm
LN.FV (LN.open t u) ⊆ LN.FV u ∪ FV_i t
u: oterm t: iterm
LN.FV u ∪ LN.FV t ⊆ LN.FV u ∪ FV_i t
reflexivity.Qed.
foralltu, FV u ⊆ FV (u '( t))
foralltu, FV u ⊆ FV (u '( t))
t: iterm u: oterm
FV u ⊆ FV (u '( t))
t: iterm u: oterm
LN.FV u ⊆ LN.FV (to_U_inv (LN.open t u))
t: iterm u: oterm
LN.FV u ⊆ LN.FV (LN.open t u)
t: iterm u: oterm
LN.FV (LN.open ?Goal0 u) ⊆ LN.FV (LN.open t u)
reflexivity.Qed.
forallux, FV ('[ x] u) [=] FV u \\ {{x}}
forallux, FV ('[ x] u) [=] FV u \\ {{x}}
u: oterm x: atom
FV ('[ x] u) [=] FV u \\ {{x}}
u: oterm x: atom
LN.FV (to_U_inv (LN.close x u)) [=] LN.FV u \\ {{x}}
u: oterm x: atom
LN.FV (LN.close x u) [=] LN.FV u \\ {{x}}
u: oterm x: atom
LN.FV u \\ {{x}} [=] LN.FV u \\ {{x}}
reflexivity.Qed.
forallux, x `notin` FV ('[ x] u)
forallux, x `notin` FV ('[ x] u)
u: oterm x: atom
x `notin` FV ('[ x] u)
u: oterm x: atom
x `notin` LN.FV (to_U_inv (LN.close x u))
u: oterm x: atom
x `notin` LN.FV (LN.close x u)
apply nin_FV_close.Qed.
foralluxy,
y <> x -> y `in` FV ('[ x] u) <-> y `in` FV u
foralluxy,
y <> x -> y `in` FV ('[ x] u) <-> y `in` FV u
u: oterm x, y: atom H: y <> x
y `in` FV ('[ x] u) <-> y `in` FV u
u: oterm x, y: atom H: y <> x
y `in` LN.FV (to_U_inv (LN.close x u)) <->
y `in` LN.FV u
u: oterm x, y: atom H: y <> x
y `in` LN.FV (LN.close x u) <-> y `in` LN.FV u
u: oterm x, y: atom H: y <> x
element_of y (LN.free (LN.close x u)) <->
y `in` LN.FV u
u: oterm x, y: atom H: y <> x
element_of y (LN.free u) /\ x <> y <-> y `in` LN.FV u
u: oterm x, y: atom H: y <> x
element_of y (LN.free u) /\ x <> y <->
element_of y (LN.free u)