Documentation

HeyVL.Expr

inductive HeyLo.Ty :
Instances For
    Equations
    @[reducible, inline]
    abbrev HeyLo.Ty.lit :
    TyType
    Equations
    Instances For
      inductive HeyLo.Yes :
      Instances For
        Equations
        inductive HeyLo.No :
          Instances For
            Equations
              Instances For
                def HeyLo.instDecidableEqNo.decEq (x✝ x✝¹ : No) :
                Decidable (x✝ = x✝¹)
                Equations
                  Instances For
                    Equations
                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Equations
                        • One or more equations did not get rendered due to their size.
                        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
                            instance HeyLo.instToExprBinOp {a✝ a✝¹ : Ty} :
                            Lean.ToExpr (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
                                instance HeyLo.instToExprUnOp {a✝ a✝¹ : Ty} :
                                Lean.ToExpr (UnOp a✝ a✝¹)
                                Equations
                                inductive HeyLo.QuantOp :
                                TyType
                                Instances For
                                  instance HeyLo.instToExprQuantOp {a✝ : Ty} :
                                  Equations
                                  structure HeyLo.Ident :
                                  Instances For
                                    Equations
                                    Instances For
                                      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
                                                  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
                                                      instance HeyLo.instToExprLiteral {a✝ : Ty} :
                                                      Equations
                                                      inductive HeyLo.Fun :
                                                      TyTyType
                                                      Instances For
                                                        instance HeyLo.instToExprFun {a✝ a✝¹ : Ty} :
                                                        Lean.ToExpr (Fun a✝ a✝¹)
                                                        Equations
                                                        inductive HeyLo :
                                                        Instances For
                                                          Equations
                                                          Instances For
                                                            instance instToExprHeyLo {a✝ : HeyLo.Ty} :
                                                            Equations
                                                            def instDecidableEqHeyLo.decEq {a✝ : HeyLo.Ty} (x✝ x✝¹ : HeyLo a✝) :
                                                            Decidable (x✝ = x✝¹)
                                                            Equations
                                                            Instances For
                                                              instance HeyLo.instOfNat {α : Ty} {n : } (h : α.Arith := by exact default) :
                                                              OfNat (HeyLo α) n
                                                              Equations
                                                              instance HeyLo.instAdd {α : Ty} (h : α.Arith := by exact default) :
                                                              Add (HeyLo α)
                                                              Equations
                                                              instance HeyLo.instSub {α : Ty} (h : α.Arith := by exact default) :
                                                              Sub (HeyLo α)
                                                              Equations
                                                              instance HeyLo.instMul {α : Ty} (h : α.Arith := by exact default) :
                                                              Mul (HeyLo α)
                                                              Equations
                                                              instance HeyLo.instDiv {α : Ty} (h : α.Arith := by exact default) :
                                                              Div (HeyLo α)
                                                              Equations
                                                              def HeyLo.subst {α : Ty} (X : HeyLo α) (x : Ident) (Y : HeyLo x.type) :
                                                              Equations
                                                              Instances For
                                                                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} {x : HeyLo.Ident} {v : pGCL.State HeyLo.Ty.ΓHeyLo.Ty.Γ x} {op : HeyLo.UnOp α β} {a : α.expr} :
                                                                          (op.sem a)[x v] = op.sem (a[x v])
                                                                          @[simp]
                                                                          theorem BinOp.sem_subst {α β : HeyLo.Ty} {b : α.expr} {x : HeyLo.Ident} {v : pGCL.State HeyLo.Ty.ΓHeyLo.Ty.Γ x} {op : HeyLo.BinOp α β} {a : α.expr} :
                                                                          (op.sem a b)[x v] = op.sem (a[x v]) (b[x v])
                                                                          @[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])
                                                                          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
                                                                              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
                                                                                    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)