{'fraction_non_alphanumeric': 0.042246431772736674, 'fraction_numerical': 0.01591394883817141, 'mean_word_length': 3.9073221898896935, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 56, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A topological model for the Fukaya categories of plumbings

We prove that the algebra of singular cochains on a smooth manifold, equipped with the cup product, is equivalent to the A-infinity structure on the Lagrangian Floer cochain group associated to the zero section in the cotangent bundle. More generally, given a pair of smooth manifolds of the same dimension with embeddings of a submanifold B with isomorphic normal bundles, we construct a differential graded category from the singular cochains of these spaces, and prove that it is equivalent to the A-infinity category obtained by considering exact Lagrangian embeddings intersecting cleanly along B.


Introduction
In [8], Fukaya and Oh proved that counts of holomorphic discs in a cotangent bundle with boundary conditions along exact Lagrangian sections agree, in a certain degeneration, with a count of gradient trees. This has been widely expected to lead to an equivalence between the A ∞ structure defined on Floer cochains of a Lagrangian Q, and the chain level cup product on the classical (Čech, simplicial, singular) models for its ordinary cohomology. Over R, Kontsevich and Soibelman in [11] described an argument using the result of Fukaya and Oh and Homological perturbation theory on de Rham cohomology, which proves this result. A different proof, also over R, is given by Fukaya, Oh, Ohta, and Ono's in their book on Lagrangian Floer cohomology [9, Section 33]. One corollary of this paper is that such an equivalence holds over the integers: Date: July 29, 2010. This research was conducted during the period the author served as a Clay Research Fellow. Remark 1.2. In order to define CF * (Q, Q) as an honest A ∞ algebra (rather than work with partially defined algebraic structures as in [11]) we follow the approach used by Seidel in [17]. The main idea is to make choices of perturbations to ensure the genericity of all moduli spaces that enter into the definition of the operations. Seidel proves that the resulting structure is independent, up to A ∞ equivalence, of these choices.
As in [11] we pass through a Morse model in order to prove this equivalence. First, we imitate the construction of the Fukaya category to obtain an A ∞ structure on Morse cochains by counting perturbed gradient trees. Writing CM * (Q) for this A ∞ algebra, we prove the existence of A ∞ functors inducing isomorphisms on cohomology. Here, C * (Q) are the cochains of a simplicial triangulation of Q. Theorem 1.1 follows from the fact that A ∞ maps inducing an isomorphism on cohomology admit (quasi)-inverses whenever the underlying groups are free abelian.
We do not rely on the degeneration technique of [8] in order to prove the equivalence of the A ∞ structures coming from Floer and Morse theory. Rather, we consider moduli spaces that are built from gradient trees and holomorphic discs with one Lagrangian boundary condition along an arbitrary leaf of the foliation of the cotangent bundle by fibres. The corresponding abstract moduli spaces give a new realisation of the multiplihedra controlling A ∞ functors foreseen by Stasheff in [19]. Theorem 1.1 is the special case of a more general result: within an exact symplectic manifold W with vanishing first chern class (and a choice of a complex volume form), we define a brane to be an exact Lagrangian Q which is relatively spin, and such that the restriction of the complex volume form to some Weinstein neighbourhood of Q is isotopic to the complexification of a (real) volume form on Q (more precisely, we fix this isotopy). These extra choices of data are necessary in order for the Fukaya category to be defined over Z and admit natural gradings.
Given a pair of exact Lagrangian branes Q 1 and Q 2 intersecting cleanly along a submanifold B, the Lagrangian condition implies that the normal bundles of Q 1 ∩ Q 2 in the two sheets are isomorphic. In Section 2.1, we construct a differential graded category  At the level of cohomology, Theorem 1.3 is not too difficult to prove from Poźniak's thesis [15]. A standard application of Weinstein's neighbourhood theorem shows that a neighbourhood of Q 1 ∪ Q 2 in W is symplectomorphic to the result of gluing the cotangent bundles of Q 1 and Q 2 along the cotangent bundle of B. The diffeomorphism type of the resulting manifold is called the plumbing of the two cotangent bundles [14]. Up to an appropriate notion of deformation equivalence which does not affect the Fukaya category, there is a canonical symplectic form on this plumbing.
The experts will observe that the condition that ω vanish on π 2 (M, Q 1 ∪ Q 2 ) is stronger than the mere exactness of Q 1 and Q 2 . One may think of it as a strict notion of exactness for the union of Q 1 and Q 2 as an immersed Lagrangian submanifold of M . For example, as we allow for B to be disconnected, our result gives a description of the category generated by a "cycle" of Lagrangians {Q i } d i=1 such that Q i intersects only Q i−1 and Q i+1 with the understanding that the labels are computed mod d. However, our description is only valid in the case we know in addition that a loop running around this cycle cannot bound any holomorphic discs (for energy reasons).
We recall that, in [16], Ruan extended the degeneration results of Fukaya and Oh to the case of an immersed Lagrangian Q ∈ M with double points such that π 2 (M, Q) vanishes, and proved that counts of rigid holomorphic discs can be made to agree with counts of gradient trees. This indicates a straightforward generalisation of Theorem 1.3: given two embeddings B → Q whose images do not intersect and with isomorphic normal bundles N B, it is easy to extend the construction of Simp(Q 1 , Q 2 ) to produce an associative product on the direct sum which satisfies the Leibniz rule with respect to the obvious differential. This algebra is then equivalent, as an A ∞ algebra, to the Lagrangian Floer cochains of Q considered as an immersed Lagrangian in the "self-plumbing" of its cotangent bundle along B. Floer cohomology for immersed Lagrangians was described in great generality by Akaho and Joyce in [4], producing an A ∞ structure on a vector space which, up to choosing different model for a cochain-level theory, is equivalent to the direct sum (1.5). One may interpret our result as a computation, in the exact case, of the A ∞ structure assigned by Akaho and Joyce to an immersed Lagrangian. Indeed, their A ∞ structure comes from the count of perturbed holomorphic discs; the perturbations are necessary because of the abundance of constant discs with marked points which do not form regular moduli spaces as soon as the number of marked points is greater than 3. As is often the case with such approaches, it seems impossible to give an explicit direct counts of the number of discs after perturbations.
Finally, we note that while every A ∞ category is abstractly equivalent to a differential graded category, there is no construction which produces a finite dimensional differential graded category when the morphism spaces are finite rank abelian groups. One consequence of Theorem 1.3 is the existence of such a finite dimensional differential graded model for Fukaya categories in the case of plumbings. We insist, however, that our construction requires working with cochains on Q 1 and Q 2 even if these manifolds happen to be formal (i.e have the property that their cohomology are quasi-isomorphic to their cochain algebras). As explained in Chapter 20 of [17], it is already true that one can find 5 exact Lagrangians in a twice punctured genus 2 curve, satisfying our exactness condition, such that the subcategory of the Fukaya category they generate is not formal (despite the fact that the circle is formal).
Acknowledgments. I would like to thank Paul Seidel for answering my many questions about Chapter 20 of [17].

Three categories
For the remainder of this paper, we fix a pair of closed smooth manifolds Q 1 and Q 2 with base points b i , and open sets U i containing b i . In the most basic situation, U i is the interior of a closed (embedded) ball. We shall write Q 1,2 for the closure of U 1 and Q 2,1 for the closure of U 2 .
In addition, we equip Q 1 and Q 2 with simplicial triangulations Q 1 and Q 2 , and choose top dimensional simplices ∆ 1 and ∆ 2 respectively containing b 1 and b 2 . Recall that the condition that a triangulation be simplicial implies that we have an ordering of all vertices; in particular, ∆ i has a unique identification ι i with the standard n-simplex ∆ which preserves the ordering (see pages 102 and 107 of [10] for a discussion of different notions of triangulations).

2.1.
A simplicial category from a triangulation of Q i . We begin by constructing a differential graded category with two objects called Q 1 and Q 2 and morphisms the simplicial cochain complexes Hom S * (Q i , Q i ) = C * (Q i ) (2.1) Hom S * (Q 1 , Q 2 ) = C * (∆) (2.2) Hom S * (Q 2 , Q 1 ) = C * (∆, ∂∆). (2.3) In particular, the rank of Hom(Q 1 , Q 2 ) is 2 n − 1, while the rank of Hom(Q 2 , Q 1 ) is 1. The cochain complexes C * (Q i ) are differential graded algebras with respect to the cup product; we shall extend this product to a differential graded composition law by noting that the inclusions of ∆ i in Q i induce ring homomorphisms (2.4) ι * i : C * (Q i ) → C * (∆).
We define compositions using cup-product on the left and on the right with the restricted classes Since the maps ι * i are maps of differential graded algebras, and the Leibniz and associativity formulae hold for the cup product and differential on C * (∆), we readily conclude that the multiplication (2.5) satisfies the Leibniz rule, and moreover defines an associative composition. For example, we have a commutative diagram In order to define this composition in the other direction, we use the fact that the cup product also makes C * (∆, ∂∆) into a bimodule over C * (∆). In particular, we define composition maps Again, the proof that these maps satisfy the properties required of a differential graded category follows immediately from the fact that C * (∆, ∂∆) is in fact a differential graded bi-module over C * (∆) (this is trivial since the differential on this relative cochain group vanishes). Finally, the inclusions of ∆ i in Q i induce maps (2.10) ι i! : C * (∆, ∂∆) → C * (Q i ).
Since C * (∆, ∂∆) has rank 1, there is an obvious formula for these maps; the image is simply the n-dimensional cochain with value 1 on ∆ i and which vanishes on every other chain. More conceptually, this map is induced by a composition (2.11) C * (∆, ∂∆) where the first map is an excision isomorphism. Using this, we define the final two composition maps . (2.13) There are 8 associativity diagrams whose commutativity remains to be checked. Even though the construction is not completely symmetric, we only discuss the following four maps: C * (∆, ∂∆) ⊗ C * (∆) ⊗ C * (∆, ∂∆) −→C * (∆). (2.14) Associativity of the first three of the above operations follows immediately from the property that C * (∆, ∂∆) is a differential graded bi-module over C * (∆). The last operation requires in addition the fact that the composition (2.15) C * (∆, ∂∆) agrees with the natural inclusion of relative cochains into ordinary cochains (alternatively, one can notice that the two maps we are comparing in Equation (2.14) vanish altogether).
We shall also need a geometric interpretation of the cup product as an intersection product on the chains of subdivisions dual to the chosen triangulations of Q i . Let us therefore fix such dual subdivisionsQ i , whose top dimensional cells are identified, by smooth charts, with polyhedra in R n . In particular, the n − 1-dimensional cells intersect cleanly.
Remark 2.2. The sign change in (2.16) is particularly convenient from the point of view of the dual cell subdivision: if we think geometrically, every generator of C * (Q) corresponds to a simplex carrying an orientation, and the differential is the restriction of this orientation to the boundary. If we want to think of the differential d on C * (Q) as taking a dual cell to its boundary, we find that the resulting operation differs from the natural restriction of orientations exactly by a sign (−1) 1+deg(σ) . The additional sign of 1 comes from the fact that an outward pointing vector at the boundary of a cell corresponds to an inward pointing vector from the dual subdivision's point of view.
We shall also require that the identification ∆ 1 ∼ = ∆ 2 map the cells ofQ 1 ∩ ∆ 1 to the corresponding cells ofQ 2 ∩ ∆ 2 . In particular, we obtain a subdivision dual to the trivial triangulation of the standard simplex ∆. Given a cell σ of Q i , we writeσ for the dual cell ofQ i , as well as for the dual generator of C * (Q i ). A slight generalization of the main observation in Appendix E of [2] is the existence of vector fields X i on Q i which generate flows φ i t such that the following Lemma holds Lemma 2.3. Whenever σ, τ , and ρ are cells of Q i such that there is a smooth map for any sufficiently small t.
Sinceσ ∪τ either vanishes or is of the formρ for some cell ρ, we conclude that the cup productσ ∪τ vanishes wheneverσ ∩ φ i t (τ ) is empty for sufficiently small t, and we interpret the above Lemma to state that the cup product is given by the intersection product of the dual cells, provided that they are appropriately perturbed.
The construction of the vector fields X i is elementary; since Q i is a simplicial triangulation, its vertices are ordered, hence so are the top dimensional cells of dual subdivision. We may choose X i to be any vector field satisfying the following property Definition 2.4. A vector field X i is said to be compatible with the simplicial triangulation if along each cellσ the restriction of X i lies in the tangent space of the top dimensional cell which is minimal among those adjacent to σ.
By abuse of language, we shall often call such vector fields simplicial. The existence of such a vector field follows from a local argument described in Appendix E of [2]. Since the above condition is respected by taking positive linear combinations, we may and shall require the restrictions of X 1 and X 2 to ∆ 1 and ∆ 2 to be intertwined by the maps identifying these two simplices. Figure 1 shows the restriction of such a vector field to the 1-skeleton of the dual subdivision of a 2 dimensional simplex.
[0]  In terms of the dual subdivisionsQ i , the restriction of cochains corresponds to taking the inverse image of a cell, while the map ι i! takes the vertex of the subdivision dual to ∆ to its image under the inclusions into Q i . Since composition maps in the category Simp(Q 1 , Q 2 ) are defined using these operations together with the cup product, Lemma 2.3 provides an intersection theoretic interpretation of this category.

A Morse category. Fix a pair of open sets
where Q 1,2 and Q 2,1 are manifolds with boundary (there is no gain in notational simplicity in assuming anything more). To make the connection with the rest of the paper, we shall later restrict to the situation where U 1 and U 2 are both balls, corresponding to neighbourhoods in Q 1 and Q 2 of the point b along which we shall perform the plumbing.
The identification between these manifolds shall be fixed throughout the following discussion, and we use it to define the space which is a non-Hausdorff smooth manifold whose locus of points which cannot be separated from each other is the union ∂Ū 1 ∪ ∂Ū 2 . By construction, this space admits canonical maps from the manifolds Q 1,2 and Q 2,1 as well. For the remainder of the paper, we sometimes also write Q i,i for Q i as a convenient notational device.
We assume that we have chosen Riemannian metrics on Q i whose restrictions to U i are intertwined by these diffeomorphisms, and we fix a choice of Morse-Smale functions such that f 1,2 and f 2,1 are respectively inward and outward pointing on the boundary. In particular, we also choose functions f 1,1 and f 2,2 on Q 1 and Q 2 . Writing CM * (f ) for Morse cochains, we shall define an A ∞ category with morphism space where |o x | is the orientation line associated to o x ≡ λ(W s (x)), i.e. the quotient of the free abelian group generated by a choice of orientation of the stable manifold of x by the relation that the sum of generators associated to opposite orientations vanishes. This rank 1 group has degree equal to the dimension of the stable manifold of x. The differential counts negative gradient lines of f i,j ; the detailed description is given in Section 8.
To define higher compositions in this category, we consider moduli spaces of gradient trees in Q which are defined later in this section. Given any ribbon tree T with d + 1 leaves, we shall assume that one of the leaves has been distinguished as outgoing, which determines the unique ordering on the remaining d leaves (called incoming) illustrated in Figure 2. We shall write E(T ) for the set of edges of T (including the external edges). Our conventions are that all edges include their endpoints and, except for the outgoing edge which is always infinite, are allowed to have length 0.
The edges adjacent to any vertex of a ribbon tree T are by definition cyclically ordered, and we define a labelling (i(e), j(e)) of the edges e ∈ E(T ) by elements of the set {1, 2} to be compatible with the cyclic ordering if i(e ′ ) = j(e) whenever e ′ follows e with respect to the cyclic ordering at some vertex. The following result may be proved by induction, or by embedding T in a disc labelling the complementary regions appropriately.
Lemma 2.5. A sequence I = (i 0 , . . . , i d ) determines a unique labelling of all edges of T which is compatible with the cyclic ordering, such that the incoming leaves are labelled by (i k , i k+1 ). Moreover, the outgoing leaf is labelled by (i 0 , i d ).
In order to resolve potential problems with transversality in defining the Morse category, we introduce perturbation data, following Seidel's construction for Lagrangian Floer theory in [17]. Let us illustrate the case of the cup product on CM * (Q 1 ). Given three critical points x 0 , x 1 and x 2 , the x 0 component of µ M 2 ([x 2 ], [x 1 ]) should count triple intersections between the ascending manifold of x 0 , and the descending manifolds of x 1 and x 2 . This space is necessarily empty unless x 1 = x 2 , in which case the intersection is not transverse.
This triple intersection admits a description as the moduli space of maps from the unique trivalent tree with three infinite external edges, which converge at the respective ends to the critical points x 0 , x 1 and x 2 , and which on each edge solve the gradient flow equation for the function f 1,1 . We shall perturb this moduli space by changing the differential equation obeyed by each edge. Concretely, as each edge is isometric to [0, +∞), our perturbation will vanish on (1, +∞) and will be essentially arbitrary on [0, 1]. Integrating the perturbed gradient flow along the interval [0, 1], we obtain a triple φ 0 , φ 1 , and φ 2 of diffeomorphisms of Q 1 . Changing our perspective once again, we interpret the moduli space of perturbed gradient trees as the intersection of the images under φ i of the appropriate ascending and descending manifolds. As the diffeomorphisms φ i are essentially arbitrary (and independent of each other) we achieve transversality (and hence an honest count) upon perturbing the gradient flow. One must still prove that this product is the quadratic term of an A ∞ structure, which requires defining compatible perturbations of the gradient flow equation on higher dimensional moduli spaces of trees.
Let us return to the general discussion, and fix a sequence of labels I as above: Definition 2.6. A gradient flow perturbation datum on (T, g T ) is a choice, for each edge e ∈ E(T ) of a family of vector fields which vanish away from a bounded subset of e and such that the restriction of the vector field , j(e)) = (1, 2) and (ii) inward pointing (i(e), j(e)) = (2, 1).
Remark 2.7. Since the gradient vector fields of f 1,2 and f 2,1 are respectively inward and outward pointing, the vanishing perturbation datum satisfies the above properties.
We shall now specialise and consider the trees which control the A ∞ structure on the Morse category. Let us write T d for the moduli space of Stasheff trees (T, g T ), i.e. metric ribbon trees with d + 1 infinite external edges, and T I for the moduli space of trees whose inputs are labelled by the successive elements of a sequence I (this is a copy of T | I | ). By allowing singular trees, we obtain compactifications T d and T I which are in fact polyhedra. The collection of spaces T d for varying d were shown by Stasheff to form an A ∞ operad; i.e. to control A ∞ algebras. In particular whenever d = d 1 + d 2 − 1, we may construct a singular Stasheff tree with d inputs by attaching the output of a singular tree with d 2 inputs to any of the inputs of an element of T d1 . This construction yields a collection of d 1 maps whose images for all pairs (d 1 , d 2 ) cover the boundary of T d . This familiar construction can also be done with labels: if I 1 = (i 1 0 , . . . , i 1 d1 ) and I 2 = (i 2 0 , . . . , i 2 d2 ) are sequences such that (i 1 k , i 1 k+1 ) is the label for the output of a tree in T I d , we obtain a natural map (2.26) ) and the boundary of T I is again covered by the images of such maps.
Definition 2.8. A universal consistent perturbation datum for trees is a choice X T of a smooth family of perturbation data for elements of T I for every sequence I , which is compatible with the gluing maps (2.26) and is invariant under the automorphisms of each tree.
Remark 2.9. The meaning of a smoothness is clarified in Definition 7.1. A priori, each edge in a singular ribbon tree is equipped with at least two perturbation data: one comes from the singular tree, the other from the (smooth) tree wherein the edge lies. Compatibility with the maps (2.26) is the requirement that these two perturbation data agree. The condition of invariance implies that the perturbation datum vanishes whenever there is only one input (because the R translation symmetry forces a non-vanishing perturbation datum to have non-compact support, contradicting the boundedness requirement in Definition 2.6).
Every edge e of a Stasheff tree is isometric to a segment in R. Writing t e for the induced coordinate, we define a (perturbed) gradient flow line on e to be a map ψ e from e to Q i(e),j(e) which is a solution to the differential equation Definition 2.10. A perturbed gradient tree ψ on (T, g T ) with labels I is a continuous map (2.28) ψ : T → Q whose restriction to every edge e ∈ E(T ) lifts to a map which is a gradient trajectory of f i(e),j(e) .
Remark 2.11. One usually imposes a balancing condition at vertices of T ; i.e. the sum of all vector fields associated to edges adjacent to v is required to vanish. This constraint is not part of our setup for gradient trees, and in fact our choices of perturbation data are such that we can choose the vector fields defined by the various edges which share a common vertex to have arbitrary and independent values, as long as the conditions on the boundary of Q 1,2 or Q 2,1 , described in Definition 2.6, are satisfied.
If x ≡ (x 1 , . . . , x d ) is a sequence of critical points of the functions f i k ,i k+1 , and x 0 is a critical point of f i0,i d , and define to be the set of isomorphism classes of perturbed gradient trees ψ such that the image of the k th incoming leaf is x k , and the image of the unique outgoing leaf is x 0 . This moduli space admits a bordification T d (x 0 , x) by adding all singular gradient trees.
We begin by showing that these moduli spaces are compact: Sketch of proof. When studying Morse theory on a manifold with boundary, one must first show that gradient trees cannot escape to the boundary: Claim. There exists a neighbourhood of the boundary of Q i,j whose image in Q is disjoint from the image of every edge e labelled by Q i,j under a gradient tree Proof of claim. The assumption that the perturbation data are consistent implies that there is a uniform (i.e. independent of (T, g T ) in a fixed space T d ) neighbourhood of the boundary Q 1,2 (respectively Q 2,1 ) in which the perturbed gradient flow (2.24) associated to every edge labelled by (1, 2) (or (2, 1)) of a tree in T d is inward (respectively outward) pointing in the sense that it increases the distance to the boundary. In particular, the gradient flows of f 1,2 and f 2,1 are themselves inward or outward pointing in this neighbourhood. By shrinking these neighbourhoods, we may assume that they are identified by the fixed diffeomorphism Q 1,2 ∼ = Q 2,1 . We shall prove that the images of edges labelled by Q 1,2 or Q 2,1 cannot intersect this neighbourhood.
The case of edges labelled by Q 2,1 is simplest. Note that if e is such an edge, then it must lie on a descending arc (e 0 , . . . , e r = e) such that e 0 is an incoming leaf, and each edge of the arc is labelled by Q 2,1 . Assuming by contradiction that the image of e intersects the neighbourhood of the boundary where the perturbed negative gradient flow points inward, we conclude that e 0 is contained in this fixed neighbourhood. This implies that the image of this incoming leaf is a critical point which is also contained in this neighbourhood, which contradicts the fact that f 2,1 has no critical points near the boundary.
If an edge is labelled by Q 1,2 , there are two possibilities: either (i) there is a descending arc (e, e 1 , . . . , e r ) with e r the outgoing leaf such that all edges succeeding e are labelled by Q 1,2 or (ii) there exists a descending arc (e = e 0 , e 1 , . . . , e r ) all of whose edge are labelled by Q 1,2 and an ascending arc (e ′ = e ′ 0 , . . . , e ′ s ) whose edges are labelled by Q 2,1 such that e r and e ′ are adjacent. Using the same argument as in the previous case, we conclude that the critical point of f 1,2 (or f 2,1 ) whither e r (or e ′ s ) limits must be contained in the previously fixed neighbourhood of the boundary of Q 2,1 (or Q 1,2 ) contradicting our assumptions that the gradient flow may not vanish in these regions.
This implies that whenever the image of an edge under a family of gradient trees converges toward the singularities of Q, the edge must be labelled by Q 1,1 or Q 2,2 , so all analysis can be done locally in either manifold. The standard proof of compactness for gradient trees for compact smooth Riemannian manifolds can then be used to prove the desired result, see [8].
The following is the main result proved in Section 7.1: Lemma 2.13. For a generic choice of universal perturbation data, all spaces T d (x 0 , x) are naturally compact topological manifolds with boundary of dimension Remark 2.14. Technically, Q is a smooth non-Hausdorff manifold, with the set of points which cannot be separated from each other diffeomorphic to ∂Q 1,2 . Any local construction for smooth manifolds is valid on Q as long as it performed away from this subset. In addition, if we are working near this subset, and we have additional data that distinguishes one of the sheets, then we may again use standard constructions from the study of smooth manifolds. Note that this is precisely what happens if we are considering an edge of a gradient tree labelled by (i, i) whose image in Q happens to intersect the non-Hausdorff locus; by definition, we have a lift to the relevant (usual) manifold Q i . The key component in the proof of Lemma 2.13 is the Claim appearing in Lemma 2.12 which asserts that there is a neighbourhood of the non-Hausdorff locus of Q which (perturbed) gradient edges labelled by Q i,j with i = j cannot intersect if they form part of a gradient Stasheff tree.
Given a sequence x such that we conclude that the moduli space T d (x 0 , x) consists of finitely many points. The description of this moduli space as a fibre product determines an isomorphism where W u ( x) is the product of the descending manifolds of the critical points x k . Our conventions are explained in Section 8. Whenever ψ is a rigid tree in T (x 0 , x), the above isomorphism and Equation (8.4) give a natural map We define the d th higher product to be a sum over the induced maps µ ψ on orientation bundles where the sign is given by: The following result follows directly from Proposition 2.13 and the proof of the analogous result in Appendix C of [2]. In particular, we define the A ∞ category Morse(Q 1 , Q 2 ) to have objects and morphisms as in Equation (2.22), and (higher) compositions defined by the operations µ M d . Remark 2.16. The orientation convention used in [2] differs in a very minor way from the one introduced here. In particular, Equation (2.38) is a simplification of Equation (C.2) in the previous paper.
2.3. The Fukaya category of the skeleton of a plumbing. On C n equipped with the standard symplectic form, complex structure, and with the coordinates (x 1 , . . . , x n , y 1 , . . . , y n ) = ( x, y), the Lagrangians intersect transversely at the origin. We define the plumbing  to be the open neighbourhood of radius 1 of the union of L 1 and L 2 (in the standard euclidean metric).
We shall now use this local model to construct a Liouville manifold by gluing cotangent bundles: pick a Riemannian metric on Q i whose restriction to a neighbourhood of b i is isometric to the ball of radius 4 in R n with b i mapping to the origin and U i to the ball of radius 2. We obtain a fixed symplectomorphism between an open subset of D * Q i and those points in D * L i consisting of cotangent vectors lying over a point in L i of euclidean norm bounded by 4. By identifying the points of D * Q 1 and D * Q 2 whose images agree in D * L 1 #D * L 2 we obtain a symplectic manifold which is diffeomorphic to the classical plumbing construction in differential topology [14]. We shall write b for the image of b 1 and b 2 in M , and M b for the fixed neighbourhood of b in M along which the gluing is performed and M 1 and M 2 for the two components of the complement of M b in M (these are symplectomorphic to the unit disc (cotangent) bundles of the manifolds obtained by removing balls from Q 1 and Q 2 ).
Since the boundary of M has corners, it is convenient to define a smooth submanifold M in ⊂ M as follows: Choose a convex smooth function χ : [0, +∞) 2 → [0, +∞) which is a small C 0 perturbation of the maximum of the coordinates, and which agrees with this maximum away from a neighbourhood of the diagonal. Writing the squared euclidean norms as ρ( x, y) = (| x| 2 , | y| 2 ) we consider ; an example for n = 1 is shown in Figure 3. The smoothing parameter for ρ should be sufficiently small that the following properties hold: In words the second condition says that, away from the disc of radius 2ǫ in L j , M in 0 agrees with the subset of the cotangent bundle consisting of vectors whose length is bounded by ǫ.
Writing M in i for the set of vectors in T * Q i of length bounded by ǫ which project to points in Q i of distance greater than 2ǫ from b i , we define a smooth manifold with boundary The symplectic form on M can be written as the differential of a primitive θ for which the embedding of each Q i is exact (i.e., the restriction of θ to Q i is the differential of a function). Moreover, the tangent space of M is equipped with a homotopy class of complex volume forms (with respect to any almost complex structure compatible with the symplectic form) whose restriction to the cotangent bundle of Q i is homotopic to a form obtained by complexifying a volume form on Q i . In particular, Q i admits a grading so that the intersection point between Q 1 and Q 2 is assigned a degree; we omit the choice of grading from our notation, but note that it may be normalised so that Definition 2.17. The category Fuk(Q 1 , Q 2 ) is the full subcategory of the Fukaya category of M whose objects are Q 1 and Q 2 .
The existence of an A ∞ category with exact Lagrangians as objects follows from [17]. The construction depends on certain choices of almost complex structures and Hamiltonian perturbations, but the category is independent, up to A ∞ equivalence, of these choices. In order to fix these choices, let us consider a second subdomain M mi of M containing M in , whose construction we shall specify in Section 6 (we shall only use it to prove compactness for a certain moduli space of holomorphic discs entering in the construction of the functor from Floer to Morse theory). We shall now pick Floer data from the following spaces: In the next section we briefly recall how to use perturbations of the∂ equation coming from families valued in J and H in order to construct Fuk(Q 1 , Q 2 ).

