Learning How to Practice Software Engineering

J.Konstapel,Leiden,19-3-2026. All Rights Reserved.

Spring naar een begrijpelijke versie hier.


The Geometry of Learning: A Non-Commutative Model of Cognitive Development

Abstract

Learning is fundamentally an ordered process, yet our theoretical models often fail to account for the dynamical consequences of sequence. This essay introduces a formal framework that reconceptualizes learning not as the passive accumulation of content, but as a trajectory through a non-commutative cognitive state space. By representing cognitive operations as rotations in a quaternion algebra, the model provides a unified mathematical structure for three core phenomena: sequence-dependent learning trajectories, iterative deepening (the spiral curriculum), and the sudden, structural reorganization known as transformative learning. The latter, termed phase inversion, is derived from the topology of the SU(2) to SO(3) double cover and is formally triggered by the conjunction of a completed operational cycle and an expectation failure, grounding an abstract geometric necessity in a concrete cognitive theory. The framework further posits that the structure of learning is not theoretically prescribed but emerges from practice; theory itself is a compression of a traversed history of failures. An inductive algorithm is proposed for recovering this structure from empirical data. The model is applied in detail to the domain of software engineering apprenticeship, generating specific, testable predictions about developer development. This essay argues that this framework offers a minimal, formal foundation for understanding and designing effective learning trajectories across all domains.

1. Introduction: The Primacy of Order in Cognitive Change

It is a truth both intuitively held and empirically verified that the order in which we encounter material fundamentally shapes what we learn. A student introduced to the elegant abstractions of calculus before the messy realities of kinematics will develop a different cognitive relationship to mathematics than one who has first grappled with the physics of motion. Foundational pedagogical theories implicitly acknowledge this. Bruner’s (1960) spiral curriculum, Kolb’s (1984) experiential learning cycle, and Mezirow’s (1991) transformative learning theory all depend on sequence. Yet, they share a critical limitation: they describe what changes—the stages, the cycles, the perspectives—but lack a formal, dynamical account of how ordered operations generate these changes.

Contemporary computational models, from connectionist networks to Bayesian inference, treat learning as an update process on a cognitive state, typically a vector of weights or a probability distribution. In these models, the order of updates is often commutative, or its effects are averaged out, failing to capture the path-dependent nature of real-world learning. The empirical literature is replete with evidence that order is not a trivial variable. It is central to concept formation (Tennyson & Cocchiarella, 1986), the development of expertise (Chi, Feltovich, & Glaser, 1981), and the timing of those profound, restructuring events we call transformative learning (Mezirow, 1991).

This essay proposes a radical departure: a formal framework in which learning is the dynamical evolution of a cognitive state through a non-commutative geometry. We will argue that by representing cognitive operations as non-commuting operators in a quaternion-valued space, we can derive the core phenomena of learning from first principles. The central thesis is that the sequence of cognitive operations is not merely a pedagogical preference but a geometric necessity, and that the most profound learning events are topological in nature.

2. The Formal Framework: Cognition on a Hypersphere

To build a model where order matters intrinsically, we must move beyond the commutative arithmetic of real numbers. The requirements are clear: we need an algebra that can support multiple, independent cognitive operations whose composition is order-dependent.

2.1 The Structural Necessity of Quaternions

The choice of quaternion algebra ((\mathbb{H})) is not an arbitrary flourish but a structural imperative. The real numbers ((\mathbb{R})) offer no mechanism for non-commutativity. The complex numbers ((\mathbb{C})), with their single imaginary axis, can represent at most one rotation operator, insufficient for a multi-faceted model of cognition. The octonions ((\mathbb{O})), while offering seven imaginary axes, are non-associative, meaning ((ab)c \neq a(bc)). This creates profound formal difficulties for composing operations, which must be unambiguous. The quaternions, discovered by Hamilton (1844), are the minimal algebraic structure that satisfies all necessary criteria: they are associative, normed, and contain three independent imaginary units ((\mathbf{i}, \mathbf{j}, \mathbf{k})) that generate non-commuting rotations. They are, therefore, the natural formal home for a three-operator learning model.

2.2 The Cognitive State as a Point on (S^3)

