Primality prover #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file provides a norm_num
extention to prove that natural numbers are prime.
theorem
tactic.norm_num.min_fac_helper.n_pos
{n k : ℕ}
(h : tactic.norm_num.min_fac_helper n k) :
0 < n
theorem
tactic.norm_num.min_fac_helper_1
{n k k' : ℕ}
(e : k + 1 = k')
(np : (bit1 n).min_fac ≠ bit1 k)
(h : tactic.norm_num.min_fac_helper n k) :
theorem
tactic.norm_num.min_fac_helper_2
(n k k' : ℕ)
(e : k + 1 = k')
(np : ¬nat.prime (bit1 k))
(h : tactic.norm_num.min_fac_helper n k) :
theorem
tactic.norm_num.min_fac_helper_3
(n k k' c : ℕ)
(e : k + 1 = k')
(nc : bit1 n % bit1 k = c)
(c0 : 0 < c)
(h : tactic.norm_num.min_fac_helper n k) :
A partial proof of factors
. Asserts that l
is a sorted list of primes, lower bounded by a
prime p
, which multiplies to n
.
theorem
tactic.norm_num.factors_helper_cons'
(n m a b : ℕ)
(l : list ℕ)
(h₁ : b * m = n)
(h₂ : a ≤ b)
(h₃ : b.min_fac = b)
(H : tactic.norm_num.factors_helper m b l) :
tactic.norm_num.factors_helper n a (b :: l)
theorem
tactic.norm_num.factors_helper_cons
(n m a b : ℕ)
(l : list ℕ)
(h₁ : b * m = n)
(h₂ : a < b)
(h₃ : b.min_fac = b)
(H : tactic.norm_num.factors_helper m b l) :
tactic.norm_num.factors_helper n a (b :: l)
theorem
tactic.norm_num.factors_helper_same
(n m a : ℕ)
(l : list ℕ)
(h : a * m = n)
(H : tactic.norm_num.factors_helper m a l) :
tactic.norm_num.factors_helper n a (a :: l)
theorem
tactic.norm_num.factors_helper_end
(n : ℕ)
(l : list ℕ)
(H : tactic.norm_num.factors_helper n 2 l) :