%!TEX root = forallx-ubc.tex
\chapter{QL Trees}
\label{ch.QLTrees}

In Chapter \ref{ch.QL.models} we saw that the more structured models of QL make reasoning about all possible models rather complex. In SL, where a model was just an assignment of truth values to atomic sentences, reasoning about all models was relatively straightforward: we could simply survey them via truth tables. In QL there isn't really as simple a method for considering claims about validity or satisfiability as the truth table method. So we must rely more heavily on proof systems.

This chapter considers a tree method for QL. Like the tree method for SL discussed in Chapter \ref{ch.sl.trees}, the QL tree method is a method that attempts to generate an interpretation satisfying a given set of sentences. When it succeeds, it shows a way to satisfy them; when it fails, it shows that they are unsatisfiable. As we did in the initial presentation of trees in Chapter \ref{ch.sl.trees}, we'll begin by working through a couple of examples at an intuitive level, before laying out the formal tree rules.

\section{Trees with fixed domains}
\label{sec.fixedrules}

Let's begin with a simplifying assumption. Let's suppose that we're only interested in models with particular fixed domain sizes. (By the time we get to the formal tree rules later in this chapter, we'll dispense with this assumption, but it's helpful for introducing the general idea.) Let's confine our attention to models that have two members in the UD. Consider whether there are any such models that satisfy the following QL sentences: $\{\forall x (Fx \eif Gx), \enot\exists x Gx, \exists x (Fx \eor Gx)\}$. To evaluate this question, we put those sentences in the root of a tree.

\begin{prooftree}
{
}
[\forall x (Fx \eif Gx), name=p1, %checked
[\enot\exists x Gx, grouped, name=p2, %checked
[\exists x (Fx \eor Gx), grouped, name=p3, %checked
%	[Fa \eif Ga, checked
%	[Fb \eif Gb, grouped, checked
%		[\enot Ga
%		[\enot Gb, grouped
%			[\enot Fa
%				[\enot Fb
%					[Fa \eor Ga
%						[Fa, close]
%						[Ga, close]
%					]
%					[Fb \eor Gb
%						[Fb, close]
%						[Gb, close]
%					]
%				]
%				[Gb, close]
%			]
%			[Ga, close
%			]
%		]
%		]
%	]
%	]
]
]
]
\end{prooftree}

Let's start by considering the universal claim on line 1. A universal says that each of its instances are true. Since at the moment we are assuming that there are two objects in our UD, let's also assume we have just two names, $a$ and $b$, corresponding to our two objects. So we can just write down the two instances as a linear development. We also put a check at line 1 to indicate that we've resolved that sentence.

\begin{prooftree}
{
}
[\forall x (Fx \eif Gx), name=p1, checked
[\enot\exists x Gx, grouped, name=p2, %checked
[\exists x (Fx \eor Gx), grouped, name=p3, %checked
	[Fa \eif Ga, %checked
	[Fb \eif Gb, grouped, %checked
%		[\enot Ga
%		[\enot Gb, grouped
%			[\enot Fa
%				[\enot Fb
%					[Fa \eor Ga
%						[Fa, close]
%						[Ga, close]
%					]
%					[Fb \eor Gb
%						[Fb, close]
%						[Gb, close]
%					]
%				]
%				[Gb, close]
%			]
%			[Ga, close
%			]
%		]
%		]
	]
	]
]
]
]
\end{prooftree}

Next let's consider the negated existential at line 2. It says that each instance is false. So it develops into the negation of both instances, and we add a check mark at line 2.

\begin{prooftree}
{
}
[\forall x (Fx \eif Gx), name=p1, checked
[\enot\exists x Gx, grouped, name=p2, checked
[\exists x (Fx \eor Gx), grouped, name=p3, %checked
	[Fa \eif Ga, %checked
	[Fb \eif Gb, grouped, %checked
		[\enot Ga
		[\enot Gb, grouped
%			[\enot Fa
%				[\enot Fb
%					[Fa \eor Ga
%						[Fa, close]
%						[Ga, close]
%					]
%					[Fb \eor Gb
%						[Fb, close]
%						[Gb, close]
%					]
%				]
%				[Gb, close]
%			]
%			[Ga, close
%			]
		]
		]
	]
	]
]
]
]
\end{prooftree}

There is one more quantified sentence to resolve, on line 3, but before we do that, let's handle the conditionals on lines 4 and 5. We do these exactly the same way we handled conditionals in SL trees. They each branch into the negation of the antecedent and the consequent; the latter branch closes each time.

\begin{prooftree}
{
}
[\forall x (Fx \eif Gx), name=p1, checked
[\enot\exists x Gx, grouped, name=p2, checked
[\exists x (Fx \eor Gx), grouped, name=p3, %checked
	[Fa \eif Ga, checked
	[Fb \eif Gb, grouped, checked
		[\enot Ga, name=Ga
		[\enot Gb, grouped, name=Gb
			[\enot Fa
				[\enot Fb
%					[Fa \eor Ga
%						[Fa, close]
%						[Ga, close]
%					]
%					[Fb \eor Gb
%						[Fb, close]
%						[Gb, close]
%					]
				]
				[Gb, close={:Gb, !c}]
			]
			[Ga, close={:Ga, !c}
			]
		]
		]
	]
	]
]
]
]
\end{prooftree}

Now let's look at line 3. It is an existential claim, so it says that at least one of its instances are true. Again, we're assuming for now that there are only two instances. So we branch into those two disjunctions at line 10. After that, we apply the approach to disjunctions from SL trees, and the tree closes.

\begin{prooftree}
{
}
[\forall x (Fx \eif Gx), name=p1, checked
[\enot\exists x Gx, grouped, name=p2, checked
[\exists x (Fx \eor Gx), grouped, name=p3, checked
	[Fa \eif Ga, checked
	[Fb \eif Gb, grouped, checked
		[\enot Ga, name=Ga
		[\enot Gb, grouped, name=Gb
			[\enot Fa, name=Fa
				[\enot Fb, name=Fb
					[Fa \eor Ga, checked
						[Fa, close={:Fa, !c}]
						[Ga, close={:Ga, !c}]
					]
					[Fb \eor Gb, checked
						[Fb, close={:Fb, !c}]
						[Gb, close={:Gb, !c}]
					]
				]
				[Gb, close={:Gb, !c}]
			]
			[Ga, close={:Ga, !c}
			]
		]
		]
	]
	]
]
]
]
\end{prooftree}

The closed tree indicates that our attempt to find a model satisfying the root has failed. We're not quite in a position to say that we've proven the root entirely unsatisfiable, because we've been assuming for simplicity that we're only interested in models that have two members of the UD. But we've shown at least that it's impossible to satisfy the root with any model with a two-object domain. We'll consider a more generalized procedure soon.

Before moving on to the official tree rules, let's look at one more  example that assumes a two-object domain.

Is there any model with a two-object UD that satisfies $\{\forall x Fxa, \forall y (Gy \eif \enot Fya)\}$? To find out, we put both sentences in the root of a tree, and continue as before. We start by taking both instances of each universal claim, then process the two conditionals. This tree remains open.

\begin{prooftree}
{
}
[\forall x Fxa, name=p1, checked
[\forall y (Gy \eif \enot Fya), grouped, name=p2, checked
	[Faa, name=Faa
	[Fba, name=Fba, grouped
		[Ga \eif \enot Faa, checked
		[Gb \eif \enot Fba, grouped, checked
			[\enot Ga
				[\enot Gb, open]
				[\enot Fba, close={:Fba, !c}]
			]
    			[\enot Faa, close={:Faa, !c}]
		]
		]
	]
	]
]
]
\end{prooftree}

As in SL trees, a completed QL tree with an open branch describes a way of satisfying the root. We're assuming a two-object UD; for simplicity, let's let our objects be the letters `a' and `b', and have `a' be the referent of the QL name $a$, and `b' be the referent of the QL name $b$. We look to the two QL atoms and two negated QL atoms in the branch; they indicate what needs to be included in the extension of each predicate in our model. Since $Faa$ is in the branch, we need to include \ntuple{a, a} in the extension of $F$. Since \enot $Ga$ is in the branch, we need for a \emph{not} to be in the extension of $G$.

Here is a partial model that suffices to satisfy the root of the above tree:
\begin{partialmodel}
	UD & $\{a, b\}$\\
	\extension{G} & \begin{tabular}{l|l}
	           & $G$ \\ \hline
		\textbf{a} & 0          \\
		\textbf{b} & 0
		\end{tabular}\\
	\extension{F} & \begin{tabular}{l|ll} $Fxy$        & \textbf{a} & \textbf{b} \\ \hline
		\textbf{a} & 1          & -  \\
		\textbf{b} & 1          &  -
		\end{tabular}
\end{partialmodel}

Notice that we've put blanks for two of the cells in the extension of $Fxy$. That is to indicate that it doesn't matter whether or not \ntuple{a, b} or \ntuple{b, b} are included in the extension of $Fxy$. (This is also why neither $Fab$, $Fbb$, \enot $Fab$, nor \enot $Fbb$ appeared in the open branch.) So the tree method for QL is similar to that for SL in this respect as well. An open branch in a completed tree describes a way to satisfy the root.

\section{Generalizing the tree method}

Trees are supposed to show something about \emph{all} possible models, not only those with two-object UDs. So we don't want our official tree rules to build in the idea that there are just two objects. For a three-object UD, we'd want our universal statements to develop into all three instances, and we'd want our existentials to branch into the three instances. For a ten-object UD like the one described on page \pageref{10UD}, we'd need to give ten instances. For an infinite UD like the set of all natural numbers, we'd need an \emph{infinite} number of developments. Obviously such rules would be impractical, to say the least. Worse than that, we often won't know at the start of the process what size domain we should be thinking of. So we need a version of the tree rules that is flexible as to domain size.

In order to state our rule formally, we need one new bit of formalism. For any QL wff \metaA{}, a constant \script{c}, and variable \script{x}, define \metaA{}\substitute{\script{x}}{\script{c}} to mean the wff that we get by replacing every occurrence of \script{x} in \metaA{} with \script{c}. So for example, $$Fx\substitute{x}{a} = Fa$$

For any quantified QL sentence $\forall \script{x} \metaA{}$ or $\exists \script{x} \metaA{}$, we call \metaA{}\substitute{\script{x}}{\script{c}} a \define{substitution instance} of $\forall x\metaA{}$ and $\exists x\metaA{}$, and $c$ is called the \define{instantiating constant}.

This, more formally, is the same notion we were working with in our discussion of trees for models with two-object UDs. For example:

\begin{itemize}
\item $Aa \eif Ba$, $Af \eif Bf$, and $Ak \eif Bk$ are all substitution instances of $\forall x(Ax \eif Bx)$; the instantiating constants are $a$, $f$, and $k$, respectively.
\item $Raj$, $Rdj$, and $Rjj$ are substitution instances of $\exists zRzj$; the instantiating constants are $a$, $d$, and $j$, respectively.
\end{itemize}

With this terminology in hand, we can begin with our official tree rules.

\section{Existentials}

This will be our official tree rule for existentials:

\factoidbox{
\begin{center}
\begin{prooftree}
{not line numbering}
[\exists\script{x}\metaA{}, checked={\script{a}}
	[\metaA{}\substitute{\script{x}}{\script{a}}, just=where \script{a} is new]
]
\end{prooftree}
\end{center}
}

Just as \metaA{} stands in for any sentence of QL, the \script{x} is meant to stand in for any variable, and \script{a} stands in for any name. The requirement that the name be \emph{new} means that the name chosen for the substitution instance must be a name that has not appeared anywhere in the tree so far.

What is the rationale for this restriction? The existential claim says that some substitution instance is true, but it doesn't say which one it is. If we knew how many objects we were looking at in the UD, we could make a new branch for each object --- that's what we did in the examples above --- but here we see a different way to model this kind of flexibility. Remember, there is no prohibition in QL of two different names referring to the very same object. So by using an instance involving a new name, we are remaining open-minded about whether it is also a name for some object we've already been discussing.

For example, consider this tree:

\begin{prooftree}
{
}
[Fa
[\exists x \enot Fx, grouped, name=p2, checked=b
	[\enot Fb, just=$\exists$:p2]
]
]
\end{prooftree}

The appropriate substitution instance of the existential on line 2 is $Fb$, not $Fa$, because $a$ is a name that is already in use. We want to say that \emph{something} is not $F$, not necessarily that $a$ is. Had we taken the $a$ instance, the tree would have closed, even though the root is satisfiable. Note also that in marking the existential as having been processed, we also make a note of the instantiating constant. That's why there is a $b$ next to the check mark in line 2.

\section{Universals}

Here is the tree rule for universals.

\factoidbox{
\begin{center}
\begin{prooftree}
{not line numbering}
[\forall\script{x}\metaA{}, subs=\script{a}
	[\metaA{}\substitute{\script{x}}{\script{a}}, just=for any \script{a}
	]
]
\end{prooftree}
\end{center}
}

The universal rule, like the existential rule, invites you to take an instance. But unlike the existential rule, we don't limit ourselves to instances with new names. The other major difference is that one can use this rule multiple times. That makes this rule different from all the other tree rules we've seen so far. You're not necessarily finished processing a universal sentence after you've performed the rule once. We mark this by indicating a $\backslash$ instead of a \checkmark next to the universal sentence.

Here is an example illustrating the importance of taking multiple instances. Here is a partially completed tree.

\begin{prooftree}
{
}
[\forall x (Fx \eand Gx), name=p1, subs={a}
[\enot Fa \eor \enot Gb, grouped, name=p2, checked
	[Fa \eand Ga, name=p3, just=$\forall$:p1, checked
		[Fa, just=$\eand$:p3
		[Ga, grouped
			[\enot Fa, just=\eor:p2, close]
			[\enot Gb
%				[Fb \eand Gb, just=$\forall$:p1, checked, name=con
%					[Fb, just=\eand:con
%					[Gb, grouped, close
%					]
%					]
%				]
			]
		]
		]
	]
]
]
\end{prooftree}

The root of this tree is pretty obviously unsatisfiable, but so far, the tree hasn't closed. On line 3 we take the $a$ instance of the universal at line 1, but the tree won't close until we take the $b$ instance as well. We can do so at any time. In this way of developing the tree, we take that instance at line 7, and then the tree will close:

\begin{prooftree}
{
}
[\forall x (Fx \eand Gx), name=p1, subs={a,b}
[\enot Fa \eor \enot Gb, grouped, name=p2, checked
	[Fa \eand Ga, name=p3, just=$\forall$:p1, checked
		[Fa, just=$\eand$:p3
		[Ga, grouped
			[\enot Fa, just=\eor:p2, close]
			[\enot Gb
				[Fb \eand Gb, just=$\forall$:p1, checked, name=con
					[Fb, just=\eand:con
					[Gb, grouped, close
					]
					]
				]
			]
		]
		]
	]
]
]
\end{prooftree}

Of course, we could also have taken the $b$ instance at the same time as we took the $a$ instance on line 3, and the tree would have worked just as well. But taking things in this order illustrates that sometimes we can go back to universal claims that have already been considered, to take an additional instance. (Later on, we will see some examples of trees that \emph{require} this kind of backtracking.)

\section{Negated existentials}

Negated existential claims are quite similar to universals. They say that no instance is true, which is another way of saying that every instance is false. So like the universal rule, the negated existential rule will allow us to take as many instances as we like; this time, we take the instances of the \emph{negation} of the wff in the scope of the quantifier.

\factoidbox{
\begin{center}
\begin{prooftree}
{not line numbering}
[\enot\exists\script{x}\metaA{}, subs=\script{a}
	[\enot\metaA{}\substitute{\script{x}}{\script{a}}, just=for any \script{a}
	]
]
\end{prooftree}
\end{center}
}

For example, if $\enot\exists x Fx$ is in the tree, one can use the negated existential rule to develop a tree branch with \enot $Fa$, \enot $Fb$, etc.

\section{Negated universals}

Conversely, a negated universal is similar to an existential. It says that not all instances are true, so at least one instance is false. So like the existential rule, we only perform it once (marking it with a check), and ensuring that we use a new name, so as not to assume anything in particular about the instance chosen.

\label{negunrule}
\factoidbox{
\begin{center}
\begin{prooftree}
{not line numbering}
[\enot\forall\script{x}\metaA{}, checked={\script{a}}
	[\enot\metaA{}\substitute{\script{x}}{\script{a}}, just=where \script{a} is \emph{new}
	]
]
\end{prooftree}
\end{center}
}

\section{Whither branching?}

When we learned the tree rules for sentential connectives, there was an important distinction between \emph{linear} rules and \emph{branching} rules. We retained this when we assumed two-object domains in \S\ref{sec.fixedrules}, where universal quantifiers had linear rules, and existentials had branching rules. Our new quantifier rules, however, all have the same linear shape. Nothing branches. Why not?

In SL, and for QL models where finite domains were specified in advance, we used branching to represent the particular possible ways one could satisfy the formula above. For some interpretation \script{I} to satisfy $P \eor Q$, either $\script{I}(P)=1$ or $\script{I}(Q)=1$. If we assume there are only two objects, $a$ and $b$, then in order for \script{I} to satisfy $\exists x Fx$, \script{I} must either have $a$ in the extension of $F$ or have $b$ in the extension of $F$. So we can branch the tree to represent those two possibilities.

But if we do not assume anything in particular about the UD, we can't just list all the possible ways to satisfy an existential (or a negated universal). We'd need as many branches as there are objects in the UD. So instead we just take one instance, but give it a new name, which may or may not be co-referential with another name we've already considered. The novelty of the name is playing the functional role of branching.

\section{The other development rules}

So far this chapter we've introduced four tree development rules for QL: we have rules for universals, existentials, negated universals, and negated existentials. There are nine more resolution rules, but they are all familiar: they are the same nine resolution rules given in Chapter \ref{ch.sl.trees}. We'll use all the same resolution rules for conjunction, negated conjunction, disjunction, negated disjunction, conditional, negated conditional, biconditional, negated biconditional, and double negation as we did before. They were introduced on pp.\ \pageref{SL.treerules.start}--\pageref{SL.treerules.end}.

\section{Branch closure rules}
\label{branchclosure.defined}
Our branch closure rules also remain unchanged. A branch closes if and only if it contains some sentence \metaA{} along with its negation, \enot\metaA{}. We mark closed branches with an `\ensuremath\times'.