2.3.1.
Review of the construction of the Fukaya category. We follow the discussion in [17], keeping our notation as close as possible. First, we must define the morphism spaces (i.e., Floer complexes) This choice determines a perturbed∂ equation on the strip where Y i,j is the Hamiltonian flow of H i,j , and the (0, 1) part is taken with respect to the t-dependent almost complex structure J i,j t . Given a pair (p 0 , p 1 ) of time-1 chords the Hamiltonian flow of H i,j with endpoints on Q j and Q i , we write where the R action comes from translation on the source. Using the fact that the complex structures which are allowed are of contact type near ∂M in , one can use Lemma 7.2 of [3] (see also Lemma 6.1 bellow) to prove the analogue of Gromov compactness and conclude: Lemma 2.19. If the image of Q i under the time-1 Hamiltonian flow generated by H i,j is transverse to Q j , then a generic choice of family J i,j t ensures that all moduli spaces of gradient trajectories R(p 0 , p 1 ) for p 0 = p 1 are regular, and hence of expected dimension Moreover, the Gromov bordification R(p 0 , p 1 ) is compact, and whenever deg(p 0 ) − deg(p 1 ) = 2, it is a manifold with boundary The Floer chain complex is a direct sum of free abelian groups |o p | associated to each time-1 chord p from Q i to Q j for the Hamiltonian H i,j . As the notation suggests, |o p | is the orientation line associated to a rank 1 space o p , whose construction we shall not recall. The key fact we use is the existence of a canonical isomorphism In general, the degree deg(p) of a generator of CF * (Q i , Q j ) is determined by an additional choice of grading on Q i and Q j . This choice has been fixed (up to a global shift) by requiring that the rank 1 group CF * (Q 1 , Q 2 ) is supported in degree 0. Whenever deg(p 0 ) − deg(p 1 ) = 1, λ(R(p 0 , p 1 )) is canonically trivialised by the translative action of R, so Equation (2.49) naturally assigns to each element u of R(p 0 , p 1 )/R a homomorphism µ F u : |o p1 | → |o p0 |. The sum of all such homomorphisms is the matrix coefficient of |o p1 | and |o p0 | in the differential in the Floer complex. Writing [p 1 ] for a generator of |o p1 |, we obtain: To define the A ∞ structure, we must choose perturbation data for moduli spaces of discs with an arbitrary number of marked point. We write R d for the moduli space of holomorphic discs with d + 1 marked points, d of which are marked as incoming, and, given a sequence I = (i 0 , . . . , i d ), R I for a copy of the moduli space R d in which each incoming arc is labelled by an elements of the set {1, 2}; in particular, the incoming marked points are labelled by pairs (i k , i k+1 ), and the outgoing marked point by (i 0 , i d ). This space admits a compactification R I which is a manifold with corners whose points are in bijective correspondence to T I , and in the setup of Equation (2.26), is equipped with maps (2.51) R I 1 × R I 2 → R I which cover its boundary. In addition, we choose strip-like ends {ǫ i k } d k=0 near the marked points of all surfaces Σ in R I ; this choice may be done globally in a smooth family over the moduli space.
Definition 2.20. A perturbation datum on Σ is a choice of an H valued 1-form K I on Σ and a function J I : Σ → J. The pull-backs of these data under a strip-like end corresponding to a marked point labelled (i, j) must agree with the Floer data for the pair (i, j).
A universal perturbation datum for discs (J R , K R ) is a choice of perturbation data for all elements of R I , varying smoothly over the moduli space, and which is consistent; i.e. compatible with the maps (2.51).
The choice of a perturbation datum on Σ defines a perturbed∂ equation analogous to (2.44): the Hamiltonian vector field associated to an element of H and the choice of K I define a vector-field valued 1-form Y I on every surface, so we consider the operator where the (0, 1) part is taken with respect to the almost complex structure J I on the target (and of course the underlying complex structure on Σ on the source).
In particular, given a universal perturbation datum, and a sequence (p 0 , p) = (p 0 , p 1 , . . . , p d ) with p 0 a chord from Q i0 to Q i d , and p k for 1 ≤ k ≤ d chords from Q i k−1 to Q i k (for the appropriate Hamiltonians), we define where the condition on the boundary is more precisely stated as follows: the image of a segment in ∂Σ labelled by i k is contained in Q i k .
The following result generalises Lemma 2.19 to discs with multiple inputs, and follows from the results proved in [17]: Proposition 2.21. For a generic choice of perturbation data, all moduli spaces R(p 0 , p) are regular, and hence have the expected dimension Their Gromov bordifications R(p 0 , p) are compact, and those which have expected dimension 1 are manifolds with boundary.
The gluing theorem for elliptic operators on the disc gives an isomorphism where λ is the top exterior power, and hence every rigid holomorphic disc u determines an isomorphism Writing µ u for the induced map on the orientation lines, we use Seidel's conventions, and define the d th higher product where the sign is given by

