Not official documentation. This is an unofficial explainer of John N. Shutt's vau calculus. It is not written, reviewed or endorsed by John N. Shutt, Dale Schumacher, Mitchell Wand, or any author of the cited sources. An AI model (Claude) drafted the text and the Lean, and no person has reviewed them. The text may contain errors; the Lean statements are the ground truth for what is proved, and the cited sources are the ground truth for the theory.
The Lean covers the pure vau-x calculus (no delta-rules)
and a model of vau-e (environments,
$vau, derived
$lambda) with this project's additions (encapsulation types, an actor model). It does not formalize Shutt's general framework; confluence is proved directly for these concrete rules only.
Licence of this repository: MIT License . Cited works keep their own copyright; only short, attributed phrases are quoted.
# Confluence of the vau-x rules
This file proves that `Steps` (zero or more steps of the seven general vau-x schemata, in the
compatible closure) is confluent: `Vau.confluence`.
Method: parallel reduction and complete developments (Tait, Martin-Lof, Takahashi). `Par` fires
any set of redexes that are present in a term at once. `cd t` fires all of them. The key lemma
`Par.to_cd` says that every parallel step from `t` can be continued to `cd t` in one more parallel
step. That gives the diamond property of `Par`, and `Steps` and the closure of `Par` are equal.
**Scope.** This is a direct proof for the concrete vau-x rules with no delta-rules. It does
**not** formalize Shutt's regular substitutive reduction systems (thesis chapter 13) or his
Church-Rosser theorem for them (Theorem 13.104). It only checks the conclusion for vau-x.
/-- Parallel reduction. -/
| var (n : Nat ) : Par (var n) (var n)
| dat (n : Nat ) : Par (dat n) (dat n)
| prim (n : Nat ) : Par (prim n) (prim n)
| vau {t t' : Term } : Par t t' -> Par (vau t) (vau t')
| vau0 {t t' : Term } : Par t t' -> Par (vau0 t) (vau0 t')
| vau2 {t t' : Term } : Par t t' -> Par (vau2 t) (vau2 t')
| wrap {t t' : Term } : Par t t' -> Par (wrap t) (wrap t')
| eval {t t' : Term } : Par t t' -> Par (eval t) (eval t')
| pair {a a' b b' : Term } : Par a a' -> Par b b' -> Par (pair a b) (pair a' b')
| comb {a a' b b' : Term } : Par a a' -> Par b b' -> Par (comb a b) (comb a' b')
| evalPair {a a' b b' : Term } : Par a a' -> Par b b' -> Par (eval (pair a b)) (comb (eval a') b')
| evalWrap {t t' : Term } : Par t t' -> Par (eval (wrap t)) (wrap (eval t'))
| parsePair {t t' a a' b b' : Term } : Par t t' -> Par a a' -> Par b b' ->
Par (comb (vau2 t) (pair a b)) (comb (comb t' a') b')
| parseNil {t t' : Term } : Par t t' -> Par (comb (vau0 t) nil) t'
| .vau t => .vau (refl t)
| .vau0 t => .vau0 (refl t)
| .vau2 t => .vau2 (refl t)
| .wrap t => .wrap (refl t)
| .eval t => .eval (refl t)
| evalSelf hs => exact .evalSelf hs (refl _)
| evalPair => exact .evalPair (refl _) (refl _)
| evalWrap => exact .evalWrap (refl _)
| beta _ hv => exact .beta hv (refl _) (refl _)
| combWrap _ hl => exact .combWrap hl (refl _) (refl _)
| parseNil => exact .parseNil (refl _)
| vau _ ih => exact .vau ih
| vau0 _ ih => exact .vau0 ih
| vau2 _ ih => exact .vau2 ih
| wrap _ ih => exact .wrap ih
| eval _ ih => exact .eval ih
| pairL b _ ih => exact .pair ih (refl b)
| pairR a _ ih => exact .pair (refl a) ih
| combL b _ ih => exact .comb ih (refl b)
| combR a _ ih => exact .comb (refl a) ih
/-! ### What parallel steps preserve -/
cases hs <;> cases h <;> constructor
| pair _ _ iha ihb => cases hv with | pair ha hb => exact .pair (iha ha) (ihb hb)
| wrap _ ih => cases hv with | wrap ht => exact .wrap (ih ht)
| comb _ _ _ _ => cases hv
| evalSelf _ _ _ => cases hv
| evalPair _ _ _ _ => cases hv
| evalWrap _ _ => cases hv
| beta _ _ _ _ _ => cases hv
| combWrap _ _ _ _ _ => cases hv
| parsePair _ _ _ _ _ _ => cases hv
| parseNil _ _ => cases hv
induction hl generalizing ts' with
| nil => cases h; exact .nil
| cons a _ ih => cases h with | pair _ hb => exact .cons _ (ih hb)
induction hl generalizing ts' with
| nil => cases h; exact .nil
| cons a _ ih => cases h with | pair ha hb => exact .pair (.eval ha) (ih hb)
/-! ### Parallel steps under renaming and substitution -/
theorem rename {t t' : Term } (rn : Nat -> Nat ) (h : Par t t') :¶ node
induction h generalizing rn with
| prim n => exact .prim n
| vau _ ih => exact .vau (ih _)
| vau0 _ ih => exact .vau0 (ih _)
| vau2 _ ih => exact .vau2 (ih _)
| wrap _ ih => exact .wrap (ih _)
| eval _ ih => exact .eval (ih _)
| pair _ _ iha ihb => exact .pair (iha _) (ihb _)
| comb _ _ iha ihb => exact .comb (iha _) (ihb _)
| evalSelf hs _ ih => exact .evalSelf (hs.rename rn) (ih _)
| evalPair _ _ iha ihb => exact .evalPair (iha _) (ihb _)
| evalWrap _ ih => exact .evalWrap (ih _)
exact .beta (hv.rename rn) (iht _) (ihv _)
| combWrap hl _ hts iht ihts =>
exact .combWrap (hl.rename rn) (iht _) (ihts _)
| parsePair _ _ _ iht iha ihb => exact .parsePair (iht _) (iha _) (ihb _)
| parseNil _ ih => exact .parseNil (ih _)
theorem subst {t t' : Term } {sg tg : Nat -> Term } (h : Par t t') (hsgtg : forall n, Par (sg n) (tg n))¶ node
induction h generalizing sg tg with
| prim n => exact .prim n
| succ n => exact (hsgtg n).rename Nat .succ
| vau0 _ ih => exact .vau0 (ih hsgtg hsg)
| vau2 _ ih => exact .vau2 (ih hsgtg hsg)
| wrap _ ih => exact .wrap (ih hsgtg hsg)
| eval _ ih => exact .eval (ih hsgtg hsg)
| pair _ _ iha ihb => exact .pair (iha hsgtg hsg) (ihb hsgtg hsg)
| comb _ _ iha ihb => exact .comb (iha hsgtg hsg) (ihb hsgtg hsg)
| evalSelf hs _ ih => exact .evalSelf (hs.subst sg) (ih hsgtg hsg)
| evalPair _ _ iha ihb => exact .evalPair (iha hsgtg hsg) (ihb hsgtg hsg)
| evalWrap _ ih => exact .evalWrap (ih hsgtg hsg)
refine .beta (hv.subst hsg) (iht ?_ (IsValue.up hsg)) (ihv hsgtg hsg)
| succ n => exact (hsgtg n).rename Nat .succ
| combWrap hl _ hts iht ihts =>
exact .combWrap (hl.subst sg) (iht hsgtg hsg) (ihts hsgtg hsg)
| parsePair _ _ _ iht iha ihb => exact .parsePair (iht hsgtg hsg) (iha hsgtg hsg) (ihb hsgtg hsg)
| parseNil _ ih => exact .parseNil (ih hsgtg hsg)
/-! ## Complete development -/
/-- `true` iff the term is a pair. -/
/-- `true` iff the term is `()`. -/
/-- The result of parse-pair, read off the development of a pair operand. -/
| .pair a b => .comb (.comb t' a) b
| b => .comb (.vau2 t') b
/-- Complete development: fire every redex that is present in the term, at once. -/
| .vau0 t => .vau0 (cd t)
| .vau2 t => .vau2 (cd t)
| .pair a b => .pair (cd a) (cd b)
| .wrap t => .wrap (cd t)
| .pair a b => .comb (.eval (cd a)) (cd b)
| .wrap u => .wrap (.eval (cd u))
| .vau0 u => .vau0 (cd u)
| .vau2 u => .vau2 (cd u)
| .var n => .eval (.var n)
| .eval u => .eval (cd (.eval u))
| .comb u w => .eval (cd (.comb u w))
| .vau0 u => if isNilB b then cd u else .comb (.vau0 (cd u)) (cd b)
| .var n => .comb (.var n) (cd b)
| .dat n => .comb (.dat n) (cd b)
| .prim n => .comb (.prim n) (cd b)
| .ign => .comb .ign (cd b)
| .nil => .comb .nil (cd b)
| .pair x y => .comb (cd (.pair x y)) (cd b)
| .eval u => .comb (cd (.eval u)) (cd b)
| .comb u w => .comb (cd (.comb u w)) (cd b)
/-- Takahashi's lemma: a parallel step from `t` can always be completed to `cd t`. -/
| prim n => exact .prim n
| vau _ ih => exact .vau ih
| vau0 _ ih => exact .vau0 ih
| vau2 _ ih => exact .vau2 ih
| wrap _ ih => exact .wrap ih
| pair _ _ iha ihb => exact .pair iha ihb
| pair _ _ => cases ih with | pair ha hb => exact .evalPair ha hb
| wrap _ => cases ih with | wrap hu => exact .evalWrap hu
| var n => cases h; exact .eval (.var n)
| eval u => exact .eval ih
| comb u w => exact .eval ih
| dat n => exact .evalSelf (h.selfEval (.dat n)) ih
| prim n => exact .evalSelf (h.selfEval (.prim n)) ih
| ign => exact .evalSelf (h.selfEval .ign ) ih
| nil => exact .evalSelf (h.selfEval .nil ) ih
| vau u => exact .evalSelf (h.selfEval (.vau u)) ih
| vau0 u => exact .evalSelf (h.selfEval (.vau0 u)) ih
| vau2 u => exact .evalSelf (h.selfEval (.vau2 u)) ih
| @comb a a' b b' ha hb iha ihb =>
next hv => exact .beta (hb.isValue ((isValueB_iff b).1 hv)) hu' ihb
next => exact .comb (.vau hu') ihb
next hl => exact .combWrap (hb.isList ((isListB_iff b).1 hl)) hu' ihb
next => exact .comb (.wrap hu') ihb
| pair hx' hy' => exact .parsePair hu' hx' hy'
| _ => exact .comb (.vau2 hu') ihb
| nil => cases hb; exact .parseNil hu'
| _ => exact .comb (.vau0 hu') ihb
| _ => exact .comb iha ihb
| evalPair _ _ iha ihb => exact .comb (.eval iha) ihb
| evalWrap _ ih => exact .wrap (.eval ih)
| @beta t t' v v' hv _ hvv iht ihv =>
| @combWrap t t' ts ts' hl _ hts iht ihts =>
exact .comb iht (ihts.evalList (hts.isList hl))
| parsePair _ _ _ iht iha ihb => exact .comb (.comb iht iha) ihb
| parseNil _ ih => exact ih
/-- The diamond property of parallel reduction. -/
exists u, Par s1 u /\ Par s2 u :=
| prim n => exact .refl _
| vau _ ih => exact ih.vau
| vau0 _ ih => exact ih.vau0
| vau2 _ ih => exact ih.vau2
| wrap _ ih => exact ih.wrap
| eval _ ih => exact ih.eval
| evalSelf hs _ ih => exact Star.head (.top (.evalSelf hs)) ih
| beta hv _ hvv iht ihv =>
| combWrap hl _ hts iht ihts =>
| parsePair _ _ _ iht iha ihb =>
| parseNil _ ih => exact (Steps.top (.parseNil _)).trans ih
/-- The strip lemma for parallel reduction. -/
| refl => exact Exists .intro s2 (And .intro h2 (.refl _))
exact ih.elim fun u hu =>
Exists .intro w (And .intro hw.1 (.tail hu.2 hw.2))
| refl => exact Exists .intro s1 (And .intro (.refl _) h1)
exact ih.elim fun u hu =>
Exists .intro w (And .intro (.tail hu.1 hw.1) hw.2)
/-- **Confluence of vau-x** (seven general schemata, no delta-rules, compatible closure):
if `t ->* s1` and `t ->* s2`, then `s1 ->* u` and `s2 ->* u` for some `u`. -/
/-- Church-Rosser form: two terms that are equal in the equational theory have a common reduct. -/
| rel h => exact Exists .intro _ (And .intro (Star.single h) (.refl _))
| refl t => exact Exists .intro t (And .intro (.refl _) (.refl _))
| symm _ ih => exact ih.elim fun u hu => Exists .intro u (And .intro hu.2 hu.1)
exact ih1.elim fun u1 h1 => ih2.elim fun u2 h2 =>
Exists .intro w (And .intro (h1.1.trans hw.1) (h2.2.trans hw.2))
/-- Two different normal forms are never equal in the equational theory. -/
The vau calculus is the work of John N. Shutt (PhD thesis, WPI, 2010). This explainer and its Lean are unofficial and were drafted by Claude (AI); no person has reviewed them. The Lean statements are the ground truth for what is proved; the cited sources are the ground truth for the theory. Repository: tangentproofs/vau-calculus (MIT License). Part of the tangentproofs/vau-calculus index . Progress is stored only in this browser.
This is the verbatim Lean of tangentproofs/vau-calculus at commit 2e29dbf, reproduced under its licence (MIT License; licence text ). The plain-English pages are unofficial and may be wrong.