A binary operation on a set is a function
.
The critical point is closure: whenever and lie in , the product must also lie in .
Binary operations may or may not be associative, commutative, or possess identities and inverses. Those are extra properties, not part of the bare definition.
One-line intuition
A binary operation is a rule that combines two elements of the set and stays inside the set.