The local, finite term-count comparison. All denominators and branch conditions are explicit; this module makes no assertion about a held actual run.
Equations
- MindFormal.ContractCount.intercept A B d₀ P = A * P + B * d₀
Instances For
Equations
- MindFormal.ContractCount.slope A B d₁ L = A * L + B * d₁
Instances For
Equations
- MindFormal.ContractCount.crossing A B d₀ d₁ P L = -MindFormal.ContractCount.intercept A B d₀ P / MindFormal.ContractCount.slope A B d₁ L
Instances For
theorem
MindFormal.ContractCount.clipped
(a d P g : ℝ)
(_hp : 0 < P)
:
(g ≤ a / P → g ≤ d / P → max (a / P - g) 0 - max (d / P - g) 0 = (a - d) / P) ∧ (g ≤ a / P → d / P ≤ g → max (a / P - g) 0 - max (d / P - g) 0 = a / P - g) ∧ (a / P ≤ g → g ≤ d / P → max (a / P - g) 0 - max (d / P - g) 0 = -(d / P - g)) ∧ (a / P ≤ g → d / P ≤ g → max (a / P - g) 0 - max (d / P - g) 0 = 0)
Separate positive, singly clipped, and doubly clipped target branches.