P826_T1_ExponentLowerBound

Lean checked

Statement

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

Lemma · Exact lower bound for the normalized binary exponent

Let A,B\in\mathbb R and e\in\mathbb Z. If
10^{-325}\leq A<B \qquad\text{and}\qquad B/2^e\leq1,
then -1079\leq e.

Lean statement

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

import Tablet.P826_T1_PowerGridAlignment

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 2000

namespace dec2flt_model

-- [TABLET NODE: P826_T1_ExponentLowerBound]
theorem P826_T1_ExponentLowerBound (A B : Real) (e : Int)
    (hA : (10 : Real) ^ (-(325 : Int)) <= A)
    (hAB : A < B) (hB : B / (2 : Real) ^ e <= 1) :
    -1079 <= e := 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

Positivity of 2^e turns B/2^e\leq1 into B\leq2^e. The exact natural-number comparison
10^{325}<2^{1080}
is checked by kernel reduction. Taking inverses of these positive numbers therefore gives 2^{-1080}<10^{-325}. If e\leq-1080, monotonicity of integer powers of the base 2>1 gives
2^e\leq2^{-1080}<10^{-325}\leq A<B\leq2^e,
a contradiction. Hence the integer e is at least -1079.

Lean proof


  have hpow2pos : 0 < (2 : Real) ^ e := zpow_pos (by norm_num) _
  have hBle : B <= (2 : Real) ^ e := by
    have := (div_le_iff₀ hpow2pos).mp hB
    simpa using this
  by_contra hnot
  have he : e <= -1080 := by omega
  have hmono : (2 : Real) ^ e <= (2 : Real) ^ (-(1080 : Int)) := by
    exact zpow_le_zpow_right₀ (by norm_num) he
  have hnat : (10 : Nat) ^ 325 < (2 : Nat) ^ 1080 := by decide +kernel
  have hnatR : (10 : Real) ^ 325 < (2 : Real) ^ 1080 := by
    exact_mod_cast hnat
  have hinv : (2 : Real) ^ (-(1080 : Int)) <
      (10 : Real) ^ (-(325 : Int)) := by
    norm_num only [zpow_neg, zpow_natCast]
    exact (inv_lt_inv₀ (pow_pos (by norm_num) _)
      (pow_pos (by norm_num) _)).mpr hnatR
  linarith

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.P826_T1_PowerGridAlignment

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 2000

namespace dec2flt_model

-- [TABLET NODE: P826_T1_ExponentLowerBound]
theorem P826_T1_ExponentLowerBound (A B : Real) (e : Int)
    (hA : (10 : Real) ^ (-(325 : Int)) <= A)
    (hAB : A < B) (hB : B / (2 : Real) ^ e <= 1) :
    -1079 <= e := by
-- BODY
  have hpow2pos : 0 < (2 : Real) ^ e := zpow_pos (by norm_num) _
  have hBle : B <= (2 : Real) ^ e := by
    have := (div_le_iff₀ hpow2pos).mp hB
    simpa using this
  by_contra hnot
  have he : e <= -1080 := by omega
  have hmono : (2 : Real) ^ e <= (2 : Real) ^ (-(1080 : Int)) := by
    exact zpow_le_zpow_right₀ (by norm_num) he
  have hnat : (10 : Nat) ^ 325 < (2 : Nat) ^ 1080 := by decide +kernel
  have hnatR : (10 : Real) ^ 325 < (2 : Real) ^ 1080 := by
    exact_mod_cast hnat
  have hinv : (2 : Real) ^ (-(1080 : Int)) <
      (10 : Real) ^ (-(325 : Int)) := by
    norm_num only [zpow_neg, zpow_natCast]
    exact (inv_lt_inv₀ (pow_pos (by norm_num) _)
      (pow_pos (by norm_num) _)).mpr hnatR
  linarith

end dec2flt_model

Proof structure

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

Explore this dependency tree

Inspect related source (116)
More program dependencies (83)
Standard-library dependencies (30)

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
Technical checking records
Local closure summary
{
  "node": "P826_T1_ExponentLowerBound",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "f145a95efbba91678a98a55661bd354c11c68c977b54708981d444b854c33332",
  "active_statement_hash": "0a4c6095343fc145a8aaa31efac791a7500faa9b30c64739b3078d3e327f6b45",
  "kernel_axioms": [
    "Classical.choice",
    "Quot.sound",
    "propext"
  ],
  "toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
  "lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
  "checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
  "approved_axioms_hash": "ab64d13f256386ee0e494a5abcc6a5db49512cf3d90bbdfcabd6327793a31f95",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "revalidate-cycle-194",
  "boundary_theorems": {},
  "strict_theorem_deps": {},
  "strict_definition_deps": {}
}
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:066ef5fc7d420befe3340e39b60d21503414b6b9b01026b8ec68120e885eb6f8",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}