A Mathematical Framework for Four-Dimensional Chess: Extending Game Mechanics Through Higher-Dimensional Geometry
Abstract
1. Introduction
- Mathematical formalization
- Algorithmic and ruleset design
- Visualization and interaction in 4D space
1.1. Motivation and Theoretical Context
1.2. Contributions
- Mathematical Contributions
- 1.
- Uniform rook mobility: a corrected, elementary proof that all squares yield mobility exactly 28, where mobility denotes the number of squares reachable by a single legal move.
- 2.
- Rook graph connectivity: proof that the graph is connected with diameter 4.
- 3.
- Bishop invariants and connectivity: bishop moves preserve coordinate-sum parity; each parity class is provably connected via constructive diagonal sequences that handle boundary detours.
- 4.
- Knight mobility: complete characterization of interior and boundary-sensitive degrees with exhaustive enumeration across all 4096 squares.
- Algorithmic and Ruleset Contributions
- 1.
- Comprehensive 4D chess engine with
- full move generation,
- attack-map construction,
- legality filtering across all kings,
- generalized castling and en passant rules,
- repetition and 50-move rule detection,
- Zobrist-style hashing extended to 4D: constant-time hashing of 4D board states for fast position comparison and reproducible state enumeration.
- 2.
- Complete reproducibility of enumeration and empirical results through publicly available code and online engine.
- 3.
- Formalization of multi-king checkmate: a ruleset that generalizes classical attack and legality concepts to multiple royal pieces.
- Visualization and HCI Contributions
- 1.
- A 64-slice 3D visualization of the 4D chess hypercube, rendering all -slices simultaneously.
- 2.
- Interactive camera navigation via quaternions, layered transparency, and consistent coordinate annotation.
1.3. Paper Structure
2. Related Work
2.1. Generalized Chess and Computational Complexity
2.2. Move Graphs on : Product-Graph Structure
- Rook graphs and Hamming graphs
- King graphs as strong products
2.3. Bishop and Knight Graphs: Invariants and Leapers
- Bishop graphs and parity structure
- Knight graphs as higher-dimensional leaper graphs
2.4. Higher-Dimensional Knight Graphs and Tours
2.5. Spectral and Metric Properties of Product Move Graphs
2.6. Toroidal Models and Boundary Effects
2.7. Visualization of Higher-Dimensional Geometric Structures
- 1.
- Caplan [18] explores GPU-assisted 4D slicing for spacetime meshes.
- 2.
- Kopczyński and Celińska-Kopczyńska [19] examine hyperbolic embeddings that preserve adjacency.
- 3.
- Cavallo [20] demonstrates interactive 4D rotations in Unity, revealing the cognitive challenge of full SO(4) manipulation, that is, the group of orientation-preserving rotations acting on ℝ4.
2.8. Prior 4D Chess Implementations
- 1.
- adopt heuristic movement extensions,
- 2.
- lack mathematical formalization of displacement sets,
- 3.
- do not analyze move graphs or invariants,
- 4.
- and rarely provide rigorous rule definitions for special mechanics such as castling and en passant.
- 1.
- a fully formal Z4 ruleset,
- 2.
- mathematical analysis of move graphs,
- 3.
- generalized definitions of special rules,
- 4.
- a functioning engine with complete legality checking,
- 5.
- a 64-slice visualization displaying the entire 4D board at once, and
- 6.
- reproducible enumeration and empirical results.
3. Mathematical Framework
3.1. 4D Chess Board as a Vector Space
3.2. Adjacency in the 4D Lattice
3.3. 4D Initial Position Specification
- Central boards (both colors present):
- White-only boards:
- Black-only boards:
- Empty boards:
3.4. Win Conditions with Multiple Kings
- Attack map on
- Check, legal moves, and multiple kings
- Checkmate and stalemate with multiple kings
- 1.
- Player is checkmated in position if
- 2.
- is in check in , i.e., holds, and
- 1.
- is not in check in , i.e., , but
- 2.
- has no legal moves:
- Draw rules
| Listing 1. Pseudocode implementation of multi-king check and checkmate detection based on pseudo-legal attacks. |
| // Return the set of pseudo-legal moves for a piece, ignoring king safety. function pseudoLegalMoves(state, piece): // Respects board boundaries, occupancy and blocking, but does NOT // check whether the move leaves the moving side in check. … // Return true if and only if ‘square’ is attacked by player P in ‘state’. function squareAttackedBy(state, P, square): for each piece e of player P in state do if square ∈ pseudoLegalMoves(state, e) then return true return false // Player P is in check if and only if at least one of their kings is attacked. function inCheck(state, P): for each king k of player P in state do if squareAttackedBy(state, 1 − P, k.square) then return true return false // A pseudo-legal move is legal if and only if no king of P is attacked afterwards. function isLegalMove(state, P, move): state’ ← apply(move, state) for each king k of player P in state’ do if squareAttackedBy(state’, 1 − P, k.square) then return false return true // Enumerate all legal moves of player P in ‘state’. function legalMoves(state, P): moves ← ∅ for each piece e of player P in state do for each move in pseudoLegalMoves(state, e) do if isLegalMove(state, P, move) then insert move into moves return moves // Checkmate: in check and has no legal moves. function checkmated(state, P): if not inCheck(state, P) then return false if legalMoves(state, P) is empty then return true return false |
3.5. 4D Graph Model of Moves
- Mathematical Results and Formal Properties
3.6. Knight Mobility and Boundary Stratification
- Consequences
3.7. Bishop Connectivity and Parity Invariants
- 1.
- exactly two components of are nonzero,
- 2.
- the two nonzero components have equal absolute value: ,
- 3.
- the remaining two components are zero, and
- 4.
- all intermediate cells along the diagonal remain inside and unobstructed.
3.8. Piece Movement Rules
- Closed-form mobility formula for the 4D bishop.
- 1.
- exactly two coordinates of are nonzero and the other two are zero;
- 2.
- among the nonzero coordinates of , one has absolute value and the other has absolute value .
- 1.
- : moves (parity flip)
- 2.
- : moves (parity preserved)
- 3.
- : moves (parity flip)
- 4.
- : moves (parity preserved)
- 5.
- So 8 + 32 = 40 moves change parity and 24 + 16 = 40 preserve parity. □
3.9. King Moves and Castling in 4D

