isDirectSummand(L, M)This function tries to detect whether $L$ is a direct summand of $M$ by searching for maps $L \to M$ and $M \to L$ whose composition is an isomorphism of $L$.
The computation is randomized, so a return value of true certifies that a summand was found, while a return value of false only means that no splitting was found within the allotted number of attempts. The alias isSummand is provided for convenience.
When $L$ is free, the method instead searches for a surjection $M \to L$, which is enough to split off a free summand.
The object isDirectSummand is a method function with options.
The source of this document is in /build/reproducible-path/macaulay2-1.26.06+ds/M2/Macaulay2/packages/DirectSummands/docs.m2:680:0.