<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="m10728"> 

<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">First-Order Logic: using quantifiers</name>
<metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2.31</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2002/07/09</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2009/01/07 12:16:37.687 US/Central</md:revised>
  <md:authorlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="ian">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Ian</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Barland</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">ibarland@radford.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="greiner">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">John</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Greiner</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">greiner@cs.rice.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="phokion">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Phokion</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Kolaitis</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">kolaitis@cse.ucsc.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="moshe">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Moshe</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Vardi</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">vardi@cs.rice.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="matthias">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Matthias</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Felleisen</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">matthias@ccs.neu.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="ian">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Ian</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Barland</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">ibarland@radford.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="greiner">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">John</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Greiner</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">greiner@cs.rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">exists</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">first-order</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">for all</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">quantifier</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Introducting quantifiers, to upgrade from propositional logic
to first-order logic.
</md:abstract>
</metadata>


<content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="section1"> 
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Talking about unnamed items</name>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para1">
  Suppose we want to express a statement like
  “there is a location which has two neighbors”
  (which is true, at least for the domain of WaterWorld board
   locations), or
  “all actors have co-starred with
    <link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" src="http://us.imdb.com/Name?Bacon,+Kevin">Kevin Bacon</link>”
  (which isn't true, at least for the domain of all Hollywood actors).
  As it stands, we can only formulate these in an awkward way —
  by talking about 
  <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">specific</emphasis> (constant) locations like <m:math><m:ci>A</m:ci></m:math> and <m:math><m:ci>G</m:ci></m:math>,
  or specific actors like
  <link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" src="http://us.imdb.com/Name?McGregor,+Ewan">Ewan McGregor</link> and
  <link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" src="http://us.imdb.com/Name?Diaz,+Cameron">Cameron Diaz</link>.
  To talk about all locations, or actors, we're forced to
  make huge formulas such as
  <m:math><m:apply><m:and/>
    <m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>Z</m:ci><m:mo>,</m:mo><m:ci>Y</m:ci><m:mo>)</m:mo></m:mrow>
    <m:apply><m:not/><m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>Z</m:ci><m:mo>,</m:mo><m:ci>A</m:ci><m:mo>)</m:mo></m:mrow></m:apply>
    <m:apply><m:not/><m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>Z</m:ci><m:mo>,</m:mo><m:ci>B</m:ci><m:mo>)</m:mo></m:mrow></m:apply>
    <m:ci>…</m:ci>
    <m:apply><m:not/><m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>Z</m:ci><m:mo>,</m:mo><m:ci>X</m:ci><m:mo>)</m:mo></m:mrow></m:apply>
  </m:apply></m:math>,
  just to express
  “there is a location which has only one neighbor”.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para2">
  We'll redress this by introducing two <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">quantifiers</term>,
  “<m:math><m:mo>∃</m:mo></m:math>” (“there exists”) and
  “<m:math><m:mo>∀</m:mo></m:math>” (“for all”).
  For example, “all actors have co-starred with Kevin Bacon”
  will be written 
  <m:math><m:mo>∀</m:mo><m:ci>a</m:ci><m:mtext>.</m:mtext>
    <m:mrow><m:ci type="function">coStarredWith</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>a</m:ci><m:mo>,</m:mo><m:ci>Kevin Bacon</m:ci><m:mo>)</m:mo></m:mrow></m:math>
  .
  For “there is a location which has (at least) two neighbors”,
  we'll start with “there exists a location <m:math><m:ci>x</m:ci></m:math> …”,
  written “<m:math><m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext></m:math>…”.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para3">
  “For all” is really just an abbreviation for a
  large conjunction, while “exists” is a disjunction
  (it could also be called “for some”,
   though it's not).
  How large a conjunction/disjunction? 
  As big as your domain  — which actually could be very
  small, or it could be infinitely large.
  Even aside from the fact that we can't write down an infinitely large
  conjunction or disjunction, 
  quantifiers let us form the conjunction without having to
  select a domain in advance.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para4">
  To continue with our WaterWorld example,
  how can we express the concept "<m:math><m:ci>x</m:ci></m:math> has (at least) two neighbors"?
  Well, we'll rephrase this as,
  “there exist distinct locations, <m:math><m:ci>y</m:ci></m:math> and <m:math><m:ci>z</m:ci></m:math>, which each of which
    is a neighbor of <m:math><m:ci>x</m:ci></m:math>”,
  written
  <m:math><m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
    <m:mo>∃</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
      <m:mo>∃</m:mo><m:ci>z</m:ci><m:mtext>.</m:mtext>
        <m:apply><m:and/>
          <m:apply><m:neq/><m:ci>y</m:ci> <m:ci>z</m:ci></m:apply>
          <m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
          <m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>z</m:ci><m:mo>)</m:mo></m:mrow>
        </m:apply></m:math>
      
    
  .
  We need the condition
  <m:math><m:apply><m:not/><m:apply><m:eq/> <m:ci>y</m:ci> <m:ci>z</m:ci></m:apply></m:apply></m:math>
  in that formula to ensure that we have distinct locations.
  Compare to the algebraic equation
  <m:math>
    <m:apply><m:eq/>
     <m:apply>
       <m:plus/>
       <m:ci>x</m:ci>
       <m:ci>y</m:ci>
      </m:apply>
      <m:cn>4</m:cn>
    </m:apply>
  </m:math>
  in which one possible solution is
  <m:math>
    <m:apply><m:eq/>
      <m:ci>x</m:ci>
      <m:ci>y</m:ci>
      <m:cn>2</m:cn>
    </m:apply>
  </m:math>.
  Variables act the same way in both logic and algebra:
  different variables can happen to take on the same value.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para5">
  We use quantifiers all the time in natural language.
  Consider the following examples, where we provide a natural
  English wording together with an equivalent phrasing that
  makes the quantification more explicit.
  We'll take the translations with a grain of salt, since
  sometimes people can disagree on the exact details of
  the intended English meaning.
  Such ambiguity can sometimes be a rich source of creativity,
  but it's not tolerable when documenting safety properties of software.
  While some of these examples are a bit frivolous,
  in general quantifiers let us precisely capture 
  more interesting concepts in type-checking,
  data structures such as trees and hash tables, 
  circuit specifications, <foreign xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">etc.</foreign>