\section{Tree completion rules}

The completion rules, however, require a modification. The SL tree completion rule, given in \S\ref{sec.SL.tree.completion}, said that a branch was complete if every sentence, other than atoms and negated atoms, has been resolved. In the QL tree system we need for our tree completion rules to take account of the fact that some sentences need to be acted on multiple times. The universal rule, for example, lets one take whatever instance one likes; we need our completion rules to ensure that we've taken \emph{enough} instances.

For example, this should not count as a completed tree:

\begin{prooftree}
{
}
[\forall x (Fx \eif Ga), name=p1, subs=a
[\enot Ga, grouped
[Fb, grouped
	[Fa \eif Ga, checked
		[\enot Fa]
		[Ga, close]
	]
]
]
]
\end{prooftree}

Our universal rule can be processed multiple times. This tree has only taken the $a$ instance of $(Fx \eif Ga)$; if it also took the $b$ instance, the tree would close:

\begin{prooftree}
{
}
[\forall x (Fx \eif Ga), name=p1, subs={a,b}
[\enot Ga, grouped
[Fb, grouped
	[Fa \eif Ga, checked
		[\enot Fa
			[Fb \eif Ga, checked
				[\enot Fb, close]
				[Ga, close]
			]
		]
		[Ga, close]
	]
]
]
]
\end{prooftree}

We don't want this tree to count as complete until it's taken both the $a$ and the $b$ instance. The universal says that every instance must be true; we don't ensure that this is satisfied if only some instances have been taken.

If we knew how many names our model used, we could simply require that every instance be taken. But we don't know in advance how many names our models are going to use. QL trees construct their interpretations as they go. (Remember that resolving existentials and negated universals involves introducing new names.) Here is the requirement we want: we require that we've taken the instance corresponding to \emph{every name in the branch}. If, after taking an instance or two, we go on to introduce a new name within the same branch, that branch isn't complete until we've taken that instance as well. Once again, this is why we use the  $\backslash$ instead of a \checkmark. We can't be sure that we're finished with that line until we've done the rest of the tree.