From simplicial to Morse cochains
In this section, we construct an A ∞ equivalence The main ingredients in the construction of such an equivalence is the interpretation of the cup product as an appropriate (perturbed) intersection product discussed in Section 2.1, and a moduli space of shrubs S d introduced in [2]; it seems that our spaces are combinatorially equivalent to those later introduced by Forcey [7] under the name composihedra. These moduli spaces are quotients of multiplihedra, and control A ∞ functors from differential graded algebras to A ∞ algebras. From now on, we shall assume The cells ofQ i intersect the boundary ofŪ i transversely, and there are nested weak homotopy equivalences∆ i ⊂ U i ⊂ ∆ i . Moreover, the identification ∆ 1 ∼ = ∆ 2 restricts on U i to the diffeomorphism of Equation (2.20).
In particular for i = j, we obtain a cellular subdivisionQ i,j of Q i,j , which is transverse to the boundary, by pulling back the dual subdivision to Q i , and the diffeomorphism Q 1,2 ∼ = Q 2,1 respects this cellular subdivision.
We shall briefly review the construction of S d , and focus on the choices of perturbation data which are necessary to bypass the transversality problems that would arise if we use only gradient flow lines as in [2].
Definition 3.1. The moduli space of shrubs S d is the space of isomorphism classes of metric ribbon trees (S, g S ) with one infinite outgoing edge, and d finite incoming edges whose endpoints are equidistant to the outgoing edge.
The moduli space of shrubs admits a natural compactification S d by allowing finite edges to become infinite, or incoming edges to shrink to 0 length. The property of equidistance required of the outgoing leaves implies that whenever a sequence in S d converges to a point on the boundary where the length of some finite edge becomes infinite, every path from the outgoing leaf to an incoming one must contain such an edge. We can reconstruct such limit points as follows: whenever r k=1 d k = d we obtain a singular shrub by attaching the outputs of r shrubs (the k th shrub having d k inputs) to a Stasheff tree with r inputs. This construction defines a map Similarly, whenever the length of some incoming edge shrinks to 0, there must be at least one other (adjacent) edge which is also collapsed, so that we have for each integer k between 1 and d − 1 a map obtained by grafting a pair of edges of length 0 at the k th external vertex. The following result appears in Appendix B of [2]: The moduli space S d is a compact manifold with boundary whose boundary is covered by the images of the maps (3.3) and (3.4).
As in the previous section, a sequence I induces a unique labelling, compatible with the cyclic order, of all edges by pairs (i(e), j(e)), such that the incoming edges are labelled by (i k , i k+1 ). Moreover, the maps (3.4) and (3.3) have their analogues for labelled shrubs where the labels on the output of a shrub in S I k agree with the labels of the k th incoming leaf of a Stasheff tree in T R . A choice of I determines a gradient flow equation on every edge of a shrub (S, g S ), which we perturb as follows: Definition 3.3. A universal consistent perturbation datum for shrubs is a choice X S of a smooth family of perturbation data on I S I which are compatible with the maps (3.5) and (3.6).
The discussion of smoothness is relegated to Section 7.1. Recall that the definition of a perturbation datum requires that the resulting perturbed negative gradient flow be outward (respectively inward) pointing on the boundary of Q 1,2 (respectively Q 2,1 ). The choice of dual cell subdivision gives another condition Definition 3.4. A universal perturbation datum is compatible withQ if, whenever e k and e k+1 are successive incoming leaves of length 0 in a shrub (S, g S ), the vector field By Condition (3.2) the behaviour of the (perturbed) gradient flow near the boundary is compatible with a requirement that the vector field be simplicial. Indeed, the restriction of the tangent space of Q i,j to every cellτ ofQ i,j contains an open cone C τ consisting of vectors pointing in the direction of the top dimensional cell adjacent toτ which is minimal with respect to the ordering; the simplicial condition is the requirement that the restriction of a vector field toτ lie in C τ . As the boundary of C τ is covered by the tangent spaces of the codimension 1 faces meeting atτ , Tτ is included in its closure. Since ∂Q i,j intersectš τ transversely, we conclude that the tangent space of the boundary separates C τ into two non-empty open components. Assuming that f i k ,i k+1 , f i k−1 ,i k and X e k have been chosen already, we can always choose X e k+1 deep inside the appropriate cone so that (3.7) is a simplicial vector field. Lemma 3.5. There is a non-empty open subset of the space of universal consistent perturbation data for shrubs which consists of data that are compatible withQ.
Proof. Since universal perturbation data are constructed inductively, it suffices to see that the compatibility condition on S I does not restrict the choice of perturbation data for S I ′ whenever I ′ is a subset of I . This is essentially obvious since our perturbation data on each edge are chosen independently of each other, and the compatibility condition restricts edges in S I which do not exist in S I ′ .
From now on when we speak of a universal perturbation datum for shrubs, we shall assume that it is compatible withQ. With the choice of such a datum, we can now define the moduli spaces which shall be used to construct the functor of Equation (3.1). Let us write σ = (σ 1 , . . . ,σ d ) for a sequence of cellsσ k ∈Q i k ,i k+1 , and x 0 for a critical point of f i0,i d : Definition 3.6. The moduli space S(x 0 , σ) of (perturbed) gradient shrubs with inputs σ and output x 0 is the set of maps The moduli space S(x 0 , σ) admits a natural stratification coming from the stratification of S d by the topological type of the tree, and a bordification S(x, σ) by allowing edges to become infinite. In particular, we have a subset consisting of maps whose domain lies in the image of the inclusion of Equation (3.6); i.e. singular shrubs whose k and k + 1 st incoming edges both have length 0.
Lemma 3.7. If the cup product ofσ k andσ k+1 vanishes, then there is a neighbourhood of the image of ∨ k in int S I whose inverse image under the forgetful map is empty. In particular, this stratum of S(x 0 , σ) does not lie in the closure of the top dimensional part of the moduli space S(x 0 , σ).
Proof. The proof is completely local. A slight generalisation of Lemma 2.3, implies that the condition that the cup product ofσ k andσ k+1 vanish is equivalent to the absence of intersection points between the images ofσ k under a flow φ k andσ k+1 under a flow φ k+1 , whenever φ k and φ k+1 are generated by sufficiently small vector fields X k and X k+1 whose difference is compatible with the simplicial triangulation. If (S, g S ) is a singular shrub with sufficiently short incoming edges e k and e k+1 , the flows obtained by integrating the perturbed gradient vector field along these edges satisfy this property due to our assumption that the perturbation datum X S is smooth and compatible with the subdivisionQ. The desired result follows immediately.
We also need a compactness result analogous to Lemma 2.12 Proof. Again, it suffices to prove that no edge labelled by Q 1,2 or Q 2,1 may escape to the boundary, which can be done in three case, of which we explain only one. We fix a neighbourhood of the boundary of Q 2,1 which does not intersect the cell dual to the interior of ∆. Assuming that the image of an edge e labelled by Q 2,1 intersects this neighbourhood, we follow an ascending arc all of whose edges are labelled by Q 2,1 , and derive the contradictory conclusion that an input cells labelled by (1, 2) intersects a neighbourhood of the boundary of Q 2,1 .
In Section 7.1, we explain how to prove: is compact, and for generic universal perturbation data, all strata are smooth manifolds of the expected dimension. Moreover, the closure of the top-dimensional strata is a compact manifold with boundary of dimension which we denoteŜ(x 0 , σ).
We now restrict attention to the case where the moduli space of shrubs is rigid, i.e. to a sequence of cells σ and a critical point x 0 such that (3.12) deg The description of the moduli space of shrubs as a fibred product (see Section 8.3) gives an isomorphism where the last factor on the right hand side is a tensor product Using the isomorphism we conclude that a rigid shrub ψ ∈ S d (x 0 , σ) determines an isomorphism Writing F ψ for the induced map on the orientation line, the d th order map in our functor from the simplicial to the Morse category is defined via the formula (3.18) where the sign †( σ) is determined by a choice of orientation on the moduli of shrubs. With our sign conventions, we would find To illustrate the case of one input, let us fix a simplex σ 1 of Q i,j , and a critical point x 0 of f i,j such thatσ 1 and W s (x 0 ) intersect transversely. At every such intersection point ψ, we have an isomorphism which, upon using the decomposition (3.15) yields an isomorphism The sign from Equation (3.19) is equal to in this case, which determines the contribution of ψ to the map To prove that this is a chain map, we must consider, as usual, 1-dimensional moduli spaces of shrubs with one input. This occurs whenever we are given a critical point x 0 such that (3.24) deg(x 0 ) = deg(σ 1 ) + 1.
Since the space S(x 0 ,σ 1 ) is the closure of the intersection ofσ 1 with W s (x 0 ), its boundary is easily seen to consist of two strata: either (i) a family of gradient trajectories from x 0 escapes to a cellσ 0 on the boundary ofσ 1 , or (ii) a family of such trajectories converges to a broken one, corresponding to the concatenation of an ascending gradient flow line from x 0 to a critical point x 1 of degree equal to deg(σ 1 ), followed by a gradient flow line from x 1 tǒ σ 1 . These two configurations correspond to the two terms whose equality implies that F 1 is a chain map: To prove the correctness of the signs, we note that we have a natural isomorphism which we must compare with the isomorphisms (3.20) and (8.2) when we pass to the compactification S(x 0 ,σ 1 ).
First, we obtain an isomorphism from Equation (8.2) and (8.4). The result of taking the tensor product with the two sides of Equation (3.20) gives: The reader may easily check that the gluing theorem for gradient flow lines gives an isomorphism λ(R) ∼ = λ(S(x 0 ,σ 1 )) near a broken trajectory, with the positive direction in R corresponding to the outward pointing normal vector. In order to pass from this to the isomorphism (3.26), we must switch some factors taking care to record the appropriate Koszul signs: (1) Permute the first copy of λ(W s (x 1 )) past λ(R), introducing a parity change of deg(σ 1 ), then (2) permute the two factors of λ(W s (x 0 )) ⊗ λ(W s (x 1 )), introducing a sign equal to deg(x 0 ) deg(x 1 ), which vanishes modulo 2, then (3) cancel the λ(W s (x 1 )) factors on either side.
The result of the operations above is exactly the isomorphism of Equation (3.26), with a change in signs given by the parity of deg(σ 1 ).
We must now analyse the same problem near the other type of boundary strata. Near such a stratum, we have a natural isomorphism between λ(S(x 0 ,σ 1 )) and the normal vector of the boundary toσ 1 . In particular, Equation (3.26) gives an isomorphism which, after introducing a sign with parity deg(x 0 ) = deg(σ 1 ) + 1, gives exactly the isomorphism of (3.20) for the boundary of σ. Note that this would naively seem to imply that F 1 satisfies the desired equation, since the two types of boundary strata have opposite relative orientations.
Unfortunately, there are additional signs coming from (i) the signs in formulas (8.7) and (2.16) for the differentials in the Morse and simplicial categories and (ii) the sign in the definition of the map F 1 . Remark 2.2 explains that the sign introduced in the definition of Simp(Q 1 , Q 2 ) contributes a −1 to the total formula because it corrects for the fact that duals cells do not have compatible orientations on their boundaries. On the other hand, both the Morse differential and F 1 contribute (−1) n and (−1) n+1 respectively, so the artificial signs we have introduced cancel in this case. The generalisation for higher products, gives: Proposition 3.10. The maps of Equation (3.17) define an A ∞ equivalence. In particular, F 1 is a chain map inducing an isomorphism on cohomology, and Proof. The claim that F 1 is a chain isomorphism is the familiar statement that the cohomology of smooth manifolds can be computed using Morse theory. To prove the A ∞ equation (3.30), we study, as usual, moduli spaces S(x, σ) of expected dimension 1. By Lemma 3.9 the closure of the interior of this moduli space is a 1-dimensional manifold with boundary projecting to the interior or top dimensional strata of the boundary of S d (this follows from the fact that all strata of S(x, σ) are of the expected dimension, hence that those lying over higher codimension strata of S d are empty).
It suffices to check that the boundary points ofŜ(x, σ) account for all the terms of (3.30). The first sum in the left hand side of (3.30) corresponds to boundary points ofŜ(x, σ) which project to the interior of S d . The top dimensional boundary strata of S d are of two types: those which are the image of (3.3) correspond to the right hand side of (3.30), and we claim that the second term of the left hand side of that equation correspond to those points which project to the image of (3.4) and are in the closure of S(x, σ). Indeed, points in S(x, σ) lying over the image of (3.4) correspond to S(x, σ ∩k ), where σ ∩k is obtained from σ by replacing the cellsσ k andσ k+1 by their intersection. Lemma 3.7 implies that whenever this intersection does not contribute to the cup product, the corresponding cell does not lie in the boundary ofŜ(x, σ), so, modulo signs, the Proposition follows from the next Lemma. We briefly discuss signs and orientations in Section 8.3.
Proof. For the purpose of this argument we introduce a moduli space consisting of ribbon trees satisfying all the conditions for being a shrub except that the distance from the outgoing edge to the incoming leaves numbered k and k + 1 are smaller by ǫ than the distances to the other incoming vertices. Note that the regularity of S(x, σ ∩k ) and the implicit function theorem imply that, whenever ǫ is sufficiently small, we have a bijective correspondence between its elements and those of S k,ǫ (x, σ ∩k φ ), where σ ∩k φ is obtained from σ ∩k by replacingσ k ∩σ k+1 by its image under a diffeomorphism sufficiently close (in the C 1 norm) to the identity, and keeping all other cells unchanged. Using the fact that our chosen perturbations are compatible with the subdivisionQ, we find that whenever k+1 are the diffeomorphisms obtained by integrating the perturbed gradient flow along the respective incoming leaves. Moreover, as (S, g S ) converges to the relevant boundary stratum of S d , the map φ S,gS k,k+1 may be chosen to converge to the identity. Writing ǫ k (S, g S ) for the length of the k th incoming leaf, the claim follows by noticing that the elements of are in bijective correspondence with the elements of the top dimensional stratum of S (S,gS ) (x, σ) which are sufficiently close to S(x, σ ∩k ).

