Documentation

CatCryptCore.Bridge.GamePkgView

Game Package View: UC-Free Game/Handler Layer #

The UC-free core of the PackageView framework: the isomorphism between SPComp games and single-operation typed handlers, plus the handler simp lemmas that drive the pkg_coherence tactic.

The statistical-distance / UC machinery (handlerSdist, oracle-swap theorems, OracleGame, PackageView) lives downstream in the dev-repo layer over this file.

Main Definitions #

Supporting SPComp law #

bind_fail_right' is a pure SPComp algebra law consumed by the pkg_coherence simp set (and by uc_coherence in the larger UC development).

theorem CatCrypt.Core.SPComp.bind_fail_right' {α β : Type} (c : SPComp α) :
(c.bind fun (x : α) => fail) = fail

Binding into a constant-failure continuation gives failure.

Single-Operation Interface #

A package interface with exactly one operation of type A → SPComp B.

Equations
Instances For
    @[reducible, inline]

    A handler for a single-operation interface. Isomorphic to A → SPComp B via ofGame/toGame.

    Equations
    Instances For

      Wrap an SPComp game as a single-operation handler.

      Equations
      Instances For

        Extract the game from a single-operation handler.

        Equations
        Instances For
          @[simp]
          theorem CatCrypt.Bridge.PkgView.GamePkg.ofGame_toGame {A B : Type} (game : ACore.SPComp B) :
          (ofGame game).toGame = game
          @[simp]

          The isomorphism between games and single-operation handlers.

          Equations
          Instances For

            Oracle Games (Package Category Morphisms) #

            @[reducible, inline]

            An oracle game is a morphism in the package category: it takes an oracle handler and produces a game.

            Concretely, OracleGame O A B is TypedHandler O → TypedHandler (singleIface A B), i.e., a morphism O ⟶ singleIface A B in pkgCat.

            Equations
            Instances For

              Construct an oracle game from a function that takes an oracle handler and produces a game.

              Equations
              Instances For

                Run an oracle game with a specific handler.

                Equations
                Instances For

                  An oracle game from a single-oracle function. The common case: the game takes one oracle X → SPComp Y.

                  Equations
                  Instances For

                    Handler Simp Lemmas for pkg_coherence #

                    These lemmas reduce handler operations to pointwise equalities, enabling the pkg_coherence tactic.

                    @[simp]
                    theorem CatCrypt.Bridge.PkgView.GamePkg.ofGame_apply {A B : Type} (game : ACore.SPComp B) :
                    ofGame game () = game
                    @[simp]
                    theorem CatCrypt.Bridge.PkgView.singleIface_doms {A B : Type} :
                    (singleIface A B).doms = fun (x : (singleIface A B).ι) => A
                    @[simp]