TorchLean API

NN.Proofs.RL.Floats.CheckedRuntime

Runtime Checked Preconditions → Float32 Semantics Theorems #

NN.Proofs.RL.Floats.IEEE32Exec proves refinement theorems for RL formulas in the executable IEEE32Exec float32 semantics, but those theorems are intentionally stated with explicit isFinite … = true hypotheses for each intermediate.

In the runtime layer, TorchLean typically enforces these hypotheses by checked preconditions: Runtime.RL.Numerics.Float32.*Checked returns Except String and fails fast if any intermediate becomes NaN/Inf.

This file is the glue: it turns “the runtime checker returned .ok” into the proof hypotheses needed by the refinement theorem, yielding a user-facing statement:

checked boundary ⇒ theorem applies.

References:

If Runtime.RL.Numerics.Float32.discountedBackupIEEE32ExecChecked returns .ok, then the decoded real meaning of the result agrees with the standard “real-op + round-to-float32” model (fp32Round) at each primitive operation.

This is the checked boundary ⇒ semantics theorem applies wrapper most users want.

If Runtime.RL.Numerics.Float32.tdResidualIEEE32ExecChecked returns .ok, then the decoded real meaning of the result agrees with the standard “real-op + round-to-float32” model (fp32Round) at each primitive operation.

This is the checked boundary ⇒ semantics theorem applies wrapper for TD residuals.