- 1.
- The king and the rook in that slice are both unmoved.
- 2.
- All squares strictly between and are empty.
- 3.
- For every square the king traverses (including the destination), where attacks may originate from any -slice.
- 4.
- The king is not in check before the move.
- 5.
- The final king and rook locations mirror the classical 2D arrangement: the king moves two squares toward the rook along X; the rook moves to the square immediately adjacent to the king on the opposite side.
3.10. 4D Pawns (Core Ruleset)
- 1.
- A pawn with orientation moves forward by increasing its -coordinate.
- 2.
- A pawn with orientation moves forward by increasing its -coordinate.
- 1.
- Y-pawns in the X–Y plane
- 2.
- W-pawns in the X–W plane
- 1.
- Pawns on even -coordinates are Y-oriented.
- 2.
- Pawns on odd -coordinates are W-oriented.
- 1.
- If (Y-oriented pawn):
- i.
- Single step: .
- ii.
- Double step: if and both intermediate squares are empty.
- 2.
- If (W-oriented pawn):
- i.
- Single step: .
- ii.
- Double step: if and both intermediate squares are empty.
- 1.
- For a Black Y-pawn, forward is in the negative -direction:
- i.
- Single step: .
- ii.
- Double step: if and both intermediate squares are empty.
- 2.
- For a Black W-pawn, forward is in the negative -direction:
- i.
- Single step:.
- ii.
- Double step: if and both intermediate squares are empty.
- i.
- Y-oriented pawn captures in the X–Y plane:for White; for Black.
- ii.
- W-oriented pawn captures in the X–W plane:for White; for Black.No other diagonal captures (e.g., XZ or YZ) are legal.
- i.
- Y-pawns promote at (White) or (Black).
- ii.
- W-pawns promote at (White) or (Black).
- 1.
- Y-pawn en passant.A White Y-pawn atmay capture en passant if
- i.
- Black’s last move was a Y-pawn moving from to ;
- ii.
- ;
- iii.
- the capturing pawn moves to ; and
- iv.
- the pawn at is removed.
- 2.
- W-pawn en passant.A White W-pawn at may capture en passant if
- i.
- Black’s last move was a W-pawn moving from to ;
- ii.
- ;
- ii.
- the capturing pawn moves to ; and
- iv.
- the pawn at is removed.
3.11. Lattice Symmetry and Group Actions
- Ruleset-preserving subgroup
- 1.
- Axis permutation .
- 2.
- Even affine reflections for in {XY, XZ, XW, YZ, YW, ZW}.
- 3.
- Color-swap + rotation in the YW-plane .
3.12. Dimensional Projection

