Source: Calculus at 7081bbc05904.

OSR v1 files#

v1/ holds the Calculus rules that the OSR v1 fragment can state, in the OSR v1 interchange format (Specification, docs/osr-v1.md). These files are generated, never edited by hand:

FileContent
v1/calculus.osr.json29 rules: derivatives diff(λx. F) ⟶ λx. G and two-sided limits limit(a, both_sides, λx. F) ⟶ L, with lambdas as OMBIND fns1#lambda, and verification records over ℝ and ℂ.
v1/calculus.report.jsonMachine-readable audit: metrics per domain and the rules not migrated.
v1/calculus.report.mdThe same audit for humans.

Where they come from#

  1. OpenSymbolicRules/Lean states each rule with Mathlib’s analysis (OSR/Calculus.lean): a derivative rule is HasDerivAt wherever the function is defined near the point; a limit rule is Tendsto along the punctured neighbourhood.
  2. OpenSymbolicRules/Verification publishes the export under reports/<source digest>/ and can rebuild it independently.
  3. This repository copies the published files. The CI checks that they validate against the v1 schema, share one source digest, and are byte-identical to the published report.

Differences from v0.1#

The v0.1 files in rules/ remain for the v0.1 loader of OpenSymbolicRules.jl. In v1:

  • 29 of the 32 rules are migrated: the derivatives of x, sin, cos, exp, ln, tan, arctan, of the hyperbolic functions, of cot, sec, csc, of the inverse trigonometric and hyperbolic functions, of a constant, the power rule, the limit of a constant and the five limits at 0. 28 are proved over ℝ and 16 over ℂ. Sqrt becomes arith1#root(x, 2);
  • FreeQ becomes an independent matching constraint: the metavariable’s match must not mention the bound variable;
  • the v0.1 power rule diff(λx. x^n) = λx. n x^(n-1) is false at n = 0, x = 0 (x^0 is defined around 0, 0 · x^(-1) is not); it is distributed with the status counterexample and a Lean proof of its negation, and would hold with the condition n ≠ 0;
  • 3 structural rules remain not migrated: their v0.1 patterns omit the differentiability assumptions required by the sum, difference and product rules, and their osr#Apply node is outside the OpenMath fragment;
  • a rule applies at the root of a diff or limit term and keeps the input’s bound variable; its result is a lambda or a value, so normalization takes one step at most.

Updating#

just update-v1 <Verification>/reports/<digest>

Then update the Verification commit pinned in the CI workflow.