David Monniaux

Alice Pain

Formally verified 32-and 64-bit integer division using double-precision floating-point arithmetic

Some recent processors are not equipped with an integer division unit. Compilers then implement division by a call to a special function supplied by the processor designers, which implements division by a loop producing one bit of quotient per iteration. This hinders compiler optimizations and results in non-constant time computation, which is a problem in some applications.

We advocate instead using the processor's floating-point unit, and propose code that the compiler can easily interleave with other computations. We fully proved the correctness of our algorithm, which mixes floatingpoint and fixed-bitwidth integer computations, using the Coq proof assistant and successfully integrated it into the CompCert formally verified compiler.

Introduction

Some instruction sets (x86, AArch64, RISC-V M extension. . . ) feature integer division instructions. Even if all other operations (integer, floating-point, memory. . . ) are fully pipelined, division is typically handled differently: only one division can be handled at a given time (no pipelining), and the execution time of the division operation depends on the operands. This makes the processor design more complex, and also precludes constant-time execution, which is desirable in some contexts, for instance for safety-critical control systems [START_REF] Boldo | Deductive Formal Verification: How To Make Your Floating-Point Programs Behave[END_REF] and in systems where timing attacks are a concern.

In contrast, some architectures eschew divisor units and emulate division in software, totally or partially. Kalray's KV3 processor, the latest in a series of VLIW (very large instruction word) processors, does not have a full division unit. Instead, it has a fully pipelined, correctly rounded IEEE-754 singleprecision (binary32 ) floating-point reciprocal operation. Using this operation as a starting point, we compute a higher-precision approximation of the reciprocal, then correct 32-bit and 64-bit integer quotients, using the processor's IEEE-754 double-precision (binary64 ) floating-point unit and integer operations.

CompCert2 is a formally verified compiler for the C language. [START_REF] Boldo | Computer Arithmetic and Formal Proofs -Verifying Floating-point Algorithms with the Coq System[END_REF] Here, "formally verified" means that there is a proof, in the Coq proof assistant, that the execution of the assembly code generated by the compiler matches that of the source code [12].

The backend for the Kalray KV3 processor [17], when compiling integer division, by default generates calls to special library functions. These functions are based on code, provided by Kalray, that computes divisions by looping over a special arithmetic instruction that performs one step of division and computes one bit of the quotient. [START_REF] Boldo | Some formal tools for computer arithmetic: Flocq and Gappa[END_REF] These calls are axiomatized inside CompCert to return the correct quotient and remainder: CompCert trusts that they perform correctly as intended. This, arguably, breaks CompCert's design; but anyway CompCert has to trust that the processor actually implements its own instructions correctly; trusting that a simple and understandable integer arithmetic procedure published by the processor designers is correct is not a far stretch from trusting that the processor hardware behaves correctly. [START_REF] Cheng | TMS320C60000 integer division[END_REF] The situation was however different for our new algorithm. During its design, especially for the 64-bit version, we came across a number of corner cases that could have been unnoticed by less careful testing. Caution dictated to be wary that there could be more corner cases. It would not have been right to add an axiom that this new algorithm was correct. Instead we resolved to fully prove it correct inside Coq, based on the definitions of the integer and IEEE-754 instructions that we use. We prove that, when the divisor is nonzero, our sequence of operations returns the correct quotient (respectively, remainder), without introducing any new axiom.

Division Algorithms

We provide division algorithms for unsigned 32-bit and 64-bit integers. We assume the processor supports IEEE-754 double-precision (binary64 ) operations and some single-precision (binary32 ) operations: an IEEE-754 single-precision reciprocal (x → 1/x) instruction, [START_REF] Cornea | Integer divide and remainder operations in the IA-64 architecture[END_REF] conversions between 64-bit signed and unsigned integers and IEEE-754 double-precision, conversions between single-and double-precision floating-point numbers, double-precision fused multiply-add (fma). All operations should be rounded to the nearest target value; the rule used to break ties between equally near numbers is unimportant. [START_REF] Cornea-Hasegan | Correctness proofs outline for newton-raphson based floating-point divide and square root algorithms[END_REF] To deal with special cases, we use conditional moves (if-then-else functional statements), maintaining constant-time execution; these may be replaced by normal if-thenelse control-flow, if needed.

Signed division following C semantics (quotients truncated towards zero) is implemented by calling unsigned division on the absolute values of the dividend and divisor and adjusting signs afterwards.

32-bit Division

To compute the quotient of a by b, we first compute a single-precision reciprocal of the divisor b, thus with 23 bits of precision. Then we follow a wellknown approach [10] to obtain approximately 46 bits of precision, using one step of a fixed-point iteration leading to the reciprocal, implemented using two double-precision fused multiply-add operations. 46 bits of precision is more than enough to compute a very precise approximation of the quotient a/b by multiplying with the dividend a. Because we do not know if that quotient was approximated by above or below, we compute the remainder associated with it using an integer multiply-add, and adjust the quotient if that remainder is negative (Algorithm 1).

In the following, fma is fused multiply-add (fma(x, y, z) ≃ xy + z). We also use special built-in operators for converting double precision numbers to signed and unsigned 64-bit numbers with round to nearest (the method of breaking ties is unimportant).

