Documentation

CslibFrontier.GameTheory.FairDivision.Basic

Cake-Cutting Valuations, Interval Partitions, and Robertson–Webb Queries #

Foundational definitions for proportional and envy-free cake cutting on [0, 1] ([Ste48]; [DS61]; [RW98]):

Main definitions #

Main results #

References #

Nonatomic cake valuations on [0, 1] #

A nonatomic finite additive normalized valuation over subintervals of [0, 1].

val a b is the value assigned to [a, b]. Normalization fixes val 0 1 = 1, degenerate and reversed intervals have value 0, subintervals of [0, 1] are nonnegative and finitely additive, and x ↦ val 0 x is continuous on [0, 1].

  • val : ℝ → ℝ → ℝ

    Value assigned to the subinterval [a, b].

  • val_zero_one : self.val 0 1 = 1

    Total value of [0, 1] is 1.

  • val_of_ge ⦃a b : ℝ⦄ : b ≤ a → self.val a b = 0

    Degenerate (a = b) and reversed (b < a) intervals have value 0.

  • val_nonneg ⦃a b : ℝ⦄ : 0 ≤ a → b ≤ 1 → 0 ≤ self.val a b

    Every subinterval of [0, 1] has nonnegative value.

  • val_add ⦃a b c : ℝ⦄ : 0 ≤ a → a ≤ b → b ≤ c → c ≤ 1 → self.val a b + self.val b c = self.val a c

    Finite additivity across adjacent subintervals of [0, 1].

  • continuousOn : ContinuousOn (self.val 0) (Set.Icc 0 1)

    Continuity of cumulative valuation x ↦ val 0 x on [0, 1].