</para>



<table xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="table1">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Quantification in English</name>
<tgroup xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" cols="2">
<thead xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"><row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> Natural English </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> Formalized English </entry>
      
    </row></thead>
<tbody xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"><row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “If you don't love yourself, you can't love anybody else.”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
        “If you don't love you, there does not exists a person <m:math><m:ci>y</m:ci></m:math>,
               such that you love <m:math><m:ci>y</m:ci></m:math>.”
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “N*Sync is the best band ever!”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
        “For all bands <m:math><m:ci>x</m:ci></m:math>, N*Sync is better than band <m:math><m:ci>x</m:ci></m:math>
          (or, <m:math><m:apply><m:eq/><m:ci>x</m:ci> <m:ci>N*Sync</m:ci></m:apply></m:math>).”
        A quick listen can easily show this statement false.
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> A casually subtle line from <cite xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Something About Mary</cite>:
              “Every day is better than the next.”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “For all days <m:math><m:ci>x</m:ci></m:math>, <m:math><m:ci>x</m:ci></m:math> is better than next(<m:math><m:ci>x</m:ci></m:math>).”
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> A buggy line from a song (<cite xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Everybody Loves My Baby</cite>,
              Jack Palmer &amp; Spencer Willson, 1924):
              “Everybody loves my baby; My baby don't love [anybody] but me.”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “For all persons <m:math><m:ci>x</m:ci></m:math>, <m:math><m:ci>x</m:ci></m:math> loves my baby.
               For all persons <m:math><m:ci>y</m:ci></m:math>, if my baby loves <m:math><m:ci>y</m:ci></m:math>, then <m:math><m:ci>y</m:ci></m:math> is me.”
              If true, one can conclude
               the speaker is his own baby, and is narcissistic.
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “Every neighbor of x is unsafe.”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “For all locations <m:math><m:ci>y</m:ci></m:math>,
               if <m:math><m:ci>y</m:ci></m:math> is a neighbor of <m:math><m:ci>x</m:ci></m:math>, then <m:math><m:ci>y</m:ci></m:math> is unsafe.”
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “There is a safe location that is a neighbor of x,
               if num(x)&lt;3.”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “If num(x)&lt;3,
               then there exists a location y,
                    such that y is safe, and y is a neighbor of x.”
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">“If you've seen one episode, you've seen 'em all.”</entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">“If there exists one episode <m:math><m:ci>x</m:ci></m:math> such that you've seen <m:math><m:ci>x</m:ci></m:math>,
             then for all episodes <m:math><m:ci>z</m:ci></m:math>, you've seen <m:math><m:ci>z</m:ci></m:math>.”
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “Somebody loves everybody.”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “There exists some person <m:math><m:ci>y</m:ci></m:math>, such that
               for all persons <m:math><m:ci>x</m:ci></m:math>, <m:math><m:ci>y</m:ci></m:math> loves <m:math><m:ci>x</m:ci></m:math>.”
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “There is someone for everybody.”
      </entry>
      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> “For all persons <m:math><m:ci>x</m:ci></m:math>, there exists a person <m:math><m:ci>y</m:ci></m:math>,
               such that <m:math><m:ci>y</m:ci></m:math> is for <m:math><m:ci>x</m:ci></m:math>.”
      </entry>
    </row>
<row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
     <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
     “All's well that ends well.”
     </entry>
     <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
     “For all events <m:math><m:ci>x</m:ci></m:math>, if <m:math><m:ci>x</m:ci></m:math> ends well then <m:math><m:ci>x</m:ci></m:math> is well.”
     </entry>
    </row></tbody>
</tgroup>
</table>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="section2">
   
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
Warning: The Ambiguous “Any”
</name>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para6">
  The ambiguous “any”:
  I was playing a game with some friends, and we came across the rule:
  “If you have more cards than any other player,
    then discard a card.”
  Does this mean
  “than <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">all</emphasis> other players”, or
  “than <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">some</emphasis> other player”?
  Our group's opinion was divided (incl. across many native English speakers).
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para7">
  In our class terms, it's not always clear 
  whether “any” means for-all,
  or for-some (there-exists).
  Or maybe more accurately, 
  in the phrase “for any <m:math><m:ci>x</m:ci></m:math>”, 
  does <m:math><m:ci>x</m:ci></m:math> necessarily mean an 
  <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m10774" target="arbitrary">arbitrary</cnxn> 
  player?  
  <note xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="aside">
    Linguistics students, or those who are so sure the rule clearly 
    intended “than all other players”:
    Switching
    “<m:math>
        <m:mrow><m:mo>(</m:mo><m:apply><m:gt/> <m:ci>x</m:ci> <m:ci>y</m:ci></m:apply><m:mo>)</m:mo></m:mrow>
      </m:math>”
    to
    “<m:math>
        <m:mrow><m:mo>(</m:mo><m:apply><m:lt/> <m:ci>x</m:ci> <m:ci>y</m:ci></m:apply><m:mo>)</m:mo></m:mrow>
      </m:math>”
    changes from an active voice to
    a passive voice 
    but may also reverse your interpretation of the English 
    quantifier “any”:
    “If any player has fewer points than you, …”
  </note>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para8">
  In your proof-writing (and your English writing, and your informal writing),
  think about replacing “any” with 
  either “every” or 
  with “some”, to make
  your meaning clear.
</para>
</section>
</section>


<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="section3">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">First-order logic: WFFs revisited</name>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para9">
  We originally defined a well-formed formula (WFF) for
  propositional logic; we'll extend this to WFFs for
  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">first-order logic</term>, also known as
  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">predicate logic</term>.
  At the same time, we'll more precisely define the binding of variables.
</para>



