Effect4

R2: Extension is conservative: C1–C8 over DI-47's relation on Σ_appreq:R2

Requirement R2: Conservative extensionabout:req:R2

This page explains requirement R2 in Effect4. It covers what conservative extension requires across eight obligations, why typing signature independence matters, and how the property is checked.

What the requirement asksabout:req:R2:what-it-asks

Requirement R2 requires that extending an application signature is conservative across eight named obligations (DB-01, docs/core/system-map.md §8):

  • C1 syntax: extending a signature leaves existing program representations unchanged.
  • C2 meaning: extending operations leaves existing program denotations unchanged.
  • C3 checker: extending a signature admits exactly the same existing programs.
  • C4 protocol typing: existing programs keep their protocol certificates.
  • C5 world: extending allocated operations projects onto earlier world states.
  • C6 local lawfulness: appending rows keeps signature validity intact.
  • C7 representation: target representations remain compatible.
  • C8 forms: higher-level form expansions remain stable under extension.

Extending a signature must never alter the typing, semantics, or admission of existing programs.

Why it mattersabout:req:R2:why-it-matters

Software composition relies on stability under modular extension.

If adding a new library, operation row, or service changed how existing programs run, modular verification would collapse.

Conservative extension lets separate modules compose without changing what the earlier ones mean.

How it is checkedabout:req:R2:how-it-is-checked

The requirement is checked by proving conservative extension theorems for syntax, checking, meaning, and sums:

  • Checker extension and restriction are stated by check_ext and check_restrict in src/Effect4/Laws/Program/Signature.lean.
  • Signature lawfulness under appending is stated by lawful_append in the same file.
  • Denotational meaning under row extension is stated on StraightRows by meaningUnder_append (src/Effect4/Laws/Program/DenoteRowsAppend.lean).
  • That a signature sum is a coproduct of free monads is stated by sum_is_coproduct (src/Effect4/Laws/Effects/Sum.lean).

The plan on this page gives each theorem's status and the goals it rests on.

R2 by concept: each concept its nodes are placed at, by tag or by module. An arrow goes where a node's proof reaches a node of another concept.
The figure in words
NodeStatusRests onNearest nodes
check_extproved—check_sound, check_complete
check_restrictproved—cata_eff_congr_on, hom_eq_cata_eff
lawful_appendproved——
meaningUnder_appendproved——
denoteRowsB_loopedproved—denoteRows_straight
denoteRowsB_straightproved——
checkModule_conservativeproved—defs_conservative
checkModule_eq_checkproved——
defs_conservativeproved—cata_eff_congr_on, hom_eq_cata_eff
moduleHasTy_extproved——
typeOfProgram_extproved—checkModule_sound, moduleHasTy_ext, checkModule_complete
check_soundproved——
check_completeproved——
cata_eff_congr_onproved——
hom_eq_cata_effproved——
denoteRows_straightproved——
checkModule_soundproved—check_sound
checkModule_completeproved—checkModule_eq_check, check_complete