Skip to content

Commit

Permalink
feat(data/nat/factorization/basic): add lemma `prime.factorization_se…
Browse files Browse the repository at this point in the history
…lf` (#15767)

Adds `lemma prime.factorization_self (hp : prime p) : p.factorization p = 1`.

We already have `prime.factorization (hp : prime p) : p.factorization = single p 1`, but this sometimes needs a little more help to simp down to `1`.
  • Loading branch information
stuart-presnell committed Jul 31, 2022
1 parent 7b2ae37 commit a2a02a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data/nat/factorization/basic.lean
Expand Up @@ -187,6 +187,10 @@ begin
refl,
end

/-- The only prime factor of prime `p` is `p` itself, with multiplicity `1` -/
@[simp] lemma prime.factorization_self {p : ℕ} (hp : prime p) : p.factorization p = 1 :=
by simp [hp]

/-- For prime `p` the only prime factor of `p^k` is `p` with multiplicity `k` -/
lemma prime.factorization_pow {p k : ℕ} (hp : prime p) :
factorization (p ^ k) = single p k :=
Expand Down

0 comments on commit a2a02a3

Please sign in to comment.