<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para10">
  This logic allows use of both functions and relations.
  Since these functions' outputs are not Booleans (otherwise, we'd call
  them relations), but rather data than can be used as a relation's input,
  we separate the syntax into that of <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">terms</term> and formulas.
  Terms are all the possible inputs for a relation.
</para>

<definition xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="term">
  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">term</term>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A variable.
  </meaning>
  <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example1">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para11">
      <m:math><m:ci>a</m:ci></m:math>, <m:math><m:ci>b</m:ci></m:math>, …
    </para>
  </example>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A constant.
  </meaning>
  <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example2">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para12">
      WaterWorld location <m:math><m:ci>F</m:ci></m:math>, Kevin Bacon, or the number 3.
    </para>
  </example>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A function applied to one or more terms.
  </meaning>
  <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example3">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para13">
      <m:math><m:mrow><m:ci type="function">successor</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:cn>3</m:cn><m:mo>)</m:mo></m:mrow></m:math>
    </para>
  </example>
</definition>


<definition xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="wff">
  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Well-Formed Formula (WFF) for first-order logic</term>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A constant: <m:math><m:true/></m:math> or <m:math><m:false/></m:math>.
  </meaning>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    An <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">atomic formula</term>: a relation symbol applied to one
    or more terms.
  </meaning>

  <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example4">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para14">
      <m:math><m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>F</m:ci><m:mo>)</m:mo></m:mrow></m:math>
    </para>
  </example>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A negation of a WFF,
    <m:math><m:apply><m:not/> <m:ci>φ</m:ci> </m:apply></m:math>.
  </meaning>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A conjunction of WFFs,
    <m:math><m:apply><m:and/> <m:ci>φ</m:ci> <m:ci>ψ</m:ci> </m:apply></m:math>.
  </meaning>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A disjunction of WFFs,
    <m:math><m:apply><m:or/> <m:ci>φ</m:ci> <m:ci>ψ</m:ci> </m:apply></m:math>.
  </meaning>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    An implication of WFFs,
    <m:math><m:apply><m:implies/> <m:ci>φ</m:ci> <m:ci>ψ</m:ci> </m:apply></m:math>.
  </meaning>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    A <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">universal quantification</term> of a WFF,
    <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext> <m:ci>φ</m:ci></m:math> .
  </meaning>

  <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example5">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para15">
      <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext> <m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>F</m:ci><m:mo>)</m:mo></m:mrow></m:math> 
    </para>
  </example>

  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    An <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">existential quantification</term> of a WFF,
    <m:math><m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext> <m:ci>φ</m:ci></m:math> .
  </meaning>

  <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example6">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para16">
      <m:math><m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext> <m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>F</m:ci><m:mo>)</m:mo></m:mrow></m:math> 
    </para>
  </example>
</definition>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para17">
  While a formula is just a piece of syntax,
  the meaning of its connectives, including the quantifiers,
  is part of the definition of a WFF.
  However, as previously discussed,
  the meaning of a WFF also depends on the
  <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m10726">interpretation</cnxn>
  we give to its relations.
</para>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="section4">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Examples</name>


<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example7">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para18">
    Everybody likes John Cusack:
    <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
      <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>John Cusack</m:ci><m:mo>)</m:mo></m:mrow></m:math>
    .
  </para>
</example>

<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example8">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para19">
    Somebody likes Joan Cusack:
    <m:math><m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
      <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>Joan Cusack</m:ci><m:mo>)</m:mo></m:mrow></m:math>
    .
  </para>
</example>

<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="somebody-likes-everybody">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para20">
    Somebody likes everybody:
    <m:math><m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
      <m:mo>∀</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
        <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow></m:math>
      
    .
    (We use <m:math><m:ci>n</m:ci></m:math> for “needy”?)
  </para>
</example>

<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example10">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para21">
    Everybody likes somebody:
    <m:math><m:mo>∀</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
      <m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
        <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>x</m:ci><m:mo>)</m:mo></m:mrow></m:math>
      
    .
    Careful; this formula looks similar to the preceding one, but it has
    a very different meaning!
  </para>
</example>

<exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exercise1">
  <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para22">
      How would you express 
      “Somebody is liked by everybody”?
    </para>
  </problem>

  <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para23">
      The cue 
      “Somebody …”
      suggests one person who exists; we'll call them <m:math><m:ci>p</m:ci></m:math> for
      “popular”:
      <m:math><m:mo>∃</m:mo><m:ci>p</m:ci><m:mtext>.</m:mtext></m:math>….
      Now we need to fill in the dots with 
      “everybody likes <m:math><m:ci>p</m:ci></m:math>”, to get:
      <m:math><m:mo>∃</m:mo><m:ci>p</m:ci><m:mtext>.</m:mtext><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
        <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>p</m:ci><m:mo>)</m:mo></m:mrow></m:math>
       .
    </para>
  </solution>
</exercise>

<exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exercise2">
  <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para24">
      How would you express 
      “Everybody is liked by somebody”?
    </para>
  </problem>

  <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para25">
      The cue 
      “Everybody …”
      suggests a universal; we'll call them <m:math><m:ci>j</m:ci></m:math> for
      “J. Doe”:
      <m:math><m:mo>∀</m:mo><m:ci>j</m:ci><m:mtext>.</m:mtext></m:math>….
      Now we need to fill in the dots with 
      “somebody likes <m:math><m:ci>j</m:ci></m:math>”, to get:
      <m:math><m:mo>∀</m:mo><m:ci>j</m:ci><m:mtext>.</m:mtext>
        <m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
          <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>j</m:ci><m:mo>)</m:mo></m:mrow></m:math>
        
      .
      Note that this formula is just like the preceding 
      <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="somebody-likes-everybody">“Somebody likes everybody” example</cnxn>,
      except that the quantifiers have been swapped
      (and different variable names were used, a superficial difference).
    </para>
  </solution>
</exercise>




