/-
Copyright 2026 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.
-/modulepublicimportMathlib.Data.Nat.Squarefree@[expose]publicsection
Primitive elements of a set with respect to divisibility
An element n is primitive in a set S ⊆ ℕ if n ∈ S and no proper divisor of n is in S.
This concept appears naturally when studying sequences closed under "divisor inheritance" -
if every member n of a sequence has the property that m * n is also in the sequence
for coprime m, then the primitive elements generate the entire sequence.
Main definitions
Set.IsPrimitive: A natural number n is primitive in S if n ∈ S and
n.properDivisors is disjoint from S.
Set.primitives: The set of primitive elements of S.
Main results
Set.IsPrimitive.mem: A primitive element is in the set.
Set.IsPrimitive.not_mem_of_properDivisor: Proper divisors of a primitive element are not
in the set.
Set.one_isPrimitive_iff: 1 is primitive in S iff 1 ∈ S.
Set.prime_isPrimitive_iff: A prime p is primitive in S iff p ∈ S and 1 ∉ S.
namespaceSet
An element n is primitive in a set S ⊆ ℕ if n ∈ S and no proper divisor of n
is in S.