Documentation

LeanMlir.Proofs.Certificates.SmoothingNetWitness

The net-semantics tie, INSTANTIATED — CERTIFY for a concrete trained net #

GENERATED by scripts/smoothing_net_witness_gen.py. The smoothing chain's last informal hypotheses — hC measurability and hp interiority for the abstract classifier — are here DISCHARGED for mlpT, the trained /128-rationalized 49→8→10 pooled-MNIST MLP (LipschitzCertInstance.lean): measurability from the logits' continuity, interiority from ONE strict-argmax witness per class (argmaxNet_smoothProb_mem_Ioo). Each witness is a pooled test image whose predicted class leads every other logit STRICTLY — checked in exact integer arithmetic at generation and re-proved in-kernel below.

smoothing_cp_certified_mlpT is Cohen's CERTIFY guarantee for THIS network's argmax with every semantic hypothesis discharged; the demo instantiates it at the deployed scorecard scale (N = 10112, α = 1/1000). Honest scope: mlpT is the Lipschitz-thread pooled net, not the 784-dim smoothing-driver checkpoint (that tie = the same generator pass at full width), and the driver's float forward vs this real-semantics net is the FloatBridge tier's story.

Class-0 witness: pooled test image #440 (label 0); exact logit margin over the runner-up is 836677782/66846720 ≈ 12.5164.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    noncomputable def Proofs.LipschitzCertDemo.netWpre0 :
    Fin 8

    Exact hidden pre-activations of netW0 (denominator 128·4080).

    Equations
    Instances For

      In-kernel STRICT argmax at the class-0 witness.

      Class-1 witness: pooled test image #3231 (label 1); exact logit margin over the runner-up is 476292520/66846720 ≈ 7.1251.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def Proofs.LipschitzCertDemo.netWpre1 :
        Fin 8

        Exact hidden pre-activations of netW1 (denominator 128·4080).

        Equations
        Instances For

          In-kernel STRICT argmax at the class-1 witness.

          Class-2 witness: pooled test image #1895 (label 2); exact logit margin over the runner-up is 929615405/66846720 ≈ 13.9067.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def Proofs.LipschitzCertDemo.netWpre2 :
            Fin 8

            Exact hidden pre-activations of netW2 (denominator 128·4080).

            Equations
            Instances For

              In-kernel STRICT argmax at the class-2 witness.

              Class-3 witness: pooled test image #1845 (label 3); exact logit margin over the runner-up is 638124398/66846720 ≈ 9.5461.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def Proofs.LipschitzCertDemo.netWpre3 :
                Fin 8

                Exact hidden pre-activations of netW3 (denominator 128·4080).

                Equations
                Instances For

                  In-kernel STRICT argmax at the class-3 witness.

                  Class-4 witness: pooled test image #8000 (label 4); exact logit margin over the runner-up is 691947893/66846720 ≈ 10.3513.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Proofs.LipschitzCertDemo.netWpre4 :
                    Fin 8

                    Exact hidden pre-activations of netW4 (denominator 128·4080).

                    Equations
                    Instances For

                      In-kernel STRICT argmax at the class-4 witness.

                      Class-5 witness: pooled test image #6908 (label 5); exact logit margin over the runner-up is 644875950/66846720 ≈ 9.6471.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def Proofs.LipschitzCertDemo.netWpre5 :
                        Fin 8

                        Exact hidden pre-activations of netW5 (denominator 128·4080).

                        Equations
                        Instances For

                          In-kernel STRICT argmax at the class-5 witness.

                          Class-6 witness: pooled test image #7843 (label 6); exact logit margin over the runner-up is 867723980/66846720 ≈ 12.9808.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def Proofs.LipschitzCertDemo.netWpre6 :
                            Fin 8

                            Exact hidden pre-activations of netW6 (denominator 128·4080).

                            Equations
                            Instances For

                              In-kernel STRICT argmax at the class-6 witness.

                              Class-7 witness: pooled test image #5297 (label 7); exact logit margin over the runner-up is 748210150/66846720 ≈ 11.1929.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                noncomputable def Proofs.LipschitzCertDemo.netWpre7 :
                                Fin 8

                                Exact hidden pre-activations of netW7 (denominator 128·4080).

                                Equations
                                Instances For

                                  In-kernel STRICT argmax at the class-7 witness.

                                  Class-8 witness: pooled test image #7919 (label 8); exact logit margin over the runner-up is 593814126/66846720 ≈ 8.8832.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    noncomputable def Proofs.LipschitzCertDemo.netWpre8 :
                                    Fin 8

                                    Exact hidden pre-activations of netW8 (denominator 128·4080).

                                    Equations
                                    Instances For

                                      In-kernel STRICT argmax at the class-8 witness.

                                      Class-9 witness: pooled test image #2478 (label 9); exact logit margin over the runner-up is 509675629/66846720 ≈ 7.6245.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        noncomputable def Proofs.LipschitzCertDemo.netWpre9 :
                                        Fin 8

                                        Exact hidden pre-activations of netW9 (denominator 128·4080).

                                        Equations
                                        Instances For

                                          In-kernel STRICT argmax at the class-9 witness.

                                          noncomputable def Proofs.LipschitzCertDemo.netW :

                                          The witness bundle: one strict-argmax point per class.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem Proofs.LipschitzCertDemo.netW_strict (c j : Fin 10) :
                                            j c(mlpT (netW c)).ofLp j < (mlpT (netW c)).ofLp c
                                            theorem Proofs.LipschitzCertDemo.smoothing_cp_certified_mlpT {σ : } ( : 0 < σ) (x : EuclideanSpace (Fin 49)) (y : Fin 10) {N k₀ : } (hk₀ : k₀ N) {α q₀ : } ( : 0 α) (hα1 : α < 1) (hq₀ : q₀ Set.Ioo 0 1) (htail : binomTail N k₀ q₀ α) :
                                            1 - α (MeasureTheory.Measure.pi fun (x : Fin N) => ProbabilityTheory.stdGaussian (EuclideanSpace (Fin 49))).real {ω : Fin NEuclideanSpace (Fin 49) | (∑ i : Fin N, if argmaxNet (fun (v : EuclideanSpace (Fin 49)) (j : Fin (9 + 1)) => (mlpT v).ofLp j) (x + σ ω i) = y then 1 else 0) = k₀∀ (δ : EuclideanSpace (Fin 49)), δ < σ * stdNormalQuantile q₀∀ (j : Fin 10), j y (z : EuclideanSpace (Fin 49)), if argmaxNet (fun (v : EuclideanSpace (Fin 49)) (j : Fin (9 + 1)) => (mlpT v).ofLp j) (x + δ + σ z) = j then 1 else 0 ProbabilityTheory.stdGaussian (EuclideanSpace (Fin 49)) < (z : EuclideanSpace (Fin 49)), if argmaxNet (fun (v : EuclideanSpace (Fin 49)) (j : Fin (9 + 1)) => (mlpT v).ofLp j) (x + δ + σ z) = y then 1 else 0 ProbabilityTheory.stdGaussian (EuclideanSpace (Fin 49))}

                                            CERTIFY for the CONCRETE net. smoothing_cp_certified_net with the classifier = mlpT's argmax: measurability and hp interiority both DISCHARGED (continuity + the ten witnesses above). With probability ≥ 1 − α over the N Gaussian samples: if the vote count for y at x comes out k₀, every ‖δ‖ < σ·Φ⁻¹(q₀) leaves y the strict argmax of the smoothed mlpT.

                                            theorem Proofs.LipschitzCertDemo.smooth_cp_mlpT_demo {σ : } ( : 0 < σ) (x : EuclideanSpace (Fin 49)) (y : Fin 10) :
                                            1 - 1 / 1000 (MeasureTheory.Measure.pi fun (x : Fin 10112) => ProbabilityTheory.stdGaussian (EuclideanSpace (Fin 49))).real {ω : Fin 10112EuclideanSpace (Fin 49) | (∑ i : Fin 10112, if argmaxNet (fun (v : EuclideanSpace (Fin 49)) (j : Fin (9 + 1)) => (mlpT v).ofLp j) (x + σ ω i) = y then 1 else 0) = 10084∀ (δ : EuclideanSpace (Fin 49)), δ < σ * stdNormalQuantile (9952 / 10000)∀ (j : Fin 10), j y (z : EuclideanSpace (Fin 49)), if argmaxNet (fun (v : EuclideanSpace (Fin 49)) (j : Fin (9 + 1)) => (mlpT v).ofLp j) (x + δ + σ z) = j then 1 else 0 ProbabilityTheory.stdGaussian (EuclideanSpace (Fin 49)) < (z : EuclideanSpace (Fin 49)), if argmaxNet (fun (v : EuclideanSpace (Fin 49)) (j : Fin (9 + 1)) => (mlpT v).ofLp j) (x + δ + σ z) = y then 1 else 0 ProbabilityTheory.stdGaussian (EuclideanSpace (Fin 49))}

                                            The deployed-protocol demo: at the scorecard's N = 10112, α = 1/1000, a count of 10084 certifies radius σ·Φ⁻¹(0.9952) for the smoothed mlpT — the per-image scorecard shape with NO abstract-classifier hypotheses left (the tail check is one kernel evaluation). The count is SmoothingCPScorecard.lean's MNIST-MLP image-1 entry, from a 784-dim driver run; no Monte-Carlo count has been taken on mlpT itself, so the hypothesis is the protocol's, not a measurement of this net.