Instances For
    @[simp]
    theorem Cslib.GameTheory.FairDivision.CakeValuation.coe_mk (f : ℝ → ℝ → ℝ) (h01 : f 0 1 = 1) (hge : ∀ ⦃a b : ℝ⦄, b ≤ a → f a b = 0) (hnn : ∀ ⦃a b : ℝ⦄, 0 ≤ a → b ≤ 1 → 0 ≤ f a b) (hadd : ∀ ⦃a b c : ℝ⦄, 0 ≤ a → a ≤ b → b ≤ c → c ≤ 1 → f a b + f b c = f a c) (hcont : ContinuousOn (f 0) (Set.Icc 0 1)) :
    { val := f, val_zero_one := h01, val_of_ge := hge, val_nonneg := hnn, val_add := hadd, continuousOn := hcont }.val = f
    @[simp]

    Singletons carry value 0 (nonatomicity).

    @[simp]

    Whole-cake normalization v 0 1 = 1 on coerced applications.

    theorem Cslib.GameTheory.FairDivision.CakeValuation.apply_eq_sub (v : CakeValuation) {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) :
    v.val a b = v.val 0 b - v.val 0 a

    Express any subinterval [a, b] ⊆ [0, 1] as the increment v 0 b - v 0 a.

    theorem Cslib.GameTheory.FairDivision.CakeValuation.apply_mono (v : CakeValuation) {a b c d : ℝ} (hc : 0 ≤ c) (hca : c ≤ a) (hbd : b ≤ d) (hd : d ≤ 1) :
    v.val a b ≤ v.val c d

    Inclusion monotonicity: [a, b] ⊆ [c, d] ⊆ [0, 1] implies v a b ≤ v c d.

    theorem Cslib.GameTheory.FairDivision.CakeValuation.apply_mono_right (v : CakeValuation) {a x y : ℝ} (ha : 0 ≤ a) (hxy : x ≤ y) (hy : y ≤ 1) :
    v.val a x ≤ v.val a y

    Right-endpoint monotonicity: x ≤ y ≤ 1 with 0 ≤ a gives v a x ≤ v a y.

    Continuity of x ↦ v a x on [a, 1] for any 0 ≤ a.

    theorem Cslib.GameTheory.FairDivision.CakeValuation.exists_cut (v : CakeValuation) {a α : ℝ} (ha0 : 0 ≤ a) (ha1 : a ≤ 1) (hα0 : 0 ≤ α) (hα1 : α ≤ v.val a 1) :
    ∃ x ∈ Set.Icc a 1, v.val a x = α

    Intermediate-value cut existence: for a ∈ [0, 1] and 0 ≤ α ≤ v a 1, there exists a cut point x ∈ [a, 1] with v a x = α.

    noncomputable def Cslib.GameTheory.FairDivision.CakeValuation.ofCDF (F : ℝ → ℝ) (h0 : F 0 = 0) (h1 : F 1 = 1) (hmono : MonotoneOn F (Set.Icc 0 1)) (hcont : ContinuousOn F (Set.Icc 0 1)) :

    Construct a CakeValuation from a cumulative distribution function F : ℝ → ℝ satisfying F 0 = 0, F 1 = 1, monotonicity on [0, 1], and continuity on [0, 1].

    @[simp]
    theorem Cslib.GameTheory.FairDivision.CakeValuation.ofCDF_apply_of_le (F : ℝ → ℝ) (h0 : F 0 = 0) (h1 : F 1 = 1) (hmono : MonotoneOn F (Set.Icc 0 1)) (hcont : ContinuousOn F (Set.Icc 0 1)) {a b : ℝ} (hab : a ≤ b) :
    (ofCDF F h0 h1 hmono hcont).val a b = F b - F a

    The uniform Lebesgue cake valuation on [0, 1], assigning b - a to [a, b] (a ≤ b).

    noncomputable def Cslib.GameTheory.FairDivision.CakeValuation.convexComb (w : ℝ) (hw0 : 0 ≤ w) (hw1 : w ≤ 1) (v₁ v₂ : CakeValuation) :

    Convex combination w · v₁ + (1 - w) · v₂ (w ∈ [0, 1]) of two cake valuations.

    @[simp]
    theorem Cslib.GameTheory.FairDivision.CakeValuation.convexComb_apply (w : ℝ) (hw0 : 0 ≤ w) (hw1 : w ≤ 1) (v₁ v₂ : CakeValuation) (a b : ℝ) :
    (convexComb w hw0 hw1 v₁ v₂).val a b = w * v₁.val a b + (1 - w) * v₂.val a b
    noncomputable def Cslib.GameTheory.FairDivision.CakeValuation.affine (slope : ℝ) (hlo : -2 ≤ slope) (hhi : slope ≤ 2) :

    Affine-density valuation on [0, 1] with density 1 + slope · (x - 1/2) (slope ∈ [-2, 2]), cumulative distribution F(x) = x + (slope / 2) · x · (x - 1).

    @[simp]
    theorem Cslib.GameTheory.FairDivision.CakeValuation.affine_apply_of_le (slope : ℝ) (hlo : -2 ≤ slope) (hhi : slope ≤ 2) {a b : ℝ} (hab : a ≤ b) :
    (affine slope hlo hhi).val a b = b + slope / 2 * b * (b - 1) - (a + slope / 2 * a * (a - 1))
    noncomputable def Cslib.GameTheory.FairDivision.CakeValuation.uniformOn (l r : ℝ) (hl : 0 ≤ l) (hlr : l < r) (hr : r ≤ 1) :

    Piecewise-uniform valuation supported uniformly on [l, r] ⊆ [0, 1] (l < r), assigning density 1 / (r - l) on [l, r] and 0 outside [l, r].

    @[simp]
    theorem Cslib.GameTheory.FairDivision.CakeValuation.uniformOn_apply_of_le (l r : ℝ) (hl : 0 ≤ l) (hlr : l < r) (hr : r ≤ 1) {a b : ℝ} (hab : a ≤ b) :
    (uniformOn l r hl hlr hr).val a b = (min r (max l b) - l) / (r - l) - (min r (max l a) - l) / (r - l)

    Interval pieces, bundles, and ordered cut partitions #

    A closed subinterval [left, right] of the cake [0, 1].

    • left : ℝ

      Left endpoint of the piece.

    • right : ℝ

      Right endpoint of the piece.

    Instances For
      theorem Cslib.GameTheory.FairDivision.CakePiece.ext {x y : CakePiece} (left : x.left = y.left) (right : x.right = y.right) :
      x = y

      Additive value assigned by v to a finite bundle of interval pieces.

      Permuting the pieces of a bundle preserves its value.

      Every bundle of pieces contained in [0, 1] has nonnegative value.

      OrderedCutsOn a b cuts asserts a ≤ c₁ ≤ … ≤ cₖ ≤ b (a ≤ b when cuts = []).

      theorem Cslib.GameTheory.FairDivision.orderedCutsOn_append_cons {a b c : ℝ} (cs₁ cs₂ : List ℝ) :
      OrderedCutsOn a b (cs₁ ++ c :: cs₂) ↔ OrderedCutsOn a c cs₁ ∧ OrderedCutsOn c b cs₂

      Splitting/joining ordered cut lists across a middle cut c.

      Elementary adjacent pieces tiling [a, b] along interior cut points cuts.

      Elementary adjacent pieces tiling [0, 1] along interior cut points cuts.

      theorem Cslib.GameTheory.FairDivision.intervalsOfCutsOn_append_cons (a b c : ℝ) (cs₁ cs₂ : List ℝ) :
      intervalsOfCutsOn a b (cs₁ ++ c :: cs₂) = intervalsOfCutsOn a c cs₁ ++ intervalsOfCutsOn c b cs₂

      Decomposing intervalsOfCutsOn across an interior cut point c.

      Every piece produced by OrderedCutsOn a b cuts lies inside [a, b] with left ≤ right.

      theorem Cslib.GameTheory.FairDivision.iUnion_Icc_intervalsOfCutsOn {a b : ℝ} {cuts : List ℝ} (hord : OrderedCutsOn a b cuts) :
      ⋃ p ∈ intervalsOfCutsOn a b cuts, Set.Icc p.left p.right = Set.Icc a b

      The closed intervals of intervalsOfCutsOn a b cuts cover Set.Icc a b exactly.

      Distinct pieces in intervalsOfCutsOn a b cuts have disjoint open interiors.

      theorem Cslib.GameTheory.FairDivision.bundleVal_intervalsOfCutsOn (v : CakeValuation) {a b : ℝ} {cuts : List ℝ} (ha : 0 ≤ a) (hb : b ≤ 1) (hord : OrderedCutsOn a b cuts) :
      v.bundleVal (intervalsOfCutsOn a b cuts) = v.val a b

      Value conservation on [a, b]: ordered cuts partition the value v a b exactly.

      Value conservation on [0, 1]: ordered cuts sum to 1 under every CakeValuation.

      Cake divisions, proportionality, and envy-freeness #

      A discrete division of [0, 1] among n agents, pairing the ordered interior cut points cuts with each agent's bundle of interval pieces pieces i.

      • cuts : List ℝ

        Ordered interior cut points 0 ≤ c₁ ≤ … ≤ cₖ ≤ 1.

      • pieces : Fin n → List CakePiece

        Interval bundle assigned to agent i : Fin n.

      Number of physical cuts made on [0, 1].

      Multiset/list concatenation of all pieces assigned across all n agents.

      D validly partitions [0, 1] along D.cuts: the cut points satisfy 0 ≤ c₁ ≤ … ≤ cₖ ≤ 1, and the assigned bundles across all agents permute the elementary pieces intervalsOfCuts D.cuts.

      A division is contiguous if every agent receives a single interval piece.

      A division is proportional for valuation profile v if every agent values their own bundle at least 1 / n.

      A division is envy-free for valuation profile v if every agent weakly prefers their own bundle to every other agent's bundle.

      Under any valid partition of [0, 1], any single valuation u sums to 1 across all n agents' bundles.

      Envy-freeness implies proportionality for every valid partition of [0, 1].

      Robertson–Webb query model #

      Robertson–Webb query signature ([RW98]) parameterized by agent type Agent:

      • eval i a b requests v_i([a, b]) : ℝ;
      • cut i a α requests a right endpoint x from a with v_i([a, x]) = α.
      • eval {Agent : Type} (i : Agent) (a b : ℝ) : RWQuery Agent ℝ

        Evaluate agent i's valuation of [a, b].

      • cut {Agent : Type} (i : Agent) (a α : ℝ) : RWQuery Agent ℝ

        Cut from left endpoint a a piece of value α for agent i.

      @[reducible, inline]
      abbrev Cslib.GameTheory.FairDivision.RWQuery.evalAsk {Agent : Type} (i : Agent) (a b : ℝ) :
      FreeM (RWQuery Agent) ℝ

      Lift an eval query into FreeM (RWQuery Agent) ℝ.

      @[reducible, inline]
      abbrev Cslib.GameTheory.FairDivision.RWQuery.cutAsk {Agent : Type} (i : Agent) (a α : ℝ) :
      FreeM (RWQuery Agent) ℝ

      Lift a cut query into FreeM (RWQuery Agent) ℝ.

      def Cslib.GameTheory.FairDivision.RWQuery.cutIn {Agent : Type} (i : Agent) (a b α : ℝ) :
      FreeM (RWQuery Agent) ℝ

      Issue a single cut query and clamp the returned cut point into [a, b].

      When a ≤ b, the returned point always lies in [a, b] (even against malformed oracles), and for every valid Robertson–Webb oracle with 0 ≤ α ≤ v_i(a, b) it achieves exact value v_i(a, x) = α even when v_i has zero-density regions extending past b.

      theorem Cslib.GameTheory.FairDivision.RWQuery.countQueries_evalAsk {Agent : Type} (oracle : {ι : Type} → RWQuery Agent ι → ι) (i : Agent) (a b : ℝ) :
      FreeM.countQueries (fun {ι : Type} => oracle) (evalAsk i a b) = 1
      theorem Cslib.GameTheory.FairDivision.RWQuery.countQueries_cutAsk {Agent : Type} (oracle : {ι : Type} → RWQuery Agent ι → ι) (i : Agent) (a α : ℝ) :
      FreeM.countQueries (fun {ι : Type} => oracle) (cutAsk i a α) = 1
      @[simp]
      theorem Cslib.GameTheory.FairDivision.RWQuery.countQueries_cutIn {Agent : Type} (oracle : {ι : Type} → RWQuery Agent ι → ι) (i : Agent) (a b α : ℝ) :
      FreeM.countQueries (fun {ι : Type} => oracle) (cutIn i a b α) = 1
      theorem Cslib.GameTheory.FairDivision.RWQuery.eval_cutIn_mem_Icc {Agent : Type} (oracle : {ι : Type} → RWQuery Agent ι → ι) (i : Agent) {a b : ℝ} (hab : a ≤ b) (α : ℝ) :
      FreeM.eval (fun {ι : Type} => oracle) (cutIn i a b α) ∈ Set.Icc a b

      Unconditional endpoint bounds for cutIn whenever a ≤ b.

      def Cslib.GameTheory.FairDivision.RWQuery.IsValidOracle {Agent : Type} (v : Agent → CakeValuation) (oracle : {ι : Type} → RWQuery Agent ι → ι) :

      Validity predicate for a Robertson–Webb oracle implementing valuation profile v: eval returns exact interval values, and any feasible cut query (0 ≤ a ≤ 1, 0 ≤ α ≤ v_i a 1) returns a point in [a, 1] of value α.

      theorem Cslib.GameTheory.FairDivision.RWQuery.IsValidOracle.eval_evalAsk {Agent : Type} {v : Agent → CakeValuation} {oracle : {ι : Type} → RWQuery Agent ι → ι} (ho : IsValidOracle v fun {ι : Type} => oracle) (i : Agent) (a b : ℝ) :
      FreeM.eval (fun {ι : Type} => oracle) (evalAsk i a b) = (v i).val a b
      theorem Cslib.GameTheory.FairDivision.RWQuery.IsValidOracle.eval_cutIn_spec {Agent : Type} {v : Agent → CakeValuation} {oracle : {ι : Type} → RWQuery Agent ι → ι} (ho : IsValidOracle v fun {ι : Type} => oracle) (i : Agent) {a b α : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) (hα0 : 0 ≤ α) (hαb : α ≤ (v i).val a b) :
      FreeM.eval (fun {ι : Type} => oracle) (cutIn i a b α) ∈ Set.Icc a b ∧ (v i).val a (FreeM.eval (fun {ι : Type} => oracle) (cutIn i a b α)) = α

      Under a valid Robertson–Webb oracle, cutIn i a b α on [a, b] ⊆ [0, 1] with 0 ≤ α ≤ v i a b returns a point x ∈ [a, b] satisfying v i a x = α.

      noncomputable def Cslib.GameTheory.FairDivision.RWQuery.oracleOf {Agent : Type} (v : Agent → CakeValuation) {ι : Type} :
      RWQuery Agent ι → ι

      Canonical Robertson–Webb oracle induced by a valuation profile v via intermediate value.

      oracleOf v is a valid Robertson–Webb oracle for every valuation profile v.

      Embed RWQuery (Fin n) into RWQuery ℕ via Fin.val, providing a size-uniform query signature across all agent counts n : ℕ for Cslib.Query.UpperBound.

      @[simp]
      theorem Cslib.GameTheory.FairDivision.RWQuery.countQueries_liftFin {n : ℕ} {α : Type} (oracle : {ι : Type} → RWQuery ℕ ι → ι) (p : FreeM (RWQuery (Fin n)) α) :
      FreeM.countQueries (fun {ι : Type} => oracle) (liftFin p) = FreeM.countQueries (fun {ι : Type} (q : RWQuery (Fin n) ι) => match ι, q with | .(ℝ), eval i a b => oracle (eval (↑i) a b) | .(ℝ), cut i a t => oracle (cut (↑i) a t)) p

      Query count of liftFin p against an ℕ-indexed oracle equals the query count of p against the restricted Fin n-indexed oracle.