Boolean algebra has laws that let you transform expressions. Commutative: and . Order doesn't matter for AND and OR.
Associative: and . Grouping doesn't matter for chains of the same operator.
Distributive: and . You can distribute AND over OR and vice versa.