Documentation

PiBaseLean.AdditionalDefs.Games

This file builds up defs and basic theory about Gale-Stewart games. This has been done previously in Lean, for example here https://afm.episciences.org/17712/pdf

Additionally, we define various topological games.

For a reference on the theory, see https://en.wikipedia.org/wiki/Determinacy

For topological games, see https://en.wikipedia.org/wiki/Topological_game

def List.ofFun {α : Type u} (f : α) :
List α

Given some function f : ℕ → X and some natural number n, the list of the form (f(0), f(1), ..., f(n - 1)).

Equations
Instances For
    @[simp]
    theorem List.ofFun_length {α : Type u} (f : α) (n : ) :
    (ofFun f n).length = n
    def List.ltakeHalf {α : Type u} :
    List αList α
    Equations
    Instances For
      def List.rtakeHalf {α : Type u} (l : List α) (n : ) :
      List α

      The n most recent moves by the opponent in a chronological game history, listed from newest to oldest.

      Equations
      Instances For
        structure PiBase.Game (X : Type u) :

        A game on some type X. Abstractly, this is equivalent to Set (ℕ → X).

        • IsPayoff (a : X) : Prop

          Whether player A wins on some game.

        Instances For
          def PiBase.WinningStrategyA {X : Type u} (G : Game X) (f : List XX) :

          On a low level, a strategy is just a function f : List X → X. We say a function is a winning strategy for Player A, if Player A wins the game f([]), a₁, f([a₁]), a₂, ... is payoff.

          Equations
          Instances For
            def PiBase.MarkovKWinningStrategyA {X : Type u} (G : Game X) (f : List XX) (k : ) :
            Equations
            Instances For
              def PiBase.WinningStrategyB {X : Type u} (G : Game X) (f : List XX) :

              A winning strategy for Player B. Note that it is possible neither A nor B have a winning strategy.

              Equations
              Instances For
                def PiBase.MarkovKWinningStrategyB {X : Type u} (G : Game X) (f : List XX) (k : ) :
                Equations
                Instances For
                  Equations
                  Instances For

                    We say Player A has a k-Markov winning strategy, if they have a winning strategy only depending on the round number and the k most recent moves by the opponent.

                    Equations
                    Instances For
                      Equations
                      Instances For

                        We say Player B has a k-Markov winning strategy, if they have a winning strategy only depending on the round number and the k most recent moves by the opponent.

                        Equations
                        Instances For
                          def PiBase.MarkovKStrategy.toStrategy {X : Type u} (f : List XX) (k : ) :
                          List XX
                          Equations
                          Instances For
                            @[reducible, inline]
                            abbrev PiBase.AllowedMoves (X : Type u) :
                            Equations
                            Instances For
                              def PiBase.Game.ofAllowed {X : Type u} (G : Game X) (S : AllowedMoves X) :

                              Usually, a game has some "allowed" moves, which the players can do. If they make a disallowed move, they lose immediately. This auxiliary definition is meant to formalise this behaviour.

                              In particle we use this definition to describe the "winning argument" in G and the allowed moves in S.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def PiBase.banachMazur (X : Type u) (S : Set X) (W : Set (Set X)) :
                                Game (Set X)

                                Banach Mazur game. Usually there are conditions on X (should be topological space) and W (each member ought to have nonempty interior), but this isn't needed for the definition.

                                Equations
                                Instances For
                                  def PiBase.g1Game {X : Type u} (A B : Set (Set X)) :
                                  Game (Set X)
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def PiBase.gFinGame {X : Type u} (A B : Set (Set X)) :
                                    Game (Set X)
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def PiBase.wGame {X : Type u} [TopologicalSpace X] (x : X) :
                                      Game (X × Set X)

                                      See https://topology.pi-base.org/properties/P187

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

                                        See https://topology.pi-base.org/properties/P206

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          def PiBase.proximalGame (X : Type u) [UniformSpace X] [Inhabited X] :
                                          Game (X × Set (X × X))

                                          The proximal game. The condition Inhabited X is an implementation detail; in theory it could also be played on the empty space, but that makes the lean definition much uglier.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem PiBase.map_ofFun {A : Type u} {B : Type v} (e : BA) (b : B) (k : ) :
                                            List.map e (List.ofFun b k) = List.ofFun (fun (n : ) => e (b n)) k
                                            theorem PiBase.map_ltakeHalf {A : Type u} {B : Type v} (e : BA) (l : List B) (n : ) :
                                            theorem PiBase.map_rtakeHalf {A : Type u} {B : Type v} (e : BA) (l : List B) (n : ) :
                                            theorem PiBase.isPayoff_ofAllowed_iff {A : Type u} {B : Type v} {G : Game A} {H : Game B} {SA : AllowedMoves A} {SB : AllowedMoves B} (e : BA) (hS : ∀ (l : List B), SB l SA (List.map e l)) (b : B) (hP : H.IsPayoff b G.IsPayoff fun (n : ) => e (b n)) :
                                            (H.ofAllowed SB).IsPayoff b (G.ofAllowed SA).IsPayoff fun (n : ) => e (b n)

                                            Transport of a payoff condition through a relabelling e of the moves, for games built with Game.ofAllowed.

                                            theorem PiBase.HasWinningStrategyA.of_equiv {A : Type u} {B : Type v} {G : Game A} {H : Game B} (e : B A) (hP : ∀ (b : B), (G.IsPayoff fun (n : ) => e (b n))H.IsPayoff b) (hG : HasWinningStrategyA G) :

                                            Transport a winning strategy for player A along an equivalence of moves.

                                            theorem PiBase.HasWinningStrategyB.of_equiv {A : Type u} {B : Type v} {G : Game A} {H : Game B} (e : B A) (hP : ∀ (b : B), H.IsPayoff bG.IsPayoff fun (n : ) => e (b n)) (hG : HasWinningStrategyB G) :

                                            Transport a winning strategy for player B along an equivalence of moves.

                                            theorem PiBase.HasMarkovKWinningStrategyB.of_equiv {A : Type u} {B : Type v} {G : Game A} {H : Game B} {k : } (e : B A) (hP : ∀ (b : B), H.IsPayoff bG.IsPayoff fun (n : ) => e (b n)) (hG : HasMarkovKWinningStrategyB G k) :

                                            The k-Markov analogue of HasWinningStrategyB.of_equiv.

                                            theorem PiBase.familyEquiv_apply {V : Type u} {W : Type v} (e : V W) (S : Set V) :
                                            (Equiv.Set.congr e) S = e '' S
                                            theorem PiBase.familyEquiv_symm_apply {V : Type u} {W : Type v} (e : V W) (T : Set W) :
                                            @[simp]
                                            theorem PiBase.familyEquiv_empty {V : Type u} {W : Type v} (e : V W) :
                                            theorem PiBase.familyEquiv_mem_iff {V : Type u} {W : Type v} (e : V W) {S : Set V} {a : V} :
                                            e a (Equiv.Set.congr e) S a S
                                            theorem PiBase.familyEquiv_singleton {V : Type u} {W : Type v} (e : V W) (a : V) :
                                            theorem PiBase.familyEquiv_iUnion {V : Type u} {W : Type v} (e : V W) (s : Set V) :
                                            (Equiv.Set.congr e) (⋃ (n : ), s n) = ⋃ (n : ), (Equiv.Set.congr e) (s n)
                                            @[simp]
                                            theorem PiBase.familyEquiv_finite {V : Type u} {W : Type v} (e : V W) (S : Set V) :
                                            @[simp]
                                            theorem PiBase.familyEquiv_subset {V : Type u} {W : Type v} (e : V W) (S T : Set V) :
                                            (Equiv.Set.congr e) S(Equiv.Set.congr e) T ST
                                            theorem PiBase.familyEquiv_exists_singleton {V : Type u} {W : Type v} (e : V W) (S T : Set V) :
                                            (∃ (a : W), (Equiv.Set.congr e) S = {a} a (Equiv.Set.congr e) T) ∃ (a : V), S = {a} a T
                                            def PiBase.g1Allowed {V : Type u_1} (A : Set (Set V)) :

                                            The allowed moves of a g1Game.

                                            Equations
                                            Instances For
                                              def PiBase.gFinAllowed {V : Type u_1} (A : Set (Set V)) :

                                              The allowed moves of a gFinGame.

                                              Equations
                                              Instances For
                                                theorem PiBase.g1Allowed_iff {V : Type u} {W : Type v} (e : V W) {A : Set (Set V)} {A' : Set (Set W)} (hA : ∀ (S : Set V), (Equiv.Set.congr e) S A' S A) (l : List (Set V)) :
                                                theorem PiBase.gFinAllowed_iff {V : Type u} {W : Type v} (e : V W) {A : Set (Set V)} {A' : Set (Set W)} (hA : ∀ (S : Set V), (Equiv.Set.congr e) S A' S A) (l : List (Set V)) :
                                                theorem PiBase.selectionPayoff_iff {V : Type u} {W : Type v} (e : V W) {B : Set (Set V)} {B' : Set (Set W)} (hB : ∀ (S : Set V), (Equiv.Set.congr e) S B' S B) (b : Set V) :
                                                ⋃ (n : ), b (2 * n + 1)B ⋃ (n : ), (Equiv.Set.congr e) (b (2 * n + 1))B'
                                                theorem PiBase.g1Game_isPayoff_iff {V : Type u} {W : Type v} (e : V W) {A : Set (Set V)} {A' : Set (Set W)} {B : Set (Set V)} {B' : Set (Set W)} (hA : ∀ (S : Set V), (Equiv.Set.congr e) S A' S A) (hB : ∀ (S : Set V), (Equiv.Set.congr e) S B' S B) (b : Set V) :
                                                (g1Game A B).IsPayoff b (g1Game A' B').IsPayoff fun (n : ) => (Equiv.Set.congr e) (b n)
                                                theorem PiBase.gFinGame_isPayoff_iff {V : Type u} {W : Type v} (e : V W) {A : Set (Set V)} {A' : Set (Set W)} {B : Set (Set V)} {B' : Set (Set W)} (hA : ∀ (S : Set V), (Equiv.Set.congr e) S A' S A) (hB : ∀ (S : Set V), (Equiv.Set.congr e) S B' S B) (b : Set V) :
                                                (gFinGame A B).IsPayoff b (gFinGame A' B').IsPayoff fun (n : ) => (Equiv.Set.congr e) (b n)

                                                Transporting topological move families #

                                                def PiBase.preimageSetEquiv {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) :
                                                Set Y Set X

                                                Taking preimages under a homeomorphism is a bijection between subsets.

                                                Equations
                                                Instances For
                                                  @[simp]
                                                  theorem PiBase.preimageSetEquiv_apply {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (t : Set Y) :
                                                  (preimageSetEquiv φ) t = φ ⁻¹' t
                                                  def PiBase.preimageFamilyEquiv {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) :
                                                  Set (Set Y) Set (Set X)

                                                  Taking preimages under a homeomorphism is a bijection between families of subsets.

                                                  Equations
                                                  Instances For
                                                    theorem PiBase.preimageFamilyEquiv_iUnion {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (s : Set (Set Y)) :
                                                    (preimageFamilyEquiv φ) (⋃ (n : ), s n) = ⋃ (n : ), (preimageFamilyEquiv φ) (s n)
                                                    @[simp]
                                                    @[simp]
                                                    theorem PiBase.preimageFamilyEquiv_subset {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (S T : Set (Set Y)) :
                                                    (preimageFamilyEquiv φ) S(preimageFamilyEquiv φ) T ST
                                                    @[simp]
                                                    theorem PiBase.preimageFamilyEquiv_mem_openCovers' {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (S : Set (Set Y)) :
                                                    (preimageFamilyEquiv φ) S {A : Set (Set X) | ⋃₀ A = Set.univ sA, IsOpen s} S {A : Set (Set Y) | ⋃₀ A = Set.univ sA, IsOpen s}
                                                    theorem PiBase.mengerGame_isPayoff_iff {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (b : Set (Set Y)) :

                                                    The payoff conditions of the Menger games correspond under a homeomorphism.

                                                    @[simp]
                                                    theorem PiBase.prodMap_symm_prodMap {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (p : X × X) :
                                                    Prod.map (⇑φ.symm) (⇑φ.symm) (Prod.map (⇑φ) (⇑φ) p) = p
                                                    @[simp]
                                                    theorem PiBase.prodMap_prodMap_symm {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (p : Y × Y) :
                                                    Prod.map (⇑φ) (⇑φ) (Prod.map (⇑φ.symm) (⇑φ.symm) p) = p
                                                    def PiBase.preimageRelEquiv {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) :
                                                    Set (Y × Y) Set (X × X)
                                                    Equations
                                                    Instances For
                                                      @[simp]
                                                      theorem PiBase.preimageRelEquiv_apply {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (V : Set (Y × Y)) :
                                                      (preimageRelEquiv φ) V = Prod.map φ φ ⁻¹' V
                                                      def PiBase.proximalMoveEquiv {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) :
                                                      Y × Set (Y × Y) X × Set (X × X)
                                                      Equations
                                                      Instances For
                                                        @[simp]
                                                        theorem PiBase.proximalMoveEquiv_fst {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (p : Y × Set (Y × Y)) :
                                                        ((proximalMoveEquiv φ) p).1 = φ.symm p.1
                                                        @[simp]
                                                        theorem PiBase.proximalMoveEquiv_snd {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (p : Y × Set (Y × Y)) :
                                                        ((proximalMoveEquiv φ) p).2 = Prod.map φ φ ⁻¹' p.2
                                                        @[simp]
                                                        theorem PiBase.preimage_prodMap_subset_iff {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (V W : Set (Y × Y)) :
                                                        Prod.map φ φ ⁻¹' VProd.map φ φ ⁻¹' W VW
                                                        @[simp]
                                                        theorem PiBase.preimage_prodMap_eq_iff {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (V W : Set (Y × Y)) :
                                                        Prod.map φ φ ⁻¹' V = Prod.map φ φ ⁻¹' W V = W
                                                        theorem PiBase.slice_preimage_prodMap {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (y : Y) (V : Set (Y × Y)) :
                                                        Prod.mk (φ.symm y) ⁻¹' Prod.map φ φ ⁻¹' V = φ ⁻¹' Prod.mk y ⁻¹' V
                                                        theorem PiBase.exists_tendsto_comp_iff {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] (φ : X ≃ₜ Y) (f : Y) :
                                                        (∃ (z : X), Filter.Tendsto (fun (n : ) => φ.symm (f n)) Filter.atTop (nhds z)) ∃ (z : Y), Filter.Tendsto f Filter.atTop (nhds z)