A convenient model for Multiplihedra
Boardman and Vogt [5] introduced spaces of "colored trees" as a model for multiplihedra; this collections of polyhedra controls A ∞ functors. Since our goal in later sections is to construct an A ∞ functor whose source is the Fukaya category, it seems reasonable to replace one of the trees by holomorphic discs. Keeping relatively close to our previous botanical terminology, we shall call these spaces moduli spaces of mushrooms.
which is a disc with d k +2 marked boundary points of which d k successive ones are distinguished as incoming, and (3) a stem S(C), which is a a shrub with k inputs.
Remark 4.2. Sometimes, it shall be convenient to discuss caps separately. By a d-cap, we will simply mean a disc with d + 2 marked points of which d successive ones are distinguished as incoming. Alternatively, we can distinguish the pair of outgoing vertices, or the arc connecting them. The moduli space of caps P d is simply the (open) Stasheff moduli space T d+1 under another guise. Later, we shall find it convenient to fix the identification with the moduli space of discs R d+1 for which the boundary marked point v out 1 in Figure 4 is mapped to the (unique) outgoing marked point for discs in R d+1 . Figure 4. The unique mushroom with one input, with cap P and stem S.
Remark 4.3. Even though we will draw mushrooms as in Figure 4, we remind the reader that the incoming vertices of the stem are not associated to a marked point on the outgoing arc.
An isomorphism C → C ′ of mushrooms is an isomorphism of the underlying caps and stem. Explicitly, such a map is a collection of r + 1 isomorphisms: The only non-trivial automorphism of a mushroom is the identity.
Proof. Such an automorphism would correspond to an automorphism of the stem or of one of the caps. However, we have excluded discs with less than 3 marked points as caps.
By definition, the set C of mushrooms with d inputs admits a bijective map to (4.1) S r × P d1 × · · · × P dr which we later use to define a topology. Recall that whereas the moduli space T d is an open manifold, the moduli space of shrubs is a (non-compact) manifold with boundary (the boundary consists of trees with outgoing edges of vanishing length). Note that the dimension of the components of (4.1) depends only on the number of inputs: Definition 4.5. A singular mushroom with d inputs is defined by the following data for each integer 1 ≤ k ≤ r, a cap, which is a singular disc with d k + 2 marked boundary points with a distinguished arc connecting two successive (outgoing) marked points, and (3) a stem, which is a singular shrub with r inputs.
Remark 4.6. Again, we consider singular caps whose moduli spaces P d can be identified with the Stasheff polytopes in their holomorphic disc model R d+1 . Decomposing a singular cap into its irreducible components, we observe that those components whose boundary intersects the distinguished arc can themselves be interpreted as lower dimensional caps. Not all irreducible components are of this type (See Figure 5).

Figure 5.
A singular cap consisting of two caps and an "ordinary" disc.
As usual, we will focus attention on stable singular mushrooms. These are characterized by stable caps and stem. As before, we can write this space as S r × P d1 × · · · × P dr .
However, it is natural to think of the moduli space of stable singular mushrooms as a quotient of this space.
For each d ′ and d ′′ , we consider the embedding • whose image is the stratum of ∂P d ′ +d ′′ consisting of discs which can be decomposed into two components (not necessarily irreducible), each of which contains an outgoing marked point, and which have respectively d ′ and d ′′ incoming marked points.
On the other hand, for each integer 1 ≤ k ≤ r − 1, we have a map ∨ k : S r−1 → S r which creates two incoming edges of vanishing length at the k th vertex. We therefore have maps We say that two stable singular mushrooms are equivalent if they are identified upon gluing along the maps ∨ k × id and id × • × id. We write ∼ for the equivalence relation generated by all such diagrams: We will equip C d with its inherited topology as a subset of C d . The spaces C d admit two important families of maps of operadic type relating them to the other moduli spaces we have studied. On the one hand, by grafting r mushrooms at the endpoints of a Stasheff tree, we obtain a map Alternatively, by attaching a singular disc at any of the incoming marked point, we obtain d 1 maps The moduli space R d+1 is stratified by cells labelled by topological types of ribbon trees with d + 2 leaves, which induces a stratification of P d . When considering this latter space, we shall assume that two such successive leaves are distinguished as outgoing. Note that the trees in which the two outgoing leaves are not adjacent (i.e. share a vertex) are exactly those that label singular caps whose outgoing edge meets more than one irreducible component. The reader may compare this constraint with the condition imposed by Boardman and Vogt on their coloured trees [5] (see also, [7]), which shows that our moduli space C d is homeomorphic to the multiplihedron of the same dimension. Moreover, the homeomorphism may be chosen so that the maps (4.3) and (4.4) are the operadic structure maps which make multiplihedra into a bimodule over the Stasheff operad. We conclude: Lemma 4.8. C d is a compact manifold with boundary stratified into finitely many (smooth) manifolds with corners. The top boundary strata are the images of the map (4.3) and (4.4) (See Figure 6).
Note that the top boundary strata of C d are the boundary strata of S r × P d1 × · · · × P dr which are not identified by the equivalence relation. In fact, the top boundary strata which are identified by the equivalence relation are exactly those for which a pair of successive external edges have vanishing length. It is easy to check that the remaining strata are exactly as described above.
As with trees (and discs), this construction can be done with labels. Given a sequence I = (i 0 , . . . , i d ), we shall consider the moduli space of mushrooms labelled by I , denoted C I , which is a copy of C d . We start by setting P I k to be a copy of P | I |−1 where the incoming arcs are labelled by the sequence I k , which allows us to define C I to be the quotient (under the identification of used in Definition 4.7) of the disjoint union (4.5) S R × P I 1 × · · · × P I r where the initial elements of I k agrees with the last element of I k−1 , the sequence I is obtained by concatenating I 1 through I r and dropping the redundant terms, and R is the sequence of length r + 1 obtained by taking i 0 together with the last elements of I 1 through I r . Whenever R and ( I 1 , . . . , I r ) are any sequences satisfying this condition, we obtain a map (4.6) T R × C I 1 × · · · × C I → C I which is the analogue of (4.3) in the presence of labels. The analogue of Equation (4.4) is a map where I is obtained from I 1 and I 2 as in Equation (2.26). This later map is induced by a map (4.8) Finally, the gluing operation (4.2) also has a labelled analogue (4.9) P I 1 × P I 2 → P I where the last element of I 1 is assumed to agree with the first element of I 2 , and I is obtained by concatenating the two sequences, and dropping the repeated term.

From Floer to Morse cochains
In this section, we construct a functor using "moduli spaces of mushrooms maps" which we shall define in Section 5.3, and a Lagrangian foliation on the plumbing, parametrized by Q, which we shall define in Section 5.1 (recall that Q is the space obtained by gluing Q 1 and Q 2 along open balls). Informally, a mushroom map consists of a gradient tree whose source is the stem, and a holomorphic map with Lagrangian boundary conditions on each cap. The Lagrangian condition on the boundary components connecting incoming vertices (or an incoming vertex and an outgoing one) will be one of the Lagrangians Q i that we have been studying. The outgoing boundary component of a cap (the one connecting the two outgoing vertices) will be required to map to a leaf of the Lagrangian foliation on M whose label (a point in Q) agrees with the image of the corresponding endpoint of the stem. From now on, we shall assume: The open sets U i used to define the Morse category are the images of the balls of radius 2 in R n under the charts used in Section 2.3.

A Lagrangian foliation.
Returning to the local model of Section 2.3, we find that the submanifold is also Lagrangian, and given x ∈ R n , we let ( x, 0)+ L ∆ denote the translate by ( x, 0) of L ∆ ; the union of all such leaves is a foliation of C n . Note that a fixed leaf ( x, 0) + L ∆ intersects L 2 transversely at (0, − x). Using Stokes's theorem to integrate the action of a path from L 1 to L 2 along ( x, 0) + L ∆ , we conclude: Lemma 5.1. The integral of ω over any disc with counter-clockwise boundary conditions (L 2 , L 1 , ( x, 0) + L ∆ ) is proportional to −|x| 2 ; in particular no such disc is holomorphic if x = 0, in which case only constant ones arise.
A minor deficiency with this model is that it differs from the standard fibration of C n as the cotangent bundle of L 1 or L 2 , so we must modify it in order to extend it to M . We write L for the result of gluing L 1 to L 2 along the identification of their balls of radius 1 about the origin under the diffeomorphism This space is a local model for Q in the sense that there is an open subset of Q, containing all non-Hausdorff points, which is diffeomorphic to L, and which maps L 1 to the image of Q 1 and L 2 to the image of Q 2 .
We would like to define a foliation of D * L 1 #D * L 2 , whose leaves L ℓ are Lagrangian discs parametrised by ℓ ∈ L. and such that the following essential properties hold  The first condition gives the correspondence between leaves and points of L, while the second implies that this foliation agrees with the canonical foliation of the cotangent bundles of L 1 and L 2 away from a neighbourhood of the origin, and hence can be extended to M . In addition, we require three technical conditions which will be used to prove compactness for moduli spaces of holomorphic curves (see Section 6), and which depend on parameters ǫ ≪ δ which can be made arbitrarily small; ǫ already appeared in the construction of M in The reader should consult the picture on the right of Figure 7 which illustrates the case n = 1. To see the fact that the leaves are parametrised by L, note that, in the second and fourth quadrant, there are two leaves passing through the corner point; these form the non-Hausdorff locus of the space of leaves L.
In order to construct L, we choose any monotone function κ : [2,4] → [0, 1] which is identically 1 near 2 and identically 0 near 4 and whose derivative is uniformly bounded by 1, and consider the affine Lagrangian planes The proof that these planes do not intersect each other in D * L 1 #D * L 2 , and hence form a foliation, is an elementary computation left to the reader (see the left side of Figure  7). Note that this foliation satisfies all but Condition 5.5 above. In order to ensure that the leaf corresponding to a vector x 0 whose norm lies between 4ǫ and 4 intersects M in in Lagrangian planes orthogonal to L 1 and L 2 , we deform this foliation by affine Lagrangians using an appropriate Hamiltonian flow. The existence of such a flow can be proved, for example, by noting that the region 3ǫ < | x| < 4 and | y| < ǫ (5.9) carries a unique function H 0 which vanishes along L 1 , and whose restriction to any leaf (5.8) has differential that agrees with the restriction of − (x i − x 0 i )dy i ; we can write its restriction to a leaf explicitly: We define H T implicitely via the property that it also vanishes along L 1 and that the restriction of H T to the image of a leaf under the flow φ T generated by the Hamiltonians {H t } t≤T also has differential agreeing with the restriction of − (x i − x 0 i )dy i . The reader may easily check that the image of each leaf under φ T is a linear Lagrangian, passing through the same point of L 1 , and that the norm of the restriction of (x i − x 0 i )dy i to each leaf decreases with T . Whenever T = 1, we find that the image of each leaf is in fact orthogonal to L 1 . We extend H T to a function on M so that it satisfies the analogous conditions in the region 3ǫ < | y| < 4 and | x| < ǫ (5.10) and define the new foliation L to be the image of (5.8) under φ 1 . More precisely, we require H T to have support contained in a 4ǫ neighbourhood of the union of the regions (5.9) and (5.10), and have C 0 and C 1 norms bounded by (say) 2ǫ. These support conditions imply that L inherits the remaining conditions from the foliation (5.8). Choosing ǫ ≪ δ implies that the estimate of Lemma 5.1 applies to L as well: Lemma 5.2. The integral of ω over any disc with counter-clockwise boundary conditions (L 2 , L 1 , L ( x,0) ) is strictly negative if δ ≤ | x|.

5.2.
Moduli spaces of caps. In this section, we will discuss moduli spaces of maps from caps to the plumbing of two cotangent bundles. Strictly speaking, the setup we will be using is not exactly the one we will later need to establish the desired results about maps of mushrooms. However, since all the main ideas are already present and the notation is much simpler, we will start here. Condition (5.2) identifies Q 1,2 and Q 2,1 with balls of radius 2 in flat Euclidean space. We assume that the metrics on Q 1 and Q 2 restrict to this flat metric in U 1 and U 2 . The first step is to impose a final condition on the perturbation H i,j and the Morse functions f i,j : The image of Q i under the time-1 Hamiltonian flow of H i,j agrees with the graph of the differential of f i,j , in a neighbourhood of Q i ∩ Q j which is identified with a (small) disc cotangent bundle of Q i,j using the foliation L q . Moreover, the images of Q 1 and Q 2 under the time-t Hamiltonian flow of H i,j are transverse to all leaves L q if |t| ≤ 1. Finally, all critical points of f i,j have distinct values.
Note that when i = j, these conditions may easily be achieved by taking any (sufficiently small) generic function H i,i . The image of Q i under such a map may be written uniquely up to a global constant as the graph of the differential of a function f i,i . The same strategy works for i = j once we observe that L 2 (in C n ) is the graph of the differential of | x| 2 as a function on L 1 with respect to the linear foliation (0, x) + L ∆ , of which L q is a small perturbation. In particular, if we choose H 2,1 = H 1,2 = 0, we conclude: Lemma 5.3. The distance to b grows along gradient flow lines of f 1,2 (and decreases along gradient lines of f 2,1 ) in the subset of U 1 (respectively U 2 ) where this distance is greater than δ.
Assumption (5.11) establishes a correspondence between critical points of f i,j and intersection points of the corresponding Lagrangians, which implies: There is a bijective correspondence between the generators of CM * (f i,j ) and those of CF * (Q i , Q j ).
Floer proved in [6] that, for an appropriate choice of almost complex structure, this correspondence becomes a chain isomorphism. Instead of using this result directly, we shall exhibit a chain equivalence, which will be the first term of an A ∞ functor: Fix a cap P ∈ P I for a sequence I of length d + 1. To each point (z, q) of ∂P × Q, we can associate a Lagrangian L ⊂ M as follows: • If s lies on the outgoing segment, we let L = L q , • otherwise, orienting the disc counterclockwise starting at the outgoing segment, L = Q j if s lies on the j th segment.
Let us assume, as in [17, Section 9g], that we have chosen a universal consistent choice of strip-like ends on the moduli space of discs, i.e. a choice of strip-like end on every stable holomorphic disc which is compatible with gluings for small parameters. Note that the isomorphism P d ∼ = R d+2 therefore determines a choice of strip-like ends on the cap P . In addition, for points sufficiently close to the boundary of P d , we obtain a decomposition into a thin part (obtained as the image of a strip-like end) and a thick part (the complement). The thin part decomposes as a union of strip-like ends with the images of maps This is a reasonable assumption because L q intersects Q i transversely at a single point. No breaking of holomorphic strips can therefore occur, so one need perturb neither the complex structure nor the Lagrangians in order to avoid it.
Definition 5.5. A Q-parametrized perturbation datum on P is a pair (K I , J I ) where We require that (i) the restriction of the perturbation data (K I , J I ) to the thin part agrees with the labelling Floer data and (ii) if (z, q) ∈ ∂P × Q is labelled by the Lagrangian L, then for each tangent vector ξ ∈ T z ∂P , we have K I (z, q)(ξ)| L ≡ 0.
In other words, we choose a family of almost complex structures J I on M parametrized by Q and by the points of the disc P , which are required to agree with the choices made in defining the Fukaya category near the incoming marked points, and with J q near the outgoing points. We also choose a family of 1-forms K I on P , parametrized by Q, and with values in the space of functions on M . The 1-forms are also compatible with the Hamiltonian perturbations used to define the Fukaya category.
Note that K I (z, q)(ξ) induces a Hamiltonian vector field Y I (z, q)(ξ). Given such a datum, for each q ∈ Q we can therefore consider the perturbed Cauchy-Riemann equation on P : where the (0, 1) part is taken with respect to the almost complex structure J I (z, q), and the Lagrangian boundary conditions are prescribed by the labels.
Definition 5.6. A Q-parametrized perturbation datum on a singular d-cap P is the choice of a Q-parametrized perturbation datum on each irreducible component.
As the Fukaya category requires counting curves parametrised over the moduli space R d , we consider the analogous generalisation for caps: Definition 5.7. A universal Q-parametrized perturbation datum for caps (K P , J P ) is a choice of a Q-parametrized perturbation datum for each singular cap P , smoothly varying with respect to the modulus, and which is compatible with the perturbation data (K R , J R ) and the maps (4.8) and (4.9).
Remark 5.8. The compatibility condition can be stated explicitly as follows: Every component of a singular cap in the image of the maps (4.8) or (4.9) is a priori equipped with two perturbation data, one coming from being the component of a disc or cap in a factor of the source, the other from being the component of a cap in P I . We require these data to agree.
The proof of the following result follows immediately from the inductive method of proof for the analogous Lemma 9.5 of [17].
Lemma 5.9. Every perturbation datum on a fixed (smooth) cap may be extended to a universal perturbation datum.
denote a sequence of time-1 Hamiltonian chords of H i k−1 ,i k points starting at Q i k and ending on Q i k−1 In addition, we will denote the point of intersection L q ∩ Q i by q i .
Definition 5.10. The moduli space of caps with inputs p is the space P( p) = q∈Q P q ( p) of solutions to the perturbed Cauchy Riemann equation (5.14) with incoming marked points mapping to p and outgoing marked points mapping to q i0 and q i d which project to the same point q ∈ Q.
In Section 7.2 we prove transversality for the moduli space of caps: Lemma 5.11. For a generic choice of universal consistent Q-parametrized cap perturbation data, P( p) is a smooth manifold. More generally, any stratum of P( p) consisting of a single cap (and an arbitrary number of discs) has the expected dimension, and, if N ⊂ Q is a submanifold, the projection map P( p) → Q (at every smooth point of the source) is generically transverse to N on every such stratum.
We shall also prove compactness in Section 6, by appropriately generalising Lemma 5.1: Lemma 5.12. Whenever i 0 = i d or (i 0 , i d ) = (2, 1), the Gromov bordification P( p) is compact. In the second case, P q ( p) is in addition empty whenever q lies more than 4ǫ away from b. (1, 2), then the Gromov bordification of the moduli space of caps with boundaries on leaves corresponding to points within 4ǫ of q is compact.