Algorithm 1 32-bit unsigned division u i n t 3 2 _ t div32 ( u i n t 3 2 _ t a , u i n t 3 2 _ t b ) { float bs = ( float ) b ; double bd = ( double ) b ; float invbs0 = 1.0 f / bs ; double invbd0 = ( double ) invbs0 ; double alpha = fma ( -bd , invbd0 , 1.0); double invbd = fma ( alpha , invbd0 , invbd0 ); double ad = ( double ) a ; double qd = ad * invbd ; // round to nearest , u n s i g n e d u i n t 6 4 _ t q0 = _ _ b u i l t i n _ l u r o u n d _ n e ( qd ); i n t 6 4 _ t r0 = a -b * q0 ; u i n t 6 4 _ t ql = r0 <0 ? q0 -1 : q0 ; return ( u i n t 3 2 _ t) ql ; } If necessary, the remainder can be computed as u i n t 3 2 _ t r2 = ( u i n t 3 2 _ t) r0 ; u i n t 3 2 _ t r = r0 <0 ? r2 + b : r2 ;

Remark that most of the expensive computation depends only on b: we postpone multiplication by a until the last moment. It would be possible to start by breaking ties to even numbers, as this is the most common rounding mode. We however do not use this anywhere in the proofs.

computing an approximation of a/b instead of 1/b, and refine that approximation, but this would not save any operation (we still would need a multiplication by a), and this would preclude the compiler from hoisting computations sharing the same divisor.

64-bit Division

The natural generalization of the 32-bit algorithm would be to increase the number of fixed-point iterations to compute a more precise approximation of the reciprocal of the divisor, but, since IEEE-754 double-precision only has 53 bits of significand, this would be insufficient to compute correct quotients of 64-bit numbers. Instead, Algorithm 2 proceeds in three steps:

1. compute an approximation q 1 of a/b, and associated remainder r 1 = a-bq 1 using the single-precision reciprocal;

2. compute an approximation q 2 of r 1 /b, and associated remainder r 2 = r 1bq 2 , using the more precise reciprocal approximation from the preceding subsection;

3. adjust the quotient if r 2 is negative.

Then q 0 = q 1 + q 2 is the quotient q = ⌊a/b⌋ in most cases (if 2 ≤ b < 2 63 ). Note that the precise reciprocal approximation can be computed in parallel to r 1 .

The cases b = 1 (return q = a) and b ≥ 2 63 (return q = 1 if a ≥ b, q = 0 otherwise) are treated separately;

• b = 1 means that r 1 ≃ a (not necessarily equal, since large values of a would incur rounding when converted to floating-point), and r 1 would not fit within a signed 64-bit integer; in this case we directly output q = a;

• if b ≥ 2 63 and q 1 = 1, r 1 may not fit within a 64-bit signed integer; e.g., a = 2 63 and b = 2 64 -1; since in this case a < 2b, the quotient is 0 or 1 depending on whether a < b.

These special cases are treated in parallel to the main computation, and the special result is substituted, if applicable, using a 1-cycle conditional move at the end. Note that b ≥ 2 63 if and only if it is negative if considered as a 64-bit signed number, and that q = 1 if a ≥ b, q = 0 otherwise amounts to taking a ≥ b as a truth value. This may help simplify the assembly code.

Here, we assume that conversion from floating-point numbers to integers do not trap (do not produce an exception stopping the program) if the number does not fall within the target range, and instead returns an "undefined" value. [START_REF] Daumas | Certification of bounds on expressions involving rounded operators[END_REF] If this operation may trap, it is necessary to rewrite the functional if-then-else (conditional move) into a control-flow test (Algorithm 3), which breaks constanttime execution.

Algorithm 2 64-bit unsigned division u i n t 6 4 _ t div64 ( u i n t 6 4 _ t a , u i n t 6 • proofs that these definitions match the non-executable10 specification that an IEEE-754 operation amounts to computing the operation in the reals then rounding into the appropriate type.

For most architectures, CompCert does very little proofs about floatingpoint: an operation having a certain semantics in the source language (say, single-precision floating-point addition) is translated into an operation with the same semantics in the assembly language. There are proofs about how to implement certain conversion operations using simpler operations for architectures that do not support these directly as individual instructions. There are however no proofs about replacing operations by combinations of other operations involving fine points about roundoff error, as we need here.

To reduce the proof effort on bounding roundoff error, we heavily rely on the Coq gappa tactic, which calls the Gappa tool11 [8, 16, 13, 14, 4]. We also heavily use Coq's ring and field arithmetic equality tactics and the lia linear integer arithmetic tactic for inequalities.

Approximate Double-Precision Reciprocal

The computation of the approximate reciprocal that we use in our algorithms is often presented as a case of Newton-Raphson iteration. Let us give a different intuition here. In order to iteratively refine a numerical solution, we express the result we want, 1/b, as a fixed-point of a contracting function f chosen such that f (1/b) = 1/b. The simplest kind of contracting function (approximated by fma) is f (x) = αx + β with small α. What α to pick? Assume b0 ≃ 1/b, then α = 1 -b b0 ≃ 0 (also approximable by fma) is small. Solve f (1/b) = 1/b for β: β = b0 . We then have |f (x) -1/b| ≤ α|x -1/b|. b = f ( b0 ) is thus an ever better approximation of 1/b than b0 . Let us now see how to turn this reasoning over real numbers into a result on floating-point computations.

We prove in theorem approx_inv_longu_correct_rel that invbd is a very precise approximation of the reciprocal of b, with relative error invbd-1/b

1/b less than 1049 × 2 -56 ≃ 2 -46 .
Let us comment the proof approach: when we encounter an expression r d (e) (respectively, r s (e)), meaning "the double-precision rounding of e", we replace it by e(1 + ǫ e ) and we use the gappa Coq tactic to bound the relative error ǫ e ; we simplify expressions in the real field using Coq's field tactic. In the end, the final relative error is expressed as a polynomial in the relative errors of the individual operations, and easily bounded.

From this relative error, we prove that q d in the 32-bit algorithm is such that |q d -a/b| < 1/2, whence the correct quotient after adjusting for negative remainder r 0 .

64-bit Division Algorithm

The proof of the 64-bit division algorithm is more involved, and distinguishes four cases: b = 1, 2 ≤ b ≤ 2 42 , 2 42 < b < 2 63 , and b ≥ 2 63 . The first and last cases are dealt with by explicit tests in the algorithm, respectively by answering q = a and q = (if a ≥ b then 1 else 0).

The of the remaining cases is more complex than for the 32-bit algorithm. One reason is that, contrary to what happens with 32-bit operands, large values of a and b cannot be in general represented exactly within doubleprecision arithmetic, so we have to deal with the roundoff error induced by the conversions of a and b in addition to the roundoff error induced by the later operations.

Small b: 2 ≤ b ≤ 2 42
We prove that |r 1 | ≤ 44 × 10 11 . We then prove that, if |r 1 | ≤ 342 × 10 11 , then q 2 truly is the quotient of the division of r 1 by b: because the numerator r 1 has small magnitude, the resulting quotient q 3d also has small magnitude and the relative error on q 3d translates into an absolute error less than 1/2. The result follows.

Big b: 2 42 < b < 2 63 We prove that q 2 truly is the quotient of the division of r 1 by b: because the denominator b is large, the resulting quotient q 3d has small magnitude and the relative error on q 3d translates into an absolute error less than 1/2. The result follows. Note that we do not prove anything about r 1 in this context.

Correspondence with IEEE-754 Numbers

So far, we have expressed floating-point computations as compositions of operations of real numbers and rounding operators. This ignores the fact that IEEE-754 floating-point values may be infinite, or "not a number" (NaN), which is the case of the IEEE-754 datatypes as used in CompCert's semantics. For each operation on IEEE-754 numbers in CompCert, we invoke a correctness theorem in Flocq (e.g., Bfma_correct for fma) that says that if the operands are finite (meaning, neither infinities nor NaN) and the result of the operation over the reals fits the maximal magnitude accepted by the target type, then the result of the operation is finite and has a real value, which is the correctly rounded value of the result of the operation applied to the operands. In order to apply these theorems, one thus has to prove lemmas on the magnitudes of the computed numbers. Most of the size of our proofs results from auxiliary lemmas on magnitudes of numbers.

Performance Evaluation

To compare performance with the previous method proposed by Kalray, we computed 64-bit quotients with a = 2 40 + 222823k and b = 212 + 19k, for 0 ≤ k < 10000 and timed the time to compute these 10000 quotients. In the following, numbers are clock cycles (less is faster), Loop is an implementation of division using a hardware loop over Kalray's special instruction producing one bit of quotient, Floating-point is our floating-point algorithm, and we consider loop structures that both compute the same 10000 quotients, one with one quotient per iteration, the other with two quotients per iteration (thus 5000 iterations).

Method

Loop Floating-point One quotient per iteration 620180 522316 Two quotients per iteration 589696 292314

When two quotients are computed for each loop iteration, CompCert can schedule [17] together the instructions that compute the two quotients, thus the nearly halved computation time. Recall that the processor is fully pipelined, meaning that if a floating-point instruction enters the pipeline, another floatingpoint instruction may enter the pipeline at the next clock cycle even though the previous instruction has not yet produced a result, as long as the second instruction does not depend (from its operands) on the first instruction. Several independent computations can thus be weaved together by the compiler, as long as they do not use control-flow (loops and if-then-else). In contrast, two calls to the function implementing division using a loop cannot be scheduled together. [START_REF] Leroy | Formal verification of a realistic compiler[END_REF] For 32-bit quotients, we used a = 2 24 + 871k and b = 2 12 + 19k, for 0 ≤ k < 10000.

Method

Loop Floating-point One quotient per iteration 469969 442101 Two quotients per iteration 434501 232124

If the same divisor is used for all iterations, the loop-invariant code motion optimization presented in [15] can move all computations involving the divisor only out of the loop. Here are cycles counts when b = 74567, for 64-bit operands:

Related Work

The possibility of iterative refinement of reciprocals, quotients and square roots by Newton-Raphson iterations implemented by fused multiply-add has long been recognized [7][16, ch. 5].

The IA-64 architecture did not have division instructions, and much work was done on efficient floating-point and integer division algorithms for this architecture and associated formal proofs [11, 10, 6]. These algorithms are generally not applicable to the KV3 and other current architectures, since they assume the availability of 82-bit extended precision floating-point operations with 64-bit significands.

Conclusion and Perspectives

We have successfully formally verified 32-bit and 64-bit integer division algorithms for the Kalray KV3 processor. The algorithms are applicable to any processor with double-precision floating-point arithmetic featuring a fused multiplyadd, using round-to-nearest. The algorithms were implemented in a version of the CompCert verified compiler for the KV3 available online. [START_REF] Melquiond | Formal Verification for Numerical Computations, and the Other Way Around[END_REF] implementation and proofs take up 883 lines for the 32-bit division, 2670 for the 64-bit division. This size could probably be reduced through refactoring and custom proof automation. For each bit width, we cover signed and unsigned division and modulo. In each case, the final theorem states that, for all inputs, our sequence of operations (at the level of the compiler's intermediate representation; these operations map one-to-one to assembly instructions) computes exactly the same value as the corresponding C division or modulo operation when the divisor is nonzero.

Experiments show that our 32-bit and 64-bit constant-time divisions are on average faster than the special functions previously provided by Kalray. In addition, since our computation is straight-line, as opposed to the loop inside that special function, it can be interleaved with other computations (including other divisions) by the compiler's instruction scheduler. Since most of the computation depends only on the divisor, common subexpression elimination by the compiler will simplify computations if several divisions use the same divisor; similarly, the code depending only on the divisor may be hoisted out of a loop if the divisor remains constant across iterations.

Currently, Kalray's compilers implement floating-point division through calls to libgcc's software floating-point routines, which are themselves implementing by integer arithmetic. A natural extension of our work would be to design, implement and prove correct algorithms using the hardware floating-point unit and especially its fused multiply-add instruction, as it was done for the IA-64.

  4 _ t b ) { double bd = ( double ) b ; float bs = ( float ) bd ; float invbs0 = 1.0 f / bs ; double invbd0 = ( double ) invbs0 ; double alpha = fma ( -bd , invbd0 , 1.0); double invbd = fma ( alpha , invbd0 , invbd0 ); double ad = ( double ) a ; double q1d = ad * invbd0 ; // round to nearest , u n s i g n e d u i n t 6 4 _ t q1 = _ _ b u i l t i n _ l u r o u n d _ n e ( q1d ); i n t 6 4 _ t r1 = a -b * q1 ; double r1d = ( double ) r1 ; double q3d = r1d * invbd ; // round to nearest , signed i n t 6 4 _ t q3 = _ _ b u i l t i n _ l r o u n d _ n e ( q3d ); i n t 6 4 _ t r3 = r1 -b * q3 ; i n t 6 4 _ t q2 = r3 <0 ? q3 -1 : q3 ; u i n t 6 4 _ t q0 = q1 + q2 ; bool is_big = ( i n t 6 4 _ t) b < 0; // b >=2^63 u i n t 6 4 _ t if_big = a >= b ; bool is_one = b <= 1; u i n t 6 4 _ t s p e c i a l = is_big ? if_big : a ; return ( is_one || is_big ) ? s p e c i a l : q0 ; } Algorithm 3 64-bit unsigned division avoiding trapping conversions by branching out u i n t 6 4 _ t div64 ( u i n t 6 4 _ t a , u i n t6 4 _ t b ) { if ( b <= 1) return a ; if (( i n t 6 4 _ t) b < 0) // b >= 2^63 return a >= b ; double bd = ( double ) b ; float bs = ( float ) bd ; float invbs0 = 1.0 f / bs ; double invbd0 = ( double ) invbs0 ; double alpha = fma ( -bd , invbd0 , 1.0); double invbd = fma ( alpha , invbd0 , invbd0 ); double ad = ( double ) a ; double q1d = ad * invbd0 ; // round to nearest , u n s i g n e d u i n t 6 4 _ t q1 = _ _ b u i l t i n _ l u r o u n d _ n e ( q1d ); i n t 6 4 _ t r1 = a -b * q1 ; double r1d = ( double ) r1 ; double q3d = r1d * invbd ; // round to nearest , signed i n t 6 4 _ t q3 = _ _ b u i l t i n _ l r o u n d _ n e ( q3d ); i n t 6 4 _ t r3 = r1 -b * q3 ; i n t 6 4 _ t q2 = r3 <0 ? q3 -1 : q3 ; return q1 + q2 ; } 3 Proof of Correctness Our proofs rely on the formalization of IEEE-754 in the Flocq library 9 [2, 3, 1, 4]. In particular, Flocq has • executable definitions of individual IEEE-754 operations, which are used to specify CompCert's C and assembler floating-point semantics (these definitions compute the bit pattern in the output as a function of the inputs)

Such systems favor predictable architectures. Constant-time execution simplifies worstcase execution time (WCET) analysis. Static analysis of WCET typically relies on explicit enumeration of reachable pipeline states, and instructions with operand-dependent execution time increase the number of such states and may lead to combinatorial explosion.

See https://compcert.org/

Another frontend, known as Velus, exists for this compiler for a subset of the Lustre / Scade synchronous data-flow language, used to implement control systems in industries such as avionics.

The comments in the library mention that this approach is adapted from[START_REF] Cheng | TMS320C60000 integer division[END_REF]. Also, when CompCert for KV3 determines that the divisor of a 32-bit division is constant, it does not generate this function call and instead produces a sequence of integer operations involving multiplications[START_REF] Granlund | Division by invariant integers using multiplication[END_REF] which is proved to be equivalent to division by this divisor.

One workaround would be to prove formally correct this snippet of code, whether directly using CompCert's semantics or using an external tool for reasoning on C source code.

It seems possible to adapt proofs to less precise approximate reciprocal operations, since we don't use the full precision that we prove.

Because we had to completely specify the rounding mode for our formal proofs, we picked

Here, we just assume the "undefined" value results in further "undefined" values through further computations. If the "undefined" value can be assumed to be a valid 64-bit integer, then we may simplify our code a tiny bit.

https://flocq.gitlabpages.inria.fr/

This specification is not executable in the sense that it involves Coq's real numbers. Since in this article we are only concerned about addition, subtraction, multiplication and division, it could be possible to write this specification using only rational numbers, which would make it executable.

https://gappa.gitlabpages.inria.fr/

What would be needed is to inline the called function, then fuse together the two loops in one single loop, which is difficult given that they have different interaction counts.

If the divisor is constant and known at compile-time, CompCert replaces 32-bit integer division by a specialized sequence of purely integer operations[START_REF] Granlund | Division by invariant integers using multiplication[END_REF]. We arranged for these benchmarks that it should not be the case.

https://gricad-gitlab.univ-grenoble-alpes.fr/certicompil/compcert-kvx.git, commit d5f60d87. The proofs are in files kvx/FPDivision32.v and kvx/FPDivision64.v. The new division operators are accessible from C using the builtins __builtin_fp_udiv32,

Acknowledgments

We wish to thank Cyril Six for help in running experiments on actual KV3 processors.


Bart Dioos
email: bart.dioos@wis.kuleuven.be

Haizhong Li

AND Hui Ma

LAMAV Luc Vrancken
email: luc.vrancken@wis.kuleuven.be

FLAT ALMOST COMPLEX SURFACES IN S 3 × S 3

Keywords: Almost complex surface, flat surface, nearly Kähler manifold

We prove a Bonnet-type existence and uniqueness theorem for almost complex surfaces in the nearly Kähler manifold S 3 ×S 3 . The proof uses a local correspondence between almost complex surfaces in S 3 × S 3 and surfaces in R 3 that satisfy the Wente H-equation. Furthermore we give a complete classification of flat almost complex surfaces.

Introduction

Nearly Kähler manifolds are almost Hermitian manifolds, with almost complex structure J, for which the tensor field G = ∇J is skew-symmetric. A nearly Kähler manifold is called strict nearly Kähler if furthermore ∇ X J = 0 for every non-zero vector X. In particular, the almost complex structure of a strict nearly Kähler manifold is non-integrable and its fundamental 2-form is non-closed, in contrast with Kähler manifolds. They arise naturally as one to the sixteen Gray-Hervella classes of of almost Hermitian manifolds [?]. Probably the most known and simplest example of a nearly Kähler manifold is the 6-dimensional sphere, whose almost complex structure J can be defined in terms of the vector cross product on R 7 . In recent work of Butruille [?] it was proven that the only homogeneous 6-dimensional nearly Kähler manifolds are S 6 , S 3 × S 3 , CP 3 and the flag manifold SU (3)/U (1) × U (1). These spaces are compact 3-symmetric spaces and they are the only known compact nearly Kähler manifolds in dimension 6.

A natural class of submanifolds of nearly Kähler manifolds are the almost complex submanifolds, also known as pseudoholomorphic curves. Almost complex submanifolds are submanifolds for which J sends tangent vectors on tangent one. Podestà and Spiro [?] proved that strict nearly Kähler manifolds of dimension 6 do not admit any 4-dimensional almost complex submanifolds. This fact was already proven by Gray for the nearly Kähler S 6 ([?]). Hence the only almost complex submanifolds are surfaces. Almost complex surfaces in the nearly Kähler manifold S 6 have been extensively studied by many authors (see e.g. [?], [?], [?], [?], [?], [?]) and more recently Xu [?] studied these surfaces in the nearly Kähler CP 3 .

Almost complex surfaces in S 3 × S 3 were first studied in [?]. In this study an almost product structure P plays an important role. If M is an almost complex surface in S 3 × S 3 with metric g and complex coordinate z on M , then Λ dz 2 = g(P ∂ z , ∂ z ) dz 2 defines a holomorphic quadratic differential on the surface. There is a local correspondence between almost complex surfaces in S 3 × S 3 and surfaces X in R 3 satisfying the Wente H-equation ([?])

X uu + X vv = - 4 √ 3 X u × X v .
The holomorphic differential Λ dz 2 on M vanishes if and only if the coordinate z = u + iv is conformal on the H-surface X, that is, |X u | = |X v | and X u , X v = 0. (Note that z is a conformal coordinate for the almost complex surface but it is not necessarily conformal for the associated H-surface.) In particular if Λ dz 2 vanishes on the almost complex surface, the corresponding Wente H-surface is a surface of constant mean curvature (Theorem 3.10 in [?]). Using this fact and a well-known theorem of H. Hopf on constant mean curvature surfaces in R 3 it was then proven that almost complex 2-spheres in S 3 × S 3 are totally geodesic. Now the main results of the present paper can be stated. Firstly, we have the following Bonnet-type existence and uniqueness theorems for almost complex surfaces in S 3 × S 3 . Theorem 1.1. Let U ⊂ R 2 be a simply connected open set and z a complex coordinate on U . Suppose we have a metric g and two functions ω : U → R and µ : U → C such that g(∂ z , ∂ z ) = e ω and ω > 0. Moreover suppose that ω and µ satisfy

ω z z = e -ω 2 sinh ω |ω z | 2 + 4 3 sinh ω(1 -|µ| 2 ), (1)
µ z = ω z μ -e ω µω z 2 sinh ω . ( 2
)
Then there is an almost complex immersion φ : U → S 3 × S 3 with Λ = 1 and with an adapted frame

∂ z , ∂ z , N, N , G(∂ z , P ∂ z ), G(∂ z , P ∂ z ) such that its second fundamental form h(∂ z , ∂ z ) is h(∂ z , ∂ z ) = -ω z e ω -e -ω N + µG(∂ z , P ∂ z ).
Moreover, two such almost complex immersions are the same up to an isometry of S 3 × S 3 . Theorem 1.2. Let U ⊂ R 2 be a simply connected open set and z a complex coordinate on U . Suppose we have a metric g and two functions ω :

U → R and µ : U → C such that g(∂ z , ∂ z ) = e ω .
Moreover suppose that ω and µ satisfy the equations

ω z z = 2 3 e ω (|µ| 2 -1), µ z = -ω z µ.
Then there is an almost complex immersion φ : U → S 3 × S 3 with vanishing differential Λ dz 2 and an adapted frame

∂ z , ∂ z , P ∂ z , P ∂ z , G(∂ z , P ∂ z ), G(∂ z , P ∂ z ) such that the second fundamental form is h(∂ z , ∂ z ) = µG(∂ z , P ∂ z ).
Moreover, two such almost complex immersions are the same up to an isometry of S 3 × S 3 .

It is interesting to note that the equations in Theorem 1.2 can be rewritten, by choosing a suitable coordinate z, as the sinh-Gordon equation ω z z + 4 3 sinh ω = 0. This is in accordance with the correspondence between almost complex surfaces with vanishing holomorphic differential Λ dz 2 and constant mean curvature surfaces in R 3 (Theorem 3.10 in [?]).

Secondly we obtain a complete classification of flat almost complex surfaces in S 3 × S 3 , which consists of a 2-parameter family of flat almost complex surfaces. Precisely, we prove Theorem 1.3. Any flat almost complex surface in S 3 × S 3 must be an open part of the following 2-parameter family of homogenous tori

f (u, v) = (p(u, v), q(u, v)) with p(u, v) = ( 1 + a 2 e i(c1u+c2v) , 1 -a 2 e i(c3u+c4v) ), and
q(u, v) = ( 1 + b 2 e i(b1u+b2v) , 1 -a 2 e i(b3u+b4v) ) * i,
where * denotes the quaternion multiplication,

(a, b) ∈]-1, 1[×]-1, 1[ and c 1 , c 2 , c 3 , c 4 , b 1 , b 2 , b 3 , b 4 are constants determined by a, b (see (44) -(51)).
We conclude the introduction with an outline of the article. In Section 2 we set notations and recall the basic properties of the nearly Kähler structure on S 3 × S 3 . We discuss the nearly Kähler structure, the almost product structure P and their relation to S 3 × S 3 equipped with the canonical product metric structure. In Section 3 we provide some properties on almost complex surfaces and recall the the correspondence between almost complex surfaces in S 3 × S 3 and solutions of the Wente H-equation. In Section 4 we introduce the adapted frame on almost complex surfaces in S 3 × S 3 and discuss its existence. In the final two sections we prove our results stated above.

The nearly Kähler

S 3 × S 3
The 4-dimensional Euclidean space R 4 can naturally be identified to the set of quaternions. The 3-sphere S 3 then is the set of all unit quaternions. The vector fields given by X 1 (p) = pi, X 2 (p) = pj and X 3 (p) = pk at p ∈ S 3 , where i, j, k are the standard basis of unit quaternions, form a basis of tangent vector fields. Therefore any tangent vector in T p S 3 can be expressed as pα where α is an imaginary quaternion. In particular, if X ∈ T p S 3 , then qp -1 X is a vector in T q S 3 .

We identify T (p,q) (S 3 × S 3 ) with T p S 3 ⊕ T q S 3 to write a tangent vector at (p, q) as Z(p, q) = U (p, q), V (p, q) or just Z = (U, V ). The almost complex structure J on S 3 × S 3 is given by

JZ (p,q) = 1 √ 3 2pq -1 V -U, -2qp -1 U + V for a vector Z in T (p,q) (S 3 × S 3 ) (see [?]); it is straightforward to check that J 2 = -Id.
The nearly Kähler metric g on S 3 × S 3 is then defined as the Hermitian metric associated to the standard Euclidean product metric:

g(Z, Z ) = 1 2 ( Z, Z + JZ, JZ ) = 4 3 ( U, U + V, V ) - 2 3 p -1 U, q -1 V + p -1 U , q -1 V .
In the first equation •, • stands for the product metric on S 3 ×S 3 and in the second one it stands for the Euclidean metric on S 3 . By definition J is compatible with g: g(JZ, JZ ) = g(Z, Z ). The metric g only differs up to a constant factor from the one introduced in [?]. In [?] the factor was chosen such that the standard basis on S 3 × S 3 has unit volume. Here and in [?] we have chosen the factor 1 2 for the sake of simplicity. We mention that the isometries of (S 3 × S 3 , g) are given by

F : S 3 × S 3 → S 3 × S 3 : (p, q) → (apc -1 , bqc -1 ),
where a, b and c are unit quaternions. We write the Levi-Civita connection of (S 3 × S 3 , g) as ∇ and the tensor field ∇J as G. Endowed with the almost Hermitian structure (g, J), S 3 × S 3 is nearly Kähler, which means that the tensor field G is skew-symmetric. The following properties can be deduced from the nearly Kähler property.

G(X, Y ) + G(Y, X) = 0, (3) G(X, JY ) + JG(X, Y ) = 0, (4) g(G(X, Y ), Z) + g(G(X, Z), Y ) = 0. (5)
The almost product structure P on S 3 × S 3 is an endomorphism defined by

P Z = (pq -1 V, qp -1 U ).
If U = pα and V = qβ, then P Z = (pβ, qα). The almost product structure can be interpreted in the following way. We start with the vector (U, V ) at (p, q). First left translate it to the point (1, 1) to get the vector (p -1 U, q -1 V ). Next we switch the components and finally we left translate this vector back to the point (p, q) and we obtain (pq -1 V, qp -1 U ). It is straightforward to show that (6) P 2 = Id, P J = -JP, g(P Z, P Z ) = g(Z, Z ).

Thus P is also symmetric with respect to g. The tensor field ∇P does not vanish identically, so P is not a product structure, but it satisfies the following properties.

Lemma 2.1. For tangent vectors X, Y ∈ T (S 3 × S 3 ) one has

P G(X, Y ) + G(P X, P Y ) = 0, (7) G(X, P Y ) + P G(X, Y ) = -2J( ∇X P )Y, (8) ( ∇X P )JY = J( ∇X P )Y. (9)
The Riemann curvature tensor R on (S 3 × S 3 , g) is given by

R(X, Y )Z = 5 12 g(Y, Z)X -g(X, Z)Y + 1 12 g(JY, Z)JX -g(JX, Z)JY -2g(JX, Y )JZ + 1 3 g(P Y, Z)P X -g(P X, Z)P Y + g(JP Y, Z)JP X -g(JP X, Z)JP Y , (10)
and from this one can show that the tensors ∇G and G satisfy

( ∇G)(X, Y, Z) = 1 3 (g(X, Z)JY -g(X, Y )JZ -g(JY, Z)X), (11) g G(X, Y ), G(Z, W ) = 1 3 g(X, Z)g(Y, W ) -g(X, W )g(Y, Z) + g(JX, Z)g(JW, Y ) -g(JX, W )g(JZ, Y ) , (12) G X, G(Y, Z) = 1 3 g(X, Z)Y -g(X, Y )Z + g(JX, Z)JY -g(JX, Y )JZ . (13)
In particular, it follows that S 3 ×S 3 is of constant type 1/3 ([?]). We note that similar expressions hold on any 6-dimensional strictly nearly Kähler manifold. Now we will give the relation between the geometry of the nearly Kähler manifold (S 3 × S 3 , g) and the product manifold (S 3 × S 3 , •, • ) endowed with the Euclidean product metric •, • . The equations in this paragraph will be used in Section 6.2.

The almost product structure P can be expressed in terms of the usual product structure QZ = Q(U, V ) = (-U, V ) and vice versa:

QZ = 1 √ 3 (2P JZ -JZ), (14)
P Z = 1 2 (Z - √ 3QJZ). ( 15
)
Using these equations the Euclidean metric •, • can be expressed in terms of g and P :

(16) Z, Z = 3 8 g(Z, Z ) + g(QZ, QZ ) = g(Z, Z ) + 1 2 g(Z, P Z ),
and consequently

(17) Z, QZ = √ 3 2 g(Z, P JZ ).
We can now show the relation between the Levi-Civita connections ∇ of g and ∇ E of the Euclidean product metric •, • on S 3 × S 3 .

Lemma 2.2. The relation between the nearly Kähler connections ∇ and the Euclidean connection

∇ E is (18) ∇ E X Y = ∇X Y + 1 2 JG(X, P Y ) + JG(Y, P X) .
Proof. It is easy to check that the right hand side of ( 18) defines a connection and we denote it by ∇. The connection ∇ is symmetric, since 1 2 JG(X, P Y ) + JG(Y, P X) is symmetric. We now only have to show that ∇ is compatible with the Euclidean metric •, • . Equations ( 6), ( 7) and ( 16) give

∇ X Y,Z + ∇ X Z, Y = g( ∇X Y, Z) + g( ∇X Z, Y ) + 1 2 g( ∇X Y, P Z) + g( ∇X Z, P Y ) + g(JG(X, P Y ), Z) + g(JG(Y, P X), Z) + g(JG(X, P Z), Y ) + g(JG(Z, P X), Y ) + 1 4 g(JG(P X, Y ), Z) + g(JG(P Y, X), Z) + g(JG(P X, Z), Y ) + g(JG(P Z, X), Y ) = Xg(Y, Z) + 1 2 g( ∇X Y, P Z) + g( ∇X Z, P Y ) + 1 4 g(JG(X, P Y ), Z) + g(JG(X, P Z), Y ) ,
and then by ( 8) and ( 16) we obtain

∇ X Y, Z + ∇ X Z, Y = Xg(Y, Z) + 1 2 g( ∇X Y, P Z) + g( ∇X Z, P Y ) + g( ∇X P Y, Z) -g( ∇X Y, P Z) = Xg(Y, Z) + 1 2 Xg(P Y, Z) = X Y, Z .
This finishes the proof of the lemma.

Remark. Using this lemma and ( 15) one can show that (∇ E X Q)Y = 0 implies equation ( 9) and vice versa. In this sense P really is the "nearly Kähler analogue" of the Euclidean product structure Q.

Almost complex surfaces in S 3 × S 3

An almost complex submanifold M in a nearly Kähler manifold M is a submanifold such that J maps tangent vectors to tangent vectors, i.e., the tangent bundle T M is J-invariant. Consequently J maps normal vectors on normal ones. It was proven by Podestà and Spiro that 6-dimensional strictly nearly Kähler manifolds do not admit 4-dimensional almost complex submanifolds [?], hence the almost complex submanifolds of S 3 × S 3 are surfaces.

Denote the Levi-Civita connection on M by ∇ and the normal connection on the normal bundle T ⊥ M by ∇ ⊥ . The Gauss and Weingarten formulas and the basic properties of G imply

∇ X JX = J∇ X X, h(X, JY ) = Jh(X, Y ), (19) A Jξ X = JA ξ X = -A ξ JX, G(X, ξ) = ∇ ⊥ X Jξ -J∇ ⊥ X ξ, (20)
for X, Y ∈ T M and ξ ∈ T ⊥ M , where h denotes the second fundamental form and A ξ denotes the shape operator (see e.g. [?] or [?]). Hence M is minimal and nearly Kähler. Furthermore, since M is an almost complex surface, the tangent space is spanned by a unit vector X and JX. Hence ∇J vanishes on M , so M is in fact Kähler. So if X, Y are tangent vectors on an almost complex surface in S 3 × S 3 , then G(X, Y ) = 0 and thus equation (8) simplifies to

( ∇X P )Y = 1 2 JG(X, P Y ). Next we recall the correspondence theorem from [?]. Let φ : M → S 3 × S 3 : (u, v) → p(u, v
), q(u, v) be an almost complex surface, where z = u + iv are isothermal coordinates on M . We may assume that φ v = Jφ u by interchanging u and v, if necessary. Furthermore, as p and q are maps into S 3 , there are well defined local functions α, β, γ and δ from M to ImH such that

p u = pα, p v = p β, q u = qγ, q v = q δ. (21) Then φ v = Jφ u gives (22) γ = √ 3 2 β + 1 2 α, δ = 1 2 β - √ 3 2 α.
The integrability conditions p uv = p vu and q uv = q vu written in terms of α and β become

αv -βu = 2α × β, αu + βv = 2 √ 3 α × β. ( 23
)
Setting α = cos θ α + sin θ β and β = -sin θ α + cos θ β with θ = 2π/3, these two equations become ( 24)

α v = β u , α u + β v = - 4 √ 3 α × β.
Assume now that we are working on a simply connected neighborhood. Then any closed 1-form is exact and hence there exists a R 3 -valued function X such that X u = α, X v = β and (25)

X uu + X vv = - 4 √ 3 X u × X v .
This equation is known as the H-surface equation (cf.

[?]). The correspondence theorem can now be formulated as Theorem 3.1. There is locally a one-to-one correspondence between almost complex surfaces in S 3 ×S 3 and solutions of the general H-system equation. Moreover, two solutions are congruent in R 3 if and only if the associated solutions in S 3 × S 3 are congruent.

On an almost complex surface, a quadratic differential Λ dz 2 is defined by g(P φ z , φ z ) dz 2 . The Cauchy-Riemann-like equations (24) imply that Λ dz 2 is a holomorphic differential. In Section 5 we show this fact using a straightforward calculation (Lemma 5.2).

An adapted frame for almost complex surfaces

Consider an almost complex surface M in S 3 × S 3 and let z = u + iv be a complex coordinate on M . We will define a suitable frame adapted to the almost complex surface M in terms of the almost complex product structure P and the tensor field G = ∇J. This frame will be used to prove the existence and uniqueness theorems (Theorem 1.1 and 1.2) in the next section. The frame can only be defined at points where a certain condition is satisfied.

Define

∂ z = 1 2 (∂ u -i∂ v ) and ∂ z = 1 2 (∂ u + i∂ v ) as usual.
Then the metric g on the surface M is given by

g(∂ z , ∂ z ) = g(∂ z , ∂ z ) = 0, g(∂ z , ∂ z ) = e ω ,
for some local function ω. It follows from the well-known Koszul formula that the Levi-Civita connection on the surface is

∇ ∂z ∂ z = ∇ ∂z ∂ z = 0, ∇ ∂z ∂ z = ω z ∂ z , ∇ ∂z ∂ z = ω z ∂ z .
The Gauss curvature is K = -e -ω ω z z and the minimality of M implies that h(∂ z , ∂ z ) = 0. We will write Λ = g(P ∂ z , ∂ z ). Moreover

g(P ∂ z , ∂ z ) = 1 4 g(P ∂ u , ∂ u ) + g(P ∂ v , ∂ v ) = 1 4 g(P ∂ u , ∂ u ) -g(JP ∂ u , J∂ u ) = 0.
From this it follows that

P ∂ z = e -ω Λ∂ z + N, P ∂ z = e -ω Λ∂ z + N ,
where N is the normal part of P ∂ z . The almost product structure P preserves the metric, so g(P ∂ z , P ∂ z ) = 0 and g(P ∂ z , P ∂ z ) = e ω , which gives

(26) g(N, N ) = 0, g(N, N ) = e ω -|Λ| 2 e -ω .
The vectors G(∂ z , P ∂ z ) and G(∂ z , P ∂ z ) are orthogonal to ∂ z , ∂ z , P ∂ z and P ∂ z , which is easily seen using equation ( 5), and thus they are also orthogonal to N and N . Writing out G(∂ z , P ∂ z ) and using ∂ v = J∂ u and the basic properties of G and P , one gets

G(∂ z , P ∂ z ) = 1 4 G(∂ u , P ∂ u ) -G(∂ v , P ∂ v ) - i 4 G(∂ u , P ∂ v ) + G(∂ v , P ∂ u ) = 1 4 G(∂ u , P ∂ u ) -G(∂ u , P ∂ u ) + i 4 G(∂ u , JP ∂ u ) -G(J∂ u , P ∂ u ) = 0,
and a similar calculation gives

G(∂ z , P ∂ z ) = 1 2 G(∂ u , P ∂ u ) + iG(∂ u , P J∂ u ) .
From equation ( 12) we get

(27) g(G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = 2 3 (e 2ω -|Λ| 2 )
and ( 28)

g(G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = 0.
So summing up, we have found that

F = ∂ z , ∂ z , N, N , G(∂ z , P ∂ z ), G(∂ z , P ∂ z )
gives an adapted frame to the almost complex surface. The vectors are orthogonal, but do not have the same length. Also note that the frame only exists at points where |Λ| 2 = e 2ω . At points where the equality |Λ| 2 = e 2ω holds the normal N is zero. At these points P preserves the tangent space: P T M = T M . In Theorem 4.2 of [?] the almost complex surfaces with P T M = T M have been classified; such a surface is locally congruent to the torus f (u, v) = (cos u + i sin u, cos v + i sin v). Therefore we will restrict ourselves to the open subset of M on which |Λ| 2 = e 2ω and we may assume that it is dense in M .

5. Proofs of Theorem 1.1 and Theorem 1.2

In this section we will prove Theorem 1.1 and Theorem 1.2. The proof consists of three steps. First we write the second fundamental form h in terms of the normal vectors N, . . . , G(∂ z , P ∂ z ). Next we deduce the compatibility equations for almost complex surfaces. In this second step the proof will be split into two cases: (a) Λ is nowhere zero and (b) Λ vanishes. Case (a) gives Theorem 1.1 and case (b) gives Theorem 1.2. In the last step we use the correspondence theorem (Theorem 3.1) and verify that the compatibility conditions for a H-surface are the same as the compatibility equations for almost complex surfaces. The proof then follows from the existence and uniqueness theorem for differential equations and the correspondence theorem.

The equations ( 7) and ( 8) give two useful expressions that will be used frequently in this section.

P G(∂ z , P ∂ z ) = G(∂ z , P ∂ z ), P G(∂ z , P ∂ z ) = G(∂ z , P ∂ z ), ( 29
) ∇∂z P ∂ z = P ∇∂z ∂ z , ∇∂z P ∂ z = P ∇∂z ∂ z . ( 30
)
Consider the adapted frame F on the open subset of M where |Λ| 2 = e 2ω .

Proposition 5.1. The second fundamental form is given by

(31) h(∂ z , ∂ z ) = λ N + µG(∂ z , P ∂ z )
with λ and µ local functions satisfying

(32) λ = 1 2 Λ z -2ω z Λ e ω -|Λ| 2 e -ω , 2 3 (e 2ω -|Λ| 2 )µ = g(h(∂ z , ∂ z ), G(∂ z , P ∂ z )).
Proof. Differentiating Λ with respect to z gives

Λ z = g( ∇∂z P ∂ z , ∂ z ) + g(P ∂ z , ∇∂z ∂ z ) = g(P ∇∂z ∂ z , ∂ z ) + g(P ∂ z , ω z ∂ z ) + g(P ∂ z , h(∂ z , ∂ z )) = 2ω z Λ + 2g(h(∂ z , ∂ z ), N ), (33)
where we used (30). Similarly,

∂ z g(P ∂ z , ∂ z ) = 0 gives us 0 = g( ∇∂z P ∂ z , ∂ z ) + g(P ∂ z , ∇∂z ∂ z ) = g(( ∇∂z P )∂ z , ∂ z ) + g(P ∇∂z ∂ z , ∂ z ) = ω z g(P ∂ z , ∂ z ) + g(P h(∂ z , ∂ z ), ∂ z ) = g(h(∂ z , ∂ z ), N ). Now we calculate the inner product of h(∂ z , ∂ z ) and G(∂ z , P ∂ z ). Since the surface is almost complex, Jh(∂ z , ∂ z ) is equal to h(∂ z , J∂ z ) = ih(∂ z , ∂ z ), so we have g(h(∂ z , ∂ z ), G(∂ z , P ∂ z )) = -g(G(∂ z , h(∂ z , ∂ z )), P ∂ z ) = -g( ∇∂z Jh(∂ z , ∂ z ), P ∂ z ) -g( ∇∂z h(∂ z , ∂ z ), JP ∂ z ) = -ig( ∇∂z h(∂ z , ∂ z ), P ∂ z ) + ig( ∇∂z h(∂ z , ∂ z ), P ∂ z ) = 0.
Note that by equations ( 27) and (31) the complex valued function µ has to satisfy the second equation of (32). We complete the proof of Proposition 5.1.

As we mentioned before, the differential Λ dz 2 is holomorphic (Theorem 3.1). This fact follows from equations ( 24) and ( 25), but it can also be shown by an easy calculation.

Lemma 5.2. The function Λ = g(P ∂ z , ∂ z ) is holomorphic.

Proof. By the first equation of (30), we have

Λ z = 2g(∇ ∂z ∂ z , P ∂ z ) = 2g(h(∂ z , ∂ z ), P ∂ z ) = 0.
We now distinguish two cases. The function Λ is holomorphic, so it is zero at isolated points or identically zero. In the latter case |Λ| 2 = 0 and since e 2ω is always positive, the frame F always exists on the surface. In the former case we can take a local coordinate system, on a possibly smaller neighbourhood, such that Λ = 1. The frame F then only exists at points where ω > 0. As we have pointed out in Section 4 we can assume that the set of points where ω > 0 is an open dense subset of M . Case 1. Λ ≡ 1. From now on we assume that Λ = 1. In this case (32) simplifies to

λ = -ω z e ω -e -ω , 2 3 (e 2ω -1)µ = g(h(∂ z , ∂ z ), G(∂ z , P ∂ z )).
The next step is to calculate ω z z and µ z . For this we need the following lemma.

Lemma 5.3. The normal covariant derivatives of the normal vectors are

∇ ⊥ ∂z N = -e -ω λN -e -ω μG(∂ z , P ∂ z ) + i 2 G(∂ z , P ∂ z ), ∇ ⊥ ∂z N = 1 2 ω z e ω csch ω N + μG(∂ z , P ∂ z ), ∇ ⊥ ∂z G(∂ z , P ∂ z ) = - 2 3 e ω μN - i 3 e ω N + 1 2 ω z e ω csch ωG(∂ z , P ∂ z ), ∇ ⊥ ∂z G(∂ z , P ∂ z ) = 2 3 μ N + 1 2 ω z e ω csch ωG(∂ z , P ∂ z ).
Proof. The first two expressions can be calculated directly. Firstly we have

∇ ⊥ ∂z N = ∇∂z (P ∂ z -e -ω ∂ z ) + A N ∂ z = ( ∇∂z P )∂ z + e -ω ω z ∂ z -e -ω ∇∂z ∂ z = 1 2 JG(∂ z , P ∂ z ) -e -ω h(∂ z , ∂ z ) = -e -ω λN -e -ω μG(∂ z , P ∂ z ) + i 2 G(∂ z , P ∂ z ).
From Proposition 5.1 we get

P h(∂ z , ∂ z ) = λ((1 -e -2ω )∂ z -e -ω N ) + µG(∂ z , P ∂ z ).
Therefore the second covariant derivative is

∇ ⊥ ∂z N = ∇∂z (P ∂ z -e -ω ∂ z ) + A N ∂ z = P ∇∂z ∂ z + ω z e -ω ∂ z -e -ω ∇∂z ∂ z + A N ∂ z = P h(∂ z , ∂ z ) ⊥ + ω z (P ∂ z ) ⊥ = 1 2 ω z e ω csch ω N + μG(∂ z , P ∂ z ).
To obtain the third and fourth expression, we calculate the inner products of ∇ ⊥ ∂z G(∂ z , P ∂ z ) and ∇ ⊥ ∂z G(∂ z , P ∂ z ) with the normal vectors. We already know that

g(∇ ⊥ ∂z G(∂ z , P ∂ z ), N ) = -g(G(∂ z , P ∂ z ), ∇ ⊥ ∂z N ) = - i 3 (e 2ω -1), g(∇ ⊥ ∂z G(∂ z , P ∂ z ), N ) = -g(G(∂ z , P ∂ z ), ∇ ⊥ ∂z N ) = - 2 3 μ(e 2ω -1).
From ( 28) it follows that g(∇ ⊥ ∂z G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = 0. By equation ( 30) we have

g(∇ ⊥ ∂z G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = g(( ∇∂z G)(∂ z , P ∂ z ), G(∂ z , P ∂ z )) + g(G( ∇∂z ∂ z , P ∂ z ), G(∂ z , P ∂ z )) + g(G(∂ z , ∇∂z P ∂ z ), G(∂ z , P ∂ z )).
Equation ( 11) says that ( ∇∂z G)(∂ z , P ∂ z ) is a linear combination of ∂ z , ∂ z , P ∂ z , P ∂ z and therefore the first term vanishes. The second term vanishes as well since ∇ ∂z ∂ z = 0. Equations ( 27), ( 31) and ( 12) then give

g(∇ ⊥ ∂z G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = g(G(∂ z , P (∇ ∂z ∂ z + h(∂ z , ∂ z )), G(∂ z , P ∂ z )) = 2 3 ω z e 2ω .
Combining these equations with ( 26) and ( 27), one obtains the third expression. Finally we have

g(∇ ⊥ ∂z G(∂ z , P ∂ z ), N ) = -g(G(∂ z , P ∂ z ), ∇ ⊥ ∂z N ) = 2 3 μ(e ω -e -ω ), g(∇ ⊥ ∂z G(∂ z , P ∂ z ), N ) = -g(G(∂ z , P ∂ z ), ∇ ⊥ ∂z N ) = 0, g(∇ ⊥ ∂z G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = 0, g(∇ ⊥ ∂z G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = 2 3 ∂ z (e 2ω -1) -g(∇ ⊥ ∂z G(∂ z , P ∂ z ), G(∂ z , P ∂ z )) = 2 3 ω z e 2ω .
These equations together with ( 26) and ( 27) give the last covariant derivative.

The expression for the curvature tensor R yields R

(∂ z , ∂ z )∂ z ⊥ = 2 3 N , so the Codazzi equa- tion becomes ∇ ⊥ ∂z h(∂ z , ∂ z ) = 2 3 N . It follows from Lemma 5.3 that ω z z sinh ω- e -ω 2 |ω z | 2 - 4 3 sinh 2 ω(1 -|µ| 2 ) = 0, µ z + e ω µω z -ω z μ 2 sinh ω = 0. ( 34
)
Case 2. Λ is identically zero. The calculations and expressions in this case are simpler. In this case h(∂ z , ∂ z ) = µG(∂ z , P ∂ z ), where

2 3 e 2ω µ = g(h(∂ z , ∂ z ), G(∂ z , P ∂ z )).
Using the same approach as in Lemma 5.3, we get

∇ ⊥ ∂z G(∂ z , P ∂ z ) = ( ∇G)(∂ z , ∂ z , P ∂ z ) + G( ∇∂z ∂ z , P ∂ z ) + G(∂ z , ∇∂z P ∂ z ) + A G(∂z,P ∂z) ∂ z = ω z G(∂ z , P ∂ z ) + μG(G(∂ z , P ∂ z ), P ∂ z ) + 1 2 G(∂ z , JG(∂ z , P ∂ z )) + A G(∂z,P ∂z) ∂ z = ω z G(∂ z , P ∂ z ).
From the Codazzi equation it follows that

0 = ∇ ⊥ ∂z h(∂ z , ∂ z ) = (µ z + ω z µ)G(∂ z , P ∂ z ). Together with the Gauss equation R(∂ z , ∂ z , ∂ z , ∂ z ) = R(∂ z , ∂ z , ∂ z , ∂ z ) + h(∂ z , ∂ z ) 2 we obtain ω z z + 2 3 e ω (1 -|µ| 2 ) = 0, µ z + ω z µ = 0. ( 35
)
In order to finish the proof, we will use the correspondence between almost complex surfaces and H-systems (Theorem 3.1). We look at the equation

X z z = 2i √ 3 X z × X z .
The definition of g, the equations ( 22) and the fact that α, β and α, β are equal up to a rotation give

e ω = 1 4 ∂ u , ∂ u + ∂ v , ∂ v = 1 4 α, α + β, β + γ, γ + δ, δ = 1 2 α, α + β, β = 1 2 α, α + β, β = 1 2 X u , X u + X v , X v = 2 X z , X z .
Moreover we know from Theorem 3.1

Λ = g(P ∂ z , ∂ z ) = 2e i π 3 X z , X z .
So we have the relations

X z , X z = 1 2 e ω , X z , X z = 1 2 e -i π 3 Λ. (36)
Case 1. Λ is not identically zero. By changing the coordinate system we may assume that Λ and thus X z , X z are constant. Then X zz , X z = 1 2 ω z e ω and X zz , X z = 0. One obtains the system

X z z = 2i √ 3 X z × X z , X zz = ω z 1 -|Λ| 2 e -2ω X z - e -ω ω z 1 -|Λ| 2 e -2ω Λe -i π 3 X z + ΩX z × X z .
for some local function Ω. We have

(X z z ) z = - ie i π 3 √ 3 ΛΩ + 2 3 e ω X z + ie ω √ 3 Ω + 2 3 e -i π 3 Λ X z + 2i √ 3 ω z 1 -|Λ| 2 e -2ω X z × X z .
Comparing this with (X zz ) z we then get

Ω z = ω z |Λ| 2 e -2ω -1 Ω + e -ω e -i π 3 ω z |Λ| 2 e -2ω -1 Λ Ω, 0 = ω z z (|Λ| 2 e -2ω -1) + |ω z | 2 |Λ| 2 e -2ω + e ω (|Λ| 2 e -2ω -1) 2 1 2 |Ω| 2 - 2 3 . If we set Ω = - 2i √ 3 e -i π 6 µ, Λ = 1,
we see that the above compatibility conditions are the same as equations ( 34). Therefore such an H-system indeed exists. Consequently we get a corresponding almost complex surface in S 3 × S 3 . Case 2. Λ is identically zero. If Λ vanishes, we obtain the system

X zz = ω z X z + ΩX z × X z .
The derivatives (X z z ) z and (X zz ) z are

(X z z ) z = - 2 3 e ω X z + ie ω √ 3 ΩX z + 2i √ 3 ω z X z × X z (X zz ) z = ω z z - e ω 2 |Ω| 2 X z + ie ω √ 3 ΩX z + Ω z + ω z Ω + 2i √ 3 ω z X z × X z .
The compatibility condition then gives

ω z z = e ω 2 |Ω| 2 - 4 3 , Ω z + ω z Ω = 0.
So for Ω = 2 √ 3 µ we get the same equations as ( 35). This proves the existence and uniqueness theorems.

Flat almost complex surfaces

In the last section we give a method to obtain all flat almost complex surfaces in S 3 ×S 3 . There is a 2-parameter family of flat almost complex surfaces and one isolated example that was already described in [?]. Our proof consists of three steps. First we choose a suitable adapted frame for the almost complex surfaces and determine the second fundamental form. For this, we calculate several compatibility conditions. In the second step, we show that the components of the flat surface are Clifford tori. This fact will be used in the final step to obtain a parametrization of the flat almost complex surfaces. 6.1. Finding the second fundamental form. Let M be a flat almost complex surface. If P T M = T M then the surface is locally congruent to the torus f (u, v) = (cos u + i sin u, cos v + i sin v) ( see Theorem 4.1 in [?]). So we will assume that P T M = T M . Choose a local frame e 1 , e 2 such that e 1 is a maximum of g(P u, u) for all unit vectors u and e 2 = Je 1 . From a standard argument it follows that g(P e 1 , e 2 ) = 0. Consider the adapted frame e 1 , . . . , e 6 along M where e 3 = P e 1 , e 5 = G(e 1 , P e 1 ), e 4 = P e 2 = -Je 3 , e 6 = G(e 1 , P e 2 ) = Je 5 .

By the assumption P T M = T M , these vectors are indeed linearly independent. Let a and b be local functions such that the connection is given by

∇ e1 e 1 = ae 2 , ∇ e2 e 1 = -be 2 ,
∇ e1 e 2 = -ae 1 , ∇ e2 e 2 = be 1 .

As ∇ is torsion free, one has [e 1 , e 2 ] = -ae 1 + be 2 . The curvature is zero, so

(37) e 1 (b) + e 2 (a) = a 2 + b 2 .
Furthermore if we write cos θ = g(P e 1 , e 1 ), then P e 1 -cos θe 1 = e 3 -cos θe 1 , -J(P e 1 -cos θe 1 ) = e 4 + cos θe 2 are normal vectors. By (5) the vectors e 5 and e 6 are also normal ones. We choose c 1 , c 2 , d 1 , d 2 such that h(e 1 , e 1 ) = c 1 (e 3 -cos θe 1 ) + c 2 (e 4 + cos θe 2 ) + d 1 e 5 + d 2 e 6 .

Since M is almost complex, Jh(e 1 , e 1 ) = h(e 1 , e 2 ) and h(e 1 , e 1 ) = -h(e 2 , e 2 ). Therefore

∇e1 e 1 = -c 1 cos θe 1 + (a + c 2 cos θ)e 2 + c 1 e 3 + c 2 e 4 + d 1 e 5 + d 2 e 6 , ∇e1 e 2 = -(a + c 2 cos θ)e 1 -c 1 cos θe 2 + c 2 e 3 -c 1 e 4 -d 2 e 5 + d 1 e 6 , ∇e2 e 1 = -c 2 cos θe 1 -(b + c 1 cos θ)e 2 + c 2 e 3 -c 1 e 4 -d 2 e 5 + d 1 e 6 , ∇e2 e 2 = (b + c 1 cos θ)e 1 -c 2 cos θe 2 -c 1 e 3 -c 2 e 4 -d 1 e 5 -d 2 e 6 .
Using equation ( 8) we obtain the covariant derivatives of e 3 and e 4 . For example, for ∇e1 e 3 = ∇e1 P e 1 , we have ∇e1 P e 1 = P ∇e1 e 1 + 1 2 G(e 1 , P e 2 ).

One obtains

∇e1 e 3 = c 1 e 1 + c 2 e 2 -c 1 cos θe 3 + (a + c 2 cos θ)e 4 + d 1 e 5 + ( 1 2 -d 2 )e 6 , ∇e1 e 4 = c 2 e 1 -c 1 e 2 -(a + c 2 cos θ)e 3 -c 1 cos θe 4 -( 1 2 + d 2 )e 5 -d 1 e 6 , ∇e2 e 3 = c 2 e 1 -c 1 e 2 -c 2 cos θe 3 -(b + c 1 cos θ)e 4 + ( 1 2 -d 2 )e 5 -d 1 e 6 , ∇e2 e 4 = -c 1 e 1 -c 2 e 2 + (b + c 1 cos θ)e 3 -c 2 cos θe 4 -d 1 e 5 + ( 1 2 + d 2 )e 6 .
The compatibility of the Levi-Civita connection ∇ with the metric gives e i (g(e 1 , e k )) = g( ∇ei e 1 , e k ) + g(e 1 , ∇ei e k ) for i = 1, 2 and k = 3, 4. These four equations give

e 1 (θ) = -2c 1 sin θ, c 1 = b cot θ csc θ, e 2 (θ) = -2c 2 sin θ, c 2 = a cot θ csc θ.
Using equation ( 11), we can compute the covariant derivatives of e 5 and e 6 . For example, for ∇e1 e 5 = ∇e1 G(e 1 , P e 1 ) the calculation goes as follows: ∇e1 G(e 1 , P e 1 ) = ( ∇e1 G)(e 1 , P e 1 ) + G( ∇e1 e 1 , P e 1 ) + G(e 1 , ∇e1 P e 1 ) = 1 3 (g(e 1 , P e 1 )e 2 -JP e 1 ) + G( ∇e1 e 1 , P e 1 ) + G(e 1 , ∇e1 P e 1 ). Now we will calculate several compatibility conditions to obtain Lemma 6.1. The compatibility conditions e 1 (e 2 (φ i )) -e 2 (e 1 (φ i )) = [e 1 , e 2 ](φ i ) give 1 24 24(U 2 + V 2 ) sec 2 α + cos 2 α sec 2 θ(103 + 28 cos 2θ -3 cos 4θ)

+ 8 sec α tan α(3 cos α(e 1 (U ) + e 2 (V )) + sin 3α + √ 3(V cos(φ 1 -2φ 2 ) -U sin(φ 1 -2φ 2 ))) + 8 tan 2 α + 4 tan θ(-2 √ 3 sin α sin θ(V cos φ 1 + U sin φ 1 ) -3 cos 2 α(7 + cos 2θ) tan θ) = 0, 1 3 2 cos 2α -3 cot α(e 1 (U ) + e 2 (V )) + cos 2 α sec 2 θ(7 + cos 2θ) + csc α(3 csc α(U 2 + V 2 ) + √ 3(-V cos(φ 1 -2φ 2 ) + U sin(φ 1 -2φ 2 )) + √ 3 cos α cot α sin θ tan θ(V cos φ 1 + U sin φ 1 ) -6 cos 2 α tan 2 θ = 0.
Multiplying the second expression by tan 2 α and adding it to the first one, gives us

6 + 2 sec 2 α(U 2 + V 2 - 1 3 ) = 0, or U 2 + V 2 = 1 3 cos 2 α(sec 2 α -9). Since U 2 + V 2 is positive, α ∈ [arccos( 1 3 ), arccos(-1 3 )]. We denote r = 1 3 cos 2 α(sec 2 α -9) 1/2
and U = r cos δ and V = r sin δ. The compatibility conditions for φ 2 and α yield two equations linear in e 1 (δ) and e 2 (δ). Solving these two equations gives -2(19 + 36 cos 2α + 9 cos 4α) sin(δ -φ 1 + 2φ 2 ) + 8 cos 2 α sin θ tan θ sin(δ + φ 1 )(7 + 9 cos 2α)).

e 1 (δ) = sec α 8 √ 3(7 + 9 cos 2α) 2 A cos δ -B sin δ ,
The compatibility condition e 1 (e 2 (δ)) -e 2 (e 1 (δ)) -[e 1 , e 2 ](δ) = 0 then gives

(39) sin(δ -φ 1 + 2φ 2 ) = (25 + 36 cos 2α + 3 cos 4α) csc 3 α 4 √ 2 √ -7 -9 cos 2α .
Lemma 6.1. The numbers θ and φ := φ 2 are constants. Moreover a, b, c 1 , c 2 are all zero and

d 1 = cos φ, d 2 = sin φ.
Proof. The expression on the right hand side of ( 39) is smaller than or equal to -1 for every α ∈ [arccos( 1 3 ), arccos(-1 3 )] and equality holds if α = π/2. Therefore α = π/2 and thus a, b, c 1 and c 2 vanish and d 1 = cos φ 2 and d 2 = sin φ 2 . The equations for e i (θ) and e i (φ 2 ) imply that θ and φ 2 are constant.

The second fundamental form thus is given by h(e 1 , e 1 ) = cos φ e 5 + sin φ e 6 , h(e 1 , e 2 ) = -sin φ e 5 + cos φ e 6 , where φ is a constant.

6.2. Both components are homogeneous tori. In order to obtain a parametrization f for flat almost complex surfaces in S 3 × S 3 , we will rewrite the structure equations for the almost complex immersion f as equations for the immersions p, q in S 3 where f = (p, q). The calculations are not that difficult, but the expressions get rather lengthy. Consider S 3 × S 3 in R 8 = R 4 ⊕ R 4 . Since [e 1 , e 2 ] = 0, there are coordinates (u, v) such that ∂ u = e 1 and ∂ v = e 2 . Write f = (p, q), Qf = (-p, q) and consider the frame

G = f, Qf, f u , f v , P f u , P f v , G(f u , P f u ), JG(f u , P f u ) ;
this is just the frame e 1 , . . . , e 6 with f and Qf added to it. Let D denote the Euclidean connection on R 8 and A and B the matrices such that

D ∂u G = AG and D ∂v G = BG.
Now we explain how to calculate all the Euclidean covariant derivatives. We have D ∂u f = f u . By DQ = 0 and ( 14)

D ∂u Qf = Qf u = - 1 √ 3 f v + 2 √ 3 P f v .
By Lemma 2.2, equations ( 16), ( 17) and the expression ∇e1 e 1 we have

D ∂u f u = ∇ E ∂u f u + 1 2 D ∂u f u , f f + 1 2 D ∂u f u , Qf Qf = ∇∂u f u + JG(f u , P f u ) -1 2 ( f u , f u f + f u , Qf u Qf ) = cos φG(f u , P f u ) + (sin φ + 1)JG(f u , P f u ) -( 1 2 + 1 4 cos θ)
f. Note that f and Qf have Euclidean length 2, hence the factor 1 2 in the last two terms. The derivatives of f v , P f u and P f v are calculated in the same way. To obtain D ∂u G(f u , P f u ) and D ∂u JG(f u , P f u ), we use (13). For instance,

D ∂u G(f u , P f u ) = ∇ E ∂u G(f u , P f u ) + 1 2 D ∂u G(f u , P f u ), f f + 1 2 D ∂u G(f u , P f u ), Qf Qf = ∇∂u G(f u , P f u ) + 1 2 JG(f u , P G(f u , P f u )) + JG(G(f u , P f u ), P f u ) -G(f u , P f u ), f u f -G(f u , P f u ), Qf u Qf = 1
3 cos φ(cos θ -1)f u + 1 6 (2(1 + sin φ) cos θ + 2 sin φ -1)f v + 1 3 cos φ(cos θ -1)P f u + 1 6 (2 sin φ(cos θ + 1) -cos θ+2)P f v . Proceeding in this way, one obtains the matrices A and B. The matrix A is

1 0 0 0 0 0 0 -1 √ 3 0 2 √ 3 0 0 0 0 0 0 cos φ 1+ sin φ s θ 0 0 0 0 -sin φ cos φ 0 0 0 0 cos φ 1 2 -sin φ 0 0 0 0 -( 1 2 + sin φ) -cos φ 1 3 cos φ(cos θ -1) 1 6
(2 cos θ(sin φ + 1) + 2 sin φ -1)

1 3 cos φ(cos θ -1) 1 6 (2 sin φ(cos θ + 1) -cos θ + 2) 0 0 -1 6 (2 sin φ(cos θ + 1) + 1) 1 3 cos φ(cos θ -1) 1 6
(2 sin φ(cos θ + 1)+ cos θ)

1 3 cos φ(1 -cos θ) 0 0         and B equals 0 1 0 0 0 0 1 √ 3 0 -2 √ 3 0 0 0 0 0 0 0 -sin φ cos φ 0 0 0 0 -cos φ 1 -sin φ 0 0 0 0 1 2 -sin φ -cos φ 0 0 0 0 -cos φ 1 2 + sin φ 1 6 (2 sin φ(1 -cos θ) + 2 cos θ + 1) 1 3 cos φ(cos θ + 1) 1 6 (2 sin φ(1 -cos θ) -cos θ -2) 1 3 cos φ(1 + cos θ) 0 0 -1 3 cos φ(cos θ + 1) 1 6 (2 sin φ(1 -cos θ) -1) 1 3 cos φ(cos θ + 1) 1 6 (2 sin φ(cos θ -1) -cos θ) 0 0        
Note that f (u, v) = exp(Au+Bv) = exp(Au) exp(Bv) gives the parametrization of flat almost complex surfaces in S 3 × S 3 as a solution of the system of differential equations of first order. At this point we have equations for the immersion f : M → (S 3 × S 3 , •, • ), that is, f is regarded as an immersion in S 3 × S 3 with the usual product metric.

In order to find the equations for the components p and q, we rewrite these first order equations as a system of second order equations. Note that p = 1 2 (f -Qf ) and q = 1 2 (f + Qf ) and consider the vectors

ξ 1 = 1 √ 3 G(f u , P f u ) + JG(f u , P f u ), ξ 2 = - 1 √ 3 G(f u , P f u ) + JG(f u , P f u ).
The derivatives of p and q can readily be found using the calculations above. If we write

G 1 = (p, p u , p v , ξ 1 ), G 2 = (q, q u , q v , ξ 2 ),
then we obtain the following system of equations

D ∂u G 1 = A 1 G 1 , D ∂v G 1 = B 1 G 1 , (40)
D ∂u G 2 = A 2 G 2 , D ∂v G 2 = B 2 G 2 , (41)
where the matrices A 1 , B 1 , A 2 and B 2 are

A 1 =    0 1 0 0 -1 4 (2 + cos θ) 0 0 1 2 (1 + √ 3 cos φ + sin φ) - √ 3 4 cos θ 0 0 1 2 (cos φ - √ 3 sin φ) 0 1 6 (cos θ(1 + 2 √ 3 cos φ 1 6 √ 3 (3 cos θ + 2 √ 3 cos φ(cos θ -1) 0 -2 sin φ) -2(1 + √ 3 cos φ + sin φ)) +6 sin φ(1 + cos θ))    , B 1 =     0 0 1 0 - √ 3 4 cos θ 0 0 1 2 (cos φ - √ 3 sin φ) -1 4 (2 -cos θ) 0 0 1 2 (1- √ 3 cos φ -sin φ) 0 -1 3 cos φ(1 + cos θ) 1 √ 3 cos φ(1 + cos θ) 0 + 1 2 √ 3 (cos θ -2 sin φ(cos θ -1)) -1 6 (2 + cos θ + 2 sin φ(cos θ -1))     , A 2 =     0 1 0 0 -1 4 (2 + cos θ) 0 0 1 2 (sin φ - √ 3 cos φ + 1) √ 3 4 cos θ 0 0 1 2 (cos φ + √ 3 sin φ) 0 1 √ 3 cos φ(1 -cos θ) 1 3 cos φ(cos θ -1) 0 -1 6 (2 sin φ(1 + cos θ) -cos θ + 2) -1 2 √ 3 (2 sin φ(1 + cos θ) + cos θ)     , B 2 =     0 0 1 0 √ 3 4 cos θ 0 0 1 2 (cos φ + √ 3 sin φ) 1 4 (cos θ -2) 0 0 1 2 ( √ 3 cos φ -sin φ + 1) 0 1 2 √ 3 (cos θ(2 sin φ -1) -2 sin φ) 1 6 (2 sin φ(1 -cos θ) -cos θ -2) 0 -1 3 cos φ(1 + cos θ) -1 √ 3 cos φ(1 + cos θ)     .
In particular p and q are parametrizations of surfaces in S 3 . An elementary calculation shows that these surfaces have zero Gaussian curvature and constant mean curvatures (42)

csc θ √ 3 2 cos θ sin π 3 -φ -1 , -csc θ √ 3 2 cos θ sin π 3 + φ + 1 respectively.
It is well-known that the only surfaces with constant Gaussian and mean curvature in S 3 are locally totally geodesic spheres or homogenous tori, hence Proposition 6.2. The immersions p and q are congruent to (parts of ) the homogeneous tori.

Recall that for

-1 < a < 1, if x a (u, v) = ( 1 + a 2 e iu , 1 -a 2 e iv ),
is the homogeneous torus with normal given by

ξ(u, v) = ( 1 -a 2 e iu , - 1 + a 2 e iv ).
Then we have that

ξ u = 1-a 1+a x u , ξ v = -1+a 1-a x v ,
from which we deduce that the mean curvature

H a = -1 2 ( 1-a 1+a -1+a 1-a ) = a √ 1-a 2 .
The immersions p and q are SO(4)-congruent to a standard flat torus in S 3 . Also S 3 × S 3 = SU (2) × SU (2) is the double cover of SO(4), so any rotation R ∈ SO(4) can be written as R(x) = αxβ, where α, β ∈ S 3 . Therefore we can write p(u, v) = a 1 (r 1 cos u, r 1 sin u, r 2 cos v, r 2 sin v) a 2 , q(ũ, ṽ) = a 3 (s 1 cos ũ, s 1 sin ũ, s 2 cos ṽ, s 2 sin ṽ) a 4 , where r 1 , r 2 , s 1 , s 2 are positive real numbers with r 2 1 + r 2 2 = 1, s 2 1 + s 2 2 = 1 and a 1 , a 2 , a 3 , a 4 ∈ S 3 are unit quaternions. Recall that the isometries of the nearly Kähler S 3 × S 3 are (p, q) → (apc -1 , bqc -1 ) for unit quaternions a, b and c. So by applying an appropriate isometry, p and q become

p(u, v) = (r 1 cos u (u, v), r 1 sin u (u, v), r 2 cos v (u, v), r 2 sin v (u, v)), q(u, v) = (s 1 cos u (u, v), s 1 sin u (u, v), s 2 cos v (u, v), s 2 sin v (u, v)) d, (43)
for some d ∈ S 3 . We already know that for both maps p and q are congruent to homogenous tori and that moreover their Christoffel symbols with respect to the usual metric on S 3 vanish. Therefore the coordinates u , v and u , v are related by an affine transformation to the standard coordinates of the homogeneous torus. We thus have

u = b 1 u + b 2 v, v = b 3 u + b 4 v, u = c 1 u + c 2 v, v = c 3 u + c 4 v.
Without loss of generality, by applying a rotation and a homothety we may moreover assume that c 1 = 1, c 2 = 0.

6.3. Proof of Theorem 1.3. We first assume that neither P (T M ) ⊂ T M nor P (T M ) ⊥ T M . The first step of the proof will be to apply the existence and uniqueness theorem given in Theorem 1.1. In this case the holomorphic differential does not vanish identically. We have seen that in this case 0 < θ < π 2 and that the connection coefficients of the basis e 1 and e 2 vanish. As such we can introduce a complex coordinate z = x + iy, by

∂ ∂z = ∂z = 1 2 w(e 1 -ie 2 ),
where at the moment w is an arbitrary positive constant. As g(∂z, P ∂z) = 1/4w 2 g(e 1 -iJe 1 , P e 1 -iP Je 1 ) = 1 2 w 2 cos θ, we see that taking w = √ 2 √ cos θ yields our preferred complex coordinate. It then follows that e ω = g(∂z, ∂ z) = 1/2w 2 = 1 cos θ , which implies that ω is a positive constant. Moreover, we have that h(∂z, ∂z) = 1 4 w 2 h(e 1 -iJe 1 , e 1 -iJe 1 ) = 1 cos θ (h(e 1 , e 1 ) -ih(e 1 , e 2 )) = 1 cos θ (cos φe 5 + sin φe 6 -i sin φe 5 + i cos φe 6 ) = 1 cos θ e iφ (e 5 -ie 6 ), and G(∂ z, P ∂z) = 1 4 w 2 G(e 1 + iJe 1 , P e 1 -iP Je 1 ) = 1 2 cos θ G(e 1 + iJe 1 , P e 1 + iJP e 1 ) = 1 cos θ (G(e 1 , P e 1 ) + iG(Je 1 , P e 1 )) = 1 cos θ (G(e 1 , P e 1 ) -iG(e 1 , P Je 1 )) = 1 cos θ (e 5 -ie 6 ), which implies that e iφ = µ. Note that these are indeed trivial solutions of the system of differential equations in Theorem 1.1 and that therefore for every value of 0 < θ < π 2 and 0 ≤ φ < 2π we get a unique solution. Therefore, in order to complete the proof in this case, by the uniqueness part of the theorem it is sufficient for value of 0 < θ < π 2 and 0 ≤ φ < 2π to give an example of a flat almost complex surface.

In order to do so we will look at the mean curvatures of the immersions p and q. We define the map

g 1 :]0, π 2 [×]0, 2π[→ R 2 : (θ, φ) → csc θ √ 3 2 cos θ sin π 3 -φ -1 , -csc θ √ 3 2 cos θ sin π 3 + φ + 1 .
Note that the image of the φ-lines under g 1 is the ellipse with equation This implies first that the map is injective and that its image is given by

g 1 (]0, π 2 [×]0, 2π[) = {(x, y) ∈ R 2 |x + y < 0}\{(-1 √ 3 , -1 √
3 )}. On the other hand as we have seen before, the homogeneous torus

C a = {(z 1 , z 2 ) ∈ C 2 : |z 1 | = 1 + a 2 , |z 2 | = 1 -a 2 },
where a ∈] -1, 1[ has mean curvature a √ 1-a 2 . Note that the function a → a √ 1-a 2 is an odd function which is a bijection between ] -1, 1[ and R. Moreover we have that a 2 . Therefore, in order to complete the proof of the theorem in this case, it is sufficient to give homogeneous tori p and q, with parameters a and b satisfying a + b < 0 and (a, b) = (-1 2 , -1 2 ). A straightforward computation now implies that p(u, v) = ( 1 + a 2 e i(c1u+c2v) , 1 -a 2 e i(c3u+c4v) ), and q(u, v) = ( 1 + b 2 e i(b1u+b2v) , 1 -a 2 e i(b3u+b4v) ) * i,

  2α) 2 A sin δ + B cos δ with A = (590 + 927 cos 2α + 450 cos 4α + 81 cos 6α) cos(δ -φ 1 + 2φ 2 ) -2 sin θ tan θ cos(δ + φ 1 )(23 cos α + 9 cos 3α) 2 , B = (7 + 9 cos 2α)( √ 2 csc α √ -7 -9 cos 2α(33 + 28 cos 2α + 3 cos 4α)

  only if a = -1

This research was supported by the Tsinghua University-K. U. Leuven Bilateral Scientific Cooperation Fund. H. Li was supported by NSFC (No. 11271214) and H. Ma was supported by NSFC (No. 11271213).

We obtain ∇e1 e 5 = 1 3 d 1 (cos θ -1)e 1 + 1 6 (2d 2 (1 + cos θ) + cos θ)e 2 + 1 3 d 1 (cos θ -1)e 3 + 1 6 (1 + 2d 2 (1 + cos θ))e 4 -2b cot 2 θe 5 , ∇e1 e 6 = 1 6 (cos θ -2d 2 (1 + cos θ))e 1 + 1 3 d 1 (cos θ -1)e 2 + 1 6 (2d 2 (1 + cos θ) -1)e 3 + 1 3 d 1 (1 -cos θ)e 4 -2b cot 2 θe 6 , ∇e2 e 5 = 1 6 (2d

We have R(e 1 , e 2 )e 1 = ∇e1 ∇e2 e 1 -∇e2 ∇e1 e 1 -∇[e1,e2] e 1 . The left hand side is given by the expression (10) for R and the right hand side can be written using all covariant derivatives above. The e 1 -, e 2 -, e 5 -and e 6 -components of this equation then give

Note that the second equation (38b) together with (37) becomes

In view of this equation we write from now on

and furthermore we introduce the variables

Substitute U and V in (37), (38a), (38c) and (38d) and solve this system of equations to obtain the derivatives of φ 1 and φ 2 :

the above constants are actually well defined for any (a, b) ∈] -1, 1[×] -1, 1[. This completes the proof in the general case.

If P (T M ) ⊂ T M , we know that M is congruent to the totally geodesic torus, which can be obtained from the previous formula by taking any allowable (a, -a).

If P (T M ) ⊥ T M we know that the corresponding H-system is a flat constant mean curvature surface (with mean curvature -2 √ 3 ). Up to congruence in R 3 such a surface is unique and therefore all such surfaces in S 3 × S 3 must be mutually congruent. So again it is sufficient to give an example of such a surface which is obtained by taking (a, b) = (-1 2 , -1 2 ) in the previous formulas.