Skip to content

Commit f3690ef

Browse files
hyperpolymathclaude
andcommitted
fix(S3): rewrite continuous_entropy_le_ln_bma proof for Coq 9.1.1
Three Coquelicot/Coq 9.1.1 incompatibilities in the existing §8 proof: 1. `change scal with Rmult / change plus with Rplus` left ring unable to recognise the goal as an R equation — replaced with assert+exact pattern to prove equalities at type R first, then bridge via definitional V=R. 2. `apply ex_RInt_plus` could not unify abstract V with R_NormedModule in apply mode — replaced with `exact (ex_RInt_plus ...)` which uses definitional equality. 3. `rewrite (RInt_ext _ _ Hext)` was passing the proof term as the third arg (a : R) — fixed to `rewrite (RInt_ext _ _ _ _ Hext)` for all four explicit args (f g a b) before the equality proof. Suite remains 39/39 passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 36494f2 commit f3690ef

1 file changed

Lines changed: 27 additions & 13 deletions

File tree

proofs/canonical-proof-suite/S3_h_theorem_ndim.v

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -675,20 +675,29 @@ Proof.
675675
with (1 / (b - a) - f x) in Htl
676676
by (field; lra).
677677
exact Htl. }
678-
(* 2. Integrability of both integrands. *)
678+
(* 2. Integrability of both integrands.
679+
Note: ex_RInt_ext and RInt_ext produce equality goals at type V
680+
(the CompleteNormedModule), not plain R. ring does not recognise
681+
@eq V goals, so each pointwise equality is proved as @eq R via an
682+
intermediate assert and closed with exact (definitional V = R). *)
679683
assert (Hh_int : ex_RInt (fun x => f x * (- ln (b - a) - ln (f x))) a b).
680684
{ apply (ex_RInt_ext
681685
(fun x => (- ln (b - a)) * f x + (-1) * (f x * ln (f x)))).
682-
- intros x _. ring.
683-
- apply ex_RInt_plus.
684-
+ exact (ex_RInt_scal _ a b (- ln (b - a)) Hf_ex).
685-
+ exact (ex_RInt_scal _ a b (-1) flnf_int). }
686+
- intros x _.
687+
assert (HH : (- ln (b - a)) * f x + (-1) * (f x * ln (f x))
688+
= f x * (- ln (b - a) - ln (f x))) by ring.
689+
exact HH.
690+
- exact (ex_RInt_plus _ _ a b
691+
(ex_RInt_scal _ a b (- ln (b - a)) Hf_ex)
692+
(ex_RInt_scal _ a b (-1) flnf_int)). }
686693
assert (Hg_int : ex_RInt (fun x => 1 / (b - a) - f x) a b).
687694
{ apply (ex_RInt_ext (fun x => 1 / (b - a) + (-1) * f x)).
688-
- intros x _. ring.
689-
- apply ex_RInt_plus.
690-
+ apply ex_RInt_const.
691-
+ exact (ex_RInt_scal _ a b (-1) Hf_ex). }
695+
- intros x _.
696+
assert (HH : 1 / (b - a) + (-1) * f x = 1 / (b - a) - f x) by ring.
697+
exact HH.
698+
- exact (ex_RInt_plus _ _ a b
699+
(ex_RInt_const a b (1 / (b - a)))
700+
(ex_RInt_scal _ a b (-1) Hf_ex)). }
692701
(* 3. Integral monotonicity: RInt h <= RInt g. *)
693702
pose proof (RInt_le
694703
(fun x => f x * (- ln (b - a) - ln (f x)))
@@ -700,8 +709,11 @@ Proof.
700709
{
701710
assert (Hext1 : forall x, Rmin a b < x < Rmax a b ->
702711
f x * (- ln (b - a) - ln (f x)) = (- ln (b - a)) * f x + (-1) * (f x * ln (f x))).
703-
{ intros x _. ring. }
704-
rewrite (RInt_ext _ _ Hext1).
712+
{ intros x _.
713+
assert (HH : f x * (- ln (b - a) - ln (f x))
714+
= (- ln (b - a)) * f x + (-1) * (f x * ln (f x))) by ring.
715+
exact HH. }
716+
rewrite (RInt_ext _ _ _ _ Hext1).
705717
etransitivity. {
706718
exact (RInt_plus
707719
(fun x => (- ln (b - a)) * f x)
@@ -723,8 +735,10 @@ Proof.
723735
{
724736
assert (Hext2 : forall x, Rmin a b < x < Rmax a b ->
725737
1 / (b - a) - f x = 1 / (b - a) + (-1) * f x).
726-
{ intros x _. ring. }
727-
rewrite (RInt_ext _ _ Hext2).
738+
{ intros x _.
739+
assert (HH : 1 / (b - a) - f x = 1 / (b - a) + (-1) * f x) by ring.
740+
exact HH. }
741+
rewrite (RInt_ext _ _ _ _ Hext2).
728742
assert (Hconst_int : ex_RInt (fun _ : R => 1 / (b - a)) a b).
729743
{ apply ex_RInt_const. }
730744
etransitivity. {

0 commit comments

Comments
 (0)