Documentation

Provenance.Database

Tuples, relations, and databases #

This file defines the basic relational model used throughout the library.

Main definitions #

def Tuple (T : Type) (n : ) :
Equations
Instances For
    Dependency graph
    def Tuple.repr {T : Type} {n : } [Repr T] (t : Tuple T n) :
    Equations
    Instances For
      Dependency graph
      def Tuple.cast {T : Type} {n m : } (heq : n = m) (t : Tuple T n) :
      Tuple T m
      Equations
      Instances For
        Dependency graph
        theorem Tuple.apply_cast {n m : } {α : Sort u_1} {T : Type} (heq : n = m) (f : Tuple T mα) (t : Tuple T n) :
        f (cast heq t) = _root_.cast f t
        Dependency graph
        theorem Tuple.cast_get {n m : } {T : Type} (heq : n = m) (t : Tuple T n) (k : Fin m) :
        cast heq t k = t (Fin.cast k)
        Dependency graph
        Dependency graph
        @[instance_reducible]
        instance instReprTuple {α : Type} {n : } [Repr α] :
        Repr (Tuple α n)
        Equations
        Dependency graph
        @[instance_reducible]
        instance instZeroTuple {T : Type} [ValueType T] {n : } :
        Zero (Tuple T n)
        Equations
        Dependency graph
        @[instance_reducible]
        instance instLTTuple {T : Type} [ValueType T] {n : } :
        LT (Tuple T n)
        Equations
        Dependency graph
        @[instance_reducible]
        instance instLETuple {T : Type} [ValueType T] {n : } :
        LE (Tuple T n)
        Equations
        Dependency graph
        @[instance_reducible]
        instance instToStringTuple {T : Type} {n : } [ToString T] :
        Equations
        Dependency graph
        @[instance_reducible]
        instance instDecidableRelTupleLt {T : Type} [ValueType T] {n : } :
        DecidableRel fun (t₁ t₂ : Tuple T n) => t₁ < t₂
        Equations
        Dependency graph
        @[instance_reducible]
        instance instLinearOrderTuple {T : Type} [ValueType T] {n : } :
        Equations
        • One or more equations did not get rendered due to their size.
        Dependency graph
        def Relation (T : Type) (arity : ) :
        Equations
        Instances For
          Dependency graph
          def Relation.cast {T : Type} {n m : } (heq : n = m) (r : Relation T n) :
          Equations
          Instances For
            Dependency graph
            theorem Relation.cast_eq {n m : } {S : Type} (r : Relation S n) (s : Relation S m) (heq : n = m) :
            s = cast heq r s = Multiset.map (fun (t : Tuple S n) => Tuple.cast heq t) r
            Dependency graph
            @[instance_reducible]
            instance instAddRelation {T : Type} {arity : } :
            Add (Relation T arity)
            Equations
            Dependency graph
            @[instance_reducible]
            instance instSubRelation {T : Type} [ValueType T] {arity : } :
            Sub (Relation T arity)
            Equations
            Dependency graph
            @[instance_reducible]
            instance instHMulRelationHAddNat {T : Type} {a₁ a₂ : } :
            HMul (Relation T a₁) (Relation T a₂) (Relation T (a₁ + a₂))
            Equations
            • One or more equations did not get rendered due to their size.
            Dependency graph
            @[instance_reducible]
            instance instZeroRelation {T : Type} {n : } :
            Equations
            Dependency graph
            @[instance_reducible]
            instance instZeroSigmaNatRelation {T : Type} :
            Zero ((n : ) × Relation T n)
            Equations
            Dependency graph
            def Database (T : Type) :
            Equations
            Instances For
              Dependency graph
              def Database.find {T : Type} (n : ) (s : String) (d : Database T) :
              Equations
              Instances For
                Dependency graph
                def Database.find.f {T : Type} (n : ) (s : String) :
                Equations
                Instances For
                  Dependency graph
                  def sortedInsert {α : Type u_1} [LinearOrder α] (x : α) (l : { l : List α // List.Pairwise (fun (x1 x2 : α) => x1 x2) l }) :
                  { l : List α // List.Pairwise (fun (x1 x2 : α) => x1 x2) l }
                  Equations
                  Instances For
                    Dependency graph
                    Dependency graph
                    @[instance_reducible]
                    instance instToStringRelation {T : Type} [ValueType T] {n : } [ToString T] :
                    Equations
                    Dependency graph