We represent the cognitive state at time (t) as a unit quaternion:
[q(t) = a(t) + b(t)\mathbf{i} + c(t)\mathbf{j} + d(t)\mathbf{k}, \quad |q(t)| = 1]
This normalizes the state onto the three-sphere (S^3), a hypersphere in four-dimensional space. The components are not arbitrary numbers but carry specific cognitive meaning:

  • (a(t)) – The Scalar of Coherence: This component represents integrated, stable knowledge. It is understanding that has been resolved, internalized, and is now available for fluent, generative use. It is the “what” and “why” that remains after the “how” has been practiced.
  • (b(t), c(t), d(t)) – The Vector of Differentiation: These imaginary components represent active cognitive operations. They are the tensions being held, the distinctions being made, the perspectives being actively processed. A high magnitude in the imaginary vector ((|\text{Im}(q)|)) indicates a state of high cognitive load and active differentiation, while a low magnitude signals integration.

2.3 Cognitive Operators as Rotations

We posit three fundamental, irreducible cognitive operations, each corresponding to a conjugation operator defined by the imaginary units. These are inner automorphisms of (\mathbb{H}):

  • (L_i) (Observation): (q \mapsto \mathbf{i}q\mathbf{i}^{-1}). This operator differentiates perceptual input. It is the act of noticing, tracing, and registering distinctions in the experiential field. It corresponds to Kolb’s concrete experience and reflective observation.
  • (L_j) (Abstraction): (q \mapsto \mathbf{j}q\mathbf{j}^{-1}). This operator forms general schemas. It abstracts principles, categories, and patterns from observed instances. It is Kolb’s abstract conceptualization.
  • (L_k) (Application): (q \mapsto \mathbf{k}q\mathbf{k}^{-1}). This operator tests abstractions in the world. It deploys schemas in new contexts, generating outcomes that either confirm or challenge the current structure. It is Kolb’s active experimentation.

These are (180^\circ) rotations in the imaginary subspace. Their critical feature is non-commutativity: (L_i L_j(q) \neq L_j L_i(q)). This is the formal heart of the model. The sequence in which a learner observes, abstracts, and applies determines their trajectory, a truth any educator recognizes. A student who applies a formula before understanding its derivation (application before abstraction) ends up in a different cognitive place than one who does the reverse, even if both eventually cover the same material.

State evolution is governed by the sequential or continuous application of these operators, with their activation rates ((\omega_m(t))) determined by the pedagogical context.

3. Helical Trajectories: The Geometry of Iterative Deepening

Under structured, repeated iteration—as in a well-designed spiral curriculum—the dynamics produce helical trajectories on (S^3). The learner revisits similar cognitive operations (the rotational component), but from a shifted orientation, representing a deeper level of understanding (the axial component). The helix’s pitch, (P = da/d\theta), quantifies the rate of integration per cognitive cycle. This is the formal expression of Bruner’s insight: each pass through the material is structurally related to the last but yields a qualitatively richer understanding. Crucially, pitch is a designable property of a curriculum, determined by the frequency and depth of integrative phases.

4. Phase Inversion: The Topology of Transformation

The most powerful prediction of the model lies in its account of transformative learning.

4.1 The SU(2) Double Cover

A fundamental property of quaternions is the two-to-one mapping from the group of unit quaternions, SU(2), to the group of three-dimensional rotations, SO(3). Every rotation in our familiar 3D space corresponds to two antipodal points on (S^3): a quaternion (q) and its negation (-q). This is the SU(2) (\rightarrow) SO(3) double cover. While (q) and (-q) represent the same observable orientation (the same rotation in 3D space), they are distinct internal states.

4.2 Phase Inversion as a Learning Event

We define phase inversion as the topological transition (q \rightarrow -q). The learner’s observable performance (their behavior, the topic they are working on) may appear similar, but their internal cognitive structure has been fundamentally reorganized: every relational orientation has been flipped. This is not a metaphor for a “change in perspective”; it is a formal consequence of the geometry.

The transition itself is not a continuous rotation but a discrete jump, effected by the inversion operator (\mathcal{I}: q \mapsto -q). This operator is not in the connected component of the identity in SU(2); it cannot be reached by gradual, unitary evolution. This formal property explains why transformative learning has the phenomenological character of a sudden, irreversible restructuring rather than a cumulative shift.

