Interval checking by binary search #
The check_interval tactic proves goals of the form
∀ n, lo ≤ n → n < hi → P n or ∀ n, lo ≤ n → n < hi → n % b = r → P n
by building a balanced binary tree of eagerReduce proof terms, one per value in the range.
Tools for automation of ∀ n, lo ≤ n → n < hi → P n #
Tools for automation of ∀ n, lo ≤ n → n < hi → n % b = r → P n #
An expression to prove statement of the form ∀ n < hi → P n
Equations
- makeForallBisectHi P hi pf = Lean.mkApp3 (Lean.mkConst `forall_start) P (Lean.mkRawNatLit hi) (makeForallBisectLoHi P 0 hi pf)
Instances For
An expression to prove statement of the form ∀ n < hi → n % b = r → P n.
Equations
- makeForallModBisectHi P hi b r bE rE pf = Lean.mkApp5 (Lean.mkConst `forall_mod_start) P (Lean.mkRawNatLit hi) bE rE (makeForallModBisectLoHi P r hi b r bE rE pf)
Instances For
Tactic to prove bounded universal statements by exhaustive kernel checking. Accepts four goal shapes:
∀ n < hi, P n∀ n, lo ≤ n → n < hi → P n∀ n < hi, n % b = r → P n∀ n, lo ≤ n → n < hi → n % b = r → P n
The predicate P n must reduce to true (via eagerReduce) for every n in range.
The tactic builds a balanced binary tree of proof terms, so the elaboration depth is
logarithmic in the range size.
-- Check that wieferichKR is false or mirimanoffKR is false for all n ≡ 1 (mod 6), n < 6000:
theorem wieferich_mirimanoff₁ : ∀ n < 6000, n % 6 = 1 →
(wieferichKR n).not'.or' (mirimanoffKR n).not' := by
check_interval
Equations
- tacticCheck_interval = Lean.ParserDescr.node `tacticCheck_interval 1024 (Lean.ParserDescr.nonReservedSymbol "check_interval" false)