← Back to Pull requests

refactor: use Mathlib's norm_matmul, module, ring, and pull fun #531

Open
unknown opened this pull request with 202 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 25, 2026 11:00 UTC
Author

Summary

Follow-up to #434: for the custom tactics proposed there that are superseded by existing Mathlib tactics (fin_vec_simp → norm_matmul, pointwise → ring / module / pull fun _ ↦ _), this PR replaces the corresponding boilerplate across the repo with Mathlib's built-in tactics (net -62 lines).

(The other two Mathlib-superseded items from #434 — d_nf and slash_simp — were already migrated upstream in #478 and #495.)

Changes

  • SpherePacking/Basic/E8.lean: Use norm_matmul (Mathlib.Tactic.NormMatMul) to prove E8Inverse_mul_E8Matrix directly over [Field R] [CharZero R], removing E8Inverse_eq_cast and the decide +kernel helper E8Inverse_mul_E8Matrix_rat.

  • SpherePacking/ModularForms/JacobiTheta/JacobiIdentity.lean: Use ring directly on ℍ → ℂ (instead of ext z; simp [Pi.]; ring) and sq in jacobi_f_eq_mul.

  • SpherePacking/ModularForms/JacobiTheta/Derivative.lean: Use module (Mathlib.Tactic.Module), ring, Algebra.smul_def, linear_combination, and pull fun _ ↦ _ (Mathlib.Tactic.Push) to eliminate repetitive ext z; simp [Pi._apply]; ring boilerplate across f₂/f₃/f₄, theta_g/theta_h, H_sum_sq, serreDerivative_H₂/H₃/H₄, and D_H₂/H₃/H₄.

  • SpherePacking/ModularForms/FG.lean & SpherePacking/MagicFunction/b/Psi.lean: Use pull fun _ ↦ _ (Mathlib.Tactic.Push) in place of manual Pi.*_apply simp only lists in F_eq_nine_DE₄_sq, MLDE_F, MLDE_G, and ψS_eq_neg_one_half_smul_G_div_disc.
  • All new tactic imports use private import statements matching the module import style from #516.

    Diff: 202 lines (+151 / -51) across 2 files Reviewer: seewoo5 Review duration: 13668m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 202 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.318
    Real PR Conversation Timeline
    1 comments
    "Review active on #531"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.2% (MEDIUM) · Higher = larger blast radius
    36.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.3% · Safe to merge
    19.3%