Mushroom maps.
Given the seeming complexity of the definitions coming up, a word of explanation is in order. Naively, a mushroom map is simply a holomorphic map defined on each cap together with a gradient tree satisfying certain compatibility conditions. Let us fix the homeomorphism type of a tree S with r inputs, and a sequence of integers d j such that d j = d. Assume we have fixed in addition, a sequence of labels I of length d, a sequence p = p 1 ∪ · · · ∪ p r of Hamiltonian chords with endpoints on the Lagrangians Q i k−1 and Q i k , and a critical point x 0 of f i0,i d . Each sequence p k determines a subsequence I k of I , whose elements we denote {i k j } d k j=1 .
We would have liked to define the space of mushroom maps with inputs p, output x 0 , and fixed topological type as a fibre product j } is the sequences of labels for the incoming segments of an element of P( p j ). Whenever S has no incoming leaves of vanishing length, one may easily choose perturbation data on the moduli space of shrubs and caps once and for all, so that all such fibre products are transverse (we shall see later how the lack of Hausdorffness is circumvented). However there is no way to achieve transversality in this way for the stratum shown in Figure 8 whenever some of the caps have the same inputs. The main observation (we used a similar trick in achieving regularity for the moduli space of cascades in [3]) is that there is no reason for the perturbation data on the various caps of a fixed mushroom to be defined in exactly the same way. In particular, even if all the caps of the mushroom shown in Figure 8 have marked points labelled by the same Hamiltonian chords, our setup will allow up to choose different perturbation data for each of them, thereby making transversality easy to achieve. The rest of this section implements this idea, which we shall return to repeatedly (see in particular Remark 5.20 and the discussion following Lemma 7.14) We first consider a simplest case of a mushroom with one input whose incoming boundary segments are labelled (i 0 , i 1 ). Definition 5.13. A Q-parametrized perturbation datum on the unique mushroom with one input is the choice of (i) a family of almost complex structures in J parametrised by a disc with three punctures, agreeing with the respective complex structure at the end and (ii) a closed 1-form γ on the cap with three punctures whose pullback under the positive end with boundary labels (Q i0 , Q i1 ) and the negative end with boundary (Q i0 , L q ) agrees with dt, and which vanishes near the remaining end.
In this case, we fix the Hamiltonian perturbation datum as If we have more inputs, we shall also require a perturbation of the stem. Recall that a labelling I of the inputs of a mushroom C is equivalent to the data of compatible labellings I k of all caps, and R of the stem. In particular, each edge of the stem is equipped with a gradient flow equation which we shall have to perturb. Unlike the usual setup, we shall allow the Floer data on the ends meeting the outgoing segment of a cap to vary depending on the modulus. This does not cause any difficulties as no breaking of holomorphic strips can happen at these ends.
Definition 5.14. A Q-parametrized perturbation datum on a singular mushroom C is the choice of (i) a gradient perturbation datum on the stem of C and (ii) a Q-parametrized perturbation datum on each (possibly singular) cap such that (5.17) The Floer datum for (L q , Q i,d ) and (Q i0 , L q ) is given by the constant choice of Condition (5.13) with the following exception: If the j th cap has exactly 2 incoming segments with Lagrangian labels (Q i0 , Q i1 ), then the Hamiltonian perturbation associated to the end (Q i0 , L q ) is given by multiplying H i0,i d by a non-negative constant which is bounded by 1. This constant vanishes whenever the j th incoming leaf of the stem is short (say, has length less than 10) and equal 1 whenever it is sufficiently long.
Remark 5.15. The perturbation of the gradient flow need not be compatible with the simplicial subdivision Q as it was in Section 3. However, we still require that the gradient flow be transverse to the boundary of Q i,j (and pointing in the appropriate direction).
Remark 5.16. The constraint (5.17) is designed to achieve two things: (i) whenever a mushroom with a single input breaks off, we need the perturbation datum to agree with the one chosen in Definition 5.13 and (ii) whenever two successive incoming edges of the stem have vanishing length, we require vanishing Floer data in order for the gluing theorem to hold.
Of course, the perturbation datum is not strictly speaking parametrized by Q anymore, but rather by Q r . For the next definition, we fix, as before a sequence p = (p 1 , . . . , p d ) of Hamiltonian chords with endpoints on Q 1 and Q 2 and a critical point x 0 of f i0,i d .
Definition 5.17. A singular mushroom map Ψ with inputs p and output x 0 is a collection of maps where Ψ S is a (singular) perturbed gradient tree (as in Definition 3.6), and Ψ j are finite energy solutions to the perturbed Cauchy-Riemann equation (5.14) on the relevant (possibly singular) caps satisfying the following conditions (1) If the k th incoming vertex lies on P j (C), then Ψ j converges on the corresponding end to p k , and the incoming boundary segments of P j (C) are mapped to the labelling Lagrangians. (2) The outgoing arc on P j (C) is mapped to L ΨS (vj ) , where v j is the j th incoming leaf of the stem.
Note that the last condition and the removal of singularities theorem forces the outgoing marked points of the j th cap to be mapped to the lifts of Ψ S (v j ) to the appropriate manifold The next result is the main tool in establishing compactness for maps of mushrooms: Lemma 5.18. The image of every cap of a singular mushroom map is contained in a compact subset of M , and every edge of a stem labelled by (i, j) with i = j is mapped to the ball of radius δ in Q i,j . In particular, if the distance between q and b is greater than δ, there is no mushroom map admitting a cap whose first and last labels differ, and whose boundary condition on the outgoing arc is L q .
Proof. The proof is a combination of Lemma 5.12 and the proof of Lemma 2.19. We focus on the case of a cap P j (C) whose first segment (in the counterclockwise order as usual) is mapped to Q 1 , and penultimate one to Q 2 (Lemma 5.12 excludes the other possibility).
As in the proof of Lemma 2.19, we find that either (i) there is a descending arc on the stem S(C), starting at the j th incoming leaf of S(C) and ending on the outgoing edge, all of whose edges are labelled (1, 2) or (ii) there is an arc from the j th incoming leaf of S(C) to another leaf meeting an incoming cap P j ′ (C) which can be broken into a descending arc with edges labelled (1, 2), followed by an ascending arc with edges labelled by (2, 1). Since the perturbed negative gradient flow along an edge labelled by (1, 2) points outward (and inward for edges labelled by (2, 1)), we conclude that the critical point of f 1,2 which is the output of our mushroom map (or the image of the cap P j ′ (C) under the projection to Q 2,1 ) lies outside the ball of radius δ about the base point in Q 1,2 (or in Q 2,1 in the second case). This contradicts our assumption (5.11) on the gradient flow f 1,2 , or Lemma 5.12 applied to the cap P j ′ (C).
Following the construction for discs and trees, we shall consider perturbation data varying with the modulus of the mushroom: Definition 5.19. A universal consistent Q-parametrized perturbation datum for mushrooms is a choice (X C , K C , J C ) of Q-parametrized perturbation data for each singular mushroom C, varying smoothly in each stratum of C, and which is compatible with (i) the maps (4.7) and the perturbation data (K R , J R ) used to define Fuk(Q 1 , Q 2 ) and (ii) the maps (4.6) and the perturbation datum X T used to define Morse(Q 1 .Q 2 ). Moreover, whenever the incoming leaf of the stem meeting a given cap P j has lenght smaller than 1, we require that the Floer datum on the ends adjacent to its outgoing segment to be the constant ones fixed in (5.13).
Remark 5.20. Had we naively pulled back the perturbation datum for a mushroom using the projections of components of C d to a product as in Equation (4.5), we would not have been able to achieve transversality in the situation pictured in Figure 8. However, while the stratum labelled by the topological type of such mushrooms lies on the boundary of the Gromov compactification of a component of C d , it in fact lies in the interior of C d . In particular, the choice of perturbation data for a fixed d on this part of the moduli space is essentially independent from the choices made for smaller value of d. This implies that the choice of datum of each cap is unconstrained by the other choices, thereby allowing us to achieve transversality as explained in the discussion following Lemma 7.14.
Given such a perturbation datum, we can define the moduli spaces which allows us to construct a functor from Morse(Q 1 , Q 2 ) to Fuk(Q 1 , Q 2 ).
Definition 5.21. The moduli space of mushroom maps is the space of maps Ψ from a non-singular mushroom C with incoming marked points p and outgoing marked point x 0 . The space of stable maps from a possibly singular mushroom is denoted C(x 0 ; p).
The topology on C(x 0 ; p) is defined as usual using the Gromov C ∞ topology for the underlying caps and stem. Moreover, this space carries a natural stratification coming from the stratifications on P and S (and possible breakings of gradient flow lines between critical points, or holomorphic strips at the incoming ends). We state the main result of Section 7.2.2: The proof of this next result is given in Section 7.2.3, and requires a gluing result in codimension 1 for moduli spaces of caps: Proposition 5.23. Given generic perturbation data, C(x 0 ; p) is a compact 1-dimensional manifold with boundary whenever

Construction of the functor.
We begin by defining the linear term of the functor G promised in the beginning of this section. To do this, we first observe that the index theorem (say, Equation (12.2) in [17]) gives a natural isomorphism where P q (p 1 ) is the moduli space of caps projecting to a fixed point q in Q, and we are writing q i for the intersection point between Q i and L q . It follows immediately that the determinant bundle of the moduli space of caps admits a natural isomorphism Given a mushroom Ψ in C(x 0 , p 1 ), the description of the moduli space of such mushrooms as the fibre product of P(p 1 ) with W s (x 0 ) over Q gives an isomorphism (5.21) λ(C(x 0 , p 1 )) ⊗ λ(Q) ∼ = λ(W s (x 0 )) ⊗ λ(P(p 1 )).
Specialising to the case deg(x 0 ) = deg(p 1 ), and using the previous result for λ(P(p 1 )) and the definition of o x0 , we conclude that every mushroom Ψ determines an isomorphism and hence a map which is the contribution of Ψ to the linear part of the functor G: Ignoring signs, the fact that G 1 is a chain map is a consequence of Proposition 5.23. Indeed, considering p 1 and x 0 such that the boundary strata of C(x 0 , p 1 ) consist of either (i) a critical point x 1 of f i,j and an element of T (x 0 , x 1 ) × C(x 1 , p 1 ) (i.e., a rigid mushroom with input p 1 and output x 1 together with a rigid gradient trajectory from x 1 to x 0 ) or (ii) an element of C(x 0 , p 0 ) × R(p 0 , p 1 ) for a time-1 chord p 0 from Q i to Q j for the Hamiltonian H i,j . These two cases correspond to the two sides of the equation To prove the correctness of the signs, we must compare the natural isomorphism (5.21), with a product isomorphism coming from its boundary strata. The case (i) above is virtually indistinguishable from the analogous situation for the moduli spaces of shrubs interpolating between simplicial and Morse cochains, analysed in the discussion surrounding Equation (3.28). The result of that discussion is that there is a sign difference given by the parity of deg(p 1 ) between the product orientation, and the one induced from the interior.
In the other case, we first note that a rigid strip gives a canonical isomorphism with the left hand side corresponding to translation. Taking the tensor product with Equation (5.21) with p 1 replaced by p 0 , and T C(x 0 , p 0 ) trivialised canonically by virtue of being rigid, we obtain an isomorphism Since gluing the strip to the cap at p 0 gives an identification R ∼ = T C(x 0 , p 1 ) with the positive direction in R pointing inward we recover the isomorphism of (5.21), multiplied by −1.
To conclude that (5.25) holds, we must keep in mind that there are signs of (−1) deg(p1) and (−1) n in the definitions of the differential in the Floer and Morse theories, as well as a sign in our formula for G 1 , which contribute n deg(p 1 ) in one case, and n deg(p 1 ) + n in the other.
Proposition 5.24. The map G 1 is a chain isomorphism.
Proof. We shall use the energy filtration to see that, if we order the critical points by energy, the matrix for G 1 is upper triangular with ones along the diagonal, hence is invertible.
We first show that C(x 0 ; p 1 ) is empty whenever where x 1 is the critical point corresponding to p 1 in Corollary 5.4. Assume by contradiction that a mushroom map Ψ with these asymptotic conditions exists. Let q denote the point of Q such that the cap of Ψ has a boundary segment mapping to L q , and write q i0 for the lift of this point to Q i0 . Since the stem is a descending flow line of f i0,i1 , we conclude that and hence, as we are assuming (5.28), we find that We claim that this inequality contradicts positivity of energy for the cap. Indeed, an application of Stokes's theorem analogous to Lemma 5.1, the closedness of the 1-form in Definition 5.13 implies that where q i0 and q i1 now stand for the intersection points of L q with the respective Lagrangian, and A for the appropriate action functional for the Hamiltonian perturbations fixed in Definition 5.13. Using the primitive θ i0 which vanishes on Q i0 and L q , we compute that A 0 (q i1 ) vanishes, while A H i 0 ,i 1 (q i0 ) and A H i 0 ,i 1 (p) are respectively equal to −f i0,i1 (q) and −f i0,i1 (x 1 ). As the left hand side of Equation (5.31) is non-negative, we conclude, as desired, that C(x 0 ; p 1 ) is empty whenever the inequality (5.28) holds.
Applying this energy analysis to the case p is the Hamiltonian chord from Q i0 to Q i1 corresponding to the critical point x of f i0,i1 , we find that the only solutions in this case must have constant cap and stem (any non-constant solution must carry some energy). The proof that there are ones along the diagonal and hence that G 1 is a chain isomorphism now follows from the fact that such constant solutions are regular.
The higher order analogues of this map are defined in essentially the same manner as the maps F d which define a functor from Floer to Morse theory. Whenever deg(x 0 ) = 1 − d + i deg p i , we may assign to each tree Ψ ∈ C(x 0 , p) an isomorphism and a sign ‡(Ψ). We discuss a set of possible choices for the isomorphism and the sign in Section 8.4. We define the d th higher term of G to be a sum of the maps G Ψ induced by Ψ on orientation lines, multiplied by the appropriate sign: Modulo signs, the analysis of the boundary strata of 1-dimensional moduli spaces of mushrooms given in Section 7.2.3 (i.e. the proof of Proposition 5.23) immediately implies: Proposition 5.25. The maps F d satisfy the A ∞ equation for a functor:

Compactness for caps
The goal of this section is to prove Lemma 5.12. We start in the first section by discussing a general result which constrains holomorphic curves to remain within compact domains, which we shall then apply in the second section to prove the desired statement: 6.1. Generalities. We begin with a generalisation of Lemma 7.2 of [3], which precludes holomorphic curves from escaping from a domain. Let us assume therefore that we are given an almost complex structure I W on a manifold W , and a 1-form α whose differential is nonnegative on every complex plane. Let W in be a (codimension 0) submanifold with boundary such that ker(α|∂W in ) is a complex distribution (in particular, α does not identically vanish near ∂W in ), and (6.1) if α(X) = 1 for X ∈ T ∂W in then (i) I W X is inward pointing and (ii) dα is positive on the complex plane spanned by X.
Assuming moreover that we are given a submanifold R ⊂ W − W in transverse to ∂W in such that (6.2) α restricts to an exact form on R whose primitive is constant on R ∩ ∂W in , we conclude Lemma 6.1. Every I W holomorphic curve in W − int(W in ) with boundary on R ∪ ∂W in which intersects ∂W in is contained therein.
Proof. Since the proof is essentially indistinguishable from that of Lemma 7.2 in [3] we shall only sketch it: The assumption that dα is non-negative on holomorphic planes implies that its integral over a holomorphic curve is non-negative. Moreover, given that dα does not vanish on a plane transverse to ∂W in this integral must be strictly positive for every holomorphic curve which intersects ∂W in but is not contained in it. In particular, Stokes's theorem implies that the integral of α over the boundary of such a holomorphic curve must be positive. However, the contribution of the subset mapping to R vanishes by Condition (6.2), while the contribution of the subset mapping to ∂W in is non-positive by Condition (6.1).
Still requiring that α|R be exact, we now assume that the primitive is only locally constant on R ∩ ∂W in . In this case, let us consider maps such that whenever γ : [0, 1] → ∂Σ is a parametrisation of a boundary segment mapping to R which is compatible with the complex orientation, (6.3) the difference between the values of a primitive of α|R at u(1) and u(0) is strictly positive.
The previously sketched argument in fact proves: There is no holomorphic curve in W − int(W in ) with boundary on R ∪ ∂W in for which Condition (6.3) holds.

