Are free $E_\infty$-algebras in spaces closed under pullbacks? (as a full subcategory of all $E_\infty$-algebras in spaces) Let's call an $E_\infty$-algebra $A$ in spaces free if there is a space $A_0$ and an equivalence of $E_\infty$-algebras:
$
  \coprod_{n \ge 0} (A_0)^n_{h\Sigma_n} \simeq A.
$
Consider a diagram of $E_\infty$-algebras in spaces
$$
  A \longrightarrow B \longleftarrow C
$$
and assume that each of them is free in the above sense.
However, the maps $A \to B \leftarrow C$ are not required to be free, i.e. they don't have to send $A_0$ to $B_0$ or $C_0$ to $B_0$.

In this setting, is the homotopy pullback $A \times_B C$ always free?


I've convinced myself in a very roundabout way that this should be true, but would be very grateful for a proper proof or even better a reference.
I think a hands-on approach using the formula for the free $E_\infty$-algebra might work, but the combinatorics will get quite tricky.
As an example, consider the case where $A, B, C$ are all free on a point and the maps $A \to B \leftarrow C$ both send the generator to twice the generator.
Then I think the resulting pullback $A \times_B C$ is free on a space with infinitely many components.
Let me give some more details on what happens in this example. I'll think of all the involved 1-types as groupoids, so $A, B, C$ are all represented by the groupoid of finite sets and bijections $\mathrm{FB}$, which is symmetric monoidal under disjoint union.
In my example the two maps correspond to the functor $F: \mathrm{FB} \to \mathrm{FB}$ that sends $a \mapsto a \times \{0,1\}$.
Now the homotopy pullback can be computed in terms of groupoids. The resulting groupoid $\mathcal{G}$ has as objects triples $(a, b, \varphi)$ where $a, b \in \mathrm{FB}$ are finite sets and $\varphi: a \times \{0,1\} \cong b \times \{0,1\}$ is a bijection. Morphisms are tuples of bijections compatible with $\varphi$.
Define the set of connected components of such an object $(a, b, \varphi)$ as the pushout $\pi_0(a,b,\varphi) = a \amalg_{a \times \{0,1\}} b$ where the right-hand map is $\varphi$ composed with projection to $b$.
This defines a symmetric monoidal functor $\pi_0: \mathcal{G} \to \mathrm{FB}$.
Let's say an object is connected if $\pi_0(a,b,\varphi)$ is a point.
Then I claim that $\mathcal{G}$ is freely generated under disjoint union by connected objects.
This is probably easiest to see by thinking of the objects as directed graphs with red and blue edges, where the vertices are $a \times \{0,1\}$, the blue edges are $(a, 0) \to (a, 1)$, the red edges are $\varphi^{-1}(b,0) \to \varphi^{-1}(b,1)$. Only graphs where every vertex is incident to exactly one blue and one red edge are allowed.
Now this category is a free symmetric monoidal groupoid on the connected graphs, of which there are countably infinitely many.
 A: This is not an answer, but I think it's really interesting to look at an example where this statement fails for commutative monoids and the analogous statement for $E_\infty$-algebras works out. This is too long for a comment, so here it goes:
By reverse engeneering the theorem about Krull monoids that @TimCampion mentions in his comment, we can find the following minimal example.
Consider the pullback of free commutative monoids:
$$
 \mathbb{N}^2 \xrightarrow{\;\;+\;\;} \mathbb{N} \xleftarrow{\;\;\cdot2\;\;} \mathbb{N}
