MindFormal v1.0.0One Mind

MindFormal.Chapters.Ch15.MatchedPrice

theorem MindFormal.Transactions.qualified_pair_partition {N : ℕ} {guard score : ℝ → Fin N → ℝ} {r H : ℝ} (search : NativeSearch guard score r H) (hr : r ≤ H) (good money : Fin N) (hg : 0 ≤ guard r good) (hm : 0 ≤ guard r money) (others : ∀ (j : Fin N), j ≠ good → j ≠ money → guard r j < 0) :
search.event = some (r, good) ∨ search.event = some (r, money)

Qualification and exclusion leave precisely the two represented marks; the price calculation therefore does not silently discard a third outcome.

theorem MindFormal.Transactions.qualified_pair_release {N : ℕ} {guard score : ℝ → Fin N → ℝ} {r H : ℝ} (search : NativeSearch guard score r H) (hr : r ≤ H) (good money : Fin N) (hg : 0 ≤ guard r good) (hm : 0 ≤ guard r money) (others : ∀ (j : Fin N), j ≠ good → j ≠ money → guard r j < 0) :
search.event = some (r, good) ↔ 0 < score r good - score r money ∨ score r good - score r money = 0 ∧ good ≤ money

The complete two-qualified-output release test, including the fixed tie rule.

theorem MindFormal.Transactions.matched_price_release {N K : ℕ} (price : Fin K → ℝ) (p0 intercept : ℝ) {slope : ℝ} (hs : 0 < slope) (guard score : Fin K → ℝ → Fin N → ℝ) (r H : Fin K → ℝ) (search : (k : Fin K) → NativeSearch (guard k) (score k) (r k) (H k)) (good money : Fin N) (hr : ∀ (k : Fin K), r k ≤ H k) (hg : ∀ (k : Fin K), 0 ≤ guard k (r k) good) (hm : ∀ (k : Fin K), 0 ≤ guard k (r k) money) (others : ∀ (k : Fin K) (j : Fin N), j ≠ good → j ≠ money → guard k (r k) j < 0) (affine : ∀ (k : Fin K), score k (r k) good - score k (r k) money = intercept - slope * (price k - p0)) :
intercept - slope * (affinePriceZero p0 intercept slope - p0) = 0 ∧ (∀ (p : ℝ), intercept - slope * (p - p0) = 0 ↔ p = affinePriceZero p0 intercept slope) ∧ ∀ (k : Fin K), (search k).event = some (r k, good) ↔ price k < affinePriceZero p0 intercept slope ∨ price k = affinePriceZero p0 intercept slope ∧ good ≤ money

Represented affine price comparisons construct their cutoffs through the native release rule. No native acceptance or price cutoff is a premise.

theorem MindFormal.Transactions.matched_price_gap {A : Type u_1} [Fintype A] (p0 slope dxOwn dxNon : ℝ) (ell owned nonowned : A → ℝ) :
affinePriceZero p0 (dxOwn + ∑ a : A, ell a * owned a) slope - affinePriceZero p0 (dxNon + ∑ a : A, ell a * nonowned a) slope = (dxOwn - dxNon + ∑ a : A, ell a * (owned a - nonowned a)) / slope

TX2.2's signed sum, with all elements retained in both affine intercepts.

theorem MindFormal.Transactions.matched_price_sign {A : Type u_1} [Fintype A] (p0 dxOwn dxNon : ℝ) (ell owned nonowned : A → ℝ) {slope : ℝ} (hs : 0 < slope) :
have gap := affinePriceZero p0 (dxOwn + ∑ a : A, ell a * owned a) slope - affinePriceZero p0 (dxNon + ∑ a : A, ell a * nonowned a) slope; have signed := dxOwn - dxNon + ∑ a : A, ell a * (owned a - nonowned a); (0 < gap ↔ 0 < signed) ∧ (gap = 0 ↔ signed = 0) ∧ (gap < 0 ↔ signed < 0)
theorem MindFormal.Transactions.paired_matched_price {A : Type u_1} [Fintype A] {N K : ℕ} (price : Fin K → ℝ) (p0 : ℝ) (dx : Bool → ℝ) (ell : A → ℝ) (forecast : Bool → A → ℝ) {slope : ℝ} (hs : 0 < slope) (guard score : Bool → Fin K → ℝ → Fin N → ℝ) (r H : Bool → Fin K → ℝ) (search : (o : Bool) → (k : Fin K) → NativeSearch (guard o k) (score o k) (r o k) (H o k)) (good money : Fin N) (hr : ∀ (o : Bool) (k : Fin K), r o k ≤ H o k) (hg : ∀ (o : Bool) (k : Fin K), 0 ≤ guard o k (r o k) good) (hm : ∀ (o : Bool) (k : Fin K), 0 ≤ guard o k (r o k) money) (others : ∀ (o : Bool) (k : Fin K) (j : Fin N), j ≠ good → j ≠ money → guard o k (r o k) j < 0) (affine : ∀ (o : Bool) (k : Fin K), score o k (r o k) good - score o k (r o k) money = dx o + ∑ a : A, ell a * forecast o a - slope * (price k - p0)) :
have cutoff := fun (o : Bool) => affinePriceZero p0 (dx o + ∑ a : A, ell a * forecast o a) slope; (∀ (o : Bool) (p : ℝ), dx o + ∑ a : A, ell a * forecast o a - slope * (p - p0) = 0 ↔ p = cutoff o) ∧ (∀ (o : Bool) (k : Fin K), (search o k).event = some (r o k, good) ↔ price k < cutoff o ∨ price k = cutoff o ∧ good ≤ money) ∧ cutoff true - cutoff false = (dx true - dx false + ∑ a : A, ell a * (forecast true a - forecast false a)) / slope

Both histories' price cutoffs are constructed from their actual qualified affine reads on the represented grid before their signed gap is evaluated.