Chess Invariants
23 points by ingve 2 hours ago | 11 comments
  • unprovable 2 hours ago |
    If you like this, you're probably gonna like this: https://en.wikipedia.org/wiki/Chessboard_complex
  • yewenjie an hour ago |
    > Chess is a lot trickier than it looks. It has so many rules: castling, en passant, pawn promotion, pinning, the discovered check, and the deadlock case of stalemate.

    Nit: Pinning and the discovered check are not really rules, but rather names of tactics.

    • JohnKemeny an hour ago |
      Well, if a piece is pinned it's illegal to move it.

      Rule 3.9.2: No piece can be moved that will either expose the king of the same colour to check or leave that king in check.

      • TheOtherHobbes an hour ago |
        Unlike en-passant and castling, pinning and discovered checks are consequences of lower-level rules.

        At the "Is this move legal?" level, they don't need unique rules of its own if the lower-level rules are specified correctly.

        • JohnKemeny 37 minutes ago |
          3.9.2: no piece can be moved if that exposes or leaves its own king in check.
          • 333c 17 minutes ago |
            That's a consequence of not being allowed to put yourself in check (by any means).
      • gobdovan an hour ago |
        You can also pin a pawn to a queen, but the pawn can still legally move.
      • munchler 20 minutes ago |
        The point is that, logically, the first part of that rule (“expose the king”) is implied by the second part (“leave that king”), so the first part is redundant. You could simplify the rule to:

        No piece can be moved that will leave the king of the same color in check.

    • juujian an hour ago |
      And discovered check means that it is not sufficient to check the position of the piece you have moved, you also need to check the position of other pieces to see whether there is a new check.
  • NicoHartmann an hour ago |
    I can't wait to show this to my manager next time he asks why it's taking three weeks to build a simple CRUD app.

    "Look, if this guys TLA+ logic struggles to model a 1,500-year-old game without crying over a French pawn-capture rule, you can't expect me to integrate Stripe billing without a few state invariant violations."

  • vintermann 4 minutes ago |
    That king promotion rule sounds like it made the game more fun.