============== There are four main sections of the U.S. statute governing patentability, and you only ever read about the first and third:
101: Patentable subject matter (what you can patent)
102: Anticipation (someone else invented or described it)
103: Obviousness (two or more references, taken together, describe it)
112: Specification (here’s the statute)
Most of what you read is about 101: is software a “thing” or is it a “mathematical formula” and thus not patentable?