Zulip Chat Archive

Stream: general

Topic: weird FTA based lemma


Frederick Pu (Oct 01 2025 at 02:02):

I'm trying to prove the following lemma does anyone know a simple way to prove it or if it's already in mathlib?

(a p : Nat)
(hp : p.Prime)
 (orderOf a / p ^ a.factorization p).factorization p = 0

Aaron Liu (Oct 01 2025 at 02:03):

why do you want to prove this

Aaron Liu (Oct 01 2025 at 02:04):

this doesn't seem like something that would normally be wanted to be proved

Aaron Liu (Oct 01 2025 at 02:09):

import Mathlib

example (a p : Nat)
    -- unused variable `hp`, which means my proof didn't use the fact that `p` is prime
    (hp : p.Prime) :
    (orderOf a / p ^ a.factorization p).factorization p = 0 := by
  by_cases ha : a = 1
  · simp [ha]
  · have hn : ¬IsOfFinOrder a := by
      apply mt IsOfFinOrder.isUnit
      simp [ha]
    simp [orderOf_eq_zero hn]

Frederick Pu (Oct 01 2025 at 02:14):

I meant a instead of orderOf a

Aaron Liu (Oct 01 2025 at 02:16):

that makes a bit more sense

Aaron Liu (Oct 01 2025 at 02:18):

import Mathlib

example (a p : Nat) :
    (a / p ^ a.factorization p).factorization p = 0 := by
  by_cases hp : p.Prime
  · have ha : p ^ a.factorization p  a :=
      -- found by `exact?` (can we rename this?)
      Nat.ordProj_dvd a p
    rw [Nat.factorization_div ha]
    simp [hp]
  · simp [hp]

Frederick Pu (Oct 01 2025 at 03:14):

thx!


Last updated: Dec 20 2025 at 21:32 UTC