$$
The pullback is $\{(x,y) \in \mathbb{N}^2 | x + y \equiv 0 \mod 2\}$. This can't be a free commutative monoid: any generating set must contain $\{(2,0), (1,1), (0,2)\}$ (and this is a generating set), so it would have to be free on at least three generators. On the other hand we know that it's group-completion is $\mathbb{Z}^2$, so if it was free it would have to have two generators.
Why does this not give a counter-example to the $E_\infty$-algebra question?
Let's model the free $E_\infty$-algebra on a point by $\mathrm{FB}$, the groupoid of finite sets and bijections, and accordingly the free $E_\infty$-algebra on two points by $\mathrm{FB}^2$, the groupoid of pairs of finite sets.
Then the analogous diagram to the above would be:
$$
 \mathrm{FB}^2 \xrightarrow{\;\;\amalg\;\;} \mathrm{FB} \xleftarrow{\;\;\times \{1,2\}\;\;} \mathrm{FB}
$$
An object in the homotopy pullback groupoid can be described as a triple $(X, Y, Z)$ of finite sets together with a bijection $\varphi:X \amalg Y \cong Z \times \{1,2\}$.
We can forget about $\varphi$ and $Z$ and instead remember the directed pairing induced by pairing $\varphi^{-1}(z,1)$ with $\varphi^{-1}(z,2)$.
So the pullback is the groupoid of tuples $(X, Y)$ together with a directed pairing on $X \amalg Y$.
This is symmetric monoidal under disjoint union and as a symmetric monoidal groupoid it's generated by four objects:
$(\{a,b\}, \emptyset)$, $(\{a\}, \{b\})$, $(\{b\}, \{a\})$ and $(\emptyset, \{a,b\})$ each with the directed pairing $a \to b$.
So in this $E_\infty$-algebra setting the pullback is actually free on four generators.
A: Yes,
the full subcategory
$\mathrm{Mon}_{\mathbb{E}_\infty}(\mathcal{S})^{\rm free} \subset \mathrm{Mon}_{\mathbb{E}_\infty}(\mathcal{S})$
on those $\mathbb{E}_\infty$-monoids that are equivalent to a free $\mathbb{E}_\infty$-monoid, is closed under all finite limits and retracts.
This is Corollary 2.1.28 and 2.1.29 of my joint paper with Shaul Barkan. "The equifibered approach to $\infty$-properads".
While I really like the proof we give, it has the disadvantage of being somewhat implicit:
it doesn't tell you at all what the pullback is free on.
So below I'll give a different proof that isn't in the paper, but might be in a future one.

"Equifibered" maps
This proof uses some of the "equifibered" machinery developed in the aforementioned paper, so I'll recall the needed facts here.
(All of these have elementary proofs, see section 2.1 of the paper.)
We say that a morphism $f\colon M \to N$ in $\mathrm{Mon}_{\mathbb{E}_\infty}(\mathcal{S})$ is equifibered if the natural map
$$ 
            M \times M \longrightarrow (N \times N) \times_{N} M,
\qquad
(m_1,m_2) \mapsto ( (f(m_1), f(m_2)), m_1+m_2)
$$
is an equivalence.
(Here the pullback is taken over the addition map and $f$.)
Now one can show several facts about equifibered maps.
I'll write $\mathbb{F}(X) := \coprod_{n \ge 0} X^n_{h\Sigma_n}$ for the free $\mathbb{E}_\infty$-monoid on a space $X$.

*

*For any map of spaces $g:X \to Y$ the induced free map $\mathbb{F}(g)\colon \mathbb{F}(X) \to \mathbb{F}(Y)$ is equifibered.

*If $f$ is equifibered and $N$ is free, then $M$ is free and $f$ is a free map.

*Equifibered maps are closed under limits as objects of the arrow category $\mathrm{Ar}(\mathrm{Mon}_{\mathbb{E}_\infty}(\mathcal{S}))$.

It follows that $M$ is free if and only if it admits an equifibered map to $\mathbb{F}(*)$.