A wff is \define{resolvable} if it is the kind of wff that gets a check mark upon processing it. (That's everything except for atoms, negated atoms, universals, and negated existentials.) A wff is \define{general} if it is a universal or a negated existential. Here is our new tree completion rule:

\label{branchcompletion.defined}
\factoidbox{
A branch is \define{complete} if and only if either (i) it is closed, or (ii) every resolvable sentence in the branch has been resolved, and for every general sentence and every name \script{a} in the branch, the \script{a} instance of that general sentence has been taken.

A tree is complete if and only if every branch in that tree is complete.
}

\section{Resolution order}

As in the SL tree system, the rules do not indicate any particular resolution order. But --- also as in the SL system --- some strategies are going to be more efficient than others. In fact, given the increased complexity of our rules and the fact that some resolutions introduce new names, it is even more important, from an efficiency perspective, than it used to be to employ sensible strategies. It is still a good idea to do linear rules before branching rules, and when possible, to perform a branching rule when you can see that one branch will close right away. Now, we can use similar strategies to take instances from general sentences in a strategic way. If you're not sure which instance to take first, look a step ahead and see if one of the instances will close a branch.

Here is a simple tree illustrating the point. Let's consider whether $Gb \eif \forall x \enot Fx$ and $\exists x Fx$ entail \enot $Gb$. We begin by putting the first two sentences and the negation of the third in the root of a tree:

\begin{prooftree}
{
}
[Gb \eif \forall x \enot Fx, name=p1%, checked
[\exists x Fx, grouped, name=p2%, checked=a
[\enot \enot Gb, grouped, name=p3
%	[\enot Gb, close={:p3, !c}, just=\eif:{p1}
%	]
%	[\forall x \enot Fx, subs={a}, name=all
%		[Fa, just=$\exists$:{p2}, name=fa
%			[\enot Fa, just=$\forall$:{all}, close={:fa, !c}
%			]
%		]
%	]
]
]
]
\end{prooftree}

Ordinarily, it is efficient not to branch too early. But in this case, if we look ahead a step, we can see that resolving the conditional on line 1 will close one branch immediately. So that's a good place to start.

\begin{prooftree}
{
}
[Gb \eif \forall x \enot Fx, name=p1, checked
[\exists x Fx, grouped, name=p2%, checked=a
[\enot \enot Gb, grouped, name=p3
	[\enot Gb, close={:p3, !c}, just=\eif:{p1}
	]
	[\forall x \enot Fx%, subs={a}, name=all
%		[Fa, just=$\exists$:{p2}, name=fa
%			[\enot Fa, just=$\forall$:{all}, close={:fa, !c}
%			]
%		]
	]
]
]
]
\end{prooftree}

From here we have three choices to consider: lines 2, 3, and 4. Line 3 pretty obviously won't get us anywhere interesting, so let's consider either the existential at line 2 or the universal at line 4. It's usually a good rule of thumb to do the new instances first --- that way we'll have more information when we make decisions about which instances to take for the general rules. So let's take the $a$ instance of line 2.

\begin{prooftree}
{
}
[Gb \eif \forall x \enot Fx, name=p1, checked
[\exists x Fx, grouped, name=p2, checked=a
[\enot \enot Gb, grouped, name=p3
	[\enot Gb, close={:p3, !c}, just=\eif:{p1}
	]
	[\forall x \enot Fx%, subs={a}, name=all
		[Fa, just=$\exists$:{p2}, name=fa
%			[\enot Fa, just=$\forall$:{all}, close={:fa, !c}
%			]
		]
	]
]
]
]
\end{prooftree}

Now we turn our attention to the universal at line 4. We can take whatever instance we want. Let's be intelligent about it. The $b$ instance wouldn't do anything interesting; $Fb$ won't interact with that \enot\enot $Gb$ in any helpful way. But the $a$ instance will close the tree. So we take that one.

\begin{prooftree}
{
}
[Gb \eif \forall x \enot Fx, name=p1, checked
[\exists x Fx, grouped, name=p2, checked=a
[\enot \enot Gb, grouped, name=p3
	[\enot Gb, close={:p3, !c}, just=\eif:{p1}
	]
	[\forall x \enot Fx, subs={a}, name=all
		[Fa, just=$\exists$:{p2}, name=fa
			[\enot Fa, just=$\forall$:{all}, close={:fa, !c}
			]
		]
	]
]
]
]
\end{prooftree}

Planning ahead can help make your trees more efficient. The general principle you should keep in mind is, if you have a choice for what resolvable sentence to resolve, or what instance of a general sentence to take, make a choice that will allow you to close branches more quickly.

\section{Infinite trees}

In the SL tree system, every development of the tree took us closer to a completed tree, because we checked sentences above as resolved, and wrote simpler sentences in one or two branches below. SL trees are guaranteed to be completed in a finite number of steps --- they will either close, or they will reach a point where everything resolvable has been resolved.

Because of the way our QL system works, it is possible for trees to continue indefinitely without closing. General sentences require that instances be taken for all names in the branch; but the rules for existentials and negated universals require that new names be introduced. Often, we can introduce the new names before dealing with the general instances, as in this completed tree:

\begin{prooftree}
{
}
[\exists x Fx, name=p1, checked=a
[\forall x Gx, grouped, name=p2, subs={a}
	[Fa, just=$\exists$:{p1}
	[Ga, just=$\forall$:{p2}, open
	]
	]
]
]
\end{prooftree}

In this tree, we introduce the name $a$ for the existential, then take the instance for the one and only name in the branch for the universal, and the tree is complete. But things won't always be so simple. Consider a tree with this single sentence in its root: $\forall x \exists y Rxy$. In this case, we must begin by performing the universal rule, as our one and only sentence is a universal. This rule allows us to take an instance with any name. Ordinarily, we use the names that already exist in the branch, but since there are no names, we'll just take the $a$ instance from the start, putting that instance --- an existential --- on line 2.

To resolve that existential, we must use a new name. So on line 3, we take the $b$ instance from line 2.

\begin{prooftree}
{
}
[\forall x \exists y Rxy, name=p1, subs={a}
	[\exists y Ray, just=1 $\forall$, checked=b
		[Rab, just=2 $\exists$
		]
	]
]
\end{prooftree}

This tree has not closed, but note that it is not complete. We haven't taken the $b$ instance of the universal on line 1. When we do so, we will find ourselves with another existential on line 4; it in turn requires an instance involving a new name, and the process will continue indefinitely.

\begin{prooftree}
{
}
[\forall x \exists y Rxy, name=p1, subs={a,b,c}
	[\exists y Ray, just=1 $\forall$, checked=b
		[Rab, just=2 $\exists$
			[\exists y Rby, just=1 $\forall$, checked=c
				[Rbc, just=4 $\exists$
					[\exists y Rcy, just=1 $\forall$, checked=d
						[Rcd, just=5 $\exists$
							[\vdots]
						]
					]
				]
			]
		]
	]
]
\end{prooftree}

As the pattern makes clear, this tree will never close, but it will also never be complete. It will just keep taking instances of an existential with new names, then taking those instances of the universal, which in turn require a new existential, and so on. (Eventually we will run out of letters, but we have subscripts available too, so we'll never run out of names.) Because the tree will never close, its open branch is describing a model that satisfies the root, but the model suggested is an infinite one. Line 3 tells us that \ntuple{a, b} should be in the extension of $R$; line 5 says that \ntuple{b, c} should too. There is a clear pattern that tells us what $R$'s extension must be like:

\begin{partialmodel}
	\extension{R} & $ \{\ntuple{a, b}, \ntuple{b, c}, \ntuple{c, d}, \ntuple{d, e}, \ldots\}$
\end{partialmodel}

Or we can represent it graphically, thus:

\begin{partialmodel}
	\extension{R} & \begin{tabular}{l|lllll}
$Rxy$   & a & b & c & d & \ldots \\ \hline
a   & - & 1 & - & - & -   \\
b   & - & - & 1 & - & -   \\
c   & - & - & - & 1 & -   \\
d   & - & - & - & - & 1   \\
\vdots & - & - & - & - & -
\end{tabular}
\end{partialmodel}

The blanks indicate that it doesn't matter whether those pairs fall under the extension of $R$ or not.

What this suggests is that if one had a UD comprising an infinite list of objects, with each object related via $R$ to the next item in the list, this model would satisfy the root of the tree. For example, suppose that our UD were the set of all natural numbers, and that we interpreted $Rxy$ as $x+1=y$. For every number $x$, there is a number $y$ that is equal to $x+1$.

Note, however, that this is only one of many possible ways to construct a model meeting the constraint described. In fact, we don't necessarily require that our UD be infinite. Our tree ended up using an infinite number of names, but there's no rule requiring that each name be assigned to a unique object.

The extension of $R$ requires that certain pairs be included. Note that it doesn't require that any pairs be excluded. There are no 0s in the chart above. The blanks mean it doesn't matter whether you include them. A model that included every ordered pair in the extension of $R$ would be an example of the kind of model indicated:

\begin{table}[h!]
\centering
\begin{tabular}{l|lllll}
$Rxy$   & a & b & c & d & \ldots \\ \hline
a   & 1 & 1 & 1 & 1 & 1  \\
b   & 1 & 1 & 1 & 1 & 1  \\
c   & 1 & 1 & 1 & 1 & 1   \\
d   & 1 & 1 & 1 & 1 & 1   \\
\vdots & 1 & 1 & 1 & 1 & 1
\end{tabular}
\end{table}

Once we put it this way, we can see that the $R$ predicate needn't draw any distinctions between the various objects in the domain. Each object could be the same, as far as $R$ is concerned. So we could even offer a simpler model, with a UD comprising a simple object that is $R$-related to itself.

\begin{partialmodel}
	UD & \{a\}\\
	\extension{R} & \{\ntuple{a, a}\}
\end{partialmodel}

When a tree continues indefinitely, the root is satisfiable; you can describe a model for it using an infinite domain, taking advantage of the pattern indicated by the infinite branch; or you can often find a way to simplify it into a model with a finite UD.

Let's consider another example of an infinite tree. This time, we'll use names with subscripts. Everything is straightforward up until line 6; at line 7, we need to go back and take a second instance of line 2, and the infinite cycle begins.

\begin{prooftree}
{
}
[\exists x \forall y \exists z (\enot Rxy \eand Rzx), checked={a_{1}}
	[\forall y \exists z (\enot Ra_{1}y \eand Rza_{1}), just=1 $\exists$, subs={a_{1}, a_{2}, a_{3}}
		[\exists z (\enot Ra_{1}a_{1} \eand Rza_{1}), just=2 $\forall$, checked={a_{2}}
			[\enot Ra_{1}a_{1} \eand Ra_{2}a_{1}, just=3 $\exists$, checked
				[\enot Ra_{1}a_{1}, just=4 \eand
				[Ra_{2}a_{1}, grouped
					[\exists z (\enot Ra_{1}a_{2} \eand Rza_{1}), just=2 $\forall$, checked={a_{3}}
						[\enot Ra_{1}a_{2} \eand Ra_{3}a_{1}, just=8 $\exists$, checked
							[\enot Ra_{1}a_{2}, just=9 \eand
							[Ra_{3}a_{1}, grouped
								[\exists z (\enot Ra_{1}a_{3} \eand Rza_{1}), just=2 $\forall$, checked={a_{4}}
									[\enot Ra_{1}a_{3} \eand Ra_{4}a_{1}, just=11 $\exists$, checked
										[\enot Ra_{1}a_{3}, just=9 \eand
										[Ra_{4}a_{1}, grouped
											[\vdots]
										]
										]
									]
								]
							]
							]
						]
					]
				]
				]
			]
		]
	]
]
\end{prooftree}

If we continued drawing the tree, we'd take the $a_{4}$ instance of the universal at line 2 on line 15, then introduce a new name by resolving that universal. The tree will continue forever, again with a clear pattern. Lines 5, 9, 13, etc.\ tell us that for every integer $i$, $Ra_{1}a_{i}$=0. Lines 6, 10, 14, etc.\ tell us that for every $i > 1$, $Ra_{i}a_{1}$=1. Or in chart form:

\begin{table}[h!]
\centering
\begin{tabular}{l|lllll}
$Rxy$   & $a_{1}$ & $a_{2}$ & $a_{3}$ & $a_{4}$ & \ldots \\ \hline
$a_{1}$   & 0 & 0 & 0 & 0 & 0  \\
$a_{2}$   & 1 & - & - & - & -  \\
$a_{3}$  & 1 & - & - & - & -   \\
$a_{4}$   & 1 & - & - & - & -   \\
\vdots & 1 & - & - & - & -
\end{tabular}
\end{table}

This chart describes the extension of $R$ that, as part of a model with the infinite UD \{$a_{1}$, $a_{2}$, $a_{3}$, \ldots\}, would satisfy $\exists x \forall y \exists z (\enot Rxy \eand Rzx)$. As in the previous example, we do not \emph{need} an infinite model to satisfy this sentence; the extension of $R$ here can be collapsed into a finite one. In the previous example, our extension required no distinctions between any of the objects; here, we do have some required differences. $Ra_{1}a_{1}=0$, but $Ra_{2}a_{1}=1$. So our model is treating $a_{1}$ and $a_{2}$ differently. But it requires no further distinctions than that. Every object after $a_{2}$ can be the same as $a_{2}$, as far as this model is concerned.  So a two-object model would also suffice to satisfy this sentence. Here is a graphical representation of the denotation for $R$:

\begin{table}[h!]
\centering
\begin{tabular}{l|lllll}
$Rxy$   & $a_{1}$ & $a_{2}$ \\ \hline
$a_{1}$   & 0 & 0   \\
$a_{2}$   & 1 & - \\
\end{tabular}
\end{table}

Or, describing the model in question with sets and n-tuples:

\begin{partialmodel}
	UD & \{$a_{1}$, $a_{2}$\}\\
	\extension{R} & \{\ntuple{$a_{2}$, $a_{1}$}\}
\end{partialmodel}

The reasoning involved in collapsing models with infinite domains into finite ones centrally involves reasoning about what distinctions are required: do we need to suppose that the objects named are \emph{different objects}, or can we treat it as a case of multiple names for the \emph{same thing}. In Chapter \ref{ch.identity}, we'll foreground this kind of question in more detail, and introduce a way to talk about it in QL.

Note that, for purposes of answering questions about entailment, you needn't go through the reasoning that allows you to move from infinite models to finite ones that would serve just as well. The tree method, most fundamentally, is a question about whether there is any possible model of the root. If a tree continues infinitely, then it is answering that question: yes, there is an infinite model for it. It's not necessary, for the question of whether there is any model satisfying the root, to determine whether there is a \emph{finite} model that does so.

\section{Common student errors}

\subsection{Using old names}

The most frequent errors for trees in QL involve ignoring the restrictions on names involved in taking instances. Particular sentences (existentials and negated universals) require a \emph{new} name --- if the name appears anywhere in the branch at the time the existential is taken (including below it), it is not suitable for substitution via these rules.

For example, this tree is a mistake:

\begin{prooftree}
{
}
[\forall x \exists y \enot Rxy, subs={a}
[Rab, grouped
	[\exists y \enot Ray, just=1 $\forall$, checked=b
		[\enot Rab, just=3 $\exists$, close={2, 4}
		]
	]
]
]
\end{prooftree}

Line 3 here is fine; but at line 4, this tree takes the $b$ instance of the existential on line 3, even though $b$ appeared in line 2. The existential rule requires a new name. The correct version of this tree will remain open. (It will extend infinitely.)

\subsection{Main Connectives}

Always work on the main connectives. If you have a sentence like $$\forall x \exists y \enot Ryx \eand (Fa \eif Fb)$$ don't use the universal rule. This sentence is a conjunction, so you must perform the conjunction rule on it. That will give you a universal, at which point you can take an instance.

\practiceproblems

\solutions
\problempart
\label{pr.QL.trees.tautology}
Use a tree to test whether the following sentences are tautologies. If they are not tautologies, describe a model on which they are false.
\begin{earg}
\item $\forall x \forall y (Gxy \eif \exists z Gxz)$
\item $\forall x Fx \eor \forall x (Fx \eif Gx)$
\item $\forall x (Fx \eif (\enot Fx \eif \forall y Gy))$
\item $\exists x (Fx \eor \enot Fx)$
\item $\exists x Jx \eiff \enot \forall x \enot Jx$
\item $\forall x (Fx \eor Gx) \eif (\forall y Fy \eor \exists x Gx)$
\end{earg}

\solutions
\problempart
\label{pr.QL.trees.validity}
Use a tree to test whether the following argument forms are valid. If they are not, give a model as a counterexample.
\begin{earg}
\item $Fa$, $Ga$, \therefore\ $\forall x (Fx \eif Gx)$
\item $Fa$, $Ga$, \therefore\ $\exists x (Fx \eand Gx)$
\item $\forall x \exists y Lxy$, \therefore\ $\exists x \forall y Lxy$
\item $\exists x (Fx \eand Gx)$, $Fb \eiff Fa$, $Fc \eif Fa$, \therefore\ $Fa$
\item $\forall x \exists y Gyx$, \therefore\ $\forall x \exists y (Gxy \eor Gyx)$
\end{earg}

\problempart
\label{pr.QL.trees.translation.and.validity}
Translate each argument into QL, specifying a UD, then use a tree to evaluate the resulting form for validity. If it is invalid, give a model as a counterexample.
\begin{earg}
\item Every logic student is studying. Deborah is not studying. Therefore, Deborah is not a logic student.
\item Kirk is a white male Captain. Therefore, some Captains are white.
\item The Red Sox are going to win the game. Every team who wins the game will be celebrated. Therefore, the Red Sox will be celebrated.
\item The Red Sox are going to win the game. Therefore, the Yankees are not going to win the game.
\item All cats make Frank sneeze, unless they are hairless. Some hairless cats are cuddly. Therefore, some cuddly things make Frank sneeze.
\end{earg}


\documentclass{article}
\usepackage[utf8]{inputenc}

\title{MAT257 Notes}
\author{Jad Elkhaleq Ghalayini}
\date{January 28 2019}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{cancel}

\usepackage[margin=1in]{geometry}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{definition}{Definition}
\newtheorem*{corollary}{Corollary}
\newtheorem{exercise}{Exercise}
\newtheorem{claim}{Claim}

\DeclareMathOperator{\Int}{Int}
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\Ker}{Ker}
\DeclareMathOperator{\Ima}{Im}
\DeclareMathOperator{\Vol}{vol}

\newcommand{\reals}[0]{\mathbb{R}}
\newcommand{\nats}[0]{\mathbb{N}}
\newcommand{\ints}[0]{\mathbb{Z}}
\newcommand{\rationals}[0]{\mathbb{Q}}
\newcommand{\brac}[1]{\left(#1\right)}
\newcommand{\sbrac}[1]{\left[#1\right]}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\eval}[3]{\left.#3\right|_{#1}^{#2}}
\newcommand{\ip}[2]{\left\langle#1,#2\right\rangle}
\newcommand{\prt}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\mb}[1]{\mathbf{#1}}
\newcommand{\hlfspc}[0]{\mathbb{H}}
\newcommand{\loint}[0]{\operatorname{L}\int}
\newcommand{\hiint}[0]{\operatorname{U}\int}
\newcommand{\indic}[1]{\chi_{#1}}

\begin{document}

\maketitle

\section{Change of Variable}
Today we're going to finish our proof of the Change of Variables theorem. We've found in the previous lectures that it's enough to show that, for every \(a \in A\), there is a Jordan measurable open neighborhood \(U\) of \(a\) with closure \(A\) so that the result is true on \(U\) in the case where we are integrating the function \(f = 1\). Furthermore, we have shown that we can assume that \(g'(a) = I\). We also expressed \(g\) as a composite of two functions, each of which changes fewer than \(n\) variables. More precisely, we wrote
\begin{equation}
  g = (x \mapsto  (g_1(x),...,g_{n - 1}(x), x_n)) \circ (y \mapsto (y_1,...,y_{n - 1},g_n(h^{-1}(y))))
\end{equation}
We will proceed by induction, using the single variable case as a base case.

We can work with any Jordan-measurable open neighborhood of \(a\), so let's work with an open rectangle. Consider specifically an open rectangle \(W\) containing \(a\) with closure in \(A\). Since we're separating one coordinate from the other \(n - 1\) coordinates, let's write \(W\) as \(D \times (a_n, b_n)\) where \(D\) is an open rectangle in \(\reals^{n - 1}\). Note that the transformation \(h\) does not change the \(n^{th}\) coordinate of it's input. Using this, we can consider the following:
\begin{equation}
  \int_{h(W)}1
\end{equation}
For a fixed \(x_n\), let's consider the function given by \(h\), depending only on \(1,...,n - 1\), written
\begin{equation}
  h_{x_n} : D \to \reals^{n - 1},
  h_{x_n}(x_1,...,x_{n - 1})(g_1(x_1,...,x_n),...,g_{n - 1}(x_1,...,x_n))
\end{equation}
This function is one to one, since we know that \(h\) is one to one, and \(h\) is just \(h_{x_n}\) with \(x_n\) appended (for each \(x_n\)), so two different values at a given \(x_n\) have got to go into different points. On the other hand, what is the determinant
\begin{equation}
  (\det h'_{x_n})(x_1,...,x_{n - 1})
\end{equation}
Well, it's the same as the determinant of \(h'\), since the last row of \(h'\) is just the standard vector \(e_n\). So let's go back: first of all,
\begin{equation}
  h(D \times \{x_n\}) = h_{x_n}(D) \times \{x_n\}
\end{equation}
since, like we said before, the \(n^{th}\) coordinate is unaffected. So we can proceed using Fubini's theorem,:
\begin{equation}
  \int_{a_n}^{b_n}\left(\int_{h_{x_n}(D)}1\right)dx_n
\end{equation}
By induction, this is equal to
\begin{equation}
  \int_{a_n}^{b_n}\int_D1|\det h'_{x_n}| = \int_{a_n}^{b_n}\int_D|\det h'| = \int_{D \times [a_n, b_n]}1 \cdot |\det h'| = \int_W 1 \cdot |\det h'|
\end{equation}
By strong induction, the theorem is also true for \(k\), giving the desired result.

Now that we finished this, what to do? We've been talking about the integral on \(\reals^n\). In the rest of the course, we're going to be talking about the integral but on a manifold.

\section{Integration on a Manifold}

We haven't talked about manifolds for a while, but I hope you can remember how to imagine one because I'm too lazy to {\LaTeX} one. So what's the point of integrating on our imaginary manifold picture? We know how to integrate on a line, and how to integrate now in \(\reals^n\), and in both cases we're integrating with some notion of \(n\)-dimensional volume. But now, on our \(k\)-dimensional manifold, we're going to have to try to figure out how to integrate using a \(k\)-dimensional measure of volume on it, which is nontrivial.

Another reason is the following: if we go back to one dimensional calculus, and we want to compue the integral of some function \(f\) from \(a\) to \(b\), the very important and aptly named Fundamental Theorem of Calculus tells us that if \(f\) has a primitive \(g\) it's integral is very easy to compute:
\begin{equation}
  \int_a^bf = g(b) - g(a)
\end{equation}
We want to try to do the same thing with a manifold: generalize the fundamental theory of calculus to relate the integral of a function on the manifold to the integral of a function on the boundary. But what sense does that make? A function on a manifold, unlike that on a line, depends on many variables. So we don't have a notion of primitive like in single variable calculus, since an \(n\) dimensional function has many partial derivatives.

So those are the two things we're going to have to understand to get started:
\begin{itemize}
  \item What is this \(k\) dimensional measure of volume?
  \item What is the appropriate notion of a primitive?
\end{itemize}
But before that, we're going to do a bit of motivation, and consider the case of a one-dimensional manifold, or as you know it, a curve:

\subsection{Case of a Parametrized Curve \(C\) in \(\reals^n\)}

So what does that mean, a parametrized curve? It means \(C\) is the image of a mapping
\begin{equation}
  \gamma : [a, b] \to \reals^n
\end{equation}
We could write, for example, \(x = \gamma(t)\). We're going to assume that our curves define something almost like a manifold, except we're going to allow that the curves cross each other. So assume that \(\gamma\) is \underline{piecewise \(\mc{C}^1\)}. What this means is, except for some finite number of points (since we're working on a compact interval), it's \(\mc{C}^1\). Furthermore, we assume that except for isolated points, \(\gamma' \neq 0\) and \(\gamma\) is one to one.
We don't want to allow, for example,
\begin{equation}
  \gamma(t): [0, 3\pi] \to \reals^2 = t \mapsto (\cos t, \sin t)
\end{equation}
since we don't want a whole big region (in this case a semicircle) where \(\gamma\) overlaps itself.

So the first item of business is: what's the measure of volume on such a curve? Length, of course. Arc length, specifically. We have that
\begin{equation}
  \ell(C) = \int_a^b|\gamma'(t)|dt
\end{equation}
We're not assuming that people have seen this before, so the question is, why? Let's deal with length in a more concrete, geometric way. How can you do that? In the same way that you define the integral: you try to approximate by something that is easy to compute. So one good way to approximate length is to divide up the integral into a partition and look at the corresponding line segments: we define length as the supremum of the length of polygonal approximations to the curve.

Let's let \(P = \{t_0,t_1,...,t_k\}\) be a partition of \([a, b]\), and let \(\ell_P(C)\) be the length of the associated polygonal approximation:
\begin{equation}
  \ell_p(C) = \sum_{j = 1}^k|\gamma(t_j) - \gamma(t_{j - 1})|
\end{equation}
We'll say that the curve has length if the supremum of these things exists, and we'll define it as the length. Formally,
\begin{definition}
  The curve \(C\) is \underline{rectifiable} if
  \begin{equation}
    \sup_P\ell_P(C)
    \label{lensupremum}
  \end{equation}
  exists, in which case we define \ref{lensupremum} it to be the \underline{length} of \(C\), written \(\ell_P(C)\).
\end{definition}
Here's a brief homework exercise: prove that if \(\gamma\) is piecewise \(\mc{C}^1\), then \(C\) is rectifiable and \(\ell(C)\) is given by equation \ref{lensupremum}. This is a first year calculus exercise using Riemann sums (I think it's in Spivak), so it shouldn't be too hard.

\end{document}


\documentclass[a4paper]{article}

%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}

%% Sets page size and margins
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}

%% Useful packages
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}

\title{Judson's Abstract Algebra: Chapter 5}
\date{}

\begin{document}
\maketitle

\section*{1}

Write the following permutations in cycle notation

$$
\begin{pmatrix}
1 & 2 & 3 & 4 & 5 \\
2 & 4 & 1 & 5 & 3
\end{pmatrix}
= (12453)$$

$$
\begin{pmatrix}
1 & 2 & 3 & 4 & 5 \\
4 & 2 & 5 & 1 & 3
\end{pmatrix}
= (14)(35)$$

$$
\begin{pmatrix}
1 & 2 & 3 & 4 & 5 \\
3 & 5 & 1 & 4 & 2
\end{pmatrix}
= (13)(25)$$

$$
\begin{pmatrix}
1 & 2 & 3 & 4 & 5 \\
1 & 4 & 3 & 2 & 5
\end{pmatrix}
= (24)$$

\section*{2}

Compute each of the following

$$(1345)(234) = (135)(24)$$
$$(12)(1253) = (253)$$
$$(143)(23)(24) = (14)(23)$$
$$(1423)(34)(56)(1324) = (12)(56)$$
$$(1254)(13)(25) = (1324)$$
$$(1254)(13)(25)^2 = (1254)(13) = (13254)$$
$$(1254)^{-1}(123)(45)(1254) = (1432)(123)(45)(1254) = (134)(25)$$
$$(1254)^2(123)(45) = (14)(235)$$
$$(123)(45)(1254)^{-2} = (123)(54)(1452)^2 = (143)(25)$$
$$(1254)^{100} = ((1254)^4)^{25} = (1)^{25} = (1)$$
$$|(1254)| = 4$$
$$|(1254)^2| = 2$$
$$(12)^{-1} = (12)$$
$$(12537)^{-1} = (17352)$$
$$[(12)(34)(12)(47)]^{-1} = [(34)(47)]^{-1} = (374)$$
$$[(1235)(467)]^{-1} = (1532)(476)$$

\section*{3}

Express the following permutations as products of transpositions and identify them as even or odd.

$$(14356) = (14)(43)(35)(56)$$
$$(156)(234) = (15)(56)(23)(34)$$
$$(1426)(142) = (1246) = (12)(24)(46)$$
$$(17254)(1423)(154632) = (14672) = (14)(46)(67)(72)$$
$$(142637) = (14)(42)(26)(63)(37)$$

\section*{4}

Find $(a_1, a_2, ..., a_n)^{-1}$.

$$(a_1, a_2, ..., a_n)^{-1} = (a_1, a_n, a_{n-1}, ..., a_2)$$

\section*{8}

Show that $A_8$ contains an element of order 15.

\vspace{\baselineskip}

Note that $(12345)(678)$ has order 15. To show that $(12345)(678)$ has even order, consider

$$(12345)(678) = (12)(23)(34)(45)(67)(78).$$

\section*{9}

Does $A_8$ contain an element of order 26?

\vspace{\baselineskip}

No. Notice that since $A_8$ must contain cycles of length $x \in \{ 1, ... , 8 \}$. Also notice that for a product of any two disjoint cycles $\sigma, \tau \in A_8$ with lengths of $x_{\sigma}$ and $x_{\tau}$ the length of their product is given by

$$x_{\sigma \tau} = x_{\tau \sigma} = x_{\tau} x_{\sigma} / \gcd(\tau, \sigma).$$

Since $8 < 26$ and $13 \not \in \{ 1, ... , 8 \}$ it follows that $A_8$ does not contain an element of order 26.

\section*{10}

Find an element of largest order in $S_n$ for $n = 3, ... , 10.$

\vspace{\baselineskip}

\section*{17}

Prove that $S_n$ is nonabelian for $n \geq 3$.

\vspace{\baselineskip}

Notice that the following are two unequal products in $S_n$ for all $n \geq 3$

$$(123)(12) = (13) \neq (23) = (12)(123).$$

\section*{24}

Show that a 3-cycle is an even permutation.

\vspace{\baselineskip}

Consider a 3-cycle $(a_1, a_2, a_3)$. Notice that

$$(a_1, a_2, a_3) = (a_1, a_2)(a_2, a_3).$$

This proves that all 3-cycles are even permutations.

\section*{27}

Let $G$ be a group and define a map $\lambda_g : G \rightarrow G$ by $\lambda_g(a) = ga$. Prove that $\lambda_g$ is a permutation of $G$.

\vspace{\baselineskip}

We must show that $\lambda_g$ is a bijection. Let $x_1, x_2 \in G$. Since

\begin{align*}
\lambda_g(x_1) &= \lambda_g(x_2) \\
gx_1 &= gx_2 \\
g^{-1} g x_1 &= g^{-1} g x_2 \\
x_1 &= x_2
\end{align*}

it is true that $\lambda_g$ is injective. Notice that since

$$g (g^{-1} x_1) = x_1$$

it is true that $\lambda_g$ is surjective.

\section*{28}

Prove that there exist $n!$ permutations of a set containing $n$ elements.

\vspace{\baselineskip}

Notice that the first element has $n$ possibilities, the second element  has $n-1$ possibilities ... the last element has $1$ possibility. This yields

$$n(n-1)...1 = n!.$$

\section*{34}

If $\alpha$ is even, prove that $\alpha^{-1}$ is even. Does a corresponding result hold if $\alpha$ is odd?

\vspace{\baselineskip}

First note that the identity permutation is even. Assume that $\alpha^{-1}$ is odd. Then note that $\alpha \alpha^{-1} = (1)$ implies that the identity is odd, a contradiction. The proof for the corresponding result when $\alpha$ is odd is identical.

\section*{35}

Show that $\alpha^{-1} \beta^{-1} \alpha \beta$ is even for $\alpha, \beta \in S_n$.

\vspace{\baselineskip}

First note that by problem 34 $x^{-1}$ is even if $x$ is even and odd if $x$ is odd for all $x \in S_n$. There are 4 (nearly identical cases). If $\alpha$ and $\beta$ are even then $\alpha^{-1}$ and $\beta^{-1}$ are even as well. Clearly $\alpha^{-1} \beta^{-1} \alpha \beta$ is even. If $\alpha$ and $\beta$ are odd then $\alpha^{-1}$ and $\beta^{-1}$ are odd as well. Since an odd plus an odd is an even, clearly $\alpha^{-1} \beta^{-1} \alpha \beta$ is even. The final two cases are the same. Without loss of generality assume $\alpha$ is even and $\beta$ is odd. Then $\alpha^{-1}$ is even and $\beta^{-1}$ is odd. Since an odd plus an odd is an even, clearly $\alpha^{-1} \beta^{-1} \alpha \beta$ is even.

\end{document}


\SecDef{minimal}{Minimal and Maximal Zero-Sum Sets}

In this section we study zero-sum sets of particular rank $n$ and prove results on their existence. We are particularly interested in the smallest of such sets, defined in the following sense.
\begin{definition}
We denote by $\minzs{n}{d}$ the minimum number $m \in \ZZplus$ for which there exists an $S \in \ZS{n}{m}{d}$. We call a zero-sum set \emph{minimal} if it is contained in $\ZS{n}{\minzs{n}{d}}{d}$. Analogously, a zero-sum set $S \in \ZS{n}{m}{d}$ is called \emph{maximal} if $\ZS{n'}{m}{d} = \varnothing$ for all $n' > n$.
\end{definition}

Note that $\minzs{n}{d}$ is only defined if $n > d$ as otherwise, the only degree-$d$ zero-sum set in $\F_2^n$ is the empty set. We first characterize the zero-sum sets of particular rank $n$ in terms of Boolean functions.

\subsection{Relations between Zero-Sum Sets and Affine Annihilators of Boolean Functions}

The first three existence results are presented in \PropRef{annihilator_construction}, \PropRef{annihilator_construction2} and \PropRef{max_annihilator_construction} and outline the link between zero-sum sets and the dimensions of degree-$1$ annihilator spaces of Boolean functions.
\begin{proposition}
\PropLabel{annihilator_construction}
There exists a degree-$d$ zero-sum set $S \in \ZS{n}{m}{d}$ if and only if there exists a Boolean function $h \in \BF{n}{n-d-1}$ with $\wt(h) = m$ and $\dim \AN_1(h) \leq 1$.
\end{proposition}
\begin{proof}
Let us assume that $S \in \ZS{n}{m}{d}$ is given in systematic form, i.e., it can be represented as in \EqRef{systematic_form}. Then, $S = \supp(h)$ for a Boolean function $h \in \BF{n}{n-d-1}$ for which $\forall i\in \{1,\dots,n\}: h(e_i) = 1$. Such a function cannot have a linear annihilator and therefore, any $a \in \AN_1(h) \setminus \{0\}$ must be of the form $a = \ell+1$ for a linear Boolean function $\ell$. It follows that $\dim AN_1(h) \leq 1$.

Let now $h \in \BF{n}{n-d-1}$ with $\wt(h) = m$ and $\dim \AN_1(h) \leq 1$. Let $a \in \AN_1(h) \setminus \{0\}$. If $a = \ell + 1$ for a linear function $\ell$, then $h$ has no linear annihilator. If $a$ is linear, we fix a constant $c \in \F_2^n$ for which $a(c)=1$ and consider the function $h_c\colon x \mapsto h(x+c) \in \BF{n}{n-d-1}$ which is domain affine equivalent to $h$ and thus has the same weight. It is easy to verify that $a+1$ is an affine annihilator for $h_c$. Because the dimensions of the annihilator spaces are invariant under domain affine equivalence, $h_c$ has no linear annihilators. Therefore, without loss of generality, we can assume that $h$ has no linear annihilator. Let $S = \supp(h) \subseteq \F_2^n$ be the support of $h$ and consider a matrix $\matzs{S}$ the columns of which form exactly the set $S$. Since $h$ has no linear annihilator, there is no linear combination of rows of $\matzs{S}$ that is equal to zero. We conclude that $\matzs{S}$ has full rank $n$ and $S\in \ZS{n}{m}{d}$.
\end{proof}

\begin{proposition}
\PropLabel{annihilator_construction2}
Given a function $h \in \BF{n}{n-d-1}$ with $\wt(h) = m$ and $\AN_1(h) = \{0\}$, it is possible to construct a zero-sum set in $\ZS{(n+1)}{m}{d}$.
\end{proposition}
\begin{proof}
Consider the function \[h': \F_2^{n+1} \to \F_2, (x_1, \ldots, x_{n+1}) \mapsto x_{n+1} h(x_1, \ldots, x_n)\;.\] Note that $h'$ has degree at most $n-d$. Further, $h'$ has no linear annihilator. Otherwise, by setting $x_{n+1} = 1$, we would obtain that $h$ has an annihilator of algebraic degree $1$, contradicting $\AN_1(h) = \{0\}$. By \PropRef{annihilator_construction}, we can construct $S \in \ZS{(n+1)}{m}{d}$.
\end{proof}

The converse statement is true for maximal zero-sum sets.

\begin{proposition}
\PropLabel{max_annihilator_construction}
Let $n \geq 2$ and let $S \in \ZS{(n+1)}{m}{d}$ be maximal. Then, $\Ind_S$ is domain linear equivalent to a function $h \in \BF{n+1}{n-d}$ of the form
\eql{annihilator_reduce}{
    h(x_1,\dots,x_{n+1}) = x_{n+1}\cdot g(x_1,\dots,x_{n}),
}
where $g \in \BF{n}{n-d-1}$ with $\wt(g) = \wt(h) = m$ and $\AN_1(g) = \{0\}$. Further, if $m < 2^{n-1}$, then $\AI(g) \geq 2$.
\end{proposition}
\begin{proof}
Let $\matzs{S}$ be a matrix which columns correspond to the elements of $S$. Because $S$ is maximal, the vector subspace of $\F_2^m$ spanned by the rows of $\matzs{S}$ must contain the all-1 vector $\idvec{n} \coloneqq (1,1,\dots,1)$. Otherwise, one would obtain a zero-sum set in $\ZS{(n+2)}{m}{d}$ defined by the matrix
$$
\coltwo{\matzs{S}}{\idvec{n}}.
$$
Therefore, we can apply a linear permutation $A$ on the columns of $\matzs{S}$ such that $\Ind_{A(S)} = h$ where $h \in \BF{n+1}{n-d}$ is of the form as given in \EqRef{annihilator_reduce} with $g \in \BF{n}{n-d-1}$ and $\wt(g) = \wt(h)$. It is left to show that $\AN_1(g) = \{0\}$.

Clearly, $g$ cannot have a linear annihilator. We assume now that $g$ has an annihilator of degree $1$ of the form $(x_1,\dots,x_n) \mapsto 1+\bigoplus_{i=1}^{n}a_ix_i$. Then, $g(x)=0$ for all $x$ with $\bigoplus_{i=1}^{n}a_ix_i = 0$. Let $j$ be such that $a_j = 1$. For the linear permutation $Q:\field{n} \to \field{n}$, $Q(x_1, \ldots, x_{n}) = (x_1, \ldots, x_{j-1}, \bigoplus_{i=1}^{n}a_ix_i, x_{j+1}, \dots, x_{n})$, we have
\[ g(Q(x_1,\dots,x_{n})) = x_{j}\cdot g'(x_1,\dots,x_{j-1},x_{j+1},\dots,x_{n})\;\] for a function $g' \in \BF{n-1}{n-d-2}$. But this means that $h$ is linear-equivalent to a function of the form $(x_1,\dots,x_{n+1}) \mapsto x_{n+1}\cdot x_{n}\cdot g'(x_1, \ldots, x_{n-1})$, which has a linear annihilator $x_{n+1}+x_{n}$. We get a contradiction and conclude that $\AN_1(g) = \{0\}$.

If $m < 2^{n-1}$, it is easy to see that $g+1$ cannot admit an annihilator of algebraic degree $1$. Suppose that $a \in \AN_1(g+1)\setminus \{0\}$. Then, $\wt(a) = 2^{n-1}$ and $ag = a$, which is impossible.
\end{proof}

As \PropRef{max_annihilator_construction} only holds for maximal zero-sum sets we cannot use it to establish an equivalence between minimal degree-$d$ zero-sums of rank $n+1$ and $n$-bit Boolean functions of degree $n-d-1$ with algebraic immunity at least 2 and minimum weight. We therefore propose the following question:

\begin{question}
\Label{q:minimal-maximal}
Let $S \in \ZS{n}{F(n,d)}{d}$ be minimal. What are necessary and sufficient conditions for $S$ to be maximal?
\end{question}

\subsection{Minimal Zero-Sum Sets: Bounds and Values for $\minzs{n}{d}$}
In order to derive values for $\minzs{n}{d}$, we basically have to study the Boolean functions that admit at most one annihilator of algebraic degree $1$ and find those of minimum weight. Indeed, from \PropRef{annihilator_construction}, we know that
$$
\minzs{n}{d} = \min\{ \wt(g) \mid g \in \BF{n}{n-d-1} \setminus \{0\} ~\text{with}~ \dim \AN_1(g) \leq 1\}.
$$

For $d=1$ and $d=2$ we can easily determine the cardinalities of minimal degree-$d$ zero-sum sets, as stated in \PropRef{min_1} and \PropRef{min_2}. The proofs also provide a construction for a minimal zero-sum set. While the proof for $d=1$ is rather trivial, the proof for $d=2$ relies on the relation between degree-$2$ zero-sum sets and semi-orthogonal matrices.
\begin{proposition}
\PropLabel{min_1}
For $n \geq 2$, $\minzs{n}{1} = n + 2 - (n \mod 2)$.
\end{proposition}
\begin{proof}
Consider a zero-sum set $S\in\ZS{n}{m}{1}$ and its matrix in systematic form. Each row must have an even weight, therefore there must be at least one extra column besides the identity part, i.e. $m \ge n+1$. By setting the extra column to the all-one vector $\idvec{n}$ we make all rows to have even weight. Furthermore, $m$ must be even and we may also need to add the all-zero column. The proposition follows.
\end{proof}

\begin{proposition}
\PropLabel{min_2}
For $n = 4$ and for $n > 5$, it is $\minzs{n}{2} = 2n$. Further, $\minzs{3}{2} = 8$ and $\minzs{5}{2} = 12$.
\end{proposition}
\begin{proof}
Let $n \geq 3$ and $m$ be minimal such that there exists an $S \in \ZS{n}{m}{2}$. Let further $L \in \F_2^{n \times (m-n)}$ such that $S$ is in systematic form with $\matzs{S} = \rowtwo{\idmat{n}}{L}$. As $\matzs{S}$ cannot contain any repeated columns, it is $\matzs{S} = \matl{L}$ and thus, $L$ must be semi-orthogonal and $n \leq (m-n)$. It follows that $\minzs{n}{2} = m \geq 2n$.

Let now $n = 4$ or $n \geq 6$. To prove the existence of an $S \in \ZS{n}{2n}{2}$, we observe that if $L \in \F_2^{n\times n}$ is an orthogonal matrix for which each column has weight larger than $1$, $\matl{L}$ defines a degree-$2$ zero-sum set of size $2n$ and rank $n$ according to \PropRef{inner_product}. It is left to show that, for any dimension $n=4$ or $n \geq 6$, there exists an orthogonal matrix for which no column corresponds to a unit vector. We are going to distinguish four cases. Let us define the orthogonal matrices $M_4$ and $M_6$ as
$$
M_4 = \matb{
0 & 1 & 1 & 1 \\
1 & 0 & 1 & 1 \\
1 & 1 & 0 & 1 \\
1 & 1 & 1 & 0
}, \quad M_6 = \matb{
0 & 1 & 1 & 1 & 1 & 1 \\
1 & 0 & 1 & 1 & 1 & 1 \\
1 & 1 & 0 & 1 & 1 & 1 \\
1 & 1 & 1 & 0 & 1 & 1 \\
1 & 1 & 1 & 1 & 0 & 1 \\
1 & 1 & 1 & 1 & 1 & 0
}.
$$

Case 1 ($n = 0 \mod 4$): The block-diagonal matrix $\diag(M_4,\dots,M_4)$ which contains $M_4$ as its diagonal blocks is orthogonal and each column weight is equal to $3$.

Case 2 ($n = 2 \mod 4$): Because $n > 5$, it is $n = 4k+6$ for $k \geq 0$ and the matrix $\diag(M_6,M_4,M_4,\dots,M_4)$ is orthogonal and each column has weight at least $3$.

Case 3 ($n = 3 \mod 4$): Because $n > 5$, it is $n = 4k + 3$ for $k \geq 1$ and the two matrices $D_1 = \diag(1,1,1,M_4,M_4,\dots,M_4)$ and $D_2 = \diag(M_4,1,1,\dots,1)$ are orthogonal. Their product is orthogonal and of the form
\newcommand{\biga}{\mbox{\normalfont\Large A}}
\newcommand{\bigd}{\mbox{\normalfont\Large D}}
\eql{diag_matrix}{
D_1D_2 =
\left[\begin{array}{@{}c|@{}c}
  \begin{matrix}
0   &   1   &   1   &   1 \\
1   &   0   &   1   &   1\\
1  & 1 & 0 & 1
\end{matrix}
 ~&~  \begin{matrix}
0   &   0   &   \dots   &   0 \\
0   &   0   &   \dots   &   0\\
0  & 0 & \dots & 0
\end{matrix} \\
\hline
   \biga  &
  \bigd
\end{array}\right],
}
where $D$ is the $4k \times (4k-1)$ submatrix of $\diag(M_4,\dots,M_4)$ omitting the first column. It is obvious that each column has weight at least $3$.

Case 4 ($n = 1 \mod 4$): Because $n > 5$, it is $n \geq 9$ and $n = 4k + 6 +3$ for $k \geq 0$. The two matrices $D_1 = \diag(1,1,1,M_6,M_4,\dots,M_4)$ and $D_2 = \diag(M_4,1,1,\dots,1)$ are orthogonal. Their product is orthogonal and of the form given in \EqRef{diag_matrix} with $D$ as the $4k + 6 \times (4k + 6 -1)$ submatrix of $\diag(M_6,M_4,M_4,\dots,M_4)$ omitting the first column. It is obvious that each column has weight at least $3$.

For $n=3$ we use that any degree-$d$ zero-sum set must contain at least $2^{d+1}$ elements. Thus, $\minzs{n}{2} \geq 8$. We obtain $\minzs{3}{2} = 8$ because $\F_2^3$ is a degree-$2$ zero-sum set.

For $n=5$, assume that there exists an orthogonal matrix $L \in \F_2^{5 \times 5}$ which does not have a unit vector as its row (or column). From point $(iii)$ of \PropRef{zero_sum} it follows that any $2\times 5$ submatrix of $L$ must contain an odd number of columns equal to each of $(0,1),(1,0),(0,0)$ and an even number of columns equal to $(1,1)$ (same applies for rows of any $5 \times 2$ submatrix of $L$). It follows that, up to a permutation of rows, $L$ has the following form:
\begin{equation}
L = \matb{
1   &   0   &   0      &   1    & 1\\
0   &   1   &   0      &   1    & 1\\
0   &   0   &   . & . & . \\
1   &   1   &   . & . & . \\
1   &   1   &   . & . & .
}.
\end{equation}
It is easy to see that it is not possible to complete this matrix such that all $2\times 5$ and $5\times 2$ submatrices satisfy the condition.
Therefore, $\minzs{5}{2} > 10$. Moreover, it is easy to verify that
$$
\matzs{S} = \matb{
1   &   0   &   0   &   0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\
0   &   1   &   0   &   0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 1\\
0   &   0   &   1   &   0 & 0 & 1 & 0 & 1 & 1 & 0 & 1 & 1\\
0   &   0   &   0   &   1 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 0\\
0   &   0   &   0   &   0 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 1
}
$$
defines a zero-sum set in $\ZS{5}{12}{2}$, thus $\minzs{5}{2} = 12$.
\end{proof}

\PropRef{extending_construction} below presents a simple way to construct a $d+1$ zero-sum set of rank $n+1$ from a degree-$d$ zero-sum set of rank $n$. This construction might be used to derive an upper bound on $\minzs{n}{d}$.

\begin{proposition}
\PropLabel{extending_construction}
If there exists an $S \in \ZS{n}{m}{d}$, one can construct a zero-sum set $S' \in \ZS{(n+1)}{2m}{d+1}$. In particular, for $n > d+1$, $\minzs{n}{d} \leq 2 \minzs{n-1}{d-1}$.
\end{proposition}
\begin{proof}
If $S \in  \ZS{n}{m}{d}$, then the columns of the matrix
\[ \left[\begin{array}{ccc}
0~\ldots~0 &|& 1~\ldots~1 \\
\matzs{S} &|& \matzs{S}
\end{array} \right]\]
define a degree-$(d+1)$ zero-sum set $S'$ with $2m$ elements of rank $n+1$. We remark that both sets $S$ and $S'$ have essentially the same indicator function, only the domain dimension is different.
\end{proof}

Note that the upper bound on $F(n,d)$ given by this construction is not always tight. Let $S \subseteq \F_2^9$ be such that $\Ind_S(x)=x_1(x_2x_3x_4x_5 + x_6x_7x_8x_9)$. It easy to verify that $S \in \ZS{9}{30}{3}$. It follows that $F(9,3) \le 30 \ne 2F(8,2) = 32$.
The corresponding matrix $\matzs{S}$ is given by:
\setcounter{MaxMatrixCols}{30}
\begin{equation}
    \small
    \setlength\arraycolsep{2pt}
    \matzs{S} = \begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 \\
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
    \end{bmatrix}.
\end{equation}

\begin{proposition}
\PropLabel{diagonal_construction}
For any $d \in \ZZplus$ and $n_1,n_2 >d$, $\minzs{n_1+n_2}{d} \leq \minzs{n_1}{d}+\minzs{n_2}{d}$.
\end{proposition}
\begin{proof}
If $S_1 \in \ZS{n_1}{m_1}{d}, S_2 \in \ZS{n_2}{m_2}{d}$, then the columns of the matrix
$$
\matzs{S} = \psquare{
\begin{array}{c|c}
    \matzs{S_1} &
    \begin{array}{c}0~\ldots~0 \\ \vdots \\ 0~\ldots~0\end{array} \\
\hline
    \begin{array}{c}0~\ldots~0 \\ \vdots \\ 0~\ldots~0\end{array} &
    \matzs{S_2}
\end{array}
}
$$

repeating an odd number of times define a degree-$d$ zero-sum set $S$ with at most $m_1+m_2$ elements of rank $n_1+n_2$. More precisely, if both $S_1$ and $S_2$ contain the zero vector, then the resulting zero-sum set has size $m_1 + m_2 - 2$ due to the zero-vector being cancelled by the repetition. Otherwise, $S$ has size $m_1 + m_2$.
\end{proof}

\begin{proposition}
\PropLabel{lower_bound_n_plus_d}
Let $d \geq 2$. If there exist an $S \in \ZS{n}{m}{d}$, one can construct a zero-sum set in $\ZS{(n+d)}{m}{d-1}$. In particular, for $n > d$, $\minzs{n}{d} \geq \minzs{n+d}{d-1}$.
\end{proposition}
\begin{proof}
Let $\matzs{S} = \rowtwo{\idmat{n}}{L}$ be a matrix for $S$ in systematic form. By reordering the rows of $\matzs{S}$, one can bring it into the form
\eql{proof_form}{
\psquare{
\begin{array}{c|c|c|c} 1 \dots 1 & 1 & 0 \dots 0 & 0 \dots 0 \\
A & 0 & B & \idmat{(n-1)}\end{array}
},
}
where $A \in \F_2^{(n-1) \times m_1}$ and $B \in \F_2^{(n-1) \times m_2}$ for some $m_1$, $m_2$ with $m_1+m_2+n = m$. Moreover, $m_1$ cannot be zero because the first row must have an even weight.
We see that $\left[\begin{array}{c|c} A &  0\end{array}\right]$ must define a degree-$(d-1)$ zero-sum set in $\F_2^{n-1}$, i.e., $\left[\begin{array}{c|c} A &  0\end{array}\right] = \matzs{T}$ for a $T \in \ZS{r}{(m_1+1)}{d-1}$. This is simply because the Hadamard (component-wise) product of any $d-1$ rows of $\left[\begin{array}{c|c} A &  0\end{array}\right]$ can be expressed as the Hadamard (component-wise) product of $d$ rows of $\matzs{S}$, i.e., the $d-1$ rows at the same positions as those of $\left[\begin{array}{c|c} A &  0\end{array}\right]$ and the first row $[1 1 \dots 1 0 0 \dots 0]$. We conclude that $m_1 = |T| \geq 2^d$ and thus, $r \geq d$.

Let $v_1,\dots,v_d$ be $d$ linearly independent rows of $A$ and consider the matrix
\[ \left[ \begin{array}{c|c|c|c}
1 \dots 1 & 1 & 0 \dots 0 & 0 \dots 0 \\
A & 0 & B & \idmat{(n-1)} \\
v_1 & 0 & 0 \dots 0 & 0 \dots 0\\
v_2 & 0 & 0 \dots 0 & 0 \dots 0\\
\vdots & \vdots & \vdots &  \vdots \\
v_d & 0 & 0 \dots 0 & 0 \dots 0\\
\end{array} \right]\;,\]
which must define a zero-sum set in $\ZS{(n+d)}{m}{d-1}$ by the same argument as above, i.e., the Hadamard product of any $d-1$ rows can be expressed as the Hadamard product of $d$ rows of $\matzs{S}$. It is also easy to see that no linear combination of rows can be equal to zero, i.e. the constructed set has full rank $n+d$.
\end{proof}

Using the above result and \PropRef{min_2}, we can prove a lower bound on $\minzs{n}{3}$ as follows.
\begin{corollary}
\Label{cor:Fn3}
For $n \geq 4$ it is $\minzs{n}{3} \geq 2n+6$.
\end{corollary}

So far, we were able to characterize the minimal degree-$d$ zero-sum sets for $d=1$ and $d=2$ and proved some inequalities for the general case. Further, we can use the following classification theorem by Kasami, Tokura and Azumi in order to derive some more exact values of $\minzs{n}{d}$.

\begin{theorem}[\cite{kasami_tokura,kasami_tokura_azumi}]
\ThmLabel{low-weight-bf}
Let $r\geq 2$ and let $f \in \BF{n}{r}$ with $\wt(f) < 2^{n-r+1}$. Then $f$ is domain affine equivalent to either $(i)$ or $(ii)$, where
\enumroman
\begin{enumerate}
\item $f = x_1 \ldots x_{r-2}(x_{r-1} x_{r} + x_{r+1} x_{r+2} + \ldots + x_{r+2\ell-3}x_{r+2\ell-2}), n \geq r+2\ell -2$
\vspace{.5em}
\item $f = x_1 \ldots x_{r-\ell}(x_{r-\ell+1}\ldots x_{r} + x_{r+1} \ldots x_{r+\ell}), r \geq \ell, n \geq r + \ell$\;.
\end{enumerate}
\end{theorem}

A direct application leads to the following results.

\begin{proposition}[Values of $\minzs{n}{d}$ for $n \leq 2d+4$]
\PropLabel{diagonal_values}
\enumroman
$ $\newline % hack to start with newline
\begin{enumerate}
\item $\minzs{d+1}{d} = 2^{d+1}$.
\item $\minzs{d+2}{d} = 2^{d+1}$ and the minimal zero-sum sets in $\F_2^{d+2}$ correspond to the Boolean functions of algebraic degree $1$.
\item $\minzs{d+3}{d} = 3 \cdot 2^{d}$ and the minimal zero-sum sets in $\F_2^n$ correspond to the Boolean functions domain affine equivalent to $x \mapsto x_1x_2 + x_3x_4$.
\item For $d + 4 \le n \le 2d+3$, $\minzs{n}{d} = 2^{2d-n+4}(2^{n-d-2}-1) = \wt(h_{n,d})$,
where
\[
r=n-d-1, h_{n,d}\colon (x_1,\dots,x_n) \mapsto x_1(x_2x_3\dots x_{r} + x_{r+1}x_{r+2}\dots x_{2r-1})\;.
\]
\item $\minzs{2d+4}{d} = 2^{d+2} = \wt(g_d)$, where: \[
g_d\colon (x_1,\dots,x_{2d+4}) \mapsto x_1(x_2x_3\dots x_{d+3} + (x_2+1)x_{d+4}x_{d+5}\dots x_{2d+4})\;.
\]
\end{enumerate}
\end{proposition}
\begin{proof}
For $d \in \ZZplus, d<n$, let us define the set \[S_{n,d} \coloneqq \{g \in \BF{n}{d}\setminus \{0\} \text{ with } \dim \AN_1(g) \leq 1 \}\;.\]
From \PropRef{annihilator_construction} we know that $\minzs{n}{d} = \min \{\wt(g) \mid g \in S_{n,n-d-1} \}$. Therefore, we trivially obtain $\minzs{d+1}{d} = 2^{d+1}$. $S_{d+2,1}$ is the set of Boolean functions of algebraic degree $1$ and thus $\minzs{d+2}{d} = 2^{d+1}$.

To obtain the minimum weight of functions in $S_{d+3,2}$, we first note that every Boolean function of algebraic degree $2$ of the minimum weight $2^{d+1}$ must be domain affine equivalent to a monomial function, i.e., $x \mapsto x_1x_2$ (see Proposition 12 of~\cite{BMM:Carlet07}). As this monomial function admits the annihilators $x \mapsto x_1 +1$ and $x \mapsto x_2+1$, the minimum weight in $S_{d+3,d}$ must be at least $2^{d+2} - 2^{d}$ (see, e.g.,~\cite[p. 70]{BMM:Carlet07} for the possible weights of quadratic Boolean functions). This weight is obtained by the function $x \mapsto x_1x_2 + x_3x_4$, which clearly is in $S_{d+3,2}$. To see that all other functions in $S_{d+3,2}$ of minimal weight are domain affine equivalent to it, it is enough to see that all of the functions
$$
q_{n,\ell}\colon (x_1,\dots,x_n) \mapsto x_1x_2 + x_3x_4 + \dots + x_{2\ell-1}x_{2\ell}
$$
with $\ell \geq 3$ have a strictly larger weight. Indeed, by induction on $\ell$, it can be easily shown that $\wt(q_{n,\ell}) = 2^{n-1} - 2^{n-\ell-1}$.

Let now $d+4 \le n \le 2d+3$. It is easy to see that $h_{n,d} \in S_{n,n-d-1}$. Further, its weight can be computed as \[
\wt(h_{n,d}) =
2^{d+1} + 2^{d+1} - 2^{2d-n+4} =
2^{2d-n+4}(2^{n-d-2}-1)\;.
\]
It is left to show that $h_{n,d}$ is an element of minimum weight in $S_{n,n-d-1}$. Let therefore be $h'$ in $S_{n,n-d-1}$ with $\wt(h') \leq \wt(h_{n,d})$. Since $\wt(h_{n,d}) < 2^{n-(n-d-1)+1}=2^{d+2}$, the assumptions of \ThmRef{low-weight-bf} are fulfilled and $h'$ would be domain affine equivalent to one of the forms given in cases $(i)$ and $(ii)$ of \ThmRef{low-weight-bf}. If $n \geq d + 5$, Case $(i)$ corresponds to a Boolean function of the form $x \mapsto x_1x_2 g$ which admits $x \mapsto x_1+1$ and $x \mapsto x_2+1$ as degree-$1$ annihilators. For $n = d + 4$, Case $(i)$ corresponds to a function of the form
$$
x \mapsto x_1(x_2x_3 + x_4x_5 + \dots + x_{2\ell}x_{2\ell+1}) = x_1g
$$
for $g \in S_{n,2}$ and, therefore, its weight must be at least $2^{n-2}-2^{n-4} = 2^{2d-n+4}(2^{n-d-2}-1)$.

Otherwise, $h'$ must be domain affine equivalent to one of the functions given in Case $(ii)$. Since it cannot admit two annihilators of algebraic degree $1$, it must be domain affine equivalent to either
$$
x \mapsto x_1(x_2x_3\dots x_{r} + x_{r+1}x_{r+2}\dots x_{2r-1}) = h_{n,d},
$$
or
$$
g_{n,d}\colon x \mapsto x_1x_2 \dots x_{r} + x_{r+1}x_{r+2} \dots x_{2r},
$$
where $r = n-d-1$.
As
$$
\wt(g_{n,d}) = 2^{2d-n+3}(2^{n-d-1}-1) > \wt(h_{n,d})=2^{2d-n+3}(2^{n-d-1}-2),
$$
the point $(iv)$ follows.

It is easy to see that $\wt(g_d)=2^{d+2}$, i.e. $F(2d+4,d)\le 2^{d+2}$. By \PropRef{extending_construction} and $(iv)$ of this Theorem, $F(2d+4,d) \ge F(2d+5,d+1)/2 = (2^{d+2}-1)$. Since $F(2d+4,d)$ has to be even, the Theorem follows.
\end{proof}

We are now going to show that, for any fixed $d$, the sequence $\minzs{n}{d}$ is increasing with $n$. For that, we need the following lemma.
\begin{lemma}
\LemLabel{growing}
For $n > 2d+3$, we have $\minzs{n}{d} \leq \frac{2^n}{n+1}$.
\end{lemma}
\begin{proof}
%If we substitute $d$ by $n-k$, the condition $n > 2d+3$ is equivalent to $n <2k-3$ where $k \geq 5$.
By repeatedly applying \PropRef{extending_construction}, we obtain
%\[\minzs{n}{d} \leq 2^{n-k-1}(k+2) = 2^n \frac{k+2}{2^{k+1}}\;.\]
\[\minzs{n}{d} \leq 2^{d-1}(n-d+2) = 2^n \frac{n-d+2}{2^{n-d+1}}\;.\]

It is left to show that $\frac{n-d+2}{2^{n-d+1}} \leq \frac{1}{n+1}$. We know that
% \[(n+1)(n-d+2) < (2k-2)(k+2) = 2(k-1)(k+2) \leq 2^{k+1}\;,\]
\[(n+1)(n-d+2) < (2n-2d-2)(n-d+2) = 2(n-d-1)(n-d+2) \leq 2^{n-d+1}\;,\]
which is true for $n - d \geq 5$. The latter is guaranteed by $n \ge 2d + 4$ and $d \ge 1$. This proves the statement.
\end{proof}

\begin{proposition}
For $n > d+1$, it is $\minzs{n}{d} \geq \minzs{n-1}{d}$.
\end{proposition}
\begin{proof}
We prove this statement by induction on $d$. If $d = 1$ and $d=2$, the statement is obviously true by \PropRef{min_1} and \PropRef{min_2}. Let thereby $d \geq 3$ and assume that the statement is true for $d-1$.

Let $S \in \ZS{n}{m}{d}$ be a minimal zero-sum set, i.e., $m = \minzs{n}{d}$, such that $\matzs{S}$ can be given as in \EqRef{proof_form} for $A \in \F_2^{(n-1) \times m_1}$ and $B \in \F_2^{(n-1) \times m_2}$ with $m_1$, $m_2$ such that $m_1+m_2+n = m$. Let $m' \coloneqq m_2+n-1$. We see that $[B | \idmat{(n-1)}]$ must define a degree-$(d-1)$-zero-sum set in $\F_2^{n-1}$, i.e., $[B | \idmat{(n-1)}] = \matzs{T}$ for a $T \in \ZS{(n-1)}{m'}{d-1}$. This is because every $(d-1) \times (m')$ submatrix of $\matzs{T}$ must occur an even number of times (from the property of $S$ being a degree-$d$ zero-sum set) and, since $\matzs{T}$ contains $\idmat{(n-1)}$, it must have rank $n-1$. We now distinguish two cases.

Case 1 ($m' \leq \frac{m}{2}$): In that case we directly obtain
\[m = \minzs{n}{d} \geq 2 \minzs{n-1}{d-1} \geq 2 \minzs{n-2}{d-1} \geq \minzs{n-1}{d}\;,\]
where the second estimation follows from the induction hypothesis and the last one follows from \PropRef{extending_construction}.

Case 2 ($m' > \frac{m}{2}$): We first remark that if $n \leq 2d+3$, the statement directly follows from \PropRef{diagonal_values}. For example, for $n \geq d + 5$,
\[ \minzs{n}{d} = 2^{d+2} - 2^{2d-n+4} \geq 2^{d+2} - 2^{2d-n+5} = \minzs{n-1}{d}\;.\]

Let us therefore assume that $n > 2d +3$. Note that in the matrix $\matzs{S}$, we can add the first row $[11\dots 1 00\dots 0]$ to any other row and would obtain an equivalent zero-sum set. This operation does not change the right part of $\matzs{S}$ containing $\idmat{(n-1)}$. Indeed, it allows us to obtain a zero-sum set $S_c \in \ZS{n}{m}{d}$ represented by
\eq{
\matzs{S_c} = \psquare{
    \begin{array}{c|c|c|c}
    1 \dots 1 & 1 & 0 \dots 0 & 0 \dots 0 \\
    A + c^{\top} & c^{\top} & B & \idmat{(n-1)}
    \end{array}
    }
}
for any $c \in \F_2^{n-1}$. Let us denote by $R$ the set of columns of $A$ together with the $(n-1)$-bit zero vector. Our statement to prove follows if we can guarantee the existence of a vector $\tilde{c}$  such that, for all $v \in (R+\tilde{c}^{\top})$, $\wt(v) \geq 2$. Then, we would obtain a zero-sum set in $\ZS{(n-1)}{m''}{d}$ defined by \[\left[ \begin{array}{c|c|c|c}
A + \tilde{c}^{\top} & \tilde{c}^{\top} & B & \idmat{(n-1)}\end{array} \right]\]
as there won't be any cancellation between $[A +\tilde{c}^{\top} \mid \tilde{c}^{\top}]$ and $\idmat{(n-1)}$, thus keeping the rank maximum. Indeed, such a vector must always exist. Assume that, for all $c \in \F_2^{n-1}$, there exists a $v \in (R+\tilde{c}^{\top})$ with weight at most $1$. This is equivalent to say that the covering radius of the set $R \subseteq \field{n-1}$ is equal to $1$. By a simple counting argument it follows that $|R| \geq \frac{2^{n-1}}{n}$. On the other hand, it is
$$
|R| = m - m' < \minzs{n}{d} - \frac{\minzs{n}{d}}{2} = \frac{1}{2} \minzs{n}{d}  \leq \frac{2^{n-1}}{n+1}\;,
$$
where the last inequality follows from the previous lemma.  We get a contradiction, therefore such vector $\tilde{c}$ always exists.
\end{proof}


% This LaTeX was auto-generated from an M-file by MATLAB.
% To make changes, update the M-file and republish this document.

\subsection*{gSin.m}

\begin{par}
\textbf{Summary:} Compute moments of the saturating function $e*sin(x(i))$, where $x \sim\mathcal N(m,v)$ and $i$ is a (possibly empty) set of $I$ indices. The optional  scaling factor $e$ is a vector of length $I$. Optionally, compute derivatives of the moments.
\end{par} \vspace{1em}

\begin{verbatim}  function [M, V, C, dMdm, dVdm, dCdm, dMdv, dVdv, dCdv] = gSin(m, v, i, e)\end{verbatim}
    \begin{par}
\textbf{Input arguments:}
\end{par} \vspace{1em}
\begin{verbatim}m     mean vector of Gaussian                                    [ d       ]
v     covariance matrix                                          [ d  x  d ]
i     vector of indices of elements to augment                   [ I  x  1 ]
e     (optional) scale vector; default: 1                        [ I  x  1 ]\end{verbatim}
\begin{par}
\textbf{Output arguments:}
\end{par} \vspace{1em}
\begin{verbatim}M     output means                                               [ I       ]
V     output covariance matrix                                   [ I  x  I ]
C     inv(v) times input-output covariance                       [ d  x  I ]
dMdm  derivatives of M w.r.t m                                   [ I  x  d ]
dVdm  derivatives of V w.r.t m                                   [I^2 x  d ]
dCdm  derivatives of C w.r.t m                                   [d*I x  d ]
dMdv  derivatives of M w.r.t v                                   [ I  x d^2]
dVdv  derivatives of V w.r.t v                                   [I^2 x d^2]
dCdv  derivatives of C w.r.t v                                   [d*I x d^2]\end{verbatim}
\begin{par}
Copyright (C) 2008-2013 by Marc Deisenroth, Andrew McHutchon, Joe Hall, and Carl Edward Rasmussen.
\end{par} \vspace{1em}
\begin{par}
Last modified: 2013-03-25
\end{par} \vspace{1em}

\begin{lstlisting}
function [M, V, C, dMdm, dVdm, dCdm, dMdv, dVdv, dCdv] = gSin(m, v, i, e)
\end{lstlisting}

\subsection*{Code}

\begin{lstlisting}
d = length(m); I = length(i);
if nargin == 3, e = ones(I,1); else e = e(:); end          % unit column default
mi(1:I,1) = m(i); vi = v(i,i); vii(1:I,1) = diag(vi);      % short-hand notation

M = e.*exp(-vii/2).*sin(mi);                                              % mean

lq = -bsxfun(@plus,vii,vii')/2; q = exp(lq);
V = (exp(lq+vi)-q).*cos(bsxfun(@minus,mi,mi')) - ...
                                      (exp(lq-vi)-q).*cos(bsxfun(@plus,mi,mi'));
V = e*e'.*V/2;                                                        % variance

C = zeros(d,I); C(i,:) = diag(e.*exp(-vii/2).*cos(mi));       % inv(v) times cov

if nargout > 3                                            % compute derivatives?
  dVdm = zeros(I,I,d); dCdm = zeros(d,I,d); dVdv = zeros(I,I,d,d);
  dCdv = zeros(d,I,d,d); dMdm = C';
  U1 = -(exp(lq+vi)-q).*sin(bsxfun(@minus,mi,mi'));
  U2 = (exp(lq-vi)-q).*sin(bsxfun(@plus,mi,mi'));
  for j = 1:I
    u = zeros(I,1); u(j) = 1/2;
    dVdm(:,:,i(j)) = e*e'.*(U1.*bsxfun(@minus,u,u') + U2.*bsxfun(@plus,u,u'));
    dVdv(j,j,i(j),i(j)) = exp(-vii(j)) * ...
                                (1+(2*exp(-vii(j))-1)*cos(2*mi(j)))*e(j)*e(j)/2;
    for k = [1:j-1 j+1:I]
      dVdv(j,k,i(j),i(k)) = (exp(lq(j,k)+vi(j,k)).*cos(mi(j)-mi(k)) + ...
                            exp(lq(j,k)-vi(j,k)).*cos(mi(j)+mi(k)))*e(j)*e(k)/2;
      dVdv(j,k,i(j),i(j)) = -V(j,k)/2;
      dVdv(j,k,i(k),i(k)) = -V(j,k)/2;
    end
    dCdm(i(j),j,i(j)) = -M(j);
    dCdv(i(j),j,i(j),i(j)) = -C(i(j),j)/2;
  end
  dMdv = permute(dCdm,[2 1 3])/2;

  dMdv = reshape(dMdv,[I d*d]);
  dVdv = reshape(dVdv,[I*I d*d]); dVdm = reshape(dVdm,[I*I d]);
  dCdv = reshape(dCdv,[d*I d*d]); dCdm = reshape(dCdm,[d*I d]);
end
\end{lstlisting}


\documentclass[12pt,letterpaper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\title{Supplementary text}
\author{Clinton Leach}

\begin{document}

\maketitle

\section*{Bayesian mechanistic model for dengue and mosquito dynamics}

Note that in practice, we rescale the model described in the main text by human population size to keep state variables on a unit scale.
This also rescales mosquito population size to number of mosquitoes per person.
Adopting this rescaling, we can express the model as:

\begin{align}
y_t & \sim \text{NegBin}(\phi_y  (C_t - C_{t-1})N, \eta_y)\\
q_t & \sim \text{NegBin}((V_{Ct} - V_{Ct-1})N, \eta_q)\\
\\
\frac{dC}{dt} &= \rho E \\
\frac{dS}{dt} &= b - bS - \lambda V_{I}S + \delta R\\
\frac{dE}{dt} &= \lambda V_{I}S - (\rho + b)E\\
\frac{dI}{dt} &= \rho E - (\gamma + b)I\\
\frac{dR}{dt} &= \gamma I - (\delta + b)R\\
\\
\frac{dV_N}{dt} & = r V_N - \phi_q \tau(t) V_N\\
\frac{dV_{E1}}{dt} &= \lambda I V_S - (4\rho_{v}(t) + d(t) + \phi_q \tau(t))V_{E1}\\
\frac{dV_{E2}}{dt} &= 4\rho_{v}(t) V_{E1} - (4\rho_{v}(t) + d(t) + \phi_q \tau(t))V_{E2}\\
\frac{dV_{E3}}{dt} &= 4\rho_{v}(t) V_{E2}  - (4\rho_{v}(t) + d(t) + \phi_q \tau(t))V_{E3}\\
\frac{dV_{E4}}{dt} &= 4\rho_{v}(t) V_{E3}  - (4\rho_{v}(t) + d(t) + \phi_q \tau(t))V_{E4}\\\frac{dV_I}{dt} &= 4\rho_{v}(t) V_{E4} - (d(t) + \phi_q \tau(t)) V_I\\
\frac{dV_C}{dt} & = \phi_q \tau(t) V_N\\
V_S &= V_N - V_E - V_I\\
\\
d(t) &= d_0 \exp(\nu(t))\\
\frac{d^2\nu}{dt^2} &= -\omega^2 \nu + \epsilon_{\nu t}\\
\frac{d^2 r}{dt^2} &= -\omega^2 r + \epsilon_{rt},
\end{align}
where $\omega = 2\pi / 52$, and
\begin{align}
\epsilon_{\nu i} & \sim \text{Normal}(0, \sigma_{\nu})\\
\epsilon_{ri} & \sim \text{Normal}(0, \sigma_r),
\end{align}
for $i = 1 \dots 243$.

The following priors complete the model specification:
\begin{align}
\sigma_r & \sim \text{Half-normal}(0, 0.2)\\
\sigma_d & \sim \text{Half-normal}(0, 0.2)\\
-\log(\phi_q) & \sim \text{Half-normal}(13, 0.5)\\
\phi & \sim \text{Beta}(7, 77)\\
\eta_y &\sim \text{Half-normal}(0, 5)\\
\eta_q & \sim \text{Half-normal}(0, 5)\\
T_{\rho} & \sim \text{Gamma}(8.3, 8.3)\\
\rho & = (0.87 T_{\rho})^{-1}\\
T_{\delta} & \sim \text{Gamma}(10, 10)\\
\delta & = (97 T_{\delta})^{-1}\\
\gamma' & \sim \text{Gamma}(100, 100)\\
\gamma & = 3.5\gamma'\\
d_0' & \sim \text{Gamma(10, 10)}\\
d_0 & = 1.47 d_0'\\
\nu_0 & \sim \text{Normal}(0, 0.5)\\
r_0 & \sim \text{Normal}(0, 0.5)\\
\log(V_{N0}) & \sim \text{Normal}(0.7, 0.3) \\
S_0' & \sim \text{Beta}(4, 6)\\
E_0' & \sim \text{Gamma}(10, 0.1)\\
I_0' & \sim \text{Gamma}(6, 0.1)\\
E_0 & = E_0' / N \\
I_0 & = I_0' / N \\
S_0 & = S_0'(1 - E_0 - I_0) \\
R_0 & = 1 - S_0 - E_0 - I_0
\end{align}

\subsection*{Details of prior specification}

\begin{itemize}
\item \textbf{Period of cross-immunity} ($T_{\delta}$): Reich \emph{et al.} \cite{Reich2013} estimate a mean of 1.88 years (97 weeks) with a 95\% confidence interval of (0.88, 4.31).
We specify a gamma prior on the multiplicative scale to have a mean of one and 0.01 and 0.99 quantiles at roughly $0.88/1.88 = 0.47$ and $4.31/1.88 = 2.3$, respectively:
\begin{equation}
T_{\delta} \sim \text{Gamma}(10, 10)
\end{equation}
where $\delta = (97 T_\delta)^{-1}$.
Note that we use a slightly more conservative interval than Reich \emph{et al.} to avoid numerical instability at extreme values.
\\
\item \textbf{Intrinsic incubation period} ($T_{\rho}$): Chan and Johansson \cite{Chan2012} estimate a mean of 6.1 days with a 95\% credible interval of (3, 10).
Thus, we specify a gamma prior on the multiplicative scale to have a mean of one, and 0.05 and 0.95 quantiles of $3 / 6.1 = 0.49$ and $10 / 6.1 = 1.6$, respectively:
\begin{equation}
T_{\rho} \sim \text{Gamma}(8.3, 8.3)
\end{equation}
where $\rho = (0.87 T_{\rho})^{-1}$.
\\
\item \textbf{Decay rate of infectiousness} ($\gamma$): Nguyet \emph{et al.} \cite{Nguyet2013} find that there is very little transmission of dengue from humans to mosquitoes after 5-6 days since the onset of fever (with roughly an extra day of infectiousness prior to onset of fever).
In reality, an individual's infectiousness decays with time, but the ODE model assumes infectiousness is constant for the (exponentially distributed) duration of the infection period.
To parameterize the model, we assume a rough equivalence between the probability of infection from a single individual at a given time and the proportion of individuals still infectious at a given time.
Thus we choose our prior for $\gamma$ to keep the time at which only 5\% of individuals are still infectious between 5 and 7 days, with a mean 5\% threshold of 6 days.
Again we specify the prior on the multiplicative scale to have a mean of one and 0.05 and 0.95 quantiles at $2.99/3.5 = 0.85$ and $4.19 / 3.5 = 1.2$, respectively:
\begin{equation}
\gamma' \sim \text{Gamma}(100, 100)
\end{equation}
where $\gamma = 3.5\gamma'$.
\\
\item \textbf{Baseline mosquito mortality rate} ($d_0$): Brady \textit{et al.} \cite{Brady2013} estimated \textit{Aedes aegypti} temperature-dependent field survivorship curves from over 190 laboratory and field experiments.
They found that increased mortality in the field generally washes out the effect of temperature, so we use their estimates for 25 degrees C to construct our prior for $d_0$.
We use nonlinear least squares to fit the exponential cdf with rate $d_0$ to the estimated mortality curve provided by Brady \textit{et al.}, which gives $d_0 = 1.47$.
We specify a gamma prior on the multiplicative scale, with parameters chosen to keep the prior mass within a factor of 2 of the mean:
\begin{equation}
d_0' \sim \text{Gamma}(10, 10)
\end{equation}
where $d_0 = 1.47d_0'$.
\\
\item \textbf{Initial conditions} ($S_0, E_0, I_0, R_0$): The SEIRS model assumes a constant population size and is scaled so that $S_0+E_0+I_0+R_0 = 1$.
We place priors on the initial number of exposed and infectious individuals, rather than the initial proportion, as it provides a more intuitive scale.
We set the prior mean for $E_0'$ and $I_0'$ at 100 and 60 individuals respectively, to account for the fact that the annual epidemic should be just beginning, with infectious individuals lagging behind exposed.
These means were chosen large enough to ensure sustained multi-annual transmission, but with a relatively large variance.
We choose the prior for $S_0'$, the proportion of remaining individuals initially susceptible, to have a mean of roughly  0.4, with the mass concentrated between 0.2 and 0.6.
This range produces dynamics with recurring annual outbreaks and avoids the extremes where the disease either does not spread or spreads far too quickly and then dies out.
This is also roughly consistent with \cite{Cardoso2011a} who report notified cases for Vitoria from 1995 to 2008.
They report that the 2008 outbreak (where our data begins) was driven by serotypes 2 and 3, and 2009 by serotype 2 only, with 13590 reported serotype 2 cases in previous years.
Assuming 12 unreported cases for every reported case, there should be 163,080 total cases, or about 50\% of the population, immune to serotype 2 at the start of 2008.
\\
\item \textbf{Initial conditions} ($\nu_0, r_0$): Since the harmonic oscillators on $\nu$ and $r$ are centered at zero, and we do not have any prior knowledge of where the oscillator should be initially, we center the priors of their initial conditions at zero as well.
Further, since $r$ is a population growth rate for a relatively stable (i.e., not explosive) population, it should not be too far from zero.
Similarly, $\nu$, as an exponential multiplier on the mean per-capita mortality, should not vary too far from zero either.
As such, we use flexible, but still conservative prior standard deviations of 0.5 for both values.
\\
\item \textbf{Mosquito population size and capture probability} ($\log(V_{N0}), \phi_q$): Wearing and Rohani \cite{Wearing2006} assume 2 mosquitoes per person in their model of dengue transmission, so we use that to inform our prior on $\log(V_{N0})$.
Since $V_{N}$ has been scaled by the human population size, we center the prior for $\log(V_{N0})$ at $\log(2) = 0.7$ and set the variance to concentrate mass between 0.5 and 5 mosquitoes per person.
The per-trap mosquito capture probability, $\phi_q$ follows $V_{N0}$ closely and scales the estimated mosquito abundance down to magnitude of the trap counts.
Since $ E[q_t] = \phi_q \tau V_{Nt} N$, we set the prior on $\log(\phi_q)$ to have a mean of $\log(q_1) - \log(\tau_1) - \log(V_{N0}) - \log(N) = -13$ and a variance to match the prior on $\log(V_{N0})$.
\\
\item \textbf{Case reporting probability} ($\phi$): Silva \emph{et al.} \cite{Silva2016} estimate a reporting rate of 1/12 (0.083) in Brazil.
Because the reporting rate is bound between 0 and 1, we used a Beta-distribution for our prior, parameterized to have a mean of 1/12, with most of the mass between 1/6 and 1/24:
\begin{equation}
\phi \sim \text{Beta}(7, 77)
\end{equation}
\\
\item \textbf{Mosquito process variances} ($\sigma_r, \sigma_d$): For the purposes of prediction and generalization, we want latent growth and death time series to be smooth and regularly oscillating.
To achieve this, we put a relatively strong, half-normal prior on the process standard deviations.
A prior standard deviation of 0.2 provides flexibility while still pulling the $\epsilon$ terms toward zero.
\\
\item \textbf{Overdispersion parameters} ($\eta_y, \eta_q$): The negative binomial likelihoods were parameterized as:
\begin{equation}
\text{NegBin}(y | \mu, \eta) = {y + 1/\eta -1 \choose y}\left(\frac{\mu\eta}{1 + \mu\eta}\right)^y\left(\frac{1}{1+\eta\mu}\right)^{1/\eta}
\end{equation}
such that
\begin{align}
E[y] & = \mu\\
\text{Var}[y] &= \mu + \eta\mu^2
\end{align}
Thus, $\eta = 0$ corresponds to Poisson, and $\eta > 0$ leads to overdispersion.
We put a relatively conservative truncated normal prior on both $\eta_y$ and $\eta_q$ that concentrates mass near zero but allows for larger values.
\end{itemize}

\subsection*{Fixed parameters}

\begin{itemize}
\item \textbf{Transmission rate} ($\lambda$): The transmission rate only appears multiplied by a term from the mosquito model (either $V_I$ or $V_S$) and is thus effectively non-identifiable when we are also estimating the overall size of the mosquito population.
Because of this, we fix $\lambda$ at a reasonable value from the literature (though our results should not be sensitive to the exact value used).
The transmission rate is the product of the mosquito feeding rate and the probability of transmission given feeding.
Scott \textit{et al.} \cite{Scott2000} estimate that \textit{Aedes aegypti} females take 0.63 blood meals per day in Puerto Rico, and 0.76 blood meals per day in Thailand.
We take the average of these and set the biting rate at 0.69 per day, or 4.87 per week.
There are relatively few reliable estimates of the transmission probability of DENV, but Lambrechts \textit{et al.} \cite{Lambrechts2011} estimate transmission probabilities close to one  for several related flaviviruses at 25 degrees C (roughly the mean temperature for Vitoria).
\\
\item \textbf{Extrinsic incubation period} ($1/\rho_{v}(t)$): Temperature is thought to play an important role in the seasonality of dengue, in particular through its influence on the extrinsic incubation period of the virus in the mosquito  (the amount of time until a mosquito becomes infectious after taking an infectious blood meal).
To account for this, we make $1/\rho_v$ a function of temperature, and force it with weekly mean temperature records for Vitoria downloaded from Weather Underground (Goiabeiras weather station, station ID: IESVITOR2).
We use the temperature relationship from the meta-analysis of Chan annd Johansson \cite{Chan2012}, which incorporates a large number of studies and accounts for the interval-censored nature of the data usually available from mosquito transmission studies.
Chan and Johansson find that the log-normal and gamma distributions are nearly indistinguishable in providing the best fit to the EIP data.
To capture a gamma-distributed EIP in the differential equation model, we follow \cite{Lloyd2001} and chain together $\nu$ exposed compartments, each with an out-flow rate of $\nu\rho_v(t)$ to generate
\begin{equation}
EIP \sim \text{Gamma}(\nu, \nu \rho_v(t))
\end{equation}
such that $E[EIP] = 1/ \rho_v(t)$.
From \cite{Chan2012}, we let $\nu = 4$ and
\begin{equation}
\rho_v(t) = 7\exp \left(0.21T(t) - 7.9\right)\\
\end{equation}
This relationship is similar to those reported in \cite{Focks1995} and \cite{Tjaden2013}, though there is uncertainty about the exact shape of this relationship.
\end{itemize}

\bibliographystyle{plos2015}
\bibliography{dengue}

\end{document}


% This is part of the TFTB Reference Manual.
% Copyright (C) 1996 CNRS (France) and Rice University (US).
% See the file refguide.tex for copying conditions.

\markright{sigmerge}
\section*{\hspace*{-1.6cm} sigmerge}

\vspace*{-.4cm}
\hspace*{-1.6cm}\rule[0in]{16.5cm}{.02cm}
\vspace*{.2cm}

{\bf \large \sf Purpose}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
Add two signals with a given energy ratio in dB.
\end{minipage}
\vspace*{.5cm}

{\bf \large \sf Synopsis}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
\begin{verbatim}
x = xmerge(x1,x2)
x = sigmerge(x1,x2,ratio)
\end{verbatim}
\end{minipage}
\vspace*{.5cm}

{\bf \large \sf Description}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
        {\ty sigmerge} adds two signals so that a given energy ratio
        expressed in deciBels is satisfied :\\
 \centerline{\ty x=x1+h*x2,}
        such that\\
\centerline{\ty 20*log(norm(x1)/norm(h*x2))=ratio.}\\

\hspace*{-.5cm}\begin{tabular*}{14cm}{p{1.5cm} p{8.5cm} c}
Name & Description & Default value\\
\hline
        {\ty x1, x2} & input signals\\
        {\ty ratio}  & energy ratio in deciBels       & {\ty 0 dB}\\
  \hline {\ty x}      & output signal\\
\hline
\end{tabular*}
\end{minipage}
\vspace*{1cm}

{\bf \large \sf Example}\begin{verbatim}
          x=fmlin(64,0.01,0.05,1); noise=hilbert(randn(64,1));
          SNR=15; xn=sigmerge(x,noise,SNR);
          Ex=mean(abs(x).^2); Enoise=mean(abs(xn-x).^2);
          10*log10(Ex/Enoise)
          ans =
                15.0000

\end{verbatim}
\vspace*{.5cm}

{\bf \large \sf See Also}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
\begin{verbatim}
noisecg.
\end{verbatim}
\end{minipage}