Conversation
…, 0 sorry Add formal verification of math::interpolateN (uniform-grid piecewise-linear interpolation) for N=2 and N=3. ## New file: formal-verification/lean/FVSquad/InterpolateN.lean 14 public theorems, 0 sorry: ### N=2 (degenerate case — reduces to single interpolate call): - interpN2_at_zero, interpN2_at_one: exact values at endpoints - interpN2_le_high, interpN2_ge_low: range containment when y0 ≤ y1 ### N=3 (two-segment model with breakpoint at 1/2): - interpN3_at_zero, interpN3_at_half, interpN3_at_one: exact at all 3 nodes - interpN3_continuity: both branch formulas agree at value=1/2 - interpN3_le_high, interpN3_ge_low, interpN3_in_range: output in [y0, y2] - interpN3_mono_seg0, interpN3_mono_seg1: segment-wise monotonicity - interpN3_const: constant output when all y equal Also includes 15 concrete #eval examples verifying flat/linear/convex curves. ## New file: formal-verification/specs/interpolaten_informal.md Informal specification: preconditions, postconditions, edge cases, examples. ## Updated: formal-verification/TARGETS.md Added target #18 for interpolateN. > ✅ Proofs verified: lake build passed with Lean 4.29.0. 0 sorry. 🔬 Lean Squad automated formal verification — run 40 (https://github.com/dsyme/PX4-Autopilot/actions/runs/24468137822) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔬 Lean Squad — automated formal verification for
dsyme/PX4-Autopilot.Summary
This PR formally verifies
math::interpolateN— PX4's uniform-grid piecewise-linear interpolation function — for N=2 and N=3. The N=3 case (three equally-spaced nodes with breakpoint at 1/2) is the key new contribution.14 public theorems proved, 0 sorry.
C++ Source
All 19 build jobs passed (including all 17 prior Lean files).
🔬 Lean Squad automated formal verification — run 24468137822