[Refactoring] TriMat has a terminal object
[Refactoring] Stream terminal object
Add proof for canonicul cut