Does a free algebra over a nontrivial monad have a well-defined dimension? Let $(T,\mu,\eta)$ be a nontrivial monad on $\mathbf{Set}$. By nontrivial here I mean there is $X$ with $|T(X)|>1$.
Suppose that $TX \cong TY$ as $T$-algebras (both with the usual free $T$-algebra structure). Does it then follow that $X$ and $Y$ have the same cardinality ? (Which we could then define as the dimension of the free $T$-algebra, by analogy with vector spaces).
I think the motivation for this question is pretty clear (analogy with vector spaces, lots of examples), here are my thoughts :


*

*all the examples I know satisfy this property : vector spaces over a fixed field $k$, or more generally $R$-modules, groups,  boolean algebras, the ultrafilter monad, the powerset monad,... 

*If the monad $T$ is furthermore finitary, that is it preserves (as an endofunctor) filtered colimits, then the claim is true when either $X$ or $Y$ is infinite, this is not totally straightforward but not hard to show, I will add the details at the end of the question (*)

*If the monad has at least one finite $T$-algebra with cardinality $>1$, then the claim holds when either $X$ or $Y$ is finite. This is easy, details at (**).
-If the monad has $T$-algebras of arbitrary infinite cardinalities, then the claim holds when either $X$ or $Y$ is infinite. This relies on some (easy) cardinal arithmetic and will be detailed at (***)


*

*$T$ being nontrivial implies that it always reflects isomorphisms, which is weaker than what we want. This is standard and not too hard,  but I think the post is already long enough, so unless specifically asked to I will not detail this. 


-In the examples I gave one can notice that there are 2 extremely different behaviours : in the case of monoids, the ultrafilter monad, or the powerset monad, isomorphisms are "created", in the sense that an isomorphism of $T$-algebras between $TX$ and $TY$ always comes from a bijection $X\to Y$; whereas in other cases such as vector spaces or groups, there can be other isomorphisms, but there is a bijection between $X$ and $Y$. 
For the first behaviour, one can see that this is because somehow the monad is "positive", one can not cancel the "atoms" (elements of $TX$ of the form $\eta_X(x)$), and they are the only ones with this property.
This leads me to think one could define a notion of "positive monad" for which the proof would be easy, but I have not yet found the right definition (the ones I find either don't work or seem ad hoc). The idea would be that elements of the form $\eta_X(x)$ are precisely the $z$'s such that if $\mu_X(a)=z$, then $a=\eta_{TX}(z)$. The thing is, any algebraic characterization of these elements will give this behaviour, because then we can ensure that the isomorphism comes from a morphism $X\to Y$ and then the previous point (about reflecting isomorphisms) solves the question.
For the second behaviour (vector spaces and "weird" isomorphisms), I don't really know how to attack the problem. 
So my questions are, more specifically : is the result true in all generality, and if so, how can one prove it ? Could it be valid for nice categories other than $\mathbf{Set}$ (with an appropriate notion of nontriviality) ? If not, what are some nice conditions on $T$ that ensure that the result holds ? Are any of them similar to the vague idea of positivity that I tried to describe ?
EDIT : As was pointed out in the comments, it is not true for all monads, indeed there are some noncommutative rings without the IBP, and so it fails for finitely generated free modules. However, since $R$ modules always give a finitary monad, it still holds for infinitely generated free algebras, and so two questions remain : is it always true for infinitely generated free algebras ? (I now suspect that it is false) and what are some nice conditions on $T$ that yield a positive result ?
(*) this is essentially the same proof as for vector spaces : if $T$ is finitary, $X$ infinite and $f:TX\cong TY$ then for any $x\in X$, there is a finite $Y_x\subset Y$ with $f(\eta_X(x))\in TY_x$ and since $T$ is nontrivial, it reflects epimorphisms (this is standard and I will not detail it unless specifically asked to) so that $\bigcup_x Y_x = Y$. Therefore $|Y|\leq \aleph_0 |X|$, the converse holding as well. It is clear that by a similar argument, $Y$ is infinite so that these inequalities imply $|X|=|Y|$. 
This can be adapted to $<\kappa$-ary monads and sets of cardinality $\geq \kappa$ in an obvious manner but it didn't seem worth it to mention it.
(**) Suppose $h: TA\to A$ is a finite $T$-algebra with $|A|\geq 2$, suppose $X$ is finite and $TX\cong TY$ as $T$-algebras. Then the universal property of free algebras yields that $A^X \cong A^Y$ as sets. But $X$ is finite and $|A|\geq 2$ so $Y$ is finite as well and $|X|=|Y|$, therefore there is a bijection.
(* * *) :  We use the universal property of free algebras as for ( * *) and the fact that if two cardinals (here $|X|, |Y|$) have the same continuum function $\mu \mapsto \mu^\kappa$ on infinite cardinals $\mu$, then they are equal, cf the answer to my previous post here
 A: There is in fact a "universal" example where this fails for any given cardinals.  Let $A$ and $B$ be sets and define an $(A,B)$-Jónsson-Tarski algebra be a set $X$ equipped with an $A$-ary operation $f_b:X^A\to X$ for each $b\in B$ and a $B$-ary operation $g_a:X^B\to X$ for each $a\in A$ satisfying the equational axioms that say the induced maps $f:X^A\to X^B$ and $g:X^B\to X^A$ are inverse bijections.  (For $|A|=1$ and $|B|=2$, this is the usual notion of a Jónsson-Tarski algebra.)  Observe now that a free $(A,B)$-Jónsson-Tarski algebra on $A$ is the same thing as a free $(A,B)$-Jónsson-Tarski algebra on $B$, since $f$ and $g$ give a natural bijection between functions $A\to X$ and functions $B\to X$ for any $(A,B)$-Jónsson-Tarski algebra $X$.  
Moreover, suppose $T$ is any monad on $\mathbf{Set}$ and $f:TB\to TA$ be an isomorphism of $T$-algebras.  Then $f$ induces a natural bijection $X^A\to X^B$ for any $T$-algebra $X$, giving every $T$-algebra the structure of an $(A,B)$-Jónsson-Tarski algebra such that all $T$-algebra homomorphisms are also $(A,B)$-Jónsson-Tarski algebra homomorphisms.  This then induces a morphism of monads $J\to T$ where $J$ is the free $(A,B)$-Jónsson-Tarski algebra monad, and it is straightforward to check that this construction is reversible and thus gives a natural bijection between isomorphisms of $T$-algebras $TB\to TA$ and monad morphisms $J\to T$.  That is, $J$ is the free monad on $\mathbf{Set}$ with an isomorphism $JB\to JA$.
