Docs / Semantics / Dynamic / Update

The update algebra

import Linglib.Semantics.Dynamic.Update · namespace DynamicSemantics

Dynamic meanings come in two forms: a relational update Update S relates input states to output states, and a context change potential CCP S transforms sets of states as wholes. An update is a mathlib SetRel S S, so sequencing is SetRel.comp, truth at a state is SetRel.dom, and the strongest postcondition, the weakest precondition, and its dual are SetRel.image, SetRel.preimage, and SetRel.core; this file adds the tests and the static connectives built from them. The image sends an update to a transformer, lower recovers it, and the distributive transformers are exactly the relational images. Acceptance and the consequence relations of dynamic meanings are in Consequence.lean, and the monadic reading of the pair is in Collapse.lean.

Main definitions

Main results

Implementation notes

The algebraic instances are scoped: Update S abbreviates a set of pairs and CCP S a function type. Sequencing distributes over arbitrary unions by mathlib's SetRel.comp_sUnion and SetRel.sUnion_comp, and the image is left adjoint to the core by SetRel.image_core_gc. Update.neg does not validate double-negation elimination and CCP.negTest is not CCP.neg; the framework-specific repairs and comparisons live in the studies. Groenendijk & Stokhof 1991's entailment notions live in Studies/GroenendijkStokhof1991.lean.

References

The relational face

A dynamic meaning as a binary relation between input and output states. Sequencing is SetRel.comp, the trivial test SetRel.id, truth at a state SetRel.dom, the possible outputs SetRel.cod, and the strongest postcondition, weakest precondition, and its dual are SetRel.image, SetRel.preimage, and SetRel.core.

@[reducible, inline] abbrev UpdateL94–98
(S : Type u_1) :
Type u_1

Instances Charlow2025.Staged.instLawfulLiftUpdateAssignmentForallNat, Charlow2025.instProgramDisjUpdateAssignment, Charlow2025.instSubstrateUpdateAssignment, Charlow2025.instTruthUpdateAssignmentForallNat

Used by Update.test, Update.neg, Update.impl, Update.disj, Update.mem_comp_test, Update.mem_test_comp, Update.mem_neg, Update.mem_impl, Update.mem_disj, Update.neg_eq_core_empty, Update.instMonoid, Update.mul_def, Update.IsTest, Update.IsTest.eq, Update.IsTest.comp, Update.IsTest.eq_test_dom, Update.IsTest.cod_eq_dom, Update.neg_eq_compl_dom, Update.impl_eq_core_dom, Update.disj_eq_dom_union_dom, Update.impl_comp, Update.dom_comp, Update.impl_eq_neg_comp_test_neg, Update.maxBy, Update.mem_maxBy, Update.mem_maxBy_iff_forall_gt, Update.maxBy_subset, Update.maxBy_eq_self, Update.cumul, Update.mem_cumul, Update.cumul_comp, Update.cumul_mono, Update.strictLift, Update.mem_strictLift, Update.strictLift_subset_cumul, Update.singleton_mem_strictLift_iff, Update.dist, Update.dom_dist, Update.dist_dist, CCP.lower, Update.image_isDistributive, Update.lower_image, Update.image_le_image_iff

Used in Semantics/Dynamic/DPL/Context, Semantics/Dynamic/DPL/Semantics, Semantics/Dynamic/DRT/ContextChange, Semantics/Dynamic/DRT/Relational, Semantics/Dynamic/ICDRT and 16 more

A static property of a single state; test embeds conditions into updates.

@[reducible, inline] abbrev ConditionL100–101
(S : Type u_1) :
Type u_1

Used by Update.test, Update.neg, Update.impl, Update.disj, Update.mem_test, Update.mem_comp_test, Update.mem_test_comp, Update.mem_test_iff_left, Update.dom_test, Update.cod_test, Update.test_inj, Update.test_comp_test, Update.neg_test, Update.preimage_test, Update.core_test, Update.isTest_test, Update.cumul_test, CCP.up_eq_image_test, Update.image_test_isEliminative, CCP.exists_eq_image_test_iff

Used in Semantics/Dynamic/ICDRT, Semantics/Dynamic/PCDRT, Semantics/Dynamic/RegisterStructure, Charlow2021, Krifka2026 and 2 more

The connectives

test C checks C without changing the state.

def Update.testL109–110
{S : Type u_1} (C : Condition S) :

Built from ,

Used by Update.mem_test, Update.mem_comp_test, Update.mem_test_comp, Update.mem_test_iff_left, Update.dom_test, Update.cod_test, Update.test_injective, Update.test_inj, Update.test_univ, Update.test_comp_test, Update.neg_test, Update.image_test, Update.preimage_test, Update.core_test, Update.isTest_test, Update.IsTest.eq_test_dom, Update.impl_comp, Update.impl_eq_neg_comp_test_neg, Update.cumul_test, CCP.up_eq_image_test, Update.image_test_isEliminative, CCP.exists_eq_image_test_iff

Used in Semantics/Dynamic/DPL/Context, Semantics/Dynamic/DPL/Semantics, Semantics/Dynamic/PCDRT, Semantics/Dynamic/RegisterStructure, Brasoveanu2010 and 11 more

impl D₁ D₂ holds at i iff every D₁-output from i has a D₂-output.