4. Implementation
4.1. System Architecture
- Board representation
- Dense 4D array: board[x][y][z][w], which is feasible because the board contains only cells.
- Sparse map: a dictionary keyed by coordinate tuples piece objects.
4.2. Special Rules in 4D
- Check/checkmate (multi-king legality)
- Pawn promotion
- Castling
- the king and rook involved have not moved,
- all squares between them on the -axis (same ) are empty,
- the king is not in check before castling, and
- every square in the set on the king’s path from start to destination, inclusive is not attacked by any opposing piece, where attacks may originate from any -slice.
- En passant
4.3. User Interface Overview
4.4. Comparison with Alternative 4D Visualization and Search Frameworks
- Visualization: 4D slicing, adjacency, and interaction design
- Trade-off
- Algorithmic search in large action spaces
- High-level planner over slices. Actions operate on coarse abstractions such as “shift major pieces from peripheral slices to the central block” or “synchronize attacks across all boards containing a given enemy king.”
- Low-level planner within slices. Conditioned on a chosen subgoal, a secondary search operates on the full move set but restricts attention to pieces and boards relevant to that subgoal (e.g., moves that keep pieces within a chosen set of -slices).
- represents each local move graph for a piece type (e.g., the knight’s 48-neighbor graph) as a labeled graph and use automorphism tools to identify symmetry classes of squares and configurations;
- represents global game states as nodes in a larger move graph where edges correspond to legal moves; symmetries combine lattice symmetries (axis permutations and reflections) with color-swap and quadrant permutations inherited from the initial layout.
- compress the state space by storing one representative per symmetry orbit,
- share evaluations between symmetric positions (reducing heuristic noise),
- and design equivariant neural networks whose inputs/outputs transform according to these symmetries, improving sample efficiency [17].
4.5. Symmetry Constraints and Practical Use
- Parity invariance. The parity function is invariant under all bishop moves and under all ruleset-preserving symmetries, justifying the bipartite structure of bishop reachability.
- Boundary-equivalence classes. Knight mobility and king adjacency depend only on distance from the board boundary, not on absolute position, allowing mobility to be stratified by boundary-distance patterns rather than by full coordinate tuples.
- Axis pairing symmetry. The equivalence between and -oriented pawns under the symmetry ensures that pawn logic can be implemented once and reused for both orientations.
4.6. Analysis of Move Generation and Legality Filtering
- Attack-map complexity
- for kings,
- for knights,
- for rooks,
- and a position-dependent value for bishops and queens due to ray truncation near boundaries.
- Multi-king legality filtering
4.7. State Hashing and Memory Footprint
- State hashing
- Memory footprint
5. Results
5.1. Computational Complexity and Game Characteristics
- Empirical branching-factor measurement (exploratory)
- State-space growth (order-of-magnitude comparison)
- Practical search implications
- Evaluation heuristic (baseline)
5.2. Observed Strategic and Structural Differences (Qualitative)
- Greater spatial evasion. The additional axes (Z and W) provide more escape routes, often allowing a side to avoid immediate contact or decline trades by shifting across slices.
- Increased tactical opportunity density. With more legal moves per play, players encounter more candidate tactical continuations; conversely, calculating accurately becomes harder without visualization aids and highlighting.
- Piece activity becomes more central. Mobility and cross-slice coordination frequently dominate local pawn-structure considerations, consistent with the enlarged move geometry in Section 3 and the branching factors reported above.
5.3. Endgames and Constructive Demonstrations
- Empirical endgame demonstrations (engine-assisted)
- A constructive strategy sketch for K + R vs. K in 4D (proof sketch with explicit limitations)
- Sketch
- Box shrinking with the rook. Place on a controlling hyperplane adjacent to one face of (e.g., when legal), restricting crossings of that boundary without allowing capture.
- King approach and rook security. Use to approach while maintaining rook safety, exploiting the king’s 4D adjacency (up to 80 neighbors) to improve opposition and prevent rook harassment.
- Monotone progress. Since each , . The strategy aims to reduce by at least 1 per completed cycle (rook boundary + king consolidation), eventually forcing into a region where multiple .
- Corner mate. Once the defender is near a corner (small the rook fixes one coordinate by checking along an axis while covers escape squares in the remaining dimensions, finishing with a finite sequence of forcing moves.
- Limitation
5.4. Complexity-Theoretic Context
- Tractable and restricted subproblems.
5.5. Exploratory User Feedback
- System access and data collection (reproducibility)
- Understanding the 4D coordinate system
- Perception of the 4D→3D projection
- Navigation between board
- Multi-board 3D representation
- Tracking piece movements across dimensions
- Axes gizmo and orientation cues
- Learning curve for 4D piece movement
- Understanding 4D geometric relationships
- Board opacity control
- Perceived educational value
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Abbott, E.A. The Annotated Flatland: A Romance of Many Dimensions; Perseus Publishing: Cambridge, MA, USA, 2002. [Google Scholar]
- Banchoff, T.F. Beyond the Third Dimension: Geometry, Computer Graphics, and Higher Dimensions; Scientific American Library: New York, NY, USA, 1990. [Google Scholar]
- Rucker, R. The Fourth Dimension: Toward a Geometry of Higher Reality; Dover Publications: Mineola, NY, USA, 2014. [Google Scholar]
- Cesarz, P.; Fiorini, E.; Gong, C.; Kelley, K.; Thomas, P.; Woldar, A. Properties of Sub-Add Move Graphs. arXiv 2024, arXiv:2411.01047. [Google Scholar] [CrossRef] [Scilit]
- Fraenkel, A.S.; Lichtenstein, D. Computing a Perfect Strategy for n × n Chess Requires Time Exponential in n. J. Comb. Theory Ser. A 1981, 31, 199–214. [Google Scholar] [CrossRef] [Scilit]
- Shannon, C.E. Programming a Computer for Playing Chess. Philos. Mag. 1950, 41, 256–275. [Google Scholar] [CrossRef] [Scilit]
- Ware, C. Information Visualization: Perception for Design, 2nd ed.; Morgan Kaufmann: San Francisco, CA, USA, 2004. [Google Scholar]
- Hanson, A.J. Visualizing Quaternions; Morgan Kaufmann: San Francisco, CA, USA, 2006. [Google Scholar]
- Hughes, J.; van Dam, A.; McGuire, M.; Sklar, D.F.; Foley, J.; Feiner, S.; Akeley, K. Computer Graphics: Principles and Practice, 3rd ed.; Addison-Wesley: Upper Saddle River, NJ, USA, 2014. [Google Scholar]
- Zermelo, E. Über eine Anwendung der Mengenlehre auf die Theorie des Schachspiels. In Proceedings of the Fifth International Congress of Mathematicians, Cambridge, UK, 22–28 August 1912; Cambridge University Press: Cambridge, UK, 1913; Volume 2, pp. 501–504. [Google Scholar]
- Pritchard, D.B. The Classified Encyclopedia of Chess Variants; John Beasley: Harpenden, UK, 2007. [Google Scholar]
- Nowakowski, R.J. (Ed.) Games of No Chance; Cambridge University Press: Cambridge, UK, 1998. [Google Scholar]
- Conway, J.H.; Guy, R.K.; Berlekamp, E.R. Winning Ways for Your Mathematical Plays; A K Peters: Wellesley, MA, USA, 2001. [Google Scholar]
- Imrich, W.; Klavžar, S. Product Graphs: Structure and Recognition; Wiley-Interscience: New York, NY, USA, 2000. [Google Scholar]
- DeMaio, J.; Mathew, T. Knight’s Tours in Higher Dimensions. arXiv 2012, arXiv:1202.5291. [Google Scholar]
- Zawalski, M.; Góral, G.; Tyrolski, M.; Wiśnios, E.; Budrowski, F.; Kuciński, Ł.; Miłoś, P. What Matters in Hierarchical Search for Combinatorial Reasoning Problems? arXiv 2024, arXiv:2406.03361. [Google Scholar] [CrossRef] [Scilit]
- Tewolde, E.; Zhang, B.H.; Oesterheld, C.; Sandholm, T.; Conitzer, V. Computing Game Symmetries and Equilibria That Respect Them. arXiv 2025, arXiv:2501.08905. [Google Scholar] [CrossRef] [Scilit]
- Caplan, P. Tessellation and Interactive Visualization of Four-Dimensional Spacetime Geometries. arXiv 2024, arXiv:2403.19036. [Google Scholar] [CrossRef] [Scilit]
- Kopczyński, E.; Celińska-Kopczyńska, D. Navigating Higher-Dimensional Spaces Using Hyperbolic Geometry. arXiv 2021, arXiv:2110.00327. [Google Scholar] [CrossRef] [Scilit]
- Cavallo, M. Higher Dimensional Graphics: Conceiving Worlds in Four Spatial Dimensions and Beyond. Comput. Graph. Forum 2021, 40, 51–63. [Google Scholar] [CrossRef] [Scilit]
- Korkut, E.H.; Surer, E. Visualization in Virtual Reality: A Systematic Review. arXiv 2022, arXiv:2203.07616. [Google Scholar] [CrossRef] [Scilit]
- Inkarbekov, M.; Monahan, R.; Pearlmutter, B.A. Visualization of AI Systems in Virtual Reality: A Comprehensive Review. arXiv 2023, arXiv:2306.15545. [Google Scholar] [CrossRef] [Scilit]
- Santoso, B. 4D Chess. GitHub Repository. 2021. Available online: https://github.com/BrianSantoso/4D-Chess (accessed on 5 December 2025).
- Thunkspace LLC. 5D Chess with Multiverse Time Travel. Steam. 2020. Available online: https://store.steampowered.com/app/1349230/5D_Chess_With_Multiverse_Time_Travel/ (accessed on 30 November 2025).
- Schaeffer, J. One Jump Ahead: Challenging Human Supremacy in Checkers; Springer: New York, NY, USA, 2013. [Google Scholar] [CrossRef] [Scilit]
- Penrose, R. The Road to Reality: A Complete Guide to the Laws of the Universe; Jonathan Cape: London, UK, 2004. [Google Scholar]
- Zobrist, A.L. A New Hashing Method with Application for Game Playing; Technical Report 88; Computer Sciences Department, University of Wisconsin: Madison, WI, USA, 1970. [Google Scholar]



| Degree | Number of Squares | |
|---|---|---|
| (0,0,4) | 48 | 256 |
| (0,1,3) | 42 | 512 |
| (0,2,2) | 36 | 384 |
| (0,3,1) | 30 | 128 |
| (0,4,0) | 24 | 16 |
| (1,0,3) | 36 | 512 |
| (1,1,2) | 31 | 768 |
| (1,2,1) | 26 | 384 |
| (1,3,0) | 21 | 64 |
| (2,0,2) | 26 | 384 |
| (2,1,1) | 22 | 384 |
| (2,2,0) | 18 | 96 |
| (3,0,1) | 18 | 128 |
| (3,1,0) | 15 | 64 |
| (4,0,0) | 12 | 16 |
| Piece | Allowed Move Vector | Description |
|---|---|---|
| Rook | One nonzero component: , , , | Moves any distance along exactly one axis (4D straight lines). |
| Bishop | Exactly two nonzero components of equal magnitude, e.g., and all permutations | Moves along diagonals in any of the six coordinate planes. |
| Queen | Any rook move or any bishop move | Union of rook and bishop moves. |
| Knight | One coordinate , one coordinate , two coordinates 0 (permutations of ) | Four choices for the “2-axis”, three for the “1-axis”, giving 48 possible moves. |
| King | Each coordinate in , excluding | One-step move to any adjacent square: axial, planar-diagonal, 3D-diagonal, or 4D-diagonal. |
| Pawn | Orientation axis . Forward: if , or if . Capture within its movement plane, e.g., for Y-pawns, or for W-pawns. | Pawn moves and captures only in its 2D subspace (X–Y or X–W), mirroring 2D pawn structure but extended to 4D. |
| Position Type | Mean Legal Moves | Median | σ |
|---|---|---|---|
| Opening slice (z,w ∈ central block) | ~48 | 46 | 10 |
| Midgame dense cluster | ~85 | 78 | 21 |
| Global average (2000 random states) | 74.3 | 72 | 18.1 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Oana, R.; Chiru, C.-G. A Mathematical Framework for Four-Dimensional Chess: Extending Game Mechanics Through Higher-Dimensional Geometry. AppliedMath 2026, 6, 48. https://doi.org/10.3390/appliedmath6030048
Oana R, Chiru C-G. A Mathematical Framework for Four-Dimensional Chess: Extending Game Mechanics Through Higher-Dimensional Geometry. AppliedMath. 2026; 6(3):48. https://doi.org/10.3390/appliedmath6030048
Chicago/Turabian StyleOana, Rinaldi (Unciuleanu), and Costin-Gabriel Chiru. 2026. "A Mathematical Framework for Four-Dimensional Chess: Extending Game Mechanics Through Higher-Dimensional Geometry" AppliedMath 6, no. 3: 48. https://doi.org/10.3390/appliedmath6030048
APA StyleOana, R., & Chiru, C.-G. (2026). A Mathematical Framework for Four-Dimensional Chess: Extending Game Mechanics Through Higher-Dimensional Geometry. AppliedMath, 6(3), 48. https://doi.org/10.3390/appliedmath6030048

