# Can composition of morphisms in a category be carried out on any subgraph of a commutative diagram, in-place?

Here is what the rule looks like to us and how we specify it to the app I'm writing.

I was wondering can you take any commutative diagram $$J$$ and apply this rule to a subgraph matching $$A \xrightarrow{a} B \xrightarrow{b} C$$ in place, all the while leaving another commutative diagram. Or does adding in the hypotenuse sometimes break commutativity of a larger diagram?

If it preserves commutativity, what is a simple proof?

Change every occurance of the new arrow $$b\circ a$$ to the subpath $$a, b$$.