Documentation

Pdl.Local.UnfoldBox

Local Box Unfolding (Section 3.1) #

Preparation for Boxes: Test Profiles #

@[reducible, inline]
abbrev TP (α : Program) :

Type of test profiles for a given program.

Equations
Instances For
    @[instance_reducible]
    instance instFintypeTP {α : Program} :
    Fintype (TP α)
    Equations
    theorem TP_eq_iff {α : Program} {ℓ ℓ' : TP α} :
    ℓ = ℓ' ↔ ∀ τ ∈ (testsOfProgram α).attach, ℓ τ = ℓ' τ
    @[instance_reducible]
    instance instCoeOutTPUnion {α β : Program} :
    CoeOut (TP (α⋓β)) (TP α)
    Equations
    @[instance_reducible]
    instance instCoeOutTPUnion_1 {α β : Program} :
    CoeOut (TP (α⋓β)) (TP β)
    Equations
    @[instance_reducible]
    instance instCoeOutTPSequence {α β : Program} :
    CoeOut (TP (α;'β)) (TP α)
    Equations
    @[instance_reducible]
    instance instCoeOutTPSequence_1 {α β : Program} :
    CoeOut (TP (α;'β)) (TP β)
    Equations
    @[instance_reducible]
    instance instCoeOutTPStar {α : Program} :
    CoeOut (TP (∗α)) (TP α)
    Equations
    def allTP (α : Program) :
    List (TP α)

    List of all test profiles for a given program. Note that in contrast to Fintype.elems : Finset (TP α) here we get a computable List (TP α).

    Equations
    Instances For
      theorem allTP_mem {α : Program} (ℓ : TP α) :
      ℓ ∈ allTP α

      All test profiles are in the list of all test profiles. Thanks to Floris van Doorn https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/List.20of.20.28provably.29.20all.20functions.20from.20given.20List.20to.20Bool

      def signature (α : Program) (ℓ : TP α) :

      σ^ℓ

      Equations
      Instances For
        theorem signature_iff {α : Program} {ℓ : TP α} {W : Type} {M : KripkeModel W} {w : W} :
        evaluate M w (signature α ℓ) ↔ ∀ τ ∈ (testsOfProgram α).attach, ℓ τ = true ↔ evaluate M w ↑τ

        This is currently unused.

        This is currently unused.

        theorem signature_contradiction_of_neq_TPs {α : Program} {ℓ ℓ' : TP α} :
        ℓ ≠ ℓ' → contradiction (signature α ℓ ⋀ signature α ℓ')

        This is currently unused.

        theorem equiv_iff_TPequiv {φ ψ : Formula} {α : Program} :
        φ ≡ ψ ↔ ∀ (ℓ : TP α), φ ⋀ signature α ℓ ≡ ψ ⋀ signature α ℓ

        This is currently unused.

        Boxes: F, P, Bset and unfoldBox #

        Note: In F, P and Bset we use lists not sets, to eventually make formulas.

        def F (α : Program) (ℓ : TP α) :
        Equations
        Instances For
          def P (α : Program) (ℓ : TP α) :
          Equations
          Instances For
            def Bset (α : Program) (ℓ : TP α) (ψ : Formula) :
            Equations
            Instances For
              def unfoldBox (α : Program) (φ : Formula) :

              unfold_□(α,ψ)

              Equations
              Instances For
                theorem F_mem_iff_neg (α : Program) (ℓ : TP α) (φ : Formula) :
                φ ∈ F α ℓ ↔ ∃ (τ : Formula) (h : τ ∈ testsOfProgram α), φ = ~τ ∧ ℓ ⟨τ, h⟩ = false
                theorem P_monotone (α : Program) (ℓ ℓ' : TP α) (h : ∀ (τ : { τ : Formula // τ ∈ testsOfProgram α }), ℓ τ = true → ℓ' τ = true) (δ : List Program) :
                δ ∈ P α ℓ → δ ∈ P α ℓ'
                theorem F_goes_down {α : Program} {ℓ : TP α} {φ : Formula} :
                φ ∈ F α ℓ → lengthOfFormula φ < lengthOfProgram α
                theorem keepFreshF {x : ℕ ⊕ ℕ} (α : Program) (ℓ : TP α) (x_notin : x ∉ α.voc) (φ : Formula) :
                φ ∈ F α ℓ → x ∉ φ.voc
                theorem keepFreshP {x : ℕ ⊕ ℕ} (α : Program) (ℓ : TP α) (x_notin : x ∉ α.voc) (δ : List Program) :
                δ ∈ P α ℓ → x ∉ δ.pvoc
                theorem boxHelperTermination (α : Program) (ℓ : TP α) (δ : List Program) :
                δ ∈ P α ℓ → (α.isAtomic → δ = [α]) ∧ (∀ (β : Program), α = (∗β) → δ = [] ∨ ∃ (a : ℕ) (δ1n : List Program), δ = ·a :: δ1n ++ [∗β] ∧ ·a :: δ1n ⊆ (subprograms α).erase α) ∧ (¬α.isAtomic ∧ ¬α.isStar → δ = [] ∨ ∃ (a : ℕ) (δ1n : List Program), δ = ·a :: δ1n ∧ ·a :: δ1n ⊆ (subprograms α).erase α)

                Depending on α we know what can occur inside δ ∈ P α ℓ and thus later in unfoldBox.

                theorem PgoesDown {δ : List Program} {γ α : Program} {ℓ : TP α} :

                Proven from boxHelperTermination.

                theorem unfoldBoxContent (α : Program) (ψ : Formula) (X : List Formula) :
                X ∈ unfoldBox α ψ → ∀ φ ∈ X, φ = ψ ∨ (∃ τ ∈ testsOfProgram α, φ = ~τ) ∨ ∃ (a : ℕ) (δ : List Program), (φ = ⌈·a⌉⌈⌈δ⌉⌉ψ) ∧ ∀ γ ∈ ·a :: δ, γ ∈ subprograms α

                Where formulas in the unfolding can come from. The article also says φ ∈ fischerLadner [⌈α⌉ψ] which we prove later in unfoldBox_in_FL.

                theorem unfoldBox_voc {x : ℕ ⊕ ℕ} {α : Program} {φ : Formula} {L : List Formula} (L_in : L ∈ unfoldBox α φ) {ψ : Formula} (ψ_in : ψ ∈ L) (x_in_voc_ψ : x ∈ ψ.voc) :
                x ∈ α.voc ∨ x ∈ φ.voc
                theorem unfoldBox_voc_fin {x : ℕ ⊕ ℕ} {α : Program} {φ : Formula} {X : Finset Formula} (X_in : X ∈ (unfoldBox α φ).toFinFin) {ψ : Formula} (ψ_in : ψ ∈ X) (x_in_voc_ψ : x ∈ ψ.voc) :
                x ∈ α.voc ∨ x ∈ φ.voc

                Finset version of unfoldBox_voc.

                theorem boxHelperTP (α : Program) (ℓ : TP α) :
                (∀ (τ : { τ : Formula // τ ∈ testsOfProgram α }), ~↑τ ∈ F α ℓ → ℓ τ = false) ∧ con (F α ℓ) ⋀ signature α ℓ ≡ signature α ℓ ∧ ∀ (ψ : Formula), con (Bset α ℓ ψ) ⋀ signature α ℓ ≡ con (List.map (fun (αs : List Program) => ⌈⌈αs⌉⌉ψ) (P α ℓ)) ⋀ signature α ℓ

                A helper theorem about Bset and signature. Note that the paper only states the third conjunct.

                theorem guardToStar (x : ℕ) (β : Program) (χ0 χ1 ρ ψ : Formula) (x_notin_beta : Sum.inl x ∉ β.voc) (beta_equiv : (⌈β⌉·x) ≡ ·x ⋀ χ0 ⋁ χ1) (rho_imp_repl : ρ ⊨ repl_in_F x ρ (χ0 ⋁ χ1)) (rho_imp_psi : ρ ⊨ ψ) :
                ρ ⊨ ⌈∗β⌉ψ
                theorem localBoxTruth_connector (γ : Program) (ψ : Formula) (goal : ∀ (ℓ : TP γ), (⌈γ⌉ψ) ⋀ signature γ ℓ ≡ con (Bset γ ℓ ψ) ⋀ signature γ ℓ) :
                (⌈γ⌉ψ) ≡ dis (List.map (fun (ℓ : TP γ) => con (Bset γ ℓ ψ)) (allTP γ))

                Show "suffices" part outside, to use localBoxTruth for star case in localBoxTruthI.

                theorem localBoxTruthI (γ : Program) (ψ : Formula) (ℓ : TP γ) :
                (⌈γ⌉ψ) ⋀ signature γ ℓ ≡ con (Bset γ ℓ ψ) ⋀ signature γ ℓ

                Induction claim for localBoxTruth.

                theorem localBoxTruth (γ : Program) (ψ : Formula) :
                (⌈γ⌉ψ) ≡ dis (List.map (fun (ℓ : TP γ) => con (Bset γ ℓ ψ)) (allTP γ))
                theorem existsBoxFP {W✝ : Type} {M : KripkeModel W✝} {v w : W✝} (γ : Program) (v_γ_w : relate M γ v w) (ℓ : TP γ) (v_conF : (M, v) ⊨ con (F γ ℓ)) :
                ∃ δ ∈ P γ ℓ, relateSeq M δ v w