Documentation

LeanPool.Lean4GlCoalgebras.Split.Completeness

Prover winning the GL-split game builds a GL-split proof. #

If Prover has a winning strategy in the game starting from Γ, then there is a proof of Γ, proven in prover_win_builds_proof; all other definitions and proofs in this file are helpers.

Rewinding the history one step to get previous move.

Equations
Instances For

    Rewinding the history one step is still in the cone of the game.

    @[irreducible]
    def Lean4GlCoalgebras.Split.rewindHistory (g : Game.Pos) (n : Fin ((if Game.turn g = Prover then min (2 * g.2.1.length + 1) (2 * g.2.2.length) else min (2 * g.2.1.length) (2 * g.2.2.length + 1)) + 1)) :

    Rewinding the history n steps.

    Equations
    Instances For
      theorem Lean4GlCoalgebras.Split.rewind_history_in_cone {Γ : SplitSequent} (g : Game.Pos) (n : Fin ((if Game.turn g = Prover then min (2 * g.2.1.length + 1) (2 * g.2.2.length) else min (2 * g.2.1.length) (2 * g.2.2.length + 1)) + 1)) (strat : Strategy coalgebraGame Prover) (in_cone : inMyCone strat (startPos Γ) g) :

      Rewinding the history n steps is still in the cone of the game.

      This is the type of the coalgebra we will use to build the proof of Γ.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Auxiliary declaration used in the GL coalgebra development.

        Equations
        Instances For
          def Lean4GlCoalgebras.Split.nextNext {Γ Δ : SplitSequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (h : winning strat (startPos Γ)) (nrep : Δ(↑g).2.1) (pos : Δ (builderRuleApp g ).splitSequents) :
          proof_type Γ strat

          Defines the premise when we do not have a repeat.

          Equations
          Instances For
            theorem Lean4GlCoalgebras.Split.next_next_cor {Γ Δ : SplitSequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (h : winning strat (startPos Γ)) (nrep : Δ(↑g).2.1) (pos : Δ (builderRuleApp g ).splitSequents) :
            f (builderRuleApp (nextNext g h nrep pos) ) = Δ

            The sequent at the premise defined by nextNext is the sequent Δ which we expect.

            theorem Lean4GlCoalgebras.Split.history_length_in_cone {Γ : SplitSequent} (strat : Strategy coalgebraGame Prover) (g : Game.Pos) (in_cone : inMyCone strat (startPos Γ) g) :
            (Game.turn g = Proverg.2.1.length = g.2.2.length) (Game.turn g = Builderg.2.1.length = g.2.2.length + 1)

            Comparison of rule app history length and sequent history length.

            def Lean4GlCoalgebras.Split.repPos {Γ Δ : SplitSequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (rep : Δ (↑g).2.1) :

            Defines the premise when we do not have a repeat.

            Equations
            Instances For
              theorem Lean4GlCoalgebras.Split.rewind_turn_one_step {g : Game.Pos} {n : } {h1 : n + 1 < (if Game.turn g = Prover then min (2 * g.2.1.length + 1) (2 * g.2.2.length) else min (2 * g.2.1.length) (2 * g.2.2.length + 1)) + 1} {h2 : n < (if Game.turn g = Prover then min (2 * g.2.1.length + 1) (2 * g.2.2.length) else min (2 * g.2.1.length) (2 * g.2.2.length + 1)) + 1} :

              Rewinding the game one step changes the player.

              theorem Lean4GlCoalgebras.Split.rewind_turn {g : Game.Pos} {n : Fin ((if Game.turn g = Prover then min (2 * g.2.1.length + 1) (2 * g.2.2.length) else min (2 * g.2.1.length) (2 * g.2.2.length + 1)) + 1)} :

              Rewinding an even number of moves is the same players turn, rewinding an odd number is other players turn.

              The sequent at the one step rewind can be found in the history.

              theorem Lean4GlCoalgebras.Split.builder_RuleApp_head_of_in_cone {Γ : SplitSequent} {g : Game.Pos} (strat : Strategy coalgebraGame Prover) (in_cone : inMyCone strat (startPos Γ) g) (h : Game.turn g = Builder) (h2 : 0 < g.2.1.length) :
              f (builderRuleApp g h) = g.2.1[0]

              The rule application at a builder position in the cone points to the head sequent.

              theorem Lean4GlCoalgebras.Split.rewind_history_correspondence_aux (Γ : SplitSequent) (info : SplitSequent RuleApp) (Γs : List SplitSequent) (Rs : List RuleApp) (strat : Strategy coalgebraGame Prover) (n : ) (h2 : n < Γs.length) (h3 : 2 * n < (if Game.turn (info, Γs, Rs) = Prover then min (2 * (info, Γs, Rs).2.1.length + 1) (2 * (info, Γs, Rs).2.2.length) else min (2 * (info, Γs, Rs).2.1.length) (2 * (info, Γs, Rs).2.2.length + 1)) + 1) (h4 : 2 * n + 1 < (if Game.turn (info, Γs, Rs) = Prover then min (2 * (info, Γs, Rs).2.1.length + 1) (2 * (info, Γs, Rs).2.2.length) else min (2 * (info, Γs, Rs).2.1.length) (2 * (info, Γs, Rs).2.2.length + 1)) + 1) (h6 : n < Γs.length) (in_cone : inMyCone strat (startPos Γ) (info, Γs, Rs)) :
              (∀ (b_turn_g : Game.turn (info, Γs, Rs) = Builder), f (builderRuleApp (rewindHistory (info, Γs, Rs) 2 * n, h3) ) = Γs[n]) ∀ (p_turn_q : Game.turn (info, Γs, Rs) = Prover), f (builderRuleApp (rewindHistory (info, Γs, Rs) 2 * n + 1, h4) ) = Γs[n]

              The sequent at the n step rewind can be found in the history.

              theorem Lean4GlCoalgebras.Split.rewind_history_correspondence (Γ : SplitSequent) (g : Game.Pos) (strat : Strategy coalgebraGame Prover) (n : ) (h2 : n < g.2.1.length) (h3 : 2 * n < (if Game.turn g = Prover then min (2 * g.2.1.length + 1) (2 * g.2.2.length) else min (2 * g.2.1.length) (2 * g.2.2.length + 1)) + 1) (h4 : 2 * n + 1 < (if Game.turn g = Prover then min (2 * g.2.1.length + 1) (2 * g.2.2.length) else min (2 * g.2.1.length) (2 * g.2.2.length + 1)) + 1) (h6 : n < g.2.1.length) (in_cone : inMyCone strat (startPos Γ) g) :
              (∀ (b_turn_g : Game.turn g = Builder), f (builderRuleApp (rewindHistory g 2 * n, h3) ) = g.2.1[n]) ∀ (p_turn_q : Game.turn g = Prover), f (builderRuleApp (rewindHistory g 2 * n + 1, h4) ) = g.2.1[n]

              The sequent at the n step rewind can be found in the history.

              def Lean4GlCoalgebras.Split.repNext (Γ : SplitSequent) {Δ : SplitSequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (rep : Δ (↑g).2.1) :
              proof_type Γ strat

              Defines the premise when we have a repeat.

              Equations
              Instances For
                theorem Lean4GlCoalgebras.Split.rep_next_cor (Γ : SplitSequent) {Δ : SplitSequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (rep : Δ (↑g).2.1) :
                f (builderRuleApp (repNext Γ g rep) ) = Δ

                The sequent at the premise defined by repNext is the sequent Δ which we expect.

                If Prover has a winning strategy in the game from Γ, then there is a proof of Γ.

                Builder winning the GL-split game builds a GL-model. #

                If Builder has a winning strategy in the game starting from Γ, then there is a proof of Γ, proven in builder_win_builds_model, all other definitions and proofs in this file are helpers.

                Auxiliary declaration used in the GL coalgebra development.

                Equations
                Instances For

                  Auxiliary declaration used in the GL coalgebra development.

                  Equations
                  Instances For

                    Auxiliary declaration used in the GL coalgebra development.

                    Equations
                    Instances For

                      Auxiliary declaration used in the GL coalgebra development.

                      Instances For

                        Auxiliary declaration used in the GL coalgebra development.

                        Equations
                        Instances For

                          Auxiliary declaration used in the GL coalgebra development.

                          Equations
                          Instances For
                            @[irreducible]

                            Auxiliary declaration used in the GL coalgebra development.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              theorem Lean4GlCoalgebras.Split.make_path_is_in_cone (Δ : SplitSequent) (strat : Strategy coalgebraGame Builder) (g : Game.Pos) (in_cone : inMyCone strat (startPos Δ) g) (h : winning strat (startPos Δ)) (i : Fin (makePathFrom strat g).length) :
                              inMyCone strat (startPos Δ) ((makePathFrom strat g).get i)
                              theorem Lean4GlCoalgebras.Split.always_exists_maximal_path_from_root_or_after (Γ : SplitSequent) (strat : Strategy coalgebraGame Builder) (h : winning strat (startPos Γ)) (g : Game.Pos) (in_cone : inMyCone strat (startPos Γ) g) (head_cases : afterBox g g = startPos Γ) :
                              ∃ (π : MaximalPath Γ strat), π.first = g

                              Auxiliary declaration used in the GL coalgebra development.

                              Equations
                              Instances For

                                Recovers the prover sequent from an explicitly identified prover game position.

                                Auxiliary declaration used in the GL coalgebra development.

                                Equations
                                Instances For

                                  Auxiliary declaration used in the GL coalgebra development.

                                  Equations
                                  Instances For

                                    Two maximal paths are related if two steps in the game can connect tail to head.

                                    Equations
                                    Instances For

                                      Builds the Kripke counter-model from a Builder winning strategy.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        A terminal split rule application cannot be available at the last node of a Builder-winning path.

                                        A non-box split rule application cannot extend the last node of a maximal path.

                                        theorem Lean4GlCoalgebras.Split.builder_win_strong {Δ : SplitSequent} (strat : Strategy coalgebraGame Builder) (h : winning strat (startPos Δ)) (π : MaximalPath Δ strat) (φ : Formula) (i : ) (lt : i < π.list.length) (helper : π.list.length - i - 1 < π.list.length) (ps : Game.turn π.list[π.list.length - i - 1] = Prover) :

                                        If Builder wins, no formula in the sequents at Prover positions evaluates to true.

                                        theorem Lean4GlCoalgebras.Split.builder_win_strong_left_zero {Δ : SplitSequent} (strat : Strategy coalgebraGame Builder) (h : winning strat (startPos Δ)) (π : MaximalPath Δ strat) (φ : Formula) (i : ) (h_i : i = 0) (lt : i < π.list.length) (helper : π.list.length - i - 1 < π.list.length) (ps : Game.turn π.list[π.list.length - i - 1] = Prover) (noTerminal : RSplitSequent.ruleApps (lastSplitSequent h π), R.splitSequents = False) (noNonbox : RSplitSequent.ruleApps (lastSplitSequent h π), ¬R.isBoxFalse) :

                                        Left-side last-node case for builder_win_strong.

                                        theorem Lean4GlCoalgebras.Split.builder_win_strong_left_succ {Δ : SplitSequent} (strat : Strategy coalgebraGame Builder) (h : winning strat (startPos Δ)) (π : MaximalPath Δ strat) (φ : Formula) (j i : ) (h_j : j = i + 1) (lt : j < π.list.length) (helper : π.list.length - j - 1 < π.list.length) (ps : Game.turn π.list[π.list.length - j - 1] = Prover) :

                                        Left-side successor case for builder_win_strong.

                                        theorem Lean4GlCoalgebras.Split.builder_win_strong_right_zero {Δ : SplitSequent} (strat : Strategy coalgebraGame Builder) (h : winning strat (startPos Δ)) (π : MaximalPath Δ strat) (φ : Formula) (i : ) (h_i : i = 0) (lt : i < π.list.length) (helper : π.list.length - i - 1 < π.list.length) (ps : Game.turn π.list[π.list.length - i - 1] = Prover) (noTerminal : RSplitSequent.ruleApps (lastSplitSequent h π), R.splitSequents = False) (noNonbox : RSplitSequent.ruleApps (lastSplitSequent h π), ¬R.isBoxFalse) :

                                        Right-side last-node case for builder_win_strong.

                                        theorem Lean4GlCoalgebras.Split.builder_win_strong_right_succ {Δ : SplitSequent} (strat : Strategy coalgebraGame Builder) (h : winning strat (startPos Δ)) (π : MaximalPath Δ strat) (φ : Formula) (j i : ) (h_j : j = i + 1) (lt : j < π.list.length) (helper : π.list.length - j - 1 < π.list.length) (ps : Game.turn π.list[π.list.length - j - 1] = Prover) :

                                        Right-side successor case for builder_win_strong.

                                        If Builder wins, there exists a counter-model.

                                        Completeness! Comes as a corrolary of gamedet, prover_win_builds_proof, and builder_win_builds_model.

                                        Corollary of completeness, used in Interpolants.lean.

                                        theorem Lean4GlCoalgebras.Split.single_preserves_equiv (n : ) (φ ψ χ : Formula) (equiv : φψ) :
                                        single n χ φsingle n χ ψ