MindFormal v1.0.0One Mind

MindFormal.Chapters.Ch06.SearchWrites

theorem MindFormal.useful_share_derivative (J L : ℝ → ℝ) {t dJ dL : ℝ} (hJ : HasDerivAt J dJ t) (hL : HasDerivAt L dL t) (hjp : 0 < J t) (hlp : 0 < L t) :
HasDerivAt (fun (s : ℝ) => J s / (J s + L s)) (J t * L t / (J t + L t) ^ 2 * (dJ / J t - dL / L t)) t

SW1 (SW6): the exact useful-share derivative is the positive share factor times the difference of proportional input rates. Both inputs are complete moving inputs. Subtracting the fixed need and offset preserves this derivative on an active branch; clipping edges require a directional argument.

theorem MindFormal.useful_share_slope_sign {J L dJ dL : ℝ} (hJ : 0 < J) (hL : 0 < L) :
0 < J * L / (J + L) ^ 2 * (dJ / J - dL / L) ↔ dL / L < dJ / J

SW1 (SW6): positive useful and competing inputs make the share slope strictly positive exactly when useful input grows proportionally faster. This is the active-branch reference sign, not a monotonicity statement for individual noisy increments or a finite-duration awareness guarantee.

theorem MindFormal.reserve_target_sign {J L g need : ℝ} (hJ : 0 < J) (hL : 0 < L) (hn : 0 < need) (hq : 0 < g + need) (hq1 : g + need < 1) :
0 < Real.log ((1 - (g + need)) * J / ((g + need) * L)) ↔ need < max (J / (J + L) - g) 0

SW1 (SW6): the log reserve is positive exactly when the complete clipped target exceeds a positive need. This includes the inactive target case without differentiating at the clipping edge. Positive useful input and a needed share strictly between zero and one are essential for this logarithmic form.

theorem MindFormal.log_reserve_derivative (J L : ℝ → ℝ) {t dJ dL q : ℝ} (hJ : HasDerivAt J dJ t) (hL : HasDerivAt L dL t) (hjp : 0 < J t) (hlp : 0 < L t) (hq : 0 < q) (hq1 : q < 1) :
HasDerivAt (fun (s : ℝ) => Real.log ((1 - q) * J s / (q * L s))) (dJ / J t - dL / L t) t

SW1 (SW6): differentiating the exact log reserve retains both useful and other-input rates. The calculation is on a differentiable positive-input branch at a fixed mode; mode jumps and absolutely continuous stitching are separate accounting obligations.

theorem MindFormal.complete_input_derivative {I : Type u_1} [Fintype I] (drive residue : ℝ → ℝ) (W x target : I → ℝ → ℝ) (write : I → ℝ) {t dDrive dResidue ν : ℝ} (hd : HasDerivAt drive dDrive t) (hr : HasDerivAt residue dResidue t) (hW : ∀ (i : I), HasDerivAt (W i) (write i) t) (hx : ∀ (i : I), HasDerivAt (x i) (ν * (target i t - x i t)) t) :
HasDerivAt (fun (s : ℝ) => drive s + residue s + ∑ i : I, W i s * x i s) (dDrive + dResidue + ∑ i : I, (write i * x i t + W i t * ν * (target i t - x i t))) t

SW1 (SW7): the complete raw-input product rule includes drive and residue rates, every relation write and every activity change in the incoming row. The supplied write rates must be II's full rates; the formula does not certify them by itself. Native mode jumps require their finite input changes as well.

theorem MindFormal.reserve_loss_envelope {H low high : ℝ} (hH : 0 ≤ H) (reserve rate : ℝ → ℝ) (hd : ∀ t ∈ Set.Icc 0 H, HasDerivAt reserve (rate t) t) (hb : ∀ t ∈ Set.Icc 0 H, -high ≤ rate t ∧ rate t ≤ -low) :
reserve 0 - high * H ≤ reserve H ∧ reserve H ≤ reserve 0 - low * H

SW1 (SW8): complete proportional-rate bounds give two straight bounds on a single cue's log reserve throughout a differentiable reference interval. No endpoint-only monotonicity or uncharged mode change is used. A finite family still needs the last-crossing construction and its native availability checks.

theorem MindFormal.reserve_zero_bracket {H low high : ℝ} (hH : 0 ≤ H) (hl : 0 < low) (hu : 0 < high) (reserve rate : ℝ → ℝ) (hd : ∀ t ∈ Set.Icc 0 H, HasDerivAt reserve (rate t) t) (hb : ∀ t ∈ Set.Icc 0 H, -high ≤ rate t ∧ rate t ≤ -low) (hz : reserve H = 0) :
reserve 0 / high ≤ H ∧ H ≤ reserve 0 / low

SW1 (SW8): any zero of a reserve with certified negative rate bounds lies between its two displayed loss clocks. This proves the time bounds at a supplied crossing; existence, earliestness and taking the last of a finite cue family are not silently assumed to follow from the algebra alone.

theorem MindFormal.fading_load_clock {excess allowance rate t : ℝ} (he : 0 < excess) (ha : 0 < allowance) (hr : 0 < rate) :
excess * Real.exp (-rate * t) < allowance ↔ Real.log (excess / allowance) / rate < t

SW1 (SW10): an exact positive excess load falls below a positive surviving allowance precisely after its logarithmic clock. For nonnegative break ages the infimum is the positive part of this clock; the zero-excess branch and full learned support/load envelopes are separate. Equality is not strict reach.