4.3 The Trigger: Expectation Failure

What activates (\mathcal{I})? The model finds its cognitive trigger in Schank’s (1982, 1986) theory of dynamic memory and expectation failure. Schank argues that learning is driven by the failure of our mental scripts—our structured expectations about how events unfold. When a prediction fails, the script itself becomes available for revision.

The model posits that phase inversion requires the conjunction of two conditions:

  1. Cycle Completion: The learner has just completed a full cycle through the operator sequence (e.g., (L_i \rightarrow L_j \rightarrow L_k)), returning the system to a point on (S^3) that is antipodal to its starting position. The topological condition for the jump is now met.
  2. Expectation Failure: At this precise moment of return, an expected operator does not arrive. The script that the learner implicitly held is violated (e.g., (| q(T) – L_{\text{exp}}(T)q(T^-) | > \epsilon)).

This conjunction is critical. Mere disruption or random failure does not produce transformation. Only when the system has been prepared by a structured cycle does the expectation failure act as the key to unlock the topological transition. This formalizes Mezirow’s (1991) “disorienting dilemma” and Kegan’s (1994) “limits of a current order of consciousness,” grounding them in a common geometric mechanism. Phase inversion is the dynamical signature of Schank’s “script failure,” Mezirow’s “perspective transformation,” and Kegan’s “developmental leap.”

5. Convergence: From Differentiation to Coherence

As learning stabilizes and mastery is achieved, the model predicts a specific pattern of convergence: (|\text{Im}(q(t))| \rightarrow 0). The active, effortful differentiations recede as the knowledge becomes integrated into the scalar component, (a(t) \rightarrow 1). The cognitive state becomes coherent and stable. The history of the learner’s journey is not lost, however; it is encoded in the direction from which they converged. This provides a formal description of fluency and predicts that learners who reach the same level of competence via different sequences will exhibit different profiles of transfer and understanding.

6. Practice Precedes Theory: Operator Induction from Failure

This framework has a profound implication for the relationship between theory and practice. The operator sequence (\sigma(t)) is not a universal prescription. It is domain-emergent, shaped by the unique failure structure of a practice—be it surgery, carpentry, or trading.

Theory, in this view, is not a prerequisite for practice but a late-stage compression of it. A formal theory ((\sigma_{\text{theory}})) is a reconstruction, (\mathcal{R}), of a traversed history of practical failures ((\sigma_{\text{practice}})). To transmit a theory without the corresponding failure history is to transmit a compression without the data it compresses. The learner can recite the theory but cannot use it, because the operator structure it encodes has not been internalized through experience.

To make this operational, the essay proposes an inductive algorithm that reconstructs the operator sequence from a history of failure events (F = {(t_m, \Delta q_m, q(t_m))}). By solving a combinatorial optimization problem to find the sequence (\hat{\sigma}) that best accounts for the observed deviations, we can, in principle, extract the hidden structure of a domain directly from a learner’s trajectory of errors. This offers a pathway for data-driven curriculum design.

7. Empirical Testability and Measurement

The model is not merely an abstract formalism; it generates a suite of testable predictions (P1-P6) that span sequence effects, trajectory structure, the timing of phase transitions, and the design of transfer. A key contribution is a proposed measurement protocol that maps the abstract quaternion components onto observable cognitive tasks, allowing for longitudinal tracking of learners through this state space.

8. Implications for Learning Design

The formal structure provides clear design principles:

  • Sequence is Structural: Pedagogy must be explicit about operator ordering.
  • Spiraling is Justified: The helix provides a geometric rationale for revisiting topics.
  • Transformation can be Engineered: Learning environments can be designed to create the conditions for phase inversion—structured cycles with built-in expectation failures at the point of return.
  • Integration is Necessary: Curricula must include phases specifically designed for consolidation, not just the introduction of new differentiations.
  • Start with Failure: The most effective curricula may be those that immerse learners in the characteristic failure patterns of a domain before introducing theoretical frameworks.

9. Conclusion

