MindFormal v1.0.0One Mind

MindFormal.Run.A595Trade.CommonPrice

Gross transfers and individual cash flows in the one actually offered interior-price corner. This does not compute a price from private cutoffs.

theorem MindFormal.A595Trade.Ticket.paidPrices_length {N : ℕ} {M : Fin N → ℕ} (offers : List (Ticket M)) (h : Histories M) (s : Ledger N) :
(paidPrices offers h s).length = executionCount offers h s
theorem MindFormal.A595Trade.Ticket.paidPrices_common {N : ℕ} {M : Fin N → ℕ} (offers : List (Ticket M)) (h : Histories M) (s : Ledger N) (price : ℝ) (hp : ∀ o ∈ offers, o.price = price) (p : ℝ) :
p ∈ paidPrices offers h s → p = price
theorem MindFormal.A595Trade.Ticket.direct_accounting {N : ℕ} {M : Fin N → ℕ} (offers : List (Ticket M)) (h : Histories M) (s : Ledger N) (target : Finset ℕ) (hdirect : ∀ o ∈ offers, ∀ (z : Ledger N), o.Legal h z → ↑o.seller ∉ target ∧ ↑o.buyer ∈ target) :
executionCount offers h s + missing target (run offers h s).holders = missing target s.holders
theorem MindFormal.A595Trade.Ticket.settle_wealth {N : ℕ} {M : Fin N → ℕ} (o : Ticket M) (h : Histories M) (s : Ledger N) (i : Fin N) :
(o.settle h s).cash i + o.price * unitHolding (o.settle h s).holders ↑i = s.cash i + o.price * unitHolding s.holders ↑i
theorem MindFormal.A595Trade.Ticket.run_cash_flow {N : ℕ} {M : Fin N → ℕ} (offers : List (Ticket M)) (h : Histories M) (s : Ledger N) (price : ℝ) (hp : ∀ o ∈ offers, o.price = price) (i : Fin N) :
(run offers h s).cash i - s.cash i = price * (unitHolding s.holders ↑i - unitHolding (run offers h s).holders ↑i)
theorem MindFormal.A595Trade.Ticket.common_price_completion {N : ℕ} {M : Fin N → ℕ} (offers : List (Ticket M)) (h : Histories M) (s : Ledger N) (target : Finset ℕ) (price : ℝ) (hp : ∀ o ∈ offers, o.price = price) (hdirect : ∀ o ∈ offers, ∀ (z : Ledger N), o.Legal h z → ↑o.seller ∉ target ∧ ↑o.buyer ∈ target) (ht : (run offers h s).holders = target) :
executionCount offers h s = missing target s.holders ∧ (∀ p ∈ paidPrices offers h s, p = price) ∧ ∀ (i : Fin N), (run offers h s).cash i - s.cash i = price * (unitHolding s.holders ↑i - unitHolding target ↑i)