AFTD Auto-Formalizing Theoretical Domains

setOf_isNatFactorization_finite

theoremverified

Every natural number has only finitely many factorizations into integers greater than 1.

Statement

theorem setOf_isNatFactorization_finite (n : ℕ) :
    {x : Multiset ℕ | IsNatFactorization n x}.Finite
Source
arXiv:2611.18194 (The Möbius function of factorizations with a simple prime factor): sanity lemma for the factorization-poset definitions
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • IsNatFactorizationA factorization of a natural number n is a multiset of integers greater than 1 whose product is n.
  • orderedFactorization_finiteEvery natural number has finitely many ordered factorizations into integers greater than 1.
Used by 3

The proof, explained

The proof reduces the finiteness of multiset factorizations to the finiteness of ordered factorizations (lists). Since the collection of ordered factorizations of n is finite, its image under the list-to-multiset projection is also finite. Every multiset factorization arises as the image of its underlying list, so the multiset factorizations form a subset of this finite image and are therefore finite.

  1. The type of ordered factorizations of n into factors greater than 1 is finite.

    We invoke the known finiteness theorem orderedFactorization_finite for lists.

    line 3

    uses orderedFactorization_finite

      have := orderedFactorization_finite n
  2. It suffices to show that every multiset factorization of n is in the image of the map from ordered factorizations to multisets.

    Because the range of a function from a finite type is finite, any subset of this range is also finite.

    lines 4–5

    uses Set.finite_range

      apply (Set.finite_range
        (fun l : {l : List ℕ // (∀ a ∈ l, 1 < a) ∧ l.prod = n} => (l.1 : Multiset ℕ))).subset
  3. We may fix a multiset factorization x with elements strictly greater than 1 and product n.

    We introduce x and decompose the definition of IsNatFactorization into its two conditions.

    line 6

      rintro x ⟨hx1, hx2⟩
  4. The list x.toList is a candidate ordered factorization whose elements are all greater than 1.

    Every element of x.toList is an element of x by Multiset.mem_toList.mp, so each element is strictly greater than 1.

    line 7

    uses Multiset.mem_toList.mp

      refine ⟨⟨x.toList, fun a ha => hx1 a (Multiset.mem_toList.mp ha), ?_⟩, ?_⟩
  5. The product of the elements in x.toList is n.

    By Multiset.prod_toList, the list product equals the multiset product, which is n.

    line 8

    uses Multiset.prod_toList

      · rw [← Multiset.prod_toList] at hx2; exact hx2
  6. The multiset obtained from x.toList is x itself. automation

    Converting a multiset to a list and coercing back yields the original multiset.

    line 9

      · simp
orderedFactorization_finite
for any natural number n, the subtype of lists of integers greater than 1 whose product is n is finite
Set.finite_range
the image (range) of any function from a finite type is finite
Multiset.mem_toList.mp
an element of the list of elements of a multiset belongs to the multiset
Multiset.prod_toList
the product of the list representation of a multiset equals the product of the multiset

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem setOf_isNatFactorization_finite (n : ℕ) :    {x : Multiset ℕ | IsNatFactorization n x}.Finite := by  have := orderedFactorization_finite n  apply (Set.finite_range    (fun l : {l : List ℕ // (∀ a ∈ l, 1 < a) ∧ l.prod = n} => (l.1 : Multiset ℕ))).subset  rintro x ⟨hx1, hx2⟩  refine ⟨⟨x.toList, fun a ha => hx1 a (Multiset.mem_toList.mp ha), ?_⟩, ?_⟩  · rw [← Multiset.prod_toList] at hx2; exact hx2  · simp
See it in the graphDiscuss this resultChallenge it