Mathematics is derived from Logic. In the mathematical sense an entity / relationship can be True (2x2 = 4), False (2 x 2 = 5), Ambiguous ( x=y where we don't know y) or inherently nonsense ("This statement is false"), usually called a paradox.
But this is very narrow definition of true.
Set Theory and cardinal counting can be derived from Logic.
All mathematics can thus derived from logic. A computer has a CPU made from subsystems that are defined in pure logic "Truth tables", a table of true and false outputs for all possible combinations of true and false on the inputs. This CPU (containing the ALU, Arithmetic Logic Unit made from logic gates) then executes the program in a totally deterministic way (the same program instructions with same data give same answer always). Our brains do not work like this, no matter what some people claim.
You can replace all the electronic logic gates with relays or cogwheels & pins* that have the same truth tables and the same program and data will give the same results, just a lot slower. Complexity only allows faster execution of the program, or more complex compound instructions, or programs running in parallel. Never ever will more memory capacity or circuit complexity make it more "intelligent". It has no original thought or consciousness. It's only a collection of interconnected truth tables "executing" program instructions that are 100% based on logic and deterministic. It's a machine running on Truth. If true A.I. was something we knew how to program we could have had a slow one over 50 years ago. More powerful / faster / complex computers makes it no easier a problem to solve. Essentially we have no idea how to codify any aspect of Intelligence, creativity, problem solving or originality as tables of True and False. We are not even sure what they are!
[* a totally mechanical copy of an Intel Pentium, or rather easier, a 6502 CPU is possible. It would be very very slow. Programs would be stored and run from punched cards or paper tape, like in fact computers used to use, derived from Hollerith census machine cards (Hollerith became IBM), developed from
Jacquard Loom 1801 programming cards. Player piano is a similar idea. The motive power is anything to turn the drums and cogs, such as water, wind, "clockwork"(wound spring), steam engine or even electric engine. This is what Babbage was trying to do. He ran out of time and money to build it. Conrad Zuse in Germany, about 1938 made an electro-mechanical computer out of relays]