§5.1 — supply redirection: policies, move rates, stationary laws, objective and the induced demand
DefinitionSharedVehicleApprox_Pricing_Supplement_SupplyRedirectionThe system has nodes, units, arrival rates and instantaneous rides. Under supply redirection, the unit of a ride that ends at may be sent empty to a node at cost ; empty units are not redirected again.
- A policy is a quantile policy , zero when , with probabilities , : a ride started in state is redirected to with probability and stays at otherwise.
- The move rate from to is
A stationary law is a probability vector on that satisfies the balance equation (1) with these rates. 3. With reward curves , the objective is
- A state-independent matrix uses for every trip ending at . The induced demand of state-independent is , the demand of the hypothetical network in the proof of Lemma 21.
These objects state Lemma 21, Theorem 22, Lemma 30 and Theorem 31.
Formalization Note The redirection probability may depend on the trip's origin as well as on the state before the trip. This includes every rule and every rule that reads the state at arrival. A redirection with is allowed and charged , as in Algorithm 3. The balance equation is the base predicate with unit demand and in the place of the quantiles.
import Mathlib
import Definitions.Def_QueueingFundamentals_Networks_ClosedJackson
import Definitions.Def_SharedVehicleApprox_Pricing_Model
namespace SharedVehicleApprox.Pricing.Supplement
open Finset QueueingFundamentals.Networks
/-- A state-dependent pricing and supply-redirection policy `(q, r)` (§5.1, pp. 24–25): `q` is a
pricing policy, and `r x k i j` is the probability that the unit of a trip from `k` to `i`, started
in the state `x`, is redirected on arrival from `i` to `j`. With probability `1 − ∑ j, r x k i j`
it stays at `i`. -/
def IsRedirectPolicy (n m : ℕ) (q : (Fin n → ℕ) → Fin n → Fin n → ℝ)
(r : (Fin n → ℕ) → Fin n → Fin n → Fin n → ℝ) : Prop :=
IsPolicy n m q ∧
∀ x ∈ states n m, ∀ k i, (∀ j, 0 ≤ r x k i j) ∧ ∑ j, r x k i j ≤ 1
/-- A state-independent redirection matrix run as a policy: every unit arriving at `i` with a
customer is redirected to `j` with probability `r i j`. -/
def toRedirect {n : ℕ} (r : Fin n → Fin n → ℝ) :
(Fin n → ℕ) → Fin n → Fin n → Fin n → ℝ :=
fun _ _ i j => r i j
/-- The rate, at the state `x`, of the move `x → x − e_k + e_j` under supply redirection: trips
`k → j` that are not redirected, plus trips `k → i` redirected from `i` to `j`. Redirected units
are not redirected again. -/
def redirectRate {n : ℕ} (φ : Fin n → Fin n → ℝ) (q : (Fin n → ℕ) → Fin n → Fin n → ℝ)
(r : (Fin n → ℕ) → Fin n → Fin n → Fin n → ℝ) : (Fin n → ℕ) → Fin n → Fin n → ℝ :=
fun x k j => φ k j * q x k j * (1 - ∑ l, r x k j l) + ∑ i, φ k i * q x k i * r x k i j
/-- A stationary law of the `m`-unit system under `(q, r)`: the balance equation (1) with the move
rates `redirectRate` in the place of `φ_kj q_kj(x)`. -/
def IsRedirectStationary (n m : ℕ) (φ : Fin n → Fin n → ℝ)
(q : (Fin n → ℕ) → Fin n → Fin n → ℝ) (r : (Fin n → ℕ) → Fin n → Fin n → Fin n → ℝ)
(π : (Fin n → ℕ) → ℝ) : Prop :=
IsStationary n m (fun _ _ => 1) (redirectRate φ q r) π
/-- The steady-state objective under supply redirection (p. 25): rewards of the rides minus the
cost `c i j` of each redirection from `i` to `j`. -/
def redirectObj (n m : ℕ) (φ : Fin n → Fin n → ℝ) (I : Fin n → Fin n → ℝ → ℝ)
(c : Fin n → Fin n → ℝ) (q : (Fin n → ℕ) → Fin n → Fin n → ℝ)
(r : (Fin n → ℕ) → Fin n → Fin n → Fin n → ℝ) (π : (Fin n → ℕ) → ℝ) : ℝ :=
∑ x ∈ states n m, π x *
∑ k, ∑ i, φ k i * (rewardCurve I k i (q x k i) - q x k i * ∑ j, r x k i j * c i j)
/-- The demand `φ̄` of the hypothetical network in the proof of Lemma 21 (p. 26), which has the
same transitions as state-independent `(q, r)`:
`φ̄_ij = φ_ij q_ij (1 − ∑_k r_jk) + ∑_k φ_ik q_ik r_kj`. -/
def inducedDemand {n : ℕ} (φ : Fin n → Fin n → ℝ) (q r : Fin n → Fin n → ℝ) :
Fin n → Fin n → ℝ :=
fun i j => φ i j * q i j * (1 - ∑ k, r j k) + ∑ k, φ i k * q i k * r k j
end SharedVehicleApprox.Pricing.Supplement