Formalizing Categorical And Algebraic Constructions In Operator Theory