\section{Sketch of proof of the Satake isomorphism (Christian Klevdal)}

In this section we will outline a proof of the Satake isomorphism. Throughout this section, $F$ will be a local non archimedean field with ring of integers $\mc{O}$ and $\varpi \in \mc{O}$ a uniformizer. We will write $\underline{G}$ for a split connected reductive group over $\mc{O}$, $G = \underline{G}(F), K = \underline{G}(O)$ and we will fix a maximal torus and a Borel $T \subset B \subset \underline{G}$ with unipotent radical $N \subset B$. We write $\mc{H}_K = \mc{H}(G, K)$ is the $K$-spherical Hecke algebra, $W = N(T)/T$ the Weyl group and $\mc{H}_{T(\mc{O})}^W = \mc{H}(T(F), T(\mc{O}))^W$ the Weyl invariants in the $T(\mc{O})$-spherical Hecke algebra. Recall the isomorphism $\mc{H}_{T(\mc{O})}^W \cong \cmplx[X_\bullet(T)]^W$. Finally, let $\delta_B(t) = |\det(\mathrm{Ad}(t)|_{\mf{n}})|$. 

\begin{thm}[Satake isomorphism]\label{satakeiso} There is an isomorphism of algebras
\[\mc{S} \colon \mc{H}_K \xrightarrow{\sim} \mc{H}_{T(\mc{O})}^W \quad \quad
f \mapsto \mc{S}(f)(t) = \delta_B(t)^{\frac12} \int_N f(tn)dn \]

\end{thm}

Recall also the Cartan decomposition
\[ G = \bigsqcup_{\lambda \in X_\bullet(T)_+} K\lambda(\varpi)K \]
which implies that $\mc{H}_K$ has a basis of characteristic functions $c_\lambda = {\bf 1}_{K\lambda(\varpi) K}$ with $\lambda \in X_\bullet(T)_+$. We also have that $\mc{H}_{T(\mc{O})}$ has a basis given by the characteristic functions ${\bf 1}_{\mu(\varpi)}$ for $\mu \in X_\bullet(T)_+$. The basic calculation for the proof of the Satake isomorphism will be to determine $\mc{S}(c_\lambda)(\mu(\varpi))$ for $\mu, \lambda \in X_\bullet(T)_+$. The value is determined as follows: First, decompose the double coset $K\lambda(\varpi)K$ into a finite disjoint union of single cosets $\sqcup_{i=1}^n x_iK$. From the Iwasawa decomposition, we can assume each $x_i \in B(F)$. Thus we can write $x_i = t(x_i)n(x_i)$ for $t(x_i) \in T(F), n(x_i) \in N(F)$. Let $\rho = \frac12 \sum_{\alpha \in \Phi^+} \alpha$. 

