YukonModule.VCVio.CryptoFoundations.HardnessAssumptions.HardRelation.part0
DefinitionYukon_d98d4e7e5ec3bb11cc1d90f7better-codes
Source module VCVio.CryptoFoundations.HardnessAssumptions.HardRelation.
Definition code
/-
Copyright (c) 2024 Devon Tuma. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Devon Tuma
-/
module
public import Definitions.Def_Yukon_3ca8dea642d23c4bd0e25cee
public import Batteries.Control.OptionT
public import Mathlib.Probability.Distributions.Uniform
public import Mathlib.Data.Vector.Defs
public import Mathlib.Data.Finset.Card
public import Init
public import Mathlib.CategoryTheory.Monad.Types
public import Mathlib.Order.CompleteLattice.Basic
public import Mathlib.Probability.ProbabilityMassFunction.Monad
public import Batteries.Control.AlternativeMonad
public import Mathlib.Data.PFunctor.Multivariate.Basic
public import Mathlib.Data.PFunctor.Univariate.Basic
public import Mathlib.Tactic.Common
public import Mathlib.Init
public import Lean.Message
public import Batteries.Tactic.Lint.Basic
public import Batteries.Tactic.Lint
public import Mathlib.Algebra.Polynomial.Eval.Defs
public import Mathlib.Algebra.MvPolynomial.Eval
meta import Definitions.Def_Yukon_3ca8dea642d23c4bd0e25cee
set_option backward.isDefEq.respectTransparency.types false
/-!
# Hard Relations
This file defines a typeclass `HardRelation X W r` for relations `r : X → W → Prop`
that are "hard" in the sense that given `x : X` no polynomial adversary can find `w : W`
such that `r x w` holds.
In the actual implementation all of these are indexed by some security parameter.
## Implementation notes
This is a simplified version without the asymptotic security parameter framework.
A full asymptotic version needs `OracleAlg` to be redesigned.
-/
@[expose] public section
open OracleSpec OracleComp ENNReal
/-- A relation `r` is generable if there is an efficient algorithm `gen`
that produces instance-witness pairs satisfying the relation. -/
structure GenerableRelation
(X W : Type) (r : X → W → Bool) where
/-- An efficient algorithm producing instance-witness pairs. -/
gen : ProbComp (X × W)
/-- Every pair in the support of `gen` satisfies the relation `r`. -/
gen_sound (x : X) (w : W) : (x, w) ∈ support gen → r x w
/-- Experiment for checking whether an adversary can find a witness for a generated instance. -/
def hardRelationExp {X W : Type} {r : X → W → Bool} (hr : GenerableRelation X W r)
(adversary : X → ProbComp W) : ProbComp Bool := do
let ⟨x, _⟩ ← hr.gen
let w ← adversary x
return r x w
Source