Documentation

Gametheory.Scarf

theorem injOn_sdiff {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] (s : Finset α) (f : αβ) (h : s.card = (Finset.image f s).card + 1) :
∃ (a : α) (b : α), a s b s f a = f b a b Set.InjOn f (s \ {a, b})
class IndexedLOrder (I : Type u_3) (T : Type u_4) :
Type (max u_3 u_4)
Instances
    @[instance_reducible]
    Equations
    def IndexedLOrder.isDominant {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ : Finset T) (C : Finset I) :
    Equations
    Instances For
      theorem IndexedLOrder.Nonempty_of_Dominant {T : Type u_1} [Inhabited T] {I : Type u_2} [IST : IndexedLOrder I T] {σ : Finset T} {C : Finset I} (h : isDominant σ C) :
      theorem IndexedLOrder.Dominant_of_subset {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ τ : Finset T) (C : Finset I) :
      τσisDominant σ CisDominant τ C
      theorem IndexedLOrder.Dominant_of_supset {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ : Finset T) (C D : Finset I) :
      CDisDominant σ CisDominant σ D
      @[reducible, inline]
      abbrev IndexedLOrder.mini {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] {σ : Finset T} (h2 : σ.Nonempty) (i : I) :
      T
      Equations
      Instances For
        theorem IndexedLOrder.keylemma_of_dominant {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] {σ : Finset T} {C : Finset I} (h1 : isDominant σ C) (h2 : σ.Nonempty) :
        σ = Finset.image (mini h2) C
        theorem IndexedLOrder.card_le_of_domiant {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] {σ : Finset T} {C : Finset I} (h1 : isDominant σ C) :
        theorem IndexedLOrder.empty_Dominant {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] {D : Finset I} (h : D.Nonempty) :
        @[reducible, inline]
        abbrev IndexedLOrder.isCell {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ : Finset T) (C : Finset I) :
        Equations
        Instances For
          @[reducible, inline]
          abbrev IndexedLOrder.isRoom {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ : Finset T) (C : Finset I) :
          Equations
          Instances For
            theorem IndexedLOrder.sigma_nonempty_of_room {T : Type u_1} [Inhabited T] {I : Type u_2} [IST : IndexedLOrder I T] {σ : Finset T} {C : Finset I} (h : isRoom σ C) :
            @[reducible, inline]
            abbrev IndexedLOrder.isDoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ : Finset T) (C : Finset I) :
            Equations
            Instances For
              inductive IndexedLOrder.isDoorof {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (τ : Finset T) (D : Finset I) (σ : Finset T) (C : Finset I) :
              Instances For
                theorem IndexedLOrder.isCell_of_door {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ : Finset T) (C : Finset I) [DecidableEq T] [DecidableEq I] {τ : Finset T} {D : Finset I} (h1 : isDoorof τ D σ C) :
                isCell τ D
                theorem IndexedLOrder.isRoom_of_Door {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] {σ : Finset T} {C : Finset I} [DecidableEq T] [DecidableEq I] {τ : Finset T} {D : Finset I} (h1 : isDoorof τ D σ C) :
                isRoom σ C
                theorem IndexedLOrder.room_is_not_door {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (σ : Finset T) (C : Finset I) [DecidableEq T] [DecidableEq I] (h1 : isRoom σ C) (τ : Finset T) (D : Finset I) :
                ¬isDoorof σ C τ D
                @[reducible, inline]
                abbrev IndexedLOrder.isOutsideDoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (τ : Finset T) (D : Finset I) :
                Equations
                Instances For
                  @[reducible, inline]
                  abbrev IndexedLOrder.isInternalDoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (τ : Finset T) (D : Finset I) :
                  Equations
                  Instances For
                    theorem IndexedLOrder.outsidedoor_is_singleton {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] {τ : Finset T} {D : Finset I} (h : isOutsideDoor τ D) :
                    τ = Finset.empty ∃ (i : I), D = {i}
                    def IndexedLOrder.M_set {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (τ : Finset T) (D : Finset I) (i : I) (h_nonempty : τ.Nonempty) :
                    Set T
                    Equations
                    Instances For
                      def IndexedLOrder.is_maximal_in_M_set {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] (τ : Finset T) (D : Finset I) (i : I) (h_nonempty : τ.Nonempty) (x : T) :
                      Equations
                      Instances For
                        noncomputable def IndexedLOrder.m_element {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [Fintype T] (τ : Finset T) (D : Finset I) (i : I) (h_nonempty : τ.Nonempty) (h : (M_set τ D i h_nonempty).Nonempty) :
                        T
                        Equations
                        Instances For
                          theorem IndexedLOrder.m_element_is_maximal {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [Fintype T] (τ : Finset T) (D : Finset I) (i : I) (h_nonempty : τ.Nonempty) (h : (M_set τ D i h_nonempty).Nonempty) :
                          is_maximal_in_M_set τ D i h_nonempty (m_element τ D i h_nonempty h)
                          theorem IndexedLOrder.sublemma_3_1 {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] [Fintype T] (τ : Finset T) (D : Finset I) (h_door : isDoor τ D) (h_nonempty : τ.Nonempty) (i : I) :
                          i D → (isDominant τ (D.erase i) ∃ (a : I) (b : I), a D b D a b mini h_nonempty a = mini h_nonempty b (i = a i = b) M_set τ D i h_nonempty = )
                          theorem IndexedLOrder.sublemma_3_2 {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] [Fintype T] (τ : Finset T) (D : Finset I) (x : T) (h_door : isDoor τ D) (h_nonempty : τ.Nonempty) (h_not_mem : xτ) (a b : I) (ha : a D) (hb : b D) (hab : a b) (h_eq : mini h_nonempty a = mini h_nonempty b) :
                          isDominant (insert x τ) D i{a, b}, (M_set τ D i h_nonempty).Nonempty is_maximal_in_M_set τ D i h_nonempty x
                          theorem IndexedLOrder.M_sets_disjoint {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] [Fintype T] (τ : Finset T) (D : Finset I) (a b : I) (h_nonempty : τ.Nonempty) (h_door : isDoor τ D) (ha : a D) (hb : b D) (hab : a b) (h_eq : mini h_nonempty a = mini h_nonempty b) :
                          M_set τ D a h_nonempty M_set τ D b h_nonempty =
                          theorem IndexedLOrder.m_element_not_in_tau {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] [Fintype T] (τ : Finset T) (D : Finset I) (i a b : I) (h_door : isDoor τ D) (h_nonempty : τ.Nonempty) (ha_mem : a D) (hb_mem : b D) (hab : a b) (h_eq_mini : mini h_nonempty a = mini h_nonempty b) (h_M_nonempty : (M_set τ D i h_nonempty).Nonempty) (h_i_is : i = a i = b) :
                          m_element τ D i h_nonempty h_M_nonemptyτ
                          theorem IndexedLOrder.odoor_index_in_pair {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] [Fintype T] (τ : Finset T) (D C : Finset I) (a b j : I) (_h_door : isDoor τ D) (h_nonempty : τ.Nonempty) (ha_mem : a D) (hb_mem : b D) (hab : a b) (h_eq_mini : mini h_nonempty a = mini h_nonempty b) (h_dom : isDominant τ C) (h_room_card : C.card = τ.card) (_hj_not_mem : jC) (hc_eq : D = insert j C) :
                          j {a, b}
                          theorem IndexedLOrder.maximal_element_unique {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [Fintype T] (τ : Finset T) (D : Finset I) (i : I) (h_nonempty : τ.Nonempty) (h_M_nonempty : (M_set τ D i h_nonempty).Nonempty) (x : T) (h_x_max : is_maximal_in_M_set τ D i h_nonempty x) :
                          x = m_element τ D i h_nonempty h_M_nonempty
                          theorem IndexedLOrder.idoor_determines_element {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] [Fintype T] (τ : Finset T) (D : Finset I) (a b : I) (h_door : isDoor τ D) (h_nonempty : τ.Nonempty) (ha_mem : a D) (hb_mem : b D) (hab : a b) (h_eq_mini : mini h_nonempty a = mini h_nonempty b) (h_Ma_nonempty : (M_set τ D a h_nonempty).Nonempty) (h_Mb_nonempty : (M_set τ D b h_nonempty).Nonempty) (x : T) (h_room : isRoom (insert x τ) D) (hx_not_mem : xτ) :
                          x = m_element τ D a h_nonempty h_Ma_nonempty x = m_element τ D b h_nonempty h_Mb_nonempty
                          theorem IndexedLOrder.internal_door_two_rooms {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] [Fintype T] (τ : Finset T) (D : Finset I) (h_int_door : isInternalDoor τ D) :
                          ∃ (σ₁ : Finset T) (σ₂ : Finset T) (C₁ : Finset I) (C₂ : Finset I), (σ₁, C₁) (σ₂, C₂) isRoom σ₁ C₁ isRoom σ₂ C₂ isDoorof τ D σ₁ C₁ isDoorof τ D σ₂ C₂ ∀ (σ : Finset T) (C : Finset I), isRoom σ CisDoorof τ D σ Cσ = σ₁ C = C₁ σ = σ₂ C = C₂
                          def IndexedLOrder.isColorful {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] (c : TI) (σ : Finset T) (C : Finset I) :
                          Equations
                          Instances For
                            def IndexedLOrder.isNearlyColorful {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] (c : TI) (σ : Finset T) (C : Finset I) :
                            Equations
                            Instances For
                              def IndexedLOrder.isTypedNC {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] (c : TI) (i : I) (σ : Finset T) (C : Finset I) :
                              Equations
                              Instances For
                                theorem IndexedLOrder.not_colorful_of_TypedNC {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} {i : I} (h1 : isTypedNC c i σ C) :
                                theorem IndexedLOrder.NC_of_TNC {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} {i : I} (h1 : isTypedNC c i σ C) :
                                theorem IndexedLOrder.Finset.eq_of_mem_of_card_one {α : Type u_3} [DecidableEq α] {s : Finset α} {a : α} (h_mem : a s) (h_card : s.card = 1) :
                                s = {a}
                                theorem IndexedLOrder.room_of_colorful {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} (h : isColorful c σ C) :
                                isRoom σ C
                                noncomputable def IndexedLOrder.pick_colorful_point {T : Type u_1} [Inhabited T] {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} (h : isColorful c σ C) :
                                σ
                                Equations
                                Instances For
                                  theorem IndexedLOrder.NC_of_outsidedoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} (h : isOutsideDoor σ C) :
                                  theorem IndexedLOrder.NC_or_C_of_door {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} {i : I} {τ : Finset T} {D : Finset I} (h1 : isTypedNC c i τ D) (h2 : isDoorof τ D σ C) :
                                  isTypedNC c i σ C isColorful c σ C
                                  theorem IndexedLOrder.NCtype_of_door {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} {i : I} {τ : Finset T} {D : Finset I} (h1 : isTypedNC c i τ D) :
                                  isDoorof τ D σ CisTypedNC c i σ CisTypedNC c i τ D
                                  theorem IndexedLOrder.isTypedNC_of_isNearlyColorful_of_isDoorof_isTypedNC {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} {τ : Finset T} {D : Finset I} {i : I} (h_nc : isNearlyColorful c τ D) (h_door : isDoorof τ D σ C) (h_room_typed : isTypedNC c i σ C) :
                                  isTypedNC c i τ D
                                  theorem IndexedLOrder.card_of_NCcell {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {D : Finset I} (h : isNearlyColorful c σ D) :
                                  σ.card = (Finset.image c σ).card σ.card = (Finset.image c σ).card + 1
                                  theorem IndexedLOrder.image_subset_of_NCdoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} (h1 : isNearlyColorful c σ C) (h2 : isDoor σ C) :
                                  Finset.image c σC
                                  theorem IndexedLOrder.image_erase_eq_erase_image_of_unique {T : Type u_3} {I : Type u_4} [DecidableEq T] [DecidableEq I] (σ : Finset T) (c : TI) {z : T} :
                                  z σ∀ (uniq : ∀ ⦃w : T⦄, w σc w = c zw = z), Finset.image c (σ.erase z) = (Finset.image c σ).erase (c z)
                                  @[reducible, inline]
                                  abbrev IndexedLOrder.NCdoors {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) (σ : Finset T) (C : Finset I) :
                                  Equations
                                  Instances For
                                    theorem IndexedLOrder.three_collision_card_bound {T : Type u_1} {I : Type u_2} [DecidableEq I] [DecidableEq T] (σ : Finset T) (c : TI) (a b z : T) (ha_in_σ : a σ) (hb_in_σ : b σ) (hz_in_σ : z σ) (hab_ne : a b) (haz_ne : a z) (hbz_ne : b z) (hc_eq : c a = c b) (hcz_eq : c b = c z) :
                                    σ.card (Finset.image c σ).card + 2
                                    theorem IndexedLOrder.image_erase_collision_preserves {T : Type u_1} {I : Type u_2} [DecidableEq I] [DecidableEq T] (σ : Finset T) (c : TI) (x y : T) (hx_in_σ : x σ) (hy_in_σ : y σ) (hxy_ne : x y) (hcxy_eq : c x = c y) :
                                    theorem IndexedLOrder.collision_door_valid {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] [DecidableEq T] (σ : Finset T) (C : Finset I) :
                                    ∀ (x : TI) (x : T) (h_cell : isCell σ C) (hx_in_σ : x σ) (h_card_eq : C.card = σ.card), isDoorof (σ.erase x) C σ C
                                    theorem IndexedLOrder.doors_of_NCroom {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} [DecidableEq T] (h_room : isRoom σ C) (h_nc : isNearlyColorful c σ C) :
                                    ∃ (door1 : Finset T × Finset I) (door2 : Finset T × Finset I), door1 door2 NCdoors c σ C = {door1, door2}
                                    @[reducible, inline]
                                    noncomputable abbrev IndexedLOrder.colorful {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] :
                                    Equations
                                    Instances For
                                      @[reducible, inline]
                                      noncomputable abbrev IndexedLOrder.dbcountingset {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] (i : I) :
                                      Equations
                                      Instances For
                                        theorem IndexedLOrder.dbcount_outside_door' {T : Type u_1} [Inhabited T] {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] (i : I) :
                                        ∃ (x : (Finset T × Finset I) × Finset T × Finset I), {xdbcountingset c i | isOutsideDoor x.1.1 x.1.2} = {x}
                                        theorem IndexedLOrder.dbcount_outside_door_odd {T : Type u_1} [Inhabited T] {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] (i : I) :
                                        Odd {xdbcountingset c i | isOutsideDoor x.1.1 x.1.2}.card
                                        theorem IndexedLOrder.fiber_size_internal_door {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] [Fintype T] [Fintype I] (c : TI) (i : I) (y : Finset T × Finset I) (hy_internal : isInternalDoor y.1 y.2) (hy_typed : isTypedNC c i y.1 y.2) :
                                        have s := {xdbcountingset c i | ¬isOutsideDoor x.1.1 x.1.2}; have f := fun (x : (Finset T × Finset I) × Finset T × Finset I) => x.1; {as | f a = y}.card = 2
                                        theorem IndexedLOrder.dbcount_internal_door_even {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] (i : I) :
                                        Even {xdbcountingset c i | ¬isOutsideDoor x.1.1 x.1.2}.card
                                        theorem IndexedLOrder.NC_of_NCdoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} {i : I} {τ : Finset T} {D : Finset I} (h1 : isTypedNC c i τ D) (h2 : isDoorof τ D σ C) :
                                        ¬isColorful c σ CisTypedNC c i σ C
                                        theorem IndexedLOrder.firber2_doors_NCroom {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] {c : TI} {σ : Finset T} {C : Finset I} [Fintype T] [Fintype I] {i : I} (h0 : isRoom σ C) (h1 : isTypedNC c i σ C) :
                                        {xdbcountingset c i | x.2 = (σ, C)}.card = 2
                                        theorem IndexedLOrder.dbcount_NCroom {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] (i : I) :
                                        Even {xdbcountingset c i | ¬isColorful c x.2.1 x.2.2}.card
                                        theorem IndexedLOrder.parity_lemma {a b c d : } (h1 : Odd a) (h2 : Even b) (h3 : Even d) (h4 : a + b = c + d) :
                                        Odd c
                                        theorem Finset.card_filter_filter_neg {α : Type u_3} (s : Finset α) (p : αProp) [DecidablePred p] :
                                        s.card = (filter p s).card + {as | ¬p a}.card
                                        theorem IndexedLOrder.typed_colorful_room_odd {T : Type u_1} [Inhabited T] {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] (i : I) :
                                        Odd {xdbcountingset c i | isColorful c x.2.1 x.2.2}.card
                                        theorem IndexedLOrder.Scarf {T : Type u_1} [Inhabited T] {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] (c : TI) [Fintype T] [Fintype I] [Inhabited I] :