def Update.implL115–116
{S : Type u_1} (D₁ D₂ : Update S) :
  • D₁.impl D₂ = SetRel.core D₁ (SetRel.dom D₂)

Built from ,

Used by Update.mem_impl, Update.impl_eq_core_dom, Update.impl_comp, Update.impl_eq_neg_comp_test_neg

Used in Semantics/Dynamic/DPL/Context, Semantics/Dynamic/DPL/Semantics, Semantics/Dynamic/DRT/Relational, Semantics/Dynamic/RegisterStructure, GroenendijkStokhof1991 and 1 more

L121
L123–124
L126–127
L129
L131
L133
L135–136
L138–139

The update monoid

L143–150
L152
L154

Tests

L161
L163–164
L166
L168
L174
L176–177
L190
L211–212
L214
L216
L218
L220–221
L223–224
L226–228

Maximization

Maximization under a valuation f keeps the outputs of D at which f is maximal among the outputs. The maxima are local, since a nondeterministic D may have several.

def Update.maxByL232–235
{S : Type u_1} {α : Type u_2} [LE α] (f : S → α) (D : Update S) :
  • Update.maxBy f D = {(i, j) : S × S | MaximalFor (fun (x : S) => (i, x) ∈ D) f j}

Built from

Used by Update.mem_maxBy, Update.mem_maxBy_iff_forall_gt, Update.maxBy_subset, Update.maxBy_eq_self

Used in Semantics/Dynamic/PCDRT, Semantics/Dynamic/RegisterStructure

L237–239
L241–244
L246–247
L249–253

The plural lift

The cumulative lift of an update to plural states (Brasoveanu 2010 (18)): the relation lifting Set.LiftRel of the update, which is cumulation ** in the sense of Beck & Sauerland 2000. Every input row has a D-successor among the output rows, and every output row a D-predecessor among the input rows.

def Update.cumulL259–263
{S : Type u_1} (D : Update S) :
Update (Set S)
  • D.cumul = {(I, J) : Set S × Set S | Set.LiftRel (fun (x1 x2 : S) => (x1, x2) ∈ D) I J}

Built from

Used by Update.mem_cumul, Update.cumul_id, Update.cumul_comp, Update.cumul_mono, Update.cumul_test, Update.strictLift_subset_cumul

Used in Semantics/Dynamic/PCDRT, Semantics/Dynamic/PPCDRT, Minor2022

L265
L267–269
L275–276

The strict lift of an update to plural states (Minor 2022 (60)): each input row moves to one D-successor, and the output state is the image. Where the cumulative lift lets a row have several successors, a strict output is an image of its input, so never larger.

def Update.strictLiftL292–296
{S : Type u_1} (D : Update S) :
Update (Set S)
  • D.strictLift = {(I, J) : Set S × Set S | ∃ (f : S → S), (∀ i ∈ I, (i, f i) ∈ D) ∧ f '' I = J}

Built from

Used by Update.mem_strictLift, Update.strictLift_subset_cumul, Update.singleton_mem_strictLift_iff

Used in Minor2022

L298–299
L319–329
L331–369

The transformer face

A context change potential is a transformer of whole information states.

@[reducible, inline] abbrev CCPL375–376
(S : Type u_1) :
Type u_1
  • CCP S = (Set S → Set S)

Used by CCP.seq, CCP.instMonoid, CCP.neg, CCP.guard, CCP.negTest, CCP.might, CCP.must, CCP.IsEliminative, CCP.IsEliminative.seq, CCP.IsTest, CCP.IsTest.isEliminative, CCP.IsTest.eq_guard, CCP.isTest_iff_exists_guard, CCP.IsDistributive, CCP.isDistributive_iff_map_sSup, CCP.up, CCP.down, CCP.IsEliminative.down_eq, CCP.IsClassical, CCP.might_not_isDistributive, CCP.lower, CCP.mem_lower, CCP.image_lower, CCP.exists_eq_image_test_iff, CCP.isClassical_iff_up_down_eq

Used in Semantics/Dynamic/Bilateral, Semantics/Dynamic/Consequence, Charlow2019, Charlow2021, Rudin2025a and 3 more

L385–391

Whole-state tests

L402–403
L405–406
L408–409

Classification

L450–451

A transformer is distributive if it acts per-element: φ s = ⋃ i ∈ s, φ {i} — equivalently, it preserves arbitrary joins (isDistributive_iff_map_sSup).

def CCP.IsDistributiveL453–457
{S : Type u_1} (φ : CCP S) :
  • φ.IsDistributive = ∀ (s : Set S), φ s = {p : S | ∃ i ∈ s, p ∈ φ {i}}

Built from

Used by CCP.isDistributive_iff_map_sSup, CCP.IsClassical, CCP.might_not_isDistributive, Update.image_isDistributive, CCP.image_lower

Used in Charlow2019, Charlow2021, KampVanGenabithReyle2011

L459–490

The classical fragment

L501–502
L504–506
L511–512

The bridge

L549
L562–566

The static fragment

Van Benthem's additivity (van Benthem 1986; Rothschild & Yalcin 2016; Gillies 2022): the classical transformers are exactly the images of tests. Update semantics keeps eliminativity but its whole-state tests break distributivity; DPL's random reassignment does the reverse (Groenendijk & Stokhof 1990, §4).