Documentation

GaudisCrypt.Lib.EC.ROM

Random oracles (EasyCrypt theories/crypto/ROM.eca) #

The module types of an oracle and the lazy random oracle Lazy.LRO, with its losslessness. (FiniteEager, and the equivalences between the lazy and the eager oracle, are not ported: Lib/EC/PROM.lean has EC's programmable oracles and their lazy/eager theory.)

The theory's types in_t, out_t, d_in_t, d_out_t are outParams of the class Params, its operator dout the class's field: a clone is clone import GaudisCrypt.EC.ROM as H with type in_t <- …, op dout <- …. The module variable LRO.m is a module_var.

class GaudisCrypt.EC.ROM.Params (in_t out_t d_in_t d_out_t : outParam Type) :

EC's type in_t, out_t. op dout: in_t -> out_t distr. type d_in_t, d_out_t.

Instances
    @[simp]
    theorem GaudisCrypt.EC.ROM.POracle.destruct_mk {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (theModule✝ : POracle) :
    mk theModule✝.structure = theModule✝

    @[simp]: POracle.mk (POracle.structure m) = m — rebuilding a module from its own fields gives that module back.

    noncomputable def GaudisCrypt.EC.ROM.POracle.o {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

    The field o of a module of type POracle: the projection onto component 0 of the right-nested tuple POracle.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

    POracle.o.mk_simp reads this field back off a module built by POracle.mk; POracle.o.utilities has the accessor as a module, and the lemmas about it.

    Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).

    Equations
    • theModule✝.o = theModule✝
    Instances For
      @[reducible]
      noncomputable def GaudisCrypt.EC.ROM.POracle.mk {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

      Builds a module of type POracle from the record POracle.Structure of its fields, as a right-nested Module.pair'. @[reducible].

      Inverse of POracle.structure (POracle.mk_destruct, POracle.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas POracle.o.mk_simp.

      Equations
      Instances For
        noncomputable def GaudisCrypt.EC.ROM.POracle.o.utilities {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

        What is derivable about the accessor POracle.o, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

        • POracle.o.utilities.accessorModule : POracle →ₘ … — the accessor as a module, a projection being a module morphism;
        • POracle.o.utilities.apply_simp — Module.app POracle.o.utilities.accessorModule m = POracle.o m: applying that module is the accessor;
        • POracle.o.utilities.expression_eq — the same at the level of expressions: (POracle.o m).expression = (POracle.o.utilities.proj m.expression).reduce.
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def GaudisCrypt.EC.ROM.POracle.typeRep {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

          The ModuleTypeRep underlying POracle, the module type declared by moduletype POracle: the right-nested product of its 1 field types, in declaration order.

          POracle is by definition Module POracle.typeRep.

          Equations
          Instances For
            structure GaudisCrypt.EC.ROM.POracle.Structure {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

            The record of the fields of a module of type POracle: the fields o, one per moduletype field, each of that field's own module type.

            POracle.mk turns such a record into a POracle, POracle.structure turns a POracle back into one.

            Instances For
              @[implicit_reducible]
              instance GaudisCrypt.EC.ROM.instIsModulePOracle {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

              The IsModule POracle instance: POracle is a module type, with representation POracle.typeRep.

              It is what lets the name POracle stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module POracle.typeRep would do on its own but POracle, a plain (non-reducible) def, would not.

              Equations
              def GaudisCrypt.EC.ROM.POracle {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

              The module type declared by moduletype POracle, with fields o: the type Module POracle.typeRep of modules that are a right-nested tuple of the field types.

              Build one from a record of its fields with POracle.mk, read a single field off one with the accessors POracle.o, and get the whole record back with POracle.structure.

              Equations
              Instances For
                noncomputable def GaudisCrypt.EC.ROM.POracle.structure {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                The record of a module's fields: POracle.structure m is POracle.Structure.mk applied to POracle.o of m.

                Inverse of POracle.mk (POracle.mk_destruct, POracle.destruct_mk).

                Equations
                Instances For
                  @[simp]
                  theorem GaudisCrypt.EC.ROM.POracle.mk_destruct {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (theRecord✝ : Structure) :
                  (mk theRecord✝).structure = theRecord✝

                  @[simp]: POracle.structure (POracle.mk r) = r — destructing a module built from a record gives that record back.

                  @[simp]
                  theorem GaudisCrypt.EC.ROM.POracle.o.mk_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (theRecord✝ : Structure) :
                  (mk theRecord✝).o = theRecord✝.o

                  @[simp]: reading the field o back off a module built from a record — POracle.o (POracle.mk r) = r.o.

                  It is what carries the right-hand side of an X.apply_simp (which is an POracle.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.o.apply_simp.

                  @[reducible, inline]
                  abbrev GaudisCrypt.EC.ROM.Distinguisher {in_t out_t d_in_t d_out_t : Type} [Inhabited in_t] [Inhabited out_t] [Inhabited d_in_t] [Inhabited d_out_t] [DecidableEq in_t] [Params in_t out_t d_in_t d_out_t] :

                  A Distinguisher (or distinguishing context) is a single algorithm that has access to an oracle, and has some input/output behaviour: EC's module type Distinguisher (H : POracle) = { proc run(_ : d_in_t): d_out_t }.

                  Equations
                  Instances For
                    @[reducible]
                    noncomputable def GaudisCrypt.EC.ROM.Oracle.mk {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                    Builds a module of type Oracle from the record Oracle.Structure of its fields, as a right-nested Module.pair'. @[reducible].

                    Inverse of Oracle.structure (Oracle.mk_destruct, Oracle.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas Oracle.init.mk_simp, Oracle.o.mk_simp.

                    Equations
                    Instances For
                      @[simp]
                      theorem GaudisCrypt.EC.ROM.Oracle.destruct_mk {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (theModule✝ : Oracle) :
                      mk theModule✝.structure = theModule✝

                      @[simp]: Oracle.mk (Oracle.structure m) = m — rebuilding a module from its own fields gives that module back.

                      @[implicit_reducible]
                      instance GaudisCrypt.EC.ROM.instIsModuleOracle {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                      The IsModule Oracle instance: Oracle is a module type, with representation Oracle.typeRep.

                      It is what lets the name Oracle stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module Oracle.typeRep would do on its own but Oracle, a plain (non-reducible) def, would not.

                      Equations
                      @[simp]
                      theorem GaudisCrypt.EC.ROM.Oracle.o.mk_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (theRecord✝ : Structure) :
                      (mk theRecord✝).o = theRecord✝.o

                      @[simp]: reading the field o back off a module built from a record — Oracle.o (Oracle.mk r) = r.o.

                      It is what carries the right-hand side of an X.apply_simp (which is an Oracle.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.o.apply_simp.

                      noncomputable def GaudisCrypt.EC.ROM.Oracle.o.utilities {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                      What is derivable about the accessor Oracle.o, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                      • Oracle.o.utilities.accessorModule : Oracle →ₘ … — the accessor as a module, a projection being a module morphism;
                      • Oracle.o.utilities.apply_simp — Module.app Oracle.o.utilities.accessorModule m = Oracle.o m: applying that module is the accessor;
                      • Oracle.o.utilities.expression_eq — the same at the level of expressions: (Oracle.o m).expression = (Oracle.o.utilities.proj m.expression).reduce.
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        structure GaudisCrypt.EC.ROM.Oracle.Structure {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                        The record of the fields of a module of type Oracle: the fields init, o, one per moduletype field, each of that field's own module type.

                        Oracle.mk turns such a record into a Oracle, Oracle.structure turns a Oracle back into one.

                        Instances For
                          noncomputable def GaudisCrypt.EC.ROM.Oracle.init.utilities {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                          What is derivable about the accessor Oracle.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                          • Oracle.init.utilities.accessorModule : Oracle →ₘ … — the accessor as a module, a projection being a module morphism;
                          • Oracle.init.utilities.apply_simp — Module.app Oracle.init.utilities.accessorModule m = Oracle.init m: applying that module is the accessor;
                          • Oracle.init.utilities.expression_eq — the same at the level of expressions: (Oracle.init m).expression = (Oracle.init.utilities.proj m.expression).reduce.
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def GaudisCrypt.EC.ROM.Oracle.o {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                            The field o of a module of type Oracle: the projection onto component 1 of the right-nested tuple Oracle.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

                            Oracle.o.mk_simp reads this field back off a module built by Oracle.mk; Oracle.o.utilities has the accessor as a module, and the lemmas about it.

                            Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).

                            Equations
                            Instances For
                              def GaudisCrypt.EC.ROM.Oracle {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                              The module type declared by moduletype Oracle, with fields init, o: the type Module Oracle.typeRep of modules that are a right-nested tuple of the field types.

                              Build one from a record of its fields with Oracle.mk, read a single field off one with the accessors Oracle.init, Oracle.o, and get the whole record back with Oracle.structure.

                              Equations
                              Instances For
                                @[simp]
                                theorem GaudisCrypt.EC.ROM.Oracle.init.mk_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (theRecord✝ : Structure) :
                                (mk theRecord✝).init = theRecord✝.init

                                @[simp]: reading the field init back off a module built from a record — Oracle.init (Oracle.mk r) = r.init.

                                It is what carries the right-hand side of an X.apply_simp (which is an Oracle.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.

                                noncomputable def GaudisCrypt.EC.ROM.Oracle.init {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                The field init of a module of type Oracle: the projection onto component 0 of the right-nested tuple Oracle.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

                                Oracle.init.mk_simp reads this field back off a module built by Oracle.mk; Oracle.init.utilities has the accessor as a module, and the lemmas about it.

                                It takes no parameters (recorded in @[gaudiProcParamNames]).

                                Equations
                                Instances For
                                  def GaudisCrypt.EC.ROM.Oracle.typeRep {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                  The ModuleTypeRep underlying Oracle, the module type declared by moduletype Oracle: the right-nested product of its 2 field types, in declaration order.

                                  Oracle is by definition Module Oracle.typeRep.

                                  Equations
                                  Instances For
                                    noncomputable def GaudisCrypt.EC.ROM.Oracle.structure {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                    The record of a module's fields: Oracle.structure m is Oracle.Structure.mk applied to Oracle.init, Oracle.o of m.

                                    Inverse of Oracle.mk (Oracle.mk_destruct, Oracle.destruct_mk).

                                    Equations
                                    Instances For
                                      @[simp]
                                      theorem GaudisCrypt.EC.ROM.Oracle.mk_destruct {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (theRecord✝ : Structure) :
                                      (mk theRecord✝).structure = theRecord✝

                                      @[simp]: Oracle.structure (Oracle.mk r) = r — destructing a module built from a record gives that record back.

                                      @[implicit_reducible]
                                      noncomputable instance GaudisCrypt.EC.ROM.instCoeOraclePOracle {in_t out_t d_in_t d_out_t : Type} [Inhabited in_t] [Inhabited out_t] [Inhabited d_in_t] [Inhabited d_out_t] [DecidableEq in_t] [Params in_t out_t d_in_t d_out_t] :

                                      An Oracle is a POracle (its o).

                                      Equations
                                      @[simp]
                                      theorem GaudisCrypt.EC.ROM.Exp.apply_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (H : Oracle) (D : Distinguisher) :
                                      Exp(H, D).main = Module.app (Module.app main H) D

                                      @[simp]: applying Exp to a tuple of its 2 parameters H, D — the record of its procedures Exp.main, each applied to the parameters it uses.

                                      This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Exp.main.apply_simp to fill that procedure's holes.

                                      noncomputable def GaudisCrypt.EC.ROM.Exp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                      The module declared by module Exp, abstracted over its 2 parameters H, D, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.

                                      Applied to such a tuple it is the record of its procedures Exp.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Exp.apply_simp says.

                                      Equations
                                      Instances For
                                        @[simp]
                                        theorem GaudisCrypt.EC.ROM.Exp.main.apply_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (H : Oracle) (D : Distinguisher) :

                                        @[simp]: applying Exp.main to the parameters proc main uses (H, D) is Module.proc (Exp.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                        theorem GaudisCrypt.EC.ROM.Exp.main.procedure.apply_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig (d_in_t) → d_out_t) HoleSigs.empty)).Instantiation) :
                                        procedure.instantiate holeArgs✝ = proc (x : d_in_t) : d_out_t { var r : d_out_t; call (holeArgs✝.lookup HoleIndex.zero) (); r <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x); return §r }

                                        Instantiating the holes of Exp.main.procedure with a tuple holeArgs of procedures: the body of proc main as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                        Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Exp.main.procedure.apply_simp]).

                                        noncomputable def GaudisCrypt.EC.ROM.Exp.main {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                        proc main of module Exp as a module, abstracted over the module parameters it uses (H, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                        Apply it with the @[simp] lemma Exp.main.apply_simp, which fills the holes of Exp.main.procedure with the callees the body called.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          noncomputable def GaudisCrypt.EC.ROM.Exp.main.procedure {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :
                                          proctype (d_in_t) → d_out_t uses (() → Unit, (d_in_t) → d_out_t)

                                          The body of proc main of module Exp, as a procedure of its own: the 2 calls it makes to module parameters (H, D) are its holes, in the order the body makes them.

                                          A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Exp.main.procedure.apply_simp) rather than run. Use Exp.main for this procedure as a module.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            theory Lazy #

                                            noncomputable def GaudisCrypt.EC.ROM.Lazy.LRO.m {in_t out_t d_in_t d_out_t : Type} [Inhabited in_t] [Inhabited out_t] [Inhabited d_in_t] [Inhabited d_out_t] [DecidableEq in_t] [Params in_t out_t d_in_t d_out_t] :
                                            Equations
                                            Instances For
                                              instance GaudisCrypt.EC.ROM.Lazy.instIsGlobalVarFMapMMk {in_t out_t d_in_t d_out_t : Type} [Inhabited in_t] [Inhabited out_t] [Inhabited d_in_t] [Inhabited d_out_t] [DecidableEq in_t] [Params in_t out_t d_in_t d_out_t] :
                                              LRO.m.IsGlobalVar (VariableName.mk "GaudisCrypt.EC.ROM.Lazy.LRO.m" (FMap in_t out_t))
                                              noncomputable def GaudisCrypt.EC.ROM.Lazy.LRO.o.procedure {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                              The body of proc o of module LRO, as a procedure of its own: it calls no module parameter, so it has no holes.

                                              A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see LRO.o.procedure.apply_simp) rather than run. Use LRO.o for this procedure as a module.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem GaudisCrypt.EC.ROM.Lazy.LRO.o.procedure.apply_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                procedure.instantiate holeArgs✝ = proc (x : in_t) : out_t { var r : out_t; r <$ dout §x; if (decide ¬(§m).dom §x) { m <- (§m).set §x §r; } return oget ((§m).get §x) }

                                                Instantiating the holes of LRO.o.procedure with a tuple holeArgs of procedures: the body of proc o as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [LRO.o.procedure.apply_simp]).

                                                noncomputable def GaudisCrypt.EC.ROM.Lazy.LRO {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                                The module declared by module LRO: the record of its procedures LRO.init, LRO.o.

                                                The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no LRO.apply_simp to apply it with.

                                                Equations
                                                Instances For
                                                  noncomputable def GaudisCrypt.EC.ROM.Lazy.LRO.o {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                                  proc o of module LRO as a module: Module.proc LRO.o.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — LRO.o.apply_simp says exactly that.

                                                  Equations
                                                  Instances For
                                                    noncomputable def GaudisCrypt.EC.ROM.Lazy.LRO.init {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                                    proc init of module LRO as a module: Module.proc LRO.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — LRO.init.apply_simp says exactly that.

                                                    Equations
                                                    Instances For
                                                      @[simp]
                                                      theorem GaudisCrypt.EC.ROM.Lazy.LRO.o.apply_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                                      @[simp]: LRO.o = Module.proc LRO.o.procedure — true by definition, proc o using no module parameter and so having no holes to fill.

                                                      noncomputable def GaudisCrypt.EC.ROM.Lazy.LRO.init.procedure {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                                      The body of proc init of module LRO, as a procedure of its own: it calls no module parameter, so it has no holes.

                                                      A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see LRO.init.procedure.apply_simp) rather than run. Use LRO.init for this procedure as a module.

                                                      Equations
                                                      Instances For
                                                        theorem GaudisCrypt.EC.ROM.Lazy.LRO.init.procedure.apply_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                        procedure.instantiate holeArgs✝ = proc () : Unit { m <- FMap.empty; return () }

                                                        Instantiating the holes of LRO.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                        Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [LRO.init.procedure.apply_simp]).

                                                        @[simp]
                                                        theorem GaudisCrypt.EC.ROM.Lazy.LRO.init.apply_simp {in_t out_t d_in_t d_out_t : Type} [_gaudiParam0 : Inhabited in_t] [_gaudiParam1 : Inhabited out_t] [_gaudiParam2 : Inhabited d_in_t] [_gaudiParam3 : Inhabited d_out_t] [_gaudiParam4 : DecidableEq in_t] [_gaudiParam5 : Params in_t out_t d_in_t d_out_t] :

                                                        @[simp]: LRO.init = Module.proc LRO.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.

                                                        theorem GaudisCrypt.EC.ROM.Lazy.fvP_LRO {in_t out_t d_in_t d_out_t : Type} [Inhabited in_t] [Inhabited out_t] [Inhabited d_in_t] [Inhabited d_out_t] [DecidableEq in_t] [Params in_t out_t d_in_t d_out_t] :

                                                        glob LRO: its map LRO.m (read off the code; for the footprint tactics).

                                                        theorem GaudisCrypt.EC.ROM.Lazy.LRO_init_ll {in_t out_t d_in_t d_out_t : Type} [Inhabited in_t] [Inhabited out_t] [Inhabited d_in_t] [Inhabited d_out_t] [DecidableEq in_t] [Params in_t out_t d_in_t d_out_t] :

                                                        EC's lemma LRO_init_ll : islossless LRO.init.

                                                        theorem GaudisCrypt.EC.ROM.Lazy.LRO_o_ll {in_t out_t d_in_t d_out_t : Type} [Inhabited in_t] [Inhabited out_t] [Inhabited d_in_t] [Inhabited d_out_t] [DecidableEq in_t] [Params in_t out_t d_in_t d_out_t] :
                                                        (∀ (x : in_t), is_lossless (dout x)) → LRO.o.procedure.IsLossless

                                                        EC's lemma LRO_o_ll : (forall x, is_lossless (dout x)) => islossless LRO.o.