Documentation

LeanPool.ConwaySoifer.Certificates.CheckerSound

Soundness of the contact-sensitive checker #

The semantic context of one exclusion problem at a real parameter x is Ctx: a triangle U of positive side < 1 containing the real mandatory points, satisfying the contact condition of every cap for every orientation of U, and (when ord = some i) the non-overfull condition of side owner i. The main results are excluded_sound (the checker never accepts a satisfiable problem) and replay_sound (a checked forced-point trace excludes every configuration whose initial model holds). Everything is proved from the leaf-test semantics of IntPoly.lean, the support and contact lemmas of Support.lean, the ray lemmas of Rays.lean and convexity.

Evaluation #

noncomputable def ConwaySoifer.Certificates.evalF (u : IPoint) (x : ℝ) :

Evaluate both integer-polynomial coordinates at a real interval parameter.

Equations
Instances For
    noncomputable def ConwaySoifer.Certificates.realPt (den : ℝ) (P : IPoint) (x : ℝ) :

    The real point represented by a scaled integer point.

    Equations
    Instances For
      theorem ConwaySoifer.Certificates.evalR_detP (u v : IPoint) (x : ℝ) :
      evalR (detP u v) x = cross (evalF u x) (evalF v x)
      theorem ConwaySoifer.Certificates.evalR_supportNumP (u P₀ P₁ P₂ : IPoint) (x : ℝ) :
      evalR (supportNumP u P₀ P₁ P₂) x = supportNum (evalF u x) (evalF P₀ x) (evalF P₁ x) (evalF P₂ x)
      theorem ConwaySoifer.Certificates.evalR_gapP (den : ℤ) (u P₀ P₁ P₂ : IPoint) (x : ℝ) :
      evalR (gapP den u P₀ P₁ P₂) x = supportNum (evalF u x) (evalF P₀ x) (evalF P₁ x) (evalF P₂ x) ^ 2 - ↑den ^ 2 * normSq (evalF u x)
      theorem ConwaySoifer.Certificates.supportNum_smul_pts (c : ℝ) (e p₀ p₁ p₂ : Point) :
      supportNum e (c • p₀) (c • p₁) (c • p₂) = c * supportNum e p₀ p₁ p₂
      theorem ConwaySoifer.Certificates.cross_realPt (den : ℝ) (e : Point) (P : IPoint) (x : ℝ) :
      cross e (realPt den P x) = den⁻¹ * cross e (evalF P x)
      theorem ConwaySoifer.Certificates.realPt_sub (den : ℝ) (P Q : IPoint) (x : ℝ) :
      realPt den P x - realPt den Q x = den⁻¹ • (evalF P x - evalF Q x)

      The semantic context #

      The contact condition of a cap on the face with outward direction n.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        structure ConwaySoifer.Certificates.Ctx (U : EquilateralTriangle) (den x : ℝ) (Ps : List IPoint) (caps : List Cap) (ord : Option (Fin 6)) :

        The geometric hypotheses of one exclusion problem at parameter x.

        Instances For
          theorem ConwaySoifer.Certificates.Ctx.mono {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} {Ps' : List IPoint} (C : Ctx U den x Ps caps ord) (h : ∀ P ∈ Ps', P ∈ Ps) :
          Ctx U den x Ps' caps ord

          Support certificates #

          theorem ConwaySoifer.Certificates.nth_mem {α : Type} (l : List α) (i : ℕ) {a : α} :
          nth l i = some a → a ∈ l

          The support bound at direction e for the real points.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem ConwaySoifer.Certificates.supportOK_sound {x : ℝ} {Ps : List IPoint} {denI : ℤ} (hden : 0 < denI) {u : IPoint} {T : Triple} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : supportOK Ps denI u T a b d fuel = true) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :
            HasBound (↑denI) Ps x (evalF u x)
            theorem ConwaySoifer.Certificates.HasBound.smul {den x : ℝ} {Ps : List IPoint} {e : Point} {t : ℝ} (ht : 0 ≤ t) (h : HasBound den Ps x e) :
            HasBound den Ps x (t • e)
            theorem ConwaySoifer.Certificates.HasBound.false {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) (O : Orientation U) (h : HasBound den Ps x O.dir) :

            A support bound for the real points at the orientation direction is impossible.

            theorem ConwaySoifer.Certificates.supportOK_cone {x : ℝ} {Ps : List IPoint} {denI : ℤ} (hden : 0 < denI) {u v : IPoint} {T : Triple} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (hu : supportOK Ps denI u T a b d fuel = true) (hv : supportOK Ps denI v T a b d fuel = true) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) {α β : ℝ} (hα : 0 ≤ α) (hβ : 0 ≤ β) :
            HasBound (↑denI) Ps x (α • evalF u x + β • evalF v x)

            Two support bounds with a common triple propagate to positive combinations.

            Contact certificates #

            theorem ConwaySoifer.Certificates.badFace_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {e : IPoint} {c : Cap} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : badFace Ps e c a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) {t : ℝ} (ht : 0 < t) (hF : FaceOK U den x (t • evalF e x) c) :
            theorem ConwaySoifer.Certificates.badFaceCone_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {eu ev : IPoint} {c : Cap} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : badFaceCone Ps eu ev c a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) {α β : ℝ} (hα : 0 < α) (hβ : 0 < β) (hF : FaceOK U den x (α • evalF eu x + β • evalF ev x) c) :
            theorem ConwaySoifer.Certificates.rotPow_eval (j : Fin 3) (u : IPoint) (x : ℝ) :
            ∃ (w : IPoint), rotPow j (evalF u x) = evalF w x ∧ (j = 0 → w = u) ∧ (j = 1 → w = rotP u) ∧ (j = 2 → w = rotP (rotP u))
            theorem ConwaySoifer.Certificates.capNode_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {u : IPoint} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : capNode Ps caps u a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (O : Orientation U) {t : ℝ} (ht : 0 < t) (hdir : O.dir = t • evalF u x) :
            theorem ConwaySoifer.Certificates.capCone_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {u v : IPoint} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : capCone Ps caps u v a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (O : Orientation U) {α β : ℝ} (hα : 0 < α) (hβ : 0 < β) (hdir : O.dir = α • evalF u x + β • evalF v x) :

            Nodes and cones #

            theorem ConwaySoifer.Certificates.nodeCheck_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {N : ℕ} {u : IPoint} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : nodeCheck Ps denI caps N u a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (O : Orientation U) {t : ℝ} (ht : 0 < t) (hdir : O.dir = t • evalF u x) :
            theorem ConwaySoifer.Certificates.coneCheck_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {N : ℕ} {u v : IPoint} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : coneCheck Ps denI caps N u v a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (O : Orientation U) {α β : ℝ} (hα : 0 < α) (hβ : 0 < β) (hdir : O.dir = α • evalF u x + β • evalF v x) :

            The direction of a node lies in the first cone and is nonzero (from nodeCond).

            Equations
            Instances For
              theorem ConwaySoifer.Certificates.nodeCond_sound {x : ℝ} {u : IPoint} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : nodeCond u a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :
              InArc (evalF u x) ∧ evalF u x ≠ 0
              theorem ConwaySoifer.Certificates.cone_rejects {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {N : ℕ} {u v : IPoint} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (hu : nodeCheck Ps denI caps N u a b d fuel = true) (hv : nodeCheck Ps denI caps N v a b d fuel = true) (huv : coneCheck Ps denI caps N u v a b d fuel = true) (hdet : 0 ≤ cross (evalF u x) (evalF v x)) (hu' : InArc (evalF u x)) (hu0 : evalF u x ≠ 0) (hv' : InArc (evalF v x)) (hv0 : evalF v x ≠ 0) (O : Orientation U) (hO : InArc O.dir) (h1 : 0 ≤ cross (evalF u x) O.dir) (h2 : 0 ≤ cross O.dir (evalF v x)) :

              Every direction of the closed cone (u, v) is rejected, given that u and v satisfy the node conditions and the node/cone checks hold.

              theorem ConwaySoifer.Certificates.nodesOK_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {N : ℕ} {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (O : Orientation U) (hO : InArc O.dir) (ns : List IPoint) (u : IPoint) :
              nodesOK Ps denI caps N a b d fuel u ns = true → InArc (evalF u x) → evalF u x ≠ 0 → 0 ≤ cross (evalF u x) O.dir → 0 ≤ cross O.dir (rot eastDir) → False
              theorem ConwaySoifer.Certificates.fanCheck_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : fanCheck Ps denI caps a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :

              Diameter #

              theorem ConwaySoifer.Certificates.mem_pairDirs {e : IPoint} {Ps : List IPoint} :
              e ∈ pairDirs Ps → ∃ P ∈ Ps, ∃ Q ∈ Ps, e = psub Q P
              theorem ConwaySoifer.Certificates.sqDist_realPt (den : ℝ) (P Q : IPoint) (x : ℝ) :
              sqDist (realPt den P x) (realPt den Q x) = den⁻¹ ^ 2 * normSq (evalF P x - evalF Q x)
              theorem ConwaySoifer.Certificates.diamCheck_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : diamCheck Ps denI a b d fuel = true) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :

              Non-overfull owners #

              theorem ConwaySoifer.Certificates.evalF_vertexP (den : ℤ) (i : Fin 6) (x : ℝ) :
              evalF (vertexP den i) x = ↑den • vertex i
              theorem ConwaySoifer.Certificates.realPt_vertexP {den : ℝ} {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) (i : Fin 6) (x : ℝ) :
              realPt den (vertexP denI i) x = vertex i
              theorem ConwaySoifer.Certificates.cramer_scaled (AA BB VV DV : Point) :
              cross (BB - AA) DV • AA + cross (VV - AA) DV • (BB - AA) = cross (BB - AA) DV • VV + cross (BB - AA) (AA - VV) • DV

              Cramer's rule for the crossing of the segment [A, B] with the ray V + t • D (polynomial form).

              theorem ConwaySoifer.Certificates.cramer_identity {AA BB VV DV : Point} (hne : cross (BB - AA) DV ≠ 0) :
              AA + (cross (VV - AA) DV / cross (BB - AA) DV) • (BB - AA) = VV + (cross (BB - AA) (AA - VV) / cross (BB - AA) DV) • DV
              theorem ConwaySoifer.Certificates.crossesRay_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {i : Fin 6} {right : Bool} {A B : IPoint} (hA : A ∈ Ps) (hB : B ∈ Ps) (hv : vertex i ∈ U.carrier) {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : crossesRay (vertexP denI i) (psub (vertexP denI (neighbor i right)) (vertexP denI i)) A B a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :
              0 < evalR (detP (psub B A) (psub (vertexP denI (neighbor i right)) (vertexP denI i))) x ∧ 0 ≤ evalR (detP (psub B A) (psub A (vertexP denI i))) x ∧ evalR (detP (psub B A) (psub A (vertexP denI i))) x / evalR (detP (psub B A) (psub (vertexP denI (neighbor i right)) (vertexP denI i))) x ≤ rayLen U (vertex i) (sideDirection i right)

              A verified crossing pair gives a lower bound for the full ray length.

              theorem ConwaySoifer.Certificates.ordinaryExclusion_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {i : Fin 6} (hi : ord = some i) {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : ordinaryExclusion Ps denI i a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :
              theorem ConwaySoifer.Certificates.ordinaryCheck_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} (C : Ctx U den x Ps caps ord) {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : ordinaryCheck Ps denI ord a b d fuel = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :

              The exclusion decision #

              theorem ConwaySoifer.Certificates.excluded_sound {U : EquilateralTriangle} {den x : ℝ} {Ps : List IPoint} {caps : List Cap} {ord : Option (Fin 6)} {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {fuel : ℕ} (depth : ℕ) (a b d : ℤ) :
              0 < d → excluded Ps denI caps ord fuel depth a b d = true → 0 < x → ↑a / ↑d ≤ x → x ≤ ↑b / ↑d → Ctx U den x Ps caps ord → False

              Replay of a forced-point trace #

              Semantic content of a replay state for a configuration T at parameter x.

              Instances For
                theorem ConwaySoifer.Certificates.ModelHolds.ctx {M : Model} {T : Configuration} {den x : ℝ} (H : ModelHolds M T den x) (j : Fin 10) :
                Ctx (T j) den x (M.B j) (M.caps j) (M.ord j)
                theorem ConwaySoifer.Certificates.inTarget_sound {q : IPoint} {denI : ℤ} {den : ℝ} (hden : ↑denI = den) (hdpos : 0 < denI) {a b d : ℤ} (hd : 0 < d) {fuel : ℕ} (h : inTarget q denI a b d fuel = true) {x : ℝ} (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) :
                realPt den q x ∈ target
                theorem ConwaySoifer.Certificates.stepCheck_sound {M : Model} {T : Configuration} {den x : ℝ} {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {st : Step} {a b d : ℤ} (hd : 0 < d) {fuel depth : ℕ} (h : stepCheck M denI st a b d fuel depth = true) (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (H : ModelHolds M T den x) :
                ModelHolds (M.insert st) T den x
                theorem ConwaySoifer.Certificates.replay_sound {T : Configuration} {den x : ℝ} {denI : ℤ} (hden : ↑denI = den) (hdpos : 0 < denI) {a b d : ℤ} (hd : 0 < d) {fuel depth : ℕ} (hx : 0 < x) (hlo : ↑a / ↑d ≤ x) (hhi : x ≤ ↑b / ↑d) (steps : List Step) (M : Model) (last : Fin 10) :
                replay M denI a b d fuel depth steps last = true → ModelHolds M T den x → False
                theorem ConwaySoifer.Certificates.CertData.check_sound (C : CertData) {fuel depth : ℕ} (h : C.check fuel depth = true) :
                0 < C.den ∧ 0 ≤ C.lo ∧ C.lo < C.hi ∧ C.hi ≤ 11 / 25 ∧ ∃ (M : Model), initModel C.case C.lo C.hi C.den = some M ∧ ∀ (T : Configuration) (x : ℝ), 0 < x → x ≤ ↑(C.hi - C.lo) → ModelHolds M T (↑C.den) x → False

                The complete certificate: for every parameter s ∈ (lo, hi] and every configuration whose initial model holds at x = s - lo, contradiction.