Documentation

Paper.Links

Glossary of Lean theorems and definitions #

This file contains links to all references, definitions, lemmas and theorems from the paper.

They are listed roughly in the order they appear in the paper. This file should serve as a jumping off point to navigate and explore the formalization, and not as a reference to how things are defined. We invite the reader to click on the names in each definition to jump to their original definition. In Visual Studio Code one can Ctrl/CMD+Click on symbols to jump to their definition.

The names of the definitions on this file bear no semantic meaning, and are purely to nominally distinguish them for documentation generation.

See Paper for a list of just definitions theorems and lemmas as they appear in the paper.

Section 3 – Preliminaries #

Written $\mathbb{R}_{[0, 1]}$ in the paper

Equations
Instances For
    Equations
    Instances For

      For continuity we use ωScottContinuous

      Equations
      Instances For

        And for co-continuity we use OrderDual to flip the order of the order

        Equations
        Instances For
          def Paper.Section3.thm₉ {α : Type u_3} [CompleteLattice α] :
          LinkThm (∀ (f : α →o α), OmegaCompletePartialOrder.ωScottContinuous fOrderHom.lfp f = ⨆ (n : ), (⇑f)^[n] )

          Kleene fixed point theorem for lfp

          Equations
          Instances For

            Kleene fixed point theorem for gfp

            Equations
            Instances For
              Equations
              Instances For

                Section 4 – Expected Total Costs in Markov Decision Processes #

                Markov Chains #

                def Paper.Section4.link₂ {α : Type u_1} {MC : MarkovChain α} :
                Equations
                Instances For
                  def Paper.Section4.link₃ {α : Type u_1} {MC : MarkovChain α} :

                  Written $\text{Path}^ω$ in the paper

                  Equations
                  Instances For
                    Equations
                    Instances For
                      Equations
                      Instances For
                        Equations
                        Instances For
                          def Paper.Section4.thm₇ {α : Type u_1} {MC : MarkovChain α} :
                          LinkThm (∀ (π : MC.Path), MarkovChain.Pr π.Cyl = i : Fin (π.length - 1), (MC.P π.states[i]) π.states[i + 1])
                          Equations
                          Instances For
                            Equations
                            Instances For

                              Expected Costs of MDPs as Sums over Paths #

                              def Paper.Section4.link₁₀ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                              Equations
                              Instances For
                                def Paper.Section4.link₁₁ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                Equations
                                Instances For
                                  def Paper.Section4.link₁₂ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                  Equations
                                  Instances For
                                    def Paper.Section4.link₁₃ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                    Equations
                                    Instances For
                                      def Paper.Section4.link₁₄ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                      Equations
                                      Instances For
                                        def Paper.Section4.thm₁₅ {S : Type u_1} {A : Type u_2} {M : MDP S A} {π : M.Path} {𝒮✝ : 𝔖[M]} {h : MDP.Path.Prob 𝒮✝ π 0} :
                                        LinkThm (MarkovChain.Pr (π.toMC' h ).Cyl = MDP.Path.Prob 𝒮✝ π)
                                        Equations
                                        Instances For

                                          Expected Costs of MDPs as Least Fixed Points #

                                          Equations
                                          Instances For
                                            noncomputable def MDP.ECost {S : Type u_1} {A : Type u_2} (M : MDP S A) (𝒮 : 𝔖[M]) (c : M.Costs) (s : S) :

                                            This definition is used in the paper, be in the formalization we use EC. See below.

                                            Equations
                                            Instances For
                                              def Paper.Section4.link₁₇ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                              Equations
                                              Instances For
                                                def Paper.Section4.link₁₈ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                                Equations
                                                Instances For
                                                  def Paper.Section4.thm₂₀ {S : Type u_1} {A : Type u_2} [DecidableEq S] {M : MDP S A} {c : M.Costs} :
                                                  LinkThm (⨆ (n : ), ⨆ (𝒮 : 𝔖[M]), MDP.EC c 𝒮 n = OrderHom.lfp (MDP.Φ Optimization.Angelic c))
                                                  Equations
                                                  Instances For
                                                    def Paper.Section4.thm₂₂ {S : Type u_1} {A : Type u_2} [DecidableEq S] {M : MDP S A} [M.FiniteBranching] {c : M.Costs} :
                                                    LinkThm (⨆ (n : ), ⨅ (𝒮 : 𝔖[M]), MDP.EC c 𝒮 n = OrderHom.lfp (MDP.Φ Optimization.Demonic c))
                                                    Equations
                                                    Instances For
                                                      def Paper.Section4.link₂₃ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                                      Equations
                                                      Instances For
                                                        def Paper.Section4.link₂₄ {S : Type u_1} {A : Type u_2} {M : MDP S A} :
                                                        Equations
                                                        Instances For
                                                          Equations
                                                          Instances For
                                                            def Paper.Section4.thm₂₆ {S : Type u_1} {A : Type u_2} [DecidableEq S] {M : MDP S A} [M.FiniteBranching] {c : M.Costs} :
                                                            LinkThm (⨅ (𝒮 : 𝔖[M]), ⨆ (n : ), MDP.EC c 𝒮 n = OrderHom.lfp (MDP.Φ Optimization.Demonic c))
                                                            Equations
                                                            Instances For

                                                              Section 5 – pGCL: probabilistic Guarded Command Language #

                                                              Program States, pGCL Syntax, and Design Considerations #

                                                              Equations
                                                              Instances For
                                                                Equations
                                                                Instances For
                                                                  Equations
                                                                  Instances For
                                                                    def Paper.Section5.link₆ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} :
                                                                    Equations
                                                                    Instances For

                                                                      Operational Semantics #

                                                                      def Paper.Section5.link₇ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} :

                                                                      Operational MDP

                                                                      Equations
                                                                      Instances For

                                                                        We split the cost functions into two parts, one for programs and one for terminations

                                                                        def Paper.Section5.link₈ {𝒱 : Type u_1} {Γ : 𝒱Type u_2} :

                                                                        Cost of program for $\text{ct}$

                                                                        Equations
                                                                        Instances For
                                                                          def Paper.Section5.link₉ {𝒱 : Type u_1} {Γ : 𝒱Type u_2} :

                                                                          Cost of termination for $\text{ct}$

                                                                          Equations
                                                                          Instances For
                                                                            def Paper.Section5.link₁₀ {𝒱 : Type u_1} {Γ : 𝒱Type u_2} :

                                                                            Cost of program for $\text{cp}$

                                                                            Equations
                                                                            Instances For
                                                                              def Paper.Section5.link₁₁ {𝒱 : Type u_1} {Γ : 𝒱Type u_2} :

                                                                              Cost of termination for $\text{cp}$

                                                                              Equations
                                                                              Instances For
                                                                                def Paper.Section5.link₁₂ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {f : (pGCL.State ΓENNReal) →o pGCL.Termination × pGCL.State ΓENNReal} {g : pGCL Γ × pGCL.State ΓENNReal} :
                                                                                Equations
                                                                                Instances For
                                                                                  def Paper.Section5.thm₁₃ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {f : (pGCL.State ΓENNReal) →o pGCL.Termination × pGCL.State ΓENNReal} {g : pGCL Γ × pGCL.State ΓENNReal} [O.ΦContinuous SmallStepSemantics.mdp] {C C' : pGCL Γ} :
                                                                                  LinkThm (∀ (seq : pGCL ΓpGCL ΓpGCL Γ) (after : pGCL Γ(pGCL Γ pGCL.Termination) × pGCL.State Γ → (pGCL Γ pGCL.Termination) × pGCL.State Γ) (t_const : pGCL.State ΓENNReal), (∀ (C C' : pGCL Γ) (σ : pGCL.State Γ), SmallStepSemantics.cost_p pGCL.Termination pGCL.Act (seq C C', σ) = SmallStepSemantics.cost_p pGCL.Termination pGCL.Act (C, σ))(∀ (C C' : pGCL Γ) (σ : pGCL.State Γ), SmallStepSemantics.act (Conf.prog (seq C C') σ) = SmallStepSemantics.act (Conf.prog C σ))(∀ {C C' : pGCL Γ} {σ : pGCL.State Γ} {p : ENNReal} {α : pGCL.Act} {s : (pGCL Γ pGCL.Termination) × pGCL.State Γ}, (p, s) SmallStepSemantics.psucc C σ α(p, after C' s) SmallStepSemantics.psucc (seq C C') σ α)(∀ {C C' : pGCL Γ} {σ : pGCL.State Γ}, after C' (Sum.inl C, σ) = (Sum.inl (seq C C'), σ))(∀ {t : pGCL.Termination} {C : pGCL Γ} {C' : (pGCL Γ pGCL.Termination) × pGCL.State Γ} {σ : pGCL.State Γ}, after C (Sum.inr t, σ) = C'C' = (Sum.inl C, σ) C' = (Sum.inr t, σ) ∀ (X : pGCL.State ΓENNReal), (SmallStepSemantics.cost_t (pGCL Γ) pGCL.Act) X (t, σ) = t_const σ)(∀ {X : pGCL.State ΓENNReal} {t : pGCL.Termination} {σ : pGCL.State Γ} {C' : pGCL Γ}, after C' (Sum.inr t, σ) = (Sum.inl C', σ)(SmallStepSemantics.cost_t (pGCL Γ) pGCL.Act) ((SmallStepSemantics.op O C') X) (t, σ) (SmallStepSemantics.op O C') X σ)(∀ (x : pGCL Γ), Function.Injective (after x))(SmallStepSemantics.op O C) (SmallStepSemantics.op O C') (SmallStepSemantics.op O (seq C C')))
                                                                                  Equations
                                                                                  Instances For

                                                                                    Weakest Preexpectation Calculi #

                                                                                    def Paper.Section5.link₁₅ {𝒱 : Type u_1} {Γ : 𝒱Type u_2} :
                                                                                    Equations
                                                                                    Instances For
                                                                                      def Paper.Section5.link₁₆ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} :
                                                                                      Equations
                                                                                      Instances For
                                                                                        def Paper.Section5.link₁₇ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} :
                                                                                        Equations
                                                                                        Instances For
                                                                                          def Paper.Section5.link₁₈ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} :
                                                                                          Equations
                                                                                          Instances For

                                                                                            Soundness #

                                                                                            def Paper.Section5.link₁₉ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {f : (pGCL.State ΓENNReal) →o pGCL.Termination × pGCL.State ΓENNReal} {g : pGCL Γ × pGCL.State ΓENNReal} :
                                                                                            Equations
                                                                                            Instances For
                                                                                              def Paper.Section5.thm₂₁ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {C : pGCL Γ} :
                                                                                              Equations
                                                                                              Instances For
                                                                                                def Paper.Section5.link₂₂ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} :
                                                                                                Equations
                                                                                                Instances For
                                                                                                  def Paper.Section5.thm₂₃ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {C : pGCL Γ} :
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    def Paper.Section5.thm₂₄ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {C : pGCL Γ} :
                                                                                                    LinkThm (∀ (X : pGCL.ProbExp Γ), wlp'[O]⟦@C X = 1 - wfp'[O.dual]⟦@C (1 - X))
                                                                                                    Equations
                                                                                                    Instances For

                                                                                                      Quantitative Loop Invariants #

                                                                                                      def Paper.Section5.thm₂₅ {α : Type u_3} [CompleteLattice α] {Δ : α →o α} {f : α} :
                                                                                                      LinkThm (∀ (k : ), Δ ((fun (x : α) => Δ xf)^[k] f) fOrderHom.lfp Δ f)
                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        def Paper.Section5.thm₂₆ {α : Type u_3} [CompleteLattice α] {Δ : α →o α} {f : α} :
                                                                                                        LinkThm (∀ (k : ), f Δ ((fun (x : α) => Δ xf)^[k] f)f OrderHom.gfp Δ)
                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          def Paper.Section5.thm₂₇ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {b : pGCL.BExpr Γ} {C : pGCL Γ} {φ I : pGCL.State ΓENNReal} :
                                                                                                          LinkThm (∀ (k : ), pGCL.ParkKInvariant wp[O]⟦@C b φ k Iwp[O]⟦while @b { @C } φ I)
                                                                                                          Equations
                                                                                                          Instances For
                                                                                                            def Paper.Section5.thm₂₈ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {b : pGCL.BExpr Γ} {C : pGCL Γ} {φ I : pGCL.ProbExp Γ} :
                                                                                                            Equations
                                                                                                            Instances For
                                                                                                              def Paper.Section5.link₂₉ {𝒱 : Type u_1} {Γ : 𝒱Type u_2} :
                                                                                                              Equations
                                                                                                              Instances For
                                                                                                                def Paper.Section5.thm₃₀ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {b : pGCL.BExpr Γ} {C : pGCL Γ} {φ I : pGCL.State ΓENNReal} {σ₀ : pGCL.State Γ} :
                                                                                                                LinkThm (∀ (k : ), pGCL.IdleKInvariant wp[O]⟦@C b φ k I (~ C.mods) σ₀wp[O]⟦while @b { @C } φ σ₀ I σ₀)
                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  def Paper.Section5.thm₃₁ {𝒱 : Type u_1} [DecidableEq 𝒱] {Γ : 𝒱Type u_2} {O : Optimization} {b : pGCL.BExpr Γ} {C : pGCL Γ} {φ I : pGCL.ProbExp Γ} {σ₀ : pGCL.State Γ} :
                                                                                                                  LinkThm (∀ (k : ), pGCL.IdleKCoinvariant wlp'[O]⟦@C b φ k I (~ C.mods) σ₀I σ₀ (wlp'[O]⟦while @b { @C } φ) σ₀)
                                                                                                                  Equations
                                                                                                                  Instances For

                                                                                                                    Section 6 – Sound Encodings into an Intermediate Verification Language #

                                                                                                                    The Intermediate Verification Language HeyVL #

                                                                                                                    Written using (notice this is a different symbol than Boolean negation ¬)

                                                                                                                    Equations
                                                                                                                    Instances For

                                                                                                                      Written using xᶜ. We add ~x as custom syntax too to align with the paper

                                                                                                                      Equations
                                                                                                                      Instances For

                                                                                                                        Written using a ⇨ b and is Heyting implicaiton. In the paper this is b ↜ a (notice the flipped order of arguments).

                                                                                                                        Equations
                                                                                                                        Instances For

                                                                                                                          Written using a \ b and is Heyting co-implicaiton. In the paper this is b ↜ a (notice the flipped order of arguments).

                                                                                                                          Equations
                                                                                                                          Instances For

                                                                                                                            A HeyVL program C verifies if vp⟦C⟧ ⊤ = ⊤

                                                                                                                            Equations
                                                                                                                            Instances For

                                                                                                                              Case Study: Correctness of Encodings for pGCL #

                                                                                                                              Equations
                                                                                                                              Instances For