From 48c48b3551ef85f00212f7fa77ae95005a16c3db Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 23:10:28 +0000 Subject: [PATCH] fix(examples): repair the mult_dist proof in simple_proof.v The proof failed under Coq 8.18.0 with "Found no subterm matching m + n' * m". The fault is in the proof script, not the Coq version: after IHn' and two `rewrite <- plus_assoc` steps the goal is m + (p + (n' * m + n' * p)) = m + (n' * m + (p + n' * p)), so the `m + n' * m` that the next rewrite needs no longer exists. The step case now right-associates both sides, peels the shared `m` with f_equal, and closes the remaining commutation with Nat.add_comm and Nat.add_assoc (the non-deprecated names). `coqc -q` on the file exits 0 with Coq 8.18.0. No CI job compiles examples/ (`just proofs-coq` covers proofs/coq only), which is how this went unnoticed. Found by an arghda verdict run over the echidna corpus. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDgFqYab1nEu8NYuHqr --- examples/simple_proof.v | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/simple_proof.v b/examples/simple_proof.v index 099e74ad..62374479 100644 --- a/examples/simple_proof.v +++ b/examples/simple_proof.v @@ -60,12 +60,13 @@ Proof. - reflexivity. - simpl. rewrite IHn'. - rewrite <- plus_assoc. - rewrite <- plus_assoc. - rewrite (plus_comm m (n' * m)). - rewrite plus_assoc. - rewrite plus_assoc. - reflexivity. + (* m + p + (n' * m + n' * p) = m + n' * m + (p + n' * p) *) + rewrite <- !Nat.add_assoc. + f_equal. + (* p + (n' * m + n' * p) = n' * m + (p + n' * p) *) + rewrite Nat.add_comm, <- Nat.add_assoc. + f_equal. + apply Nat.add_comm. Qed. (**