/-
Copyright 2025 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilBrocard's Conjecture
open Finset Filter
namespace Brocard
Brocard's Conjecture
For every n ≥ 2, between the squares of the n-th and (n+1)-th primes,
there are at least four prime numbers.
@[category research open, AMS 11]
theorem brocard_conjecture (n : ℕ) (hn : 1 ≤ n) :
letI prev := n.nth Nat.Prime;
letI next := (n+1).nth Nat.Prime;
4 ≤ ((Ioo (prev^2) (next^2)).filter Nat.Prime).card := n:ℕhn:1 ≤ n⊢ 4 ≤ #(filter Nat.Prime (Ioo (Nat.nth Nat.Prime n ^ 2) (Nat.nth Nat.Prime (n + 1) ^ 2)))
All goals completed! 🐙
Ferreira proved that Brocard's conjecture is true for sufficiently large n.
@[category research solved, AMS 11]
theorem brocard_conjecture.ferreira_large_n : ∀ᶠ n in atTop,
letI prev := n.nth Nat.Prime;
letI next := (n+1).nth Nat.Prime;
4 ≤ ((Ioo (prev^2) (next^2)).filter Nat.Prime).card := ⊢ ∀ᶠ (n : ℕ) in atTop, 4 ≤ #(filter Nat.Prime (Ioo (Nat.nth Nat.Prime n ^ 2) (Nat.nth Nat.Prime (n + 1) ^ 2)))
All goals completed! 🐙
end Brocard