"The analytic knowledge is known just by definition of the system we create" is more or less true under the modern conception of logic and deduction, largely developed due to the efforts of Frege, Peirce, Russell and others at the end of 19th, beginning of 20th century. It was not true on the conception of logic available in Kant's time, Aristotle's syllogistic being the paradigm. It only allowed a primitive form of conceptual inference, basically unpacking the definitions and applying simple syllogistic figures.
Kant was right to point out that theorems of Euclidean geometry do not follow from Euclid's axioms this primitive way. So he was right that mathematics is not analytic on his conception of "analytic", but not on Russell's much more expanded conception. Russell's writing is not particularly crisp on the difference, but he was aware of it as one of the architects of the shift. As he wrote in the introduction to Principles of Mathematics (1903, not to be confused with later Principia):
"It seemed plain that mathematics consists of deductions, and yet the orthodox accounts of deduction were largely or wholly inapplicable to existing mathematics... In this fact lay the
strength of the Kantian view, which asserted that mathematical reasoning is not strictly formal, but always uses intuitions, i.e. the a priori knowledge
of space and time."
Here is a more detailed explanation from Azzouni's Why Do Informal Proofs Conform to Formal Norms?:
"Analytic statements are to be recognized by an analysis of the concepts involved in those statements. It can be proven in Euclidean geometry that the interior angles of any triangle sum to 180◦. The proof proceeds, however, not by an analysis of a free-standing triangle (and its conceptually-given parts), but by embedding it within a larger figure. This is a ubiquitous and crucial aspect of mathematical proof: proofs are routinely facilitated (and often must be facilitated) by introducing concepts and methodology that — strictly speaking — go beyond (sometimes far beyond) the conceptual givens of what’s to be shown. What makes this a problem for Kant is that (for him and for his contemporaries) analyticity exhausts the resources of logic.
[...] Back then, the notion was restricted, pretty much, to an analysis of concepts almost along the model of Lego blocks. A concept — corresponding to a word — was taken to be composed of parts, and recognizable as so made up. This was why Kant’s examples of a priori synthetic truths, such as “7+5=12,” were successful counterexamples. It was presumed recognizable that the concept of “+”, for example, isn’t part of the notion of “12”. The contemporary notion... has additional resources."
However, Kant's notion of synthetic a priori is still non-empirical, unlike "synthetic" as it is largely taken to be today. This is because "a priori" is associated with conceptual/intellectual capacities only, if they are admitted at all. Kant, however, believed that we have an additional a priori faculty, the so-called "pure intuition", a kind of internal form of sensibility where the a priori synthesis of mathematics takes place. This is how he filled in the missing piece that is now fulfilled by far more expansive analytic use of definitions with the resources of propositional and quantificational logic. His solution was ingenious for his time, but it did not generalize well beyond arithmetic and geometry, the way modern one does. 4D space was a problem for Kant's original conception, just as non-Euclidean geometry was, although his successors came up with ways of extending "synthetic" to accomodate it. Azzouni again:
"It’s remarkable that this problem was first discovered by Kant, who wasn’t a professional mathematician (although, of course, he was familiar with mathematics)... It’s more remarkable that this “explanatory gap” wasn’t seen by Leibniz, a first-rate mathematician as well as philosopher, who — otherwise — thought deeply and far-sightedly about the nature of mathematical proof.
[...] The problem may be posed this way: a medium for proof is required that bridges the gap between the concepts involved in the statement of a theorem, and those that arise in a proof of that theorem. Kant, notoriously, hoped that intuition (of space and time) would fill that gap. This solution loses plausibility once the scope of mathematical proof is recognized to extend well beyond the traditional domains of geometry and number."
As for randomness, it is not relevant to the modern, empirical, notion of synthetic. That part of knowledge that necessarily involves external senses would be synthetic, whether the world is deterministic or not makes no difference. It is possible, of course, that God, or Laplace's demon, may be able to find out what goes on in advance by using deterministic laws, but they would have to know, analytically, that those laws hold. We do not.
Kant actually believed that we do know some of them a priori (Newton's laws), but that is a different story, and he believed that we know them synthetically a priori. Even when he speculates about God in Critique of Judgement he tends to suggest that God's intellect is intuitive ("archetypal"), and hence his perfect knowledge is all synthetic a priori. It is the wretched creatures like us who in addition need the analytic crutch of discursive intellect.