Tests for equality of subrings. The ambient rings of the subrings A and B should be the same.
The object subalgEquals is a method function.