6.2.
Proof of compactness. If in the discussion of the previous section, α is a Liouville form whose restriction to ∂W in is a contact form, then Condition (6.1) essentially says that I W is of contact type near ∂W in , and Condition (6.2) that R is exact with Legendrian boundary (and in addition admits a primitive for the Liouville form which strictly vanishes on this boundary). In this case, we exactly recover Lemma 7.2 of [3], and we may conclude half of Lemma 5.12: Lemma 6.3. If the distance between q and b is greater than δ then P q ( x) is compact whenever i 0 = i d and empty whenever (i 0 , i d ) = (2, 1). Note that while the almost complex structure is of contact type near any point in ∂M in , the Lagrangians L q may not intersect it in Legendrian submanifolds if q is within δ of b. We shall construct a different submanifold M mi which will play the same role as M in did in the previous Lemma (this manifold was mentioned in Condition (2.43) and we are finally about to define it). Its local model in C n is a smoothing of the manifold with corners (6.4) {( x, y)|| x| 2 ≤ 1/4 or | y| 2 ≤ 1/4} ∪ {( x, y)|| y| 2 + | x| 2 ≤ 2 and | y + x| 2 ≤ 4 − δ}, see Figure 9. To understand the construction, it is helpful to keep in mind that the sphere of radius 2 about the origin meets the hypersurface | y + x| 2 = 4 precisely on its intersection with the diagonal. Hence this intersection takes place far away from the hypersurfaces | x| 2 = 1/4 and | y| 2 = 1/4. In particular, this manifold has only codimension 2 corners, and the smoothing construction which produces M mi is entirely local. We leave the details of the smoothing to the reader, requiring only that if the distance between b and q is smaller than δ, the intersection of the leaf L q with ∂M mi agrees with its intersection with the hypersurface | y + x| 2 = 4 − δ.

Proof. As usual
Note that {( x, y)|| y + x| 2 ≤ 4 − δ} can be naturally identified with a disc cotangent bundle of the Lagrangian such that affine planes parallel to L ∆ correspond to cotangent fibres. In particular, the leaves L q (whenever q is close to b) intersect M mi in Legendrians. With this at hand, we complete this Section with the An element of T d lies in the cell labelled by T ∞ if the result of collapsing all its finite edges yields a (ribbon) tree combinatorially isomorphic to T ∞ , see [17] which gives a detailed discussion of the parallel case in which the Stasheff polytopes are modeled by moduli spaces of holomorphic discs. The space T d also has a cell decomposition with cells T T →T ∞ labelled by surjective maps of ribbon trees where both T and T ∞ are isomorphism classes of trees with d inputs, and such that the inverse image of every vertex is a connected tree. The stratum determined by such a map consists of trees which are homeomorphic to T and whose finite edges are those collapsed in T ∞ . In particular, the set of infinite edges in such a stratum is fixed, so the structure of a metric tree is determined by the lengths of the remaining edges, and we have a canonical isomorphism with closure (allowing edges to reach length 0 or ∞): The cell structure on T In particular, we obtain a smooth structure on T T →T ∞ . Note that every flag in T (a pair (e, v) with v a vertex of the edge e) and the metric g T determine a unique orientation and length preserving map taking v to the origin and e to the appropriate segment on either side of the origin. In particular, this flag determines a polyhedral subset in Recall that a universal perturbation is a smooth choice of perturbation data for all labelled Stasheff trees, which is moreover consistent in the sense that the perturbation data for a singular tree is given by the data of its components.  Proof. Since the perturbation data have been fixed on the lower dimensional moduli spaces it suffices to extend the perturbation datum to interior cells. Fix a tree T labelling such a cell, (in this case T ∞ is a tree with a unique d + 1-valent vertex, and all interior edges are collapsed, so we may drop this data from the notation). By assumption, perturbation data have been chosen for the boundary of the cell labelled by T . If we fix an interior edge e, writing (e, v ± ) for the two flags it lies on, then the existence of a smooth extension of a function from the boundary of is obvious since this is a manifold with corners (we proceed by induction, extending over small neighbourhoods of the skeleta). It suffices therefore to make sure that the extension can be chosen so the maps associated to the two flags containing e are both smooth. Writing t e for the coordinate of the factor of [0, +∞] |E(T )|−|E(T ∞ )| corresponding to the edge e, we find that the only potentially interesting extension problem occurs at the boundary facets t e = 0, +∞. Since the map (t e , y) → (t e , y + t e ) is smooth on R 2 , and takes the polyhedron associated to (e, v − ) to the one associated to (e, v + ), smoothness of the extensionsX T →T ∞ (e,v−) andX T →T ∞ (e,v+) are equivalent near t e = 0.
In remains to check the existence of an extension from t e = +∞. The key fact is that the perturbation datum is required to be compactly supported on every edge. This defines a naive way of gluing the perturbation data associated to the flags (e, v ± ) whenever t e ≫ 0 by "pregluing" the two half-infinite intervals as follows: if we identify the edge with the interval [0, t e ], then the perturbation datum on [t e /3, 2t e /3] is set to vanish, while those on [0, t e /3] and [2t e /3, t e ] are obtained by pulling back the perturbation datum from the natural inclusions in [0, +∞) and [−∞, 0] (the second is obtained after translation by −t e ). A simple computation shows that the resulting perturbation datum extends smoothly with respect to both coordinate systems, and the proof proceeds by induction using cutoff functions, proving the first part of the result. The second part follows easily by observing that once one has constructed a perturbation datum over the boundary of a cell, it can be arbitrarily modified at any point in its interior.
The next technical result is the infinitesimal version of the fact that perturbing of the gradient flow equation on a bounded subset of an edge integrates to an essentially arbitrary diffeomorphism (see the discussion preceding Definition 2.6) . Lemma 7.3. For each gradient tree ψ : (T, g T ) → Q, x a point in the appropriate ascending or descending manifold, and tangent vector X at ev k (x), there exists a 1-parameter family of universal perturbation data X T τ whose evaluation maps ev τ k ′ are independent of τ for k ′ = k, and such that With this in mind, we can prove the desired transversality result.
Lemma 7.4. All moduli spaces T (x 0 , x) are manifolds of the expected dimension for a generic choice of universal perturbation data.
Sketch of proof. If x consists of a single element x 1 , this follows from the assumption that all functions f i,j are Morse-Smale. To prove the general case, note that the choice of a perturbation datum associates a diffeomorphism of one of the manifolds Q i,j to each finite edge of a metric tree (T, g T ); the diffeomorphism is simply the flow of the associated perturbed gradient vector field. By picking finite segments in each incoming edge containing the support of the perturbation datum, we may also associate a diffeomorphism (the perturbed gradient flow on this segment) to a leaf of T . In particular, we define for each integer 0 ≤ k ≤ d a diffeomorphism φ k obtained by composing the diffeomorphism attached to the k th leaf with the diffeomorphisms associated to the sequence of finite edges which form an arc from the k th leaf to the outgoing segment. The moduli space of gradient trees for a fixed metric tree is the inverse image of the diagonal in Q d+1 under a map whose k th component ev k is the composition of the inclusion of the given stable or unstable manifold in the appropriate factor with the diffeomorphism φ k . A standard argument using Sard's theorem then reduces the regularity of the moduli space to the previous Lemma.
Remark 7.5. Lemma 2.12 implies that we may discuss transversality of the evaluation map (7.12) to the diagonal even though the target space is not Hausdorff; the image of a point under consideration may only lie in the singular strata of Q if it is labelled by Q 1,1 or Q 2,2 , in which case all the arguments take place in the appropriate manifold.
7.1.2. Transversality for shrubs. We briefly explain how to extend the techniques of the previous section to obtain moduli spaces of maps of shrubs which are smooth manifolds.
The main difference are that the strata of S d are not manifolds with corners, so one may not extend an arbitrary smooth function from one skeleton to the next. The quickest way to resolve this problem is to consider the inclusion obtained by attaching two infinite edges to every incoming vertex of a shrub. We insist that this is a purely formal construction; the right hand side should not be thought of as controlling gradient trees for Morse theory in this construction, and so we have given it a different name. It is clear that the natural stratification of S d agrees with the pullback of the stratification of T 2d under the inclusion.
Given a sequence I , we define 2 I to be the sequence obtained by repeating every element but the last, allowing us to define the analogue of this inclusion in the presence of labels (7.14) S I → T 2 I ≡ S ext 2 I .
The reader may easily check the commutativity of the diagram, with vertical arrows obtained by applying (7.14), and the horizontal ones by applying the map (3.5) in the first row, and r iterations of the map (2.26) in the second. Note that the map (2.26) can be interpreted in our new notation as the existence of a map (7.16) where I is obtained by removing one of the inputs of I 1 and replacing it by the inputs of I 2 .
Definition 7.6. A universal perturbation datum on S ext is a perturbation datum for every tree in S I varying smoothly, and which is compatible with the perturbation datum X T used to define Morse(Q 1 , Q 2 ) and the maps (7.16).
A choice of perturbation data for each element of S I is said to be smooth if it is the restriction of a universal perturbation datum on S ext under the map (7.14).
Remark 7.7. Of course, a universal perturbation datum on S ext involves many choices which are discarded by restricting to S I . One might reasonably a universal perturbation datum only on neighbourhoods of the image of S I which are compatible with the operadic structure maps, but there seems to be no reason to desire this additional level of complexity.
The existence of a universal perturbation datum on S ext is proved by induction as we did in the construction of X T . The induction step uses the fact that any smooth function on a subcomplex of the natural stratification of a manifold with corner may be extended to an additional cell.
The commutativity of the diagram (7.15) implies that the compatibility of a perturbation datum with respect to the structure maps of S ext implies compatibility of the restriction to S with (3.5). Lemma 3.7 implies that the simplicial condition is realised in an open set of such perturbations. To conclude the desired transversality result, the key ingredient, as in the proof of Lemma 7.4 is an intersection-theoretic interpretation of S S,gS (x, σ) whenever σ = (σ 1 , . . . ,σ d ) is a composable sequence of cells with σ k a cell of Q i k ,i k+1 , and x is a critical point of f 0,d . As we did for Stasheff trees in the proof of Lemma 7.4, this moduli space is the inverse image of the diagonal under a map whose k th factor is obtained by composing the inclusion ofσ k with the composition of perturbed gradient flows associated to the edges of S lying on an arc from the k th incoming leaf to the outgoing edge. We conclude: Lemma 7.8. For generic universal perturbation data, all strata of S(x, σ) are smooth manifolds of the expected dimension.
7.1.3. Codimension 1 gluing for trees. We briefly describe how to use the approach of [12] in order to prove the desired gluing theorems for moduli spaces of gradient trees. The results of this section prove that the compactifications of moduli spaces of gradient trees are manifolds with boundary whenever they have virtual dimension 1. However, as we shall need a description of a neighbourhood of the codimension 1 strata of moduli spaces of shrubs of arbitrary dimension, we shall discuss matters in that generality.
Consider a Morse-Smale function f on a smooth submanifold, and N 1 and N 2 smooth manifolds which are transverse to the gradient flow of f . The manifold of gradient flow lines of length R starting on N 1 and ending on N 2 will be denoted M R (N 1 , N 2 ). The union of these spaces admits a compactification M(N 1 , N 2 ) by allowing broken trajectories. We write for broken gradient trajectories passing through a critical point x. Note that all strata of virtual codimension 1 in M(N 1 , N 2 ) are of this type. The following result is a minor generalisation of Proposition 18.1.4 in [12]: and an embedding for R 0 ≫ 0, such that the image of U (a 1 , x, a 2 ) × {R} consists of all gradient segments of length R which are sufficiently close to (γ 1 , γ 2 ). Moreover, the evaluation map converges in the C ∞ topology as R converges to infinity.
Assuming that the perturbation data we have chosen are generic, this result implies that the moduli spaces T (x 0 , x) are manifolds with boundary, with boundary stratified by smooth manifolds of the expected dimension. For simplicity of notation (and as this is the only case that is needed for our arguments), we focus on a neighbourhood of the strata of codimension 1. Such a stratum is a product with a fixed choice of an element x 1 j ∈ x 1 which equals y, and such that x is the result of replacing x 1 j by x 2 in x 1 . The outgoing and incoming edge with endpoint y are naturally isometric to [0, +∞) and (−∞, 0]. We fix a constant K sufficiently large that the support of the perturbation data on these edges are respectively contained in [0, K] and [−K, 0], and write b K for the image of ±K on this edge. We define evaluation maps 2 ) → Q d2 which are obtained in the second case by composing the inclusion of W u (x j 2 ) into the j th factor with the flows associated with a descending arc from the j th leaf to the point b k (the first case is a straightforward modification). We write N ∞ (x 0 , x 1 − y) and N ∞ ( x 2 ) for the inverse images of the diagonal under these maps. By definition, the stratum we are considering is given by Our regularity assumption can be restated as the fact that this is a transverse fibre product.
Consider the "pregluing" map (7.23) (0, +∞] × T d1 × T d2 → T d obtained by replacing the bi-infinite edge in the source with a finite one whose length is given by the projection to the first factor in the source. Let us define for R ∈ [0, +∞) in the same way as their analogue for R = +∞, but using the perturbation data on T I pulled back under the inclusion of {R} × T I 1 × T I 2 . A neighbourhood of T (x 0 , x 1 ) × T (y, x 2 ) in T (y, x) consists of gradient trees whose source lies in the image of this pregluing map, and is therefore given by the union The smoothness condition on our choice of perturbation data implies that the evaluation maps on N R (x 0 , x 1 − y) and N R ( x 2 ) converge on compact subsets, and in the C ∞ topology to the evaluation maps at R = +∞. Together with Lemma 7.9, elementary differential topology implies Lemma 7.10. Each point (ψ 1 , ψ 2 ) ∈ T (x 0 , x 1 )×T (y, x 2 ) admits a neighbourhood U (ψ 1 , ψ 2 ), and an embedding for R 0 ≫ 0, whose image is a neighbourhood of (ψ 1 , ψ 2 ) in the Gromov topology.
This result has a straightforward generalisation to corners of higher codimension, but we shall not need that fact in this paper.
The same proof technique works for shrubs: Let ψ 0 be a rigid gradient tree in T (x 0 , x), and ψ = (ψ 1 , . . . , ψ d ) a sequence of shrub maps with outputs x j . We write ( σ 1 , . . . , σ r ) for the collections of inputs of all shrub maps ψ j , and σ for the sequence obtained by concatenating the sequences σ j . By attaching ψ j to the j th input of ψ 0 , we obtain a singular shrub Let U (ψ 0 , ψ) denote a sufficiently small neighbourhood of this point in the boundary stratum of S(x 0 , σ) wherein it lies (note that his stratum has virtual codimension 1). Applying the discussion for trees to this situation, we conclude: Lemma 7.11. There exists an embedding whose image is a neighbourhood of (ψ 0 , ψ) in S(x 0 , σ).