<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example11">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para26">
    The following formula is a simple application of symmetry.
    <m:math><m:apply><m:implies/>
      <m:apply><m:and/>
        <m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
          <m:mo>∀</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
            <m:apply><m:implies/>
              <m:mrow><m:ci type="function">near</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
              <m:mrow><m:ci type="function">near</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>x</m:ci><m:mo>)</m:mo></m:mrow>
            </m:apply>
          
        
        <m:mrow><m:ci type="function">near</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>Sue</m:ci><m:mo>,</m:mo><m:ci>Joe</m:ci><m:mo>)</m:mo></m:mrow>
      </m:apply>
      <m:mrow><m:ci type="function">near</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>Joe</m:ci><m:mo>,</m:mo><m:ci>Sue</m:ci><m:mo>)</m:mo></m:mrow>
    </m:apply></m:math>.
  </para>

  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para27">
    While it is certainly true under the intended interpretation,
    it is also true under <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">any</emphasis> interpretation.
    Such formulas are called <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">valid</term>.
    Valid first-order formulas are the natural analog of tautological
    propositional formulas.
  </para>
</example>

<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example-using-even-prime">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para28">
    <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
      <m:apply><m:implies/>
        <m:apply><m:and/>
          <m:mrow><m:ci type="function">even</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>)</m:mo></m:mrow>
          <m:mrow><m:ci type="function">prime</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>)</m:mo></m:mrow>
        </m:apply>
        <m:apply><m:eq/> <m:ci>x</m:ci> <m:cn>2</m:cn></m:apply>
      </m:apply></m:math>
    
    is a mathematical fact, in the standard interpretation of arithmetic.
  </para>
</example>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para29">
  While technically not allowed by our
  <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m10728" target="term">term</cnxn> and
  <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m10728" target="wff">formula</cnxn>
  syntax, we'll continue using infix notation
  for common mathematical functions and relations, as in
  <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="example-using-even-prime">the previous example</cnxn>.
</para>

<exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exercise-even-and-prime">
  <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para30">
      The
      <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="example-using-even-prime">previous example</cnxn> used the relations
      <m:math><m:ci type="function">even</m:ci></m:math> and <m:math><m:ci type="function">prime</m:ci></m:math>.
      Of course, to use such relations,
      they must either be defined directly by the interpretation, or
      be defined in terms of functions and relations provided by
      the interpretation.
    </para>

    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para31">
      How would you define these two relations in terms of the basic
      numerical functions (addition, multiplication, …)
      and relations (<m:math><m:mo>=</m:mo></m:math> , &lt;, &gt;)?
    </para>
  </problem>

  <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para32">
      “Evenness” is a straightforward translation from 
      “An integer n is even, iff it is twice some other integer k”:
      <m:math><m:apply><m:equivalent/>
        <m:mrow><m:ci type="function">even</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>n</m:ci><m:mo>)</m:mo></m:mrow>
        <m:mo>∃</m:mo><m:ci>k</m:ci><m:mtext>.</m:mtext>
          <m:apply><m:eq/>
            <m:ci>n</m:ci>
            <m:apply><m:times/><m:cn>2</m:cn><m:ci>k</m:ci></m:apply>
          </m:apply>
        
      </m:apply></m:math>.
      Note that by this standard definition, zero is even.
    </para>

    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para33">
      There are many equivalent ways to define primality, just as there
      many algorithms for checking primality.
      One straightforward solution is
      <m:math><m:apply><m:equivalent/>
        <m:mrow><m:ci type="function">noncomposite</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>n</m:ci><m:mo>)</m:mo></m:mrow>
        <m:mo>∀</m:mo><m:ci>j</m:ci><m:mtext>.</m:mtext>
          <m:mo>∀</m:mo><m:ci>k</m:ci><m:mtext>.</m:mtext>
            <m:apply><m:implies/>
              <m:apply><m:eq/>
                <m:apply><m:times/> <m:ci>j</m:ci> <m:ci>k</m:ci></m:apply>
                <m:ci>n</m:ci>
              </m:apply> 
              <m:apply><m:or/>
                <m:apply><m:eq/> <m:ci>j</m:ci> <m:cn>1</m:cn></m:apply>
                <m:apply><m:eq/> <m:ci>k</m:ci> <m:cn>1</m:cn></m:apply>
              </m:apply>
            </m:apply>
          
        
      </m:apply></m:math>.
      
      Well, this is almost expresses “prime”,
      except that
      <m:math>
        <m:apply><m:eq/>
          <m:ci>n</m:ci>
          <m:cn>1</m:cn>
        </m:apply>
      </m:math>
      satisfies this formula.
      A mathematician points out that just as 0 is neither positive nor
      negative, 1 is neither prime nor composite;
      as stated this formula
      actually captures “noncomposite”, oops.
      There are several ways to upgrade this to exactly capture
      “prime”.
      <note xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="aside">
        1 is called a “unit”.  
        If we consider the domain of all integers (not just natural numbers),
        the idea of primality still makes sense; -17 is also prime;
        and -1 is also another unit.  Similarly, considering the domain
        of “complex integers”
        
        <m:math><m:set>
          <m:bvar>
            <m:apply>
              <m:plus/>
              <m:ci>a</m:ci>
              <m:apply>
                <m:times/>
                <m:ci>b</m:ci>
                <m:imaginaryi/>
              </m:apply>
            </m:apply>
          </m:bvar>
          <m:condition>
            <m:apply><m:and/>
              <m:reln>
                <m:in/>
                <m:ci>a</m:ci>
                <m:integers/>
              </m:reln>
              <m:reln>
                <m:in/>
                <m:ci>b</m:ci>
                <m:integers/>
              </m:reln>
            </m:apply>
          </m:condition>
        </m:set></m:math>
        
        (could be written
         “<m:math>
             <m:apply>
               <m:plus/>
               <m:integers/>
               <m:apply>
                 <m:times/>
                 <m:integers/>
                 <m:imaginaryi/>
               </m:apply>
             </m:apply>
           </m:math>”),
        then
        <m:math>
          <m:imaginaryi/>
        </m:math>
        and
        <m:math>
          <m:apply>
            <m:minus/>
            <m:imaginaryi/>
          </m:apply>
        </m:math>
        are also units.
        
        How might we generalize our definition of prime, to work
        in these further interpretations?
        
      </note>
      A similar, equivalent formula to the above is
      <m:math><m:apply><m:equivalent/>
        <m:mrow><m:ci type="function">noncomposite</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>n</m:ci><m:mo>)</m:mo></m:mrow>
        <m:apply><m:not/>
          <m:mo>∃</m:mo><m:ci>j</m:ci><m:mtext>.</m:mtext> 
            <m:mo>∃</m:mo><m:ci>k</m:ci><m:mtext>.</m:mtext>
              <m:apply><m:and/>
                <m:apply><m:eq/> 
                  <m:apply> <m:times/> <m:ci>j</m:ci> <m:ci>k</m:ci></m:apply>
                  <m:ci>n</m:ci>
                </m:apply>
                <m:apply><m:neq/> <m:ci>j</m:ci> <m:cn>1</m:cn></m:apply>
                <m:apply><m:neq/> <m:ci>k</m:ci> <m:cn>1</m:cn></m:apply>
              </m:apply> 
             
          
        </m:apply> 
      </m:apply></m:math>.
    </para>
  </solution>
