Ordered resource algebras and their morphisms.
Copyright (c) The Iris-Lean Contributors.
The composition operation.
Equations
- Iris.Op.«term_•_» = Lean.ParserDescr.trailingNode `Iris.Op.«term_•_» 60 61 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " • ") (Lean.ParserDescr.cat `term 61))
Instances For
The composition operation with an optional right argument.
Equations
- Iris.Op.«term_•?_» = Lean.ParserDescr.trailingNode `Iris.Op.«term_•?_» 60 61 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " •? ") (Lean.ParserDescr.cat `term 61))
Instances For
The partial core operator for a resource algebra.
- pcore : α → Option α
The partial core of a resource.
Instances
The validity predicates of a resource algebra.
The step-indexed validity predicate.
- Valid : α → Prop
The validity predicate.
Instances
The validity predicate.
Equations
- Iris.Validity.«term✓_» = Lean.ParserDescr.node `Iris.Validity.«term✓_» 50 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "✓ ") (Lean.ParserDescr.cat `term 50))
Instances For
The step-indexed validity predicate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ordering predicate. This is the generic ORA order predicate; if your ORA is OrdInc,
the lemma ord_inc converts it to the extension order typical of Iris CMRAs.
Equations
- Iris.Ordered.«term_≼ₒ_» = Lean.ParserDescr.trailingNode `Iris.Ordered.«term_≼ₒ_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≼ₒ ") (Lean.ParserDescr.cat `term 51))
Instances For
The reflexive closure of the step-indexed order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The reflexive closure of the order.
Equations
- Iris.Ordered.«term_≼ₒ*_» = Lean.ParserDescr.trailingNode `Iris.Ordered.«term_≼ₒ*_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≼ₒ* ") (Lean.ParserDescr.cat `term 51))
Instances For
The extension inclusion: y is x composed with some frame.
Equations
- Iris.«term_≼_» = Lean.ParserDescr.trailingNode `Iris.«term_≼_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≼ ") (Lean.ParserDescr.cat `term 51))
Instances For
An algebra is affine when extension inclusion implies its resource order.
Equations
Instances For
Order-free theory #
Op #
Equip a resource operation with its extension-inclusion order.
Equations
- Iris.ORA.extOrdered = { OrderN := Iris.IncludedN, Order := Iris.Included, ordN_ne := ⋯, ordN_succ := ⋯, ordN_trans := ⋯, ord_trans := ⋯, ordN_of_ord := ⋯ }
Instances For
Ordered resource algebras #
An ordered resource algebra: composition, core and validity together with the laws relating
them, and a step-indexed order that they respect. The order is neither required to be reflexive
(OrderRefl) nor to contain the extension inclusion (IncOrd).
- op : α → α → α
- extend {n : Nat} {x y₁ y₂ : α} : ✓{n} x → OFE.Dist n x (y₁ • y₂) → (z₁ : α) ×' (z₂ : α) ×' x = z₁ • z₂ ∧ OFE.Dist n z₁ y₁ ∧ OFE.Dist n z₂ y₂
Split a valid resource into factors matching an approximate decomposition.
- pcore_increasing {x cx : α} : pcore x = some cx → Increasing cx
Instances
Validity #
Core #
Total cores #
Discrete elements #
The extension inclusion #
A classical resource algebra: composition, core and validity together with the laws
relating them, and the monotonicity of the partial core along frames. It is not itself an
ordered resource algebra; ORA.ofCMRAData makes one of it, taking the order to be the extension
inclusion.
- op : α → α → α
- pcore_op_left {x cx : α} : PCore.pcore x = some cx → cx • x = x
- extend {n : Nat} {x y₁ y₂ : α} : ✓{n} x → OFE.Dist n x (y₁ • y₂) → (z₁ : α) ×' (z₂ : α) ×' x = z₁ • z₂ ∧ OFE.Dist n z₁ y₁ ∧ OFE.Dist n z₂ y₂
Decompose a valid classical resource along an approximate composition.
Instances
The frame law follows from monotonicity of the partial core along the extension inclusion,
the form of the law in Iris-Rocq (cmra_pcore_mono).
Equations
- Iris.CMRA.ofIsInc = { toORA := inst✝¹, toIsInc := inst✝ }
Construct a classical ordered resource algebra from its operation and core.
Equations
- Iris.ORA.ofCMRAData d = { toORA := Iris.CMRAData.toORA, toIsInc := ⋯ }
Instances For
Discrete and affine algebras #
An algebra with discrete equivalence, validity, and resource order.
Instances
Unital algebras #
A unital ordered resource algebra: an ordered resource algebra with a unit, whose order is reflexive.
- op : α → α → α
- unit : α
The unit resource.
Instances
The unit of a classical unital resource algebra; the input of UORA.ofUCMRAData.
- unit : α
The proposed unit of a classical resource algebra.
Instances
A classical resource algebra equipped with a unit.
Instances
Equations
- Iris.UCMRA.ofIsInc = { toCMRA := Iris.CMRA.ofIsInc, toOrderRefl := ⋯, unit := Iris.UORA.unit, unit_valid := ⋯, unit_left_id := ⋯, pcore_unit := ⋯ }
Add a specified unit to a classical resource algebra.
Equations
- Iris.UORA.ofUCMRAData d = { toCMRA := inst✝, toOrderRefl := ⋯, unit := Iris.UCMRAData.unit, unit_valid := ⋯, unit_left_id := ⋯, pcore_unit := ⋯ }
Instances For
Order #
Increasing elements #
Composition with increasing elements #
A morphism between CMRAs is defined to be a non-expansive function which
preserves validN, pcore and op.
- f : α → β
- ne : NonExpansive self.f
Instances For
A morphism between ORAs, written α -C> β, is defined to be a non-expansive function which
preserves validN, pcore, op, the order and increasing elements.
- f : α → β
- ne : NonExpansive self.f
- increasing {x : α} : Increasing x → Increasing (self.f x)
Instances For
A morphism between ORAs, written α -C> β, is defined to be a non-expansive function which
preserves validN, pcore, op, the order and increasing elements.
Equations
- Iris.ORA.«term_-C>_» = Lean.ParserDescr.trailingNode `Iris.ORA.«term_-C>_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " -C> ") (Lean.ParserDescr.cat `term 25))
Instances For
The identity morphism of an ordered resource algebra.
Equations
- Iris.ORA.Hom.id = { toHom := Iris.OFE.Hom.id, validN := ⋯, pcore := ⋯, op := ⋯, monoN_ord := ⋯, mono_ord := ⋯, increasing := ⋯ }
Instances For
A mixed-variance family of ordered resource algebras with a non-expansive action.
- map {α₁ α₂ : Type u_1} {β₁ β₂ : Type u_2} [COFE α₁] [COFE α₂] [COFE β₁] [COFE β₂] : (α₂ -n> α₁) → (β₁ -n> β₂) → F α₁ β₁ -C> F α₂ β₂
The contravariant and covariant action on non-expansive maps.
- map_id {α : Type u_1} {β : Type u_2} [COFE α] [COFE β] (x : F α β) : (map OFE.Hom.id OFE.Hom.id).f x = x
Instances
A resource functor whose action on morphisms is contractive.
- map_id {α : Type u_1} {β : Type u_2} [COFE α] [COFE β] (x : F α β) : (map OFE.Hom.id OFE.Hom.id).f x = x
- map_contractive {α₁ α₂ : Type u_1} {β₁ β₂ : Type u_2} [COFE α₁] [COFE α₂] [COFE β₁] [COFE β₂] : OFE.Contractive (Function.uncurry RFunctor.map)
Instances
Equations
- Iris.RFunctorContractive.toOFunctorContractive = { toOFunctor := Iris.RFunctor.toOFunctor, map_contractive := ⋯ }
A resource functor whose values are unital ordered resource algebras.
- map {α₁ α₂ : Type u_1} {β₁ β₂ : Type u_2} [COFE α₁] [COFE α₂] [COFE β₁] [COFE β₂] : (α₂ -n> α₁) → (β₁ -n> β₂) → F α₁ β₁ -C> F α₂ β₂
The action on morphisms of a unital resource functor.
- map_id {α : Type u_1} {β : Type u_2} [COFE α] [COFE β] (x : F α β) : (map OFE.Hom.id OFE.Hom.id).f x = x
Instances
A unital resource functor with a contractive action on morphisms.
- map_id {α : Type u_1} {β : Type u_2} [COFE α] [COFE β] (x : F α β) : (map OFE.Hom.id OFE.Hom.id).f x = x
- map_contractive {α₁ α₂ : Type u_1} {β₁ β₂ : Type u_2} [COFE α₁] [COFE α₂] [COFE β₁] [COFE β₂] : OFE.Contractive (Function.uncurry URFunctor.map)
Instances
Equations
- Iris.URFunctorContractive.toRFunctorContractive = { toRFunctor := Iris.URFunctor.toRFunctor, map_contractive := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Iris.rFunctorComposeOFContractiveLeft = { toRFunctor := Iris.rFunctorComposeOF, map_contractive := ⋯ }
Equations
- Iris.urFunctorComposeOFContractiveLeft = { toURFunctor := Iris.urFunctorComposeOF, map_contractive := ⋯ }
Equations
- Iris.rFunctorComposeOFContractiveRight = { toRFunctor := Iris.rFunctorComposeOF, map_contractive := ⋯ }
Equations
- Iris.urFunctorComposeOFContractiveRight = { toURFunctor := Iris.urFunctorComposeOF, map_contractive := ⋯ }
Equations
- Iris.OFunctor.constOFRFunctorContractive = { toRFunctor := Iris.COFE.OFunctor.constOFRFunctor, map_contractive := ⋯ }
Equations
- Iris.OFunctor.constOFURFunctorContractive = { toURFunctor := Iris.COFE.OFunctor.constOFURFunctor, map_contractive := ⋯ }
Transporting a CMRA equality #
Rocq bundles a CMRA as a record, so a proof of A = B transports the whole algebra. In Lean
ORA is a type class, and an equality of carriers says nothing about the two instances, so the
transport lemmas are replaced by transpAp and the OFE.transpAp_* family in
Iris.Instances.IProp.Instance, which carry the equality of the instances explicitly.
The partial core on dependent functions.
Equations
- Iris.DiscreteFun.raPCore = { pcore := fun (f : (x : α) → β x) => some fun (x : α) => Iris.PCore.core (f x), pcore_ne := ⋯, pcore_idem := ⋯ }
Instances For
Equations
- Iris.ucmraDiscreteFunO β = { toORA := Iris.cmraDiscreteFunO β, toOrderRefl := ⋯, unit := fun (x : α) => Iris.UORA.unit, unit_valid := ⋯, unit_left_id := ⋯, pcore_unit := ⋯ }
Apply a family of resource morphisms pointwise to dependent functions.
Equations
- Iris.mapCodHomC F = { toHom := Iris.OFE.mapCodHom fun (x : α) => (F x).toHom, validN := ⋯, pcore := ⋯, op := ⋯, monoN_ord := ⋯, mono_ord := ⋯, increasing := ⋯ }
Instances For
Equations
- Iris.DiscreteFunOFURFC F = { toURFunctor := Iris.urFunctorDiscreteFunOF F, map_contractive := ⋯ }
Lift the partial core to an optional resource.
Equations
Instances For
Compose optional resources, taking absence as the unit.
Equations
- Iris.optionOp (some x') (some y') = some (x' • y')
- Iris.optionOp none y = y
- Iris.optionOp x none = x
Instances For
Validity of an optional resource; absence is valid.
Equations
- Iris.optionValid (some y) = (✓ y)
- Iris.optionValid none = True
Instances For
The step-indexed order on Option α: none lies below none and below every increasing
element, some is monotone up to n-equivalence, and nothing but none lies below none.
Equations
- Iris.optionOrderN n none none = True
- Iris.optionOrderN n none (some y) = Iris.Increasing y
- Iris.optionOrderN n (some x_2) (some y) = (x_2 ≼ₒ*{n} y)
- Iris.optionOrderN n (some val) none = False
Instances For
Resource order on optional values, with absence below increasing resources.
Equations
- Iris.optionOrder none none = True
- Iris.optionOrder none (some y) = Iris.Increasing y
- Iris.optionOrder (some x_2) (some y) = (x_2 ≼ₒ* y)
- Iris.optionOrder (some val) none = False
Instances For
Composition on optional resources.
Equations
- Iris.Option.raOp = { op := Iris.optionOp, op_ne := ⋯, assoc := ⋯, comm := ⋯ }
Instances For
The partial core on optional resources.
Equations
- Iris.Option.raPCore = { pcore := fun (x : Option α) => some (Iris.optionCore x), pcore_ne := ⋯, pcore_idem := ⋯ }
Instances For
Validity on optional resources.
Equations
- Iris.Option.raValid = { ValidN := Iris.optionValidN, Valid := Iris.optionValid, validN_ne := ⋯, valid_iff_validN := ⋯, validN_succ := ⋯ }
Instances For
The resource order on optional resources.
Equations
- Iris.Option.raOrdered = { OrderN := Iris.optionOrderN, Order := Iris.optionOrder, ordN_ne := ⋯, ordN_succ := ⋯, ordN_trans := ⋯, ord_trans := ⋯, ordN_of_ord := ⋯ }
Instances For
Equations
- Iris.ucmraOption = { toORA := Iris.cmraOption, toOrderRefl := ⋯, unit := none, unit_valid := trivial, unit_left_id := ⋯, pcore_unit := ⋯ }
The classical resource algebra on the one-element type.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The unique element is the unit of the one-element resource algebra.
Equations
- Iris.Unit.ucmraData = { unit := (), unit_valid := True.intro, unit_left_id := @Iris.Unit.ucmraData._proof_1, pcore_unit := Iris.Unit.ucmraData._proof_2 }
Instances For
The classical resource algebra on the empty type.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The partial core of a pair, defined when both component cores exist.
Equations
- Iris.Prod.pcore x = (Iris.PCore.pcore x.fst).bind fun (a : α) => (Iris.PCore.pcore x.snd).bind fun (b : β) => pure (a, b)
Instances For
Composition on resource pairs.
Equations
- Iris.Prod.raOp = { op := Iris.Prod.op, op_ne := ⋯, assoc := ⋯, comm := ⋯ }
Instances For
The partial core on resource pairs.
Equations
- Iris.Prod.raPCore = { pcore := Iris.Prod.pcore, pcore_ne := ⋯, pcore_idem := ⋯ }
Instances For
Validity on resource pairs.
Equations
- Iris.Prod.raValid = { ValidN := Iris.Prod.ValidN, Valid := Iris.Prod.Valid, validN_ne := ⋯, valid_iff_validN := ⋯, validN_succ := ⋯ }
Instances For
The resource order on resource pairs.
Equations
- Iris.Prod.raOrdered = { OrderN := Iris.Prod.OrderN, Order := Iris.Prod.Order, ordN_ne := ⋯, ordN_succ := ⋯, ordN_trans := ⋯, ord_trans := ⋯, ordN_of_ord := ⋯ }
Instances For
Equations
- Iris.Prod.ucmraProd = { toORA := Iris.Prod.cmraProd, toOrderRefl := ⋯, unit := (Iris.UORA.unit, Iris.UORA.unit), unit_valid := ⋯, unit_left_id := ⋯, pcore_unit := ⋯ }
Lift a resource morphism to optional resources.
Equations
- Iris.Option.mapC f = { toHom := Iris.optionMap f.toHom, validN := ⋯, pcore := ⋯, op := ⋯, monoN_ord := ⋯, mono_ord := ⋯, increasing := ⋯ }
Instances For
Equations
- Iris.instRFunctorContractiveProdOF = { toRFunctor := Iris.instRFunctorProdOF, map_contractive := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Iris.instURFunctorContractiveProdOF = { toURFunctor := Iris.instURFunctorProdOF, map_contractive := ⋯ }
Equations
- Iris.urFunctorContractiveOptionOF = { toURFunctor := Iris.urFunctorOptionOF, map_contractive := ⋯ }