Documentation

CatCryptCore.Crypto.UCMonad.SPCompInstance

SPComp Instance of UCMonad #

This file provides the concrete UCMonad SPComp instance, connecting the generic typeclass to the existing CatCrypt infrastructure.

Main results #

The generic↔concrete bridge lemmas (generic_UCEmulates_iff_concrete, generic_approxFact_iff_concrete) need Crypto.UC, so they live in SPCompUCBridge.lean.

Design #

The instance fields map directly:

Re-derive bind_fail_right (private in Affine.lean) #

Localized mapSum (UC-free copy) #

mapSum lives in UC.lean, which this file must NOT depend on: keeping SPCompInstance off the UC layer is what makes the whole RoundM/ITreeN substrate built on it UC-free (the compiler-boundary cut). mapSum is a pure Sum-parallel-composition, so we keep a local copy here; the proofs mirror UC.lean / UCFactorization.lean.

noncomputable def UCMonad.mapSumSP {α β γ δ : Type} (f : α → CatCrypt.Core.SPComp β) (g : γ → CatCrypt.Core.SPComp δ) :
α ⊕ γ → CatCrypt.Core.SPComp (β ⊕ δ)
Equations
Instances For
    @[simp]
    theorem UCMonad.mapSumSP_inl {α β γ δ : Type} (f : α → CatCrypt.Core.SPComp β) (g : γ → CatCrypt.Core.SPComp δ) (a : α) :
    @[simp]
    theorem UCMonad.mapSumSP_inr {α β γ δ : Type} (f : α → CatCrypt.Core.SPComp β) (g : γ → CatCrypt.Core.SPComp δ) (c : γ) :
    theorem UCMonad.sdist_mapSumSP_le {α₁ α₂ β₁ β₂ : Type} (f₁ f₂ : α₁ → CatCrypt.Core.SPComp α₂) (g₁ g₂ : β₁ → CatCrypt.Core.SPComp β₂) {ε₁ ε₂ : ENNReal} (hf : CatCrypt.Crypto.sdist f₁ f₂ ≤ ε₁) (hg : CatCrypt.Crypto.sdist g₁ g₂ ≤ ε₂) :
    CatCrypt.Crypto.sdist (mapSumSP f₁ g₁) (mapSumSP f₂ g₂) ≤ max ε₁ ε₂

    UC-free copy of RC.sdist_mapSum_le for mapSumSP. Since mapSumSP is definitionally mapSum, this also closes goals stated with mapSum, letting the ITreeN multi-session layer stay off the RC/UC layer. Proof mirrors RC.sdist_mapSum_le.

    The UCMonad instance for SPComp #

    @[instance_reducible]
    Equations
    • One or more equations did not get rendered due to their size.

    UCPure instance for SPComp #

    @[instance_reducible]

    SPComp.IsPure satisfies the UCPure interface.

    Equations