add(named): congruence of the C equivalence and the R rule with capture avoidance (M5 named rules)

This commit is contained in:
milner committed 2026-09-22 23:04:00 +02:00
1 parent 728ed42efc
commit 0e1a6659b4
5 files changed
+840 -688

No files matched your search

+7
View File
@@ -49,6 +49,9 @@ digraph theorem_deps {
mred_B_intro [label="mred_B_intro", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="mred_B_intro theory/Metaterm.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
mred_gc_intro [label="mred_gc_intro", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="mred_gc_intro theory/Metaterm.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
mred_r_intro [label="mred_r_intro", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="mred_r_intro theory/Metaterm.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
Plus_mred_of_Plus_red1 [label="Plus_mred_of_Plus_red1", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="Plus_mred_of_Plus_red1 theory/Metaterm.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
mred_full_comp_pure [label="mred_full_comp_pure", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="mred_full_comp_pure theory/Metaterm.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
mred_plus_one [label="mred_plus_one", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="mred_plus_one theory/Metaterm.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
Plus_red1_context [label="Plus_red1_context", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="Plus_red1_context theory/Metatheory.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
occurs_count_zero [label="occurs_count_zero", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="occurs_count_zero theory/Metatheory.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
occurs_count_false [label="occurs_count_false", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="occurs_count_false theory/Metatheory.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
@@ -70,6 +73,8 @@ digraph theorem_deps {
isubst_meta_in [label="isubst_meta_in", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="isubst_meta_in theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
isubst_meta_notin [label="isubst_meta_notin", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="isubst_meta_notin theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
eqC_in_Es [label="eqC_in_Es", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="eqC_in_Es theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
Es_ctx_any [label="Es_ctx_any", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="Es_ctx_any theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
nred_R_intro [label="nred_R_intro", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="nred_R_intro theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
Es_refl_any [label="Es_refl_any", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="Es_refl_any theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
Es_sym_any [label="Es_sym_any", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="Es_sym_any theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
Es_trans_any [label="Es_trans_any", color="#38761d", fillcolor="#d9ead3", style="filled", fontcolor="#222222", tooltip="Es_trans_any theory/NamedMeta.v https://arxiv.org/html/2312.13270v1", shape=ellipse];
@@ -155,6 +160,8 @@ digraph theorem_deps {
mfvs_lift_m -> mfvs_open_m;
of_trm_plug -> mred_term_context;
of_trm_moccurs -> of_trm_moccurs0;
Plus_mred_of_Plus_red1 -> mred_full_comp_pure;
lemma_2_2_full_comp -> mred_full_comp_pure;
occurs_count_zero -> occurs_count_pos;
occurs_count_false -> occurs_count_zfill_plug;
occurs_lift_self -> occurs_count_zfill_plug;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 KiB

After

Width:  |  Height:  |  Size: 608 KiB

+744 -687
View File
File diff suppressed because it is too large. Load diff

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 93 KiB

+53
View File
@@ -467,6 +467,39 @@
"file": "theory/Metaterm.v",
"depends": []
},
{
"id": "Plus_mred_of_Plus_red1",
"label": "Plus_mred_of_Plus_red1",
"kind": "infra",
"status": "proved",
"milestone": "M0",
"section": "",
"file": "theory/Metaterm.v",
"depends": []
},
{
"id": "mred_full_comp_pure",
"label": "mred_full_comp_pure",
"kind": "infra",
"status": "proved",
"milestone": "M0",
"section": "",
"file": "theory/Metaterm.v",
"depends": [
"Plus_mred_of_Plus_red1",
"lemma_2_2_full_comp"
]
},
{
"id": "mred_plus_one",
"label": "mred_plus_one",
"kind": "infra",
"status": "proved",
"milestone": "M0",
"section": "",
"file": "theory/Metaterm.v",
"depends": []
},
{
"id": "Plus_red1_context",
"label": "Plus_red1_context",
@@ -706,6 +739,26 @@
"file": "theory/NamedMeta.v",
"depends": []
},
{
"id": "Es_ctx_any",
"label": "Es_ctx_any",
"kind": "infra",
"status": "proved",
"milestone": "M0",
"section": "",
"file": "theory/NamedMeta.v",
"depends": []
},
{
"id": "nred_R_intro",
"label": "nred_R_intro",
"kind": "infra",
"status": "proved",
"milestone": "M0",
"section": "",
"file": "theory/NamedMeta.v",
"depends": []
},
{
"id": "Es_refl_any",
"label": "Es_refl_any",
+36 -1
View File
@@ -70,7 +70,21 @@ Inductive Es : ntrm -> ntrm -> Prop :=
| Es_trans : forall t u v, Es t u -> Es u v -> Es t v
| Es_C : forall t x u y v,
y <> x -> ~ In y (nfv u) -> ~ In x (nfv v) ->
Es (NESub (NESub t x u) y v) (NESub (NESub t y v) x u).
Es (NESub (NESub t x u) y v) (NESub (NESub t y v) x u)
| Es_ctx : forall C t t', Es t t' -> Es (nplug C t) (nplug C t').
Fixpoint cbinders (C : nctx) : list atom :=
match C with
| nHole => []
| nAppL C1 _ => cbinders C1
| nAppR _ C1 => cbinders C1
| nLam x C1 => x :: cbinders C1
| nESubL C1 _ _ => cbinders C1
| nESubR _ _ C1 => cbinders C1
end.
Definition cavoid (C : nctx) (phi : list atom) : bool :=
forallb (fun y => negb (existsb (Nat.eqb y) phi)) (cbinders C).
Inductive nred : ntrm -> ntrm -> Prop :=
| nred_B : forall t x u, nred (NApp (NLam x t) u) (NESub t x u)
@@ -82,6 +96,11 @@ Inductive nred : ntrm -> ntrm -> Prop :=
is_subst_chain C = false ->
nred (NESub (nplug C (NMVar X d)) x u)
(NESub (nplug C (NESub (NMVar X d) x u)) x u)
| nred_R : forall C x u phi,
In x phi ->
(forall y, In y (nfv u) -> In y phi) ->
cavoid C phi = true ->
nred (NESub (nplug C (NVar x)) x u) (NESub (nplug C u) x u)
| nred_ctx : forall C t t', nred t t' -> nred (nplug C t) (nplug C t').
Lemma eqC_in_Es : forall t x u y v,
@@ -89,6 +108,20 @@ Lemma eqC_in_Es : forall t x u y v,
Es (NESub (NESub t x u) y v) (NESub (NESub t y v) x u).
Proof. intros. apply Es_C; assumption. Qed.
Lemma Es_ctx_any : forall C t t', Es t t' -> Es (nplug C t) (nplug C t').
Proof. intros. apply Es_ctx. exact H. Qed.
Lemma nred_R_intro : forall C x u phi,
In x phi -> (forall y, In y (nfv u) -> In y phi) -> cavoid C phi = true ->
nred (NESub (nplug C (NVar x)) x u) (NESub (nplug C u) x u).
Proof.
intros C x u phi Hx Hu Hc.
apply nred_R with (phi := phi).
- exact Hx.
- exact Hu.
- exact Hc.
Qed.
Lemma Es_refl_any : forall t, Es t t.
Proof. intros. apply Es_refl. Qed.
@@ -100,6 +133,8 @@ Proof. intros. apply Es_trans with (u := u); assumption. Qed.
Print Assumptions isubst_meta_in.
Print Assumptions isubst_meta_notin.
Print Assumptions Es_ctx_any.
Print Assumptions nred_R_intro.
Print Assumptions eqC_in_Es.
Print Assumptions Es_refl_any.
Print Assumptions Es_sym_any.