!newop ACF
!newop eq
!newop Zar
!newop st
!newop stp
!newop loc
!newop cl
!newop trd
!newop inc
!newop len
!newop locus
!newcal U
\providecommand{\stR}{{ }^*\R}
\providecommand{\stC}{{ }^*\C}
\providecommand{\dl}{\delta}
\providecommand{\bdl}{\boldsymbol\dl}
\providecommand{\fdl}{\dl_{\"fin}}
\providecommand{\clbdl}{\cl_{\bdl}}
\providecommand{\dind}{\|/^{\bdl}}
\providecommand{\ndind}{\+/^{\bdl}}
\providecommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\providecommand{\calE}{\mathcal{E}}
\renewcommand{\a}{\overline{a}}
\renewcommand{\b}{\overline{b}}
\renewcommand{\c}{\overline{c}}
\renewcommand{\d}{\overline{d}}
\renewcommand{\g}{\overline{d}}
\newcommand{\pp}{\mathfrak{p}}
\newcommand{\qq}{\mathfrak{q}}
\renewcommand{\O}{\mathcal{O}}
\providecommand{\AA}{\mathbb{A}}

\theoremstyle{remark}
\newtheorem{setup}[thm]{Setup}
\newtheorem{assumption}[thm]{Assumption}
\newtheorem{recall}[thm]{Recall}

Disclaimer: these are old scrappy notes which should not be trusted, and are 
only here because they contain some ideas which didn't make it into the paper 
and could be useful one day.

## Preliminaries

# Pseudofinite dimensions

Setup:
  Work in an ultraproduct $K$ of expansions of algebraically closed fields 
  $K_i$ in a countable language $L$. Let $\stR$ be the corresponding 
  ultrapower of $\R$, and let $\st : \stR --> \R$ be the standard part map.

  Fix $\xi_0 (- \stR$, and recall the coarse pseudofinite dimension 
  $\bdl := \bdl_{\xi_0}$, defined by $\bdl(X) := \st(\frac{\log |X|}{\xi_0}) 
  (- \R \cup \{-\infty,\infty\}$ for $X (= K^n$ a definable subset.

  (Note this would make sense for subsets of $K^{\eq}$, but using EI in ACF we 
  can consider just $K^n$.)

  We also consider $//\\$-definable sets, by which we will mean an 
  intersection of countably many definable sets; equivalently, since the 
  language is countable, the set defined by a partial type over a countable 
  set. Since $K$ is $\aleph_1$-saturated, taking the realisations in $K$ is 
  a bijection between such partial types and the $//\\$-definable subsets 
  they define, and we will often identify a $//\\$-definable set with the 
  corresponding partial type.

  We define $\bdl$ for $//\\$-definable $X$ by $\bdl(X) := \inf_{X' )= X} 
  \bdl(X')$ for $X'$ definable.

  We also use the fine pseudofinite dimension.
  Let $\Gamma_0 := \stR / \"Fin$ where $\"Fin$ is the convex hull of the 
  standard reals.
  Let $\Gamma$ be the lower formal completion of $\Gamma_0$ as an ordered 
  abelian monoid, which can be constructed as the set of downwards-closed 
  subsets of $\Gamma_0$.
  Recall from \cite[5.1]{Hr-approxSubgrps} the fine pseudofinite dimension 
  $\fdl$ defined on definable subsets of $K^n$ taking
  values in $\Gamma_0 \cup \{-\infty,\infty\}$, and on $//\\$-definable 
  subsets taking values in $\Gamma$.
  Note that $\fdl(X) <= 0$ iff $X$ is finite.

  Define $R(X)$ for a $//\\$-definable set $X$ to be the Morley rank of 
  the partial field type implied by $X$; equivalently, the dimension of the 
  Zariski closure $X^{\Zar}$ of $X$.
  .

Assumption:
  We assume internal characteristic 0, i.e. $\"char(K_i) = 0$.
  This is used by Lemma~\ref{lem:SZT}.
  (See \cite[Corollary~5.6]{Hr-psfDims} for discussion on how it ought to 
  be possible to weaken this).
  .

Assumption:
  We assume that $\bdl$ is continuous, meaning that given a formula 
  $\phi(x,y)$ and $\alpha (- \R$, for any $\epsilon (- \R_{>0}$ there is a 
  definable set $Y$ such that $b (- Y => \bdl(x,b) < \alpha+\epsilon$ and 
  $\bdl(x,b) <= \alpha => b (- Y$.
  Hence, the definitions and results of \cite[2.7]{Hr-psfDims} apply, and we 
  use them below.

  In particular, $\bdl$ is invariant and is additive:
  $\bdl(ab/C)=\bdl(b/C) + \bdl(a/bC)$.

  {\em TODO: explicitly recall any other bits we use.}

  Continuity can be ensured while keeping the language countable by adding 
  cardinality comparison quantifiers as in \cite{Hr-psfDims}, or more simply 
  by adding quantifiers expressing that $\log(|\phi(M,a)|) < q\xi_0$ for each 
  $q (- \Q$.
  .


Notation:
  Unless otherwise specified, $X,Y,Z$ will be $//\\$-definable sets,
  while $A,B,C$ will be constructible sets.
  .

Recall from \cite[5.2]{Hr-approxSubgrps} the following basic properties of 
a pseudofinite dimension $\dl$, including $\fdl$ and $\bdl$:
Lemma{lem:dlProps}:--
  **(i)
    $\dl$ is subadditive: if $f$ is definable and $\dl(f^{-1}(f(x))) <= 
    \xi$ for all $x (- X$, then $\dl(X) <= \dl(f(X)) + \xi$.

  **(ii)
    For any $\xi (- \Gamma$ and $n (- \N$, $\{ X (= K^n | \dl(X) < \xi 
    \}$ is an ideal. In particular, any partial type $X$ over a 
    countable set $A (= K$ can be completed to a complete type $Y (= X$ 
    over $A$ with $\dl(Y) = \dl(X)$.
  *ee*
  .

%Lemma{lem:CS}:
%  If $f : X --> Y $ is definable, then the self-fibre-product of $X$ 
%  with itself with respect to $f$, $X \times_f X := \{ (x,y) | x (- X, y 
%  (- X, f(x)=f(y) \}$, satisfies $\bdl(X \times_f X) >= 2\bdl(X) - \bdl(f(X))$.
%  .
%Proof:
%  When $X$ is definable, this follows from a Cauchy-Schwarz argument - see 
%  \cite[2.2]{Hr-psfDims}. In general,
%  for any $\epsilon>0$ in $\R$, there exists $X' )= X$ such
%  that $\bdl(f(X')) < \bdl(f(X))+\epsilon$, and then for any definable $X''$ 
%  with $X (= X'' (= X'$, $\bdl(X'' \times_f X'') >= 2\bdl(X'') - \bdl(f(X'') > 
%  2\bdl(X) - \bdl(f(X)) - \epsilon$.
%  So $\bdl(X \times_f X) >= 2\bdl(X) - \bdl(f(X)) - \epsilon$.
%  .
%
%{\em TODO - what's the best version of this for fine dimension and 
%$\Wedge$-definable $X$?}
%
%{\em TODO - actually for the coarse dimension there's nothing special about 
%*self*-fibre-products, and Cauchy-Schwarz is irrelevant really. It's really 
%just about the existence of $\bdl$-independent extensions; see the next 
%section.}

# Szemeredi-Trotter

We deduce pseudofinite dimension bounds from the algebraic Szemeredi-Trotter 
results of [FoxEtAl-SzemerediTrotter].

Lemma{lem:SZT}:
  Suppose $X_1$ and $X_2$ are $//\\$-definable sets and $X$ is the 
  intersection of $X_1 \times X_2$ with a Zariski closed set.

  Suppose $R(X_1),R(X_2) <= d/2$.

  Suppose further that $X$ omits $K_{t,2}$ for some $t (- \N$, meaning that 
  for $a,b (- X_2$ with $a /= b$,
   \[ |{ X(a) \cap X(b) }| < t ,\]
  where $X(y) := \{ x : (x,y) (- X \} (= X_1$.

  Then
  **(i)
  \[ \bdl(X) <= \max(
    \frac d{2d-1}\bdl(X_1) + \frac{2d-2}{2d-1}\bdl(X_2), \bdl(X_1), \bdl(X_2)
    ) ;\]
  **(ii) (Symmetric version)
  \[ \frac{\bdl(X)}{\max(\bdl(X_1),\bdl(X_2))}
    <= \frac{3d-2}{2d-1} = \frac 32 - \frac 1{4d-2} ;\]
  **(iii) ($d$-independent version)
  if $\bdl(X_1) > 0$ and $\bdl(X_2) > \frac 12 \bdl(X_1)$,
  then
  \[ \bdl(X) < \frac 12\bdl(X_1) + \bdl(X_2) .\]
  *ee*
  .
Proof:
  (ii) and (iii) are easy consequences of (i). We prove (i).

  We may assume $\bdl(X_i) < \infty$ for $i=1,2$, as otherwise the result is 
  immediate.

  Say $X = (X_1 \times X_2) \cap V$ where $V$ is Zariski closed and defined 
  over a finitely generated subfield $k <= K$.

  By the compactness theorem of first order logic, there are definable $X_i' 
  )= X_i$ such that $(X_1' \times X_2') \cap V$ also omits $K_{t,2}$.
  So by the definition of $\bdl$ on $//\\$-definable sets, it suffices to 
  prove the lemma in the case that $X_i$ are definable.

  So assume $X_i$ are definable, and that $\bdl(X)$ exceeds the stated bound.
  Then for some real $\epsilon > 0$, for some $K_i$,
  *\[a* |X(K_i)|
  & >= |X_1(K_i)|^\epsilon |X_2(K_i)|^\epsilon (
  |X_1(K_i)|^{\frac d{2d-1}} |X_2(K_i)|^{\frac{2d-2}{2d-1}}
  + |X_1(K_i)| + |X_2(K_i)| ) . *a\]*

  Embedding the finitely generated field $k(X_1(K_i),X_2(K_i))$ into $\C = \R 
  + i\R$,
  since the degree of the fibre $V(y)$ is uniformly bounded,
  this contradicts [FoxEtAl-SzemerediTrotter Theorem~1.2] for some $d$.
  %(Alternatively, it contradicts [Elekes-Szabo Theorem~9] for some $d$, but 
  %that gives less information on $d$.)

  TODO: This is enough for (iii), which actually may be enough for our purposes,
  but to get that we can take $d=2\max(R(X_1),R(X_2))$,
  we must argue inductively as in [Breuillard-Wang Corollary~2.7].
  .

The following qualitative corollary is not used in the sequel.
It can be interpreted as saying that algebraically defined ``strict 
quasidesigns'', being incidence systems in which pairs of ``lines'' intersect 
finitely but non-trivially, are possible in characteristic 0 only in the 
extreme situations that there are few points, or there are few lines through a 
point on average, or points typically lie on only one line.

Corollary[cor:noStrictQdesign]:
  Suppose $X,X_1,X_2$ are as in Lemma~\ref{lem:SZT},
  and suppose further that $X(a) \cap X(b) /= {}$ for $a,b (- X_2$.

  Then $\bdl(X_1)=0$ or $\bdl(X) <= \bdl(X_1)$ or $\bdl(X) > 2\bdl(X_2)$.
  .
Proof:
  Suppose not.

  Consider the fibre product $Z := \{ (p,l,l') : (p,l),(p,l') (- X \}$.
  Then for $l,l' (- X_2$ with $l /= l'$,
  we have $1 <= | \{ p : (p,l,l') (- Z \} | <= t$.
  So $\bdl(Z) = \max( 2\bdl(X_2), \bdl(X) ) = 2\bdl(X_2) )$.

  Considering the projection to $X_1$ meanwhile, we obtain
  $\bdl(Z) <= \bdl(X_1) + 2(\bdl(X) - \bdl(X_1)) = 2\bdl(X) - \bdl(X_1)$.

  So $\bdl(X) >= \frac 12\bdl(X_2) + \bdl(X_1)$,
  so by Lemma~\ref{lem:SZT}(iii) and our assumption that $\bdl(X_1)>0$,
  we have $\bdl(X_2) <= \frac 12 \bdl(X_1) < \frac 12 \bdl(X)$,
  contradicting assumptions.
  .

The following version of Szemeredi-Trotter allows for pseudofinite pairwise 
intersections, but has weaker bounds than Lemma~\ref{lem:SZT}.
Lemma{lem:SZTb}:
  Suppose $X_1$ and $X_2$ are $//\\$-definable sets and $X$ is the 
  intersection of $X_1 \times X_2$ with a Zariski closed set.

  Suppose further that for $a,b (- X_2$ with $a /= b$,
   \[ \bdl(X(a) \cap X(b)) <= \tau ,\]
  where $X(y) := \{ x : (x,y) (- X \} (= X_1$.

  Then
  **(i)
  for some $\eta > 0$ which does not depend on $\tau$,
  \[ \bdl(X) <= \tau + \max ((1-\eta) (\frac12\bdl(X_1) + \bdl(X_2)),
  \bdl(X_1), \bdl(X_2)) \]
  **(ii)
  if $\bdl(X_1) > 0$ and $\bdl(X_2) > \frac 12 \bdl(X_1)$,
  then
  \[ \bdl(X) < \tau + \frac 12\bdl(X_1) + \bdl(X_2) .\]
  *ee*
  .
Proof:
  (ii) follows from (i). We prove (i).

  We may assume $\bdl(X_i) < \infty$ for $i=1,2$, as otherwise the result is 
  immediate.

  Say $X = (X_1 \times X_2) \cap V$ where $V$ is Zariski closed and defined 
  over a finitely generated subfield $k <= K$.

  By continuity of $\bdl$ and the compactness theorem of first order logic,
  for any $\tau' > \tau$,
  there are definable $X_i')= X_i$ such that in $X' := (X_1' \times X_2') \cap 
  V$,
  for $a /= b$, we have $\bdl(X'(a) \cap X'(b)) < \tau'$.
  So by the definition of $\bdl$ on $//\\$-definable sets,
  it suffices to prove the lemma in the case that $X_i$ are definable.

  So assume $X_i$ are definable, and that $\bdl(X)$ exceeds the stated bound.
  Then for some real $\epsilon > 0$, for some $K_i$,
  setting
  $T := ( \max_{a,b (- X_2^{K_i}; a /= b} |X^{K_i}(a) \cap X^{K_i}(b)| )$,
  we have
  \[ |X^{K_i}|
  >= T
  |X_1^{K_i}|^\epsilon |X_2^{K_i}|^\epsilon (
  (|X_1^{K_i}|^{\frac 12} |X_2^{K_i}|)^{1-\eta}
  + |X_1^{K_i}| + |X_2^{K_i}| ) . \]

  Embedding the finitely generated field $k(X_1^{K_i},X_2^{K_i})$ into $\C = \R 
  + i\R$,
  since the degree of the fibre $V(y)$ is uniformly bounded,
  for sufficiently small $\eta$,
  this contradicts [Elekes-Szabo Theorem~9] once we observe from the proof of 
  that theorem that the constant in the $\O$-notation depends linearly on $t$
  (which is $b$ in the notation of that paper).

  FIXME: is there anything to cite for this observation? It doesn't seem to be 
  explicit in any of the proofs of Szemeredi-Trotter theorems I can find.
  Maybe best to just give a proof from the cutting lemma?
  Note that we presumably can in fact get the same bounds as in 
  Lemma~\ref{lem:SZT}, by using the FoxEtAl result - the only problem is that 
  the proof there is less explicit, so checking the dependence on the bound on 
  sizes of intersections is less straightforward (and I haven't done it).
  .


# Canonical bases

We recall some of the model-theoretic yoga of stationarity and canonical bases 
which will be used below.

A type is _stationary_ if it has a unique non-forking global extension. In 
stable theories, types over $\acleq$-closed sets are stationary; we write 
$\stp(a/b)$ for $\tp(a/\acleq(b))$.

The _canonical base_ of a stationary type $p \in S(A)$, is the least 
$\dcleq$ closed set $\Cb(p) (= \dcleq(A)$ such that the restriction of $p$ 
to $\Cb(p)$ is stationary and $p$ is its non-forking extension. We write 
$\Cb(a/b)$ for $\Cb(\stp(a/b))$.

We have $a \|/_C B <==> \acleq(\Cb(a/B)) (= \acleq(C)$.

We say stationary types $p (- S(A)$ and $q (- S(B)$ are _parallel_ 
if $p\cup q$ has a completion which forks over neither $A$ nor $B$.
Another characterisation of the canonical base is that
if $\sigma$ is a global automorphism,
then $p^\sigma$ is parallel to $p$
iff $\Cb(p)$ is fixed pointwise by $\sigma$.

In an $\omega$-stable theory (such as $\ACF$), canonical bases are finite,
meaning $\Cb(p) = \dcleq(e)$ for some finite tuple $e$. So then $\Cb(a/b) 
= \dcleq(e)$ for some $e (- \acleq(b)$; in particular, $\tp(a/\~b)$ is 
stationary where $\~b := eb$.

In the case of an algebraically closed field, stationarity and canonical bases 
correspond to absolute irreducibility and fields of definition, respectively.
By elimination of imaginaries and quantifier elimination, $\acleq(A)=\acl(A)$ 
is the algebraically closed subfield generated by $A$, and
$\dcleq(A)$=$\dcl(A)$ is the perfect subfield generated by $A$, and 
non-forking agrees with algebraic independence. If $K$ is a perfect subfield 
and $p \in S_n(K)$, it follows from quantifier elimination that $p$ is the 
generic type of an irreducible variety $V (= \|A^n$ over $K$. Then $p$ is 
stationary iff $V$ absolutely irreducible, and $\Cb(p)$ is then the perfect 
closure of the field of definition of $V$.

## First version of Elekes-Szabo
(Preserving this for now, but see Theorem~\ref{thm:elekesSzabo2} for a neater 
version.)

Definition:
  $X$ is in _general position_ if any $Y (= X$ with $R(Y) < R(X)$ is finite.
  .

Lemma[Lemma~3.1]{lem:genPosBounds}:
  Let $\dl$ be $\fdl$ or $\bdl$.
  Suppose $X_i$ is in general position, $R(X_i)=k$, $\dl(X_i) <= \xi$,
  and $Y (= \prod_{i=1}^n X_i$.
  Then $\dl(Y) <= \floor{ R(Y) / k } \xi$.
  .
Proof:
  This holds for $n=1$ by assumption.
  Suppose the result for $n$, let $Y (= \prod_{i=1}^{n+1} X_i$, and let $\pi 
  : Y --> \prod_{i=1}^n$ be the co-ordinate projection map. Let $Y' (= Y$ be 
  a complete type with $\dl(Y') = \dl(Y)$. By definability of Morley rank in ACF,
  $R(\pi^{-1}(\pi(y)) = R(Y') - R(\pi(Y'))$ for any $y (- Y'$. Then by 
  subadditivity, the inductive hypothesis and the n=1 case (identifying 
  fibres of $\pi$ with subsets of $X_{n+1}$),
  *\[a* \dl(Y) = \dl(Y')
    &<= \dl(\pi(Y')) + \max_{y (- Y'} \dl(\pi^{-1}(\pi(y))) \\\
    &<= \floor{ R(\pi(Y') / k } \xi + \floor{ ( R(Y') - R(\pi(Y')) ) / k } \xi \\\
    &<= \floor{ R(Y') / k } \xi \\\
    &<= \floor{ R(Y) / k } \xi . *a\]*
  .


Thm[Version of Thm~1.8]{thm:elekesSzabo}:
  Suppose $X (= X_1\times X_2\times X_3$ are $//\\$-definable,
  $X^{\Zar}$ is irreducible,
  $\pi_i : X -->> X_i$ are the projection maps,
  $X_i$ is in general position,
  $R(X_i)=k$, $R(X)=2k=R(X_{ij})$ where $X_{ij} = (\pi_i \times \pi_j)(X)$,
  $\bdl(X_i) <= \xi$,
  and $\bdl(X) > (2-\eta)\xi$,
  where $\eta := 1/(16k-2)$.

  Then $X^{\Zar}$ is special (that is, in co-ordinatewise finite-to-finite 
  correspondence with the graph of a algebraic group), and moreover the 
  corresponding group is abelian.
  .
Remark:
  Without the assumption that $X^{\Zar}$ is irreducible, you get silly 
  counterexamples with e.g. $X^{\Zar} = \{ x=0 \/ y=0 \/ z=0 \}$.
  .
Proof:
  Original proof of this commented out;
  see Theorem~\ref{thm:elekesSzabo2} below (TODO: reorganise).
%  We may assume $X$ is a complete type over an algebraically closed subset 
%  $E (= K$; indeed, such a complete $X' (= X$ with $\bdl(X')=\bdl(X)$ exists 
%  by Lemma~\ref{lem:dlProps}(ii), and then by Lemma~\ref{lem:genPosBounds} 
%  and $\eta<1$, we have $R(X') = 2k$; so $X'^{\Zar} = X^{\Zar}$ since the 
%  latter is irreducible, and the conditions of the theorem hold for $X'$.
%  {\em CHECKME: do we actually use that $E$ is algebraically closed?}
%
%  We work with $K$ as an algebraically closed field extension of $E$: $\tp$,
%  $\stp$, $\Cb$, $\dcl$, $\acl$, the (Morley) rank $R$, and independence 
%  $\|/$ are all considered in the reduct of $K$ to the field language with 
%  constants for the elements of $E$.
%
%  Let $(a,b,c) (- X$; so $a,b,c$ are pairwise independent, each of rank $k$,
%  and $R(abc)=2k$.
%
%  By Lemmas \ref{lem:CS} and \ref{lem:dlProps}(ii), there is a $//\\$-definable 
%  $Y (= X \times_{\pi_2} X$ defined by a complete type and with 
%  $\bdl(Y) >= 2\bdl(X) - \bdl(X_2) > (3-2\eta)\xi$;
%  then by Lemma~\ref{lem:genPosBounds} and $\eta < 1/2$,
%  we have $R(Y) >= 3k$; so $R(Y)=3k$, and if $aa'cc'b (- Y$,
%  then $a'c'$ is an independent realisation of $\tp(ac/b)$.
%
%  Let $\alpha := aa'$, and $\gamma := cc'$, and
%  say $\Cb(\alpha/\gamma) = \dcl(e)$.
%  Claim:
%    $R(e) = k$
%    FIXME: I mean $\trd$, not $R$!
%    .
%  Proof:
%    Suppose for a contradiction that $R(e) > k$.
%
%    Let $Z$ be the projection of $Y$ to the $\alpha\gamma$ co-ordinates;
%    this projection has finite fibres, so $\bdl(Z) = \bdl(Y)$.
%
%    We have $\alpha\gamma (- Z (= \tp(\alpha\gamma)$, and $\bdl(Z) = \bdl(Y)$,
%    and subsets of $Z$ and of the projections $Z_1,Z_2$ satisfy the 
%    conclusion of Lemma~\ref{lem:genPosBounds}.
%    Without losing these properties,
%    we may assume that $\tp(\alpha/\gamma)$ is stationary. Indeed, say 
%    $\~\gamma (- \acl(\gamma)$ and $\gamma (- \dcl(\~\gamma)$ and 
%    $\tp(\alpha/\~\gamma)$ is stationary. Replacing $Z$ with its inverse image 
%    under $\tp(\alpha\~\gamma,\alpha\gamma)$, considered as a map 
%    $\tp(\alpha\~\gamma) --> \tp(\alpha\gamma)$ with finite fibres, does not 
%    change $\bdl(Z)$ nor the conclusion of Lemma~\ref{lem:genPosBounds}.
%    So we may assume $\~\gamma=\gamma$.
%
%    Now $e (- \dcl(\gamma)$, say $f(\gamma)=e$ for a rational map $f$.
%    Note $R(\alpha/\gamma)=k$.
%    Suppose $\alpha\gamma' (- Z$.
%    Then $R(\alpha / \gamma\gamma') = k$
%    iff $\alpha \|/_\gamma \gamma'$ and $\alpha \|/_{\gamma'} \gamma$,
%    iff $\Cb(\alpha / \gamma) = \Cb(\alpha / \gamma\gamma')
%      = \Cb(\alpha / \gamma')$,
%    iff $f(\gamma) = f(\gamma')$.
%    Meanwhile, $R(\gamma/e) = R(\gamma) - R(e) < k$.
%
%    Now let $Z' := (\id \times f)(Z)$.
%    Then by the above rank calculations and the fact that $Z$, and hence $Z'$,
%    implies a complete $\ACF$ type, the fibres of $(\id\times f)$ and the 
%    intersections $Z'_{e'} \cap Z'_{e''}$ for $e' != e''$ have rank $<k$, so 
%    by the conclusion of Lemma~\ref{lem:genPosBounds}, they are finite.
%    So $\bdl(Z') = \bdl(Z) = \bdl(Y) > (3-2\eta)\xi$, and (by compactness)
%    $Z'$ omits some $K_{2,t}$.
%    Meanwhile, the projections of $Z'$ have $\bdl(Z'_i) <= 2\xi$ and $R(Z'_i) = 
%    2k$.
%    So by Lemma~\ref{lem:noQuasidesign},
%    $3/2 - \eta < \bdl(Z') / 2\xi <= 3/2 - 1/(16k-2)$,
%    so $\eta > 1/(16k-2)$, contradicting the choice of $\eta$.
%
%
%    % TODO: maybe neater to directly work with a finitely valued f rather 
%    % than first passing to a finite cover?
%    .
%
%  So $R(e) = k$. Let $e' := \Cb(ac'/a'c)$. By the same argument, $R(e')=k$.
%
%  We now show that $aa'cc'ee'b$ forms an abelian group configuration.
%  Consider the following diagram.
%
%    \[ \xymatrix{
%    & & &&&& e \ar@{-}'[ddll][dddlll] \ar@{-}'[dlll][ddllllll]   \\\
%	& & & a' \ar@{-}'[d][dd] & & & \\\
%	a & &  & b & c \ar@{-}'[l][llll] & & \\\
%	&  & & c' &&   & \\\
%	&& & & & & e' \ar@{-}'[uull][uuulll] \ar@{-}'[ulll][uullllll] } \]
%
%  It follows from definitions of the elements and $R(e)=k=R(e')$ that each 
%  point has rank $k$.
%  
%  We claim that if $f_1f_2f_3$ is a colinear triple,
%  then $R(f_1f_2f_3) = 2k = R(f_if_j)$ for $i /= j$.
%  %then any two points are
%  %interalgebraic over the third, i.e. $f_i (- \acl(f_j,f_k)$ whenever 
%  %$\{i,j,k\}=\{1,2,3\}$.
%  This is clear for $abc$ and $a'bc'$. For $aa'e$, we have
%  $R(aa')=2k$ by choice of $a'$, and $a \|/ e$ since $a \|/ cc'$, so 
%  $R(ae)=2k$ and similarly $R(a'e)=2k$, and
%  so $R(aa'e)=R(aa'/e)+R(e)=R(aa'/cc')+R(e)=k+k=2k$ since $e=\Cb(aa'/cc')$.
%
%  For $cc'e$, note that $a$ and $b$ are interalgebraic over $c$ and also 
%  over $c'e$ (via $a'$); so $R(ab/cc'e)=R(ab/c)=R(ab)-R(c)$ and 
%  $R(ab/cc'e)=R(ab/c'e)$, so $\acl(c) = \acl(\Cb(ab/cc'e)) (= \acl(c'e)$, so 
%  $c (= \acl(c'e)$. Similarly $c' (= \acl(ce)$, and meanwhile $e = 
%  \Cb(ab/cc') (= \acl(cc')$. So $R(ce) = R(cc'e) = R(c'e)$, and $R(cc'e) = 
%  R(cc') = 2k$.
%
%  By symmetry, the same arguments apply to the remaining lines $ac'e'$ and 
%  $a'ce'$.
%
%  The rank of the whole diagram is $R(aa'cc'ee'b)=R(aa'c)=3k$. Now 
%  consider the diagram $aa'cc'ee'$ with $b$ omitted. Any non-colinear triple 
%  here has $aa'cc'ee'$ in its algebraic closure, and hence is independent.
%  So this is a group configuration. Now as in \cite[Theorem~C.2]{BHM-CCMA},
%  since $c (- \acl(a,b) (= \acl(a, \acl(a'c') \cap \acl(ac))$, the group 
%  obtained from the group configuration theorem is abelian. So by the group 
%  configuration theorem there is an abelian algebraic group such that the 
%  graph of its addition is co-ordinatewise interalgebraic with the line 
%  $aa'e$, and hence (working over $c'$) with the line $abc$; that is,
%  $\loc(abc) = X^{\Zar}$ is special.
  .
Remark:
  We didn't quite prove that the assumptions of \cite[Theorem~C.2]{BHM-CCMA} 
  hold, because there it is also assumed that $ee'b$ is an independent 
  triple. But in fact, this assumption is not used in the proof of that 
  theorem.
  .
Remark:
  The $//\\$-definable case of the theorem follows easily from the definable 
  case.
  .

Remark:
  The assumption on the ranks is necessary. For example, let $E$ be an 
  elliptic curve over $\C$, and let $\gamma (- E^2(\C)$ be such that the 
  subgroup $<\gamma>$ generated by $\gamma$ is Zariski-dense in $E^2$. There 
  are only countably many algebraic subgroups of $E^2$, so such $\gamma$ 
  certainly exist. Then consider the arithmetic progressions $A_n := 
  \{-n\gamma,-(n-1)\gamma,...,(n-1)\gamma,n\gamma\}$, and consider the 
  pseudo-finite approximate subgroup $A := \Pi_n A_i / \U$ of $E(\stC)$ 
  where $\stC := \Pi_n \C / \U$. Let $\pi_1 : E^2 --> E$ be the projection 
  to the first co-ordinate; so $\pi_1$ is injective on $A_n$ and hence on 
  $A$.

  By Falting's Theorem, if $V (= E^2$ is a proper algebraic subvariety over 
  $\C$, then it has finite intersection with $<\gamma>$. Moreover, the size 
  of this finite intersection is bounded uniformly in families, i.e. in the 
  degree of the subvariety \cite{Scanlon-MLUniformity}. Hence $A$ has finite 
  intersection with any proper algebraic subvariety over $\stC$, so $A$ is 
  in general position in $E^2$.

  Now let $X := \{ (a,\pi_1(b),\pi_1(c)) | a,b,c (- A, a+b=c \}$. We can 
  think of this as an "approximate subaction" of the algebraic action of 
  $E^2$ on its quotient $E$ defined by $(\alpha,\beta)*\eta := 
  \alpha+\eta$. Then $\bdl(X) = 2 \bdl(A) = 2\bdl(\pi(A))$, and $A$ 
  and $\pi(A)$ are in general position. So all the hypotheses of 
  Theorem~\ref{thm:elekesSzabo} are satisfied except the rank assumptions,
  but $X^{\Zar}$ is the graph of the algebraic action, which is not "special" 
  in the sense of that Theorem.

  It would be interesting to know whether this example is essentially the 
  general case - namely whether any such $X^{\Zar}$ is, up to finite-to-finite 
  co-ordinatewise correspondences *and algebraic group quotients*, the graph 
  of an abelian group operation.
  .

# Questions
Question:
  All we really used about $\ACF$ is that it has finite additive Morley rank 
  and that Lemma~\ref{lem:SZT} holds. Can we generalise that Lemma and hence 
  the Theorem to other contexts, such as D-varieties, or compact complex 
  manifolds, or finite Morley rank groups? When we have trichotomy / CBP, as 
  in D-varieties and CCM, can we deduce it directly from the ACF case? Or for 
  CCM, can we deduce it from the recent o-minimal versions applied to 
  $\R_{\"an}$? But these results apply only to the planar case.
  .

## Weak general position

We now begin to consider relaxing the assumption in
Theorem~\ref{thm:elekesSzabo} that the $X_i$ are in general position.

We would like to conclude that $X$ is in co-ordinatewise finite-to-finite 
correspondence with the graph of a nilpotent algebraic group.

We give examples to show that some condition is still needed. The following 
may suffice.

Definition:
  $X$ is in _weak general position_ (``$X$ is wgp'') if for any 
  Zariski closed subset $C (= X^{\Zar}$ with $\dim(C) < \dim(X^{\Zar})$,
  we have $\bdl(X\cap C) < \bdl(X)$.
  .

Note that simply taking $X$ to be a complete type $\tp(a/E)$ over some given 
countable parameter set $E$ does not ensure that it is in weak general 
position, since there is no restriction on the parameters defining $C$ in the 
definition of wgp. However, Lemma~\ref{lem:wgp} shows that it suffices to check 
$\bdl(X\cap C)$ for $C$ defined over $\clbdl(E)$. Sadly, $\clbdl(E)$ is in 
general uncountable, so our formalism does not allow us to consider types over 
such sets as $//\\$-definable sets, and we are forced to be a little circumspect.

{\em TODO: would it in fact make sense to pass to a more saturated elementary 
extension where we can work directly with such types?}

Lemma{lem:Racl}:
  $R(a/E) = \trd(a/\dcl(E)) = \trd(a/\acl(E))$.
  .
Proof:
  Clearly, $V := \tp(a/E)^{\Zar}$ is defined (as an algebraic variety) over 
  $\dcl(E)$, so $R(a/E) = \dim(V) >= \trd(a/\dcl(E)) >= \trd(a/\acl(E))$.
  Conversely, if $W = \locus(a/\acl(E))$,
  then a finite union $W'$ of conjugates of $W$ is defined over $\dcl(E)$,
  so $R(a/E) <= \dim(W') = \dim(W) = \trd(a/\acl(E))$.
  .

Lemma{lem:wgp}:
  **(i) A partial type $\pi$ is wgp iff for any completion $p )= \pi$, if 
    $R(p) < R(\pi)$ then $\bdl(p) < \bdl(\pi)$.
  **(ii) $\tp(a/E)$ is wgp iff for any $E' =) E$, if $a \dind_E E'$ then 
    $a \|/_{\acl(E)} \acl(E')$.
    % converse fails, of course!
  **(iii) $\tp(a/E)$ is wgp iff $a \|/_{\acl(E)} \clbdl(E)$.
  **(iv) If $\tp(a/E)$ is wgp and $a \dind_E b$, then $\tp(a/Eb)$ is 
    wgp.
  *ee*
  .
  
Proof:
  **(i)
    If $\pi$ is not wgp iff for some $\phi$ we have $R(\pi\cup\{\phi\}) < 
    R(\pi)$ but $\bdl(\pi\cup\{\phi\}) = \bdl(\pi)$, which as in 
    Lemma~\ref{lem:dlProps}(ii) is equivalent to some completion having 
    this property.
  **(ii)
    By Lemma~\ref{lem:Racl},
    $a \+/_{\acl(E)} \acl(E')$ iff $R(a/E') < R(a/E)$.
    So by (i), $\tp(a/E)$ is wgp iff for any $E'$,
    if $a \+/_{\acl(E)} \acl(E')$ then $a\ndind_E E'$.
  **(iii) By \cite[Lemma~2.13]{Hr-psfDims}, if $a \dind_E E'$, so also 
    $a \dind_{\clbdl(E)} \clbdl(E')$, then $a\|/_{\clbdl(E)} \clbdl(E')$, and in particular 
    $a\|/_{\clbdl(E)} \acl(E')$.
    So the result follows from (ii) and transitivity of $\|/$.
  **(iv) If $a \dind_{Eb} E'b$, then $a \dind_E E'b$ by the
    $\bdl$-independence assumption, so $a \|/_{\acl(E)} \acl(E'b)$ by wgp,
    so in particular $a \|/_{\acl(Eb)} \acl(E'b)$.
  *ee*
  .

Remark:
  Analagous phenomena appear in other expansions of fields. For example, in 
  the theory of differentially closed fields, the algebraically closed 
  differential field $<{ E }>_\partial$ generated by $E$ takes the place of 
  $\clbdl(E)$, and one has that $A \|/^\partial_E B$ implies $A \|/_{<{ E 
  }>_\partial} B$ (and in fact there the converse holds too). So just as 
  here, given $\tp(a/E)$, one has to consider that it is possible that $a 
  \+/_E <{ E }>_\partial$, even though $a \|/^\partial_E <{ E }>_\partial$,
  but once we pass to $\tp(a/<{ E }>_\partial)$ any further algebraic 
  dependence will imply differential dependence.

  {\em TODO: can we push this analogy further, and see our results on groups 
  as being in line with the results on definable groups in tame expansions 
  of fields?}
  .

Remark:
  This wgp hypothesis suffices to replace the general position hypothesis in 
  Proposition~5.1 of [Breuillard-Wang], yielding that if $G$ is an algebraic 
  group, and $(a_1,a_2,a_3) (- \Gamma_G$ is Zariski-generic and 
  $\bdl(a_i)=1$ and $\bdl(a_ia_j)=2$ for $i /= j$, then $G$ is nilpotent.
  TODO: details.
  .

Question:
  What happens when $G$ is only $\\//$-definable in ACF, e.g. the group of 
  birational automorphisms of a variety, or indeed in a monoid of 
  self-correspondences, and $a_1a_2a_3$ is as above, with $\locus(a_i) =: X 
  (= G$. We can use [BGT-structure] to find nilprogressions. Taking the 
  Zariski closure, can we deduce that $X$ is a nilpotent algebraic subgroup?
  .

% Commenting this out, because it doesn't work.
%Example:
%  If we don't assume wgp, we can get non-nilpotent groups.
%  Consider a non-nilpotent algebraic group $G$ over a field $k_0$ with an 
%  infinite algebraic family $H_b < G$ of abelian subgroups whose union is 
%  Zariski dense in $G$. For example, the family of connected 1-dimensional 
%  centralisers in $SO_3$.
%
%  Let $K_i := k := k_0^{\"alg}$. Let $(b_i)_{i (- \omega}$ be a 
%  sequence such that $\bigcup_i H_{b_i}$ is Zariski dense in $G$,
%  with $b_i (- k$.
%  Let $A_{i,n}$ be a symmetric arithmetic progression in $H_{b_i}$ of length 
%  $2n+1$, i.e. $A_{i,n} = \{-n\alpha,...,-\alpha,0,\alpha,...,n\alpha\}$ for 
%  some $\alpha (- H_{b_i}(k)$ which is not $m$-torsion for any $m<=n$.
%  Finally, let $B_i := \cup_{j<=i} A_{j,2^i}$.
%
%  Now set $B := \Pi_i B_i / \U$ and $X := B^3 \cap \Gamma_G$.
%
%  Then $X^{\Zar} = \Gamma_G$, % Not true!
%  $X_i := \pi_i(X) = B$, and $\bdl(X) = 2\bdl(X_i)$, and the condition on 
%  ranks is satisfied.
%  But $X$ is not in weak general position, since $\bdl(X \cap 
%  \Gamma_{H_{b_i}}) = \bdl(X)$ for any $b_i$.
%  .

Example:
  If we don't assume wgp, we can get solvable non-nilpotent groups.
  For example,
  $\GL_2 \cap \begin{bmatrix}
    [-\log(N),\log(N)] & [-N,N] \\\
    0 & [-\log(N),\log(N)
  \end{bmatrix}$
  is a $O(\log(N))$-approximate subgroup.
  c.f. the definition of {\em control} in BGT.
  .

Example:
  If we remove the condition on the ranks and don't assume weak general 
  position, we get at least one kind of genuinely new behaviour: $X^{\Zar}$ 
  can be the graph of an algebraic group *scheme*.

  Let $\calE^L := (E_\lambda)_{\lambda (- \C \\ \{0,1\}}$ be the Liouville 
  family of complex elliptic curves, defined by taking $E_\lambda$ to be the 
  closure in $\|P^2$ of
    \[ \{ y^2 = x(x-1)(x-\lambda) \} (= \|A^2 ,\]
  and setting
    $\calE^L := \{ (\lambda,\alpha) |
      \lambda /= 0, \lambda /= 1, \alpha (- E_\lambda \}$.

  Now we proceed as in the previous example.
  Let $K_i := \C$. Let $(\lambda_i (- \C \\ \{0,1\})_{i (- \omega}$ be a 
  sequence taking infinitely many values. Let $A_{i,n}$ be a symmetric 
  arithmetic progression in $E_{\lambda_i}$ of length $2n+1$, i.e. $A_{i,n} 
  = \{-n\alpha,...,-\alpha,0,\alpha,...,n\alpha\}$ for $\alpha (- 
  E_{\lambda_i}(\C)$ which is not $m$-torsion for any $m<=n$. Finally, let 
  $B_i := \cup_{j<=i} A_{j,2^j}$.

  Now set $B := \Pi_i B_i / \U$ and $X := B^3 \cap \Gamma$, where $\Gamma$ 
  is the graph of the group operation of the group scheme $\calE^L$,
  \[ \Gamma := \{(\lambda,\gamma_1),(\lambda,\gamma_2),(\lambda,\gamma_3) |
    \gamma_1+\gamma_2=\gamma_3 \textrm{in} E_\lambda \} .\]

  Then $X^{\Zar} = \Gamma$, $X_i := \pi_i(X) = B$, and $\bdl(X) = 2\bdl(X_i)$.
  But $R(X_i) = R(\calE^L) = 2$ while $R(X) = \R(\Gamma) = 3$,
  and $X$ is not in weak general position.
  .

Example:
  We can get a similar example with $R(X_i)=3$ and $R(X)=5$ by taking $X$ to 
  be the graph of composition in an abelian groupoid.
  .

Question:
  These examples still involve groups. Is this necessary?
  .

At best, we could hope for the following analogue of
Theorem~\ref{thm:elekesSzabo} for wgp complete types, which for convenience 
(and without loss of generality) we take to be over $\emptyset$.

Conjecture{conj:grpWgp}:
  Suppose $\tp(a_1a_2a_3)$ is in weak general position,
  $\tp^{\ACF}(a_1a_2a_3)$ is stationary,
  $R(a_i)=k$, $R(a_1a_2a_3) = 2k = R(a_ia_j)$,
  $\bdl(a_i) <= \xi$,
  $\bdl(a_1a_2a_3) = 2\xi$.

  Then $\locus(a_1a_2a_3)$ is special (that is, in co-ordinatewise 
  finite-to-finite correspondence with the graph of a algebraic group), and 
  moreover the corresponding group is nilpotent.
  .

## General position revisited

We keep the setup of the previous section, but now return to the condition of 
general position, and try to get some stronger results.

Say a partial type $\pi$ is in general position (or ``is gp'')
if $\pi$ is not algebraic but any extension $\pi'$ with $R(\pi')<R(\pi)$ is 
algebraic, i.e. $R(\pi')=0$. So a complete type $p$ in general position is an 
``ACF-minimal type'' in the sense that for $\phi$ an $ACF$ formula, either 
$p\cup\{\phi\}$ or $p\cup\{\neg\phi\}$ is an algebraic type.

As in other trichotomous situations in model theory, we expect:

**(I) In internal characteristic zero, $p$ is either trivial or one-based, and 
  in the latter case is non-orthogonal to a coarsely approximate subgroup 
  of a commutative algebraic group, with the non-orthogonality being 
  witnessed by a finite-to-finite algebraic correspondence.
**(II) In positive internal characteristic, we expect only one new possibility:
  $p$ could be (algebraically) non-orthogonal to a pseudofinite field. In 
  particular, we expect this to be possible only when $R(p)=1$; for 
  $R(p)>1$, the possibilities should be as in the internal characteristic 0 
  case.
*ee*

TODO: consider the Canonical Base Property in this context?

%Remarks:
%  Where exactly is the pregeometry? In the Mordell-Lang example, $\acl$ is 
%  ACF $\acl$; but presumably that fails in general, and $\acl$ won't satisfy 
%  exchange.
%
%  Nice example of getting new $\acl$: consider approximate subgroup of graph 
%  of exp.
%
%  It looks like it should turn out to be a predimension... but not clear how 
%  to define it a priori, and the submodularity may correspond to the truth 
%  of the trichotomy...
%  .

Example:
  Trivial example. j-function?
  .

First, we rework Theorem~\ref{thm:elekesSzabo} in this context.

Lemma{lem:gp}:
  **(i) A non-algebraic partial type $\pi$ is gp iff for any completion $p )= \pi$,
    if $R(p) < R(\pi)$ then $p$ is algebraic.
  **(ii) $\tp(a/E)$ is gp iff for any $E' =) E$, if $\tp(a/E')$ is 
  non-algebraic then $a \|/_{\acl(E)} \acl(E')$.
    % note the converse fails
    **(iii) $\tp(a/E)$ is gp iff $a \|/_{\acl(E)} \cl^{???}(E)$.
    FIXME: is there a natural choice for $\cl^{???}$ which makes this true?
  **(iv) If $\tp(a/E)$ is gp and $\tp(a/Eb)$ is non-algebraic,
    then $\tp(a/Eb)$ is gp.
  *ee*
  .
  
Proof:
  Analogous to the proof of Lemma~\ref{lem:wgp}, replacing the condition of 
  $\bdl$ dropping with the condition of becoming algebraic.
  .

Fix a subfield $E_0$.
We write $\tp^0(a)$ for the reduct of $\tp(a)$ to $\ACF$ with constants for $E_0$,
and we write $\dcl^0(a),\Cb^0(a/b)$ etc to refer to these notions considered 
in the reduct, and $\trd(a)$ means $\trd(a/E_0)$.

Theorem{thm:elekesSzabo2}:
  Suppose $\tp(a_i)$ is in general position, $i=1,2,3$,
  and $\tp^{\ACF}(a_1a_2a_3)$ is stationary,
  and $\trd(a_i)=k$, $\trd(a_1a_2a_3) = 2k = \trd(a_ia_j)$,
  and $\bdl(a_i) <= \xi$,
  and $\bdl(a_1a_2a_3) > (2-\eta)\xi$,
  where $\eta := \frac 1{16k-2}$.

  Then $\locus(a_1a_2a_3)$ is special (that is, in co-ordinatewise 
  finite-to-finite correspondence with the graph of a algebraic group), and 
  moreover the corresponding group is abelian.
  .
Remark:
  Via Lemma~\ref{lem:Racl}, we can deduce the same statement with $\trd$ 
  replaced with $R$ and $\locus(a_1a_2a_3)$ replaced by
  $\locus(a_1a_2a_3/\acl({}))$.
  .
Remark:
  The resulting algebraic group is well-defined up to isogeny. FIXME: proof.
  .
Proof:
  Rescaling, we may assume $\xi=1$.

  Let (by the extension property of $\dind$) $a_1'a_3'$ be a
  $\bdl$-independent realisation of $\tp(a_1a_3/a_2)$.
  Now $\bdl(a_1/a_2) = \bdl(a_1a_2) - \bdl(a_2)
  = \bdl(a_1a_2a_3) - \bdl(a_2) > 1-\eta >= 0$,
  so $\tp(a_1/a_2)$ is non-algebraic and hence gp.
  Since $a_3 (- \acl^0(a_1a_2)$, also $\tp(a_1a_3/a_2)$ is
  gp. By $\bdl$-independence, $\bdl(a_1'a_3'/a_1a_3a_2) > 0$, so 
  $a_1'a_3' \|/^0_{a_2} a_1a_3$.

  Let $\alpha := a_1a_1'$, and $\gamma := a_3a_3'$, and
  say $\Cb^0(\alpha/\gamma) = \dcl^0(e)$.
  Claim:
    $\trd(e) = k$
    .
  Proof:
    Now
    $\trd(e) >= \trd(\alpha)-\trd(\alpha/e) = \trd(\alpha)-\trd(\alpha/\gamma) >= 
    \trd(\alpha) - (\trd(\alpha/\gamma a_2) + \trd(a_2)) = 2k - (0+k) = k$.

    So assume for a contradiction that $\trd(e) > k$.

    Let $V := \loc(\alpha e)$. Since $e$ is canonical, if $e_i ==^0 e$ then 
    $V_{e_i}$ is irreducible and $\dim(V_{e_1} \cap V_{e_2}) < \dim V_{e_i} = 
    \trd(\alpha/e) = k$ if $e_1 /= e_2$.
    So setting $X_1 := \tp(\alpha)$ and $X_2 := \tp(e)$ and $X := (X_1 \times 
    X_2) \cap V$, by general position of $a_1$ and $a_1'$ we have that 
    $X_{e_1} \cap X_{e_2}$ is finite for any $e_i (- X_2$ with $e_1 /= e_2$.
    By the compactness theorem of first-order logic, there is a uniform bound 
    on the size of such intersections.

    So by Lemma~\ref{lem:SZT} with $d=4k$, we obtain
    $\bdl(\alpha e) <= \bdl(X) <= 3 - \frac 1{8k-1}$.

    But $\trd(\gamma/e) = \trd(\gamma) - \trd(e) < 2k - k = k$,
    so again by general position of $a_3$ and $a_3'$, we conclude $\gamma 
    (- \acl(e)$, and in particular $\bdl(\gamma/e)=0$.

    Meanwhile, by $a_1'a_3' \dind_{a_2} a_1a_3$, we have $\bdl(\alpha\gamma) = 
    \bdl(a_1a_3/a_2) + \bdl(a_1a_2a_3) = 2*\bdl(a_1a_2a_3) - \bdl(a_2) > 
    2(2-\eta) - 1 = 3 - 2\eta$.
    
    So $3-2\eta < \bdl(\alpha\gamma) = \bdl(\alpha e) <= 3 - \frac 1{8k-1}$,
    so $\eta > \frac 1{16k-2}$, contradicting the choice of $\eta$.
    .

  So $\trd(e) = k$. Let $e' := \Cb^0(a_1a_3'/a_1'a_3)$. By the same argument, $\trd(e')=k$.

  The remainder of the proof works entirely in the reduct to ACF, and is 
  similar to \cite[Proof of Proposition 10]{HrUnimod}.

  For notational convenience, define $a := a_1, a' := a_1', b := a_2, c := 
  a_3, c' := a_3'$.

  We now show that $aa'cc'ee'b$ forms an abelian group configuration.
  Consider the following diagram.

    \[ \xymatrix{
    & & &&&& e \ar@{-}'[ddll][dddlll] \ar@{-}'[dlll][ddllllll]   \\\
	& & & a' \ar@{-}'[d][dd] & & & \\\
	a & &  & b & c \ar@{-}'[l][llll] & & \\\
	&  & & c' &&   & \\\
	&& & & & & e' \ar@{-}'[uull][uuulll] \ar@{-}'[ulll][uullllll] } \]

  It follows from definitions of the elements and $\trd(e)=k=\trd(e')$ that each 
  point has rank $k$.
  
  We claim that if $f_1f_2f_3$ is a colinear triple,
  then $\trd(f_1f_2f_3) = 2k = \trd(f_if_j)$ for $i /= j$.
  %then any two points are
  %interalgebraic over the third, i.e. $f_i (- \acl(f_j,f_k)$ whenever 
  %$\{i,j,k\}=\{1,2,3\}$.
  This is clear for $abc$ and $a'bc'$. For $aa'e$, we have
  $\trd(aa')=2k$ by choice of $a'$, and $a \|/ e$ since $a \|/ cc'$, so 
  $\trd(ae)=2k$ and similarly $\trd(a'e)=2k$, and
  so $\trd(aa'e)=\trd(aa'/e)+\trd(e)=\trd(aa'/cc')+\trd(e)=k+k=2k$ since 
  $e=\Cb^0(aa'/cc')$.

  For $cc'e$, note that $a$ and $b$ are interalgebraic over $c$ and also 
  over $c'e$ (via $a'$); so $\trd(ab/cc'e)=\trd(ab/c)=\trd(ab)-\trd(c)$ and 
  $\trd(ab/cc'e)=\trd(ab/c'e)$, so $\acl(c) = \acl(\Cb^0(ab/cc'e)) (= 
  \acl(c'e)$, so $c (= \acl(c'e)$. Similarly $c' (= \acl(ce)$, and meanwhile 
  $e = \Cb^0(ab/cc') (= \acl(cc')$. So $\trd(ce) = \trd(cc'e) = \trd(c'e)$,
  and $\trd(cc'e) = \trd(cc') = 2k$.

  By symmetry, the same arguments apply to the remaining lines $ac'e'$ and 
  $a'ce'$.

  The rank of the whole diagram is $\trd(aa'cc'ee'b)=\trd(aa'c)=3k$. Now 
  consider the diagram $aa'cc'ee'$ with $b$ omitted. Any non-colinear triple 
  here has $aa'cc'ee'$ in its algebraic closure, and hence is independent.
  So this is a group configuration. Now as in \cite[Theorem~C.2]{BHM-CCMA},
  since $c (- \acl(a,b) (= \acl(a, \acl(a'c') \cap \acl(ac))$, the group 
  obtained from the group configuration theorem is abelian. So by the group 
  configuration theorem there is an abelian algebraic group such that the 
  graph of its addition is co-ordinatewise interalgebraic with the line 
  $aa'e$, and hence (working over $c'$) with the line $abc$; that is,
  $\loc(abc) = X^{\Zar}$ is special.
  .

Question:
  What happens if we only have $\trd(a_1a_2a_3) < 3k$?
  .


## Coherent modularity for types in coarse general position

%A subset $X$ of $K^{\eq^0}$ is /coherent/ if $\trd=\bdl$ on any tuple from the 
%set.

In this subsection, we work with $K^{\eq^0}$, by which we mean the union of 
the imaginary sorts in the sense of $\ACF$.
By elimination of imaginaries in $\ACF$, we could equivalently take 
$K^{\eq^0}$ to be the disjoint union of the Cartesian powers $\bigcup_n K^n$,
but it is cleaner not to use this.
We consider $\acl^0$ as a map $\powerset(K^{\eq^0}) --> \powerset(K^{\eq^0})$.

TODO: clarify that further, especially for non-model-theorists (maybe best to 
just stick to cartesian powers, and explain why this handles varieties?).

Definition:
  $c (- K^{\eq^0}$ is in \defnstyle{coarse general position}
  (or \defnstyle{is cgp})
  if for any $B (= K^{\eq^0}$,
  if $c \+/^0 B$ then $\bdl(c/B)=0$.
  .

(Note: to make this fit with earlier notions of general position, we should 
assume we're working over a $\dcl$-closed set.)

Definition:
  A subset $X$ of $K^{\eq^0}$ is /weakly coherent/ if for any subsets $A,B,C 
  (= X$,
  \[ A \|/^0_C B <=> A \dind_C B .\]
  .

%Lemma{lem:weakCoherence}:
%  **(i)
%    $X (= K^{\eq^0}$ is weakly coherent iff for any elements $a,b (- X$ and finite 
%    tuple $\c (- X^{<\omega}$,
%    \[ a \|/^0_{\c} b <=> a \dind_{\c} b .\]
%  **(ii)
%    If $X$ is weakly coherent and $C (= X$, then $\acl(C) \cap X = \acl^0(C) \cap X$.
%  *ee*
%  .
%Proof:
%  **(i)
%    An easy induction.
%  **(ii)
%    Suppose $b (- \acl(C) \cap X$.
%    Then $b \dind_C b$, so $b \|/^0_C b$, so $b (- \acl^0(C)$.
%  *ee*
%  .

% Eventually we'll want to consider cgp types with varying bases, since any 
% type can be analysed in such cgp types. Here we're concentrating on a single 
% base.

Lemma:
  Suppose $X (= K^{\eq^0}$ is weakly coherent and every $a (- X$ is cgp.
  Then $\acl^0$ is a pregeometry on $X$.
  %Moreover, so is any localisation $\acl^0|_A$ for $A (= K^{eq^0}$.
  % ^ no it isn't.
  .
Proof:
  Only exchange requires an argument.
  Suppose $C (= X$ and $a,b (- X$ and $a (- \acl^0(Cb) \\ acl^0(C)$.
  Then $b \|/^0_C a$,
  so $\bdl(b/Ca)=0$ since $b$ is cgp,
  so $b (- \acl^0(Ca)$ by weak coherence.
  .

Now this pregeometry splits into orthogonal pieces according to $\bdl$ and 
$\trd$, in the sense that if $X$ is weakly coherent, $a,b (- X$ are cgp, $C (= 
X$, and $a \+/^0_C b$, then $\bdl(a)=\bdl(b)$ and $\trd(a)=\trd(b)$. So it 
makes sense to restrict to the following situation.

Definition:
  For $\alpha (- \R_{>0}$, we say $X (= K^{\eq^0}$ is \defnstyle{coherent} 
  with coherence constant $\alpha (- \R_{>0}$ if every $a (- X$ is cgp and 
  $\bdl(\a) = \alpha \trd(\a)$ for every $\a (- X^{<\omega}$.

  Define the \defnstyle{incoherence} of a partial type $\pi$ to be 
  $\inc(\pi) = \inc_\alpha(\pi) := \bdl(\pi) - \alpha\trd(\pi)$,
  and define $\inc_{\alpha}(\b/C) := \inc_{\alpha}(\tp(\b/C))$.

  We often leave the coherence constant $\alpha$ implicit, and abbreviate 
  $\inc_\alpha$ to $\inc$.
  .

Note that if $X$ is coherent then it is weakly coherent, so $\acl^0$ is a 
pregeometry on $X$.

Remark:
  Any $\bdl$-independent sequence of realisations of a cgp type is coherent.
  .

TODO: consider weak coherence in general, analysing types in cgp types.

Remark:
  If $B$ is coherent over $C (= B$, it does not follow that $\dcl^0(B)$ is 
  coherent over $C$.

  In particular, if $ab$ is coherent, it does not follow that $ab\Cb^0(a/b)$ 
  is coherent (one can manufacture counterexamples by taking an incoherent 
  base change).
  .

Lemma:
  **(i) Incoherence is additive, $\inc(ab/C) = \inc(a/b C) + \inc(b/C)$.
  **(ii) If $b (- \acl^0(Ca)$, then $\inc(ab/C) = \inc(a/C)$.
  *ee*
  .
Proof:
  **(i) Immediate from additivity of $\trd$ and $\bdl$.
  **(ii) Immediate from the corresponding equality for $\trd$ and for 
    $\bdl$.
  *ee*
  .

Lemma{lem:cgpInc}:
  Suppose $B$ is coherent.
  **(i) $\acl^0(B)$ has hereditarily non-negative incoherence; i.e.
    if $\a$ is a tuple from $B$ and $d (- \acl^0(\a)$,
    then $\inc(d) >= 0$.
  **(ii) If $\a$ and $\b$ are tuples from $B$,
    and $d (- \acl^0(\a) \cap \acl^0(\b)$,
    and $\a \|/^0_{d} \b$,
    then $\inc(d)=0$.
  *ee*
  .
Proof:
  Let $\alpha$ be the coherence constant.

  **(i)
    We prove by induction on the length of $\a$ the more general statement 
    that for any $d (- K^{\eq^0}$, we have $\bdl(\a/d) <= \alpha \trd(\a/d)$.
    Indeed, suppose this holds for $\a$, let $a (- B$, and we show it for 
    $a\a$.

    Let $d (- K^{\eq^0}$.
    If $d \|/^0_{\a} a$, then $\bdl(a\a/d) <= \bdl(\a/d) + \bdl(a/\a) <= 
    \alpha(\trd(\a/d) + \trd(a/\a)) = \alpha (\trd(\a/d) + \trd(a/d\a)) = 
    \alpha\trd(a\a/d)$.

    Else, by cgp we have $\bdl(a/d\a)=0$, so $\bdl(a\a/d) = \bdl(\a/d) <= 
    \alpha\trd(\a/d) <= \alpha\trd(a\a/d)$.

    TODO: maybe we want to get rid of the notion of incoherence, and just make 
    the statement here that $\bdl(\a/d) <= \alpha \trd(\a/d)$?
  **(ii)
    $\trd(\a/d) = \trd(\a/\b)$ and $\bdl(\a/d) >= \bdl(\a/\b d) = \bdl(\a/\b)$,
    so $\inc(\a/d) >= \inc(\a/\b) = \inc(\a\b) - \inc(\b) = 0$,
    so $\inc(d) = \inc(\a) - \inc(\a/d) <= 0$,
    so by (i),
    $\inc(d) = 0$.
  *ee*
  .

Lemma{lem:cgpCoherentLinearity}:
  Suppose $X (= K^{\eq^0}$ is coherent.
  Then $X$ is \defnstyle{linear}$^0$ in the following sense:
  if $\a=a_1a_2$ and $\b$ are tuples from $X$ with $\trd(a_i) = k$ and 
  $\trd(\a)=2k$ and $0<\trd(\a/\b)<2k$, then $\trd(\Cb^0(\a/\b)) = k$.
  .
Proof:
  Let $\alpha$ be the coherence constant.

  Since $a_i$ is cgp, $\trd(\a/\b)=k$.

  Let $\d := \Cb^0(\a/\b)$.

  Let $V := \loc(\a\d)$,
  let $X_1 := \tp(\a)$,
  let $X_2 := \tp(\d)$,
  and let $X := (X_1 \times X_2) \cap V$.

  If $d_1,d_2 (- X_2$ with $d_1 /= d_2$ then $\bdl(X(\d_1) \cap X(\d_2)) = 0$;
  indeed, if $\a' (- X(\d_1) \cap X(\d_2)$,
  then $\trd(\a'/\d_1\d_2) < k$ since $\d = \Cb^0(\a/\d)$,
  and so $\bdl(\a'/\d_1d_2)=0$ since $a_i$ is cgp.

  Also $\bdl(X) - \bdl(X_2) >= \bdl(\a\d) - \bdl(\d) = \bdl(\a/\d) >= 
  \bdl(\a/\b) = \alpha \trd(\a/\b) = \frac{\alpha}2\trd(\a) = \frac12\bdl(\a) = 
  \frac12\bdl(X_1)$.
  So by Lemma~\ref{lem:cgpInc}(i) and Lemma~\ref{lem:SZTb}(ii),
  $\alpha\trd(\d) <= \bdl(\d) = \bdl(X_2) <= \frac 12 \bdl(X_1) = \frac12\bdl(\a) = 
  \frac{\alpha}2\trd(\a) = \alpha k$.

  But also $\trd(\d) >= \trd(\a) - \trd(\a/\d) = k$,
  so $\trd(\d) = k$.
  .

Definition:
  For $B (= K^{\eq^0}$ and a coherence constant $\alpha$, define 
    \[ G(B) = G_\alpha(B) := \{ x (- \acl^0(B) | x \;\textrm{is cgp and}\;
    \inc_\alpha(x) = 0 \} .\]
  .

Lemma{lem:cgpCoherenceAcl}:
  If $B$ is coherent, then so is $G(B)$.
  % ^Note: actually we only need that \acl^0(B) has hereditarily 
  % non-negative incoherence
  .
Proof:
  Let $\alpha$ be the coherence constant.

  We show by induction on length that $\inc(\a)=0$ for every finite tuple 
  $\a$ from $G(B)$.
  This holds for tuples of length 1 by the definition of $G(B)$.
  Now suppose $\a (- G(B)$ and $\inc(\a)=0$ and $b (- G(B)$.
  If $\trd(b/\a) < \trd(b)$ then $\bdl(b/\a) = 0$ since $b$ is cgp,
  and otherwise $\bdl(b/\a) <= \bdl(b) = \alpha\trd(b) = \alpha\trd(b/\a)$.
  So in either case $\inc(b/\a) <= 0$.
  So $\inc(b\a) = \inc(b/\a) + \inc(\a) <= 0$.
  But $\inc(b\a) >= 0$ by Lemma~\ref{lem:inc}(i).
  So $\inc(b\a)=0$.
  .

Clearly $G(G(B)) = G(B)$. We say $X (= K^{\eq^0}$ is \defnstyle{coherently 
closed} if $X$ is coherent and $X=G(X)$.

Theorem{thm:cgpCoherentModularity}:
  Suppose $X (= K^{\eq^0}$ is coherently closed.
  Then $\acl^0|_X$ is modular.
  .
Proof:
  Let $\alpha$ be the coherence constant.

  By \cite[Lemma~C.1.11]{TentZiegler},
  it suffices to show that if $a_1,a_2 (- X$ and $B (= X$ are such that 
  $a_1$ and $a_2$ are independent but are dependent over $B$, then they are 
  already dependent over some $d (- \acl^0|_X(B)$.

  If $a_i (- \acl^0(C)$ for some $i$ then we may take $d := a_i$.
  Else, by cgp we have $\trd(a_i) = \trd(a_i/C)$ for $i=1,2$.
  So since $a_1$ and $a_2$ are interalgebraic$^0$ over $C$,
  we have $\trd(a_1) = \trd(a_2)$.
  Say $k = \trd(a_i)$.
  Now let $d := \Cb^0(a_1a_2/B)$.
  It suffices to show $d (- X$.
  Since $d (- \acl^0(B)$ and $X$ is coherently closed,
  it suffices to show that $d$ is cgp and $\inc(d)=0$.

  By Lemma~\ref{lem:cgpCoherentLinearity}, $\trd(d)=k$.
  Then $\trd(d/a_1a_2) = \trd(d/a_1) - (\trd(a_2/a_1) - \trd(a_2/a_1d)) = 
  \trd(d/a_1) - k <= k - k = 0$.
  So $d (- \acl^0(a_1a_2) \cap \acl^0(B)$, and $a_1a_2 \|/^0_d B$,
  and so $\inc(d)=0$ by Lemma~\ref{lem:cgpInc}(ii).

  Finally, we show $d$ is cgp.
  So suppose $E (= K^{\eq^0}$ and $d \+/^0 E$;
  we show $\bdl(d/E) = 0$.
  Replacing $\a B$ with another realisation of $\tp(\a B / d)$ as necessary,
  we may assume $\a B \dind_d E$.
  Now $\a \+/^0 E$ since $d \+/^0 E$, and so by cgp of $a_i$ and coherence, we 
  have $\bdl(\a/E) <= \bdl(a_i) = \alpha k$.
  Meanwhile, $\bdl(\a/d) = \bdl(\a) - \bdl(d) = \alpha (\trd(\a) - \trd(d)) = 
  \alpha k$.
  So $\bdl(d/E) = \bdl(\a/E) - \bdl(\a/dE) = \bdl(\a/E) - \bdl(\a/d) <= k - k 
  = 0$.
  % ^Note: it's for this argument that we have to use cgp rather than gp, and 
  % so need the stronger form of Szemeredi-Trotter.
  .

Remark:
  We would like to understand the geometry of such $X$.
  Note that we have no reason to expect the geometry to be homogeneous.
  However, it is a general fact that a modular geometry can be partitioned 
  into a trivial part and a disjoint union of projective geometries over 
  division rings. Thanks to Hrushovski for this remark. Indeed,
  %by the argument of Lemma~\ref{lem:nonTrivialTriangles},
  modularity implies that the relation between two points of being dependent 
  over some third point is an equivalence relation; the equivalence classes of 
  cardinality $>1$ are projective geometries, while the remainder form a trivial 
  geometry.

  % note this arises even in the stable case if you take a union of minimal 
  % types over 0; but there the equivalence relation is just 
  % non-orthogonality.
  .

Definition:
Say $X (= K^{\eq^0}$ is \defnstyle{1-based}$^0$
  if for any tuples $\a$ and $\b$ from $X$,
  we have $\Cb^0(\a/\b) (= \acl^0(\a)$,
  or equivalently $\a \|/^0_{\acl^0(\a)\cap\acl^0(\b)} \b$.
  .
Corollary{cor:coherent1basedness}:
  If $X (= K^{\eq^0}$ is coherent then $X$ is 1-based$^0$.
  .
Proof:
  By Lemma~\ref{thm:cgpCoherentModularity},
  we have $\a \|/^0_{\acl^0|_{G(X)}(\a) \cap \acl^0|_{G(X)}(\b)} \b$,
  and so in particular $\a \|/^0_{\acl^0(\a)\cap\acl^0(\b)} \b$.
  .

TODO: consequence for "consistently coherent" partial types.

## Elekes-Szabo and coherent modularity

TODO: update for cgp coherence

We continue to use tuple notation.

Theorem{thm:coherentES}:
  Suppose $\a_1\a_2\a_3$ is coherent,
  and $\tp^{\ACF}(\a_1\a_2\a_3)$ is stationary,
  and $\trd(\a_i) = k$,
  and $\trd(\a_1\a_2\a_3) = 2k = \trd(\a_i\a_j)$ for $i/=j$.

  Then $\locus(\a_1\a_2\a_3)$ is special and the corresponding group is 
  abelian.
  .
Proof:
  Let $\a_1'\a_3'$ be a $\bdl$-independent realisation of $\tp(\a_1\a_3/\a_2)$.
  Then by Lemma~\ref{lem:coherenceAcl}(iii),
  $\a_1\a_1'\a_2\a_3\a_3'$ is a coherent tuple,
  and $\a_1'\a_3' \|/^0_{\a_2} \a_1\a_3$.

  Let $C := \acl^0(\a_1\a_1') \cap \acl^0(\a_3\a_3')$
  By Corollary~\ref{cor:coherent1basedness},
  $\a_1\a_1' \|/^0_C \a_3\a_3'$,
  and so $\acl^0(\Cb^0(\a_1\a_1'/\a_3\a_3')) = C$.

  Then $\trd(\Cb^0(\a_1\a_1'/\a_3\a_3'))
  = \trd(C)
  = \trd(\a_1\a_1'C) - \trd(\a_1\a_1'/C)
  = \trd(\a_1\a_1') - \trd(\a_1\a_1'/\a_3\a_3')
  = 2k - k
  = k$.

  By the same argument, $\trd(\Cb^0(\a_1\a_3'/\a_3\a_1')) = k$.

  We conclude exactly as in Theorem~\ref{thm:elekesSzabo2}.
  .

Example:
  Let $k (- \N$, and let $F (= K^k\times K^k\times K^k$ be (the $K$-rational 
  points of) an irreducible affine algebraic variety over $K$ of dimension 
  $2k$ projecting dominantly to pairs.
  Let $X_i (- K$ for $i=1...3k$ be pseudofinite subsets with $\bdl(X_i) <= 1$,
  and suppose $\bdl(F \cap \Pi_i X_i) >= 2k$.

  Then $F$ is special and the corresponding group is abelian.
  .
Proof:
  Taking a completion of $F\cap \Pi_i X_i$ with the same $\bdl$,
  we find $\a=\a_1\a_2\a_3=a_1...a_{3k} (- F$
  with $\bdl(\a) >= 2k$ and $\bdl(a_i) <= 1$.
  Since $\a (- \acl^0(\a_i\a_j)$ for $i/=j$,
  it follows that $\bdl(\a)=2k=\bdl(\a_i\a_j)$
  and so $\bdl(a_t)=1$ for $1 <= t <= 3k$.
  So $\a$ is coherent by Lemma~\ref{lem:coherenceAcl}(ii),
  and the other conditions of Theorem~\ref{thm:coherentES} are satisfied,
  and $F = \locus(\a)$.
  .

TODO: coherent internality?

TODO: the group and the correspondences coming from the group configuration 
are defined over parameters. The group configuration theorem gives that the 
parameters are $\acl^0$-independent from the original configuration, but can 
we take them to be also $\bdl$-independent? Looks like this might require 
actually going into the proof of the group configuration, and seeing that 
coherence is preserved throughout the construction...


## Projective geometries and 3-amalgamation

TODO: this section is using the old notion of coherence; in other words, 
coherent sets are assumed to be subsets of $K$ rather than of $K^{\eq^0}$
(and so elements are necessarily cgp), and the coherence constant is assumed 
to be $\alpha=1$.

Here, we follow the line of \cite[Chapter~8]{Kim-simplicityTheory}
to see that with some 3-amalgamation, non-triviality does yield a single 
projective geometry.

Here we use the 3-replacement of \cite{Hr-approxSubgrps}, which is sufficient 
for the argument to go through, but uses the fine pseudofinite dimension. We 
have not managed to see whether some sufficient form of
3-replacement/amalgamation holds for coarse dimension.

Lemma{lem:coherenceAcl}:
  **(i)
    If $B$ is coherent, then so is
    \[ G(B) := \{ x (- \acl^0(B) | \inc(x) = 0 \} .\]
    % Note: actually we only need that \acl^0(B) has hereditarily 
    % non-negative incoherence
  **(ii)
    A tuple $\a=(a_i)_i$ is coherent iff $\inc(\a)=0$ and
    $\inc(a_i)=0$ for all $i$.
  **(iii)
    If $\a\b$ and $\b\c$ are coherent, and $\a \dind_{\b} \c$,
    then $\a\b\c$ is coherent.
  *ee*
  .
Proof:
  **(i)
  **(ii)
    Suppose $\inc(\a)=0$ and $\inc(a_i)=0$ for all $i$.
    Let $\a'$ be an $\acl^0$-basis for $\a$.
    Then $\bdl(\a')=\trd(\a')$ and each element has $\bdl=1$,
    and so $\a'$ is coherent.
    But $a_i (- G(\a')$, so we conclude by (i) that $\a$ is coherent.

    The converse is immediate.
  **(iii)
    First note that $\a \|/^0_{\b} \c$. Indeed, if $a_1...a_n$ is a 
    $\acl^0$-basis for $\a$ over $\b$ but $a_n (- \acl^0(\b\c a_{<n})$, then 
    $\bdl(a_i/\b\c a_{<i}) <= \bdl(a_i/\b a_{<i}) = 1$ and
    $\bdl(a_n/\b\c a_{<n}) = 0$, so $\bdl(\a/\b\c) < \bdl(\a/\b)$, contrary 
    to assumption.

    So $\bdl(\a\b\c) = \bdl(\a/\b) + \bdl(\b\c) = \trd(\a/\b) + \trd(\b\c) = 
    \trd(\a\b\c)$, and we conclude by (ii) that $\a\b\c$ is coherent.
  *ee*
  .

Let $\alpha := \fdl(p)$.

We assume that the corresponding ideal $\mu_\alpha$ is invariant.

Say $ab$ with $a \|/^0 b$ is \defnstyle{coherently non-trivial}
if there exists a coherent point
$c (- \acl^0(ab) \\ (\acl^0(a) \cup \acl^0(b))$.

Lemma{lem:nonTrivialTriangles}:
  If $c_1c_2c_3$ is a coherent triple,
  and if two of the pairs $c_ic_j$ are coherently non-trivial then so must 
  be the third.
  .
Proof:
  Indeed, if $d_i (- \acl^0(c_i,c_3)$ witness coherent
  non-triviality, then $d_1d_2 \+/^0 c_1c_2$,
  and so by modularity of $G(c_1c_2c_3)$ there exists
  $d_3 (- \acl^0(c_1,c_2) \cap \acl^0(d_1,d_2) \\ acl^0({})$,
  which witnesses coherent non-triviality of $c_1c_2$.
  .

Suppose $p$ is a coherent 1-type over $A$ with an invariant global extension 
(this holds if $A$ is a model;
per \cite[Remark~2.19(iii)]{Hr-approxSubgrps},
it might actually suffice for this lemma that $A$ be boundedly closed).

Assume without loss that $A = {}$.

Say $p$ is \defnstyle{finely non-trivial}
if $ab$ is coherently non-trivial
for some $a,b |= p$ with $\fdl(b/a)=\alpha$,
Lemma{lem:fineHomog}:
  Suppose $p$ is finely non-trivial.

  Then $a'b'$ is coherently non-trivial
  for *any* $a',b' |= p$ with $\fdl(b'/a')=\alpha$.
  .
Proof:
  If the lemma fails, we obtain a triple $c_1c_2c_3$ with
  $\fdl(c_i/c_{<i})=\alpha$,
  and so in particular coherent,
  with $c_1c_2$ coherently trivial but $c_2c_3$ coherently non-trivial,
  and hence by Lemma~\ref{lem:nonTrivialTriangles}
  with $c_1c_3$ coherently trivial.

  Suppose $ab$ witnesses fine non-triviality,
  and say $c_1c'_2 == ab$.
  By \cite[Lemma~2.9]{Hr-approxSubgrps},
  $\tp(c_2'/c_1)$ and $\tp(c_2/c_1)$ do not divide,
  and so by \cite[Theorem~2.18]{Hr-approxSubgrps}, 
  there is $c'_3$ such that $c'_3c_1 == c_3c_1$,
  $c'_3c_2' == c_3c_2$,
  and $\fdl(c'_3/c_1c_2')=\alpha$.

  But then $c_1c'_2c'_3$ is coherent,
  and $c_1c'_2$ and $c'_2c'_3$ are coherently non-trivial,
  contradicting coherent triviality of $c_1c'_3$.
  .

Now suppose $p$ is indeed finely non-trivial.

Let $B = (b_i)_i$ be an infinite sequence of realisations of $p$ with 
$\fdl(b_i/b_j)=\alpha$ for $i>j$
(for example, successively realising $p$ with $\fdl(b_i/b_{<i})=\alpha$).

Lemma{lem:projGeomFine}:
  The geometry of $G(B)$ is projective geometry over a division ring.
  .
Proof:
  By a standard result of geometric algebra,
  it suffices to show that $ab$ is coherently non-trivial for any 
  $\acl^0$-independent $a,b (- G(B)$.

  We prove this by following the line of
  \cite[Theorem~8.3.9]{Kim-simplicityTheory}.

  First, suppose for a contradiction that $a (- B$ and $b (- G(B)$ are 
  $\acl^0$-independent and $ab$ is coherently trivial.
  Say $b (- \acl^0(\c)$ with $\c=c_1...c_n$ of minimal length with $c_i (- B$.

  Now $ac_n$ is coherently non-trivial, say witnessed by $d$.
  Then $a$ and $b$ are interalgebraic$^0$ over $\c_{<n}d$,
  so $ab \+/^0 \c_{<n}d$, and so by coherent modularity and coherent triviality 
  either $a (- \acl^0(\c_{<n}d)$ or $b (- \acl^0(\c_{<n}d)$, and in either 
  case $a (- \acl^0(\c_{<n}d)$.
  Then $\trd(a\c) <= n$, and so $a (- \acl^0(\c)$.

  So say $a$ is interalgebraic$^0$ with $c_i$ over $\c_{/=i}$;
  then $ab \+/^0 \c_{/=i}$,
  so again by coherent modularity and coherent triviality of $ab$, 
  either $a (- \acl^0(\c_{/=i})$ or $b (- \acl^0(\c_{/=i})$,
  but either case contradicts minimality of $\c$.

  Finally, suppose $a (- G(B)$ and $b (- G(B)$ are $\acl^0$-independent and 
  $ab$ is coherently trivial.
  Since $B$ is an infinite $\acl^0$-independent set,
  some $c (- B$ is such that $c \|/^0 ab$.
  Then by the above, neither $ac$ nor $bc$ is coherently trivial,
  contradicting Lemma~\ref{lem:nonTrivialTriangles}.
  .

Example:
  Suppose $E$ is an elliptic curve with endomorphism ring $\O$,
  let $\Gamma$ be a $k$-approximate subgroup,
  and let $p$ be a type concentrating on $\Gamma$ with $\fdl(p)=\fdl(\Gamma)$.

  Then $p$ is finely non-trivial,
  witnessed by $a+b=c$ with $a,b,c |= p$.

  If moreover $\Gamma$ is an ``approximate $\O$-submodule'',
  the corresponding geometry is projective geometry over $\O\tensor\Q$.
  FIXME: details, justification...
  .

# Cheap coarse version
Suppose $p$ is a coherent 1-type over $A$,
and assume without loss $A={}$,
and suppose $p$ is \defnstyle{coarsely non-trivial}
in the sense that $ac_0$ is coherently non-trivial
for some $a,c_0 |= p$ with $ac_0$ coherent (i.e. $\bdl(ac_0)=2$).

Then consider $p' := \tp(a/c_0)$, a $\bdl$-independent extension of $p$.
Add $c_0$ to the language.
Lemma{lem:trianglesBasePoint}:
  If $a,b |= p'$ and $ab$ is coherent, then $ab$ is coherently non-trivial.
  .
Proof:
  In the original language,
  $\bdl(ab/c_0) = 2$, so $\bdl(abc_0)=3$ and so $abc_0$ is coherent.
  So by choice of $c_0$ and Lemma~\ref{lem:nonTrivialTriangles},
  $ab$ is coherently non-trivial in the original language,
  so say $d (- \acl^0(ab) \\ (\acl^0(a) \cup \acl^0(b))$ is coherent.
  Since $ab \dind c_0$, also $d \dind c_0$, so $\bdl(d/c_0)=1$.
  Since also $a \|/^0 c_0$ and $b \|/^0 c_0$,
  we have $d (- \acl^0(abc_0) \\ (\acl^0(ac_0) \cup \acl^0(bc_0))$.
  So $d$ witnesses coherent non-triviality over $c_0$.

  TODO: neaten.
  .

Continue to work over $c_0$,
and let $B$ be a $\bdl$-independent sequence of realisations of $p'$.

Lemma{lem:projGeomCheapCoarse}:
  The geometry of $G(B)$ is projective geometry over a division ring.
  .
Proof:
  The proof of Lemma~\ref{lem:projGeomFine} goes through verbatim,
  using Lemma~\ref{lem:trianglesBasePoint} in place of
  Lemma~\ref{lem:fineHomog}.
  .

Question[TODO]:
  Can we exploit this cheap argument to get something more satisfactory?
  If the original $p$ is over a suitable set $A$,
  say a somewhat saturated model,
  or we have some coheir-like assumption on $p$,
  or perhaps just that $A$ is $\clbdl$-closed,
  can we push $c_0$ down into $A$ and so not have to pass to $p'$?

  Or should this cheap version already be satisfactory, actually?
  .


\appendix
## Start of proof of Conjecture~\ref{conj:grpWgp}
Conjecture{conj:grpWgp}:
  Suppose $\tp(a_1a_2a_3)$ is in weak general position,
  $\tp^{\ACF}(a_1a_2a_3)$ is stationary,
  $R(a_i)=k$, $R(a_1a_2a_3) = 2k = R(a_ia_j)$,
  $\bdl(a_i) <= \xi$,
  $\bdl(a_1a_2a_3) = 2\xi$.

  Then $\locus(a_1a_2a_3)$ is special (that is, in co-ordinatewise 
  finite-to-finite correspondence with the graph of a algebraic group), and 
  moreover the corresponding group is nilpotent.
  .
Proof[Attempted proof]:
  Rescaling, we may assume $\xi=1$.

  If $\{i,j,k\}=\{1,2,3\}$, then $a_k$ is algebraic over $a_ia_j$,
  so $2 = \bdl(a_ia_ja_k) = \bdl(a_ia_j) <= \bdl(a_i)+\bdl(a_j) <= 2$.
  So $\bdl(a_i) = 1 = \bdl(a_j)$ and $a_i \dind a_j$.

  Let (by the extension property of $\dind$) $a_1'a_3'$ be a
  $\bdl$-independent realisation of $\tp(a_1a_3/a_2)$. Since $a_1 \dind 
  a_2$, Lemma~\ref{lem:wgp}(iii) yields that $\tp(a_1/a_2)$ is wgp, and then 
  since $a_3$ is algebraic over $a_1a_2$, so is $\tp(a_1a_3/a_2)$. So 
  $a_1'a_3' \|/_{a_2} a_1a_3$.

  Let $\alpha := a_1a_1'$, and $\gamma := a_3a_3'$, and
  say $\Cb^{\ACF}(\alpha/\gamma) = \dcl(e)$.

  Claim:
    $\trd(e) = k$
    .
  Proof[Attempted proof]:
    First, reduce to the case that $\tp^{\ACF}(\alpha/\gamma)$ is 
    stationary (TODO).

    Now
    $\trd(e) >= \trd(\alpha)-\trd(\alpha/e) = \trd(\alpha)-\trd(\alpha/\gamma) >= 
    \trd(\alpha) - (\trd(\alpha/\gamma a_2) + \trd(a_2)) = 2k - (0+k) = k$.

    So assume for a contradiction that $\trd(e) > k$.

    If $\trd(e) = 2k$, we again contradict Szemeredi-Trotter as long as the 
    pairwise intersections are finite. However, there's no longer an obvious 
    reason why they should be. One could hope that such intersections 
    themselves yield a contradiction to Szemeredi-Trotter, but recall that 
    Szemeredi-Trotter doesn't actually disallow non-modularity. Could there 
    be a counterexample already with a two-dimensional subvariety $X$ of 
    $GL_2$ acting on $\AA^2$?

    Meanwhile we also need to rule out $k < \trd(e) < 2k$.
    Simplest case there where I can't see that a counterexample couldn't lurk:
    consider the Cremona group $Bir(\|P^2)$ of birational automorphisms of 
    the projective plane (a $\\//$-definable group in ACF), and consider a 
    rank 2 algebraic subvariety $X$ and its action on $\|P^2$, such that 
    the composition $X\circ X$ has rank 3. Can we find $a_1 (- X$,
    $a_2 (- \|P^2$, and $a_3 = a_1*a_2$, as in the statement of this 
    proposition?

    FIXME: I think I saw how to rule out the amalgam of these counterexamples,
    where we work with a subvariety of $GL_2$ but have $k < \trd(e) < 2k$, by 
    considering compositions and using that we're in an algebraic group. How 
    did that go?
    .
  .

## FAILED attempts at getting coarse 3-existence

Hopefully, the results of the previous section go through with $\bdl$ in place 
of $\fdl$. All that's missing is an analogue of
\cite[Theorem~2.18]{Hr-approxSubgrps}.

Definition:
  Say $a$ and $b$ have the same \defnstyle{$\bdl$-strong type} over $C$ 
  if they are in the same equivalence class for any definable equivalence 
  relation over $C$ whose quotient has $\bdl(X/E)=0$.
  Equivalently, $\tp(a/\clbdl(C)) = \tp(b/\clbdl(C))$.
  .

Definition[tentative]:
  Define $\bdl$-dividing as for dividing, but replacing ``inconsistent'' with 
  ``of lesser $\bdl$''.
  .

Remark:
  One might naively hope for $\bdl$-independent 3-amalgamation 
  for $\bdl$-strong types in something like the following form:
  if $p$ is a $\bdl$-strong type over $C$,
  $a \dind_C b$,
  $\tp(b/a)$ does not ($\bdl$-)divide over $C$,
  and $p_a$ is a $\bdl$-independent extension of $p$ to $a$,
  sim $p_b$,
  then $p_a \cup p_b$ is consistent and has a realisation $\bdl$-independent 
  over $C$.

  However, the possibility of linear orders easily rules anything like this 
  out - consider $p$ as a cut (say in a model), and $p_a(x) |= x<a$ and 
  $p_b(x) |= x>b$ with $a<b$ in the cut.
  .

# Coarse 3-replacement
3-replacement would be sufficient.

Hope: can adapt \cite[2.18]{Hr-approxSubgrps} to the coarse case. The ideal is 
not S1, so it isn't literally going to be a matter of stability and dividing.
Maybe coherent dividing is correct? And $\bdl$-strong types could substitute for 
invariant global types?

Question:
  Is the ideal $\bdl$-S1, in the sense that
  for $a_i$ an indiscernable sequence in a $\bdl$-strong type,
  if $\bdl(\phi(x,a_i) /\ \phi(x,a_j))<1$ for $i<j$
  then $\bdl(\phi_(x,a_i))<1$?
  .

Remark:
  Inclusion-exclusion yields at least the following:

  If $\bdl(A) = \epsilon > 0$,
  and $\bdl(\phi_a) = 1$ for $a (- A$,
  and $\bdl( \{ (a,b) | \phi_a \cap \phi_b > 1-\alpha \} ) < \alpha$
  where $\alpha > 0$,
  then $\bdl( \exists a (- A. \phi_a(x) ) > 1$.

  Indeed, taking a subset of $A$ we can assume $\epsilon < \alpha$
  while still having
  $\bdl( \{ (a,b) | \phi_a \cap \phi_b <= 1-\alpha \} ) = 2\epsilon$,
  and then since $1-\alpha+2\epsilon < 1+\epsilon$,
  inclusion-exclusion yields
  $\bdl( \exists a (- A. \phi_a(x) ) >= 1+\epsilon$.
  .

Question:
  Best would be if we had the following:

  Let $p$ be a $\bdl$-strong type over ${}$,
  suppose $\bdl(\psi_a)=1=\bdl(\Psi)$ for $a|=p$,
  where $\psi_a -> \Psi$ and $\Psi$ is over ${}$.
  Then(?) for $a|=p$ and $\alpha > 0$,
  $\bdl(p(x) \cup \{ \bdl(\psi_a \cap \psi_x) < 1-\alpha \})<1$.
  ("Intersections of non-negligible are negligibly negligible.")

  Without fixing the strong type, equivalence relations yield counterexamples.
  (c.f. Turán.)

  FIXME: do approximate equivalence relations also yield counterexamples, so 
  need to consider hyperimaginaries in the definition of strong type?

  Using inclusion-exclusion,
  it would suffice to have a non-trivial near-clique,
  namely that if the conclusion fails,
  there is a $\bdl>0$ formula consistent with $p$
  such that 
  $\bdl(\psi_x \cap \psi_y) < 1-\alpha$
  holds on all but a $\bdl<\alpha$ set of pairs.

  Less precise general version of that:
  Let $p$ be a $\bdl$-strong type over $M$,
  suppose $\bdl(p)=1$ and for $a |= p$,
  $\bdl(p(x) \cup \{ \phi(a,x) \} = 1$.
  Suppose $\phi$ is symmetric.
  Then(?) for any $\alpha>0$ exists $\psi$ consistent with $p$
  with $\bdl(\psi)>0$
  and $\bdl(\psi(x) /\ \psi(y) /\ \neg\phi(x,y)) < \alpha$.
  ("Non-negligible minimal degree implies non-trivial near-clique.")

  Idea: there are results of the form "$K_n$-free with large minimal degree 
  implies small chromatic number". Use these to find an internal equivalence 
  relation with $\bdl=0$ quotient.

  Explicitly, would be nice if the following were true:
  if a graph with $n$ vertices has minimal degree $>>n^{1-\epsilon}$ for any 
  $\epsilon$, and has chromatic number $>>n^\alpha$ for some $\alpha>0$, then 
  it has a (near-)clique of size $>>n^\beta$ for some $\beta>0$.
  
  Looks plausible! But I'm expecting in the end it will turn out to be naive.
  .

Really need analogue of the argument with an invariant global type and 
non-dividing.

Question:
  Can we extend coherent $p$ to a coherent invariant global type $\pp$,
  then take a Morley sequence in it,
  and have that $(a,b) |= \pp^{(2)}$ implies $\tp(b/a)$ doesn't coherently 
  divide?

  Does everything then go through?
  .

Proposition:
  Let $p$ be a type over a model $M$, with $\bdl(p)=1$.
  Then for some global coheir $\pp$,
  **(i) $\bdl(\pp)=1$
  **(ii) moreover, $\pp$ does not $\bdl$-divide over $M$.
  *ee*
  .

Actually, maybe all we need is \cite[2.15]{Hr-approxSubgrps}?
(And the fact he proves that weaker statement suggests that the above 
Proposition is false.)

Note that any /invariant/ coherent global extension of $p$ doesn't 
$\bdl$-divide over $M$.

# Independence theorem

By inclusion-exclusion arguments above,
$R(x,y) :== \bdl(\psi_x /\ \psi_y) < 1-\alpha$
can not have a non-trivial definable clique
(c.f. Prop~7.3.6 in Tent-Ziegler)
so it has a definable maximal clique $A$ with $\bdl(A)=0$
(definable over the parameters of $\psi$;
we can indeed assume such is definable while keeping the language countable,
by adding formulae uniformly defining maximal cliques.)

Note then that if $b (/- A$ then $\neg R(b,a)$ for some $a (- A$.
If we take ``very strong type'' over $C$ to mean ``type over $\clbdl(C)$''
(so ``strong type'' ought to be the transitive closure of this),
then if $b$ and $b'$ have the same very strong type over $C$
and $\psi$ is over $C$
then $\psi_b$ and $\psi_{b'}$ both have $\alpha$-non-negligible intersection 
with some $\psi_a$.

More generally, say $(b,b')$ is \defnstyle{$\bdl$-unbounded} over $C$
if for any symmetric $R (- \tp(b,b'/C)$, 
does not have a $\bdl=0$ definable maximal clique.
So ``same strong type'' is contained in (TODO: equal to?)
the transitive closure of this relation.

Aim from here would be to adapt the proof of the independence theorem in 
simple theories,
the above already being what one gets there from local character.

At least some of it seems like it would go through if we define 
$\bdl$-dividing by taking $k$ in the definition of dividing to be pseudofinite 
with $\bdl(k)=0$. Only problem is that this makes no obvious sense.

But then we can at least handwavily argue that if $(b,b')$ is $\bdl$-unbounded 
and $a$ doesn't $\bdl$-divide from $b'$ over $b$
and $\bdl(\phi_a /\ \psi_b) = \bdl(\exists x,y. (\phi_x /\ \psi_y)) = 1$
then $\bdl(\phi_a /\ \psi_{b'}) = 1$;
else, take a big clique $b_i$ in $(b,b')$,
and by non-$\bdl$-dividing sequentially realise $a_i$
such that $\bdl(\phi_{a_i} /\ \psi_{b_j})$ is 1 if $i=j$ and $<1$ if $j>i$,
for enough $i$ that we contradict inclusion-exclusion (c.f. equationality).

Could it be that with an appropriate such definition, inclusion-exclusion 
actually yields an analogue of the S1 argument to show that $\bdl$-dividing 
implies a drop in $\bdl$?
If we have a $\bdl>0$-long sequence $b_i$,
and $\psi_{b_i}$ is $k$-inconsistent where $\bdl(k)=0$,
then indeed $\bdl(\exists x. \psi_x) > \bdl(\psi_{b_i})$
by a simple counting argument.

Definition:
  Say $\phi_b$ \defnstyle{$\bdl$-divides} over $C$
  if there is an internal set $Z$ with $\bdl(Z)>0$
  (TODO: does it change anything if we require $Z$ to be definable?)
  and $|= //\\_{\psi/C} \forall z (- Z. (\psi(z) <-> \psi(b))$,
  and a pseudofinite $k=(k_n)_n/\U$ with $\bdl(k)=0$
  such that $(\phi_b)_{b (- Z}$ is $k$-inconsistent,
  meaning that for $\U$-many $n$,
  $(\phi_b^{K_n})_{b (- Z^{K_n}}$ is $k_n$-inconsistent.
  .

When trying to translate the usual development of dividing,
we have the problem that we can't simply apply Ramsey theory,
since the bounds are logarithmic.
So we don't get indiscernable sequences,
and I can't see how to replace them in proving 3-amalgamation/replacement.

FAIL?


% Failed attempt:
%Say $a$ \defnstyle{doesn't clique-divide} from $b$ over $C$
%if FIXME.
%
%Question:
%  Does $\bdl$-independence imply clique-nondividing?
%  .
%
%Lemma:
%  Suppose $\bdl(\phi_a /\ \psi_b) = \bdl(\exists b. \psi_b) = 1$,
%  with $\phi$ and $\psi$ over $C$,
%  and $(b,b')$ is $\bdl$-unbounded over $C$,
%  and $a$ doesn't clique-divide from $b'$ over $Cb$.
%  Then $\bdl(\phi_a /\ \psi_{b'}) = 1$.
%  .
%Proof[rough]:
%  WLOG $C={}$.
%  Suppose not.
%  So $\bdl(\phi_a /\ \psi_b /\ \psi_{b'}) < 1$.
%
%  Take a non-trivial clique $D$ in $R (- \tp(b,b')$ (to be determined).
%
%  By clique-nondividing, we may assume all $d (- D$ have $d ==_{ab} b'$,
%  at least as far as some formula to be determined is concerned.
%
%  ...Fail.
%  .


##TODO

Lemma:
  Suppose $p$ is not coherently trivial.
  Then $p^0$ is non-orthogonal to a the generic of a connected abelian 
  algebraic group.

  (TODO: And moreover the non-orthogonality puts $p$ in correspondence with 
  a $//\\$-definable subgroup.)
  .
Question:
  Can we push this to include an analogue of the full description we have in 
  the minimal stable case, showing that the only "coherent structure" is 
  that of a quasiendomorphism module?

  (Note that also in the Cherlin-Hrushovski enrichments of vector spaces,
  the pregeometry is still just linear span, so this does fit.)

  To what extent can we push this to a general statement of ``coherent 
  1-basedness''? Do nilprogressions fit?
  .
Proof:
  .

Question:
  Can we get coherent modularity for gp types of $\trd>1$?
  Shouldn't even need internal char 0 for this.
  Can we then handle the general case by analysing in gp types?
  .

Question:
  Can we get fully describe the ``coherent structure'' on a type,
  i.e. the algebraic varieties which witness dependencies,
  i.e. $\loc(\a)$ for $\a$ a coherent tuple of realisations,
  or more generally for $\a$ a tuple from $G(B)$ where $B$ is a coherent set?
  Do we get, as in the case of minimal types in stable theories,
  exactly the structure of a vector space over the quasiendomorphisms 
  (note that even for simple theories no such complete structure theorem is 
  known)?
  .

Question:
  There's a relation to arithmetic geometry, by considering nonstandard 
  algebraic points of pseudofinite degree and pseudofinite height. What do we 
  get here? Can we e.g. recover Zhang's theorem?

  Simpler: prove that (uniform?) Manin-Mumford is equivalent to its 
  consequence on counting torsion points of algebraic varieties. This seems 
  reasonable, in light of the equivalence of the Lang property and 1-basedness 
  shown in Pillay's article in the Bouscaren book.

  e.g. Elekes-Szabo shows that if an irreducible subvariety $X (= \|G_m^3$ of 
  dim 2 has $~n^2$ $n$-torsion points for arbitrarily large $n$, then it is in 
  co-ordinatewise correspondence with the graph of a group operation. Can we 
  deduce from the fact that we're working with multiplicative torsion that the 
  group in question is the multiplicative group, and $X$ is a coset?
  Perhaps because we can use fine 3-amalgamation to see we only have a single 
  projective geometry involved, and hence only a single group?
  Start with $\fdl$-Morley sequence in non-standard torsion.
  .

\bibliography{mt}