</exercise>

<exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exercise4">
  <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para34">
      One hypothesis about natural numbers is known as 
      <link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" src="http://www.wikipedia.org/wiki/Goldbachs_conjecture">Goldbach's Conjecture</link>.
      It states that all even integers greater than two
      can be expressed as the sum of two primes.
      It is one of the oldest still-unsolved problems about numbers.
      How would you write this conjecture as a WFF?
    </para>
  </problem>

  <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para35">
      <m:math><m:mo>∀</m:mo><m:ci>n</m:ci><m:mtext>.</m:mtext> 
        <m:apply><m:implies/>
          <m:apply><m:and/>
            <m:mrow><m:ci type="function">even</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>n</m:ci><m:mo>)</m:mo></m:mrow>
            <m:reln><m:gt/> <m:ci>n</m:ci> <m:cn>2</m:cn> </m:reln>
          </m:apply>
          <m:mo>∃</m:mo><m:ci>p</m:ci><m:mtext>.</m:mtext> 
            <m:mo>∃</m:mo><m:ci>q</m:ci><m:mtext>.</m:mtext>
              <m:apply><m:and/>
                <m:mrow><m:ci type="function">prime</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>p</m:ci><m:mo>)</m:mo></m:mrow>
                <m:mrow><m:ci type="function">prime</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>q</m:ci><m:mo>)</m:mo></m:mrow>
                <m:apply><m:eq/> 
                  <m:apply><m:plus/> <m:ci>p</m:ci> <m:ci>q</m:ci></m:apply>
                  <m:ci>n</m:ci>
                </m:apply>
              </m:apply> 
             
          
        </m:apply></m:math>
      
    </para>
  </solution>
</exercise>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para36">
  Enough about number theory.  Let's look at some examples
  about common data structures and some about our favorite problem,
  WaterWorld.
</para>

<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="example13">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para37">
    If your program uses binary search trees and your domain is
    tree nodes, you need to know
    
    <m:math><m:mo>∀</m:mo><m:ci>node</m:ci><m:mtext>.</m:mtext>
      <m:apply><m:and/>
        <m:reln>
          <m:leq/>
          <m:apply>
            <m:fn><m:ci>data</m:ci></m:fn>
            <m:apply>
              <m:fn><m:ci>left</m:ci></m:fn>
              <m:ci>node</m:ci>
            </m:apply>
          </m:apply>
          <m:apply>
            <m:fn><m:ci>data</m:ci></m:fn>
            <m:ci>node</m:ci>
          </m:apply>
        </m:reln>
        <m:reln>
          <m:gt/>
          <m:apply>
            <m:fn><m:ci>data</m:ci></m:fn>
            <m:apply>
              <m:fn><m:ci>right</m:ci></m:fn>
              <m:ci>node</m:ci>
            </m:apply>
          </m:apply>
          <m:apply>
            <m:fn><m:ci>data</m:ci></m:fn>
            <m:ci>node</m:ci>
          </m:apply>
        </m:reln>
      </m:apply></m:math>
    .
    If these trees are also balanced, you need to know
    <m:math><m:mo>∀</m:mo><m:ci>node</m:ci><m:mtext>.</m:mtext>
      
      <m:apply><m:or/>
        <m:reln>
          <m:eq/> 
          <m:apply>
            <m:fn><m:ci>height</m:ci></m:fn>
            <m:apply>
              <m:fn><m:ci>left</m:ci></m:fn>
              <m:ci>node</m:ci>
            </m:apply>
          </m:apply>
          <m:apply>
            <m:fn><m:ci>height</m:ci></m:fn>
            <m:apply>
              <m:fn><m:ci>right</m:ci></m:fn>
              <m:ci>node</m:ci>
            </m:apply>
          </m:apply>
        </m:reln>
        <m:reln>
          <m:eq/>
          <m:apply>
            <m:plus/>
            <m:apply>
              <m:fn><m:ci>height</m:ci></m:fn>
              <m:apply>
                <m:fn><m:ci>left</m:ci></m:fn>
                <m:ci>node</m:ci>
              </m:apply>
            </m:apply>
            <m:cn>1</m:cn>
          </m:apply>
          <m:apply>
            <m:fn><m:ci>height</m:ci></m:fn>
            <m:apply>
              <m:fn><m:ci>right</m:ci></m:fn>
              <m:ci>node</m:ci>
            </m:apply>
          </m:apply>
        </m:reln>
        <m:reln>
          <m:eq/>
          <m:apply>
            <m:fn><m:ci>height</m:ci></m:fn>
            <m:apply>
              <m:fn><m:ci>left</m:ci></m:fn>
              <m:ci>node</m:ci>
            </m:apply>
          </m:apply>
          <m:apply>
            <m:plus/>
            <m:apply>
              <m:fn><m:ci>height</m:ci></m:fn>
              <m:apply>
                <m:fn><m:ci>right</m:ci></m:fn>
                <m:ci>node</m:ci>
              </m:apply>
            </m:apply>
            <m:cn>1</m:cn>
          </m:apply>
        </m:reln>
      </m:apply></m:math>
    .
    Again, these assume the implied interpretations.
  </para>
