Documentation

HeyVL.Expr

inductive HeyLo.Ty :
Instances For
    @[implicit_reducible]
    Equations
    @[implicit_reducible]
    Equations
    @[reducible, inline]
    abbrev HeyLo.Ty.lit :
    TyType
    Equations
    Instances For
      inductive HeyLo.Yes :
      Instances For
        @[implicit_reducible]
        Equations
        @[implicit_reducible]
        Equations
        inductive HeyLo.No :
          Instances For
            @[implicit_reducible]
            Equations
            def HeyLo.instDecidableEqNo.decEq (x✝ x✝¹ : No) :
            Decidable (x✝ = x✝¹)
            Instances For
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              inductive HeyLo.BinOp :
              TyTyType
              Instances For
                def HeyLo.instToExprBinOp.toExpr {a✝ a✝¹ : Ty} :
                BinOp a✝ a✝¹Lean.Expr
                Equations
                Instances For
                  @[implicit_reducible]
                  instance HeyLo.instToExprBinOp {a✝ a✝¹ : Ty} :
                  Lean.ToExpr (BinOp a✝ a✝¹)
                  Equations
                  @[implicit_reducible]
                  instance HeyLo.instDecidableEqBinOp {a✝ a✝¹ : Ty} :
                  DecidableEq (BinOp a✝ a✝¹)
                  Equations
                  def HeyLo.instDecidableEqBinOp.decEq {a✝ a✝¹ : Ty} (x✝ x✝¹ : BinOp a✝ a✝¹) :
                  Decidable (x✝ = x✝¹)
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    inductive HeyLo.UnOp :
                    TyTyType
                    Instances For
                      @[implicit_reducible]
                      instance HeyLo.instToExprUnOp {a✝ a✝¹ : Ty} :
                      Lean.ToExpr (UnOp a✝ a✝¹)
                      Equations
                      @[implicit_reducible]
                      instance HeyLo.instDecidableEqUnOp {a✝ a✝¹ : Ty} :
                      DecidableEq (UnOp a✝ a✝¹)
                      Equations
                      inductive HeyLo.QuantOp :
                      TyType
                      Instances For
                        @[implicit_reducible]
                        instance HeyLo.instToExprQuantOp {a✝ : Ty} :
                        Equations
                        structure HeyLo.Ident :
                        Instances For
                          Equations
                          Instances For
                            @[implicit_reducible]
                            Equations
                            def HeyLo.instDecidableEqIdent.decEq (x✝ x✝¹ : Ident) :
                            Decidable (x✝ = x✝¹)
                            Equations
                            Instances For
                              Equations
                              Instances For
                                theorem HeyLo.Ident.ext {i j : Ident} (h : i.name = j.name) (h' : i.type = j.type) :
                                i = j
                                theorem HeyLo.Ident.ext_iff {i j : Ident} :
                                i = j i.name = j.name i.type = j.type
                                Equations
                                Instances For
                                  @[reducible, inline]
                                  abbrev HeyLo.Ty.Γ :
                                  Equations
                                  Instances For
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      @[reducible, inline]
                                      abbrev HeyLo.Ty.expr (t : Ty) :
                                      Equations
                                      Instances For
                                        @[implicit_reducible]
                                        Equations
                                        @[implicit_reducible]
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        inductive HeyLo.Literal :
                                        TyType
                                        Instances For
                                          def HeyLo.instDecidableEqLiteral.decEq {a✝ : Ty} (x✝ x✝¹ : Literal a✝) :
                                          Decidable (x✝ = x✝¹)
                                          Equations
                                          Instances For
                                            @[implicit_reducible]
                                            instance HeyLo.instToExprLiteral {a✝ : Ty} :
                                            Equations
                                            inductive HeyLo.Fun :
                                            TyTyType
                                            Instances For
                                              @[implicit_reducible]
                                              instance HeyLo.instDecidableEqFun {a✝ a✝¹ : Ty} :
                                              DecidableEq (Fun a✝ a✝¹)
                                              Equations
                                              @[implicit_reducible]
                                              instance HeyLo.instToExprFun {a✝ a✝¹ : Ty} :
                                              Lean.ToExpr (Fun a✝ a✝¹)
                                              Equations
                                              inductive HeyLo :
                                              Instances For
                                                Equations
                                                Instances For
                                                  @[implicit_reducible]
                                                  instance instToExprHeyLo {a✝ : HeyLo.Ty} :
                                                  Equations
                                                  def instDecidableEqHeyLo.decEq {a✝ : HeyLo.Ty} (x✝ x✝¹ : HeyLo a✝) :
                                                  Decidable (x✝ = x✝¹)
                                                  Equations
                                                  Instances For
                                                    @[implicit_reducible]
                                                    instance HeyLo.instOfNat {α : Ty} {n : } (h : α.Arith := by exact default) :
                                                    OfNat (HeyLo α) n
                                                    Equations
                                                    @[implicit_reducible]
                                                    instance HeyLo.instAdd {α : Ty} (h : α.Arith := by exact default) :
                                                    Add (HeyLo α)
                                                    Equations
                                                    @[implicit_reducible]
                                                    instance HeyLo.instSub {α : Ty} (h : α.Arith := by exact default) :
                                                    Sub (HeyLo α)
                                                    Equations
                                                    @[implicit_reducible]
                                                    instance HeyLo.instMul {α : Ty} (h : α.Arith := by exact default) :
                                                    Mul (HeyLo α)
                                                    Equations
                                                    @[implicit_reducible]
                                                    instance HeyLo.instDiv {α : Ty} (h : α.Arith := by exact default) :
                                                    Div (HeyLo α)
                                                    Equations
                                                    @[implicit_reducible]
                                                    instance instHNotHeyLo {α : HeyLo.Ty} :
                                                    HNot (HeyLo α)
                                                    Equations
                                                    def HeyLo.subst {α : Ty} (X : HeyLo α) (x : Ident) (Y : HeyLo x.type) :
                                                    Equations
                                                    Instances For
                                                      @[implicit_reducible]
                                                      Equations
                                                      noncomputable def HeyLo.BinOp.sem {α β : Ty} (op : BinOp α β) (l r : α.expr) :
                                                      β.expr
                                                      Equations
                                                      Instances For
                                                        noncomputable def HeyLo.UnOp.sem {α β : Ty} (op : UnOp α β) (x : α.expr) :
                                                        β.expr
                                                        Equations
                                                        Instances For
                                                          @[simp]
                                                          theorem Bool.iInf_eq {α : Type u_1} (f : αBool) :
                                                          ⨅ (x : α), f x = true ∀ (x : α), f x = true
                                                          @[simp]
                                                          theorem Bool.iSup_eq {α : Type u_1} (f : αBool) :
                                                          ⨆ (x : α), f x = true ∃ (x : α), f x = true
                                                          noncomputable def HeyLo.QuantOp.sem {α : Ty} (op : QuantOp α) (x : Ident) (m : α.expr) :
                                                          α.expr
                                                          Equations
                                                          Instances For
                                                            @[simp]
                                                            theorem HeyLo.QuantOp.Sup_sem_eq_iSup_ennreal {𝒱 : Sort u_1} {e : Ty.ENNReal.expr} [DecidableEq 𝒱] {x : Ident} :
                                                            Sup.sem x e = ⨆ (v : x.type.lit), e[x fun (x : pGCL.State Ty.Γ) => v]
                                                            @[simp]
                                                            theorem HeyLo.QuantOp.Sup_sem_eq_iInf_ennreal {e : Ty.ENNReal.expr} {x : Ident} :
                                                            Inf.sem x e = ⨅ (v : x.type.lit), e[x fun (x : pGCL.State Ty.Γ) => v]
                                                            noncomputable def HeyLo.Fun.sem {α β : Ty} (f : Fun α β) (m : α.expr) :
                                                            β.expr
                                                            Equations
                                                            Instances For
                                                              noncomputable def HeyLo.sem {α : Ty} (X : HeyLo α) :
                                                              α.expr
                                                              Equations
                                                              Instances For
                                                                @[simp]
                                                                theorem QuantOp.Forall_sem {x : HeyLo.Ident} {m : HeyLo.Ty.Bool.expr} {σ : pGCL.State HeyLo.Ty.Γ} :
                                                                HeyLo.QuantOp.Forall.sem x m σ = ∀ (v : x.type.lit), (m[x fun (x : pGCL.State HeyLo.Ty.Γ) => v]) σ
                                                                @[simp]
                                                                theorem QuantOp.Exists_sem {x : HeyLo.Ident} {m : HeyLo.Ty.Bool.expr} {σ : pGCL.State HeyLo.Ty.Γ} :
                                                                HeyLo.QuantOp.Exists.sem x m σ = ∃ (v : x.type.lit), (m[x fun (x : pGCL.State HeyLo.Ty.Γ) => v]) σ
                                                                @[simp]
                                                                theorem HeyLo.Sup_sem_eq_iSup_ennreal {e : HeyLo Ty.ENNReal} {x : Ident} :
                                                                (Quant QuantOp.Sup x e).sem = ⨆ (v : x.type.lit), e.sem[x fun (x : pGCL.State Ty.Γ) => v]
                                                                @[simp]
                                                                theorem HeyLo.Sup_sem_eq_iInf_ennreal {e : HeyLo Ty.ENNReal} {x : Ident} :
                                                                (Quant QuantOp.Inf x e).sem = ⨅ (v : x.type.lit), e.sem[x fun (x : pGCL.State Ty.Γ) => v]
                                                                @[simp]
                                                                theorem HeyLo.sem_subst {α : Ty} {x : Ident} {v : HeyLo x.type} {X : HeyLo α} :
                                                                X[x v].sem = X.sem[x v.sem]
                                                                @[simp]
                                                                theorem UnOp.sem_subst {α β : HeyLo.Ty} {subs : List ((a : HeyLo.Ident) × (pGCL.State HeyLo.Ty.ΓHeyLo.Ty.Γ a))} {op : HeyLo.UnOp α β} {a : α.expr} :
                                                                (op.sem a)[..subs] = op.sem (a[..subs])
                                                                @[simp]
                                                                theorem BinOp.sem_subst {α β : HeyLo.Ty} {b : α.expr} {subs : List ((a : HeyLo.Ident) × (pGCL.State HeyLo.Ty.ΓHeyLo.Ty.Γ a))} {op : HeyLo.BinOp α β} {a : α.expr} :
                                                                (op.sem a b)[..subs] = op.sem (a[..subs]) (b[..subs])
                                                                @[simp]
                                                                theorem HeyLo.lit_sem_subst {α : Ty} {subs : List ((a : Ident) × (pGCL.State Ty.ΓTy.Γ a))} {l : Literal α} :
                                                                (Lit l).sem[..subs] = (Lit l).sem
                                                                @[simp]
                                                                theorem HeyLo.call_sem_subst {α β : Ty} {arg : HeyLo α} {subs : List ((a : Ident) × (pGCL.State Ty.ΓTy.Γ a))} {f : Fun α β} :
                                                                (Call f arg).sem[..subs] = f.sem (arg.sem[..subs])
                                                                @[simp]
                                                                theorem HeyLo.ite_sem_subst {α : Ty} {c : HeyLo Ty.Bool} {s : List ((a : Ident) × (pGCL.State Ty.ΓTy.Γ a))} {a b : HeyLo α} :
                                                                (c.Ite a b).sem[..s] = fun (σ : pGCL.State Ty.Γ) => if (c.sem[..s]) σ then (a.sem[..s]) σ else (b.sem[..s]) σ
                                                                @[simp]
                                                                theorem HeyLo.sem_Forall_apply {x : Ident} {σ : pGCL.State Ty.Γ} {c : HeyLo Ty.Bool} :
                                                                (Quant QuantOp.Forall x c).sem σ ∀ (v : x.type.lit), c.sem (σ[x v])
                                                                @[simp]
                                                                theorem HeyLo.sem_Exists_apply {x : Ident} {σ : pGCL.State Ty.Γ} {c : HeyLo Ty.Bool} :
                                                                (Quant QuantOp.Exists x c).sem σ ∃ (v : x.type.lit), c.sem (σ[x v])
                                                                @[reducible, inline]
                                                                Equations
                                                                Instances For
                                                                  def HeyLo.castTy {α β : Ty} (a : HeyLo α) (h : α = β) :
                                                                  Equations
                                                                  Instances For
                                                                    Equations
                                                                    Instances For
                                                                      def HeyLo.performSubstWith {α : Ty} (a : HeyLo α) (x : Ident) (v : HeyLo x.type) :
                                                                      Equations
                                                                      Instances For
                                                                        theorem HeyLo.performSubstWith_sem {α : Ty} {x : Ident} {v : HeyLo x.type} {m : HeyLo α} :
                                                                        theorem Array.flatMap_sum {α : Type u_1} {β : Type u_2} {A : Array α} {f : αArray β} [AddMonoid β] :
                                                                        (flatMap f A).sum = (map (fun (a : α) => (f a).sum) A).sum
                                                                        theorem Array.map_mul_sum {α : Type u_1} {β : Type u_2} [MonoidWithZero β] [AddMonoid β] [LeftDistribClass β] {A : Array α} {s : β} {f : αβ} :
                                                                        (map (fun (x : α) => s * f x) A).sum = s * (map f A).sum
                                                                        structure HeyLo.Distribution (α : Ty) :
                                                                        Instances For
                                                                          def HeyLo.instDecidableEqDistribution.decEq {α✝ : Ty} (x✝ x✝¹ : Distribution α✝) :
                                                                          Decidable (x✝ = x✝¹)
                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            @[implicit_reducible]
                                                                            Equations
                                                                            Equations
                                                                            Instances For
                                                                              def HeyLo.Distribution.bind {α β : Ty} (μ : Distribution α) (f : HeyLo αDistribution β) :
                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                def HeyLo.Distribution.map {α β : Ty} (μ : Distribution α) (f : HeyLo αHeyLo β) :
                                                                                Equations
                                                                                Instances For
                                                                                  @[implicit_reducible]
                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  @[simp]
                                                                                  theorem HeyLo.Distribution.exists_in_values {α : Ty} (μ : Distribution α) :
                                                                                  ∃ (x : HeyLo Ty.ENNReal) (v : HeyLo α), (x, v) μ.values
                                                                                  @[simp]
                                                                                  theorem Array.sum_replicate {n : } {α : Type u_1} {x : α} [Semiring α] :
                                                                                  (replicate n x).sum = n * x
                                                                                  def HeyLo.Distribution.unif {α : Ty} (vs : Array (HeyLo α)) (h : vs #[]) :
                                                                                  Equations
                                                                                  Instances For
                                                                                    def HeyLo.Distribution.bin {α : Ty} (a : HeyLo α) (p : HeyLo Ty.ENNReal) (b : HeyLo α) :
                                                                                    Equations
                                                                                    Instances For
                                                                                      @[simp]
                                                                                      theorem HeyLo.Distribution.pure_map {α a✝ : Ty} {f : HeyLo αHeyLo a✝} {e : HeyLo α} :
                                                                                      (pure e).map f = pure (f e)
                                                                                      @[simp]
                                                                                      theorem HeyLo.Distribution.bin_map {α : Ty} {p : HeyLo Ty.ENNReal} {a✝ : Ty} {f : HeyLo αHeyLo a✝} {a b : HeyLo α} :
                                                                                      (bin a p b).map f = bin (f a) p (f b)
                                                                                      Equations
                                                                                      Instances For
                                                                                        @[simp]
                                                                                        theorem HeyLo.Distribution.bin_toExpr {p a b : HeyLo Ty.ENNReal} :
                                                                                        (bin a p b).toExpr = (p1) * a + ((1 - p1) * b + 0)