The frame closure #
The frame closure is an endomap on predicate transformers over a family of supremum-preserving
operators op r, one per resource r. It internalizes the frame rule into the transformer it is
applied to. The companion family opE r frames the exception postcondition; the FrameOp class
relates op to its companion, derived by the structure of the exception postcondition type.
Relates a frame operator op on the value channel of a PredTrans Pred EPosts to a companion
opE on the exception channel. Both preserve suprema. Instances derive opE from the structure
of EPosts: op itself on the assertion type, a pointwise lift under a function layer, and a
componentwise lift on a product layer. A low-priority default instance ignores the frame. An
instance for a custom exception layer takes precedence.
- preservesSup (r : R) : PreservesSup (op r)
Each
op rpreserves suprema, so it has an upper adjoint. - preservesSupE (r : R) : PreservesSup (opE r)
Each
opE rpreserves suprema, so it has an upper adjoint.
Instances
The frame acts pointwise under a function layer.
Equations
- Lean.Order.FrameOp.pointwise opE r = Function.comp (opE r)
Instances For
The frame acts componentwise on a product layer.
Equations
- Lean.Order.FrameOp.prod opA opB r = Prod.map (opA r) (opB r)
Instances For
The frame cannot act on the channel, so its companion ignores it.
Equations
Instances For
The frame closure of a predicate transformer t with respect to a family of
supremum-preserving operators op r and its exception-channel companion opE r: the meet over all
resources r of the r-upper-adjoint of t framed by r on both channels. It internalizes the
frame rule into any t (see PredTrans.frameClosure_frames), with no assumption on t.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Unfolding frameClosure through apply.
The frame closure carries monotonicity: if t is monotone, so is t.frameClosure op.
The frame rule, internalized: for supremum-preserving op r whose resources compose by comp
with the action law op (comp r r') = op r ∘ op r', and the matching companion law hactE, op F
commutes into the value postcondition of t.frameClosure op while opE F commutes into the
exception postcondition.
Landing below the frame closure, transposed across the Galois connection:
pre ⊑ (t.frameClosure op).apply Q E holds exactly when
op r pre ⊑ t.apply (fun a => op r (Q a)) (opE r E) for every resource r.
Landing below the frame closure reduces to landing below the base transformer together with
framing: if pre ⊑ t.apply Q E and t frames every op r on both channels, then
pre ⊑ (t.frameClosure op).apply Q E.
The frame closure lies below the base transformer, witnessed at a unit resource e with
op e = id and opE e = id.