</example>

<example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sorted-array">
  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para38">
    We would like to be able to state that the output of a sorting
    routine is, in fact, sorted.
    Let's assume we're sorting arrays into ascending order.
  </para>

  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para39">
    To talk about the elements of an array in a typical programming
    language, we would write something like
    <m:math><m:ci>A</m:ci><m:mfenced close="]" open="["><m:ci>i</m:ci></m:mfenced></m:math>.
    For this example, we'll use that notation, even though it doesn't
    quite fit the logic's syntax.
  </para>

  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para40">
    To describe sortedness (in non-decreasing order),
    we want to state that each element is greater than or equal to  
    the previous one.  However, just like in a program, we need to
    ensure our formula doesn't index outside the bounds of the array.
    For this example, we'll assume that an array's indices are
    zero to (but not including) 
    <m:math><m:apply><m:fn><m:ci>size</m:ci></m:fn><m:ci>A</m:ci></m:apply></m:math>.
  </para>

  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para41">
    <m:math><m:apply><m:equivalent/>
      <m:mrow><m:ci type="function">sorted</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>A</m:ci><m:mo>)</m:mo></m:mrow>
      <m:mo>∀</m:mo><m:ci>i</m:ci><m:mtext>.</m:mtext>
        <m:apply><m:implies/>
          <m:apply><m:and/>
            <m:reln>
              <m:leq/>
              <m:cn>1</m:cn>
              <m:ci>i</m:ci>
            </m:reln>
            <m:reln>
              <m:lt/>
              <m:ci>i</m:ci>
              <m:apply>
                <m:fn><m:ci>size</m:ci></m:fn>
                <m:ci>A</m:ci>
              </m:apply>
            </m:reln>
          </m:apply>
          <m:reln>
            <m:lt/>
            <m:mrow>
              <m:ci>A</m:ci>
              <m:mfenced close="]" open="[">
                <m:apply><m:minus/><m:ci>i</m:ci><m:cn>1</m:cn></m:apply>
              </m:mfenced>
            </m:mrow>  
            <m:mrow>
              <m:ci>A</m:ci>
              <m:mfenced close="]" open="["><m:ci>i</m:ci></m:mfenced>
            </m:mrow>
          </m:reln>
        </m:apply>
      
    </m:apply></m:math>
  </para>

  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para42">
    When proving things about programs, it's often useful to realize
    there are alternate ways of defining things.  So, let's see a couple
    more definitions.
  </para>

  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para43">
    We could change our indexing slightly:
    
    <m:math><m:apply><m:equivalent/>
      <m:mrow><m:ci type="function">sorted</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>A</m:ci><m:mo>)</m:mo></m:mrow>
      <m:mo>∀</m:mo><m:ci>i</m:ci><m:mtext>.</m:mtext>
        <m:apply><m:implies/>
          <m:apply><m:and/>
            <m:reln> <m:leq/> <m:cn>0</m:cn> <m:ci>i</m:ci> </m:reln>
            <m:reln>
              <m:lt/>
              <m:ci>i</m:ci>
              <m:apply>
                <m:minus/>
                <m:apply>
                  <m:fn><m:ci>size</m:ci></m:fn>
                  <m:ci>A</m:ci>
                </m:apply>
                <m:cn>1</m:cn>
              </m:apply>
            </m:reln>
          </m:apply>
          <m:reln>
            <m:lt/>
            <m:mrow>
              <m:ci>A</m:ci>
              <m:mfenced close="]" open="["><m:ci>i</m:ci></m:mfenced>
            </m:mrow> 
            <m:mrow>
              <m:ci>A</m:ci>
              <m:mfenced close="]" open="[">
                <m:apply>
                  <m:plus/>
                  <m:ci>i</m:ci>
                  <m:cn>1</m:cn>
                </m:apply>
              </m:mfenced>
            </m:mrow> 
          </m:reln>
        </m:apply>
      
    </m:apply></m:math>.
  </para>


  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para44">
    
    Or we could state that the ordering holds on every pair of elements:
    <m:math><m:apply><m:equivalent/>
      <m:mrow><m:ci type="function">sorted</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>A</m:ci><m:mo>)</m:mo></m:mrow>
      <m:mo>∀</m:mo><m:ci>i</m:ci><m:mtext>.</m:mtext>
        <m:mo>∀</m:mo><m:ci>j</m:ci><m:mtext>.</m:mtext>
          <m:apply><m:implies/>
            <m:apply><m:and/>
              <m:reln> <m:leq/> <m:cn>0</m:cn> <m:ci>i</m:ci> </m:reln>
              <m:reln>
                <m:lt/>
                <m:ci>i</m:ci>
                <m:apply><m:fn><m:ci>size</m:ci></m:fn> <m:ci>A</m:ci></m:apply>
              </m:reln>
              <m:reln> <m:leq/> <m:cn>0</m:cn> <m:ci>j</m:ci> </m:reln>
              <m:reln>
                <m:lt/>
                <m:ci>j</m:ci>
                <m:apply><m:fn><m:ci>size</m:ci></m:fn> <m:ci>A</m:ci></m:apply>
              </m:reln>
              <m:reln> <m:lt/> <m:ci>i</m:ci>  <m:ci>j</m:ci> </m:reln>
            </m:apply>
            <m:reln>
              <m:leq/>
              <m:mrow>
                <m:ci>A</m:ci>
                <m:mfenced close="]" open="["><m:ci>i</m:ci></m:mfenced>
              </m:mrow> 
              <m:mrow>
                <m:ci>A</m:ci>
                <m:mfenced close="]" open="["><m:ci>j</m:ci></m:mfenced>
              </m:mrow>
            </m:reln>
          </m:apply>
        
      
    </m:apply></m:math>.
    This definition isn't any stronger, but it makes an additional
    property explicit.  Generally, you'd find it harder to prove that
    this formula was true, but once you did, you'd find it easier to
    use this formula to prove other statements.
  </para>
