Squarefree elements of monoids #
An element of a monoid is squarefree when it is not divisible by any squares except the squares of units.
Main Definitions #
squarefree r
indicates thatr
is only divisible byx * x
ifx
is a unit.
Main Results #
multiplicity.squarefree_iff_multiplicity_le_one
:x
issquarefree
iff for everyy
, eithermultiplicity y x ≤ 1
oris_unit y
.unique_factorization_monoid.squarefree_iff_nodup_factors
: A nonzero elementx
of a unique factorization monoid is squarefree ifffactors x
has no duplicate factors.nat.squarefree_iff_nodup_factors
: A positive natural numberx
is squarefree iff the listfactors x
has no duplicate factors.
Tags #
squarefree, multiplicity
An element of a monoid is squarefree if the only squares that divide it are the squares of units.
Equations
- squarefree r = ∀ (x : R), x * x ∣ r → is_unit x
@[simp]
@[simp]
@[simp]
@[simp]
theorem
squarefree_of_dvd_of_squarefree
{R : Type u_1}
[comm_monoid R]
{x y : R}
(hdvd : x ∣ y)
(hsq : squarefree y) :
theorem
multiplicity.squarefree_iff_multiplicity_le_one
{R : Type u_1}
[comm_monoid R]
[decidable_rel has_dvd.dvd]
(r : R) :
squarefree r ↔ ∀ (x : R), multiplicity x r ≤ 1 ∨ is_unit x
theorem
irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree
{R : Type u_1}
[comm_monoid_with_zero R]
[wf_dvd_monoid R]
(r : R) :
(∀ (x : R), irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ (x : R), ¬irreducible x) ∨ squarefree r
theorem
squarefree_iff_irreducible_sq_not_dvd_of_ne_zero
{R : Type u_1}
[comm_monoid_with_zero R]
[wf_dvd_monoid R]
{r : R}
(hr : r ≠ 0) :
squarefree r ↔ ∀ (x : R), irreducible x → ¬x * x ∣ r
theorem
squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible
{R : Type u_1}
[comm_monoid_with_zero R]
[wf_dvd_monoid R]
{r : R}
(hr : ∃ (x : R), irreducible x) :
squarefree r ↔ ∀ (x : R), irreducible x → ¬x * x ∣ r
theorem
unique_factorization_monoid.squarefree_iff_nodup_normalized_factors
{R : Type u_1}
[cancel_comm_monoid_with_zero R]
[nontrivial R]
[unique_factorization_monoid R]
[normalization_monoid R]
[decidable_eq R]
{x : R}
(x0 : x ≠ 0) :
theorem
unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree
{R : Type u_1}
[cancel_comm_monoid_with_zero R]
[nontrivial R]
[unique_factorization_monoid R]
[normalization_monoid R]
{x y : R}
{n : ℕ}
(hsq : squarefree x)
(h0 : n ≠ 0) :
Assuming that n
has no factors less than k
, returns the smallest prime p
such that
p^2 ∣ n
.
Returns the smallest prime factor p
of n
such that p^2 ∣ n
, or none
if there is no
such p
(that is, n
is squarefree). See also squarefree_iff_min_sq_fac
.
Equations
- n.min_sq_fac = ite (2 ∣ n) (let n' : ℕ := n / 2 in ite (2 ∣ n') (some 2) (n'.min_sq_fac_aux 3)) (n.min_sq_fac_aux 3)
The correctness property of the return value of min_sq_fac
.
- If
none
, thenn
is squarefree; - If
some d
, thend
is a minimal square factor ofn
theorem
nat.min_sq_fac_prop_div
(n : ℕ)
{k : ℕ}
(pk : nat.prime k)
(dk : k ∣ n)
(dkk : ¬k * k ∣ n)
{o : option ℕ}
(H : (n / k).min_sq_fac_prop o) :
n.min_sq_fac_prop o
@[protected, instance]
Equations
theorem
nat.divisors_filter_squarefree
{n : ℕ}
(h0 : n ≠ 0) :
(finset.filter squarefree n.divisors).val = multiset.map (λ (x : finset ℕ), x.val.prod) (unique_factorization_monoid.normalized_factors n).to_finset.powerset.val
theorem
nat.sum_divisors_filter_squarefree
{n : ℕ}
(h0 : n ≠ 0)
{α : Type u_1}
[add_comm_monoid α]
{f : ℕ → α} :
∑ (i : ℕ) in finset.filter squarefree n.divisors, f i = ∑ (i : finset ℕ) in (unique_factorization_monoid.normalized_factors n).to_finset.powerset, f i.val.prod
Square-free prover #
A predicate representing partial progress in a proof of squarefree
.
theorem
tactic.norm_num.squarefree_bit10
(n : ℕ)
(h : tactic.norm_num.squarefree_helper n 1) :
squarefree (bit0 (bit1 n))
theorem
tactic.norm_num.squarefree_bit1
(n : ℕ)
(h : tactic.norm_num.squarefree_helper n 1) :
squarefree (bit1 n)
theorem
tactic.norm_num.squarefree_helper_2
(n k k' c : ℕ)
(e : k + 1 = k')
(hc : bit1 n % bit1 k = c)
(c0 : 0 < c)
(h : tactic.norm_num.squarefree_helper n k') :