Documentation

GL.General.Completeness

Prover winning the GL-game builds a GL-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 rewind_history (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
      @[irreducible]
      theorem rewind_history_in_cone {Γ : Sequent} (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.

      @[simp]

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

      Equations
      Instances For
        Equations
        Instances For
          def next_next {Γ Δ : Sequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (h : winning strat (startPos Γ)) (nrep : Δ(↑g).2.1) (pos : Δ (builder_RuleApp g ).sequents) :
          proof_type Γ strat

          Defines the premise when we do not have a repeat.

          Equations
          Instances For
            theorem next_next_cor {Γ Δ : Sequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (h : winning strat (startPos Γ)) (nrep : Δ(↑g).2.1) (pos : Δ (builder_RuleApp g ).sequents) :
            f (builder_RuleApp (next_next g h nrep pos) ) = Δ

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

            theorem history_length_in_cone {Γ : Sequent} (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 rep_pos {Γ Δ : Sequent} {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
              @[irreducible]
              theorem 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 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.

              @[irreducible]
              theorem rewind_history_correspondence (Γ : Sequent) (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 (builder_RuleApp (rewind_history g 2 * n, h3) ) = g.2.1[n]) ∀ (p_turn_q : Game.turn g = Prover), f (builder_RuleApp (rewind_history g 2 * n + 1, h4) ) = g.2.1[n]

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

              def rep_next (Γ : Sequent) {Δ : Sequent} {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 rep_next_cor (Γ : Sequent) {Δ : Sequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (rep : Δ (↑g).2.1) :
                f (builder_RuleApp (rep_next Γ g rep) ) = Δ

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

                def builder_move_premises {Γ : Sequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (h : winning strat (startPos Γ)) :
                List (proof_type Γ strat)

                Define the list of premises from a Builder move.

                Equations
                Instances For
                  theorem prover_win_builds_proof {Γ : Sequent} (strat : Strategy coalgebraGame Prover) (h : winning strat (startPos Γ)) :
                  Γ

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

                  Builder winning the GL-game builds a GL-countermodel. #

                  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.

                  Maximal Paths. #

                  Predicate on moves in the game necessary for quantifying maximal paths.

                  Equations
                  Instances For
                    def is_box (g : Game.Pos) :

                    Predicate on moves in the game necessary for quantifying maximal paths.

                    Equations
                    Instances For

                      Relation on moves in the game necessary for quantifying maximal paths.

                      Equations
                      Instances For

                        The type of a maximal path in the game.

                        Instances For
                          Equations
                          Instances For
                            Equations
                            Instances For

                              Maximal paths always start from a move which is Prover's turn.

                              Maximal paths always end in a move which is Prover's turn.

                              @[irreducible]

                              If Builder is winning, there is always a maximal path.

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

                                If Builder is winning, the List from make_path_from is nonempty.

                                @[irreducible]

                                If Builder is winning, the List from make_path_from is a chain.

                                @[irreducible]
                                theorem make_path_is_max (strat : Strategy coalgebraGame Builder) (g : Game.Pos) :
                                ¬∃ (g' : Game.Pos), non_box_move ((make_path_from strat g).getLast ) g'

                                If Builder is winning, the List from make_path_from is maximal.

                                @[irreducible]
                                theorem make_path_is_in_cone (Δ : Sequent) (strat : Strategy coalgebraGame Builder) (g : Game.Pos) (in_cone : inMyCone strat (Sum.inl Δ, [], []) g) (h : winning strat (Sum.inl Δ, [], [])) (i : Fin (make_path_from strat g).length) :
                                inMyCone strat (Sum.inl Δ, [], []) ((make_path_from strat g).get i)

                                If Builder is winning, every move in the list from make_path_from is in the cone.

                                theorem always_exists_maximal_path_from_root_or_after (Γ : Sequent) (strat : Strategy coalgebraGame Builder) (h : winning strat (startPos Γ)) (g : Game.Pos) (in_cone : inMyCone strat (startPos Γ) g) (head_cases : after_box g g = startPos Γ) :
                                ∃ (π : MaximalPath Γ strat), π.first = g

                                If Builder is winning, the starting move or any move after a box move has a maximal path.

                                Given a prover move, find the underlying sequent.

                                Equations
                                Instances For
                                  Equations
                                  Instances For
                                    def last_sequent {Γ : Sequent} {strat : Strategy coalgebraGame Builder} (h : winning strat (startPos Γ)) :
                                    MaximalPath Γ stratSequent
                                    Equations
                                    Instances For
                                      def path_relation (Γ : Sequent) (strat : Strategy coalgebraGame Builder) (π₁ π₂ : MaximalPath Γ strat) :

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

                                      Equations
                                      Instances For

                                        Interesting for MathLib?

                                        def game_b_model (Γ : Sequent) {strat : Strategy coalgebraGame Builder} (h : winning strat (startPos Γ)) :
                                        Model (MaximalPath Γ strat)

                                        The definition of the GL-model (M,R,V) we will use as the countermodel. M, R, V are all defined as expected (except R is transtive), transitivity is immediate, and converse well-foundedness follow from well-foundedness of the game.

                                        Equations
                                        Instances For
                                          theorem move_from_last_implies_box {Γ : Sequent} {strat : Strategy coalgebraGame Builder} (π : MaximalPath Γ strat) (x : GamePos) :
                                          Move π.last xis_box x

                                          Helper for case of builder_win_strong.

                                          @[irreducible]
                                          theorem diamond_in_last_of_diamond_in_first {Γ : Sequent} {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) :

                                          Helper for case of builder_win_strong.

                                          theorem formula_in_successor_of_diamond_formula_in {Γ : Sequent} {strat : Strategy coalgebraGame Builder} (h : winning strat (startPos Γ)) {π ρ : MaximalPath Γ strat} (π_ρ : path_relation Γ strat π ρ) (φ : Formula) :

                                          Helper for case of builder_win_strong.

                                          theorem diamond_in_path_of_diamond_formula_in {Γ : Sequent} {strat : Strategy coalgebraGame Builder} (h : winning strat (startPos Γ)) {π ρ : MaximalPath Γ strat} (π_ρ : Relation.TransGen (path_relation Γ strat) π ρ) (φ : Formula) :

                                          Helper for case of builder_win_strong.

                                          theorem formula_in_path_of_diamond_formula_in {Γ : Sequent} {strat : Strategy coalgebraGame Builder} (h : winning strat (startPos Γ)) {π ρ : MaximalPath Γ strat} (π_ρ : Relation.TransGen (path_relation Γ strat) π ρ) (φ : Formula) :

                                          Helper for case of builder_win_strong.

                                          @[irreducible]
                                          def builder_win_strong {Δ : Sequent} (strat : Strategy coalgebraGame Builder) (h : winning strat (Sum.inl Δ, [], [])) (π : 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 has a winning strategy, then for any maximal path π, if φ appears in π then the model game_b_model which we previously defined will falsify φ at π.

                                          Equations
                                          • =
                                          Instances For

                                            If Builder has a winning strategy in the game starting from Γ, then there is a countermodel of `Γ!

                                            theorem completeness_seq (Γ : Sequent) :
                                            ΓΓ

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