The proof:
The idea is to reduce the proof to the following "universal" example:
$$
\mathbb{F}(\mathbb{F}(*)) \xrightarrow{\ +\ } 
\mathbb{F}(*) \xleftarrow{\ +\ } 
\mathbb{F}(\mathbb{F}(*))
$$
Claim:
It suffices to show that the pullback of the "universal" cospan is free.
Proof idea:
An arbitrary cospan $f\colon \mathbb{F}(X) \to \mathbb{F}(Z) \leftarrow \mathbb{F}(Y) :\! g$ maps to the universal cospan by using the free map $\mathbb{F}(t): \mathbb{F}(Z) \to \mathbb{F}(*)$ coming from $t: Z \to *$
and then factoring the resulting
$$
\mathbb{F}(X) \xrightarrow{f} \mathbb{F}(Z) \xrightarrow{\mathbb{F}(t)} \mathbb{F}(*)
\qquad \text{ as } \qquad
\mathbb{F}(X) \xrightarrow{\mathbb{F}((\mathbb{F}(t) \circ f)_{|X})} \mathbb{F}(\mathbb{F}(*)) \xrightarrow{*} \mathbb{F}(*).
$$
So we get a map of cospans and hence a map of pullbacks:
$$
\mathbb{F}(X) \times_{\mathbb{F}(Z)} \mathbb{F}(Y)
\longrightarrow
\mathbb{F}(\mathbb{F}(*)) \times_{\mathbb{F}(*)} \mathbb{F}(\mathbb{F}(*))
$$
This map is equifibered because all of the maps between the cospans were free (and hence equifibered by 1) and equifibered maps are closed under pullbacks by 3.
(Note that this works even though the maps within the cospans aren't free.)
Now it follows from 2. that the general pullback is free if the universal one is.
Proof of the universal case
To check that the universal pullback is free we can rewrite it as a pullback of symmetric monoidal $1$-groupoids.
It is equivalent to:
$$
\mathrm{Ar}(\mathrm{Fin})^\simeq \xrightarrow{\ s\ }
\mathrm{Fin}^\simeq \xleftarrow{\ s\ }
\mathrm{Ar}(\mathrm{Fin})^\simeq.
$$
Here $\mathrm{Ar}(\mathrm{Fin})^\simeq$ is the maximal subgroupoid of the arrow category of finite sets and $s$ is the functor that sends an arrow to its source.
This pullback is equivalent to the following groupoid of diagrams:
$$
   \mathrm{Fun}( \bullet \leftarrow \bullet \rightarrow \bullet, \mathrm{Fin})^\simeq
$$
Now one can check directly that this groupoid is freely generated by those diagrams of finite sets $A \leftarrow C \to B$ where $A \amalg_C B$ is a single point.

What is the pullback free on?
To answer this question we can first answer it for the universal pullback.
There I claimed that it is free on diagrams of finite sets $A \leftarrow C \to B$ where $A \amalg_C B$ is a point.
These can be thought of as connected bi-partite graphs with vertices $A \amalg B$ and edges $C$.
The more general case will be fibered over this.
Now consider a cospan
$$
  \mathbb{F}(X) \xrightarrow{\ f\ } \mathbb{F}(*) \xleftarrow{\ g\ } \mathbb{F}(Y)
$$
This is not quite the most general case, but almost.
We can decompose $X = \coprod_{n \ge 0} (X_n)_{h\Sigma_n}$ where $X_n$ is the fiber of $X \subset \mathbb{F}(X) \xrightarrow{f} \mathbb{F}(*)$ at some point in $B\Sigma_n \subset \mathbb{F}(*)$ and similarly for $Y_n$.
We can think of $X$ and $Y$ as symmetric sequences and for a finite set $D$ of size $n$ I'll write $X(D) := X_n$.
Then the pullback is free on
$$
\operatorname*{colim}\limits_{A \xleftarrow{u} C \xrightarrow{w} B} \prod_{a \in A} X(u^{-1}(a)) \times \prod_{b \in B} Y(w^{-1}(b))
$$
where the colimit runs over connected bipartite graphs.
With a bit of imaginative thinking this can be identified with the connected composition product for bisymmetric sequences that Bruno Vallette introduces in his work on properads.
