f : α → α preserves Sup if it distributes over arbitrary joins:
f (sup s) = sup { f x | x ∈ s }. Equivalently f is a lower adjoint, so it has an upper adjoint
PreservesSup.upperAdjoint f.
A frame operator acts by a Sup-preserving map for each resource r: the lattice meet (a ⊓ ·),
or a cost combinator (costConj r) for a counter resource. The upper adjoint is the corresponding
implication: Heyting ⇨ for the meet, a magic wand for separating conjunction.
- map_sup (s : α → Prop) : f (CompleteLattice.sup s) = CompleteLattice.sup fun (y : α) => ∃ (x : α), s x ∧ y = f x
fpreserves joins.
Instances
The upper adjoint of f: the join of all x with f x ⊑ b. For f = (a ⊓ ·) this is Heyting
implication a ⇨ ·.
Equations
- Lean.Order.PreservesSup.upperAdjoint f b = Lean.Order.CompleteLattice.sup fun (x : α) => Lean.Order.PartialOrder.rel (f x) b
Instances For
upperAdjoint f b is the least upper bound of {x | f x ⊑ b} by definition.
Unit, free from the definition of upperAdjoint: f x ⊑ b → x ⊑ upperAdjoint f b. Needs only
CompleteLattice.
Counit (modus ponens), from join preservation: f (upperAdjoint f b) ⊑ b.
Monotonicity of a Sup-preserving f, derived from join preservation.
The frame closure of a post-transformer k with respect to a family of Sup-preserving
operators op r: the meet over all resources r of the r-upper-adjoint of k framed by r. It
internalizes the frame rule into any k (see frameClosure_frames), with no assumption on k. A
weakest precondition built as frameClosure op (fun Q => bwp x Q E) satisfies the op-frame rule by
construction.
Equations
- Lean.Order.PreservesSup.frameClosure op k Q = Lean.Order.iInf fun (r : R) => Lean.Order.PreservesSup.upperAdjoint (op r) (k fun (a : β) => op r (Q a))
Instances For
The frame rule, internalized: for a family of Sup-preserving operators op r whose resources
compose by comp with the action law op (comp r r') = op r ∘ op r', and any post-transformer k,
op F (frameClosure op k Q) ⊑ frameClosure op k (fun a => op F (Q a)).
Landing below the frame closure, transposed across the Galois connection: pre ⊑ frameClosure op k Q
holds exactly when op r pre ⊑ k (fun a => op r (Q a)) for every resource r. At a unit resource
(op e = id) the r = e conjunct is pre ⊑ k Q; the remaining conjuncts are the frame conditions on
pre, so a pre that cannot frame is forced down to the trivial ⊥.
Landing below the frame closure reduces to landing below the base transformer together with
framing: if pre ⊑ k Q and k frames every op r (op r (k Q') ⊑ k (fun a => op r (Q' a))), then
pre ⊑ frameClosure op k Q.
A right adjoint is monotone.
The frame closure lies below the base transformer, witnessed at a unit resource e with
op e = id.
Frame a single state coordinate: from the function-order premise (fun u => ⌜u = s⌝ ⊓ pre) ⊑ Q
conclude the point entailment pre ⊑ Q s. Instantiating the premise at u := s collapses
⌜s = s⌝ ⊓ pre to pre. Iterating it over a state chain point-frames pre ⊑ Q s₁ … sₙ to the
function-order goal (fun u⃗ => ⌜u⃗ = s⃗⌝ ⊓ pre) ⊑ Q.