Documentation

Provenance.AnnotatedDatabase

@[reducible, inline]
abbrev AnnotatedTuple (T : Type) (K : Type u_1) (n : ) :
Type u_1
Equations
Instances For
    Equations
    instance instZeroAnnotatedTuple {T : Type} [ValueType T] {K : Type} [Zero K] {n : } :
    Equations
    def AnnotatedRelation (T : Type) (K : Type u_1) (arity : ) :
    Type u_1
    Equations
    Instances For
      def AnnotatedRelation.cast {T K : Type} {n m : } (heq : n = m) (r : AnnotatedRelation T K n) :
      Equations
      Instances For
        def Relation.annotate {T K : Type} {n : } (f : Tuple T nK) (r : Relation T n) :
        Equations
        Instances For
          def AnnotatedDatabase (T : Type) (K : Type u_1) :
          Type u_1
          Equations
          Instances For
            Equations
            Instances For
              def AnnotatedTuple.toComposite {T K : Type} {n : } (p : AnnotatedTuple T K n) :
              Fin (n + Nat.succ 0)T K
              Equations
              Instances For
                def Tuple.fromComposite {T : Type} [ValueType T] {K : Type} [Zero K] {n : } (t : Tuple (T K) (n + 1)) :
                Equations
                Instances For
                  def AnnotatedRelation.toComposite {T K : Type} {n : } (ar : AnnotatedRelation T K n) :
                  Relation (T K) (n + 1)
                  Equations
                  Instances For
                    @[simp]
                    theorem AnnotatedRelation.toComposite_add {n : } {T K : Type} (ar₁ ar₂ : AnnotatedRelation T K n) :
                    (ar₁ + ar₂).toComposite = ar₁.toComposite + ar₂.toComposite
                    Equations
                    Instances For
                      theorem AnnotatedTuple.toComposite_join {n₁ n₂ : } {K T : Type} [ValueType T] [HasAltLinearOrder K] [SemiringWithMonus K] (ta₁ : AnnotatedTuple T K n₁) (ta₂ : AnnotatedTuple T K n₂) :
                      toComposite (Fin.append ta₁.1 ta₂.1, ta₁.2 * ta₂.2) = fun (k : Fin (n₁ + n₂ + 1)) => if h : k < n₁ then ta₁.toComposite (k.castLT ) else if k < n₁ + n₂ then ta₂.toComposite (Fin.ofNat (n₂ + 1) (k.toNat - n₁)) else ta₁.toComposite (Fin.last n₁) * ta₂.toComposite (Fin.last n₂)
                      theorem eq_imp_eq_equiv_eq {α✝ : Sort u_1} {y z x : α✝} :
                      y = z → (x = y x = z)
                      theorem AnnotatedRelation.toComposite_map_product {n₁ n₂ : } {K T : Type} [ValueType T] [HasAltLinearOrder K] [SemiringWithMonus K] (ar₁ : AnnotatedRelation T K n₁) (ar₂ : AnnotatedRelation T K n₂) :
                      toComposite (Multiset.map (fun (x : AnnotatedTuple T K n₁ × AnnotatedTuple T K n₂) => (Fin.append x.1.1 x.2.1, x.1.2 * x.2.2)) (Multiset.product ar₁ ar₂)) = Multiset.map (fun (x : Tuple (T K) (n₁ + 1) × Tuple (T K) (n₂ + 1)) (k : Fin (n₁ + n₂ + 1)) => if h : k < n₁ then x.1 (k.castLT ) else if k < n₁ + n₂ then x.2 (Fin.ofNat (n₂ + 1) (k.toNat - n₁)) else x.1 (Fin.last n₁) * x.2 (Fin.last n₂)) (Multiset.product ar₁.toComposite ar₂.toComposite)
                      theorem AnnotatedRelation.cast_toComposite {n m : } {T K : Type} (ar : AnnotatedRelation T K n) (h' : n + 1 = m + 1) (h : n = m) :