P13_T1_NumberHelperRejection

Lean checked

Statement

This explanation was written alongside the formalization to describe the statement and its reasoning.

Theorem

Every nonempty source-valid byte slice of length at most A=3458764513820540928 bytes that is not a complete unsigned numeric literal returns normally with None from the specialized parse_number in ActualDispatchOperations. The slice domain is SourceValidByteSlice, with arbitrary bytes and no UTF-8 premise. Invalidity is the complement of the complete unsigned numeric grammar in DecimalGoalVocabularyDefault; it includes malformed exponent tails and trailing characters after exponent accumulation has stopped. No extra exponent-digit or value bound is imposed. Checked failure or divergence does not satisfy this normal-return claim.

Lean statement

Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.

import Tablet.DecimalGoalVocabularyDefault
import Tablet.SourceValidByteSlice
import Tablet.P9_T1_ActualDispatchOperations
import Tablet.P367_T1_NumberHelperWholeClassificationA

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: P13_T1_NumberHelperRejection]
theorem P13_T1_NumberHelperRejection :
    forall s : Slice Std.U8,
      SourceValidByteSlice s -> s.val ≠ [] ->
      s.val.length <= 3458764513820540928 ->
      (¬ exists x : DecimalLexeme, x.leadingSign = none ∧
        DecimalGoalVocabularyDefault.validNumeric x ∧
        DecimalGoalVocabularyDefault.renderNumeric x = DecimalGoalVocabularyDefault.bytes s) ->
      P9_T1_ActualDispatchOperations.parseNumber s = ok none := by
Proof

Natural-language proof

The status above describes the Lean proof. Its explanatory prose may remain a sketch after that proof closes.

Explanatory prose status

Prose retained as authored. The explanatory prose is preserved as it stood when captured.

Proof

Apply NumberHelperWholeClassificationA to the nonempty slice and its stated A-bound. It supplies an actual normal optional result o for the specialized call. If o were Some d, its forward classification implication would supply a lexeme with no leading sign, valid numeric grammar and whole rendering equal to the input bytes. That is exactly the existential excluded by the invalidity premise in DecimalGoalVocabularyDefault. Therefore o is not Some. The only other constructor of Option is None, so the normal equation is \texttt{ok none}. The classifier scans the entire exponent-digit suffix even after accumulation stops and tests the final consumed length; its normality is over arbitrary bytes, so this argument does not replace failure or divergence by a normal rejection or assume a short exponent.

Lean proof


  intro s hsource hne hlen hinvalid
  obtain ⟨result, hparse, hclass⟩ :=
    P367_T1_NumberHelperWholeClassificationA s hne hlen
  cases result with
  | none => exact hparse
  | some d => exact (hinvalid (hclass.mp ⟨d, rfl⟩)).elim

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.DecimalGoalVocabularyDefault
import Tablet.SourceValidByteSlice
import Tablet.P9_T1_ActualDispatchOperations
import Tablet.P367_T1_NumberHelperWholeClassificationA

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: P13_T1_NumberHelperRejection]
theorem P13_T1_NumberHelperRejection :
    forall s : Slice Std.U8,
      SourceValidByteSlice s -> s.val ≠ [] ->
      s.val.length <= 3458764513820540928 ->
      (¬ exists x : DecimalLexeme, x.leadingSign = none ∧
        DecimalGoalVocabularyDefault.validNumeric x ∧
        DecimalGoalVocabularyDefault.renderNumeric x = DecimalGoalVocabularyDefault.bytes s) ->
      P9_T1_ActualDispatchOperations.parseNumber s = ok none := by
-- BODY
  intro s hsource hne hlen hinvalid
  obtain ⟨result, hparse, hclass⟩ :=
    P367_T1_NumberHelperWholeClassificationA s hne hlen
  cases result with
  | none => exact hparse
  | some d => exact (hinvalid (hclass.mp ⟨d, rfl⟩)).elim

end dec2flt_model

Proof structure

Follow the declared dependencies to read the supporting statements and proofs.

Explore this dependency tree

Inspect related source (198)
More program dependencies (156)
Standard-library dependencies (39)

Related source and models come from the extraction records and declared dependencies.

Proof assumptions and review

Lean checks the formal proof. Trellis also reviews how the statement corresponds to the intended requirement.

Transitive assumptions

This list combines the assumptions recorded for this declaration and its dependencies. It may include assumptions used by auxiliary declarations in those modules.

Helper theorems included
All 177 entries
Technical checking records
Local closure summary
{
  "node": "P13_T1_NumberHelperRejection",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "2285cf3c9a4144d5cc023e20f72fac69ffb77ffa464e7c1507fd4e3c7d714c95",
  "active_statement_hash": "f1ce35eb7900bffacb04e30af417d6a82c35193d66ff51f90965805df094ab27",
  "kernel_axioms": [
    "propext"
  ],
  "toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
  "lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
  "checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
  "approved_axioms_hash": "576e6bf9480cfd32f53c309c7ac8fb115c1ba6e413f299ed5ff9fa7c647e6769",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-194",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "P367_T1_NumberHelperWholeClassificationA": "5730db65003ba4ba"
  },
  "strict_definition_deps": {
    "DecimalGoalVocabulary": "65227461bf3cac06",
    "DecimalGoalVocabularyDefault": "71a18a6c119a3cdc",
    "DecimalLexeme": "c43614ff2149ecf2",
    "P9_T1_ActualDispatchOperations": "d8bf51ebbbf153ac",
    "P9_T1_DispatchOperations": "9b177bb1b830a655",
    "SourceValidByteSlice": "3dc42716a6378d26",
    "num_imp_dec2flt_decimal_Decimal": "c43614ff2149ecf2"
  }
}
Prose assessment
{
  "label": "Lean proof closed; predictive prose review no longer required",
  "assessment_status": null,
  "fingerprint_relation": "unknown",
  "assessment_fingerprint": null,
  "current_fingerprint": "sound-v2:f2a4b400df2ea3baf8260e84bf498999cd46b30f6308197a826fc59e4673c8c9",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}