By representing the mind as a point on a hypersphere and cognitive operations as non-commuting rotations, this framework provides a unified formal language for learning. It integrates sequence dependence, iterative deepening, transformative restructuring, and the primacy of failure into a single, coherent geometry. Phase inversion, derived from the topology of the SU(2) double cover and triggered by the Schankian mechanism of expectation failure, offers a rigorous candidate for the long-sought mechanism of transformative learning. This model does not replace existing theories but formalizes and extends them, grounding the intuitions of Bruner, Kolb, Mezirow, and Schank in the bedrock of mathematical structure. It offers not only an explanation of how we learn but a blueprint for how we might design learning itself.


Case Study: The Software Engineering Apprentice

The power of the framework is best illustrated through application. Software engineering is an ideal testbed because its failures are recorded (e.g., compilation errors, bug reports), its sequence-dependence is documented (Robins, Rountree, & Rountree, 2003), and its practitioners report discrete moments of restructuring.

In this domain, the operators are mapped as follows:

  • (L_i) (Observation): Reading and tracing code.
  • (L_j) (Abstraction): Design, pattern recognition, and architectural thinking.
  • (L_k) (Application): Implementation, testing, and debugging.

The model predicts two major phase inversions in a developer’s journey. The first, from syntactic to semantic understanding, occurs when a novice, after cycles of tracing and implementing, finally gets code to compile (cycle completion) only to find it produces the wrong output (expectation failure). The internal representation flips: “correctness” is no longer about the compiler’s approval but about the program’s behavior.

The second, from semantic to architectural understanding, occurs when a competent developer, after cycles of writing functionally correct code, encounters a change request that their current system architecture cannot accommodate without massive restructuring. The expectation failure (“working code is finished code”) triggers a phase inversion where maintainability and structure become the primary concerns.

This analysis generates domain-specific predictions (P-SE1 to P-SE4) and offers a powerful critique of current pedagogy. Teaching design patterns (second-order compressions) before semantic fluency is achieved is like teaching literary theory to someone who is still learning to decode sentences. The case study argues for a “failure-first” curriculum, where novices are immediately immersed in debugging, extending, and fixing broken systems, allowing the operator structure of the domain to emerge from their own practice before formal theory is introduced.


Annotated Bibliography

Bruner, J. S. (1960). The Process of Education. Harvard University Press.
Bruner’s classic work introduces the concept of the “spiral curriculum,” the idea that any subject can be taught in some intellectually honest form to any child, and that complex ideas can be revisited at increasing levels of abstraction as the learner develops. This essay’s helical trajectory model provides a formal, geometric grounding for Bruner’s intuitive and influential idea, showing how the “spiral” is a necessary consequence of non-commutative, cyclic cognitive operations.

Busemeyer, J. R., & Bruza, P. D. (2012). Quantum Models of Cognition and Decision. Cambridge University Press.
This text provides a comprehensive overview of how the mathematical formalism of quantum theory—particularly concepts like superposition, interference, and non-commutativity—can be applied to model human judgment and decision-making. While the current essay’s quaternion model is distinct, it shares the core premise that non-classical probability and non-commutative operators are essential for capturing the dynamics of human cognition, placing this work within a broader, emerging research program.

Chi, M. T. H., Feltovich, P. J., & Glaser, R. (1981). Categorization and representation of physics problems by experts and novices. Cognitive Science, 5(2), 121-152.
This seminal empirical study demonstrates that experts and novices organize their knowledge differently. Experts categorize physics problems based on deep principles (e.g., conservation of energy), while novices categorize them based on surface features (e.g., “inclined plane problems”). This essay’s framework explains this as a consequence of phase inversion: experts have undergone a structural reorganization that reorients their representation of the domain, a transition the model predicts occurs after cycles of expectation failure.

Dreyfus, H. L., & Dreyfus, S. E. (1986). Mind Over Machine: The Power of Human Intuitive Expertise in the Era of the Computer. Free Press.
The Dreyfus brothers’ five-stage model of skill acquisition (novice to expert) is a cornerstone of expertise studies. This essay’s software engineering case study explicitly connects their work, noting that the decreasing “pitch” of the learning helix—the slower axial advance at higher levels—corresponds to the transition from the rule-following competence stage to the intuitive, fluid performance of proficiency and expertise.

