MindFormal v1.0.0One Mind

MindFormal.Tools.ContractCompletion.AffineCount

The local, finite term-count comparison. All denominators and branch conditions are explicit; this module makes no assertion about a held actual run.

noncomputable def MindFormal.ContractCount.comparison (A B d₀ d₁ P L k : ℝ) :
Equations
Instances For
    Equations
    Instances For
      Equations
      Instances For
        noncomputable def MindFormal.ContractCount.crossing (A B d₀ d₁ P L : ℝ) :
        Equations
        Instances For
          theorem MindFormal.ContractCount.numerator (A B d₀ d₁ P L k : ℝ) (hp : 0 < P + k * L) :
          comparison A B d₀ d₁ P L k = (intercept A B d₀ P + k * slope A B d₁ L) / (P + k * L)
          theorem MindFormal.ContractCount.signs (A B d₀ d₁ P L k : ℝ) (hp : 0 < P + k * L) :
          (0 < comparison A B d₀ d₁ P L k ↔ 0 < intercept A B d₀ P + k * slope A B d₁ L) ∧ (comparison A B d₀ d₁ P L k < 0 ↔ intercept A B d₀ P + k * slope A B d₁ L < 0) ∧ (comparison A B d₀ d₁ P L k = 0 ↔ intercept A B d₀ P + k * slope A B d₁ L = 0)
          theorem MindFormal.ContractCount.derivative (A B d₀ d₁ P L k : ℝ) (hp : P + k * L ≠ 0) :
          HasDerivAt (comparison A B d₀ d₁ P L) (B * (d₁ * P - L * d₀) / (P + k * L) ^ 2) k
          theorem MindFormal.ContractCount.increasing_crossing (A B d₀ d₁ P L k : ℝ) (hp : 0 < P + k * L) (hs : 0 < slope A B d₁ L) :
          0 < comparison A B d₀ d₁ P L k ↔ crossing A B d₀ d₁ P L < k
          theorem MindFormal.ContractCount.decreasing_crossing (A B d₀ d₁ P L k : ℝ) (hp : 0 < P + k * L) (hs : slope A B d₁ L < 0) :
          0 < comparison A B d₀ d₁ P L k ↔ k < crossing A B d₀ d₁ P L
          theorem MindFormal.ContractCount.tie (A B d₀ d₁ P L k : ℝ) (hp : 0 < P + k * L) (hs : slope A B d₁ L ≠ 0) :
          comparison A B d₀ d₁ P L k = 0 ↔ k = crossing A B d₀ d₁ P L
          theorem MindFormal.ContractCount.zero_slope (A B d₀ d₁ P L k : ℝ) (hp : 0 < P + k * L) (hs : slope A B d₁ L = 0) :
          (0 < comparison A B d₀ d₁ P L k ↔ 0 < intercept A B d₀ P) ∧ (comparison A B d₀ d₁ P L k = 0 ↔ intercept A B d₀ P = 0)
          theorem MindFormal.ContractCount.integer_crossing (A B d₀ d₁ P L : ℝ) (k cap : ℕ) (_hk : k ≤ cap) (hp : 0 < P + ↑k * L) (hs : 0 < slope A B d₁ L) :
          k ≤ cap ∧ 0 < comparison A B d₀ d₁ P L ↑k ↔ k ≤ cap ∧ ⌊crossing A B d₀ d₁ P L⌋ < ↑k

          Exact integer cutoff, including nonintegral and negative crossings.

          theorem MindFormal.ContractCount.tested_crossing (A B d₀ d₁ P L lo hi : ℝ) (hp : ∀ k ∈ Set.Icc lo hi, 0 < P + k * L) (hs : slope A B d₁ L ≠ 0) :
          (∃ k ∈ Set.Icc lo hi, comparison A B d₀ d₁ P L k = 0) ↔ crossing A B d₀ d₁ P L ∈ Set.Icc lo hi
          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.