Documentation

LeanMlir.Proofs.Certificates.LipschitzCert.Scorecard

Certified-accuracy scorecard #

REDUCED CERTIFICATE MODEL — this file's concrete net is the 4×4-pooled 49-dim MNIST family (width-8 hidden, /128–/256 rational weights), NOT the canonical 784→512→512→10 mlpVerified; chosen so every margin/norm/SOS check is exact rational arithmetic in-kernel. Canonical surface: Proofs/MlpCanonical.lean.

The one-input certificate of LipschitzCert.Instance, scaled to a dataset-level claim over a FIXED subset — the first 100 MNIST test images (4×4-pooled, exact pixel-sum rationals) — at a FIXED radius ε = 1/10 (pooled-feature L2; a pooled coordinate is a 16-pixel block average, so ε is a 4×4-block-averaged pixel budget of 0.1·255 ≈ 25.5 gray levels concentrated on one block, or spread L2-wise across blocks). Two nets:

Same theorem, same ε — the training method decides whether the certificate bites (tighter caps, 1.5–2, cost too much clean accuracy at this scale: σ ≤ 2 → 66% test acc; σ ≤ 4 keeps 87.0% vs 89.8% unconstrained).

Theorem vs. measurement — read this before quoting a number. Soundness lives in the ENGINE (certified_at_eps + LipschitzCert.Basic), proved once — kernel-checking the 57th image buys nothing the 56th didn't. The counts above are exact-rational MEASUREMENTS over the first 100 images, carried in full by the certMargin* data table at the aggregate below (which is what downstream measurement passes read); the first 8 certified images per net additionally carry hpre*/margin*/certified* THEOREMS, and scorecard states only those. Every img<i> of the measured set is kept regardless — the 34 image definitions are cheap and other tiers reference them.

Each of the 8 EMITTED images gets a margin lemma (exact rational, in-kernel) and a ∀ δ, ‖δ‖ < ε → argmax fixed theorem via certified_at_eps. Every OTHER certified image appears only as a -- certMargin* comment line: a measurement, carrying no lemma of any kind. The aggregate count is the honest direction only ("at least K of 100") — an upper-bound L cannot prove an image UNcertifiable. Empirical bracket (not proof): L2-PGD (100 steps, 4 restarts) leaves uncon 69/100, capped 72/100 robust at the same ε — cert ≤ TRUE ≤ PGD.

Generated by scripts/certs/lipschitz_cert_scorecard.py; weights/images are DATA.

