math / data /lean /OAI /NumberTheory /Ostmann /Defs.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
1.47 kB
import Mathlib.Algebra.Group.Pointwise.Set.Basic
import Mathlib.Data.Nat.Prime.Defs
import Mathlib.Data.Set.Finite.Basic
import Mathlib.Data.Set.SymmDiff
import Mathlib.Order.Interval.Finset.Nat
namespace OAI
namespace Ostmann
open scoped Pointwise symmDiff
def primes : Set β„• := {n | Nat.Prime n}
abbrev sumset (A B : Set β„•) : Set β„• := A + B
def EventuallyEqual (S T : Set β„•) : Prop :=
βˆƒ N : β„•, βˆ€ n : β„•, N ≀ n β†’ (n ∈ S ↔ n ∈ T)
def AsymptoticallyIndecomposable : Prop :=
βˆ€ A B : Set β„•, A.Nontrivial β†’ B.Nontrivial β†’
Set.Infinite ((A + B) βˆ† {n : β„• | Nat.Prime n})
def FiniteModificationIndecomposable : Prop :=
βˆ€ S : Set β„•, (S βˆ† primes).Finite β†’
βˆ€ A B : Set β„•, A.Nontrivial β†’ B.Nontrivial β†’ A + B β‰  S
@[simp] theorem mem_primes {n : β„•} : n ∈ primes ↔ Nat.Prime n := Iff.rfl
@[simp] theorem mem_sumset {A B : Set β„•} {n : β„•} :
n ∈ sumset A B ↔ βˆƒ a ∈ A, βˆƒ b ∈ B, a + b = n := Set.mem_add
noncomputable def elementsUpTo (A : Set β„•) (x : β„•) : Finset β„• := by
classical
exact (Finset.range (x + 1)).filter (fun n => n ∈ A)
noncomputable def countUpTo (A : Set β„•) (x : β„•) : β„• := (elementsUpTo A x).card
@[simp] theorem mem_elementsUpTo {A : Set β„•} {x n : β„•} :
n ∈ elementsUpTo A x ↔ n ∈ A ∧ n ≀ x := by
classical
simp only [elementsUpTo, Finset.mem_filter, Finset.mem_range,
Nat.lt_succ_iff, and_comm]
end Ostmann
end OAI