<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>decision-problems &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/decision-problems/</link>
	<description>Feed of posts on WordPress.com tagged "decision-problems"</description>
	<pubDate>Thu, 20 Jun 2013 04:27:04 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Deciding the convexity of semialgebraic sets II]]></title>
<link>http://stochastix.wordpress.com/2012/06/23/deciding-the-convexity-of-semialgebraic-sets-ii/</link>
<pubDate>Sun, 24 Jun 2012 01:03:00 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/06/23/deciding-the-convexity-of-semialgebraic-sets-ii/</guid>
<description><![CDATA[Let denote the set of real symmetric matrices. We introduce a matrix-valued function defined by The]]></description>
<content:encoded><![CDATA[<p>Let <img src='http://s0.wp.com/latex.php?latex=S_3+%5Csubset+%5Cmathbb%7BR%7D%5E%7B3+%5Ctimes+3%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_3 &#92;subset &#92;mathbb{R}^{3 &#92;times 3}' title='S_3 &#92;subset &#92;mathbb{R}^{3 &#92;times 3}' class='latex' /> denote the set of real symmetric <img src='http://s0.wp.com/latex.php?latex=3+%5Ctimes+3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='3 &#92;times 3' title='3 &#92;times 3' class='latex' /> matrices. We introduce a matrix-valued function <img src='http://s0.wp.com/latex.php?latex=A%3A+%5Cmathbb%7BR%7D%5E3+%5Cto+S_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A: &#92;mathbb{R}^3 &#92;to S_3' title='A: &#92;mathbb{R}^3 &#92;to S_3' class='latex' /> defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=A+%28x%29+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D+1+%26%2338%3B+x_1+%26%2338%3B+x_2%5C%5C+x_1+%26%2338%3B+1+%26%2338%3B+x_3%5C%5C+x_2+%26%2338%3B+x_3+%26%2338%3B+1%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x) = &#92;left[&#92;begin{array}{ccc} 1 &amp; x_1 &amp; x_2&#92;&#92; x_1 &amp; 1 &amp; x_3&#92;&#92; x_2 &amp; x_3 &amp; 1&#92;end{array}&#92;right]' title='A (x) = &#92;left[&#92;begin{array}{ccc} 1 &amp; x_1 &amp; x_2&#92;&#92; x_1 &amp; 1 &amp; x_3&#92;&#92; x_2 &amp; x_3 &amp; 1&#92;end{array}&#92;right]' class='latex' /></p>
<p>The <a href="http://math.berkeley.edu/~philipp/Main/SpecialCase1" target="_blank">elliptope</a> <img src='http://s0.wp.com/latex.php?latex=E_3+%5Csubset+%5Cmathbb%7BR%7D%5E3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3 &#92;subset &#92;mathbb{R}^3' title='E_3 &#92;subset &#92;mathbb{R}^3' class='latex' /> is defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=E_3+%3D+%5Cleft%5C%7B+x+%5Cin+%5Cmathbb%7BR%7D%5E3+%5Cmid+A+%28x%29+%5Csucceq+0+%5Cright%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3 = &#92;left&#92;{ x &#92;in &#92;mathbb{R}^3 &#92;mid A (x) &#92;succeq 0 &#92;right&#92;}' title='E_3 = &#92;left&#92;{ x &#92;in &#92;mathbb{R}^3 &#92;mid A (x) &#92;succeq 0 &#92;right&#92;}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=A+%28x%29+%5Csucceq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x) &#92;succeq 0' title='A (x) &#92;succeq 0' class='latex' /> means that matrix <img src='http://s0.wp.com/latex.php?latex=A+%28x%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x)' title='A (x)' class='latex' /> is positive semidefinite. Since the elliptope <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /> is defined by the <a href="http://en.wikipedia.org/wiki/Linear_matrix_inequality" target="_blank">linear matrix inequality</a> (LMI) <img src='http://s0.wp.com/latex.php?latex=A+%28x%29+%5Csucceq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x) &#92;succeq 0' title='A (x) &#92;succeq 0' class='latex' />, we can conclude that <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /> is a <a href="http://en.wikipedia.org/wiki/Spectrahedron" target="_blank">spectrahedron</a> and, therefore, we have that <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /> is convex.</p>
<p>The <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /> elliptope (also known as &#8220;inflated tetrahedron&#8221;) is the yellow part (surface and interior) of the <a href="http://mathworld.wolfram.com/CayleyCubic.html" target="_blank">Cayley&#8217;s cubic surface</a> plotted below</p>
<p><a href="http://stochastix.files.wordpress.com/2012/06/cayley-cubic-small.jpg"><img class="wp-image-8236 aligncenter" title="Cayley Cubic (small)" src="http://stochastix.files.wordpress.com/2012/06/cayley-cubic-small.jpg?w=450&#038;h=322" alt="" width="450" height="322" /></a></p>
<p style="text-align:center;">[ <a href="http://math.berkeley.edu/~philipp/Main/SpecialCase1" target="_blank">source</a> ]</p>
<p style="text-align:center;">__________</p>
<p><img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /> <strong>is a semialgebraic set</strong></p>
<p>Saying that <img src='http://s0.wp.com/latex.php?latex=A+%28x%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x)' title='A (x)' class='latex' /> is positive semidefinite is equivalent to saying that the <img src='http://s0.wp.com/latex.php?latex=2%5E3+-+1+%3D+7&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='2^3 - 1 = 7' title='2^3 - 1 = 7' class='latex' /> principal <a href="http://en.wikipedia.org/wiki/Minor_%28linear_algebra%29" target="_blank">minors</a> of <img src='http://s0.wp.com/latex.php?latex=A+%28x%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x)' title='A (x)' class='latex' /> are nonnegative. If <img src='http://s0.wp.com/latex.php?latex=A+%28x%29+%5Csucceq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x) &#92;succeq 0' title='A (x) &#92;succeq 0' class='latex' />, then the three 1st order principal minors (which are the diagonal entries of <img src='http://s0.wp.com/latex.php?latex=A+%28x%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x)' title='A (x)' class='latex' />) lead to the following three (admittedly uninteresting) inequalities</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=1+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1 &#92;geq 0' title='1 &#92;geq 0' class='latex' />,     <img src='http://s0.wp.com/latex.php?latex=1+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1 &#92;geq 0' title='1 &#92;geq 0' class='latex' />,     <img src='http://s0.wp.com/latex.php?latex=1+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1 &#92;geq 0' title='1 &#92;geq 0' class='latex' /></p>
<p>which we can discard. The three 2nd order principal minors (determinants of <img src='http://s0.wp.com/latex.php?latex=2+%5Ctimes+2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='2 &#92;times 2' title='2 &#92;times 2' class='latex' /> submatrices of <img src='http://s0.wp.com/latex.php?latex=A+%28x%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x)' title='A (x)' class='latex' />) and the 3rd order principal minor (the determinant of <img src='http://s0.wp.com/latex.php?latex=A+%28x%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='A (x)' title='A (x)' class='latex' />) can be computed using the following Python 2.5 + <a href="http://sympy.org" target="_blank">SymPy</a> script:</p>
<pre class="brush: python; title: ; notranslate" title="">
from sympy import *

# symbolic variables
x1 = Symbol('x1')
x2 = Symbol('x2')
x3 = Symbol('x3')

# build matrix A(x)
A = Matrix([[1,x1,x2],
            [x1,1,x3],
            [x2,x3,1]])

print &#34;\nMatrix A(x):&#34;
print A

print &#34;\n2nd order principal minors:&#34;
print A.extract([0,1],[0,1]).det()
print A.extract([0,2],[0,2]).det()
print A.extract([1,2],[1,2]).det()

print &#34;\n3rd order principal minor:&#34;
print A.det()
</pre>
<p>which produces the following output:</p>
<pre style="padding-left:30px;background:#FFFFFF;">Matrix A(x):
[ 1, x1, x2]
[x1,  1, x3]
[x2, x3,  1]

2nd order principal minors:
-x1**2 + 1
-x2**2 + 1
-x3**2 + 1

3rd order principal minor:
-x1**2 + 2*x1*x2*x3 - x2**2 - x3**2 + 1</pre>
<p>Hence, the 2nd order principal minors yield the following inequalities</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=1+-+x_1%5E2+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1 - x_1^2 &#92;geq 0' title='1 - x_1^2 &#92;geq 0' class='latex' />,     <img src='http://s0.wp.com/latex.php?latex=1+-+x_2%5E2+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1 - x_2^2 &#92;geq 0' title='1 - x_2^2 &#92;geq 0' class='latex' />,     <img src='http://s0.wp.com/latex.php?latex=1+-+x_3%5E2+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1 - x_3^2 &#92;geq 0' title='1 - x_3^2 &#92;geq 0' class='latex' /></p>
<p>which define the <img src='http://s0.wp.com/latex.php?latex=3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='3' title='3' class='latex' />-dimensional cube <img src='http://s0.wp.com/latex.php?latex=%5B-1%2C1%5D%5E3+%5Csubset+%5Cmathbb%7BR%7D%5E3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='[-1,1]^3 &#92;subset &#92;mathbb{R}^3' title='[-1,1]^3 &#92;subset &#92;mathbb{R}^3' class='latex' />. The 3rd order principal minor (i.e., the determinant) yields the inequality</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=1+%2B+2+x_1+x_2+x_3+-+%28x_1%5E2+%2B+x_2%5E2+%2B+x_3%5E3%29+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1 + 2 x_1 x_2 x_3 - (x_1^2 + x_2^2 + x_3^3) &#92;geq 0' title='1 + 2 x_1 x_2 x_3 - (x_1^2 + x_2^2 + x_3^3) &#92;geq 0' class='latex' />.</p>
<p>We can thus conclude that <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /> is a basic closed <a href="http://en.wikipedia.org/wiki/Semialgebraic_set" target="_blank">semialgebraic set</a>.</p>
<p style="text-align:center;">__________</p>
<p><strong>Deciding the convexity of</strong> <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /></p>
<p>In my <a href="http://stochastix.wordpress.com/2012/06/16/deciding-the-convexity-of-semialgebraic-sets/" target="_blank">last post</a>, I used <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a> to decide the convexity of two semialgebraic sets in <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5E2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}^2' title='&#92;mathbb{R}^2' class='latex' />. Let us now decide the convexity of <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' />, which is of higher &#8220;complexity&#8221; than the sets I considered last time. What is the goal? The goal is to find out whether <a href="http://redlog.dolzmann.de/" target="_blank">REDLOG</a> can decide the convexity of <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' /> in less than 10 minutes.</p>
<p>Based on the scripts in my <a href="http://stochastix.wordpress.com/2012/06/16/deciding-the-convexity-of-semialgebraic-sets/" target="_blank">previous post</a>, we write the following <a href="http://redlog.dolzmann.de/" target="_blank">REDUCE + REDLOG</a> script to decide the convexity of <img src='http://s0.wp.com/latex.php?latex=E_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E_3' title='E_3' class='latex' />:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% decide the convexity of the elliptope E3

load_package redlog;
rlset ofsf;

% define predicates in antecedent
p1 := (1-x1^2&#62;=0) and (1-x2^2&#62;=0) and (1-x3^2&#62;=0) and 
      (1-x1^2-x2^2-x3^2+2*x1*x2*x3&#62;=0);
p2 := (1-y1^2&#62;=0) and (1-y2^2&#62;=0) and (1-y3^2&#62;=0) and 
      (1-y1^2-y2^2-y3^2+2*y1*y2*y3&#62;=0);
p3 := (theta&#62;=0) and (theta&#60;=1);

% define predicate in the consequent
z1 := theta*x1+(1-theta)*y1;
z2 := theta*x2+(1-theta)*y2;
q  := (1-z1^2&#62;=0) and (1-z2^2&#62;=0) and (1-z3^2&#62;=0) and 
      (1-z1^2-z2^2-z3^2+2*z1*z2*z3&#62;=0);

% define universal formula
phi := all({x1,x2,x3,y1,y2,y3,theta}, (p1 and p2 and p3) impl q);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>After <strong>30 minutes</strong> (!!!) waiting for the decision procedure to terminate, I killed the <em>reduce.exe</em> process (which was eating all my machine&#8217;s CPU cycles and RAM memory). This is disappointing&#8230;</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding the convexity of semialgebraic sets]]></title>
<link>http://stochastix.wordpress.com/2012/06/16/deciding-the-convexity-of-semialgebraic-sets/</link>
<pubDate>Sun, 17 Jun 2012 05:01:04 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/06/16/deciding-the-convexity-of-semialgebraic-sets/</guid>
<description><![CDATA[Given a basic closed semialgebraic set [1], , defined by where and , how can one decide if set is co]]></description>
<content:encoded><![CDATA[<p>Given a basic closed <a href="http://en.wikipedia.org/wiki/Semialgebraic_set" target="_blank">semialgebraic set</a> [1], <img src='http://s0.wp.com/latex.php?latex=S+%5Csubset+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S &#92;subset &#92;mathbb{R}^n' title='S &#92;subset &#92;mathbb{R}^n' class='latex' />, defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=S+%3D+%5C%7B+x+%5Cin+%5Cmathbb%7BR%7D%5En+%5Cmid+g_1+%28x%29+%5Cgeq+0+%5Cland+%5Cdots+%5Cland+g_m+%28x%29+%5Cgeq+0%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S = &#92;{ x &#92;in &#92;mathbb{R}^n &#92;mid g_1 (x) &#92;geq 0 &#92;land &#92;dots &#92;land g_m (x) &#92;geq 0&#92;}' title='S = &#92;{ x &#92;in &#92;mathbb{R}^n &#92;mid g_1 (x) &#92;geq 0 &#92;land &#92;dots &#92;land g_m (x) &#92;geq 0&#92;}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=m+%5Cin+%5Cmathbb%7BN%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='m &#92;in &#92;mathbb{N}' title='m &#92;in &#92;mathbb{N}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=g_1%2C+%5Cdots%2C+g_m+%5Cin+%5Cmathbb%7BR%7D%5Bx%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g_1, &#92;dots, g_m &#92;in &#92;mathbb{R}[x]' title='g_1, &#92;dots, g_m &#92;in &#92;mathbb{R}[x]' class='latex' />, how can one decide if set <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Convex_set" target="_blank">convex</a>? Can one use <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a>?</p>
<p style="text-align:center;">__________</p>
<p><strong>Convexity</strong></p>
<p>Let us recall the definition of convexity [2]:</p>
<p style="padding-left:30px;"><span style="text-decoration:underline;">Definition</span>: A set <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is <em>convex</em> if the line segment between any two points in <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> lies in <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' />, <em>i.e.</em>, if for any <img src='http://s0.wp.com/latex.php?latex=x%2C+y+%5Cin+S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x, y &#92;in S' title='x, y &#92;in S' class='latex' /> and any <img src='http://s0.wp.com/latex.php?latex=%5Ctheta&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;theta' title='&#92;theta' class='latex' /> with <img src='http://s0.wp.com/latex.php?latex=0+%5Cleq+%5Ctheta+%5Cleq+1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='0 &#92;leq &#92;theta &#92;leq 1' title='0 &#92;leq &#92;theta &#92;leq 1' class='latex' />, we have <img src='http://s0.wp.com/latex.php?latex=%5Ctheta+x+%2B+%281-%5Ctheta%29+y+%5Cin+S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;theta x + (1-&#92;theta) y &#92;in S' title='&#92;theta x + (1-&#92;theta) y &#92;in S' class='latex' />.</p>
<p>Let us introduce a <a href="http://en.wikipedia.org/wiki/Predicate_%28mathematical_logic%29" target="_blank">predicate</a> <img src='http://s0.wp.com/latex.php?latex=p+%3A+%5Cmathbb%7BR%7D%5En+%5Cto+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='p : &#92;mathbb{R}^n &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' title='p : &#92;mathbb{R}^n &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' class='latex' />, defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle+p+%28x%29+%3D+%5Cbigwedge_%7Bi+%3D+1%7D%5Em+g_i+%28x%29+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;displaystyle p (x) = &#92;bigwedge_{i = 1}^m g_i (x) &#92;geq 0' title='&#92;displaystyle p (x) = &#92;bigwedge_{i = 1}^m g_i (x) &#92;geq 0' class='latex' /></p>
<p>so that we can write <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> in the more parsimonious form</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=S+%3D+%5C%7B+x+%5Cin+%5Cmathbb%7BR%7D%5En+%5Cmid+p+%28x%29+%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S = &#92;{ x &#92;in &#92;mathbb{R}^n &#92;mid p (x) &#92;}' title='S = &#92;{ x &#92;in &#92;mathbb{R}^n &#92;mid p (x) &#92;}' class='latex' />.</p>
<p>Hence, writing <img src='http://s0.wp.com/latex.php?latex=x+%5Cin+S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x &#92;in S' title='x &#92;in S' class='latex' /> is equivalent to asserting that <img src='http://s0.wp.com/latex.php?latex=p+%28x%29+%3D+%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='p (x) = &#92;text{True}' title='p (x) = &#92;text{True}' class='latex' />. From the definition above, it follows that set <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is convex if and only if the following universally quantified formula</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+x+%5C%2C+%5Cforall+y+%5C%2C+%5Cforall+%5Ctheta+%5C%2C+%5Cleft%5B+%5C%2C+p%28x%29+%5Cland+p%28y%29+%5Cland+%28%5Ctheta+%5Cgeq+0+%5Cland+%5Ctheta+%5Cleq+1%29+%5Cimplies+p+%28%5Ctheta+x+%2B+%281-%5Ctheta%29+y%29+%5C%2C+%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x &#92;, &#92;forall y &#92;, &#92;forall &#92;theta &#92;, &#92;left[ &#92;, p(x) &#92;land p(y) &#92;land (&#92;theta &#92;geq 0 &#92;land &#92;theta &#92;leq 1) &#92;implies p (&#92;theta x + (1-&#92;theta) y) &#92;, &#92;right]' title='&#92;forall x &#92;, &#92;forall y &#92;, &#92;forall &#92;theta &#92;, &#92;left[ &#92;, p(x) &#92;land p(y) &#92;land (&#92;theta &#92;geq 0 &#92;land &#92;theta &#92;leq 1) &#92;implies p (&#92;theta x + (1-&#92;theta) y) &#92;, &#92;right]' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x%2C+y&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x, y' title='x, y' class='latex' /> range over <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}^n' title='&#92;mathbb{R}^n' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Ctheta&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;theta' title='&#92;theta' class='latex' /> ranges over <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' />, evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. Since <img src='http://s0.wp.com/latex.php?latex=g_1%2C+%5Cdots%2C+g_m&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g_1, &#92;dots, g_m' title='g_1, &#92;dots, g_m' class='latex' /> are polynomials, the formula above can be decided using quantifier elimination software like <a href="http://www.usna.edu/cs/~qepcad/B/QEPCAD.html" target="_blank">QEPCAD</a> or <a href="http://redlog.dolzmann.de/" target="_blank">REDLOG</a>. Unfortunately, <a href="http://en.wikipedia.org/wiki/Decidability_%28logic%29" target="_blank">decidability</a> does not imply that real quantifier elimination will decide the formula in an expedite manner. Let us now consider two instances of the <a href="http://en.wikipedia.org/wiki/Decision_problem" target="_blank">decision problem</a> under study.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example #1</strong></p>
<p>Consider the following semialgebraic set</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=S_1+%3A%3D+%5C%7B+x+%5Cin+%5Cmathbb%7BR%7D%5E2+%5Cmid+x_1+-+x_2%5E2+%2B+3+%5Cgeq+0+%5Cland+-x_1+-+x_2%5E2+%2B+3+%5Cgeq+0%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_1 := &#92;{ x &#92;in &#92;mathbb{R}^2 &#92;mid x_1 - x_2^2 + 3 &#92;geq 0 &#92;land -x_1 - x_2^2 + 3 &#92;geq 0&#92;}' title='S_1 := &#92;{ x &#92;in &#92;mathbb{R}^2 &#92;mid x_1 - x_2^2 + 3 &#92;geq 0 &#92;land -x_1 - x_2^2 + 3 &#92;geq 0&#92;}' class='latex' /></p>
<p>which we <a href="http://www.wolframalpha.com/input/?i=plot+x-y^2%2B3%3E0+and+-x-y^2%2B3%3E0" target="_blank">depict</a> below</p>
<p><a href="http://stochastix.files.wordpress.com/2012/06/plot-x-y23-gt-0-and-x-y23-gt-0.png"><img class="size-full wp-image-8184 aligncenter" title="plot x-y2+3 gt 0 and -x-y2+3 gt 0" src="http://stochastix.files.wordpress.com/2012/06/plot-x-y23-gt-0-and-x-y23-gt-0.png?w=403&#038;h=389" alt="" width="403" height="389" /></a></p>
<p>Visual inspection of the plot above allows us to conclude that set <img src='http://s0.wp.com/latex.php?latex=S_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_1' title='S_1' class='latex' /> is convex. However, relying on the human visual system is extremely limiting. Therefore, we would like to automate the decision. We decide the convexity of <img src='http://s0.wp.com/latex.php?latex=S_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_1' title='S_1' class='latex' /> via <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a> using the following <a href="http://redlog.dolzmann.de/" target="_blank">REDUCE + REDLOG</a> script:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% decide the convexity of a semialgebraic set

load_package redlog;
rlset ofsf;

% define predicates in antecedent
p1 := (x1-x2^2+3&#62;=0) and (-x1-x2^2+3&#62;=0);
p2 := (y1-y2^2+3&#62;=0) and (-y1-y2^2+3&#62;=0);
p3 := (theta&#62;=0) and (theta&#60;=1);

% define predicate in the consequent
z1 := theta*x1+(1-theta)*y1;
z2 := theta*x2+(1-theta)*y2;
q  := (z1-z2^2+3&#62;=0) and (-z1-z2^2+3&#62;=0); 

% define universal formula
phi := all({x1,x2,y1,y2,theta}, (p1 and p2 and p3) impl q);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>This script returns the truth value <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' /> and, hence, <img src='http://s0.wp.com/latex.php?latex=S_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_1' title='S_1' class='latex' /> is, indeed, convex. However, it took REDLOG approximately 60 seconds to decide the convexity of <img src='http://s0.wp.com/latex.php?latex=S_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_1' title='S_1' class='latex' />, which is considerably longer than any of my previous experiments with REDLOG. Since we are performing quantifier elimination on a formula with <em>five</em> universal quantifiers, I am not incredibly surprised that it takes a while to obtain an answer.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example #2</strong></p>
<p><strong></strong>Consider now the following semialgebraic set</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=S_2+%3A%3D+%5C%7B+x+%5Cin+%5Cmathbb%7BR%7D%5E2+%5Cmid+x_1+-+x_2%5E2+%2B+3+%5Cgeq+0+%5Cland+x_1+-+x_2%5E2+%2B+1+%5Cleq+0%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_2 := &#92;{ x &#92;in &#92;mathbb{R}^2 &#92;mid x_1 - x_2^2 + 3 &#92;geq 0 &#92;land x_1 - x_2^2 + 1 &#92;leq 0&#92;}' title='S_2 := &#92;{ x &#92;in &#92;mathbb{R}^2 &#92;mid x_1 - x_2^2 + 3 &#92;geq 0 &#92;land x_1 - x_2^2 + 1 &#92;leq 0&#92;}' class='latex' /></p>
<p>part of which we <a href="http://www.wolframalpha.com/input/?i=plot+x-y^2%2B3%3E0+and+x-y^2%2B1%3C0" target="_blank">depict</a> below</p>
<p><a href="http://stochastix.files.wordpress.com/2012/06/plot-x-y23-gt-0-and-x-y21-lt-0.png"><img class="size-full wp-image-8192 aligncenter" title="plot x-y2+3 gt 0 and x-y2+1 lt 0" src="http://stochastix.files.wordpress.com/2012/06/plot-x-y23-gt-0-and-x-y21-lt-0.png?w=445&#038;h=434" alt="" width="445" height="434" /></a></p>
<p>Visual inspection of the plot above allows us to conclude that set <img src='http://s0.wp.com/latex.php?latex=S_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_2' title='S_2' class='latex' /> is <em>not</em> convex. We decide the convexity of <img src='http://s0.wp.com/latex.php?latex=S_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_2' title='S_2' class='latex' /> using the following <a href="http://redlog.dolzmann.de/" target="_blank">REDUCE + REDLOG</a> script:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% decide the convexity of a semialgebraic set

load_package redlog;
rlset ofsf;

% define predicates in antecedent
p1 := (x1-x2^2+3&#62;=0) and (x1-x2^2+1&#60;=0);
p2 := (y1-y2^2+3&#62;=0) and (y1-y2^2+1&#60;=0);
p3 := (theta&#62;=0) and (theta&#60;=1);

% define predicate in the consequent
z1 := theta*x1+(1-theta)*y1;
z2 := theta*x2+(1-theta)*y2;
q  := (z1-z2^2+3&#62;=0) and (z1-z2^2+1&#60;=0); 

% define universal formula
phi := all({x1,x2,y1,y2,theta}, (p1 and p2 and p3) impl q);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>This script returns the truth value <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BFalse%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{False}' title='&#92;text{False}' class='latex' /> and, hence, <img src='http://s0.wp.com/latex.php?latex=S_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_2' title='S_2' class='latex' /> is, indeed, not convex. Interestingly, it took REDLOG less than one second to decide the formula. That is over two orders of magnitude faster than in example #1.</p>
<p style="text-align:center;">__________</p>
<p><strong>References</strong></p>
<p style="padding-left:30px;">[1] Markus Schweighofer, <a href="http://www.math.uni-konstanz.de/~schweigh/presentations/dcssblmi.pdf" target="_blank"><em>Describing convex semialgebraic sets by linear matrix inequalities</em></a>, International Symposium on Symbolic and Algebraic Computation, Korea Institute for Advanced Study, Seoul, July 2009.</p>
<p style="padding-left:30px;">[2] Stephen Boyd, Lieven Vandenberghe, <em><a href="http://www.stanford.edu/~boyd/cvxbook/" target="_blank">Convex Optimization</a></em>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding the bijectivity of finite functions]]></title>
<link>http://stochastix.wordpress.com/2012/03/31/deciding-the-bijectivity-of-finite-functions/</link>
<pubDate>Sun, 01 Apr 2012 03:52:13 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/03/31/deciding-the-bijectivity-of-finite-functions/</guid>
<description><![CDATA[Consider a function . Function is bijective if and only if it is both injective and surjective. We s]]></description>
<content:encoded><![CDATA[<p>Consider a function <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' title='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' class='latex' />. Function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Bijection" target="_blank">bijective</a> if and only if it is both <a href="http://en.wikipedia.org/wiki/Injective_function" target="_blank">injective</a> and <a href="http://en.wikipedia.org/wiki/Surjective_function" target="_blank">surjective</a>. We say that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is a <em>finite function</em> if and only if both <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' /> are <a href="http://en.wikipedia.org/wiki/Finite_set" target="_blank">finite sets</a>.</p>
<p>In this post, we will restrict our attention to finite functions. For finite functions, we already know how to decide <a href="http://stochastix.wordpress.com/2012/03/07/deciding-the-injectivity-of-finite-functions/" target="_blank">injectivity</a> and <a href="http://stochastix.wordpress.com/2012/03/19/deciding-the-surjectivity-of-finite-functions/" target="_blank">surjectivity</a>. Hence, deciding the bijectivity of finite functions is now trivial. In Haskell, we create the following three predicates:</p>
<pre style="padding-left:30px;background:#EEEEEE;">isInjective :: (Eq a, Eq b) =&#62; (a -&#62; b) -&#62; [a] -&#62; Bool
isInjective f xs = all phi [(x1,x2) &#124; x1 &#60;- xs, x2 &#60;- xs]
                   where phi (x1,x2) = (f x1 /= f x2) &#124;&#124; (x1 == x2)

isSurjective :: Eq b =&#62; (a -&#62; b) -&#62; [a] -&#62; [b] -&#62; Bool
isSurjective f xs ys = all psi ys
                       where psi y = or [(f x == y) &#124; x &#60;- xs]

isBijective :: (Eq a, Eq b) =&#62; (a -&#62; b) -&#62; [a] -&#62; [b] -&#62; Bool
isBijective f xs ys = (isInjective f xs) &#38;&#38; (isSurjective f xs ys)</pre>
<p>Note that predicate <em>isInjective</em> takes as inputs a function and a list (the domain), whereas predicate <em>isSurjective</em> takes as inputs a function and two lists (the domain and the codomain). Both return either <em>True</em> or <em>False</em>. Predicate <em>isBijective</em> is defined using the conjunction of the other two predicates. In this implementation, we separated the decision procedure from the definition of <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' />.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example #1</strong></p>
<p>Let us define <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BZ%7D_4+%3A%3D+%5C%7B0%2C+1%2C+2%2C+3%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' title='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' class='latex' />. Consider the finite function</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+f+%3A+%5Cmathbb%7BZ%7D_4+%26%2338%3B%5Cto+%5Cmathbb%7BZ%7D_4%5C%5C+n+%26%2338%3B%5Cmapsto+3+n+%5Cpmod%7B4%7D%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' title='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=%5Cpmod%7B4%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;pmod{4}' title='&#92;pmod{4}' class='latex' /> denotes <a href="http://en.wikipedia.org/wiki/Modular_arithmetic" target="_blank">modulo 4 arithmetic</a>. We know that this function is both <a href="http://stochastix.wordpress.com/2012/03/07/deciding-the-injectivity-of-finite-functions/" target="_blank">injective</a> and <a href="http://stochastix.wordpress.com/2012/03/19/deciding-the-surjectivity-of-finite-functions/" target="_blank">surjective</a>. Hence, it is bijective. Here&#8217;s a GHCi session (after running the Haskell script above):</p>
<pre style="padding-left:30px;background:#FFFFFF;">*Main&#62; let f n = (3 * n) `mod` 4
*Main&#62; isInjective f [0..3]
True
*Main&#62; isSurjective f [0..3] [0..3]
True
*Main&#62; isBijective f [0..3] [0..3]
True</pre>
<p style="text-align:center;">__________</p>
<p><strong>Example #2</strong></p>
<p>Consider now the following finite function</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+g+%3A+%5Cmathbb%7BZ%7D_4+%26%2338%3B%5Cto+%5Cmathbb%7BZ%7D_4%5C%5C+n+%26%2338%3B%5Cmapsto+2+n+%5Cpmod%7B4%7D%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} g : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 2 n &#92;pmod{4}&#92;end{array}' title='&#92;begin{array}{rl} g : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 2 n &#92;pmod{4}&#92;end{array}' class='latex' /></p>
<p>We already <a href="http://stochastix.wordpress.com/2012/03/19/deciding-the-surjectivity-of-finite-functions/" target="_blank">know</a> that function <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g' title='g' class='latex' /> is neither injective nor surjective. Hence, it is not bijective. Here&#8217;s a GHCi session:</p>
<pre style="padding-left:30px;background:#FFFFFF;">*Main&#62; let g n = (2 * n) `mod` 4
*Main&#62; isInjective g [0..3]
False
*Main&#62; isSurjective g [0..3] [0..3]
False
*Main&#62; isBijective g [0..3] [0..3]
False</pre>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding the surjectivity of finite functions]]></title>
<link>http://stochastix.wordpress.com/2012/03/19/deciding-the-surjectivity-of-finite-functions/</link>
<pubDate>Mon, 19 Mar 2012 09:31:32 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/03/19/deciding-the-surjectivity-of-finite-functions/</guid>
<description><![CDATA[Consider a function . We say that is a finite function if and only if both and are finite sets. As m]]></description>
<content:encoded><![CDATA[<p>Consider a function <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' title='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' class='latex' />. We say that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is a <em>finite function</em> if and only if both <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' /> are <a href="http://en.wikipedia.org/wiki/Finite_set" target="_blank">finite sets</a>. As <a href="http://stochastix.wordpress.com/2012/03/04/deciding-surjectivity/" target="_blank">mentioned</a> two weeks ago, function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Surjective_function" target="_blank">surjective</a> if and only if</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5Cexists+x+%5Cleft%28+f+%28x%29+%3D+y+%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;exists x &#92;left( f (x) = y &#92;right)' title='&#92;forall y &#92;exists x &#92;left( f (x) = y &#92;right)' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x' title='x' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=y&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='y' title='y' class='latex' /> range over sets <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' />, respectively. We now introduce the surjectivity <a href="http://en.wikipedia.org/wiki/Predicate_%28mathematical_logic%29" target="_blank">predicate</a> <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%3A+%5Cmathcal%7BX%7D+%5Ctimes+%5Cmathcal%7BY%7D+%5Cto+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi : &#92;mathcal{X} &#92;times &#92;mathcal{Y} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' title='&#92;varphi : &#92;mathcal{X} &#92;times &#92;mathcal{Y} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' class='latex' />, defined by <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x%2C+y%29+%3D%5Cleft%28+f+%28x%29+%3D+y%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x, y) =&#92;left( f (x) = y&#92;right)' title='&#92;varphi (x, y) =&#92;left( f (x) = y&#92;right)' class='latex' /> so that function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Surjective_function" target="_blank">surjective</a> if and only if <img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5Cexists+x+%5C%2C+%5Cvarphi+%28x%2C+y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' title='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' class='latex' /> evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />.</p>
<p>Let <img src='http://s0.wp.com/latex.php?latex=m+%3A%3D+%26%23124%3B%5Cmathcal%7BX%7D%26%23124%3B&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='m := &#124;&#92;mathcal{X}&#124;' title='m := &#124;&#92;mathcal{X}&#124;' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=n+%3A%3D+%26%23124%3B%5Cmathcal%7BY%7D%26%23124%3B&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n := &#124;&#92;mathcal{Y}&#124;' title='n := &#124;&#92;mathcal{Y}&#124;' class='latex' /> denote the <a href="http://en.wikipedia.org/wiki/Cardinality" target="_blank">cardinalities</a> of sets <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' />, respectively. Deciding <img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5Cexists+x+%5C%2C+%5Cvarphi+%28x%2C+y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' title='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' class='latex' /> should then require a total of <img src='http://s0.wp.com/latex.php?latex=m+n&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='m n' title='m n' class='latex' /> evaluations of predicate <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi' title='&#92;varphi' class='latex' />. Let us write <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D+%3D+%5C%7Bx_1%2C+x_2%2C+%5Cdots%2C+x_m%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X} = &#92;{x_1, x_2, &#92;dots, x_m&#92;}' title='&#92;mathcal{X} = &#92;{x_1, x_2, &#92;dots, x_m&#92;}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D+%3D+%5C%7By_1%2C+y_2%2C+%5Cdots%2C+y_n%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y} = &#92;{y_1, y_2, &#92;dots, y_n&#92;}' title='&#92;mathcal{Y} = &#92;{y_1, y_2, &#92;dots, y_n&#92;}' class='latex' />, and introduce <img src='http://s0.wp.com/latex.php?latex=%5CPhi+%5Cin+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D%5E%7Bm+%5Ctimes+n%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi &#92;in &#92;{&#92;text{True}, &#92;text{False}&#92;}^{m &#92;times n}' title='&#92;Phi &#92;in &#92;{&#92;text{True}, &#92;text{False}&#92;}^{m &#92;times n}' class='latex' />, a Boolean matrix defined as follows</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5CPhi+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bcccc%7D+%5Cvarphi+%28x_1%2Cy_1%29+%26%2338%3B+%5Cvarphi+%28x_1%2Cy_2%29+%26%2338%3B+%5Cldots+%26%2338%3B+%5Cvarphi+%28x_1%2Cy_n%29%5C%5C+%5Cvarphi+%28x_2%2Cy_1%29+%26%2338%3B+%5Cvarphi+%28x_2%2Cy_2%29+%26%2338%3B+%5Cldots+%26%2338%3B+%5Cvarphi+%28x_2%2Cy_n%29%5C%5C+%5Cvdots+%26%2338%3B+%5Cvdots+%26%2338%3B+%5Cddots+%26%2338%3B+%5Cvdots%5C%5C+%5Cvarphi+%28x_m%2Cy_1%29+%26%2338%3B+%5Cvarphi+%28x_m%2Cy_2%29+%26%2338%3B+%5Cldots+%26%2338%3B+%5Cvarphi+%28x_m%2Cy_n%29%5C%5C%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi = &#92;left[&#92;begin{array}{cccc} &#92;varphi (x_1,y_1) &amp; &#92;varphi (x_1,y_2) &amp; &#92;ldots &amp; &#92;varphi (x_1,y_n)&#92;&#92; &#92;varphi (x_2,y_1) &amp; &#92;varphi (x_2,y_2) &amp; &#92;ldots &amp; &#92;varphi (x_2,y_n)&#92;&#92; &#92;vdots &amp; &#92;vdots &amp; &#92;ddots &amp; &#92;vdots&#92;&#92; &#92;varphi (x_m,y_1) &amp; &#92;varphi (x_m,y_2) &amp; &#92;ldots &amp; &#92;varphi (x_m,y_n)&#92;&#92;&#92;end{array}&#92;right]' title='&#92;Phi = &#92;left[&#92;begin{array}{cccc} &#92;varphi (x_1,y_1) &amp; &#92;varphi (x_1,y_2) &amp; &#92;ldots &amp; &#92;varphi (x_1,y_n)&#92;&#92; &#92;varphi (x_2,y_1) &amp; &#92;varphi (x_2,y_2) &amp; &#92;ldots &amp; &#92;varphi (x_2,y_n)&#92;&#92; &#92;vdots &amp; &#92;vdots &amp; &#92;ddots &amp; &#92;vdots&#92;&#92; &#92;varphi (x_m,y_1) &amp; &#92;varphi (x_m,y_2) &amp; &#92;ldots &amp; &#92;varphi (x_m,y_n)&#92;&#92;&#92;end{array}&#92;right]' class='latex' /></p>
<p>Stating that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is surjective, i.e., <img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5Cexists+x+%5C%2C+%5Cvarphi+%28x%2C+y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' title='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' class='latex' /> evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />, is equivalent to saying that every column of matrix <img src='http://s0.wp.com/latex.php?latex=%5CPhi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi' title='&#92;Phi' class='latex' /> contains at least one entry that evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. We now introduce a new predicate, <img src='http://s0.wp.com/latex.php?latex=%5Cpsi+%3A+%5Cmathcal%7BY%7D+%5Cto+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;psi : &#92;mathcal{Y} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' title='&#92;psi : &#92;mathcal{Y} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' class='latex' />, defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cpsi+%28y%29+%3D+%5Cexists+x+%5C%2C+%5Cvarphi+%28x%2Cy%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;psi (y) = &#92;exists x &#92;, &#92;varphi (x,y)' title='&#92;psi (y) = &#92;exists x &#92;, &#92;varphi (x,y)' class='latex' /></p>
<p>so that <img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5Cexists+x+%5C%2C+%5Cvarphi+%28x%2C+y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' title='&#92;forall y &#92;exists x &#92;, &#92;varphi (x, y)' class='latex' /> can be rewritten in the form <img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5C%2C+%5Cpsi+%28y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;, &#92;psi (y)' title='&#92;forall y &#92;, &#92;psi (y)' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=y&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='y' title='y' class='latex' /> ranges over set <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' />. Note that <img src='http://s0.wp.com/latex.php?latex=%5Cpsi+%28y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;psi (y)' title='&#92;psi (y)' class='latex' /> can be viewed as the <a href="http://en.wikipedia.org/wiki/Disjunction" target="_blank">disjunction</a> of the <img src='http://s0.wp.com/latex.php?latex=m&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='m' title='m' class='latex' /> atoms <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x_1%2C+y%29%2C+%5Cvarphi+%28x_2%2C+y%29%2C+%5Cdots%2C+%5Cvarphi+%28x_m%2C+y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x_1, y), &#92;varphi (x_2, y), &#92;dots, &#92;varphi (x_m, y)' title='&#92;varphi (x_1, y), &#92;varphi (x_2, y), &#92;dots, &#92;varphi (x_m, y)' class='latex' />, i.e.,</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cpsi+%28y%29+%3D+%5Cdisplaystyle%5Cbigvee_%7Bi+%3D1%7D%5Em+%5Cvarphi+%28x_i%2C+y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;psi (y) = &#92;displaystyle&#92;bigvee_{i =1}^m &#92;varphi (x_i, y)' title='&#92;psi (y) = &#92;displaystyle&#92;bigvee_{i =1}^m &#92;varphi (x_i, y)' class='latex' />.</p>
<p>Note also that <img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5C%2C+%5Cpsi+%28y%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;, &#92;psi (y)' title='&#92;forall y &#92;, &#92;psi (y)' class='latex' /> can be viewed as the <a href="http://en.wikipedia.org/wiki/Logical_conjunction" target="_blank">conjunction</a> of the <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n' title='n' class='latex' /> atoms <img src='http://s0.wp.com/latex.php?latex=%5Cpsi+%28y_1%29%2C+%5Cpsi+%28y_2%29%2C+%5Cdots%2C+%5Cpsi+%28y_n%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;psi (y_1), &#92;psi (y_2), &#92;dots, &#92;psi (y_n)' title='&#92;psi (y_1), &#92;psi (y_2), &#92;dots, &#92;psi (y_n)' class='latex' />. Thus, we can decide surjectivity using the following procedure:</p>
<ol>
<li>Compute <img src='http://s0.wp.com/latex.php?latex=%5Cpsi+%28y%29+%3D+%5Cexists+x+%5C%2C+%5Cvarphi+%28x%2Cy%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;psi (y) = &#92;exists x &#92;, &#92;varphi (x,y)' title='&#92;psi (y) = &#92;exists x &#92;, &#92;varphi (x,y)' class='latex' /> for all <img src='http://s0.wp.com/latex.php?latex=y+%5Cin+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='y &#92;in &#92;mathcal{Y}' title='y &#92;in &#92;mathcal{Y}' class='latex' />.</li>
<li>Compute the conjunction <img src='http://s0.wp.com/latex.php?latex=%5Cbigwedge_%7Bj%3D1%7D%5En+%5Cpsi+%28y_j%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;bigwedge_{j=1}^n &#92;psi (y_j)' title='&#92;bigwedge_{j=1}^n &#92;psi (y_j)' class='latex' />. If its truth value is <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />, then the function is surjective.</li>
</ol>
<p>Let us now consider two simple examples and implement this decision procedure in <a href="http://en.wikipedia.org/wiki/Haskell_%28programming_language%29" target="_blank">Haskell</a>.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example #1<br />
</strong></p>
<p>Let us define <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BZ%7D_4+%3A%3D+%5C%7B0%2C+1%2C+2%2C+3%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' title='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' class='latex' />. Consider the finite function</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+f+%3A+%5Cmathbb%7BZ%7D_4+%26%2338%3B%5Cto+%5Cmathbb%7BZ%7D_4%5C%5C+n+%26%2338%3B%5Cmapsto+3+n+%5Cpmod%7B4%7D%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' title='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=%5Cpmod%7B4%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;pmod{4}' title='&#92;pmod{4}' class='latex' /> denotes <a href="http://en.wikipedia.org/wiki/Modular_arithmetic" target="_blank">modulo 4 arithmetic</a>. Note that <img src='http://s0.wp.com/latex.php?latex=f+%280%29+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (0) = 0' title='f (0) = 0' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=f+%281%29+%3D+3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (1) = 3' title='f (1) = 3' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=f+%282%29+%3D+2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (2) = 2' title='f (2) = 2' class='latex' />, and <img src='http://s0.wp.com/latex.php?latex=f+%283%29+%3D+1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (3) = 1' title='f (3) = 1' class='latex' />. Hence, we easily conclude that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is both injective and surjective (and, thus, is bijective). In Haskell:</p>
<pre style="padding-left:30px;background:#FFFFFF;">Prelude&#62; let f n = (3 * n) `mod` 4
Prelude&#62; let xs = [0..3]
Prelude&#62; let ys = [0..3]
Prelude&#62; let psi y = or [(f x == y) &#124; x &#60;- xs]
Prelude&#62; all psi ys
True</pre>
<p>which allows us to conclude that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is surjective. Note that we used function <a href="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:or" target="_blank">or</a> to perform disjunction, and function <a href="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:all" target="_blank">all</a> to perform universal quantification.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example #2</strong></p>
<p>Consider now the following finite function</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+g+%3A+%5Cmathbb%7BZ%7D_4+%26%2338%3B%5Cto+%5Cmathbb%7BZ%7D_4%5C%5C+n+%26%2338%3B%5Cmapsto+2+n+%5Cpmod%7B4%7D%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} g : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 2 n &#92;pmod{4}&#92;end{array}' title='&#92;begin{array}{rl} g : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 2 n &#92;pmod{4}&#92;end{array}' class='latex' /></p>
<p>Note that <img src='http://s0.wp.com/latex.php?latex=g+%280%29+%3D+g+%282%29+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g (0) = g (2) = 0' title='g (0) = g (2) = 0' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=g+%281%29+%3D+g+%283%29+%3D+2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g (1) = g (3) = 2' title='g (1) = g (3) = 2' class='latex' />. Hence, function <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g' title='g' class='latex' /> is neither injective nor surjective. In Haskell, we have the following:</p>
<pre style="padding-left:30px;background:#FFFFFF;">Prelude&#62; let g n = (2 * n) `mod` 4
Prelude&#62; let xs = [0..3]
Prelude&#62; let ys = [0..3]
Prelude&#62; let psi y = or [(g x == y) &#124; x &#60;- xs]
Prelude&#62; all psi ys
False</pre>
<p>which allows us to conclude that <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g' title='g' class='latex' /> is <em>not</em> surjective. Why? The following code returns a list of lists of Booleans where each sublist is a column of matrix <img src='http://s0.wp.com/latex.php?latex=%5CPhi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi' title='&#92;Phi' class='latex' /> (where each entry is <img src='http://s0.wp.com/latex.php?latex=%5CPhi_%7Bij%7D+%3D+%28g%28x_i%29+%3D+y_j%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi_{ij} = (g(x_i) = y_j)' title='&#92;Phi_{ij} = (g(x_i) = y_j)' class='latex' />)</p>
<pre style="padding-left:30px;background:#FFFFFF;">Prelude&#62; [[(g x == y) &#124; x &#60;- xs] &#124; y &#60;- ys]
[[True,False,True,False],[False,False,False,False],
[False,True,False,True],[False,False,False,False]]</pre>
<p>Note that the 2nd and 4th sublists contain only <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BFalse%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{False}' title='&#92;text{False}' class='latex' /> truth values. Hence, it is not the case that every column of matrix <img src='http://s0.wp.com/latex.php?latex=%5CPhi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi' title='&#92;Phi' class='latex' /> contains at least one entry that evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. Thus, <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g' title='g' class='latex' /> is not surjective.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding the injectivity of finite functions II]]></title>
<link>http://stochastix.wordpress.com/2012/03/17/deciding-the-injectivity-of-finite-functions-ii/</link>
<pubDate>Sun, 18 Mar 2012 05:37:17 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/03/17/deciding-the-injectivity-of-finite-functions-ii/</guid>
<description><![CDATA[Last week we considered the following finite function where  and denotes modulo 4 arithmetic. We kno]]></description>
<content:encoded><![CDATA[<p>Last week <a href="http://stochastix.wordpress.com/2012/03/07/deciding-the-injectivity-of-finite-functions" target="_blank">we considered</a> the following finite function</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+f+%3A+%5Cmathbb%7BZ%7D_4+%26%2338%3B%5Cto+%5Cmathbb%7BZ%7D_4%5C%5C+n+%26%2338%3B%5Cmapsto+3+n+%5Cpmod%7B4%7D%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' title='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BZ%7D_4+%3A%3D+%5C%7B0%2C+1%2C+2%2C+3%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' title='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cpmod%7B4%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;pmod{4}' title='&#92;pmod{4}' class='latex' /> denotes <a href="http://en.wikipedia.org/wiki/Modular_arithmetic" target="_blank">modulo 4 arithmetic</a>. We <a href="http://stochastix.wordpress.com/2012/02/28/deciding-injectivity" target="_blank">know</a> that function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Injective_function" target="_blank">injective</a> if and only if</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' title='&#92;forall x_1 &#92;forall x_2 &#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1' title='x_1' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=x_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_2' title='x_2' class='latex' /> range over set <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BZ%7D_4&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{Z}_4' title='&#92;mathbb{Z}_4' class='latex' />. We introduce the injectivity <a href="http://en.wikipedia.org/wiki/Predicate_%28mathematical_logic%29" target="_blank">predicate</a> <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%3A+%5Cmathbb%7BZ%7D_4+%5Ctimes+%5Cmathbb%7BZ%7D_4+%5Cto+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi : &#92;mathbb{Z}_4 &#92;times &#92;mathbb{Z}_4 &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' title='&#92;varphi : &#92;mathbb{Z}_4 &#92;times &#92;mathbb{Z}_4 &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' class='latex' />, defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x_1%2C+x_2%29+%3D%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x_1, x_2) =&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' title='&#92;varphi (x_1, x_2) =&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' class='latex' /></p>
<p>so that function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective if and only if the universally-quantified sentence <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />.</p>
<p style="text-align:center;">__________</p>
<p><strong>A naive decision procedure</strong></p>
<p>We can determine the truth value of <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> by evaluating the predicate <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi' title='&#92;varphi' class='latex' /> at all <img src='http://s0.wp.com/latex.php?latex=%28x_1%2C+x_2%29+%5Cin+%5Cmathbb%7BZ%7D_4+%5Ctimes+%5Cmathbb%7BZ%7D_4&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='(x_1, x_2) &#92;in &#92;mathbb{Z}_4 &#92;times &#92;mathbb{Z}_4' title='(x_1, x_2) &#92;in &#92;mathbb{Z}_4 &#92;times &#92;mathbb{Z}_4' class='latex' />, which will require a total of <img src='http://s0.wp.com/latex.php?latex=%26%23124%3B%5Cmathbb%7BZ%7D_4%26%23124%3B%5E2+%3D+4%5E2+%3D+16&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#124;&#92;mathbb{Z}_4&#124;^2 = 4^2 = 16' title='&#124;&#92;mathbb{Z}_4&#124;^2 = 4^2 = 16' class='latex' /> evaluations. We <a href="http://stochastix.wordpress.com/2012/03/07/deciding-the-injectivity-of-finite-functions" target="_blank">implemented</a> this decision procedure in <a href="http://en.wikipedia.org/wiki/Haskell_%28programming_language%29" target="_blank">Haskell</a> last week. Here&#8217;s a rather brief GHCi session:</p>
<pre style="padding-left:30px;background:#FFFFFF;">Prelude&#62; let f n = (3 * n) `mod` 4
Prelude&#62; let phi (x1,x2) = (f x1 /= f x2) &#124;&#124; (x1 == x2)
Prelude&#62; all phi [(x1,x2) &#124; x1 &#60;- [0..3], x2 &#60;- [0..3]]
True</pre>
<p>which allows us to conclude that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective. Note that we used the following equivalence</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29+%5Cequiv+%5Cleft%28+f+%28x_1%29+%5Cneq+f+%28x_2%29+%5Clor+x_1+%3D+x_2%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right) &#92;equiv &#92;left( f (x_1) &#92;neq f (x_2) &#92;lor x_1 = x_2&#92;right)' title='&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right) &#92;equiv &#92;left( f (x_1) &#92;neq f (x_2) &#92;lor x_1 = x_2&#92;right)' class='latex' /></p>
<p>to implement <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi' title='&#92;varphi' class='latex' />. Can we do better than this? In fact, we can.</p>
<p style="text-align:center;">__________</p>
<p><strong>A better decision procedure</strong></p>
<p>We introduce matrix <img src='http://s0.wp.com/latex.php?latex=%5CPhi+%5Cin+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D%5E%7B4+%5Ctimes+4%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi &#92;in &#92;{&#92;text{True}, &#92;text{False}&#92;}^{4 &#92;times 4}' title='&#92;Phi &#92;in &#92;{&#92;text{True}, &#92;text{False}&#92;}^{4 &#92;times 4}' class='latex' />, defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5CPhi+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bcccc%7D+%5Cvarphi+%280%2C0%29+%26%2338%3B+%5Cvarphi+%280%2C1%29+%26%2338%3B+%5Cvarphi+%280%2C2%29+%26%2338%3B+%5Cvarphi+%280%2C3%29%5C%5C+%5Cvarphi+%281%2C0%29+%26%2338%3B+%5Cvarphi+%281%2C1%29+%26%2338%3B+%5Cvarphi+%281%2C2%29+%26%2338%3B+%5Cvarphi+%281%2C3%29%5C%5C+%5Cvarphi+%282%2C0%29+%26%2338%3B+%5Cvarphi+%282%2C1%29+%26%2338%3B+%5Cvarphi+%282%2C2%29+%26%2338%3B+%5Cvarphi+%282%2C3%29%5C%5C+%5Cvarphi+%283%2C0%29+%26%2338%3B+%5Cvarphi+%283%2C1%29+%26%2338%3B+%5Cvarphi+%283%2C2%29+%26%2338%3B+%5Cvarphi+%283%2C3%29%5C%5C%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi = &#92;left[&#92;begin{array}{cccc} &#92;varphi (0,0) &amp; &#92;varphi (0,1) &amp; &#92;varphi (0,2) &amp; &#92;varphi (0,3)&#92;&#92; &#92;varphi (1,0) &amp; &#92;varphi (1,1) &amp; &#92;varphi (1,2) &amp; &#92;varphi (1,3)&#92;&#92; &#92;varphi (2,0) &amp; &#92;varphi (2,1) &amp; &#92;varphi (2,2) &amp; &#92;varphi (2,3)&#92;&#92; &#92;varphi (3,0) &amp; &#92;varphi (3,1) &amp; &#92;varphi (3,2) &amp; &#92;varphi (3,3)&#92;&#92;&#92;end{array}&#92;right]' title='&#92;Phi = &#92;left[&#92;begin{array}{cccc} &#92;varphi (0,0) &amp; &#92;varphi (0,1) &amp; &#92;varphi (0,2) &amp; &#92;varphi (0,3)&#92;&#92; &#92;varphi (1,0) &amp; &#92;varphi (1,1) &amp; &#92;varphi (1,2) &amp; &#92;varphi (1,3)&#92;&#92; &#92;varphi (2,0) &amp; &#92;varphi (2,1) &amp; &#92;varphi (2,2) &amp; &#92;varphi (2,3)&#92;&#92; &#92;varphi (3,0) &amp; &#92;varphi (3,1) &amp; &#92;varphi (3,2) &amp; &#92;varphi (3,3)&#92;&#92;&#92;end{array}&#92;right]' class='latex' /></p>
<p>Stating that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective, i.e., <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />, is equivalent to saying that all the <img src='http://s0.wp.com/latex.php?latex=4%5E2+%3D+16&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='4^2 = 16' title='4^2 = 16' class='latex' /> entries of matrix <img src='http://s0.wp.com/latex.php?latex=%5CPhi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi' title='&#92;Phi' class='latex' /> evaluate to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. Note, however, that the four entries on the main diagonal of <img src='http://s0.wp.com/latex.php?latex=%5CPhi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi' title='&#92;Phi' class='latex' /> will always evaluate to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />, as the implication</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=f+%28x%29+%3D+f+%28x%29+%5Cimplies+x+%3D+x&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (x) = f (x) &#92;implies x = x' title='f (x) = f (x) &#92;implies x = x' class='latex' /></p>
<p>evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' /> for every <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x' title='x' class='latex' />. Moreover, from the equivalence</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29+%5Cequiv+%5Cleft%28+f+%28x_2%29+%3D+f+%28x_1%29+%5Cimplies+x_2+%3D+x_1%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right) &#92;equiv &#92;left( f (x_2) = f (x_1) &#92;implies x_2 = x_1&#92;right)' title='&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right) &#92;equiv &#92;left( f (x_2) = f (x_1) &#92;implies x_2 = x_1&#92;right)' class='latex' /></p>
<p>we can conclude that <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x_1%2C+x_2%29+%3D+%5Cvarphi+%28x_2%2C+x_1%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x_1, x_2) = &#92;varphi (x_2, x_1)' title='&#92;varphi (x_1, x_2) = &#92;varphi (x_2, x_1)' class='latex' /> for all <img src='http://s0.wp.com/latex.php?latex=x_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1' title='x_1' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=x_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_2' title='x_2' class='latex' />, which tells us that matrix <img src='http://s0.wp.com/latex.php?latex=%5CPhi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi' title='&#92;Phi' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Symmetric_matrix" target="_blank">symmetric</a> (i.e., <img src='http://s0.wp.com/latex.php?latex=%5CPhi+%3D+%5CPhi%5ET&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi = &#92;Phi^T' title='&#92;Phi = &#92;Phi^T' class='latex' />). Therefore, we do not need to evaluate all entries of matrix <img src='http://s0.wp.com/latex.php?latex=%5CPhi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;Phi' title='&#92;Phi' class='latex' />, only the ones above the main diagonal, as illustrated below</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cleft%5B%5Cbegin%7Barray%7D%7Bcccc%7D+%5Cast+%26%2338%3B+%5Cvarphi+%280%2C1%29+%26%2338%3B+%5Cvarphi+%280%2C2%29+%26%2338%3B+%5Cvarphi+%280%2C3%29%5C%5C+%5Cast+%26%2338%3B+%5Cast+%26%2338%3B+%5Cvarphi+%281%2C2%29+%26%2338%3B+%5Cvarphi+%281%2C3%29%5C%5C+%5Cast+%26%2338%3B+%5Cast+%26%2338%3B+%5Cast+%26%2338%3B+%5Cvarphi+%282%2C3%29%5C%5C+%5Cast+%26%2338%3B+%5Cast+%26%2338%3B+%5Cast+%26%2338%3B+%5Cast%5C%5C%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;left[&#92;begin{array}{cccc} &#92;ast &amp; &#92;varphi (0,1) &amp; &#92;varphi (0,2) &amp; &#92;varphi (0,3)&#92;&#92; &#92;ast &amp; &#92;ast &amp; &#92;varphi (1,2) &amp; &#92;varphi (1,3)&#92;&#92; &#92;ast &amp; &#92;ast &amp; &#92;ast &amp; &#92;varphi (2,3)&#92;&#92; &#92;ast &amp; &#92;ast &amp; &#92;ast &amp; &#92;ast&#92;&#92;&#92;end{array}&#92;right]' title='&#92;left[&#92;begin{array}{cccc} &#92;ast &amp; &#92;varphi (0,1) &amp; &#92;varphi (0,2) &amp; &#92;varphi (0,3)&#92;&#92; &#92;ast &amp; &#92;ast &amp; &#92;varphi (1,2) &amp; &#92;varphi (1,3)&#92;&#92; &#92;ast &amp; &#92;ast &amp; &#92;ast &amp; &#92;varphi (2,3)&#92;&#92; &#92;ast &amp; &#92;ast &amp; &#92;ast &amp; &#92;ast&#92;&#92;&#92;end{array}&#92;right]' class='latex' /></p>
<p>where the symbol <img src='http://s0.wp.com/latex.php?latex=%5Cast&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;ast' title='&#92;ast' class='latex' /> denotes &#8220;don&#8217;t care&#8221;, i.e., entries we do not need to evaluate. Hence, instead of evaluating the predicate <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi' title='&#92;varphi' class='latex' /> a total of <img src='http://s0.wp.com/latex.php?latex=4%5E2+%3D+16&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='4^2 = 16' title='4^2 = 16' class='latex' /> times, we now only need to evaluate it <img src='http://s0.wp.com/latex.php?latex=%7B4+%5Cchoose+2%7D+%3D+6&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='{4 &#92;choose 2} = 6' title='{4 &#92;choose 2} = 6' class='latex' /> times, which is <img src='http://s0.wp.com/latex.php?latex=37.5+%5C%25&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='37.5 &#92;%' title='37.5 &#92;%' class='latex' /> of the original total. We can generate all pairs <img src='http://s0.wp.com/latex.php?latex=%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='(x_1, x_2)' title='(x_1, x_2)' class='latex' /> with <img src='http://s0.wp.com/latex.php?latex=x_2+%26%2362%3B+x_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_2 &gt; x_1' title='x_2 &gt; x_1' class='latex' /> using the following Haskell code:</p>
<pre style="padding-left:30px;background:#FFFFFF;">Prelude&#62; [(x1,x2) &#124; x1 &#60;- [0..3], x2 &#60;- [(x1+1)..3]]
[(0,1),(0,2),(0,3),(1,2),(1,3),(2,3)]</pre>
<p>We thus implement a more efficient decision procedure as follows:</p>
<pre style="padding-left:30px;background:#FFFFFF;">Prelude&#62; let f n = (3 * n) `mod` 4
Prelude&#62; let phi (x1,x2) = (f x1 /= f x2) &#124;&#124; (x1 == x2)
Prelude&#62; all phi [(x1,x2) &#124; x1 &#60;- [0..3], x2 &#60;- [(x1+1)..3]]
True</pre>
<p>which requires less than half of the number of evaluations required by the previous (naive) procedure.</p>
<p style="text-align:center;">__________</p>
<p><strong>Conclusions</strong></p>
<p>Given a finite function <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' title='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' class='latex' />, we introduce the injectivity predicate <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%3A+%5Cmathcal%7BX%7D+%5Ctimes+%5Cmathcal%7BX%7D+%5Cto+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi : &#92;mathcal{X} &#92;times &#92;mathcal{X} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' title='&#92;varphi : &#92;mathcal{X} &#92;times &#92;mathcal{X} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' class='latex' />, defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x_1%2C+x_2%29+%3D%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x_1, x_2) =&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' title='&#92;varphi (x_1, x_2) =&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' class='latex' /></p>
<p>so that (finite) function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective if and only if <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. Let <img src='http://s0.wp.com/latex.php?latex=n+%3A%3D+%26%23124%3B%5Cmathcal%7BX%7D%26%23124%3B&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n := &#124;&#92;mathcal{X}&#124;' title='n := &#124;&#92;mathcal{X}&#124;' class='latex' /> denote the <a href="http://en.wikipedia.org/wiki/Cardinality" target="_blank">cardinality</a> of set <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' />. Deciding <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> using the naive procedure will require a total of <img src='http://s0.wp.com/latex.php?latex=n%5E2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n^2' title='n^2' class='latex' />  evaluations of the predicate <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi' title='&#92;varphi' class='latex' />. Since <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x%2Cx%29+%3D+%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x,x) = &#92;text{True}' title='&#92;varphi (x,x) = &#92;text{True}' class='latex' /> for every <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x' title='x' class='latex' />, and taking into account that <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x_1%2Cx_2%29+%3D+%5Cvarphi+%28x_2%2Cx_1%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x_1,x_2) = &#92;varphi (x_2,x_1)' title='&#92;varphi (x_1,x_2) = &#92;varphi (x_2,x_1)' class='latex' />, using the improved procedure we can decide injectivity at a cost of only <img src='http://s0.wp.com/latex.php?latex=%7Bn+%5Cchoose+2%7D+%3D+%5Cfrac%7Bn+%28n-1%29%7D%7B2%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='{n &#92;choose 2} = &#92;frac{n (n-1)}{2}' title='{n &#92;choose 2} = &#92;frac{n (n-1)}{2}' class='latex' /> evaluations of the predicate <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi' title='&#92;varphi' class='latex' />. As <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n' title='n' class='latex' /> approaches infinity, the ratio <img src='http://s0.wp.com/latex.php?latex=%7Bn+%5Cchoose+2%7D+%2F+n%5E2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='{n &#92;choose 2} / n^2' title='{n &#92;choose 2} / n^2' class='latex' /> approaches <img src='http://s0.wp.com/latex.php?latex=1%2F2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='1/2' title='1/2' class='latex' />. Hence, for &#8220;large&#8221; problems, the improved procedure will require approximately half the number of evaluations required by the naive procedure.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding the injectivity of finite functions]]></title>
<link>http://stochastix.wordpress.com/2012/03/07/deciding-the-injectivity-of-finite-functions/</link>
<pubDate>Wed, 07 Mar 2012 09:10:01 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/03/07/deciding-the-injectivity-of-finite-functions/</guid>
<description><![CDATA[Consider a function .  We say that is a finite function if and only if both and are finite sets. As]]></description>
<content:encoded><![CDATA[<p>Consider a function <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' title='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' class='latex' />.  We say that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is a <em>finite function</em> if and only if both <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' /> are <a href="http://en.wikipedia.org/wiki/Finite_set" target="_blank">finite sets</a>. As mentioned <a href="http://stochastix.wordpress.com/2012/02/28/deciding-injectivity" target="_blank">last week</a>, function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Injective_function" target="_blank">injective</a> if and only if</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' title='&#92;forall x_1 &#92;forall x_2 &#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1' title='x_1' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=x_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_2' title='x_2' class='latex' /> range over set <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' />. We now introduce the injectivity <a href="http://en.wikipedia.org/wiki/Predicate_%28mathematical_logic%29" target="_blank">predicate</a> <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%3A+%5Cmathcal%7BX%7D+%5Ctimes+%5Cmathcal%7BX%7D+%5Cto+%5C%7B%5Ctext%7BTrue%7D%2C+%5Ctext%7BFalse%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi : &#92;mathcal{X} &#92;times &#92;mathcal{X} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' title='&#92;varphi : &#92;mathcal{X} &#92;times &#92;mathcal{X} &#92;to &#92;{&#92;text{True}, &#92;text{False}&#92;}' class='latex' />, defined by</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cvarphi+%28x_1%2C+x_2%29+%3D%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi (x_1, x_2) =&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' title='&#92;varphi (x_1, x_2) =&#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' class='latex' /></p>
<p>so that function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Injective_function" target="_blank">injective</a> if and only if <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> is true. In this post we will restrict our attention to finite functions, for which it is fairly straightforward to devise a decision procedure to decide injectivity. Let <img src='http://s0.wp.com/latex.php?latex=n+%3A%3D+%26%23124%3B%5Cmathcal%7BX%7D%26%23124%3B&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n := &#124;&#92;mathcal{X}&#124;' title='n := &#124;&#92;mathcal{X}&#124;' class='latex' /> denote the <a href="http://en.wikipedia.org/wiki/Cardinality" target="_blank">cardinality</a> of set <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' />. Then, determining the truth value of <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> will require a total of <img src='http://s0.wp.com/latex.php?latex=n%5E2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n^2' title='n^2' class='latex' />  evaluations of the predicate <img src='http://s0.wp.com/latex.php?latex=%5Cvarphi&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;varphi' title='&#92;varphi' class='latex' />.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example</strong></p>
<p>Let us define <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BZ%7D_4+%3A%3D+%5C%7B0%2C+1%2C+2%2C+3%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' title='&#92;mathbb{Z}_4 := &#92;{0, 1, 2, 3&#92;}' class='latex' />. Consider the finite function</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+f+%3A+%5Cmathbb%7BZ%7D_4+%26%2338%3B%5Cto+%5Cmathbb%7BZ%7D_4%5C%5C+n+%26%2338%3B%5Cmapsto+3+n+%5Cpmod%7B4%7D%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' title='&#92;begin{array}{rl} f : &#92;mathbb{Z}_4 &amp;&#92;to &#92;mathbb{Z}_4&#92;&#92; n &amp;&#92;mapsto 3 n &#92;pmod{4}&#92;end{array}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=%5Cpmod%7B4%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;pmod{4}' title='&#92;pmod{4}' class='latex' /> denotes <a href="http://en.wikipedia.org/wiki/Modular_arithmetic" target="_blank">modulo 4 arithmetic</a>. Is <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> injective? Note that <img src='http://s0.wp.com/latex.php?latex=f+%280%29+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (0) = 0' title='f (0) = 0' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=f+%281%29+%3D+3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (1) = 3' title='f (1) = 3' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=f+%282%29+%3D+2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (2) = 2' title='f (2) = 2' class='latex' />, and <img src='http://s0.wp.com/latex.php?latex=f+%283%29+%3D+1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (3) = 1' title='f (3) = 1' class='latex' />. Hence, we easily conclude that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective. Suppose that we do not want to enumerate the images of the elements of <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BZ%7D_4&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{Z}_4' title='&#92;mathbb{Z}_4' class='latex' /> under <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' />; in that case, we can use the following <a href="http://en.wikipedia.org/wiki/Haskell_%28programming_language%29" target="_blank">Haskell</a> script to decide that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective:</p>
<pre style="padding-left:30px;background:#EEEEEE;">-- define function f
f :: Integral a =&#62; a -&#62; a
f n = (3 * n) `mod` 4 

-- define disjunction
(\/) :: Bool -&#62; Bool -&#62; Bool
p \/ q = p &#124;&#124; q

-- define implication
(==&#62;) :: Bool -&#62; Bool -&#62; Bool
p ==&#62; q = (not p) \/ q

-- define injectivity predicate
phi :: Integral a =&#62; (a,a) -&#62; Bool
phi (x1,x2) = (f x1 == f x2) ==&#62; (x1 == x2)</pre>
<p>where we used the fact that <img src='http://s0.wp.com/latex.php?latex=p+%5Cimplies+q&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='p &#92;implies q' title='p &#92;implies q' class='latex' /> is <em>semantically</em> equivalent to <img src='http://s0.wp.com/latex.php?latex=%5Cneg+p+%5Clor+q&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;neg p &#92;lor q' title='&#92;neg p &#92;lor q' class='latex' />. Let us carry out some testing:</p>
<pre style="padding-left:30px;background:#FFFFFF;">*Main&#62; -- test function f
*Main&#62; [ f n &#124; n &#60;- [0..3]]
[0,3,2,1]
*Main&#62; -- test disjunction
*Main&#62; [ p \/ q &#124; p &#60;-[True, False], q &#60;- [True, False]]
[True,True,True,False]
*Main&#62; -- test implication
*Main&#62; [ p ==&#62; q &#124; p &#60;-[True, False], q &#60;- [True, False]]
[True,False,True,True]</pre>
<p>So far, so good. Finally, we can determine the truth value of the sentence <img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5C%2C+%5Cvarphi+%28x_1%2C+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' title='&#92;forall x_1 &#92;forall x_2 &#92;, &#92;varphi (x_1, x_2)' class='latex' /> using function <a href="http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#v:all" target="_blank">all</a>, as follows:</p>
<pre style="padding-left:30px;background:#FFFFFF;">*Main&#62; all phi [(x1,x2) &#124; x1 &#60;- [0..3], x2 &#60;- [0..3]]
True</pre>
<p>which allows us to conclude that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective.</p>
<p>An alternative procedure would be to use function <a href="http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Data-List.html#v%3Anub" target="_blank">nub</a> from library <a href="http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Data-List.html" target="_blank">Data.List</a> to remove duplicates from a given list. Note that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is injective if and only if the list of the images of the elements of <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BZ%7D_4&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{Z}_4' title='&#92;mathbb{Z}_4' class='latex' /> under <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> contains no duplicates. Hence, we obtain:</p>
<pre style="padding-left:30px;background:#FFFFFF;">*Main&#62; let images = [ f n &#124; n &#60;- [0..3]]
*Main&#62; import Data.List
*Main Data.List&#62; length (nub images) == length images
True</pre>
<p>What a hack! This second procedure might seem much terser than the first one. But if we do away with type declarations and refrain from re-defining disjunction and defining implication, the first procedure can be made quite succinct as well:</p>
<pre style="padding-left:30px;background:#FFFFFF;">Prelude&#62; let f n = (3 * n) `mod` 4
Prelude&#62; let phi (x1,x2) = not (f x1 == f x2) &#124;&#124; (x1 == x2)
Prelude&#62; all phi [(x1,x2) &#124; x1 &#60;- [0..3], x2 &#60;- [0..3]]
True</pre>
<p>which includes the definition of function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' />. Three lines only! Three!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding surjectivity]]></title>
<link>http://stochastix.wordpress.com/2012/03/04/deciding-surjectivity/</link>
<pubDate>Mon, 05 Mar 2012 07:52:38 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/03/04/deciding-surjectivity/</guid>
<description><![CDATA[Consider a function . We say that is surjective [1] if and only if for all there exists a with . Mor]]></description>
<content:encoded><![CDATA[<p>Consider a function <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' title='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' class='latex' />. We say that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Surjective_function" target="_blank">surjective</a> [1] if and only if for all <img src='http://s0.wp.com/latex.php?latex=y+%5Cin+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='y &#92;in &#92;mathcal{Y}' title='y &#92;in &#92;mathcal{Y}' class='latex' /> there exists a <img src='http://s0.wp.com/latex.php?latex=x+%5Cin+%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x &#92;in &#92;mathcal{X}' title='x &#92;in &#92;mathcal{X}' class='latex' /> with <img src='http://s0.wp.com/latex.php?latex=f+%28x%29+%3D+y&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (x) = y' title='f (x) = y' class='latex' />. More formally, <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Surjective_function" target="_blank">surjective</a> if and only if</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+y+%5Cexists+x+%5Cleft%28+f+%28x%29+%3D+y+%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall y &#92;exists x &#92;left( f (x) = y &#92;right)' title='&#92;forall y &#92;exists x &#92;left( f (x) = y &#92;right)' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x' title='x' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=y&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='y' title='y' class='latex' /> range over sets <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' />, respectively. Equivalently, <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Surjective_function" target="_blank">surjective</a> if and only if the image of <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' /> under <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{Y}' title='&#92;mathcal{Y}' class='latex' /> itself.</p>
<p>In this post, we will restrict our attention to functions from <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' /> to <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' />. For polynomial functions from reals to reals, we can use <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a> to determine the truth values of the quantified formula above, thus deciding surjectivity.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example</strong></p>
<p>We would like to decide the surjectivity of the following functions</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+f+%3A+%5Cmathbb%7BR%7D+%26%2338%3B%5Cto+%5Cmathbb%7BR%7D%5C%5C+x+%26%2338%3B%5Cmapsto+x%5E2%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} f : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^2&#92;end{array}' title='&#92;begin{array}{rl} f : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^2&#92;end{array}' class='latex' />                 <img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+g+%3A+%5Cmathbb%7BR%7D+%26%2338%3B%5Cto+%5Cmathbb%7BR%7D%5C%5C+x+%26%2338%3B%5Cmapsto+x%5E3%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} g : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^3&#92;end{array}' title='&#92;begin{array}{rl} g : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^3&#92;end{array}' class='latex' /></p>
<p>Instead of using the <a href="http://en.wikipedia.org/wiki/Horizontal_line_test" target="_blank">horizontal line test</a> to determine whether these functions are surjective, we use the <a href="http://redlog.dolzmann.de" target="_blank">REDUCE + REDLOG</a> script:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% decide the surjectivity of f(x) = x^2 and g(x) = x^3

load_package redlog;
rlset ofsf;

% define quantified formulas
phi := all(y, ex(x, x**2=y));
psi := all(y, ex(x, x**3=y));

% perform quantifier elimination
rlqe phi;
rlqe psi;

end;</pre>
<p>which decides that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <em>not</em> surjective and that <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g' title='g' class='latex' /> is surjective.</p>
<p style="text-align:center;">__________</p>
<p><strong>References</strong></p>
<p style="padding-left:30px;">[1] David Makinson, <a href="http://books.google.com/books?id=hm9OAiHC2vcC" target="_blank"><em>Sets, Logic and Maths for Computing</em></a>, Springer, 2008.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding injectivity  ]]></title>
<link>http://stochastix.wordpress.com/2012/02/28/deciding-injectivity/</link>
<pubDate>Tue, 28 Feb 2012 15:39:54 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/02/28/deciding-injectivity/</guid>
<description><![CDATA[Consider a function . We say that is injective if and only if it maps distinct inputs to distinct ou]]></description>
<content:encoded><![CDATA[<p>Consider a function <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' title='f : &#92;mathcal{X} &#92;to &#92;mathcal{Y}' class='latex' />. We say that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Injective_function" target="_blank">injective</a> if and only if it maps distinct inputs to distinct outputs [1]. More formally, <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Injective_function" target="_blank">injective</a> if and only if</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5Cleft%28+x_1+%5Cneq+x_2+%5Cimplies+f+%28x_1%29+%5Cneq+f+%28x_2%29%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;left( x_1 &#92;neq x_2 &#92;implies f (x_1) &#92;neq f (x_2)&#92;right)' title='&#92;forall x_1 &#92;forall x_2 &#92;left( x_1 &#92;neq x_2 &#92;implies f (x_1) &#92;neq f (x_2)&#92;right)' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1' title='x_1' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=x_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_2' title='x_2' class='latex' /> range over set <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BX%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{X}' title='&#92;mathcal{X}' class='latex' />. Note that the inequations <img src='http://s0.wp.com/latex.php?latex=x_1+%5Cneq+x_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1 &#92;neq x_2' title='x_1 &#92;neq x_2' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=f+%28x_1%29+%5Cneq+f+%28x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (x_1) &#92;neq f (x_2)' title='f (x_1) &#92;neq f (x_2)' class='latex' /> are equivalent to <img src='http://s0.wp.com/latex.php?latex=%5Cneg+%28x_1+%3D+x_2%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;neg (x_1 = x_2)' title='&#92;neg (x_1 = x_2)' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cneg+%5Cleft%28f+%28x_1%29+%3D+f+%28x_2%29%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;neg &#92;left(f (x_1) = f (x_2)&#92;right)' title='&#92;neg &#92;left(f (x_1) = f (x_2)&#92;right)' class='latex' />, respectively. The <a href="http://en.wikipedia.org/wiki/Universal_quantification" target="_blank">universally-quantified</a> formula above can be rewritten as follows</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5Cleft%28+%5Cneg+%28x_1+%3D+x_2%29+%5Cimplies+%5Cneg+%28f+%28x_1%29+%3D+f+%28x_2%29%29%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;left( &#92;neg (x_1 = x_2) &#92;implies &#92;neg (f (x_1) = f (x_2))&#92;right)' title='&#92;forall x_1 &#92;forall x_2 &#92;left( &#92;neg (x_1 = x_2) &#92;implies &#92;neg (f (x_1) = f (x_2))&#92;right)' class='latex' /></p>
<p>which looks a bit messy. Contrapositively,</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cforall+x_1+%5Cforall+x_2+%5Cleft%28+f+%28x_1%29+%3D+f+%28x_2%29+%5Cimplies+x_1+%3D+x_2%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;forall x_1 &#92;forall x_2 &#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' title='&#92;forall x_1 &#92;forall x_2 &#92;left( f (x_1) = f (x_2) &#92;implies x_1 = x_2&#92;right)' class='latex' />.</p>
<p>In this post, we will restrict our attention to real-valued functions of a real variable (i.e., functions from <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' /> to <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' />). For polynomial functions from reals to reals, we can use quantifier elimination to determine the truth values of the universally-quantified formulas above, thereby deciding injectivity.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example</strong></p>
<p>We would like to decide the injectivity of the following functions</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+f+%3A+%5Cmathbb%7BR%7D+%26%2338%3B%5Cto+%5Cmathbb%7BR%7D%5C%5C+x+%26%2338%3B%5Cmapsto+x%5E2%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} f : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^2&#92;end{array}' title='&#92;begin{array}{rl} f : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^2&#92;end{array}' class='latex' />                 <img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+g+%3A+%5Cmathbb%7BR%7D+%26%2338%3B%5Cto+%5Cmathbb%7BR%7D%5C%5C+x+%26%2338%3B%5Cmapsto+x%5E3%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} g : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^3&#92;end{array}' title='&#92;begin{array}{rl} g : &#92;mathbb{R} &amp;&#92;to &#92;mathbb{R}&#92;&#92; x &amp;&#92;mapsto x^3&#92;end{array}' class='latex' /></p>
<p>which we plot below (using <a href="http://www.wolframalpha.com" target="_blank">Wolfram Alpha</a>)</p>
<p><a href="http://stochastix.files.wordpress.com/2012/02/quadratic.png"><img class="size-full wp-image-7606 aligncenter" title="Quadratic" src="http://stochastix.files.wordpress.com/2012/02/quadratic.png?w=438&#038;h=296" alt="" width="438" height="296" /></a></p>
<p><a href="http://stochastix.files.wordpress.com/2012/02/cubic.png"><img class="size-full wp-image-7605 aligncenter" title="Cubic" src="http://stochastix.files.wordpress.com/2012/02/cubic.png?w=437&#038;h=311" alt="" width="437" height="311" /></a>In high school we all learned to use the infamous <a href="http://en.wikipedia.org/wiki/Horizontal_line_test" target="_blank">horizontal line test</a> to determine whether a function is injective. Let us use something more powerful this time, namely, the following <a href="http://redlog.dolzmann.de" target="_blank">REDUCE + REDLOG</a> script:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% decide the injectivity of f(x) = x^2 and g(x) = x^3

load_package redlog;
rlset ofsf;

% define universally-quantified formulas
phi := all({x1,x2}, x1**2=x2**2 impl x1=x2);
psi := all({x1,x2}, x1**3=x2**3 impl x1=x2);

% perform quantifier elimination
rlqe phi;
rlqe psi;

end;</pre>
<p>which decides that <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f' title='f' class='latex' /> is <em>not</em> injective and that <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='g' title='g' class='latex' /> is injective.</p>
<p style="text-align:center;">__________</p>
<p><strong>References</strong></p>
<p style="padding-left:30px;">[1] David Makinson, <a href="http://books.google.com/books?id=hm9OAiHC2vcC" target="_blank"><em>Sets, Logic and Maths for Computing</em></a>, Springer, 2008.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding the existence of equilibrium points]]></title>
<link>http://stochastix.wordpress.com/2012/02/25/deciding-the-existence-of-equilibrium-points/</link>
<pubDate>Sun, 26 Feb 2012 07:17:33 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/02/25/deciding-the-existence-of-equilibrium-points/</guid>
<description><![CDATA[Suppose we are given a dynamical system of the form where is the state trajectory, and is a known ve]]></description>
<content:encoded><![CDATA[<p>Suppose we are given a dynamical system of the form</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cdot%7Bx%7D+%28t%29+%3D+f+%28+x+%28t%29+%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;dot{x} (t) = f ( x (t) )' title='&#92;dot{x} (t) = f ( x (t) )' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x+%3A+%5Cmathbb%7BR%7D+%5Cto+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}^n' title='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}^n' class='latex' /> is the state trajectory, and <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathbb%7BR%7D%5En+%5Cto+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathbb{R}^n &#92;to &#92;mathbb{R}^n' title='f : &#92;mathbb{R}^n &#92;to &#92;mathbb{R}^n' class='latex' /> is a known <a href="http://en.wikipedia.org/wiki/Vector_field" target="_blank">vector field</a> [1]. We now introduce the following definition:</p>
<p style="padding-left:30px;"><span style="text-decoration:underline;">Definition</span>: A point <img src='http://s0.wp.com/latex.php?latex=x%5E%2A+%5Cin+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x^* &#92;in &#92;mathbb{R}^n' title='x^* &#92;in &#92;mathbb{R}^n' class='latex' /> is an <a href="http://en.wikipedia.org/wiki/Equilibrium_point" target="_blank">equilibrium point</a> of the given dynamical system if the state being at <img src='http://s0.wp.com/latex.php?latex=x%5E%2A&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x^*' title='x^*' class='latex' /> at some time <img src='http://s0.wp.com/latex.php?latex=t%5E%2A&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='t^*' title='t^*' class='latex' /> implies that the state will remain at <img src='http://s0.wp.com/latex.php?latex=x%5E%2A&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x^*' title='x^*' class='latex' /> for all <em>future</em> time, i.e., <img src='http://s0.wp.com/latex.php?latex=x+%28t%29+%3D+x%5E%2A&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x (t) = x^*' title='x (t) = x^*' class='latex' /> for all <img src='http://s0.wp.com/latex.php?latex=t+%5Cgeq+t%5E%2A&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='t &#92;geq t^*' title='t &#92;geq t^*' class='latex' />. In other words, an equilibrium point <img src='http://s0.wp.com/latex.php?latex=x%5E%2A&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x^*' title='x^*' class='latex' /> is a point of <em>zero flow</em>, i.e., <img src='http://s0.wp.com/latex.php?latex=f+%28+x%5E%2A+%29+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f ( x^* ) = 0' title='f ( x^* ) = 0' class='latex' />.</p>
<p>If you happen to dislike the word &#8220;flow&#8221;, feel free to replace it with the word &#8220;velocity&#8221;. A point of zero velocity is thus a <em>stationary</em> one. Like a properly-trained poodle, it stays put.</p>
<p>One can find the equilibrium points of a given dynamical system by computing the real roots of the vector equation <img src='http://s0.wp.com/latex.php?latex=f+%28x%29+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (x) = 0' title='f (x) = 0' class='latex' />. However, suppose that we are not interested in computing the equilibrium points; instead, all we would like to know is whether any such points exist. Thus, we arrive at the following <a href="http://en.wikipedia.org/wiki/Decision_problem" target="_blank">decision problem</a>:</p>
<p style="padding-left:30px;"><span style="text-decoration:underline;">Problem</span>: Given a vector field <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathbb%7BR%7D%5En+%5Cto+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathbb{R}^n &#92;to &#92;mathbb{R}^n' title='f : &#92;mathbb{R}^n &#92;to &#92;mathbb{R}^n' class='latex' />, we would like to decide whether the dynamical system <img src='http://s0.wp.com/latex.php?latex=%5Cdot%7Bx%7D+%28t%29+%3D+f+%28+x+%28t%29+%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;dot{x} (t) = f ( x (t) )' title='&#92;dot{x} (t) = f ( x (t) )' class='latex' /> has at least one equilibrium point. This is equivalent to determining the truth value of the formula <img src='http://s0.wp.com/latex.php?latex=%5Cexists+x+%5Cleft%28+f+%28x%29+%3D+0+%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;exists x &#92;left( f (x) = 0 &#92;right)' title='&#92;exists x &#92;left( f (x) = 0 &#92;right)' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=x+%5Cin+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x &#92;in &#92;mathbb{R}^n' title='x &#92;in &#92;mathbb{R}^n' class='latex' />.</p>
<p>Since both <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x' title='x' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=f+%28x%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (x)' title='f (x)' class='latex' /> are <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n' title='n' class='latex' />-dimensional vectors, <img src='http://s0.wp.com/latex.php?latex=x+%3D+%28x_1%2C+%5Cdots%2C+x_n%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x = (x_1, &#92;dots, x_n)' title='x = (x_1, &#92;dots, x_n)' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=f+%28x%29+%3D+%28f_1+%28x%29%2C+%5Cdots%2C+f_n+%28x%29%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f (x) = (f_1 (x), &#92;dots, f_n (x))' title='f (x) = (f_1 (x), &#92;dots, f_n (x))' class='latex' />, we can rewrite the <a href="http://en.wikipedia.org/wiki/Existential_quantification" target="_blank">existentially-quantified</a> formula above in the following form</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle%5Cexists+x_1+%5Cexists+x_2+%5Cdots+%5Cexists+x_n+%5Cleft%28+%5Cbigwedge_%7Bi%3D1%7D%5En+f_i+%28x_1%2C+x_2%2C+%5Cdots%2C+x_n%29+%3D+0%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;displaystyle&#92;exists x_1 &#92;exists x_2 &#92;dots &#92;exists x_n &#92;left( &#92;bigwedge_{i=1}^n f_i (x_1, x_2, &#92;dots, x_n) = 0&#92;right)' title='&#92;displaystyle&#92;exists x_1 &#92;exists x_2 &#92;dots &#92;exists x_n &#92;left( &#92;bigwedge_{i=1}^n f_i (x_1, x_2, &#92;dots, x_n) = 0&#92;right)' class='latex' />.</p>
<p>Can one even determine the truth value of the existentially-quantified formula above? In order to avoid colliding against the brick wall of <a href="http://en.wikipedia.org/wiki/Decidability_%28logic%29" target="_blank">undecidability</a>, let us restrict our attention to polynomial dynamical systems (i.e., dynamical systems in which the vector field <img src='http://s0.wp.com/latex.php?latex=f+%3A+%5Cmathbb%7BR%7D%5En+%5Cto+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f : &#92;mathbb{R}^n &#92;to &#92;mathbb{R}^n' title='f : &#92;mathbb{R}^n &#92;to &#92;mathbb{R}^n' class='latex' /> is polynomial). For such systems, one can use <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a> to decide the existence of equilibrium points.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example<br />
</strong></p>
<p>Consider the following polynomial dynamical system</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+%5Cdot%7Bx%7D_1+%26%2338%3B%3D+%5Cmu+-+x_1%5E2%5C%5C+%5Cdot%7Bx%7D_2+%26%2338%3B%3D+-+x_2%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} &#92;dot{x}_1 &amp;= &#92;mu - x_1^2&#92;&#92; &#92;dot{x}_2 &amp;= - x_2&#92;end{array}' title='&#92;begin{array}{rl} &#92;dot{x}_1 &amp;= &#92;mu - x_1^2&#92;&#92; &#92;dot{x}_2 &amp;= - x_2&#92;end{array}' class='latex' /></p>
<p>taken from section 2.7 in Khalil&#8217;s book [1]. Note that the two first-order ordinary differential equations above are decoupled, i.e., they are of the form <img src='http://s0.wp.com/latex.php?latex=%5Cdot%7Bx%7D_i+%3D+f_i+%28x_i%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;dot{x}_i = f_i (x_i)' title='&#92;dot{x}_i = f_i (x_i)' class='latex' />. Note also that we have a free parameter <img src='http://s0.wp.com/latex.php?latex=%5Cmu+%5Cin+%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu &#92;in &#92;mathbb{R}' title='&#92;mu &#92;in &#92;mathbb{R}' class='latex' />.</p>
<p>We now compute the equilibrium points of the dynamical system by solving the (scalar) polynomial equations <img src='http://s0.wp.com/latex.php?latex=f_i+%28x_i%29+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='f_i (x_i) = 0' title='f_i (x_i) = 0' class='latex' />. We thus obtain <img src='http://s0.wp.com/latex.php?latex=x_1%5E2+%3D+%5Cmu&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1^2 = &#92;mu' title='x_1^2 = &#92;mu' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=x_2+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_2 = 0' title='x_2 = 0' class='latex' />. For <img src='http://s0.wp.com/latex.php?latex=%5Cmu+%26%2362%3B+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu &gt; 0' title='&#92;mu &gt; 0' class='latex' />, we have two equilibrium points at <img src='http://s0.wp.com/latex.php?latex=%28%5Csqrt%7B%5Cmu%7D%2C+0%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='(&#92;sqrt{&#92;mu}, 0)' title='(&#92;sqrt{&#92;mu}, 0)' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%28-%5Csqrt%7B%5Cmu%7D%2C+0%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='(-&#92;sqrt{&#92;mu}, 0)' title='(-&#92;sqrt{&#92;mu}, 0)' class='latex' />. For <img src='http://s0.wp.com/latex.php?latex=%5Cmu+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu = 0' title='&#92;mu = 0' class='latex' />, we have one equilibrium point at <img src='http://s0.wp.com/latex.php?latex=%280%2C0%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='(0,0)' title='(0,0)' class='latex' />. Finally, for <img src='http://s0.wp.com/latex.php?latex=%5Cmu+%26%2360%3B+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu &lt; 0' title='&#92;mu &lt; 0' class='latex' />, we have no equilibrium points, as the equation <img src='http://s0.wp.com/latex.php?latex=x_1%5E2+%3D+%5Cmu&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1^2 = &#92;mu' title='x_1^2 = &#92;mu' class='latex' /> has no real roots when <img src='http://s0.wp.com/latex.php?latex=%5Cmu+%26%2360%3B+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu &lt; 0' title='&#92;mu &lt; 0' class='latex' />. The existence of equilibrium points depends on parameter <img src='http://s0.wp.com/latex.php?latex=%5Cmu&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu' title='&#92;mu' class='latex' />. Stating that this dynamical system has at least one equilibrium point is the same as saying that the following existentially-quantified formula</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle%5Cexists+x_1+%5Cexists+x_2+%5Cleft%28+x_1%5E2+-+%5Cmu+%3D+0+%5Cland+x_2+%3D+0%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;displaystyle&#92;exists x_1 &#92;exists x_2 &#92;left( x_1^2 - &#92;mu = 0 &#92;land x_2 = 0&#92;right)' title='&#92;displaystyle&#92;exists x_1 &#92;exists x_2 &#92;left( x_1^2 - &#92;mu = 0 &#92;land x_2 = 0&#92;right)' class='latex' /></p>
<p>evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. By visual inspection of the formula, we conclude that the formula (which has two bound variables, <img src='http://s0.wp.com/latex.php?latex=x_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1' title='x_1' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=x_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_2' title='x_2' class='latex' />, and one free variable <img src='http://s0.wp.com/latex.php?latex=%5Cmu&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu' title='&#92;mu' class='latex' />) evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' /> when <img src='http://s0.wp.com/latex.php?latex=%5Cmu+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu &#92;geq 0' title='&#92;mu &#92;geq 0' class='latex' />. Let us confirm this using the following <a href="http://redlog.dolzmann.de" target="_blank">REDUCE + REDLOG</a> script:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% decide the existence of equilibrium points

load_package redlog;
rlset ofsf;

% define polynomial vector field
f1 := mu - x1**2;
f2 := -x2; 

% define existentially quantified formula
phi := ex({x1,x2}, f1=0 and f2=0);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>which outputs <img src='http://s0.wp.com/latex.php?latex=%5Cmu+%5Cgeq+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu &#92;geq 0' title='&#92;mu &#92;geq 0' class='latex' />. Hence, if the parameter <img src='http://s0.wp.com/latex.php?latex=%5Cmu&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mu' title='&#92;mu' class='latex' /> is nonnegative, then there will always exist at least one equilibrium point.</p>
<p style="text-align:center;">__________</p>
<p><strong>References</strong></p>
<p style="padding-left:30px;"><strong></strong>[1] Hassan K. Khalil, <em>Nonlinear Systems</em>, 3rd edition, Prentice Hall.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding linear independence]]></title>
<link>http://stochastix.wordpress.com/2012/02/23/deciding-linear-independence/</link>
<pubDate>Fri, 24 Feb 2012 01:40:31 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2012/02/23/deciding-linear-independence/</guid>
<description><![CDATA[Quantifier elimination has a bit of a magical feel to it. &#8211; Arnab Bhattacharyya (2011) We woul]]></description>
<content:encoded><![CDATA[<p style="padding-left:240px;"><em>Quantifier elimination has a bit of a magical feel to it.</em></p>
<p style="padding-left:240px;">&#8211; <a href="http://cstheory.blogoverflow.com/2011/11/something-you-should-know-about-quantifier-elimination-part-i" target="_blank">Arnab Bhattacharyya</a> (2011)</p>
<p>We would like to decide whether a given (finite) set of vectors <img src='http://s0.wp.com/latex.php?latex=%5C%7B%5Cmathbf%7Bv%7D_1%2C+%5Cmathbf%7Bv%7D_2%2C+%5Cdots%2C+%5Cmathbf%7Bv%7D_k%5C%7D+%5Csubset+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;dots, &#92;mathbf{v}_k&#92;} &#92;subset &#92;mathbb{R}^n' title='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;dots, &#92;mathbf{v}_k&#92;} &#92;subset &#92;mathbb{R}^n' class='latex' /> is <a href="http://en.wikipedia.org/wiki/Linear_independence" target="_blank">linearly independent</a>. Let us first recall the definition of linear independence. From Dym&#8217;s book [1], we have:</p>
<p style="padding-left:30px;"><span style="text-decoration:underline;">Definition</span>: <em>A set of vectors </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7Bv%7D_1%2C+%5Cdots%2C+%5Cmathbf%7Bv%7D_k&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbf{v}_1, &#92;dots, &#92;mathbf{v}_k' title='&#92;mathbf{v}_1, &#92;dots, &#92;mathbf{v}_k' class='latex' /><em> in a vector space </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BV%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{V}' title='&#92;mathcal{V}' class='latex' /><em> over </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{F}' title='&#92;mathbb{F}' class='latex' /><em> is said to be linearly independent over </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{F}' title='&#92;mathbb{F}' class='latex' /><em> if the only scalars </em><img src='http://s0.wp.com/latex.php?latex=%5Calpha_1%2C+%5Cdots%2C+%5Calpha_k+%5Cin+%5Cmathbb%7BF%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1, &#92;dots, &#92;alpha_k &#92;in &#92;mathbb{F}' title='&#92;alpha_1, &#92;dots, &#92;alpha_k &#92;in &#92;mathbb{F}' class='latex' /><em> for which</em></p>
<p style="padding-left:30px;text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Calpha_1+%5Cmathbf%7Bv%7D_1+%2B+%5Cdots+%2B+%5Calpha_k+%5Cmathbf%7Bv%7D_k+%3D+%5Cmathbf%7B0%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1 &#92;mathbf{v}_1 + &#92;dots + &#92;alpha_k &#92;mathbf{v}_k = &#92;mathbf{0}' title='&#92;alpha_1 &#92;mathbf{v}_1 + &#92;dots + &#92;alpha_k &#92;mathbf{v}_k = &#92;mathbf{0}' class='latex' /></p>
<p style="padding-left:30px;"><em>are </em><img src='http://s0.wp.com/latex.php?latex=%5Calpha_1+%3D+%5Cdots+%3D+%5Calpha_k+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1 = &#92;dots = &#92;alpha_k = 0' title='&#92;alpha_1 = &#92;dots = &#92;alpha_k = 0' class='latex' /><em>. This is just another way of saying that you cannot express one of these vectors in terms of the others.</em></p>
<p style="text-align:center;"><em><em>_____</em><em></em><br />
</em></p>
<p>In this post we are interested in sets of real vectors and, thus, we shall restrict our attention to the case where <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D+%3D+%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{F} = &#92;mathbb{R}' title='&#92;mathbb{F} = &#92;mathbb{R}' class='latex' />. Asserting that a given (finite) set of vectors is <em>linearly independent</em> is the same as stating that the set of vectors under study is <span style="text-decoration:underline;">not</span> <em>linearly dependent</em>. Therefore, we now recall Dym&#8217;s definition [1] of linear dependence:</p>
<p style="padding-left:30px;"><span style="text-decoration:underline;">Definition</span>: <em>A set of vectors </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7Bv%7D_1%2C+%5Cdots%2C+%5Cmathbf%7Bv%7D_k&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbf{v}_1, &#92;dots, &#92;mathbf{v}_k' title='&#92;mathbf{v}_1, &#92;dots, &#92;mathbf{v}_k' class='latex' /><em> in a vector space </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BV%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathcal{V}' title='&#92;mathcal{V}' class='latex' /><em> over </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{F}' title='&#92;mathbb{F}' class='latex' /><em> is said to be linearly dependent over </em><img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{F}' title='&#92;mathbb{F}' class='latex' /><em> if there exists a set of scalars </em><img src='http://s0.wp.com/latex.php?latex=%5Calpha_1%2C+%5Cdots%2C+%5Calpha_k+%5Cin+%5Cmathbb%7BF%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1, &#92;dots, &#92;alpha_k &#92;in &#92;mathbb{F}' title='&#92;alpha_1, &#92;dots, &#92;alpha_k &#92;in &#92;mathbb{F}' class='latex' /><em>, not all of which are zero, such that</em></p>
<p style="padding-left:30px;text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Calpha_1+%5Cmathbf%7Bv%7D_1+%2B+%5Cdots+%2B+%5Calpha_k+%5Cmathbf%7Bv%7D_k+%3D+%5Cmathbf%7B0%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1 &#92;mathbf{v}_1 + &#92;dots + &#92;alpha_k &#92;mathbf{v}_k = &#92;mathbf{0}' title='&#92;alpha_1 &#92;mathbf{v}_1 + &#92;dots + &#92;alpha_k &#92;mathbf{v}_k = &#92;mathbf{0}' class='latex' />.</p>
<p style="padding-left:30px;"><em></em><em>Notice that this permits you to express one or more of the given vectors in terms of the others.</em></p>
<p style="text-align:center;"><em><em></em><em><em><em>_____</em></em></em></em></p>
<p>From this definition it follows that saying that a given (finite) set of vectors <img src='http://s0.wp.com/latex.php?latex=%5C%7B%5Cmathbf%7Bv%7D_1%2C+%5Cmathbf%7Bv%7D_2%2C+%5Cdots%2C+%5Cmathbf%7Bv%7D_k%5C%7D+%5Csubset+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;dots, &#92;mathbf{v}_k&#92;} &#92;subset &#92;mathbb{R}^n' title='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;dots, &#92;mathbf{v}_k&#92;} &#92;subset &#92;mathbb{R}^n' class='latex' /> is <em>linearly dependent</em> is the same as stating that the following <a href="http://en.wikipedia.org/wiki/Existential_quantification" target="_blank">existentially quantified</a> formula</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle%5Cexists+%5Calpha_1+%5Cexists+%5Calpha_2+%5Cdots+%5Cexists+%5Calpha_k+%5Cleft%28+%5Cneg+%5Cleft%28%5Cbigwedge_%7Bi%3D1%7D%5Ek+%5Calpha_i+%3D+0%5Cright%29+%5Cland+%5Cleft%28%5Csum_%7Bi+%3D+1%7D%5Ek+%5Calpha_i+%5Cmathbf%7Bv%7D_i+%3D+%5Cmathbf%7B0%7D%5Cright%29%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;displaystyle&#92;exists &#92;alpha_1 &#92;exists &#92;alpha_2 &#92;dots &#92;exists &#92;alpha_k &#92;left( &#92;neg &#92;left(&#92;bigwedge_{i=1}^k &#92;alpha_i = 0&#92;right) &#92;land &#92;left(&#92;sum_{i = 1}^k &#92;alpha_i &#92;mathbf{v}_i = &#92;mathbf{0}&#92;right)&#92;right)' title='&#92;displaystyle&#92;exists &#92;alpha_1 &#92;exists &#92;alpha_2 &#92;dots &#92;exists &#92;alpha_k &#92;left( &#92;neg &#92;left(&#92;bigwedge_{i=1}^k &#92;alpha_i = 0&#92;right) &#92;land &#92;left(&#92;sum_{i = 1}^k &#92;alpha_i &#92;mathbf{v}_i = &#92;mathbf{0}&#92;right)&#92;right)' class='latex' /></p>
<p>evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. Please do note that <img src='http://s0.wp.com/latex.php?latex=%5Csum_%7Bi+%3D+1%7D%5Ek+%5Calpha_i+%5Cmathbf%7Bv%7D_i+%3D+%5Cmathbf%7B0%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;sum_{i = 1}^k &#92;alpha_i &#92;mathbf{v}_i = &#92;mathbf{0}' title='&#92;sum_{i = 1}^k &#92;alpha_i &#92;mathbf{v}_i = &#92;mathbf{0}' class='latex' /> is a vector equation encapsulating <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n' title='n' class='latex' /> scalar equations of the form</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle%5Csum_%7Bi+%3D+1%7D%5Ek+%5Calpha_i+v_i%5E%7B%28j%29%7D+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;displaystyle&#92;sum_{i = 1}^k &#92;alpha_i v_i^{(j)} = 0' title='&#92;displaystyle&#92;sum_{i = 1}^k &#92;alpha_i v_i^{(j)} = 0' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=v_i%5E%7B%28j%29%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='v_i^{(j)}' title='v_i^{(j)}' class='latex' /> is the <img src='http://s0.wp.com/latex.php?latex=j&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='j' title='j' class='latex' />-th component of vector <img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7Bv%7D_i&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbf{v}_i' title='&#92;mathbf{v}_i' class='latex' />. Finally, we conclude that a given (finite) set of vectors <img src='http://s0.wp.com/latex.php?latex=%5C%7B%5Cmathbf%7Bv%7D_1%2C+%5Cmathbf%7Bv%7D_2%2C+%5Cdots%2C+%5Cmathbf%7Bv%7D_k%5C%7D+%5Csubset+%5Cmathbb%7BR%7D%5En&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;dots, &#92;mathbf{v}_k&#92;} &#92;subset &#92;mathbb{R}^n' title='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;dots, &#92;mathbf{v}_k&#92;} &#92;subset &#92;mathbb{R}^n' class='latex' /> being <em>linearly independent</em> is equivalent to the following formula</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cneg+%5Cdisplaystyle%5Cexists+%5Calpha_1+%5Cexists+%5Calpha_2+%5Cdots+%5Cexists+%5Calpha_k+%5Cleft%28+%5Cneg+%5Cleft%28%5Cbigwedge_%7Bi%3D1%7D%5Ek+%5Calpha_i+%3D+0%5Cright%29+%5Cland+%5Cleft%28%5Cbigwedge_%7Bj%3D1%7D%5En+%5Csum_%7Bi+%3D+1%7D%5Ek+%5Calpha_i+v_i%5E%7B%28j%29%7D+%3D+0%5Cright%29%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;neg &#92;displaystyle&#92;exists &#92;alpha_1 &#92;exists &#92;alpha_2 &#92;dots &#92;exists &#92;alpha_k &#92;left( &#92;neg &#92;left(&#92;bigwedge_{i=1}^k &#92;alpha_i = 0&#92;right) &#92;land &#92;left(&#92;bigwedge_{j=1}^n &#92;sum_{i = 1}^k &#92;alpha_i v_i^{(j)} = 0&#92;right)&#92;right)' title='&#92;neg &#92;displaystyle&#92;exists &#92;alpha_1 &#92;exists &#92;alpha_2 &#92;dots &#92;exists &#92;alpha_k &#92;left( &#92;neg &#92;left(&#92;bigwedge_{i=1}^k &#92;alpha_i = 0&#92;right) &#92;land &#92;left(&#92;bigwedge_{j=1}^n &#92;sum_{i = 1}^k &#92;alpha_i v_i^{(j)} = 0&#92;right)&#92;right)' class='latex' /></p>
<p>evaluating to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. We can determine the truth value of the formula above using <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a>.</p>
<p style="text-align:center;">__________</p>
<p><strong>Example</strong></p>
<p>Consider the three following vectors in <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5E4&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}^4' title='&#92;mathbb{R}^4' class='latex' /></p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7Bv%7D_1+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+1%5C%5C+0+%5C%5C+0+%5C%5C+0%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbf{v}_1 = &#92;left[&#92;begin{array}{c} 1&#92;&#92; 0 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' title='&#92;mathbf{v}_1 = &#92;left[&#92;begin{array}{c} 1&#92;&#92; 0 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' class='latex' />,    <img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7Bv%7D_2+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+0%5C%5C+1+%5C%5C+0+%5C%5C+0%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbf{v}_2 = &#92;left[&#92;begin{array}{c} 0&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' title='&#92;mathbf{v}_2 = &#92;left[&#92;begin{array}{c} 0&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' class='latex' />,    <img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7Bv%7D_3+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+1%5C%5C+1+%5C%5C+0+%5C%5C+0%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbf{v}_3 = &#92;left[&#92;begin{array}{c} 1&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' title='&#92;mathbf{v}_3 = &#92;left[&#92;begin{array}{c} 1&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' class='latex' />.</p>
<p>Is the set of vectors <img src='http://s0.wp.com/latex.php?latex=%5C%7B%5Cmathbf%7Bv%7D_1%2C+%5Cmathbf%7Bv%7D_2%2C+%5Cmathbf%7Bv%7D_3%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;mathbf{v}_3&#92;}' title='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;mathbf{v}_3&#92;}' class='latex' /> linearly independent (over <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' />)? It is not, as <img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7Bv%7D_3+%3D+%5Cmathbf%7Bv%7D_1+%2B+%5Cmathbf%7Bv%7D_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbf{v}_3 = &#92;mathbf{v}_1 + &#92;mathbf{v}_2' title='&#92;mathbf{v}_3 = &#92;mathbf{v}_1 + &#92;mathbf{v}_2' class='latex' />. However, we would like to arrive at this conclusion using quantifier elimination. Note that in this example we have <img src='http://s0.wp.com/latex.php?latex=k+%3D+3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='k = 3' title='k = 3' class='latex' /> (number of vectors), and <img src='http://s0.wp.com/latex.php?latex=n+%3D+4&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='n = 4' title='n = 4' class='latex' /> (dimensionality).</p>
<p>The vector equation <img src='http://s0.wp.com/latex.php?latex=%5Calpha_1+%5Cmathbf%7Bv%7D_1+%2B+%5Calpha_2+%5Cmathbf%7Bv%7D_2+%2B+%5Calpha_3+%5Cmathbf%7Bv%7D_3+%3D+%5Cmathbf%7B0%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1 &#92;mathbf{v}_1 + &#92;alpha_2 &#92;mathbf{v}_2 + &#92;alpha_3 &#92;mathbf{v}_3 = &#92;mathbf{0}' title='&#92;alpha_1 &#92;mathbf{v}_1 + &#92;alpha_2 &#92;mathbf{v}_2 + &#92;alpha_3 &#92;mathbf{v}_3 = &#92;mathbf{0}' class='latex' /> then becomes</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Calpha_1+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+1%5C%5C+0+%5C%5C+0+%5C%5C+0%5Cend%7Barray%7D%5Cright%5D+%2B+%5Calpha_2+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+0%5C%5C+1+%5C%5C+0+%5C%5C+0%5Cend%7Barray%7D%5Cright%5D+%2B+%5Calpha_3+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+1%5C%5C+1+%5C%5C+0+%5C%5C+0%5Cend%7Barray%7D%5Cright%5D+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+0%5C%5C+0+%5C%5C+0+%5C%5C+0%5Cend%7Barray%7D%5Cright%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1 &#92;left[&#92;begin{array}{c} 1&#92;&#92; 0 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right] + &#92;alpha_2 &#92;left[&#92;begin{array}{c} 0&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right] + &#92;alpha_3 &#92;left[&#92;begin{array}{c} 1&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right] = &#92;left[&#92;begin{array}{c} 0&#92;&#92; 0 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' title='&#92;alpha_1 &#92;left[&#92;begin{array}{c} 1&#92;&#92; 0 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right] + &#92;alpha_2 &#92;left[&#92;begin{array}{c} 0&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right] + &#92;alpha_3 &#92;left[&#92;begin{array}{c} 1&#92;&#92; 1 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right] = &#92;left[&#92;begin{array}{c} 0&#92;&#92; 0 &#92;&#92; 0 &#92;&#92; 0&#92;end{array}&#92;right]' class='latex' /></p>
<p>which yields two (scalar) equations: <img src='http://s0.wp.com/latex.php?latex=%5Calpha_1+%2B+%5Calpha_3+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_1 + &#92;alpha_3 = 0' title='&#92;alpha_1 + &#92;alpha_3 = 0' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Calpha_2+%2B+%5Calpha_3+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;alpha_2 + &#92;alpha_3 = 0' title='&#92;alpha_2 + &#92;alpha_3 = 0' class='latex' />. Note that the vector equation above also yields two redundant equations of the form <img src='http://s0.wp.com/latex.php?latex=0+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='0 = 0' title='0 = 0' class='latex' />, which we happily discard.</p>
<p>The set of vectors <img src='http://s0.wp.com/latex.php?latex=%5C%7B%5Cmathbf%7Bv%7D_1%2C+%5Cmathbf%7Bv%7D_2%2C+%5Cmathbf%7Bv%7D_3%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;mathbf{v}_3&#92;}' title='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;mathbf{v}_3&#92;}' class='latex' /> is linearly independent (over <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' />) if and only if the following existentially quantified formula</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cneg+%5Cdisplaystyle%5Cexists+%5Calpha_1+%5Cexists+%5Calpha_2+%5Cexists+%5Calpha_3+%5Cleft%28+%5Cneg+%5Cleft%28%5Cbigwedge_%7Bi%3D1%7D%5E3+%5Calpha_i+%3D+0%5Cright%29+%5Cland+%5Calpha_1+%2B+%5Calpha_3+%3D+0+%5Cland+%5Calpha_2+%2B+%5Calpha_3+%3D+0%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;neg &#92;displaystyle&#92;exists &#92;alpha_1 &#92;exists &#92;alpha_2 &#92;exists &#92;alpha_3 &#92;left( &#92;neg &#92;left(&#92;bigwedge_{i=1}^3 &#92;alpha_i = 0&#92;right) &#92;land &#92;alpha_1 + &#92;alpha_3 = 0 &#92;land &#92;alpha_2 + &#92;alpha_3 = 0&#92;right)' title='&#92;neg &#92;displaystyle&#92;exists &#92;alpha_1 &#92;exists &#92;alpha_2 &#92;exists &#92;alpha_3 &#92;left( &#92;neg &#92;left(&#92;bigwedge_{i=1}^3 &#92;alpha_i = 0&#92;right) &#92;land &#92;alpha_1 + &#92;alpha_3 = 0 &#92;land &#92;alpha_2 + &#92;alpha_3 = 0&#92;right)' class='latex' /></p>
<p>evaluates to <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />. Using the following <a href="http://redlog.dolzmann.de" target="_blank">REDUCE + REDLOG</a> script, we can determine the truth value of the formula above:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% decide the linear independence of a set of vectors

load_package redlog;
rlset ofsf;

% define linear functions
f1 := alpha1;
f2 := alpha2;
f3 := alpha3;
f4 := alpha1 + alpha3;
f5 := alpha2 + alpha3; 

% define existentially quantified formula
phi := not ex({alpha1,alpha2,alpha3}, 
           not (f1=0 and f2=0 and f3=0) and f4=0 and f5=0);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>This script returns <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BFalse%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{False}' title='&#92;text{False}' class='latex' />, which allows us to conclude that the set of vectors <img src='http://s0.wp.com/latex.php?latex=%5C%7B%5Cmathbf%7Bv%7D_1%2C+%5Cmathbf%7Bv%7D_2%2C+%5Cmathbf%7Bv%7D_3%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;mathbf{v}_3&#92;}' title='&#92;{&#92;mathbf{v}_1, &#92;mathbf{v}_2, &#92;mathbf{v}_3&#92;}' class='latex' /> is, indeed, <em>not</em> linearly independent.</p>
<p style="text-align:center;">__________</p>
<p><strong>Acknowledgements</strong></p>
<p>This post was inspired by Arnab Bhattacharyya&#8217;s recent <a href="http://cstheory.blogoverflow.com/2011/11/something-you-should-know-about-quantifier-elimination-part-i" target="_blank">blog post on quantifier elimination</a>.</p>
<p style="text-align:center;">__________</p>
<p><strong>References</strong></p>
<p style="padding-left:30px;">[1] Harry Dym, <a href="http://books.google.com/books?id=q46nRETkXTsC" target="_blank"><em>Linear algebra in action</em></a>, American Mathematical Society, 2006.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Deciding 2-colorability via quantifier elimination]]></title>
<link>http://stochastix.wordpress.com/2011/09/01/deciding-2-colorability-of-graphs/</link>
<pubDate>Fri, 02 Sep 2011 06:26:55 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2011/09/01/deciding-2-colorability-of-graphs/</guid>
<description><![CDATA[A vertex coloring of a graph is a map that assigns a color to each vertex of . The coloring is prope]]></description>
<content:encoded><![CDATA[<p>A <em>vertex coloring</em> of a graph <img src='http://s0.wp.com/latex.php?latex=G+%3D+%28V%2CE%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='G = (V,E)' title='G = (V,E)' class='latex' /> is a map <img src='http://s0.wp.com/latex.php?latex=%5Ckappa+%3A+V+%5Cto+C&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;kappa : V &#92;to C' title='&#92;kappa : V &#92;to C' class='latex' /> that assigns a color to each vertex of <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='G' title='G' class='latex' />. The coloring is <em>proper</em> if adjacent vertices are assigned distinct colors. The graph is 2-colorable if there exists a proper coloring whose <em>color set</em> <img src='http://s0.wp.com/latex.php?latex=C&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='C' title='C' class='latex' /> has two elements.</p>
<p>For instance, consider a graph <img src='http://s0.wp.com/latex.php?latex=G+%3D+%28V%2CE%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='G = (V,E)' title='G = (V,E)' class='latex' /> whose <em>vertex set</em> is <img src='http://s0.wp.com/latex.php?latex=V+%3A%3D+%5C%7B1%2C+2%2C+3%5C%7D+&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='V := &#92;{1, 2, 3&#92;} ' title='V := &#92;{1, 2, 3&#92;} ' class='latex' /> and whose <em>edge set</em> is <img src='http://s0.wp.com/latex.php?latex=E+%3A%3D+%5C%7B%5C%7B1%2C2%5C%7D%2C+%5C%7B1%2C3%5C%7D%2C+%5C%7B2%2C3%5C%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='E := &#92;{&#92;{1,2&#92;}, &#92;{1,3&#92;}, &#92;{2,3&#92;}&#92;}' title='E := &#92;{&#92;{1,2&#92;}, &#92;{1,3&#92;}, &#92;{2,3&#92;}&#92;}' class='latex' />. A pictorial representation of this graph is depicted below</p>
<p><a href="http://stochastix.files.wordpress.com/2011/09/complete-graph-with-3-vertices.png"><img class="size-full wp-image-6903 aligncenter" title="Complete graph with 3 vertices" src="http://stochastix.files.wordpress.com/2011/09/complete-graph-with-3-vertices.png?w=293&#038;h=222" alt="" width="293" height="222" /></a>Note that this graph is <a href="http://en.wikipedia.org/wiki/Complete_graph" target="_blank">complete</a>. We can assign two distinct colors to any two vertices, but we cannot assign a color to the third vertex that will yield a <em>proper</em> coloring. Therefore, the graph is not 2-colorable. To illustrate, we use the color set <img src='http://s0.wp.com/latex.php?latex=C+%3A%3D+%5C%7B%5Ctext%7Bpink%7D%2C+%5Ctext%7Bblue%7D%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='C := &#92;{&#92;text{pink}, &#92;text{blue}&#92;}' title='C := &#92;{&#92;text{pink}, &#92;text{blue}&#92;}' class='latex' /> and generate all <img src='http://s0.wp.com/latex.php?latex=2%5E3+%3D+8&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='2^3 = 8' title='2^3 = 8' class='latex' /> possible vertex 2-colorings, as depicted below</p>
<p><a href="http://stochastix.files.wordpress.com/2011/09/8-vertex-2-colorings.png"><img class="size-full wp-image-6906 aligncenter" title="8 vertex 2-colorings" src="http://stochastix.files.wordpress.com/2011/09/8-vertex-2-colorings.png?w=390&#038;h=600" alt="" width="390" height="600" /></a>Notice that none of these 2-colorings is <em>proper</em>, as expected.</p>
<p>As discussed by <a href="http://www.math.ucdavis.edu/~deloera/" target="_blank">De Loera</a> <em>et alia</em> [1], the <a href="http://en.wikipedia.org/wiki/Graph_coloring" target="_blank">graph vertex-coloring</a> problem can be modeled using polynomial equations. We introduce variables <img src='http://s0.wp.com/latex.php?latex=x_1%2C+x_2%2C+x_3&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1, x_2, x_3' title='x_1, x_2, x_3' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=x_i+%3D+-1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i = -1' title='x_i = -1' class='latex' /> if vertex <img src='http://s0.wp.com/latex.php?latex=i&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='i' title='i' class='latex' /> is assigned the color <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7Bpink%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{pink}' title='&#92;text{pink}' class='latex' />, and <img src='http://s0.wp.com/latex.php?latex=x_i+%3D+1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i = 1' title='x_i = 1' class='latex' /> if vertex <img src='http://s0.wp.com/latex.php?latex=i&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='i' title='i' class='latex' /> is assigned the color <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7Bblue%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;text{blue}' title='&#92;text{blue}' class='latex' />. Given an edge <img src='http://s0.wp.com/latex.php?latex=%5C%7Bi%2Cj%5C%7D+%5Cin+E&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{i,j&#92;} &#92;in E' title='&#92;{i,j&#92;} &#92;in E' class='latex' />, we have that:</p>
<ul>
<li>if both vertices are pink, we get <img src='http://s0.wp.com/latex.php?latex=x_i+%2B+x_j+%3D+-2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i + x_j = -2' title='x_i + x_j = -2' class='latex' />.</li>
</ul>
<ul>
<li>if both vertices are blue, we get <img src='http://s0.wp.com/latex.php?latex=x_i+%2B+x_j+%3D+2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i + x_j = 2' title='x_i + x_j = 2' class='latex' />.</li>
</ul>
<ul>
<li>if the vertices have distinct colors, we get <img src='http://s0.wp.com/latex.php?latex=x_i+%2B+x_j+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i + x_j = 0' title='x_i + x_j = 0' class='latex' />.</li>
</ul>
<p>Thus, stating that adjacent vertices must be assigned distinct colors is equivalent to imposing the constraints <img src='http://s0.wp.com/latex.php?latex=x_i+%2B+x_j+%3D+0&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i + x_j = 0' title='x_i + x_j = 0' class='latex' /> for all <img src='http://s0.wp.com/latex.php?latex=%5C%7Bi%2Cj%5C%7D+%5Cin+E&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;{i,j&#92;} &#92;in E' title='&#92;{i,j&#92;} &#92;in E' class='latex' />. We thus obtain a system of three equations</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+x_1+%2B+x_2+%26%2338%3B%3D+0%5C%5C+x_1+%2B+x_3+%26%2338%3B%3D+0%5C%5C+x_2+%2B+x_3+%26%2338%3B%3D+0%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} x_1 + x_2 &amp;= 0&#92;&#92; x_1 + x_3 &amp;= 0&#92;&#92; x_2 + x_3 &amp;= 0&#92;end{array}' title='&#92;begin{array}{rl} x_1 + x_2 &amp;= 0&#92;&#92; x_1 + x_3 &amp;= 0&#92;&#92; x_2 + x_3 &amp;= 0&#92;end{array}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=x_1%2C+x_2%2C+x_3+%5Cin+%5C%7B-1%2C1%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_1, x_2, x_3 &#92;in &#92;{-1,1&#92;}' title='x_1, x_2, x_3 &#92;in &#92;{-1,1&#92;}' class='latex' />. This is still a combinatorial problem, though. We can transform it into an algebraic-geometric problem. Here is a truly beautiful trick [1]: the constraint <img src='http://s0.wp.com/latex.php?latex=x_i+%5Cin+%5C%7B-1%2C1%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i &#92;in &#92;{-1,1&#92;}' title='x_i &#92;in &#92;{-1,1&#92;}' class='latex' /> can be encoded as <img src='http://s0.wp.com/latex.php?latex=x_i%5E2+%3D+1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i^2 = 1' title='x_i^2 = 1' class='latex' /> with <img src='http://s0.wp.com/latex.php?latex=x_i+%5Cin+%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='x_i &#92;in &#92;mathbb{R}' title='x_i &#92;in &#92;mathbb{R}' class='latex' />. How quaint!! We then obtain a system of six equations with polynomials in <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5Bx_1%2C+x_2%2C+x_3%5D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;mathbb{R}[x_1, x_2, x_3]' title='&#92;mathbb{R}[x_1, x_2, x_3]' class='latex' /></p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brl%7D+x_1+%2B+x_2+%26%2338%3B%3D+0%5C%5C+x_1+%2B+x_3+%26%2338%3B%3D+0%5C%5C+x_2+%2B+x_3+%26%2338%3B%3D+0%5C%5C+x_1%5E2+-+1+%26%2338%3B%3D+0%5C%5C+x_2%5E2+-+1+%26%2338%3B%3D+0%5C%5C+x_3%5E2+-1+%26%2338%3B%3D+0%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rl} x_1 + x_2 &amp;= 0&#92;&#92; x_1 + x_3 &amp;= 0&#92;&#92; x_2 + x_3 &amp;= 0&#92;&#92; x_1^2 - 1 &amp;= 0&#92;&#92; x_2^2 - 1 &amp;= 0&#92;&#92; x_3^2 -1 &amp;= 0&#92;end{array}' title='&#92;begin{array}{rl} x_1 + x_2 &amp;= 0&#92;&#92; x_1 + x_3 &amp;= 0&#92;&#92; x_2 + x_3 &amp;= 0&#92;&#92; x_1^2 - 1 &amp;= 0&#92;&#92; x_2^2 - 1 &amp;= 0&#92;&#92; x_3^2 -1 &amp;= 0&#92;end{array}' class='latex' /></p>
<p>whose solution set, which we denote by <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' />, is <a href="http://en.wikipedia.org/wiki/Algebraic_set" target="_blank">algebraic</a> [2]. The given graph is 2-<em>colorable</em> if and only if the system of polynomial equations above is <em>feasible</em>, i.e., if set <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is <em>nonempty</em> [1]. The following <a href="http://redlog.dolzmann.de/" target="_blank">REDUCE + REDLOG</a> script uses <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a> to decide if <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is nonempty:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% feasibility via quantifier elimination

load_package redlog;
rlset ofsf;

% define polynomial functions
f1 := x1+x2;
f2 := x1+x3;
f3 := x2+x3;
f4 := x1^2-1;
f5 := x2^2-1;
f6 := x3^2-1;

% define existential formula
phi := ex({x1,x2,x3}, f1=0 and f2=0 and f3=0 and
                      f4=0 and f5=0 and f6=0);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>This script produces the truth value <em>false</em>. Thus, the solution set <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is empty, which means that the system of polynomial equations is <em>infeasible</em>. We conclude that the given graph is not 2-colorable.</p>
<p style="text-align:center;">__________</p>
<p><strong>References</strong></p>
<p style="padding-left:30px;">[1] Jesús De Loera, Jon Lee, Susan Margulies, Shmuel Onn, <a href="http://arxiv.org/abs/0706.0578" target="_blank"><em>Expressing Combinatorial Optimization Problems by Systems of Polynomial Equations and the Nullstellensatz</em></a>, 2007.</p>
<p style="padding-left:30px;">[2] Jacek Bochnak, Michel Coste, Marie-Françoise Roy, <a href="http://books.google.com/books?id=m8Er5OAnT5cC" target="_blank"><em>Real Algebraic Geometry</em></a>, Springer, 1998.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Feasibility via quantifier elimination II]]></title>
<link>http://stochastix.wordpress.com/2011/08/29/feasibility-via-quantifier-elimination-ii/</link>
<pubDate>Mon, 29 Aug 2011 08:47:46 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2011/08/29/feasibility-via-quantifier-elimination-ii/</guid>
<description><![CDATA[Suppose we want to decide whether the following semialgebraic set is nonempty. This is the same as d]]></description>
<content:encoded><![CDATA[<p>Suppose we want to decide whether the following <a href="http://en.wikipedia.org/wiki/Semialgebraic_set" target="_blank">semialgebraic</a> set</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=S+%3A%3D+%5C%7B%28x%2Cy%29+%5Cin+%5Cmathbb%7BR%7D%5E2+%5Cmid+x+-+y%5E2+%2B+1+%5Cgeq+0+%5Cland+-x+-+y%5E2+%2B+1+%5Cgeq+0%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S := &#92;{(x,y) &#92;in &#92;mathbb{R}^2 &#92;mid x - y^2 + 1 &#92;geq 0 &#92;land -x - y^2 + 1 &#92;geq 0&#92;}' title='S := &#92;{(x,y) &#92;in &#92;mathbb{R}^2 &#92;mid x - y^2 + 1 &#92;geq 0 &#92;land -x - y^2 + 1 &#92;geq 0&#92;}' class='latex' /></p>
<p>is <em>nonempty</em>. This is the same as determining whether the following system of polynomial inequalities</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brrl%7D+g_1+%28x%2C+y%29+%3A%3D%26%2338%3B+x+-+y%5E2+%2B+1+%26%2338%3B%5Cgeq+0%5C%5C+g_2+%28x%2C+y%29+%3A%3D%26%2338%3B+-x+-+y%5E2+%2B1+%26%2338%3B%5Cgeq+0%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rrl} g_1 (x, y) :=&amp; x - y^2 + 1 &amp;&#92;geq 0&#92;&#92; g_2 (x, y) :=&amp; -x - y^2 +1 &amp;&#92;geq 0&#92;end{array}' title='&#92;begin{array}{rrl} g_1 (x, y) :=&amp; x - y^2 + 1 &amp;&#92;geq 0&#92;&#92; g_2 (x, y) :=&amp; -x - y^2 +1 &amp;&#92;geq 0&#92;end{array}' class='latex' /></p>
<p>is <em>feasible</em>. We now define <img src='http://s0.wp.com/latex.php?latex=S_1+%3A%3D+%5C%7B%28x%2Cy%29+%5Cin+%5Cmathbb%7BR%7D%5E2+%5Cmid+g_1+%28x%2C+y%29+%5Cgeq+0%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_1 := &#92;{(x,y) &#92;in &#92;mathbb{R}^2 &#92;mid g_1 (x, y) &#92;geq 0&#92;}' title='S_1 := &#92;{(x,y) &#92;in &#92;mathbb{R}^2 &#92;mid g_1 (x, y) &#92;geq 0&#92;}' class='latex' />, and <img src='http://s0.wp.com/latex.php?latex=S_2+%3A%3D+%5C%7B%28x%2Cy%29+%5Cin+%5Cmathbb%7BR%7D%5E2+%5Cmid+g_2+%28x%2C+y%29+%5Cgeq+0%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_2 := &#92;{(x,y) &#92;in &#92;mathbb{R}^2 &#92;mid g_2 (x, y) &#92;geq 0&#92;}' title='S_2 := &#92;{(x,y) &#92;in &#92;mathbb{R}^2 &#92;mid g_2 (x, y) &#92;geq 0&#92;}' class='latex' />. Set <img src='http://s0.wp.com/latex.php?latex=S_1&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_1' title='S_1' class='latex' /> is depicted below</p>
<p><a href="http://stochastix.files.wordpress.com/2011/08/wa-plot-x-y21-gt-0.gif"><img class="size-full wp-image-6868 aligncenter" title="WA plot x-y^2+1 gt 0" src="http://stochastix.files.wordpress.com/2011/08/wa-plot-x-y21-gt-0.gif?w=300&#038;h=293" alt="" width="300" height="293" /></a>and set <img src='http://s0.wp.com/latex.php?latex=S_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S_2' title='S_2' class='latex' /> is depicted below</p>
<p><a href="http://stochastix.files.wordpress.com/2011/08/wa-plot-x-y21-gt-01.gif"><img class="size-full wp-image-6869 aligncenter" title="WA plot -x-y^2+1 gt 0" src="http://stochastix.files.wordpress.com/2011/08/wa-plot-x-y21-gt-01.gif?w=300&#038;h=292" alt="" width="300" height="292" /></a>Note that <img src='http://s0.wp.com/latex.php?latex=S+%3D+S_1+%5Ccap+S_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S = S_1 &#92;cap S_2' title='S = S_1 &#92;cap S_2' class='latex' />. We depict this intersection below</p>
<p><a href="http://stochastix.files.wordpress.com/2011/08/wa-plot-x-y21-gt-0-and-x-y21-gt-0.gif"><img class="size-full wp-image-6870 aligncenter" title="WA plot x-y^2+1 gt 0 and -x-y^2+1 gt 0" src="http://stochastix.files.wordpress.com/2011/08/wa-plot-x-y21-gt-0-and-x-y21-gt-0.gif?w=298&#038;h=300" alt="" width="298" height="300" /></a>Visual inspection of the plot of the intersection <img src='http://s0.wp.com/latex.php?latex=S+%3D+S_1+%5Ccap+S_2&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S = S_1 &#92;cap S_2' title='S = S_1 &#92;cap S_2' class='latex' /> allows us to conclude that <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> in <em>nonempty</em>. Asserting that <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is nonempty is the same as stating that the proposition</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cexists%7Bx%7D%5Cexists%7By%7D+%5Cleft%28g_1+%28x%2Cy%29+%5Cgeq+0+%5Cland+g_2+%28x%2Cy%29+%5Cgeq+0%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;exists{x}&#92;exists{y} &#92;left(g_1 (x,y) &#92;geq 0 &#92;land g_2 (x,y) &#92;geq 0&#92;right)' title='&#92;exists{x}&#92;exists{y} &#92;left(g_1 (x,y) &#92;geq 0 &#92;land g_2 (x,y) &#92;geq 0&#92;right)' class='latex' /></p>
<p>is <em>true</em>. We can determine the truth value of this proposition via <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a> using the following <a href="http://redlog.dolzmann.de/" target="_blank">REDUCE + REDLOG</a> script:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% feasibility via quantifier elimination

load_package redlog;
rlset ofsf;

% define polynomial functions
g1 :=  x-y^2+1;
g2 := -x-y^2+1;

% define existential formula
phi := ex({x,y}, g1&#62;=0 and g2&#62;=0);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>which produces the truth value<em> true</em>. This means that there exists a <img src='http://s0.wp.com/latex.php?latex=%28x%2Cy%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='(x,y)' title='(x,y)' class='latex' /> that satisfies the polynomial inequalities, i.e., <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is nonempty.</p>
<p style="text-align:center;">__________</p>
<p><strong>Remark:</strong> the plots in this post were generated by <a href="http://www.wolframalpha.com" target="_blank">Wolfram Alpha</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Feasibility via quantifier elimination]]></title>
<link>http://stochastix.wordpress.com/2011/08/27/feasibility-via-quantifier-elimination/</link>
<pubDate>Sun, 28 Aug 2011 02:24:05 +0000</pubDate>
<dc:creator>Rod Carvalho</dc:creator>
<guid>http://stochastix.wordpress.com/2011/08/27/feasibility-via-quantifier-elimination/</guid>
<description><![CDATA[Consider the system of polynomial equations and inequalities [1] whose solution set is the following]]></description>
<content:encoded><![CDATA[<p>Consider the system of polynomial equations and inequalities [1]</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brrl%7D+f_1+%28x_1%2C+x_2%29+%3A%3D%26%2338%3B+x_1%5E2+%2B+x_2%5E2+-+1+%26%2338%3B%3D+0%5C%5C+g_1+%28x_1%2C+x_2%29+%3A%3D%26%2338%3B+3+x_2+-+x_1%5E3+-+2+%26%2338%3B%5Cgeq+0%5C%5C+g_2+%28x_1%2C+x_2%29+%3A%3D%26%2338%3B+x_1+-+8+x_2%5E3+%26%2338%3B%5Cgeq+0%5Cend%7Barray%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;begin{array}{rrl} f_1 (x_1, x_2) :=&amp; x_1^2 + x_2^2 - 1 &amp;= 0&#92;&#92; g_1 (x_1, x_2) :=&amp; 3 x_2 - x_1^3 - 2 &amp;&#92;geq 0&#92;&#92; g_2 (x_1, x_2) :=&amp; x_1 - 8 x_2^3 &amp;&#92;geq 0&#92;end{array}' title='&#92;begin{array}{rrl} f_1 (x_1, x_2) :=&amp; x_1^2 + x_2^2 - 1 &amp;= 0&#92;&#92; g_1 (x_1, x_2) :=&amp; 3 x_2 - x_1^3 - 2 &amp;&#92;geq 0&#92;&#92; g_2 (x_1, x_2) :=&amp; x_1 - 8 x_2^3 &amp;&#92;geq 0&#92;end{array}' class='latex' /></p>
<p>whose solution set is the following <a href="http://en.wikipedia.org/wiki/Semialgebraic_set" target="_blank">semialgebraic</a> set</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=S+%3A%3D+%5C%7B+%28x_1%2Cx_2%29+%5Cin+%5Cmathbb%7BR%7D%5E2+%5Cmid+f_1+%28x_1%2Cx_2%29+%3D+0+%5Cland+g_1+%28x_1%2Cx_2%29+%5Cgeq+0+%5Cland+g_2+%28x_1%2Cx_2%29+%5Cgeq+0%5C%7D&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S := &#92;{ (x_1,x_2) &#92;in &#92;mathbb{R}^2 &#92;mid f_1 (x_1,x_2) = 0 &#92;land g_1 (x_1,x_2) &#92;geq 0 &#92;land g_2 (x_1,x_2) &#92;geq 0&#92;}' title='S := &#92;{ (x_1,x_2) &#92;in &#92;mathbb{R}^2 &#92;mid f_1 (x_1,x_2) = 0 &#92;land g_1 (x_1,x_2) &#92;geq 0 &#92;land g_2 (x_1,x_2) &#92;geq 0&#92;}' class='latex' /></p>
<p>Parrilo showed in [1] that this system is <em>infeasible</em>, i.e., set <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is empty, using the <em>Positivstellensatz</em> [2]. Alternatively, one could use <a href="http://en.wikipedia.org/wiki/Quantifier_elimination" target="_blank">quantifier elimination</a> to conclude infeasibility.</p>
<p>Consider the following proposition</p>
<p style="text-align:center;"><img src='http://s0.wp.com/latex.php?latex=%5Cexists%7Bx_1%7D%5Cexists%7Bx_2%7D+%5Cleft%28f_1+%28x_1%2Cx_2%29+%3D+0+%5Cland+g_1+%28x_1%2Cx_2%29+%5Cgeq+0+%5Cland+g_2+%28x_1%2Cx_2%29+%5Cgeq+0%5Cright%29&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='&#92;exists{x_1}&#92;exists{x_2} &#92;left(f_1 (x_1,x_2) = 0 &#92;land g_1 (x_1,x_2) &#92;geq 0 &#92;land g_2 (x_1,x_2) &#92;geq 0&#92;right)' title='&#92;exists{x_1}&#92;exists{x_2} &#92;left(f_1 (x_1,x_2) = 0 &#92;land g_1 (x_1,x_2) &#92;geq 0 &#92;land g_2 (x_1,x_2) &#92;geq 0&#92;right)' class='latex' />.</p>
<p>If this proposition is <em>true</em>, then the system is <em>feasible</em> and <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is nonempty. If the proposition is <em>false</em>, then the system is <em>infeasible</em> and <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=000&amp;s=0' alt='S' title='S' class='latex' /> is empty. We can determine the truth value of the proposition using <a href="http://redlog.dolzmann.de/" target="_blank">REDUCE + REDLOG</a> to perform quantifier elimination:</p>
<pre style="padding-left:30px;background:#EEEEEE;">% feasibility via quantifier elimination

load_package redlog;
rlset ofsf;

% define polynomial functions
f1 := x1^2+x2^2-1;
g1 := 3*x2-x1^3-2;
g2 := x1-8*x2^3;

% define existential formula
phi := ex({x1,x2}, f1=0 and g1&#62;=0 and g2&#62;=0);

% perform quantifier elimination
rlqe phi;

end;</pre>
<p>The output of this script is the following:</p>
<p><a href="http://stochastix.files.wordpress.com/2011/08/feasibility.png"><img class="alignnone size-full wp-image-6839" title="Feasibility" src="http://stochastix.files.wordpress.com/2011/08/feasibility.png?w=450&#038;h=226" alt="" width="450" height="226" /></a></p>
<p>The proposition is <em>false</em> and, thus, the system is infeasible.</p>
<p style="text-align:center;">__________</p>
<p><strong>References</strong></p>
<p style="padding-left:30px;">[1] Pablo Parrilo, <a href="http://stochastix.files.wordpress.com/2011/08/sos-programs-and-polynomial-inequalities.pdf" target="_blank"><em>Sum of Squares Programs and Polynomial Inequalities</em></a>.</p>
<p style="padding-left:30px;">[2] Jacek Bochnak, Michel Coste, Marie-Françoise Roy, <em><a href="http://books.google.com/books?id=m8Er5OAnT5cC" target="_blank">Real Algebraic Geometry</a></em>, Springer, 1998.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Foreign aid and economic growth]]></title>
<link>http://econworld.wordpress.com/2011/01/03/foreign-aid-and-economic-growth/</link>
<pubDate>Mon, 03 Jan 2011 13:19:03 +0000</pubDate>
<dc:creator>MoSa</dc:creator>
<guid>http://econworld.wordpress.com/2011/01/03/foreign-aid-and-economic-growth/</guid>
<description><![CDATA[While financial aid keeps flowing from developed countries to 3rd world and developing countries, mo]]></description>
<content:encoded><![CDATA[While financial aid keeps flowing from developed countries to 3rd world and developing countries, mo]]></content:encoded>
</item>
<item>
<title><![CDATA[Game Theory]]></title>
<link>http://econworld.wordpress.com/2010/12/16/game-theory/</link>
<pubDate>Thu, 16 Dec 2010 05:24:26 +0000</pubDate>
<dc:creator>MoSa</dc:creator>
<guid>http://econworld.wordpress.com/2010/12/16/game-theory/</guid>
<description><![CDATA[In Economics, Game theory studies multi-person decision problems where each person/firm must conside]]></description>
<content:encoded><![CDATA[In Economics, Game theory studies multi-person decision problems where each person/firm must conside]]></content:encoded>
</item>

</channel>
</rss>