7.2.
Transversality and gluing for caps and mushrooms. The proofs of technical results from Section 5 are contained in this section. However, we omit the analytical parts of the proofs, so that we work with smooth functions throughout, without setting up the relevant Banach spaces.
7.2.1. Transversality for caps. In this section, we prove Lemma 5.11. One way to define the topology on P( p), is to introduce the space of all smooth maps u : P → M for some cap P whose boundary arcs are mapped to (Q i0 , · · · , Q i d , L q ), where q is allowed to vary arbitrarily in Q, and whose incoming marked points are mapped to the Hamiltonian chords p. Note that P( p) is simply the zero-level set of (7.29) (du − Y I ) 0,1 as a section of the vector bundle over C ∞ P( p) with fibre at a map u with source P .
Proof of Lemma 5.11. The proof is a standard application of Sard-Smale to pseudo-holomorphic curve theory. We note that the assumption that all moduli spaces of holomorphic discs R(p 0 , p) are regular implies that every stratum consisting of one cap and several discs will have the expected dimension as soon as the component corresponding to the cap is regular. We introduce the ingredients necessary to prove that this is the case for generic perturbation data: Fix q ∈ Q, and let u : P → M be a smooth map . We define to be the subspace of C ∞ (P, u * (T M )) consisting of vector fields whose restriction to a boundary segment of P labelled by Q i is valued in the tangent space Q i , and whose restriction to the outgoing boundary segment projects to a constant vector in Q (note that the foliation L q defines a smooth map M → Q). The projection map is obviously surjective with kernel consisting of vector fields X which, on each arc point in the direction of the Lagrangian label. We write (7.31) C ∞ res (P, u * (T M )) for this space.
Let T P denote the space of infinitesimal deformations of the universal perturbation data K P and J P , and let T P denote the analogous space for fixed P . By taking the direct sum of the linearized∂ operator and the projection above, we obtain a map (7.32) T P ⊕ T P P ⊕ T u C ∞ P( p) → C ∞ (P, Ω 0,1 (P ) ⊗ u * T M ) ⊕ T q Q.
Note that the surjectivity of this operator implies the desired result by the Sard-Smale theorem, and the infinitesimal version of Lemma 5.9 which shows that T P surjects onto T P .
The surjectivity of this operator itself follows from the surjectivity of the linearized∂ operator restricted to the kernel of the projection to T P P ⊕ T q Q: . This fact, however, is a standard result in pseudo-holomorphic curve theory. For closed holomorphic curves, this appears in the textbook [13, Proposition 3.2.1] (the Lagrangian case can also be found, for example, in [18,Lemma 2.4]).
The next result is the key to our proof of the gluing theorem for mushrooms: Let u be an element of a moduli space of caps P( p 1 ) of dimension k such that the evaluation map is an immersion near u; let U denote a neighbourhood in P( p 1 ) where this property holds.
Let v be a rigid element of a moduli space of discs R(p, p 2 ) such that p agrees with the j th input of p 1 . Denoting by p the result of replacing this input in p 1 with p 2 , we write (u, v) for the singular cap in P( p) obtained by attaching v to u. The next result is standard gluing theorem in pseudo-holomorphic curve theory: Lemma 7.12. There exists an embedding whose image is a neighbourhood of (u, v) in P( p), and whose restriction to {ǫ} × U is smooth for any value of ǫ. Moreover, the composition of the evaluation map with the inclusion of {ǫ} × U converges in the C 1 topology to its value at ǫ = 0.

Sketch of proof:
The key ingredient in the construction of a gluing map is a choice of right inverse. Let q denote the image of u under the evaluation map, and fix a neighbourhood of q with a diffeomorphism to a neighbourhood of the origin in R n such that the image of U under the evaluation map is the intersection of this subset with R k .
We consider the codimension n − k subspace (7.36) C ∞ R n−k (P, u * (T M )) ⊂ C ∞ res (P, u * (T M )) consisting of vector fields whose image under the projection map to T Q and the local diffeomorphism with R n lie in the copy of R n−k complementary to the image of the moduli space under evaluation. By construction, the restriction of the parametrized (perturbed)∂ operator to (7.37) This choice of right inverse determines a gluing construction as follows: since v is rigid its∂ operator is an isomorphism. For every real number ǫ, one constructs a "preglued" map u# ǫ v whose source is a surface obtained by removing parts of the strip-like ends of the domains of u and v and attaching the complements. This preglued map comes equipped with a right inverse also obtained by gluing the right inverses on both side. Applying the implicit function theorem to this right inverse, we conclude the existence of a unique vector field sol u#ǫv along the pre-glued curve, in the image of the right inverse and of sufficiently small norm, whose image is an honest solution to the∂ problem being studied. The standard argument in holomorphic curve theory shows that the norm of sol u#ǫv (in any reasonable space of functions) decays as ǫ goes to 0.
The same construction can be done for curves u ′ near u, and it is easy to see that the preglued curve varies smoothly with u and ǫ, from which C 0 convergence of the evaluation map follows. In order to prove C 1 convergence, we must therefore prove that the vector field sol u#ǫv decays with ǫ in the C 1 topology as a function of u. The easiest way to do this is to use a right inverse at u ′ # ǫ v obtained by parallel transport of the one constructed by pregluing at u# ǫ v. Decay in the C 1 topology follows from a standard version of the implicit function theorem applied to a chart for the relevant space of functions which is "centered at u# ǫ v" (see [6,Proposition 24] for the version of the implicit function theorem one should use, and [1,Proposition 5.4] for a detailed version of this argument in the setting of bubbling of holomorphic discs).