Hamilton, W. R. (1844). On quaternions. Proceedings of the Royal Irish Academy, 2, 424-434.
This is the original publication in which Sir William Rowan Hamilton announced his discovery of quaternions. The paper is included not as a cognitive science reference, but to acknowledge the source of the fundamental algebraic structure upon which this entire theoretical framework is built. It is a nod to the deep history of the mathematics being employed.

Kegan, R. (1994). In Over Our Heads: The Mental Demands of Modern Life. Harvard University Press.
Kegan’s constructive-developmental theory describes the evolution of consciousness through qualitatively distinct “orders of mind.” Each new order is not just an addition of knowledge but a fundamental transformation in how one makes meaning. This essay’s phase inversion mechanism is proposed as the formal dynamical process underlying these developmental leaps, triggered when the limits of the current order are encountered as expectation failures.

Kolb, D. A. (1984). Experiential Learning: Experience as the Source of Learning and Development. Prentice Hall.
Kolb’s experiential learning cycle is one of the most widely cited models of learning. This essay engages directly with his four-stage cycle (concrete experience, reflective observation, abstract conceptualization, active experimentation), reinterpreting it not as a linear progression but as a structured operator sequence. The three operators (Observation, Abstraction, Application) are a distillation of Kolb’s cycle, providing a more parsimonious and formally tractable foundation.

Mezirow, J. (1991). Transformative Dimensions of Adult Learning. Jossey-Bass.
Mezirow’s theory of transformative learning focuses on how adults revise the “frames of reference” through which they understand the world, often triggered by a “disorienting dilemma.” This essay provides a unified formal candidate for this phenomenon by grounding it in the phase inversion mechanism, arguing that a disorienting dilemma is a phenomenological description of an expectation failure occurring at the moment of topological readiness.

Pea, R. D., & Kurland, D. M. (1984). On the cognitive effects of learning computer programming. New Ideas in Psychology, 2(2), 137-168.
This paper is an early and influential critique of the claim that learning programming transfers to general thinking skills. Crucially for this essay, it documents the specific difficulties novices face, particularly in forming a coherent “notional machine” of how a computer executes code. This supports the model’s description of the exploratory phase, where novices accumulate failures without a coherent operator structure.

Robins, A., Rountree, J., & Rountree, N. (2003). Learning and teaching programming: A review and discussion. Computer Science Education, 13(2), 137-172.
This comprehensive review synthesizes decades of research on programming education. It provides strong empirical backing for the software engineering case study, confirming the sequence-dependence of learning to program and documenting the discrete, qualitative shift from syntactic to semantic understanding that the model identifies as the first phase inversion.

Schank, R. C. (1982). Dynamic Memory: A Theory of Reminding and Learning in Computers and People. Cambridge University Press.
Schank, R. C. (1986). Explanation Patterns: Understanding Mechanically and Creatively. Lawrence Erlbaum.
In these works, Schank develops his theory of dynamic memory, where knowledge is organized into scripts. Learning, in this view, is driven by the failure of these scripts to predict events, forcing the creation of new explanatory structures. This essay integrates Schank’s theory as the cognitive trigger for the geometric phase inversion, providing a formal distinction between script reinforcement (helical progression), script revision (local perturbation), and script failure (phase inversion).

Sorva, J. (2012). Visual Program Simulation in Introductory Programming Education. Aalto University.
Sorva’s doctoral thesis is a deep dive into the “notional machine” problem in computing education—the challenge novices face in building a mental model of program execution. This essay’s model connects this phenomenon to the high magnitude of the imaginary vector ((|\text{Im}(q)|)) in the exploratory phase, where a novice holds many unresolved tensions without a coherent framework for integrating them.

Tennyson, R. D., & Cocchiarella, M. J. (1986). An empirically based instructional design theory for teaching concepts. Review of Educational Research, 56(1), 40-71.
This paper provides a rigorous empirical review of concept formation, demonstrating that the order of examples and non-examples significantly impacts learning outcomes. It serves as a key piece of evidence for the essay’s opening claim that order effects are real and well-documented, establishing the empirical problem that the non-commutative model aims to solve.

Begrijpelijke Nederlandse Versie

De Geometrie van Leren
Een formeel model voor cognitieve ontwikkeling op basis van quaternionenalgebra en niet-commutatieve geometrie

