<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/~yorgey/forest/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="false" base-url="/~yorgey/forest/">
  <fr:frontmatter>
    <fr:authors />
    <fr:date>
      <fr:year>2026</fr:year>
      <fr:month>4</fr:month>
      <fr:day>13</fr:day>
    </fr:date>
    <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EG/</fr:uri>
    <fr:display-uri>00EG</fr:display-uri>
    <fr:route>/~yorgey/forest/00EG/</fr:route>
    <fr:title text="Fundamental Theorem of Arithmetic">Fundamental Theorem of Arithmetic</fr:title>
    <fr:taxon>Theorem</fr:taxon>
  </fr:frontmatter>
  <fr:mainmatter><html:p>Every positive integer <fr:tex display="inline"><![CDATA[n \geq  1]]></fr:tex> is equal to a product of zero or more primes, known as its <html:em>prime factorization</html:em>. The product is unique up to reordering; say, if the primes are listed in order from smallest to largest.</html:p><html:p>There are two things to prove: first, that it is always <html:em>possible</html:em> to write any positive integer as a product of primes, and second, that the product is always unique.  At this point, we will only prove that the product exists.</html:p>
  
    
    <fr:tree show-metadata="false" toc="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
  We will prove via strong induction that every positive integer <fr:tex display="inline"><![CDATA[n \geq  1]]></fr:tex> is equal to a product of primes.
  
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
    <fr:tex display="inline"><![CDATA[n = 1]]></fr:tex> can be written as an empty product, <html:em>i.e.</html:em> a product of <html:em>zero</html:em> primes.
  </fr:mainmatter></fr:tree>

  
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
    Now let <fr:tex display="inline"><![CDATA[k \geq  1]]></fr:tex> be aribitrary, and suppose that every number <fr:tex display="inline"><![CDATA[\leq  k]]></fr:tex> is equal to a product of primes.  We must show this for <fr:tex display="inline"><![CDATA[k+1]]></fr:tex> as well.  Since <fr:tex display="inline"><![CDATA[k+1 \geq  2]]></fr:tex>, it is either prime or composite.
    
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
      If <fr:tex display="inline"><![CDATA[k+1]]></fr:tex> is prime, then we are done: it is equal to a "product" of just one prime (itself).
    </fr:mainmatter></fr:tree>

    
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
      Otherwise, <fr:tex display="inline"><![CDATA[k+1]]></fr:tex> is composite, which means there must be positive integers <fr:tex display="inline"><![CDATA[1 < a, b < k+1]]></fr:tex> such that <fr:tex display="inline"><![CDATA[k+1 = ab]]></fr:tex>.  Since <fr:tex display="inline"><![CDATA[a \leq  k]]></fr:tex> and <fr:tex display="inline"><![CDATA[b \leq  k]]></fr:tex>, by the induction hypothesis we know that they are both equal to a product of primes.  Hence so is <fr:tex display="inline"><![CDATA[k+1 = ab]]></fr:tex>: the product of two products of primes is itself a product of primes.
    </fr:mainmatter></fr:tree>

  </fr:mainmatter></fr:tree>

</fr:mainmatter></fr:tree>
  
</fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2026</fr:year>
              <fr:month>4</fr:month>
              <fr:day>13</fr:day>
            </fr:date>
            <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EC/</fr:uri>
            <fr:display-uri>00EC</fr:display-uri>
            <fr:route>/~yorgey/forest/00EC/</fr:route>
            <fr:title text="Primes">Primes</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>You're probably familiar with prime numbers and prime factorization from elementary school. Let's study these concepts formally, using the framework that we've built so far.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EN/</fr:uri>
                <fr:display-uri>00EN</fr:display-uri>
                <fr:route>/~yorgey/forest/00EN/</fr:route>
                <fr:title text="Trivial divisors">Trivial divisors</fr:title>
                <fr:taxon>Definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Notice that for any natural number <fr:tex display="inline"><![CDATA[n]]></fr:tex> we always have <fr:tex display="inline"><![CDATA[1 \mid  n]]></fr:tex> (since <fr:tex display="inline"><![CDATA[1 \times  n = n]]></fr:tex>) and <fr:tex display="inline"><![CDATA[n \mid  n]]></fr:tex> (since <fr:tex display="inline"><![CDATA[n \times  1 = n]]></fr:tex>).  <fr:tex display="inline"><![CDATA[1]]></fr:tex> and <fr:tex display="inline"><![CDATA[n]]></fr:tex> are called <html:em>trivial divisors</html:em> of <fr:tex display="inline"><![CDATA[n]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00ED/</fr:uri>
                <fr:display-uri>00ED</fr:display-uri>
                <fr:route>/~yorgey/forest/00ED/</fr:route>
                <fr:title text="Prime">Prime</fr:title>
                <fr:taxon>Definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>An integer <fr:tex display="inline"><![CDATA[p > 1]]></fr:tex> is <html:em>prime</html:em> iff it has no nontrivial divisors.  That is, <fr:tex display="block"><![CDATA[\mathrm {Prime}(p) \equiv  (p > 1) \land  (\forall  {d}: {\mathbb {N}}.\;{(1 < d < p) \to  d \nmid  p}).]]></fr:tex></html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EF/</fr:uri>
                <fr:display-uri>00EF</fr:display-uri>
                <fr:route>/~yorgey/forest/00EF/</fr:route>
                <fr:taxon>Example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p><fr:tex display="inline"><![CDATA[2]]></fr:tex>, <fr:tex display="inline"><![CDATA[3]]></fr:tex>, <fr:tex display="inline"><![CDATA[5]]></fr:tex>, and <fr:tex display="inline"><![CDATA[7]]></fr:tex> are prime, which we can easily check by trying all possibilities:
<html:ul><html:li><fr:tex display="inline"><![CDATA[2]]></fr:tex> is prime because there aren't even any numbers between <fr:tex display="inline"><![CDATA[1]]></fr:tex> and <fr:tex display="inline"><![CDATA[2]]></fr:tex> which could be divisors.</html:li>
  <html:li><fr:tex display="inline"><![CDATA[3]]></fr:tex> is prime because <fr:tex display="inline"><![CDATA[2 \nmid  3]]></fr:tex>.</html:li>
  <html:li><fr:tex display="inline"><![CDATA[4]]></fr:tex> is not prime, because <fr:tex display="inline"><![CDATA[2 \mid  4]]></fr:tex>.</html:li>
  <html:li><fr:tex display="inline"><![CDATA[5]]></fr:tex> is prime, because <fr:tex display="inline"><![CDATA[2 \nmid  5]]></fr:tex>, <fr:tex display="inline"><![CDATA[3 \nmid  5]]></fr:tex>, and <fr:tex display="inline"><![CDATA[4 \nmid  5]]></fr:tex>.</html:li>
  <html:li><fr:tex display="inline"><![CDATA[6]]></fr:tex> is not prime, because <fr:tex display="inline"><![CDATA[2 \mid  6]]></fr:tex> (and <fr:tex display="inline"><![CDATA[3 \mid  6]]></fr:tex>).</html:li>
  <html:li><fr:tex display="inline"><![CDATA[7]]></fr:tex> is prime, because <fr:tex display="inline"><![CDATA[2 \nmid  7]]></fr:tex>, <fr:tex display="inline"><![CDATA[3 \nmid  7]]></fr:tex>, <fr:tex display="inline"><![CDATA[4 \nmid  7]]></fr:tex>, <fr:tex display="inline"><![CDATA[5 \nmid  7]]></fr:tex>, and <fr:tex display="inline"><![CDATA[6 \nmid  7]]></fr:tex>.</html:li></html:ul></html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EH/</fr:uri>
                <fr:display-uri>00EH</fr:display-uri>
                <fr:route>/~yorgey/forest/00EH/</fr:route>
                <fr:title text="Composite">Composite</fr:title>
                <fr:taxon>Definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Integers <fr:tex display="inline"><![CDATA[> 1]]></fr:tex> that are not prime are called <html:em>composite</html:em>.</html:p>
                <html:p>That is, a composite number <fr:tex display="inline"><![CDATA[n]]></fr:tex> is one which has at least one divisor <fr:tex display="inline"><![CDATA[d \mid  n]]></fr:tex> with <fr:tex display="inline"><![CDATA[1 < d < n]]></fr:tex>.  Note that if <fr:tex display="inline"><![CDATA[d \mid  n]]></fr:tex>, then by definition <fr:tex display="inline"><![CDATA[dk = n]]></fr:tex> for some integer <fr:tex display="inline"><![CDATA[k]]></fr:tex>, which means <fr:tex display="inline"><![CDATA[k]]></fr:tex> is also a divisor of <fr:tex display="inline"><![CDATA[n]]></fr:tex>; divisors come in pairs (except for the special case when <fr:tex display="inline"><![CDATA[n = d^2]]></fr:tex>).</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EE/</fr:uri>
                <fr:display-uri>00EE</fr:display-uri>
                <fr:route>/~yorgey/forest/00EE/</fr:route>
                <fr:taxon>Remark</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Notice that according to the definition, <fr:tex display="inline"><![CDATA[0]]></fr:tex> and <fr:tex display="inline"><![CDATA[1]]></fr:tex> are neither prime nor composite! They are special because they are the multiplicative annihilator and identity, respectively.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>We can now state one of the most fundamental results in number theory, which several ancient civilizations discovered independently, and you probably learned in elementary school.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EG/</fr:uri>
                <fr:display-uri>00EG</fr:display-uri>
                <fr:route>/~yorgey/forest/00EG/</fr:route>
                <fr:title text="Fundamental Theorem of Arithmetic">Fundamental Theorem of Arithmetic</fr:title>
                <fr:taxon>Theorem</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>Every positive integer <fr:tex display="inline"><![CDATA[n \geq  1]]></fr:tex> is equal to a product of zero or more primes, known as its <html:em>prime factorization</html:em>. The product is unique up to reordering; say, if the primes are listed in order from smallest to largest.</html:p><html:p>There are two things to prove: first, that it is always <html:em>possible</html:em> to write any positive integer as a product of primes, and second, that the product is always unique.  At this point, we will only prove that the product exists.</html:p>
  
    
    <fr:tree show-metadata="false" toc="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
  We will prove via strong induction that every positive integer <fr:tex display="inline"><![CDATA[n \geq  1]]></fr:tex> is equal to a product of primes.
  
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
    <fr:tex display="inline"><![CDATA[n = 1]]></fr:tex> can be written as an empty product, <html:em>i.e.</html:em> a product of <html:em>zero</html:em> primes.
  </fr:mainmatter></fr:tree>

  
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
    Now let <fr:tex display="inline"><![CDATA[k \geq  1]]></fr:tex> be aribitrary, and suppose that every number <fr:tex display="inline"><![CDATA[\leq  k]]></fr:tex> is equal to a product of primes.  We must show this for <fr:tex display="inline"><![CDATA[k+1]]></fr:tex> as well.  Since <fr:tex display="inline"><![CDATA[k+1 \geq  2]]></fr:tex>, it is either prime or composite.
    
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
      If <fr:tex display="inline"><![CDATA[k+1]]></fr:tex> is prime, then we are done: it is equal to a "product" of just one prime (itself).
    </fr:mainmatter></fr:tree>

    
  <fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Subproof</fr:taxon></fr:frontmatter><fr:mainmatter>
      Otherwise, <fr:tex display="inline"><![CDATA[k+1]]></fr:tex> is composite, which means there must be positive integers <fr:tex display="inline"><![CDATA[1 < a, b < k+1]]></fr:tex> such that <fr:tex display="inline"><![CDATA[k+1 = ab]]></fr:tex>.  Since <fr:tex display="inline"><![CDATA[a \leq  k]]></fr:tex> and <fr:tex display="inline"><![CDATA[b \leq  k]]></fr:tex>, by the induction hypothesis we know that they are both equal to a product of primes.  Hence so is <fr:tex display="inline"><![CDATA[k+1 = ab]]></fr:tex>: the product of two products of primes is itself a product of primes.
    </fr:mainmatter></fr:tree>

  </fr:mainmatter></fr:tree>

</fr:mainmatter></fr:tree>
  
</fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EI/</fr:uri>
                <fr:display-uri>00EI</fr:display-uri>
                <fr:route>/~yorgey/forest/00EI/</fr:route>
                <fr:title text="Composites have a divisor \leq  \sqrt {n}">Composites have a divisor <fr:tex display="inline"><![CDATA[\leq  \sqrt {n}]]></fr:tex></fr:title>
                <fr:taxon>Theorem</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>If <fr:tex display="inline"><![CDATA[n]]></fr:tex> is <fr:link href="/~yorgey/forest/00EH/" title="Composite" uri="http://ozark.hendrix.edu/~yorgey/forest/00EH/" display-uri="00EH" type="local">composite</fr:link>, it has a <fr:link href="/~yorgey/forest/00ED/" title="Prime" uri="http://ozark.hendrix.edu/~yorgey/forest/00ED/" display-uri="00ED" type="local">prime</fr:link> <fr:link href="/~yorgey/forest/00D5/" title="Divisibility" uri="http://ozark.hendrix.edu/~yorgey/forest/00D5/" display-uri="00D5" type="local">divisor</fr:link> <fr:tex display="inline"><![CDATA[d \leq  \sqrt  n]]></fr:tex>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EJ/</fr:uri><fr:display-uri>00EJ</fr:display-uri><fr:route>/~yorgey/forest/00EJ/</fr:route><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>It’s worth spelling out how to write this in formal predicate logic: <fr:tex display="block"><![CDATA[\forall  n \in  \Z ^+ .\; \mathrm {Composite}(n) \rightarrow  \exists  p
    \in  \Z ^+ .\; \mathrm {Prime}(p) \land  (p \mid  n) \land  p \leq  \sqrt 
    n.]]></fr:tex> The phrase “it has a prime divisor <fr:tex display="inline"><![CDATA[\leq  \sqrt  n]]></fr:tex>” actually expands into an <fr:tex display="inline"><![CDATA[\exists ]]></fr:tex> with a conjunction of three propositions! Each of “prime”, “divisor”, and “<fr:tex display="inline"><![CDATA[\leq  \sqrt 
  n]]></fr:tex>” corresponds to a separate property of the number that is claimed to exist.</html:p></fr:mainmatter></fr:tree>
  
    
    <fr:tree show-metadata="false" toc="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
  Suppose <fr:tex display="inline"><![CDATA[n]]></fr:tex> is composite. That means there exist <fr:tex display="inline"><![CDATA[1 < a, b < n]]></fr:tex> such that <fr:tex display="inline"><![CDATA[n = ab]]></fr:tex>. If both <fr:tex display="inline"><![CDATA[a > \sqrt  n]]></fr:tex> and <fr:tex display="inline"><![CDATA[b > \sqrt  n]]></fr:tex>, then their product would be <fr:tex display="inline"><![CDATA[ab > n]]></fr:tex>, which is a contradiction—hence either <fr:tex display="inline"><![CDATA[a \leq  \sqrt  n]]></fr:tex> or <fr:tex display="inline"><![CDATA[b \leq  \sqrt  n]]></fr:tex>. Suppose <fr:tex display="inline"><![CDATA[a \leq  \sqrt  n]]></fr:tex> (the proof is essentially the same if <fr:tex display="inline"><![CDATA[b \leq  \sqrt  n]]></fr:tex>). We are <html:em>almost</html:em> done but not quite—<fr:tex display="inline"><![CDATA[a]]></fr:tex> is a divisor of <fr:tex display="inline"><![CDATA[n]]></fr:tex>, and <fr:tex display="inline"><![CDATA[a \leq  \sqrt  n]]></fr:tex>, <html:em>but</html:em> we don’t necessarily know that it is prime! However, by the <fr:link href="/~yorgey/forest/00EG/" title="Fundamental Theorem of Arithmetic" uri="http://ozark.hendrix.edu/~yorgey/forest/00EG/" display-uri="00EG" type="local">Fundamental Theorem of Arithmetic</fr:link>, there is some prime <fr:tex display="inline"><![CDATA[p]]></fr:tex> which divides <fr:tex display="inline"><![CDATA[a]]></fr:tex>, and by transitivity of divisibility, <fr:tex display="inline"><![CDATA[p \mid  n]]></fr:tex>, and also <fr:tex display="inline"><![CDATA[p \leq  a \leq  \sqrt  n]]></fr:tex>.
</fr:mainmatter></fr:tree>
  
</fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EK/</fr:uri>
                <fr:display-uri>00EK</fr:display-uri>
                <fr:route>/~yorgey/forest/00EK/</fr:route>
                <fr:title text="Sieve of Eratosthenes">Sieve of Eratosthenes</fr:title>
                <fr:taxon>Example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>The <html:em>sieve of Eratosthenes</html:em> is an ancient Greek
method for finding all the primes up to some limit; consider as an
example finding all the primes up to 100. We start by circling <fr:tex display="inline"><![CDATA[2]]></fr:tex> as
the first prime, then crossing out all multiples of <fr:tex display="inline"><![CDATA[2]]></fr:tex>. Since the
<fr:tex display="inline"><![CDATA[3]]></fr:tex> is not crossed out, it must be prime too. We circle it and cross
out all multiples of <fr:tex display="inline"><![CDATA[3]]></fr:tex>. The <fr:tex display="inline"><![CDATA[4]]></fr:tex> is already crossed out now, but
<fr:tex display="inline"><![CDATA[5]]></fr:tex> is not, which means it must be prime—if it were composite it
would have some smaller prime divisor, but we have already crossed out
all multiples of smaller primes. So we circle <fr:tex display="inline"><![CDATA[5]]></fr:tex> and cross out all
its multiples; finally we circle <fr:tex display="inline"><![CDATA[7]]></fr:tex> and cross out all its
multiples. But now we can stop! We have found all the primes up to
<fr:tex display="inline"><![CDATA[\sqrt {100} = 10]]></fr:tex>. The rest of the numbers up to <fr:tex display="inline"><![CDATA[10]]></fr:tex> are already
crossed out; by the previous theorem, composite numbers up to <fr:tex display="inline"><![CDATA[100]]></fr:tex>
must have a prime divisor less than or equal to <fr:tex display="inline"><![CDATA[10]]></fr:tex>, but we have
already crossed out all multiples of primes less than <fr:tex display="inline"><![CDATA[10]]></fr:tex>. So all
the remaining numbers must be prime and we can simply circle them.


  
  <html:img src="/~yorgey/forest/bafkrmibmxi62axb3wlfumuflo73zewkcfmaolakc5rkbqnwgloyq7gsrvu.png" /></html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>Here is another classic piece of mathematics from ancient Greece:</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EL/</fr:uri>
                <fr:display-uri>00EL</fr:display-uri>
                <fr:route>/~yorgey/forest/00EL/</fr:route>
                <fr:title text="Infinitude of primes">Infinitude of primes</fr:title>
                <fr:taxon>Theorem</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>There are infinitely many primes.</html:p>
  
    
    <fr:tree show-metadata="false" toc="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
Pick any prime <fr:tex display="inline"><![CDATA[p]]></fr:tex>, and let <fr:tex display="inline"><![CDATA[Q]]></fr:tex> be one more than the product of all the primes up to <fr:tex display="inline"><![CDATA[p]]></fr:tex>, that is, <fr:tex display="block"><![CDATA[Q = (2 \cdot  3 \cdot  5 \cdots  p) + 1.]]></fr:tex> By the <fr:link href="/~yorgey/forest/00EG/" title="Fundamental Theorem of Arithmetic" uri="http://ozark.hendrix.edu/~yorgey/forest/00EG/" display-uri="00EG" type="local">Fundamental Theorem of Arithmetic</fr:link>, <fr:tex display="inline"><![CDATA[Q]]></fr:tex> must be divisible by at least one prime, call it <fr:tex display="inline"><![CDATA[q]]></fr:tex>.  However, notice that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> cannot be divisible by any of the primes up to <fr:tex display="inline"><![CDATA[p]]></fr:tex>, since <fr:tex display="inline"><![CDATA[Q \equiv _2 1]]></fr:tex>, <fr:tex display="inline"><![CDATA[Q \equiv _3 1]]></fr:tex>, <fr:tex display="inline"><![CDATA[Q \equiv _5 1]]></fr:tex>, and so on for for each prime up to <fr:tex display="inline"><![CDATA[p]]></fr:tex>.  Therefore, <fr:tex display="inline"><![CDATA[q]]></fr:tex> must be a prime larger than <fr:tex display="inline"><![CDATA[p]]></fr:tex>.  But <fr:tex display="inline"><![CDATA[p]]></fr:tex> was arbitrary: since for any prime <fr:tex display="inline"><![CDATA[p]]></fr:tex> we can always find a larger one, there must be infinitely many primes.  (<html:em>Question to ponder: is the <fr:tex display="inline"><![CDATA[Q]]></fr:tex> in this proof always a prime itself?</html:em>)
</fr:mainmatter></fr:tree>
  
</fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EM/</fr:uri>
                <fr:display-uri>00EM</fr:display-uri>
                <fr:route>/~yorgey/forest/00EM/</fr:route>
                <fr:title text="The largest known prime">The largest known prime</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>So <fr:link href="/~yorgey/forest/00EL/" title="Infinitude of primes" uri="http://ozark.hendrix.edu/~yorgey/forest/00EL/" display-uri="00EL" type="local">there is no largest prime</fr:link>; but the currently (as of April 13, 2026) largest <html:em>known</html:em> prime—that is, the largest number we can specifically point to and say for certain it is prime—is <fr:tex display="block"><![CDATA[2^{136,279,841} - 1.]]></fr:tex> This number has <fr:tex display="inline"><![CDATA[41,024,320]]></fr:tex> decimal digits (pop quiz: how many <fr:link href="/~yorgey/forest/00CX/" title="Binary expansions" uri="http://ozark.hendrix.edu/~yorgey/forest/00CX/" display-uri="00CX" type="local">binary digits</fr:link> does it have?), and was found by the <fr:link href="https://www.mersenne.org/primes/?press=M136279841" type="external">Great Internet Mersenne Prime Search</fr:link>. If it were printed in a book, with, say, <fr:tex display="inline"><![CDATA[100]]></fr:tex> digits per line and <fr:tex display="inline"><![CDATA[50]]></fr:tex> lines of digits per page, it would require around <fr:tex display="inline"><![CDATA[8204]]></fr:tex> pages—probably a 20-volume set of books taking up a whole shelf!</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2026</fr:year>
              <fr:month>4</fr:month>
              <fr:day>13</fr:day>
            </fr:date>
            <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EL/</fr:uri>
            <fr:display-uri>00EL</fr:display-uri>
            <fr:route>/~yorgey/forest/00EL/</fr:route>
            <fr:title text="Infinitude of primes">Infinitude of primes</fr:title>
            <fr:taxon>Theorem</fr:taxon>
          </fr:frontmatter>
          <fr:mainmatter><html:p>There are infinitely many primes.</html:p>
  
    
    <fr:tree show-metadata="false" toc="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
Pick any prime <fr:tex display="inline"><![CDATA[p]]></fr:tex>, and let <fr:tex display="inline"><![CDATA[Q]]></fr:tex> be one more than the product of all the primes up to <fr:tex display="inline"><![CDATA[p]]></fr:tex>, that is, <fr:tex display="block"><![CDATA[Q = (2 \cdot  3 \cdot  5 \cdots  p) + 1.]]></fr:tex> By the <fr:link href="/~yorgey/forest/00EG/" title="Fundamental Theorem of Arithmetic" uri="http://ozark.hendrix.edu/~yorgey/forest/00EG/" display-uri="00EG" type="local">Fundamental Theorem of Arithmetic</fr:link>, <fr:tex display="inline"><![CDATA[Q]]></fr:tex> must be divisible by at least one prime, call it <fr:tex display="inline"><![CDATA[q]]></fr:tex>.  However, notice that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> cannot be divisible by any of the primes up to <fr:tex display="inline"><![CDATA[p]]></fr:tex>, since <fr:tex display="inline"><![CDATA[Q \equiv _2 1]]></fr:tex>, <fr:tex display="inline"><![CDATA[Q \equiv _3 1]]></fr:tex>, <fr:tex display="inline"><![CDATA[Q \equiv _5 1]]></fr:tex>, and so on for for each prime up to <fr:tex display="inline"><![CDATA[p]]></fr:tex>.  Therefore, <fr:tex display="inline"><![CDATA[q]]></fr:tex> must be a prime larger than <fr:tex display="inline"><![CDATA[p]]></fr:tex>.  But <fr:tex display="inline"><![CDATA[p]]></fr:tex> was arbitrary: since for any prime <fr:tex display="inline"><![CDATA[p]]></fr:tex> we can always find a larger one, there must be infinitely many primes.  (<html:em>Question to ponder: is the <fr:tex display="inline"><![CDATA[Q]]></fr:tex> in this proof always a prime itself?</html:em>)
</fr:mainmatter></fr:tree>
  
</fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2026</fr:year>
              <fr:month>4</fr:month>
              <fr:day>13</fr:day>
            </fr:date>
            <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EI/</fr:uri>
            <fr:display-uri>00EI</fr:display-uri>
            <fr:route>/~yorgey/forest/00EI/</fr:route>
            <fr:title text="Composites have a divisor \leq  \sqrt {n}">Composites have a divisor <fr:tex display="inline"><![CDATA[\leq  \sqrt {n}]]></fr:tex></fr:title>
            <fr:taxon>Theorem</fr:taxon>
          </fr:frontmatter>
          <fr:mainmatter><html:p>If <fr:tex display="inline"><![CDATA[n]]></fr:tex> is <fr:link href="/~yorgey/forest/00EH/" title="Composite" uri="http://ozark.hendrix.edu/~yorgey/forest/00EH/" display-uri="00EH" type="local">composite</fr:link>, it has a <fr:link href="/~yorgey/forest/00ED/" title="Prime" uri="http://ozark.hendrix.edu/~yorgey/forest/00ED/" display-uri="00ED" type="local">prime</fr:link> <fr:link href="/~yorgey/forest/00D5/" title="Divisibility" uri="http://ozark.hendrix.edu/~yorgey/forest/00D5/" display-uri="00D5" type="local">divisor</fr:link> <fr:tex display="inline"><![CDATA[d \leq  \sqrt  n]]></fr:tex>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00EJ/</fr:uri><fr:display-uri>00EJ</fr:display-uri><fr:route>/~yorgey/forest/00EJ/</fr:route><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>It’s worth spelling out how to write this in formal predicate logic: <fr:tex display="block"><![CDATA[\forall  n \in  \Z ^+ .\; \mathrm {Composite}(n) \rightarrow  \exists  p
    \in  \Z ^+ .\; \mathrm {Prime}(p) \land  (p \mid  n) \land  p \leq  \sqrt 
    n.]]></fr:tex> The phrase “it has a prime divisor <fr:tex display="inline"><![CDATA[\leq  \sqrt  n]]></fr:tex>” actually expands into an <fr:tex display="inline"><![CDATA[\exists ]]></fr:tex> with a conjunction of three propositions! Each of “prime”, “divisor”, and “<fr:tex display="inline"><![CDATA[\leq  \sqrt 
  n]]></fr:tex>” corresponds to a separate property of the number that is claimed to exist.</html:p></fr:mainmatter></fr:tree>
  
    
    <fr:tree show-metadata="false" toc="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2026</fr:year><fr:month>4</fr:month><fr:day>13</fr:day></fr:date><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
  Suppose <fr:tex display="inline"><![CDATA[n]]></fr:tex> is composite. That means there exist <fr:tex display="inline"><![CDATA[1 < a, b < n]]></fr:tex> such that <fr:tex display="inline"><![CDATA[n = ab]]></fr:tex>. If both <fr:tex display="inline"><![CDATA[a > \sqrt  n]]></fr:tex> and <fr:tex display="inline"><![CDATA[b > \sqrt  n]]></fr:tex>, then their product would be <fr:tex display="inline"><![CDATA[ab > n]]></fr:tex>, which is a contradiction—hence either <fr:tex display="inline"><![CDATA[a \leq  \sqrt  n]]></fr:tex> or <fr:tex display="inline"><![CDATA[b \leq  \sqrt  n]]></fr:tex>. Suppose <fr:tex display="inline"><![CDATA[a \leq  \sqrt  n]]></fr:tex> (the proof is essentially the same if <fr:tex display="inline"><![CDATA[b \leq  \sqrt  n]]></fr:tex>). We are <html:em>almost</html:em> done but not quite—<fr:tex display="inline"><![CDATA[a]]></fr:tex> is a divisor of <fr:tex display="inline"><![CDATA[n]]></fr:tex>, and <fr:tex display="inline"><![CDATA[a \leq  \sqrt  n]]></fr:tex>, <html:em>but</html:em> we don’t necessarily know that it is prime! However, by the <fr:link href="/~yorgey/forest/00EG/" title="Fundamental Theorem of Arithmetic" uri="http://ozark.hendrix.edu/~yorgey/forest/00EG/" display-uri="00EG" type="local">Fundamental Theorem of Arithmetic</fr:link>, there is some prime <fr:tex display="inline"><![CDATA[p]]></fr:tex> which divides <fr:tex display="inline"><![CDATA[a]]></fr:tex>, and by transitivity of divisibility, <fr:tex display="inline"><![CDATA[p \mid  n]]></fr:tex>, and also <fr:tex display="inline"><![CDATA[p \leq  a \leq  \sqrt  n]]></fr:tex>.
</fr:mainmatter></fr:tree>
  
</fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>http://ozark.hendrix.edu/~yorgey/forest/00FY/</fr:uri>
            <fr:display-uri>00FY</fr:display-uri>
            <fr:route>/~yorgey/forest/00FY/</fr:route>
            <fr:title text="Agda proof of the Fundamental Theorem of Arithmetic">Agda proof of the Fundamental Theorem of Arithmetic</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>On Monday, I was idly brainstorming potential final projects for my <fr:link href="https://hendrix-cs.github.io/csci365/" type="external">Functional Programming</fr:link> students.  Having just <fr:link href="/~yorgey/forest/00EG/" title="Fundamental Theorem of Arithmetic" uri="http://ozark.hendrix.edu/~yorgey/forest/00EG/" display-uri="00EG" type="local">taught my Discrete Math students the Fundamental Theorem of Arithmetic</fr:link>, I wondered whether formalizing it in Agda could make a nice project.  (I mean formalizing it <html:em>from scratch</html:em>: of course, the FTA must already in the Agda standard library.)  Then I... kind of fell down the rabbit hole.  Several hours and 560 lines of Agda later, I'm very close: all I have left is to <fr:link href="/~yorgey/forest/00DL/" title="Proof of Division Algorithm" uri="http://ozark.hendrix.edu/~yorgey/forest/00DL/" display-uri="00DL" type="local">prove that the result of the division algorithm is unique</fr:link> (which is actually kinda tricky).  Well... actually, I've only formalized half of the FTA so far, namely, the part that says any number can be factored into a product of primes.  I haven't yet attempted to formalize the claim that the resulting factorization is unique up to permutation.  We'll see if I decide to add that.</html:p>
            <html:p>In any case, this has been a fun and pleasant exercise, requiring a bunch of facts about addition, multiplication, and inequality; well-founded induction; encoding loops from a start value up to an end value; and various other things.  I've been doing everything completely from scratch/memory, without peeking at any Agda stdlib code. Once I finish it I might clean it up and turn it into a blog post.</html:p>
            <html:p>Formalizing the proof has led me to rethink a few of the wys I present things in Discrete Math.  For example, I had been defining a number <fr:tex display="inline"><![CDATA[p]]></fr:tex> to be prime if "all divisors of <fr:tex display="inline"><![CDATA[p]]></fr:tex> are trivial", that is, formally, <fr:tex display="block"><![CDATA[\mathrm {Prime}(p) \equiv  \forall  {d}: {\mathbb {N}}.\;{(d \mid  p) \to  (d = 1 \lor  d = p)}.]]></fr:tex>  But now I actually think it is better to define it as "<fr:tex display="inline"><![CDATA[p]]></fr:tex> has no nontrivial divisors", that is, <fr:tex display="block"><![CDATA[\mathrm {Prime}(p) \equiv  \forall  {d}: {(1 < d < n) \to  (d \nmid  p)}.\;.]]></fr:tex>  Since primality is decidable, these are constructively equivalent, but... I like the second definition better now, for reasons I can't quite put my finger on.
  </html:p>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