Capped-net hidden weights (8×49), entries k/256.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Capped-net output weights (10×8), entries k/256.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      G1s = W1s·W1sᵀ (8×8, denominators 256² = 65536).

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          H1s = G1s² (denominators 256⁴ = 4294967296).

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Proofs.LipschitzCertDemo.G1s_eq (a b : Fin 8) :
              G1s a b = ∑ j : Fin 49, W1s a j * W1s b j
              theorem Proofs.LipschitzCertDemo.G2s_eq (a b : Fin 10) :
              G2s a b = ∑ j : Fin 8, W2s a j * W2s b j
              theorem Proofs.LipschitzCertDemo.H1s_eq (a b : Fin 8) :
              H1s a b = ∑ c : Fin 8, G1s c a * G1s c b
              theorem Proofs.LipschitzCertDemo.H2s_eq (a b : Fin 10) :
              H2s a b = ∑ c : Fin 10, G2s c a * G2s c b

              Schatten-8 bound for the capped hidden layer: B₁ = 4323/1000 (cap 4).

              Capped-net Schatten-8 product: L = 19.760 vs 63.79 unconstrained — the projection is what makes the fixed-ε certificate bite.

              MNIST test image #0 (digit 7), exact pixel sums /4080.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                MNIST test image #3 (digit 0), exact pixel sums /4080.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  MNIST test image #5 (digit 1), exact pixel sums /4080.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    MNIST test image #10 (digit 0), exact pixel sums /4080.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      MNIST test image #13 (digit 0), exact pixel sums /4080.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        MNIST test image #14 (digit 1), exact pixel sums /4080.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          MNIST test image #17 (digit 7), exact pixel sums /4080.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            MNIST test image #25 (digit 0), exact pixel sums /4080.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              MNIST test image #28 (digit 0), exact pixel sums /4080.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                MNIST test image #29 (digit 1), exact pixel sums /4080.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  MNIST test image #34 (digit 7), exact pixel sums /4080.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    MNIST test image #36 (digit 7), exact pixel sums /4080.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      MNIST test image #37 (digit 1), exact pixel sums /4080.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        MNIST test image #39 (digit 1), exact pixel sums /4080.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          MNIST test image #41 (digit 7), exact pixel sums /4080.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            MNIST test image #52 (digit 5), exact pixel sums /4080.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For

                                              MNIST test image #56 (digit 4), exact pixel sums /4080.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For

                                                MNIST test image #60 (digit 7), exact pixel sums /4080.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  MNIST test image #68 (digit 3), exact pixel sums /4080.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For

                                                    MNIST test image #69 (digit 0), exact pixel sums /4080.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      MNIST test image #70 (digit 7), exact pixel sums /4080.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For

                                                        MNIST test image #71 (digit 0), exact pixel sums /4080.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For

                                                          MNIST test image #74 (digit 1), exact pixel sums /4080.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For

                                                            MNIST test image #79 (digit 7), exact pixel sums /4080.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For

                                                              MNIST test image #81 (digit 6), exact pixel sums /4080.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                MNIST test image #82 (digit 2), exact pixel sums /4080.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For

                                                                  MNIST test image #85 (digit 4), exact pixel sums /4080.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For

                                                                    MNIST test image #86 (digit 7), exact pixel sums /4080.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For

                                                                      MNIST test image #89 (digit 1), exact pixel sums /4080.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For

                                                                        MNIST test image #90 (digit 3), exact pixel sums /4080.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For

                                                                          MNIST test image #93 (digit 3), exact pixel sums /4080.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For

                                                                            MNIST test image #94 (digit 1), exact pixel sums /4080.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For

                                                                              MNIST test image #95 (digit 4), exact pixel sums /4080.

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For

                                                                                MNIST test image #98 (digit 6), exact pixel sums /4080.

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  noncomputable def Proofs.LipschitzCertDemo.hpreC0 :
                                                                                  Fin 8 → ℝ
                                                                                  Equations
                                                                                  Instances For
                                                                                    theorem Proofs.LipschitzCertDemo.marginC0 (j : Fin 10) :
                                                                                    j ≠ 7 → 907357987 / 267386880 ≤ (mlpS img0).ofLp 7 - (mlpS img0).ofLp j
                                                                                    theorem Proofs.LipschitzCertDemo.certifiedC0 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                    j ≠ 7 → (mlpS (img0 + δ)).ofLp j < (mlpS (img0 + δ)).ofLp 7

                                                                                    Test #0 (digit 7): certified at ε = 1/10 — margin 3.393 ≥ √2·L·ε.

                                                                                    noncomputable def Proofs.LipschitzCertDemo.hpreC3 :
                                                                                    Fin 8 → ℝ
                                                                                    Equations
                                                                                    Instances For
                                                                                      theorem Proofs.LipschitzCertDemo.marginC3 (j : Fin 10) :
                                                                                      j ≠ 0 → 53187503 / 13369344 ≤ (mlpS img3).ofLp 0 - (mlpS img3).ofLp j
                                                                                      theorem Proofs.LipschitzCertDemo.certifiedC3 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                      j ≠ 0 → (mlpS (img3 + δ)).ofLp j < (mlpS (img3 + δ)).ofLp 0

                                                                                      Test #3 (digit 0): certified at ε = 1/10 — margin 3.978 ≥ √2·L·ε.

                                                                                      noncomputable def Proofs.LipschitzCertDemo.hpreC5 :
                                                                                      Fin 8 → ℝ
                                                                                      Equations
                                                                                      Instances For
                                                                                        theorem Proofs.LipschitzCertDemo.marginC5 (j : Fin 10) :
                                                                                        j ≠ 1 → 64216467 / 22282240 ≤ (mlpS img5).ofLp 1 - (mlpS img5).ofLp j
                                                                                        theorem Proofs.LipschitzCertDemo.certifiedC5 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                        j ≠ 1 → (mlpS (img5 + δ)).ofLp j < (mlpS (img5 + δ)).ofLp 1

                                                                                        Test #5 (digit 1): certified at ε = 1/10 — margin 2.882 ≥ √2·L·ε.

                                                                                        noncomputable def Proofs.LipschitzCertDemo.hpreC10 :
                                                                                        Fin 8 → ℝ
                                                                                        Equations
                                                                                        Instances For
                                                                                          theorem Proofs.LipschitzCertDemo.marginC10 (j : Fin 10) :
                                                                                          j ≠ 0 → 287439677 / 89128960 ≤ (mlpS img10).ofLp 0 - (mlpS img10).ofLp j
                                                                                          theorem Proofs.LipschitzCertDemo.certifiedC10 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                          j ≠ 0 → (mlpS (img10 + δ)).ofLp j < (mlpS (img10 + δ)).ofLp 0

                                                                                          Test #10 (digit 0): certified at ε = 1/10 — margin 3.225 ≥ √2·L·ε.

                                                                                          noncomputable def Proofs.LipschitzCertDemo.hpreC13 :
                                                                                          Fin 8 → ℝ
                                                                                          Equations
                                                                                          Instances For
                                                                                            theorem Proofs.LipschitzCertDemo.marginC13 (j : Fin 10) :
                                                                                            j ≠ 0 → 279315957 / 89128960 ≤ (mlpS img13).ofLp 0 - (mlpS img13).ofLp j
                                                                                            theorem Proofs.LipschitzCertDemo.certifiedC13 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                            j ≠ 0 → (mlpS (img13 + δ)).ofLp j < (mlpS (img13 + δ)).ofLp 0

                                                                                            Test #13 (digit 0): certified at ε = 1/10 — margin 3.134 ≥ √2·L·ε.

                                                                                            noncomputable def Proofs.LipschitzCertDemo.hpreC14 :
                                                                                            Fin 8 → ℝ
                                                                                            Equations
                                                                                            Instances For
                                                                                              theorem Proofs.LipschitzCertDemo.marginC14 (j : Fin 10) :
                                                                                              j ≠ 1 → 34094067 / 11141120 ≤ (mlpS img14).ofLp 1 - (mlpS img14).ofLp j
                                                                                              theorem Proofs.LipschitzCertDemo.certifiedC14 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                              j ≠ 1 → (mlpS (img14 + δ)).ofLp j < (mlpS (img14 + δ)).ofLp 1

                                                                                              Test #14 (digit 1): certified at ε = 1/10 — margin 3.060 ≥ √2·L·ε.

                                                                                              noncomputable def Proofs.LipschitzCertDemo.hpreC17 :
                                                                                              Fin 8 → ℝ
                                                                                              Equations
                                                                                              Instances For
                                                                                                theorem Proofs.LipschitzCertDemo.marginC17 (j : Fin 10) :
                                                                                                j ≠ 7 → 73973561 / 17825792 ≤ (mlpS img17).ofLp 7 - (mlpS img17).ofLp j
                                                                                                theorem Proofs.LipschitzCertDemo.certifiedC17 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                                j ≠ 7 → (mlpS (img17 + δ)).ofLp j < (mlpS (img17 + δ)).ofLp 7

                                                                                                Test #17 (digit 7): certified at ε = 1/10 — margin 4.150 ≥ √2·L·ε.

                                                                                                noncomputable def Proofs.LipschitzCertDemo.hpreC25 :
                                                                                                Fin 8 → ℝ
                                                                                                Equations
                                                                                                Instances For
                                                                                                  theorem Proofs.LipschitzCertDemo.marginC25 (j : Fin 10) :
                                                                                                  j ≠ 0 → 1618574687 / 267386880 ≤ (mlpS img25).ofLp 0 - (mlpS img25).ofLp j
                                                                                                  theorem Proofs.LipschitzCertDemo.certifiedC25 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                                  j ≠ 0 → (mlpS (img25 + δ)).ofLp j < (mlpS (img25 + δ)).ofLp 0

                                                                                                  Test #25 (digit 0): certified at ε = 1/10 — margin 6.053 ≥ √2·L·ε.

                                                                                                  noncomputable def Proofs.LipschitzCertDemo.hpreU82 :
                                                                                                  Fin 8 → ℝ
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    theorem Proofs.LipschitzCertDemo.marginU82 (j : Fin 10) :
                                                                                                    j ≠ 2 → 726202319 / 66846720 ≤ (mlpT img82).ofLp 2 - (mlpT img82).ofLp j
                                                                                                    theorem Proofs.LipschitzCertDemo.certifiedU82 (δ : EuclideanSpace ℝ (Fin 49)) (hδ : ‖δ‖ < 1 / 10) (j : Fin 10) :
                                                                                                    j ≠ 2 → (mlpT (img82 + δ)).ofLp j < (mlpT (img82 + δ)).ofLp 2

                                                                                                    Test #82 (digit 2): certified at ε = 1/10 — margin 10.864 ≥ √2·L·ε.

                                                                                                    The capped-net certificate witnesses: (subset index, image, class), one triple per certifiedC<i> theorem, in index order.

                                                                                                    Equations
                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                    Instances For

                                                                                                      The unconstrained-net certificate witnesses (certifiedU<i>).

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        Every capped-net witness is certified — the aggregate is no longer bookkeeping over a bare index list: the proof term is literally the tuple of the 8 per-image theorems.

                                                                                                        theorem Proofs.LipschitzCertDemo.scorecard :
                                                                                                        (cappedCerts.length = 8 ∧ ∀ p ∈ cappedCerts, CertifiedAt mlpS (1 / 10) p.2.1 p.2.2) ∧ unconCerts.length = 1 ∧ ∀ p ∈ unconCerts, CertifiedAt mlpT (1 / 10) p.2.1 p.2.2

                                                                                                        The proved core of the scorecard: the 8 capped-net and 1 unconstrained-net witnesses in cappedCerts/unconCerts each carry a CertifiedAt … (1/10) proof (pooled L2; cappedCerts_certified/ unconCerts_certified). The dataset counts (34/100 capped, 1/100 unconstrained) are exact-rational measurements recorded in the certMargin* lines above, not theorems. Lower bounds only: an upper-bound L cannot prove an image uncertifiable.