</example>

<exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="functions">
  <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para45">
      The two preceding examples used functions like <m:math><m:ci>left</m:ci></m:math>,
      <m:math><m:ci>size</m:ci></m:math>, and subtraction, although our logic syntax
      doesn't include such functions.
      However, we can rewrite any use of functions with appropriate new
      relations.
    </para>

    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para46">
      As an example, rewrite
      <m:math><m:apply>
        <m:lt/>
        <m:ci>i</m:ci>
        <m:apply><m:fn><m:ci>size</m:ci></m:fn> <m:ci>A</m:ci></m:apply>
      </m:apply></m:math>
      in proper first-order syntax.
    </para>
  </problem>

  <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para47">
      We need a new relation that combines the syntax of
      <m:math><m:reln><m:lt/></m:reln></m:math> and <m:math><m:ci>size</m:ci></m:math>.
      The result would look like
      <m:math><m:mrow><m:ci type="function">less-than-size</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>i</m:ci><m:mo>,</m:mo><m:ci>A</m:ci><m:mo>)</m:mo></m:mrow></m:math>.
      This assumes the new relation has the obvious intended definition.
    </para>

  </solution>
</exercise>

<exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exercise6">
  <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para48">
    One simple WaterWorld fact is that if a location has no unsafe
    neighbors, then its number of adjacent pirates is zero.
    Furthermore, the implication goes both ways.
    How would you state that as a WFF?
    </para>
  </problem>

  <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para49">
      <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
        <m:mrow><m:mo>(</m:mo><m:mo>∀</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
            <m:apply><m:implies/>
              <m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
              <m:mrow><m:ci type="function">safe</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
            </m:apply>
          <m:mo>⇔</m:mo><m:apply><m:ci>has0</m:ci> <m:ci>x</m:ci></m:apply><m:mo>)</m:mo></m:mrow></m:math>
      
    </para>
  </solution>
</exercise>

<exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exercise7">
  <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para50">
      How would you make a similar statement about the number of
      adjacent pirates being one?
    </para>
  </problem>

  <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para51">
      There are various solutions, but they all must capture the same idea:
      there exists exactly one unsafe neighbor.
      This solution states that in two parts:
      <list xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="list1">
        <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
          There exists an unsafe neighbor, <m:math><m:ci>u</m:ci></m:math>.
        </item>
        <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
          Every unsafe neighbor is <m:math><m:ci>u</m:ci></m:math>.
        </item>
      </list>
      Together, these two parts imply there is only one such <m:math><m:ci>u</m:ci></m:math>.
    </para>

    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para52">
      <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
        <m:mrow><m:mo>(</m:mo><m:mo>∃</m:mo><m:ci>u</m:ci><m:mtext>.</m:mtext>
            <m:apply><m:and/>
              <m:apply> <m:ci>nhbr</m:ci> <m:ci>x</m:ci> <m:ci>u</m:ci></m:apply>
              <m:apply><m:not/>
                <m:mrow><m:ci type="function">safe</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>u</m:ci><m:mo>)</m:mo></m:mrow>
              </m:apply>
              <m:mo>∀</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
                <m:apply><m:implies/>
                  <m:mrow><m:ci>nhbr</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
                  <m:mrow><m:mo>(</m:mo><m:apply><m:not/>
                      <m:mrow><m:ci type="function">safe</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
                    </m:apply><m:mo>⇔</m:mo><m:apply><m:eq/> <m:ci>y</m:ci> <m:ci>u</m:ci> </m:apply><m:mo>)</m:mo></m:mrow>
                </m:apply>
              
            </m:apply>
          <m:mo>⇔</m:mo><m:apply><m:ci>has1</m:ci> <m:ci>x</m:ci></m:apply><m:mo>)</m:mo></m:mrow></m:math>
      
    </para>
  </solution>
</exercise>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para53">
  These statements are very similar to, and provable from, the
  <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m11072">first-order WaterWorld domain axioms</cnxn>.
</para>

</section> 