J.konstapel,Leiden,19-3-2027.

Samenvatting
Leren is fundamenteel een kwestie van volgorde, maar bestaande modellen negeren de dynamische consequenties daarvan. Dit artikel presenteert een formeel raamwerk waarin leren geen passieve accumulatie is, maar een traject door een niet-commutatieve cognitieve ruimte. Cognitieve operaties worden gemodelleerd als rotaties in een quaternionenalgebra. Dit levert een structuur voor drie fenomenen: volgorde-afhankelijke leertrajecten, iteratieve verdieping (spiraalcurriculum) en plotselinge herstructurering (transformationeel leren), hier fase-inversie genoemd.

1. Waarom volgorde de kern van leren is
De volgorde waarin kennis wordt aangeboden bepaalt wat geleerd wordt. Verschillende volgordes leiden tot verschillende cognitieve structuren. Bestaande theorieën erkennen dit impliciet, maar missen een formeel dynamisch model. Dit raamwerk beschouwt leren als evolutie in een niet-commutatieve geometrie.

Centrale these:
De volgorde van cognitieve operaties is een geometrische noodzaak. Ingrijpende leermomenten zijn topologisch van aard.

2. Het formele raamwerk: cognitie op een hypersfeer

2.1 Quaternionen
Quaternionen vormen de minimale structuur die niet-commutatieve operaties mogelijk maakt. Ze bevatten drie onafhankelijke imaginaire eenheden (i, j, k).

2.2 Cognitieve toestand
De cognitieve toestand wordt gemodelleerd als:

q(t) = a(t) + b(t)i + c(t)j + d(t)k, met |q(t)| = 1

  • a(t): geïntegreerde, stabiele kennis
  • b(t), c(t), d(t): actieve cognitieve processen en spanningen

2.3 Cognitieve operatoren

  • Observeren: q → iqi⁻¹
  • Abstraheren: q → jqj⁻¹
  • Toepassen: q → kqk⁻¹

Deze operatoren zijn niet-commutatief. De volgorde bepaalt het leertraject.

3. Helische trajecten
Herhaalde leerprocessen vormen een helix. Elke cyclus verdiept begrip.
De spoed van de helix (P = da/dθ) meet integratie per cyclus.

4. Fase-inversie

4.1 Structuur
Elke toestand q heeft een tegenhanger −q. Ze lijken extern gelijk maar zijn intern verschillend.

4.2 Definitie
Fase-inversie: q → −q
Een plotselinge herstructurering van cognitie.

4.3 Voorwaarden

  1. Volledige cyclus (observeren → abstraheren → toepassen)
  2. Gefaalde verwachting op het juiste moment

Dit verklaart transformationeel leren als discrete sprong.

5. Convergentie
Bij meesterschap verdwijnt actieve spanning:

|Im(q)| → 0 en a(t) → 1

Kennis wordt stabiel en geïntegreerd. Verschillende leerpaden leiden tot verschillende vormen van begrip.

6. Praktijk gaat voor theorie
Theorie ontstaat uit falen in de praktijk. Zonder die faalgeschiedenis blijft theorie inert.
De volgorde van leren moet worden afgeleid uit fouten, niet vooraf opgelegd.

7. Implicaties voor leerontwerp

  • Volgorde is structureel
  • Spiraleren is geometrisch noodzakelijk
  • Transformatie is ontwerpbaar
  • Integratie vereist aparte fasen
  • Begin met falen

Casestudy: software-engineering

Operatoren:

  • Observeren: code lezen
  • Abstraheren: ontwerpen
  • Toepassen: implementeren

Fase-inversies:

  1. Syntactisch → semantisch begrip
    Code werkt technisch maar niet functioneel
  2. Semantisch → architectonisch begrip
    Werkende code blijkt onhoudbaar

Conclusie: een falen-eerst curriculum is effectiever.

Kernidee
Leren is geen accumulatie van kennis, maar een traject door een niet-commutatieve ruimte waarin volgorde, herhaling en verstoring structurele transformaties veroorzaken.

Als je wilt kan ik dit nog compacter maken of juist geschikt maken als publiceerbare tekst (essay / paper).