%Basic calculation
\begin{lem}\label{basic calculation}
With notation as above,
\[ \mc{S}(c_\lambda)(\mu(\varpi)) = q^{-\langle \mu, \rho \rangle}|\{i \colon t(x_i) \equiv \mu(\pi) \mod T(\mc{O}) \}| \]
\end{lem}
\begin{proof}
First note that $\delta_B(\mu(\varpi))^{\frac12} = q^{-\langle\mu,\rho \rangle}$. % I probably should add some justification of this fact.
Thus
\[\mc{S}(c_\lambda)(\mu(\varpi)) = q^{-\langle \mu, \rho \rangle} \int_N {\bf 1}_{K\lambda(\varpi)K}(\mu(\varpi)n)dn = q^{-\langle \mu, \rho \rangle} \sum_{i = 1}^n \int_N {\bf 1}_{x_iK}(\mu(\varpi)n) \]
We need to check when $\mu(\varpi)n \in x_iK$. But this happens if and only if $n \in \mu(\varpi)^{-1}t(x_i)n(x_i)K$. Since $N$ normalizes $T$, we can write $\mu(\varpi)^{-1}t(x_i)n(x_i)K = n(x_i)'\mu(\varpi)^{-1}t(x_i)K$ for some $n(x_i)' \in N$. We now see that $n$ is in this later set if and only if $t(x_i)^{-1}\mu(\varpi)(n(x_i)')^{-1}n^{-1} \in K$. But this happens if and only if $n(x_i)'n \in N(\mc{O})$ and $t(x_i)^{-1}\mu(\varpi) \in T(\mc{O})$ (this last conidition is exactly that $t(x_i) = \mu(\varpi) \mod T(\mc{O})$). Once we note that $N(\mc{O})$ has volume $1$ we have 
\[ \int_N {\bf 1}_{x_i K} dn = \begin{cases} \int_{n(x_i)'N(\mc{O})}dn = 1 &\text{if } t(x_i) \equiv \mu(\varpi) \mod T(\mc{O})\\ 0 &\text{otherwise} \end{cases} \]
Consequently, we have 
\[ \sum_i \int_N {\bf 1}_{x_iK}(\mu(\varpi)n) dn = |\{i \colon t(x_i) \equiv \mu(\varpi) \mod T(\mc{O}) \}| \]
\end{proof}

As an easy consequence of the above lemma, $\mc{S}(c_\lambda)(\lambda(\varpi)) \neq 0$ since we can assume one of the $x_i$ is $\lambda(\varpi)$. 

\begin{proof}[Proof of Theorem \ref{satakeiso}]
Our sketch procedes in 3 steps:
\begin{enumerate}
\item Check that $\mc{S}$ is an algebra homomoprhism.
\item Check that the image is Weyl invariant.
\item Conclude $\mc{S}$ is an isomorphism using the facts:
	\begin{enumerate}
	\item $\mc{S}(c_\lambda)(\lambda(\varpi)) \neq 0$ (which we noted above).
	\item For $\mu, \lambda \in X_\bullet(T)_+$
		\[ \mc{S}(c_\lambda)(\mu(\varpi))\neq 0 \implies \mu \leq \lambda \]
	(we'll prove this later). 
	\end{enumerate}
\end{enumerate}

\underline{Proof of (3), given (1), (2) and facts (a),(b):} Given $\mu \in X_\bullet(T)$, let $\mathrm{ch}(V(\mu))$ be the character of the representation of the Langlands dual group of $G$ with highest weight $\mu$. By highest weight theory, the set of such characters ranging over $\mu \in X_\bullet(T)_+$ gives a basis of $\mc{H}^W_{T(\mc{O})} = \cmplx[X_\bullet(T)]^W$. Hence using $W$ invariance 
	\[ \mc{S}(c_\lambda) = \mc{S}(c_\lambda)(\lambda(\varpi))\mathrm{ch}(V(\lambda)) + \sum_{\mu < \lambda} a_{\lambda \mu}\mathrm{ch}(V(\mu)) \]
We sum over $\mu < \lambda$ by fact (b) above. Now the fact that this is ``upper triangular'' implies that $\mc{S}$ is an isomorphism. 

\underline{Explanation of fact (b):} From the definition
\[ \mc{S}(c_\lambda)(\mu(\varpi)) = \delta(\mu(\varpi))^{\frac12}\int_N {\bf 1}_{K\lambda(\varpi)K}(\mu(\omega)n) dn\]
we have $\mc{S}(c_\lambda)(\mu(\varpi)) \neq 0$ if and only if $N\mu(\varpi) \cap K\lambda(\varpi)K \neq \varnothing$ (since $N\mu(\varpi) = \mu(\varpi)N$). Thus (b) follows from the next proposition.

\begin{prop}
For $\mu, \lambda \in X_\bullet(T)_+$, 
\[ N\mu(\varpi) \cap K\lambda(\varpi)K \neq \varnothing \implies \mu \leq \lambda \]
\end{prop}
\begin{proof}
We will only sketch a proof in this in the case that $\mc{O}$ is equicharacteristic (e.g. $\mc{O} = k\llbracket t \rrbracket, F = k((t))$ which is the case we will be interested in for geometric Satake). The reference in general is Bruhat-Tits. What we gain in equal characetistic is the inclusion $\underline{G}(k) \subset \underline{G}(k\llbracket t \rrbracket) \subset \underline{G}(F)$. 

Define a left action of $\mathbb{G}_m$ on $G/K$ where $s \in \mathbb{G}_m$ acts by left multiplication by $2\rho^\vee(s)$ (where $2\rho^\vee$ is the sum of positive coroots). For $x \in N\mu(\varpi)$
	\[ \lim_{s\to 0} 2\rho^\vee(s)x = \mu(\varpi) \in G/K \]
If $k = \cmplx$ taking the limit makes sense, but for general $k$ we won't make sense of the limit until later when we realize $G/K$ as an object in algebraic geometry. To see the above formula, write $x = n\mu(\varpi)$ with $n \in N$. Then 
	\[2\rho^\vee(s)n \mu(\varpi) = 2\rho^\vee(s)n(2\rho^\vee(s))^{-1} 2\rho^\vee(s)\mu(\varpi) \]
Since we are working in $G/K$ we can replace the $2\rho^\vee(s)\mu(\varpi)$ with just $\mu(\varpi)$ on the right hand side since $2\rho^\vee(s)$ is an element of $K$. Hence we get the $s$ action sends $n\mu(\varpi)$ to $\mathrm{Ad}2\rho^\vee(s)(n) \mu(\varpi)$. Now one sees that the limit as $s \to 0$ of $\mathrm{Ad}2\rho^\vee(s)(n) = 1$ and we conclude the formula. For example, in the $\mathrm{Sl}_3$ case, we get $n$ is a unipotent matrix, and $2\rho^\vee(s)$ is the matrix with $s^2, 1, s^{-2}$ on the diagonal. We compute  
\[ \mathrm{Ad}\bp s^2 & & \\ & 1 & \\ & & s^{-2} \ep \cdot \bp 1 & x & y \\ & 1 & z \\ & & 1 \ep = \bp 1 & s^2x & s^4y \\ & 1 & s^2z \\ & & 1 \ep \]
and this clearly goes to the identity as $s \to 0$. 

As a consequence, we have $S_\mu = N\mu(\varpi)K/K = \{x \in G/K \colon \lim_{s\to 0} 2 \rho^\vee(s)x = \mu(\varpi) \}$. So if we have $x \in S_\mu \cap K\lambda(\varpi)K$ then $2\rho^\vee(s)x$ preserves $K\lambda(\varpi)K$ and hence $\mu(\varpi) = \lim_{s \to 0} 2\rho^\vee(s)x \in \overline{K\lambda(\varpi)K}/K$ (we will make sense of the closure later). We now use the following fact that
	\[ \overline{K\lambda(\varpi)K}/K = \sqcup_{\nu \leq \lambda} K\nu(\varpi)K/K \]
Hence we conclude that $\mu \leq \lambda$. (This argument will be made rigorous when we discuss the affine Grassmannian and Schubert varieties.)
\end{proof}

\underline{Proof of (1):} Consider the factorization of $\mc{S}$ as 
	\[ \mc{H}_K \xrightarrow{\mathrm{res}_B} \mc{H}(B(F), B(\mc{O}) \xrightarrow{\beta} \mc{H}_{T(\mc{O})} \xrightarrow{\cdot \delta_B^{\frac12}} \mc{H}_{T(\mc{O})} \]
Where the map $\beta$ is $\beta(f)(t) = \int_N f(tn)dn$. We will prove that each individual map is an algebra homomorphism. Given functions $f_1, f_2 \in \mc{H}_K$ we have that $\mathrm{res}_B(f_1\ast f_2)$ is the map
	\[ p \mapsto \int_G f_1(x)f_2(x^{-1}p) d_G g\]
where $d_G$ is a normalized left Haar measure on $G$. If we likewise denote $d_K, d_B$ as normalized left Haar measures on $K, B$ then the Iwasawa decomposition gives rise to the following integration formula (see Cartier, Representations of $p$-adic Groups)
\begin{align*}
\int_G f_1(x) f_2(x^{-1}p) d_G g &= \int_K\int_B f_1(bk)f_2(k^{-1}b^{-1}p)d_Kk d_B b &\text{(Cartier)} \\
&= \int_B f_1(b)f_2(b^{-1}p) d_B b &\text{since $f_1, f_2$ are K invariant} \\
&= \mathrm{res}_B(f_1)\ast \mathrm{res}_B(f_2) 
\end{align*}
Hence the first map is an algebra homomorphism. For the second map $\beta$, we have
\begin{align*} 
\beta(f_1\ast f_2)(s) &= \int_Nf_1\ast f_2(sn)dn  = \int_N\int_B f_1(b)f_2(b^{-1}sn)db\ dn\ \\
&= \int_N\int_T\int_N f_1(tn_1)f_2(n_1^{-1}t^{-1}sn)dn_1\ dt\ dn\ \\
&= \int_N\int_T\int_N f_1(tn_1)f_2(t^{-1}sn) dn\ dt\ dn\ & \text{$dn$ is left invariant} \\
&= \int_T\left(\int_Nf_1(tn_1)dn_1\right)\left(\int_Nf_2(t^{-1}sn)dn_2\right) dt\\
&= \int_T \beta(f_1)(t)\beta(f_2)(t^{-1}s)dt = \beta(f_1)\ast\beta(f_2)(s) 
\end{align*}
This shows that the second map is an algebra homomorphism. It is clear that the third map is an algebra homomorphism. Hence we have proven (1).

\underline{Proof of (2):} We need to show that $\mathrm{im}(\mc{S})$ is Weyl invariant. Recall $W = N(T)/T = N(T)\cap K/T\cap K$ (this holds because $G$ is split) and $T\cap K = T(\mc{O})$. So we need to show 
\[ \mc{S}(f)(t) = \mc{S}(f)(xtx^{-1}) \]
for all $x \in N(T)\cap K$ and all $t \in T(F)$. By continuity, it suffices to check this on the dense set of regular $t$, i.e. $t \in T$ such that $\alpha(t) \neq 1$ for all $\alpha \in \Phi$. (For $\mathrm{Gl}_n$ these are the diagonal matrices with distinct entries). We will use without proof the following lemma, (see Cartier, Representations of $p$-adic Groups). 

\begin{lem}
For $t$ regular, if one writes $D(t) = |\det\left((\mathrm{Ad}(t) - 1)|_{\mf{n}}\right)|\delta(t)^{\frac{-1}2}$, then 
\[ \mc{S}(f)(t) = D(t) \int_{G/T} f(gtg^{-1}) d_{G/T}g \]
\end{lem}

Perhaps a little bit of explanation is necessary. The groups $G, T$ are unimodular, and we can define a left $G$-invariant quotient measure $d_{G/T}$ allowing us to integrate $T$-invariant function over $G/T$. This type of integral over conjugacy classes is usually called an orbital integral. Also note that $f(gtg^{-1})$ is (right) $T$-invariant as a function of $g$. We will now prove (3) using the lemma. First we show Weyl invariance of $D(t)$ (we've written $\mf{n}'$ for the opposite unipotent radical of $\mf{n}$):
\begin{align*}
D(t)^2 &= |\det\left((\mathrm{Ad}(t) - 1)|_{\mf{n}}\right)|^2 |\det\left((\mathrm{Ad}(t^{-1})|_{\mf{n}}\right)| \\
&= |\det\left((\mathrm{Ad}(t) - 1)|_{\mf{n}}\right)||\det\left((\mathrm{Ad}(t^{-1}) - 1)|_{\mf{n}}\right)| \\
&= |\det\left((\mathrm{Ad}(t) - 1)|_{\mf{n}}\right)||\det\left((\mathrm{Ad}(t) - 1)|_{\mf{n'}}\right)| \\
&= |\det\left((\mathrm{Ad}(t) - 1)|_{\mf{g}/\mf{t}}\right)|
\end{align*}
This expression is clearly Weyl-invariant. Finally,
\begin{align*}
\int_{G/T} f(gxtx^{-1}g^{-1}) d_{G/T} g &= \int_{G/T}(f(x^{-1}gx)t(x^{-1}gx)^{-1}) d_{G/T}g \\
&= \int_{G/T} f(gtg^{-1}) d_{G/T} g 
\end{align*}
where the last equality is by the change of variables $g \mapsto xgx^{-1}$ (here we use that $x \in K$, which is compact, to show the quotient measure is preserved under $x$-conjugation). 

\end{proof}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\section{Function sheaf dictionary}
With notation as in the previous section, the classical Satake isomorphism is giving an isomorphism of $\mc{S} \colon \mc{H}_K \xrightarrow{\sim} \mc{H}(T, T(\mc{O})^W$. We can phrase this isomorphism slightly differently which will show us how to categorify the classical Satake isomorphism to get geometric Satake. We begin by noting that $\mc{H}(T, T(\mc{O}))^W \cong \cmplx[X_\bullet(T)]^W$, which by heighest weight theory is precisely the complexification of the Grothendieck group of $\mathrm{Rep}(G^\vee)$ where $G^\vee$ is the Langlands dual of $G$. The $K$-spherical Hecke algebra is $\mc{H}_K = C^\infty(G(\mc{O})\backslash G(F)/G(\mc{O})) = C^\infty(G(F)/G(\mc{O}))^{G(\mc{O})}$. These are the $G(\mc{O})$-invariant functions on $G(F)/G(\mc{O})$. So the Satake isomorphism is an isomorphism 
	\[ \mc{S} \colon C^\infty(G(F)/G(\mc{O}))^{G(\mc{O})} \xrightarrow{\sim} K_0(\mathrm{Rep}(G^\vee))\otimes \cmplx \]
If we wanted to categorify this isomorphism, that is to turn this into an equivalence of categories, the obvious thing to put on the right hand side is $\mathrm{Rep}(G^\vee)$. It is much less clear what we should put on the left hand side. From now on we specialize to the case where $F = k((t))$ and $\mc{O} = k\llbracket t \rrbracket$. In the next section, we will introduce a geometric object over $k$, the affine Grassmannian $\mathrm{Gr}_G$, which has the property that $\mathrm{Gr}_G(k) = G(F)/G(\mc{O}) = G(k((t)))/G(k\llbracket t \rrbracket)$. Under this identification the left hand side becomes a collection of $K = G(\mc{O})$ invariant functions on the affine Grassmannian. But what kind of ``functions''? The answer to this question will be provided using the function sheaf dictionary, which we explain now.

Take $k = \mathbb{F}_q$ and $X$ a finite type separated scheme over $\mathbb{F}_q$. A constructible $\rats_\ell$-sheaf $\mc{F}$ on $X$ is a $\rats_{\ell}$-sheaf (we are not being very precise here) $\mc{F}$ such that there exists a partition $X$ into a finite disjoint union of locally closed subschemes $X_\alpha$ and $\mc{F}|_{X_\alpha}$ is locally constant. Recall that locally constant $\rats_\ell$-sheaves on a connected scheme $Y$ are equivalent to continuous $\rats_\ell$ representations of $\pi_1^\text{\'et}(Y)$ (in what follows we omit reference to base-points). In particular, a locally constant sheaf $\mc{G}$ on $\mathrm{Spec}(k)$ is the same thing as a continouous $\ell$-adic representation of $\Gamma_k = \mathrm{Gal}(\overline{k}/k)$ which by abuse of notation we will also denote by $\mc{G}$. In particular, given $\mc{F}$ constructible and $x \in X(k)$ we can view $x^\ast \mc{F}$ as a $\Gamma_k$ representation. We can now define the function associated to a constructible sheaf $\mc{F}$ on $X$. 

%Function sheaf dictionary
\begin{defn}
If $\mc{F}$ is a constructible $\rats_\ell$-sheaf the the function associated to $\mc{F}$ is 
\begin{align*}
	\tr_\mc{F} \colon X(k) &\to \rats_\ell \\
\left(x\colon \mathrm{Spec}(k) \to X\right) &\mapsto \tr(\frob{q} | x^\ast\mc{F})
\end{align*}
where $\frob{q} \in \Gamma_k$ is the geometric Frobenius, and we think of $x^\ast \mc{F}$ as an $\ell$-adic Galois representation. More generally, given $K \in D^b_c(X)$ the bounded derived category of $\ell$-adic sheaves, the function associated to $K$ is 
\begin{align*} 
\tr_\mc{F} \colon X(k) &\to \rats_\ell \\
x &\mapsto \sum_i (-1)^i \tr_{H^i(K)}(x)
\end{align*}
\end{defn}

This turns out to be a reasonable definition because of the following

%Compatibilities of function sheaf dictionary
\begin{prop}
The following compatibilities hold.
\begin{enumerate}
\item If ${F}, {G}$ are in $D^b_c(X)$, the bounded derived categry of constructible sheaves on $X$, then 
	\[\tr_{{F} \oplus {G}} = \tr_{{F}} + \tr_{{G}} \]
and
\[
 \tr_{F \otimes G}= \tr_F \cdot \tr_G.
\]

\item If $f \colon X \to Y$ is a morphism and ${F} \in D^b_c(Y)$ then 
	\[f^\ast \tr_{\mc{F}} = \tr_{f^\ast \mc{F}}\]
\item With $f$ as above we can form for any $K \in D^b_c(X)$ the sheaf $Rf_!K \in D^b_c(Y)$ and we have for $y \in Y(k)$
	\[\tr_{Rf_!K}(y) = \sum_{x \in f^{-1}(y)\cap X(k)} \tr_K(x) \tag{$\star$} \]\label{integratefibers}
\end{enumerate}
\end{prop}

This proposition shows that operations on sheaves translate to the analogous operations on fuctions. The first two are fairly easy, while the last formula is difficult; it can be thought of as saying that pushforward is integration along the fibers. We will now give examples of the function sheaf dictionary and investigate some consequences of the proposition. 

%Sheaves associated to characters
\begin{exmpl}[Sheaves associated to characters]\label{sheafcharacter}
Suppose $A$ is a commutative algebraic group scheme over $k$. We can define a map $L \colon A \to A$ called the Lang isogeny given by $x \mapsto x-Fx$, where $F$ is the $k$-morphism given by $x \mapsto x^q$ on structure sheaves. The Lang isogeny is a finite \'etale cover with kernel equal to $A(k)$. In the case of $\mathbb{G}_a$ the Lang isogeny is the Artin-Scheier map $x \mapsto x-x^q$. 

The deck transformations of $L$ over $A$ are given by multiplication by elements of $A(k)$, hence we get a surjection $\pi_1^\text{\'et}(A) \to \mathrm{Aut}(L) \cong A(k)$. Now given any character $\chi \colon A(k) \to \overline{\rats_\ell}^\times$ is an $\ell$-adic representation, hence corresponds to a locally constant $\ell$ adic sheaf $\mc{L}_\chi$. We claim that $\tr_{\mc{L}_\chi} = \chi$. Indeed, let $x \in A(k)$. Then $x^\ast \mc{L}_\chi$ is the unique continuous representation $\Gamma_k \to \overline{\rats}_\ell$ sending $\frob{q} \mapsto \chi(x)$. Indeed, given a point $x \in A(k)$ fix a geometric point $\overline{x} \to x$ (which amounts to fixing an algebraic closure $\overline{k}$ of $k$). The corresponding $\ell$-adic representation is 
	\[ \Gamma_k = \pi_1(x) \to \pi_1(A) \to A(k) \xrightarrow{\chi} \overline{\rats}_\ell^\times \]
(we have ommitted the basepoint $\overline{x}$ and the superscripts \'et). So we are done as soon as we see that $\frob{q} \mapsto x \in A(k)$ under the composition 
	\[ \pi_1(x) \to \pi_1(A) \to \mathrm{Aut}(L) \cong A(k) \]
Given $y \in L^{-1}(x)$ then $y-F(y)= x$ or equivalently $F(y) = y-x$. But the action of $F$ on $L^{-1}(x)$ is the same as the action of $\frob{q}^{-1} \in \pi_1(x)$. Hence we see that $\frob{q}$ acts as translation by $x$ on $L^{-1}(x)$ and hence $\frob{q}$ maps to $x \in A(k)$ as required. 
\end{exmpl}


%Lefschetz fixed point formula
\begin{exmpl}[Lefschetz fixed point formula]
A key result in proving the Weil conjectures is the Lefschetz fixed point formula 
	\[\sum_i (-1)^i \tr(\frob{q}| H^i_c(X_{\overline{k}}, \rats_\ell))  = |X(k)|\]
This is the basic case of the push-forward formula in the previous Proposition: take $f$ to be the structure morphism $f \colon X \to Y = \mathrm{Spec}(k)$ and $K = \rats_\ell \in D^b_c(X)$. For the one point $y \in Y(k)$ we have $f(x) = y$ for all $x \in X(k)$, hence the right hand side of \ref{integratefibers} is just 
	\[ \sum_{X(k)} \tr_{\rats_\ell}(x) = \sum_{X(k)} 1 = |X(k)| \]
But we can also compute $\tr_{Rf_!\rats_\ell}(y)$ from the definition. Since $H^i(Rf_!\rats_\ell) = H^i_c(X_{\overline{k}}, \rats_\ell)$ we have the left hand side of \ref{integratefibers} is
	\[ \tr_{Rf_!\rats_\ell} = \sum_i (-1)^i \tr(\frob{q} | H^i_c(X_{\overline{k}}, \rats_\ell)) \]
\end{exmpl}

%Gauss sums
\begin{exmpl}[Gauss sums]
Gauss considered sums of the form 
	\[ G(\chi, \psi) = \sum_{x\in k^\times} \chi(x)\psi(x) \]
where $\chi \colon k^\times \to \cmplx^\times$ and $\psi \colon k \to \cmplx^\times$ are characters. Gauss proved that $|G(\chi, \psi)| = \sqrt{q}|$. This is a very elementary computation, but we will prove it geometrically. The idea is to use the sheaf $\mc{F} = \mc{L}_\chi \otimes j^\ast \mc{L}_\psi$ where $\mc{L}_\chi$ is the sheaf associated to $\chi$ on $\mathbb{G}_m$ (example \ref{sheafcharacter}), $\mc{L}_\psi$ is the sheaf associated to $\psi$ on $\mathbb{G}_a$ and $j \colon \mathbb{G}_m \to \mathbb{G}_a$ is the open immersion. Then it follows that $\tr_{\mc{F}}(x) = \chi(x)\psi(x)$, hence
	\[ G(\chi, \psi) = \sum_{x \in k^\times} \tr_{\mc{F}}(x) = \sum_i (-1)^i \tr(\frob {q}| H^i_c( \mathbb{G}_m, \mc{F})) \]
where the second equality is by the theorem and a similar argument as was used in the previous example. We can compute that $H^0_c(\mathbb{G}_m, \mc{F}) = H^2_c(\mathbb{G}_m, \mc{F}) = 0$ and $H^1_c(\mathbb{G}_m, \mc{F})$ is $1$ dimensional. A little argument using Deligne's Weil II shows the eigenvalue of Frobenius on first cohomology is $\sqrt{q}$ and consequently $|G(\chi, \psi)| = \sqrt{q}$. 
\end{exmpl}

%Kloosterman sums
\begin{exmpl}
What we did for Gauss sums was very silly, since it is extremely elementary to prove that $|G(\chi, \psi)| = \sqrt{q}$. However, the idea we used can be used to bound absolute values of Kloosterman sums. Given a character $\psi \colon k \to \cmplx^\times$ the $n$-th Kloosterman sum is 
	\[ \mathrm{Kl}_n(a) = \sum_{x_1\cdot x_2 \cdots x_n = a} \psi(x_1 + \cdots + x_n) \]
Using an idea similar to the previous example, Deligne showed that $|\mathrm{Kl}_n(a)| \leq nq^{(n-1)/2}$. The idea is to consider $X = \{(x_1, \ldots, x_n)\colon x_1\cdots x_n = a \} \subset \mathbb{A}^n$ and take $f \colon X \to \mathbb{A}^1$ given by $(x_1, \ldots, x_n) \mapsto x_1 + \cdots + x_n$. Then 
	\[ \mathrm{Kl_n(a)} = \sum_{i} \tr(\frob{q}|H^{i}_c(X_{\overline{k}}, f^\ast \mc{L}_\psi)) \]
In order to bound this sum, Deligne shows the cohomology on the right hand side is $0$ for $i \neq n-1$ and then uses information (Weil II) about the eigenvalues of frobenius on \'etale cohomology. 
\end{exmpl}