<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="section5">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">A hint on deciphering formulas' meanings</name>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para54">
  Some formulas can get pretty hairy:
  <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
    <m:mo>∃</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
      <m:mo>∀</m:mo><m:ci>z</m:ci><m:mtext>.</m:mtext> 
        <m:apply><m:and/>
          <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
          <m:apply><m:not/><m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>z</m:ci><m:mo>)</m:mo></m:mrow></m:apply>
        </m:apply></m:math>
      
    
  .
  The zeroth step is to take a breath, and read this in English —
  for every <m:math><m:ci>x</m:ci></m:math>, there's some <m:math><m:ci>y</m:ci></m:math> such that for every <m:math><m:ci>z</m:ci></m:math>,
  <m:math><m:ci>x</m:ci></m:math> likes <m:math><m:ci>y</m:ci></m:math> but <m:math><m:ci>y</m:ci></m:math> doesn't like <m:math><m:ci>z</m:ci></m:math>.
  Even so, how do we approach getting a handle on what this means?
  Given an interpretation, how do we know it's true?
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para55">
  The top-down way would be to read this formula left-to-right.
  Is the whole formula true?
  Well, it's only true if, for every possible value of x,
  some smaller formula is true
  (namely, 
   “there exists a <m:math><m:ci>y</m:ci></m:math> such that
     forall <m:math><m:ci>z</m:ci></m:math>, <m:math><m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow></m:math>
     and <m:math><m:apply><m:not/><m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>z</m:ci><m:mo>)</m:mo></m:mrow></m:apply></m:math>.”).
  (This is a formula with <m:math><m:ci>x</m:ci></m:math> free  —
   that is, it's a statement about <m:math><m:ci>x</m:ci></m:math>.)
  And is that formula true? 
  Well, precisely when we can find some <m:math><m:ci>y</m:ci></m:math> such that … (and so on).
  This direct approach is hard to keep inside your head all at once.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para56">
  Most people prefer approaching the problems in a bottom-up manner
  (or if you prefer, right-to-left or inside-out):
  First consider at the small inner bits alone, figure out what they mean,
  and only then figure out how they relate.

  <list xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="list2">
    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      What does the innermost formula
      “<m:math><m:apply><m:and/>
          <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow>
          <m:apply><m:not/><m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>z</m:ci><m:mo>)</m:mo></m:mrow></m:apply>
        </m:apply></m:math>”
      mean, in English?  That's not so bad:
      <m:math><m:ci>x</m:ci></m:math> likes <m:math><m:ci>y</m:ci></m:math>, and <m:math><m:ci>y</m:ci></m:math> dislikes <m:math><m:ci>z</m:ci></m:math>.
      A statement about three people called <m:math><m:ci>x</m:ci></m:math>, <m:math><m:ci>y</m:ci></m:math>, <m:math><m:ci>z</m:ci></m:math>.
    </item>

    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      Working outward, what does
      “<m:math><m:mo>∀</m:mo><m:ci>z</m:ci><m:mtext>.</m:mtext>
          <m:apply><m:and/>
            <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow> 
            <m:apply><m:not/>
              <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>z</m:ci><m:mo>)</m:mo></m:mrow>
            </m:apply>
          </m:apply></m:math>
        ”
      mean?  Ah, not so bad either:
      <m:math><m:ci>x</m:ci></m:math> likes <m:math><m:ci>y</m:ci></m:math>, and <m:math><m:ci>y</m:ci></m:math> dislikes everybody<note xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="footnote">Or if
      you prefer, “<m:math><m:ci>x</m:ci></m:math> likes <m:math><m:ci>y</m:ci></m:math>, who is a misanthrope”.
      A self-loathing misanthrope, at that!</note>.
    </item>

    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      Keep on going:
      “<m:math><m:mo>∃</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
          <m:mo>∀</m:mo><m:ci>z</m:ci><m:mtext>.</m:mtext>
            <m:apply><m:and/>
              <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow> 
              <m:apply><m:not/>
                <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>z</m:ci><m:mo>)</m:mo></m:mrow>
              </m:apply>
            </m:apply></m:math>
          
        ”
      becomes “<m:math><m:ci>x</m:ci></m:math> likes some misanthrope”.
    </item>

    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      Now it's clear:
      “<m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
          <m:mo>∃</m:mo><m:ci>y</m:ci><m:mtext>.</m:mtext>
            <m:mo>∀</m:mo><m:ci>z</m:ci><m:mtext>.</m:mtext>
              <m:apply><m:and/>
                <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>,</m:mo><m:ci>y</m:ci><m:mo>)</m:mo></m:mrow> 
                <m:apply><m:not/>
                  <m:mrow><m:ci type="function">likes</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>y</m:ci><m:mo>,</m:mo><m:ci>z</m:ci><m:mo>)</m:mo></m:mrow>
                </m:apply>
              </m:apply></m:math>
            
          
        ”
      is just “everybody likes some misanthrope”.
    </item>
  </list>

  Phew!
</para>

</section>





<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="section6">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">“Forall”'s friend “if”</name>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para57">
  We have already seen quite a few formulas of the general form
  <m:math><m:mo>∀</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
    <m:apply><m:implies/>
      <m:mrow><m:ci type="function">P</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>)</m:mo></m:mrow>
      <m:mtext>…</m:mtext>
    </m:apply></m:math>
  .
  Indeed, this is a very useful idiom:
  If our domain is natural numbers but we want to say something
  about all primes, we simply write
  <m:math><m:mo>∀</m:mo><m:ci>n</m:ci><m:mtext>.</m:mtext>
    <m:apply><m:implies/>
      <m:mrow><m:ci type="function">prime</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>n</m:ci><m:mo>)</m:mo></m:mrow>
      <m:mtext>…</m:mtext>
    </m:apply></m:math>
  .
  Don't be fooled;
  this formula is in no way suggesting that all numbers are prime!

  <note xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="warning">
    This same construct using <m:math><m:mo>∃</m:mo></m:math> is usually a mistake.  Consider
    <m:math><m:mo>∃</m:mo><m:ci>x</m:ci><m:mtext>.</m:mtext>
      <m:apply><m:implies/>
        <m:mrow><m:ci type="function">P</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>x</m:ci><m:mo>)</m:mo></m:mrow>
        <m:mtext>…</m:mtext>
      </m:apply></m:math>
    .
    By choosing <m:math><m:ci>x</m:ci></m:math> to be any non-<m:math><m:ci type="function">P</m:ci></m:math> element,
    this entire formula is true, without even glancing at what is inside
    the “…”!
  </note>
</para>

<note xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
  If you have to demonstrate that all ravens are black — 
  <m:math><m:mo>∀</m:mo><m:ci>i</m:ci><m:mtext>.</m:mtext>
    <m:apply><m:implies/>
      <m:mrow><m:ci type="function">isRaven</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>i</m:ci><m:mo>)</m:mo></m:mrow>
      <m:mrow><m:ci type="function">isBlack</m:ci><m:mo>⁡</m:mo><m:mo>(</m:mo><m:ci>i</m:ci><m:mo>)</m:mo></m:mrow>
    </m:apply></m:math>
  
  — there are two ways to do so:
  You can go out and find every raven and verify that it's black.
  Alternately, you can go and find every non-black item, and verify
  that it's a non-raven.

  Epistemologists — philosophers dealing with how we humans
  come to learn and know things (about, say, raven colors) —
  go on to ponder about real-world degrees-of-belief:
  If we have only looked at some ravens, and we find another raven and
  confirm it is black, does this increase our degree of belief about
  all ravens being black?
  If so, then whenever we find a non-black item which is a non-raven,
  this must also increase our degree of belief that all ravens
  are black.
  This leads to Hempel's (so-called) Paradox:
  if we are looking for evidence to choose between two competing hypotheses
  (say, “all non-black items are not ravens”
   versus “all non-orange items are not ravens”),
  then finding a purple cow increases our belief in <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">both</emphasis>
  of these hypotheses, simultaneously!
</note>

</section>
</section> 

</content>
</document>
