DispatchAbstractComposition__Refutation

Lean checked

Statement

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

Theorem

The following result is false: The shared lexical, native-shortcut, integer-tier, many-digit comparison/deferral, slow-fallback, assembly, and sign contracts of DispatchContracts admit implementations whose explicit dispatcher flow produces a normal result for the bytes of every source-valid Rust string. For any implementation of those same contracts and every source-valid Rust string, that flow first strips the sign; failed stripping is invalid, while successful stripping obtains a source-valid byte-slice body and performs numeric-or-special lexical classification. On a numeric record it tries the native shortcut; after native deferral it computes the first integer pair, conditionally computes the mantissa-plus-one pair for a many-digit record, retains an equal pair or forces deferral on disagreement, replaces a deferred pair by the slow result, assembles the selected pair, and finally applies the lexical sign. Every normal flow result is invalid exactly for an invalid input; every numeric literal returns its exact binary64 magnitude rounding with its lexical sign; and every special literal returns a NaN or the infinity with its lexical sign, as appropriate.

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.DispatchContracts
import Tablet.DispatchContractsUninhabited
import Tablet.SourceValidByteSlice
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace
import Tablet.num_imp_dec2flt_parse_parse_number
import Tablet.num_imp_dec2flt_parse_parse_inf_nan
import Tablet.num_imp_dec2flt_decimal_Decimal_try_fast_path
import Tablet.num_imp_dec2flt_lemire_compute_float
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa
import Tablet.num_imp_dec2flt_biased_fp_to_float

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: DispatchAbstractComposition__Refutation]
theorem DispatchAbstractComposition__Refutation : ¬ ((∃ C : DispatchContracts,
      ∀ s, DecimalGoalVocabularyDefault.sourceString s ->
        ∃ out, C.flow (DecimalGoalVocabularyDefault.bytes s) out) ∧
    ∀ (C : DispatchContracts) s out,
      DecimalGoalVocabularyDefault.sourceString s ->
      C.flow (DecimalGoalVocabularyDefault.bytes s) out ->
      (out = none ↔ DecimalGoalVocabularyDefault.classifies
        (DecimalGoalVocabularyDefault.bytes s) none) ∧
      (∀ x, DecimalGoalVocabularyDefault.classifies
          (DecimalGoalVocabularyDefault.bytes s) (some (Sum.inl x)) ->
          ∃ (f target : F64), out = some f ∧
            DecimalGoalVocabularyDefault.roundsMagnitude
              (DecimalGoalVocabularyDefault.exactMagnitude x) target ∧
            DecimalGoalVocabularyDefault.signedMagnitude
              (DecimalGoalVocabularyDefault.lexicalNegative x) target f) ∧
      (∀ sign nan,
        DecimalGoalVocabularyDefault.classifies
          (DecimalGoalVocabularyDefault.bytes s)
          (some (Sum.inr (sign, nan))) ->
        ∃ f, out = some f ∧
          (if nan then DecimalGoalVocabularyDefault.isNan f
           else DecimalGoalVocabularyDefault.isInfinity (sign = some true) f))) := 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.

Earlier prose review

An earlier review questioned the prose argument. Lean subsequently checked the formal proof. Review of the statement’s intended meaning is a separate judgment.

Proof

Suppose the displayed positive claim held. Its first conjunct supplies a dispatcher contract package C, and therefore supplies an inhabitant of DispatchContracts. This contradicts DispatchContractsUninhabited, which proves that no such package exists. Hence the exact positive claim displayed above is false.

Lean proof


  intro h
  rcases h.1 with ⟨C, _⟩
  exact DispatchContractsUninhabited ⟨C⟩

Download Lean source · Download TeX source

Complete Lean module
import Tablet.DecimalGoalVocabularyDefault
import Tablet.DispatchContracts
import Tablet.DispatchContractsUninhabited
import Tablet.SourceValidByteSlice
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace
import Tablet.num_imp_dec2flt_parse_parse_number
import Tablet.num_imp_dec2flt_parse_parse_inf_nan
import Tablet.num_imp_dec2flt_decimal_Decimal_try_fast_path
import Tablet.num_imp_dec2flt_lemire_compute_float
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa
import Tablet.num_imp_dec2flt_biased_fp_to_float

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: DispatchAbstractComposition__Refutation]
theorem DispatchAbstractComposition__Refutation : ¬ ((∃ C : DispatchContracts,
      ∀ s, DecimalGoalVocabularyDefault.sourceString s ->
        ∃ out, C.flow (DecimalGoalVocabularyDefault.bytes s) out) ∧
    ∀ (C : DispatchContracts) s out,
      DecimalGoalVocabularyDefault.sourceString s ->
      C.flow (DecimalGoalVocabularyDefault.bytes s) out ->
      (out = none ↔ DecimalGoalVocabularyDefault.classifies
        (DecimalGoalVocabularyDefault.bytes s) none) ∧
      (∀ x, DecimalGoalVocabularyDefault.classifies
          (DecimalGoalVocabularyDefault.bytes s) (some (Sum.inl x)) ->
          ∃ (f target : F64), out = some f ∧
            DecimalGoalVocabularyDefault.roundsMagnitude
              (DecimalGoalVocabularyDefault.exactMagnitude x) target ∧
            DecimalGoalVocabularyDefault.signedMagnitude
              (DecimalGoalVocabularyDefault.lexicalNegative x) target f) ∧
      (∀ sign nan,
        DecimalGoalVocabularyDefault.classifies
          (DecimalGoalVocabularyDefault.bytes s)
          (some (Sum.inr (sign, nan))) ->
        ∃ f, out = some f ∧
          (if nan then DecimalGoalVocabularyDefault.isNan f
           else DecimalGoalVocabularyDefault.isInfinity (sign = some true) f))) := by
-- BODY
  intro h
  rcases h.1 with ⟨C, _⟩
  exact DispatchContractsUninhabited ⟨C⟩

Proof structure

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

Explore this dependency tree

Inspect related source (201)
More program dependencies (159)
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 10 entries
Technical checking records
Local closure summary
{
  "node": "DispatchAbstractComposition__Refutation",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "41a69abc3f33a7edd8d16a6e6e9de956e5f9c0a7f9115b77b646dcd78b963a1b",
  "active_statement_hash": "f2c53457d2a8ca4dc04fbcb183c245401643beab2951706f2192079c0c05aef3",
  "kernel_axioms": [
    "propext"
  ],
  "toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
  "lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
  "checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
  "approved_axioms_hash": "d5c04ffa333d9b33b238a527f5beaa2be82e021d3e9c0bbe01b1310280f7f55a",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-23",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "DispatchContractsUninhabited": "d0cddc91b375723e"
  },
  "strict_definition_deps": {
    "DecimalGoalVocabulary": "65227461bf3cac06",
    "DecimalGoalVocabularyDefault": "512f8d0aea894250",
    "DecimalLexeme": "c43614ff2149ecf2",
    "DispatchContracts": "1b6a73572941f181",
    "F64": "ec4e25fbaf4e11d4"
  }
}
Prose assessment
{
  "label": "Sound flag superseded by recorded Lean closure",
  "assessment_status": "ReviewerPinnedFail",
  "fingerprint_relation": "differs from current fingerprint",
  "assessment_fingerprint": "sound-v2:8e5506e3f0fa633dfe9789b45bffce452dfa181ae21c617b6a38835d60b29789",
  "current_fingerprint": "sound-v2:cf585c31502a0eeb05dce5f5a1a46d47cdcafa540f436e90ee2c4c8357f80ed6",
  "superseded_for_theorem_closure": true
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Fail",
  "substantiveness_status": "Pass"
}