Blocks and pulleys problem with friction - the condition for sliding
I encountered a problem with blocks and pulleys, which I'm not sure about. The diagrams I've drawn are given below. We need to find the minimal mass $M$ of the block $3$, such that block $1$ starts to slide against block $2$. The masses and friction coefficients are shown on the first diagram. Relevant forces are shown on the second diagram.
Important! I consider the case of blocks $1$ and $2$ moving together to the left with acceleration $a$, i.e. not sliding against each other, and try to find the maximal mass $M$ which makes it possible. I believe this is equivalent to the initial problem.
The second pulley is considered a part of the block $2$, so the forces acting on a pulley are considered acting on the block $2$. The cord is inextensible and massless, the pulleys are massless. 512
The maximal static friction between blocks $1$ and $2$ is taken to be equal to the kinetic friction.
The above diagram can be considered as a part of the problem statement. The below diagram is my take on the forces acting on the bodies in the direction of the movement. I'm not sure about the part marked with a question mark.
This is how I write the <PERSON>'s second law (for the direction of movement) for all three blocks:
$$(1)~~~ ma=4 \mu mg-T$$
$$(2)~~~ 2ma=2T-3 \mu mg-4 \mu mg$$
$$(3)~~~ Ma=Mg-T$$
If correct, these three equations allow us to find the three unknowns $M, a, T$.
I'm sure about the third equation, it's simple.
My questions are about the forces acting between blocks $1$ and $2$ - the area in question is shown on the second diagram.
Is the force, which makes Block $1$ accelerate to the left, only the (maximal) static friction $4 \mu mg$? And the tension $T$ (red arrow) is hindering this force?
Should we include the same force acting on the Block $2$ (by <PERSON>'s third law) and hindering its acceleration together with the friction between Block $2$ and the talbe (blue arrows)?
I hope this question is not off-topic, I'm not sure how to clarify it further. I have read through the duplicates, but found none (i.e., no question which helps me understand my own better). All of the problems are easier than mine.
I know all the relevant concepts, but I can't quite wrap my mind around the situation at hand, especially how the two blocks affect each other.
<PERSON> Just to be clear - after solving the system I get:
$$M= \frac{15 \mu}{4-\mu}m$$
Which makes sense numerically (i.e. mass is positive).
I'm basically asking, if my system of equations is correct?
P.P.S. I've drawn the second diagram with all the forces myself, and marked each of them by color. It was not given in the problem statement. 512