7.2.2.
Transversality for mushrooms. In this section, we prove the existence of universal perturbation data for which the moduli spaces of mushrooms are smooth manifolds. We adopt the strategy used for shrubs and consider the disjoint union over sequences with j d j = d: Recall that we constructed C d starting with a disjoint union of polyhedra each admitting a natural embedding: (7.39) S 2r × P d1 × · · · × P dr ⊂ S ext 2r × P d1 × · · · × P dr .
The moduli space C d was defined as a quotient under an equivalence relation which naturally extends to the cells of the polyhedra appearing in the disjoint union (7.38). The cellular complex C ext d obtained by taking the quotient under this relation is not a manifold (it doesn't even have pure dimension).
Let us consider the maps which make the moduli space of mushrooms into a bimodule over (two different models) of the Stasheff associahedron: A short verification shows that (4.4) is compatible with the inclusion (7.39), and a natural map obtained by attaching the disc the one of the d 1 inputs of an element of C ext d1 . On the other hand, and as in Equation (7.16), the module map (4.3) can be recovered from the inclusion (7.39) and a repeated application of the map All these constructions have analogues for labels, so we shall consider a sequence I of such. As all the components of (7.38) are smooth manifolds with corners, it makes sense to speak of smooth functions on C ext I . We define a universal Q-parametrised perturbation datum in C ext to be a Q-parametrised perturbation datum on all elements of C ext I which is smooth on each component, invariant under the equivalence relation ∼, and compatible with the perturbation data (X T , K R , J R ) and the analogue of the maps (7.40) and (7.41) in the presence of labels.
Definition 7.13. A family of perturbation data on C I is smooth if it is the restriction of a universal perturbation datum on C ext I .
The analogue of Lemma 7.2 holds. As the proof is the same, we shall not repeat it. The only subtle point in ensuring that Condition (5.17) holds. However, the inductive construction starts by choosing perturbation data on the simplest space, which is the moduli of shrubs with 1 input. Definition 5.13 dictates how this initial choice should be made, and Condition (5.17) is compatible with the requirement that the perturbation data be chosen consistently.
Lemma 7.14. The restriction map from the space of Q-parametrised perturbation data on C ext I to the space of perturbation data for a fixed mushroom is surjective.
The transversality result we desire now follows by applying the idea of Lemma 5.11. We start by studying interior strata of C d : The strata of C d are labelled by the following data: a partition d = d 1 + . . . + d r , an increasing sequence of integers 1 = r 0 < r 1 < . . . < r e = r, and a tree S with e inputs. Indeed, write D for this data, and first consider the stratum of S D ⊂ S r consisting of trees homeomorphic to S for which two vertices v i and v j are collapsed to the same point whenever i and j lie between consecutive integers r l and r l+1 , but are otherwise distinct. The stratum of C d consisting of mushrooms with r smooth caps with respectively (d 1 , . . . , d r ) inputs and a stem in S D will be denoted by C D ; it is a product (7.42) S D × P d1 × · · · × P dr .
Define C ∞ P (d1,...,dr) ( p) ≡ C ∞ P( p d1 0 ) × · · · × C ∞ P( p d d−dr ), to be the space of smooth r-tuples of maps from the disc to M satisfying the appropriate boundary conditions for the caps of a mushroom map in C(x 0 , p) whose underlying mushroom has r smooth caps with respectively (d 1 , . . . , d r ) inputs. Further, define to be the vanishing locus of the∂ equation (7.29) perturbed according to the chosen perturbation datum (which now depends on the modulus in C D rather than depending only on the corresponding moduli space of caps as explained in Remark 5.20).
We have a map (7.43) P D ( p) → C D × Q r which, on the second factor, agrees with the projection of the "outgoing arc" of each cap.
Let us now consider the stem. Generalising Equation (7.17), and writing Q = (Q i0 , . . . , Q ir ) we define to be the inverse image of the diagonal under a map , whose factors are a composition of the natural inclusion with a diffeomorphism of the target obtained by integrating the flow of a descending arc of S as in Equation (7.17) (the flow depends on the perturbation data, which are parametrised by the first factor). Here, as in Equation (5.15), the sequence {i k j } d k j=0 records the boundary conditions on P( p k ). Observe that the moduli space of shrubs with a fixed source, output x 0 , and arbitrary inputs is naturally an open submanifold of the ascending manifold of x 0 . The reader should also keep in mind that while there are r evaluation maps, we are potentially considering a tree in which an arbitrary number of these maps necessarily agree because the corresponding incoming vertices lie on a subset of the shrub which is collapsed to a point. The next result is simply a reinterpretation of the definition of a mushroom map (compare also Equation (5.15)): Lemma 7.15. The subset of C(x 0 , p) consisting of maps whose source is a mushroom in C D is naturally diffeomorphic to the fibre product We complete this section by proving a Lemma from Section 5.3 Proof of Lemma 5.22. Since every component of a singular mushroom map consists of mushroom maps, discs perturbed with respect to the datum (K R , J R ), and gradient Stasheff trees perturbed with respect to X T , the fact that we have chosen regular perturbation data to define Morse(Q 1 , Q 2 ) and Fuk(Q 1 , Q 2 ) implies that Lemma 5.22 would follow once we show that all strata of C(x 0 , p) have the expected dimension. The previous Lemma reduces this to showing that for a generic choice of perturbation data, the fibre product (7.46) is transverse. Of course, this will follow from an application of Sard-Smale. To simplify matters, we observe that the forgetful map is a submersion. In particular, our result would follow once we show that the evaluation map (7.47) P D ( p) → P d1 × · · · × P dr × Q r can be made transverse to an arbitrary submanifold in the target by changing the perturbation datum.
Fix a mushroom map Ψ with source C, and let T P (C) denote the space of infinitesimal deformations of perturbation data for the caps of C. We introduce the notation Using the surjectivity of the restriction map from the space of universal perturbation data to the space of perturbation data for the caps of C, we have reduced the problem to showing that the evaluation map at the level of tangent spaces (7.49) T P (C) × C ∞ res ( P , Ψ * (T M )) → T Q r is surjective. Splitting the source and the target as a direct sum of r factors, we find that this follows immediately from the proof of Lemma 5.11 given in the previous section.
To prove transversality even in the base case of mushrooms with 1 input, it is important to note that surjectivity holds even if we are allowing only perturbations of the almost complex structure (but which are of course allowed to vary along the caps, this is is exactly the setting in which transversality is proved in [13]). has virtual dimension 1. By Lemma 5.22 which is proved in the previous section, all strata of C(x 0 , p) are empty except those of virtual dimension 0 and 1. In order to prove that C(x 0 , p) is a 1 dimensional manifold with boundary, we must prove that points in the 0 dimensional strata have neighbourhoods, in the Gromov topology, which are homeomorphic to an interval.
There are four distinct geometric situations to consider.
(1) ψ is a rigid gradient tree in T (x 0 , x), and Ψ = (Ψ 1 , . . . , Ψ k ) is a sequence of rigid mushrooms with outputs x j . We write ( p 1 , . . . , p r ) for the collections of inputs of all mushrooms Ψ j , and p for the sequence obtained by concatenating the sequences p j . The pair (ψ, Ψ) defines an element of C(x 0 , p) obtained geometrically by attaching Ψ j to the j th input of ψ. Consider the stratum C D determined by the datum of d j = | p j | and a tree S with exactly r inputs. If the perturbation data on the caps were independent of the stem, the result would follow from Lemma 7.11, and the observation that the moduli space we are studying has an alternative description as (7.51) S(x 0 , P( p 1 , . . . , p r )) where P( p 1 , . . . , p r ) is the product of the moduli spaces P( p j ), each which defines a chain on Q by the evaluation map at the outgoing segment. Using only Lemma 7.11 as analytic input one can prove the general case by imitating the strategy for passing from Equation (5.15) to Lemma 7.15 (i.e. work fiberwise over C D ). (2) v is a rigid holomorphic curve in R(p 0 , p 2 ), and Ψ a rigid mushroom in C(x 0 , p 1 ), such that p 0 agrees with the k th input in p 1 . In this case, we focus attention on the cap with inputs p 1,j wherein this k th input lies. Writing Ψ j for the map of caps along which we are attaching v, we assume again for simplicity that the perturbation datum on that cap is independent of the remaining caps and the stem, and use Lemma 7.12 to find a neighbourhood of (Ψ j , v) in P( p 1,j ∪ p0 p 2 ) foliated by smooth codimension 1 submanifolds which are the images of the boundary for gluing parameter ǫ. Note that the immersive assumption in Lemma 7.12 is implied by the rigidity and regularity requirements on Ψ. In addition, Lemma 7.15 gives a description of C(x 0 , p# p0 p 2 ) as a fibre product one of whose factors is P( p 1 # p0 p 2 ).
The assumption that C(x 0 , p) is rigid and the C 1 convergence of the evaluation maps to Q on the image of the gluing map implies that there is a unique solution for each such sufficiently small parameter. The general case can be proved by working fibrewise over C D , or, alternatively, by noticing that the smoothness in the choice of perturbation data implies that there is a neighbourhood of the singular mushroom we are considering where all moduli spaces together with their evaluation maps are perturbed by C ∞ small amounts from moduli spaces with perturbation data independent of the stem. After such a perturbation, a unique ray converging to the boundary persists. (3) Ψ is a mushroom with r caps, such that two successive incoming vertices (say k − 1 and k) of the stem are collapsed to one point, which is moreover rigid among such mushrooms. In particular, the boundary conditions on the outgoing arcs of the two caps P k−1 (C) and P k (C) agree. In this case, there is a unique 1-parameter family of mushrooms Ψ t , whose domains have stems for which the distance between the incoming vertex labelled k and k + 1 does not vanish, and which converge to Ψ. The argument given in Lemma 3.10 proves this. (4) In the same situation as before, we glue Ψ P k−1 and Ψ P k to obtain a cap whose inputs are given by concatenating those for Ψ P k−1 and Ψ P k . Lemma 7.12 again applies here to show that this moduli space of caps is foliated by the images of the gluing map for sufficiently small gluing parameter ǫ, and that the evaluation map converges in the C 1 topology as ǫ goes to 0. The argument of Case (2) yields the desired conclusion.

Orientations and signs
8.1. The differential in Morse and Floer theory. We begin by describing the differential in the Morse complex CM * (f i,j ). We define T (x 0 , x 1 ) to be the fibre product of W s (x 0 ) and W u (x 1 ) over their common inclusion in Q i,j , yielding a natural short exact sequence of vector spaces and hence an isomorphism of top exterior powers Whenever deg(x 0 ) = deg(x 1 )+1, the intersection between W s (x 0 ) and W u (x 1 ) is a segment, mapping to R immersively under f i,j , so the tangent space of is canonically oriented, with our conventions dictating that a rigid gradient flow line is given the opposite orientation of the one induced by projection to R (i.e. the orientation we pick identifies x 1 with −∞). Using the decomposition of the tangent space of Q i,j at x 1 , we have an isomorphism which, together with the map in (8.2) determines an isomorphism and hence an induced map on orientation lines (8.6) µ M ψ : |o x1 | → |o x0 |. The differential is defined to be the sum of all such terms multiplied by a global sign: ψ∈T (x0,x1) Orienting abstract moduli spaces. As noted in our discussion of the Fukaya and Morse categories, the construction of A ∞ categories from counts of rigid discs or trees requires first a choice of orientations on the abstract moduli spaces controlling these categories.
8.2.1. Stasheff trees. Let T be a trivalent Stasheff tree with d inputs. Given an integer k, let A k denote the descending arc starting at the k th incoming leaf, and let b k denote the vertex of T where A k and A k−1 meet. We shall label the edges of this trivalent vertex e ℓ k , e r k and e d k as in Figure 10.  Figure 10.
We order the (finite) edges of T using the following inductive procedure: (1) Set T 2 to be the union of all the external edges of T (2) If e r k lies in T k , then define e k = e d k . Otherwise, set e k = e r k . (3) Set T k to be the union of T k−1 with e k . Proof. We must prove that it is impossible for both e d k and e r k to lie in T k−1 . The edge e d k lies in T k−1 only if it is the outgoing external edge. In that case, a simple check shows that e r k cannot lie in T k−1 .
We define the orientation on T d to be given by where t e is the length of e, and r(T ) is the number of integers between 3 and d for which e k = e r k . Lemma 8.2. The orientation given by formula (8.8) is independent of the topological type of T .
Proof. It suffices to check that this is the case in a neighbourhood of the codimension 1 walls. As these consist of trees with a unique 4-valent vertex, we start with a trivalent tree, and pass through the wall by collapsing an edge e. There is a natural way to identify the edges on trivalent trees on either side of the wall, and the reader may easily check that, under this identification, the edges e j are unchanged whenever b k is not one of the endpoints of e. There are two cases to consider, depending on whether e k agrees with e r k , whose verification is left to the reader.  Figure 11.
We now consider the boundary stratum of T d which is the image of the map given by attaching a tree with d 2 inputs to the k + 1 st incoming leaf of a tree with d 1 inputs (here, d 1 + d 2 = d + 1). Since we know that our choices of orientations are consistent throughout the moduli space, it suffices to compare these orientations in a special case. The author found the case shown in Figure 11 to be particularly convenient. The resulting computation implies:  Figure 12.
differs from the boundary orientation by a sign of while the orientation on the stratum whose image consists of shrubs whose k th and k − 1 st inputs are collapsed differs by a sign of (8.17) k + 1 from its orientation as a subset of the boundary.
Proof. Given the fact that the orientations are consistent throughout the moduli space, it suffices to compute the difference in sign orientation for one topological type of trees. The case (8.16) is essentially trivial, while that of (8.14) can be conveniently checked using the singular shrub appearing in Figure 12. 8.3. Orienting moduli spaces of shrubs. We shall fix the following conventions: whenever a space X is given as a transverse fibre product of X 1 and X 2 over X 0 , the short exact sequence For example, the isomorphism of Equation (2.34) comes from the choices (8.20) while Equation (3.13) comes from the choices We first use this fixed choice in order to prove the validity of the signs in Proposition 3.10. More precisely, we shall prove the validity of the signs in the right hand side, leaving the left hand side to the reader. For clarity of the argument, we introduce a change of sign of (8.22) (n + 1)(r + †( σ)) which we use to change the orientation of all moduli spaces of shrubs with inputs σ and dimension 1.
The starting point is an element of S(x 0 , σ) which consists of a rigid gradient tree in T (x 0 , x) with x = (x 1 , . . . , x r ), and a collection of r rigid shrubs in S(x r , σ r ), where ( σ 1 , . . . , σ r ) is a partition of σ. The orientation of the rigid tree is given by Equation (2.34) which can be simplified to: by using the splitting of the inclusion of the tangent space of the r + 1-fold diagonal whose kernel are the last r factors. Next, we decompose the k th copy of λ(Q r ) on the left as a tensor product: and rearrange the terms in the left hand side as where the first factor is the tensor product of λ(W s (x k ) in their usual order, introducing a Koszul sign of (8.23) Cancelling λ(W u ( x)) from both sides of the equation, we arrive at the isomorphism Rigid shrubs are oriented via Equation (2.34), which can be simplified (using the same splitting of the inclusion of the tangent space of the diagonal) as Introducing a sign of we obtain an isomorphism The product orientation of the singular shrub we are considering is given by taking the tensor product of Equation (8.24) with a copy of Equation (8.26) for each shrub: We shall compare this with the induced orientation as a boundary. On the left hand side, we permute factors so that we arrive at which introduces a sign of On the right hand side, we rearrange the terms so that they appear in the order The Koszul signs amount to: which we prefer to rewrite as The difference between the boundary and product orientations is given by the sum of Equations (8.23), (8.25), (8.27), and (8.28). The first three give r k=1 deg(x k ) (k + 1)(n + 1) The term deg(x k )(k + 1)(n + 1) cancels with a term appearing in the definition of the Morse category, which introduces an additional sign of (n + 1)r . This can be see by writing using the fact that the gradient tree with inputs x k and output x 0 is rigid. Incorporating these signs coming from the Morse category yields (n + 1)r + r k=1 (deg( σ k ) + d k + 1) (1 + k + d k + n(d 1 + · · · + d k−1 )) , and the sum with (8.28) equals There are additional signs coming from the definition of the functor F (see Equation (3.17)), and the change in orientations of 1-dimensional moduli spaces given by Equation (8.22). Together, these terms contribute (8.29) (n + 1) after which we use the fact that deg( σ) = deg(x 0 ) + d to simplify the total remaining sign to Adding the sign coming from Equation (8.15), we conclude that the boundary and product orientations are exactly opposite with the convention we have chosen.

8.4.
Orientations for mushroom maps. Throughout this section, we shall work with the simplified setup in which moduli spaces of mushroom maps are given by the fibre product in (5.15). More precisely, the moduli space of mushrooms C(x 0 , p) is stratified with top strata labelled by a choice of a partition of p into sequences ( p 1 , . . . , p r ). The stratum determined by this data is the moduli space of shrubs with r inputs lying on the images of the projection maps from the moduli spaces of caps {P( p k )} r k=1 , and is therefore given by a fibre product as in the previous section with (8.30) X = S(x 0 , P( p 1 ), . . . , P( p r )) X 0 = Q r+1 X 1 = Q X 2 = S r × W s (x 0 ) × P( p 1 ) × · · · × P( p r ) Every such mushroom Ψ therefore determines an isomorphism The description of λ(P(p 1 ) given in Equation (5.20) extends to an isomorphism When Ψ is rigid, our choice of orientations on S r , on R d k +1 (using the conventions from [17]) and the identification P d k ∼ = R d k +1 fixed in Remark 4.2, therefore determines a unique homomorphism (8.33) o p1 ⊗ · · · ⊗ o p d → o x0 .
We write F Ψ for the induced map on orientation bundles. In order to get the correct sign, we first introduce the notation where deg( p k ) is the sum of the degrees of the elements of p k . The sign used to define G is given by Having fixed the signs in the functor F , we have the necessary ingredients to prove Proposition 4.2. The proof considers the 4 types of boundary strata discussed in Section 7.2.3, and shows that each such stratum contributes with the correct sign to Equation (5.32), after taking into account the sign (8.35), as well as the signs that go into the construction of Fuk(Q 1 , Q 2 ) and Morse(Q 1 , Q 2 ). More precisely, it is enough to show that, after taking these artificial signs into account, the difference between the boundary and product orientation on each stratum of C(x 0 , p) is given by the sign claimed in the A ∞ equation (3.30), up to a universal constant, independent of the stratum (but that is allowed to depend on p).
The proof is a tedious computation, with the cases (1) and (2) from Section 7.2.3 respectively following from the computations performed in [17] and the previous section. Indeed, whenever a rigid disc bubbles off the k th cap, the only affected term in Equation (8.35) is †( p k ). This is exactly the sign convention for holomorphic discs we have used in constructing the Fukaya category, see [17,Equation (12.24)]. Similarly, when the stem breaks into a gradient tree together with several shrubs, only the term (n + 1) † ( P ) changes. The integer deg(P( p k ) agrees with the codimension of P( p k ) as a chain on Q, so these are exactly the conventions used in the previous section while orienting moduli space of shrubs.
Therefore, we shall only discuss cases (3) and (4), which correspond to terms which are supposed to cancel pairwise. In terms of orientations, we must therefore show that, whenever given a singular mushroom map lying in such an "internal" boundary, there is no difference between the orientations obtained by considering it as a boundary stratum of the two components described in cases (3) and (4). As in the previous section, it is convenient to change the orientation of the 1-dimensional moduli spaces as well. The sign we use is given by (8.36) (n + 1) r + †( P ) + r k=1 1 + †( p k ) + d k deg( p k ) We will start with case (3), for which the orientation is induced by the isomorphism of Equation (8.31). For simplicity, we begin by choosing a splitting of the inclusion of the tangent space (r + 1)-diagonal of Q, corresponding to the inclusion of all but the first factor. Introducing a sign of n, we can simplify to an isomorphism (8.37) λ(C(x 0 , p)) ⊗ λ(Q r ) ∼ = λ(S r ) ⊗ λ(W s (x 0 )) ⊗ λ(P( p 1 )) ⊗ · · · ⊗ λ(P( p r )).
The next step is to use the isomorphism (8.32) to decompose λ(P( p k−1 )) into its constituent factors, then cancel the resulting copy of λ(Q) with its matching factor on the right hand side (this is the k − 1 st factor starting at the left). The resulting Koszul sign is (1 + d j + deg( p j ))   Decomposing λ(P( p k )) as well, we find the expression in the right hand side. Using the identification of P d with R d+1 discussed in Remark (4.2), and Lemma 8.3 we may replace this by λ(R) ⊗ λ(P( p k−1 ∪ p k )) at the cost of a sign given by (8.39) d k−1 + (d k + 1) deg( p k−1 ).
Note that in Lemma 8.3, d 1 plays the role of d k−1 + 1, d 2 that of d k + 1, and k is our d k−1 (making for incompatible notations). We now move the normal co-vector λ(R) to the beginning of the right hand side, using Lemma 8.4 to cancel with the normal vector of the inclusion of S r−1 into S r in which the k th and k − 1 st incoming leaves are collapsed. The resulting sign is: 1 + d j + deg( p j ) + n The final output of this procedure is an isomorphism (8.41) λ(C(x 0 , p)) ⊗ λ(Q r−1 ) ∼ = λ(S r−1 ) ⊗ λ(W s (x 0 )) ⊗ λ(P( p 1 )) ⊗ · · · ⊗ λ(P( p k−1 ∪ p k )) ⊗ · · · ⊗ λ(P( p r )), which is exactly the analogue of the isomorphism of Equation (8.37) for the case (4). In particular, the difference between the orientations of a singular shrub as a boundary in cases (4) and (3)  In this section, we shall show that our construction, which so far yields Theorem 1.3 whenever B is a point, can be extended to the general case.
The starting point is the observation that, whenever two Lagrangian manifolds Q 1 and Q 2 meet cleanly along a submanifold B, we have a perfect pairing on the normal bundles N Q1 B and N Q2 B; in particular these normal bundles are dual, hence isomorphic as unoriented vector bundles. Conversely, given smooth embeddings of a compact manifold B into Q 1 and Q 2 with normal bundles isomorphic to a given vector bundle N B, the choice of such an isomorphism determines a plumbing of T * Q 1 and T * Q 2 along a neighbourhood of B.
Explicitly, we fix a Riemannian metric on B and on the vector bundle N B, which induces a metric on the total space. We may assume that we are given a Riemannian metric on Q i whose restriction to a neighbourhood of B is isometric to the disc bundle of radius 4 in N B, with U i corresponding to the disc bundle of radius 2. By Weinstein's theorem, there is a neighbourhood of B where the first form the pullback of the canonical form on the cotangent bundle, and the second defines a flow which radially rescales each fibre.
unchanged. The shifts in gradings do not affect the degree of the contribution of each gradient tree to the higher products, so that these groups are morphisms spaces in a Zgraded A ∞ category. To see this, assume for simplicity that we are considering a gradient tree with i 0 = i d . An argument analogous to the one given in the proof of Lemma 2.12 implies that, in this case, every labelled gradient tree that contributes to the Morse category has the property that the numbers of external edges labelled by f k 1,2 and f k 2,1 agree for every 1 ≤ k ≤ r, so that the formula for expected dimension still holds. The generalisation of this argument to the case i 0 = i d is left to the reader.
A.3. Simplicial category. Let us now choose simplicial triangulations Q i of Q i and assume that there is a pair of codimension 0 submanifolds with boundary N i ⊂ Q i which are the closures of top dimensional simplices, each properly including U i as a deformation retract. We assume that the diffeomorphism U 1 ∼ = U 2 determined by the plumbing construction extends to a cellular homeomorphism Writing N for the induced subdivision on an abstract manifold N , and {N k } r k=1 for the triangulations on the components of this space, we define a category Simp B (Q 1 , Q 2 ) with objects Q 1 and Q 2 , and morphism spaces The construction of composition maps and the proofs that the appropriate diagrams commute follows word by word the arguments given in the case N i is the closure of a simplex. We simply observe that the composition maps still have degree 0 because the different components of N do not interact, and we have chosen changes in gradings which differ by a sign for the morphisms going in opposite directions.
A.4. From simplicial to Morse. The construction of a functor from the simplicial to the Morse category relied on an appropriate choice of dual subdivision. In the clean intersection case, we chooseQ i , and writeŇ i for those cells dual to interior cells of N, replacing Condition (3.2) by the assumption that the cells ofQ i intersect the boundary ofŪ i transversely, and that we have nested weak homotopy equivalences Whenever B is disconnected, we assume that the choices of shifts in grading in the simplicial and Morse categories agree. All arguments extend with only minor modifications; e.g. in Lemma 3.8, we should require the appropriate neighbourhood of the boundary of Q 2,1 not to intersect any cell of Q 2,1 which is dual to a cell whose interior lies entirely in N .
A.5. From Floer to Morse. In order to construct a functor from the Fukaya category to the Morse category, we start by choosing the integers m k in Equation (A.4), whenever B is disconnected, to agree with those coming from Floer theory as discussed in Addendum A.1.
The next step is to construct a foliation of M B which we shall extend to M . Near each point b ∈ B, M B splits as the product of the disc cotangent bundle of B with a domain in C n−dim(B) . We equip this region with the product of the cotangent foliation of T * B with the model foliation L on D * L 1 #D * L 2 (with C n replaced by C n−dim(B) ) constructed in Section 5.
We claim that this foliation of C n−dim(B) can be chosen to be invariant under the action of the orthogonal group O(n − dim(B)) embedded in unitary group (in Figure 7, this corresponds to the invariance under rotation by π), which is the structure group for the normal bundle of T * B in M . To see this, recall that we first constructed a foliation by affine Lagrangian planes in Equation (5.8), which we then deformed, using a Hamiltonian flow. Since only the norm of a point in R n−dim(B) enters in the construction in Equation (5.8), the corresponding foliation is tautologically invariant under O(n − dim(B)); one can then easily check that the construction of the deforming Hamiltonian flow can be made invariant, say by averaging it over the action of the orthogonal group.
We conclude that the foliations defined locally on neighbourhoods of points of B are compatible with each other, and define a foliation on a neighbourhood of B in M which agrees with the cotangent bundle foliations of T * Q i away from a neighbourhood of B, and hence extends to all of M . To construct a functor in this case, note that Condition (5.11) makes sense as stated, but that we cannot choose f i,j to be given by the squared length of a normal vector as this function is only Morse-Bott. However, choosing f i,j to be a C 1 -small generic perturbations of this fibrewise quadratic function, one concludes that, away from a small neighbourhood of B, the distance to B increases (or decreases) along the appropriate gradient flow, to that the analogue of Lemma 5.3 holds.
With the choice of Hamiltonian perturbations coming from (5.11), we obtain an identification between generators of Floer and Morse complexes, and we may carry through the remainder of the construction of an A ∞ functors. The discussion of which moduli spaces are counted, as well as issues of transversality require no modification. As to compactness, note that defines a Lagrangian submanifold of the total space of N B ⊗ C, and hence a Lagrangian in M locally near B. In analogy with Equation (6.4), we consider the submanifold of M where the subscripts stand for the radii of various neighbourhoods. Working in charts near each point b ∈ B, the discussion of Section 6 shows that the boundary of this manifold with corners is transverse to the Liouville flow, and hence can be smoothed to a Liouville subdomain M mi ⊂ M . As long as the parameter ǫ in the construction of the foliation is chosen much smaller than δ, Lemma 5.12, proved in Section 6 by using the contact type condition near ∂M mi and ∂M in applies in the clean intersection case as well.