Documentation

ImportGraph.Util.Diff.Basic

class ImportGraph.Diff.Measurable (α : Sort u_1) :
Sort (max 1 u_1)
  • measure : α → Nat
Instances

    If an integer is (strictly) greater than 0, display it with +.

    Equations
    Instances For
      structure ImportGraph.Diff.Transition (α : Type u) :

      A simple structure with two states, initial : α and final : α, which models a transition.

      • initial : α

        The state before final.

      • final : α

        The state after initial.

      Instances For
        Equations
        Instances For
          def ImportGraph.Diff.instBEqTransition.beq {α✝ : Type u_1} [BEq α✝] :
          Transition α✝ → Transition α✝ → Bool
          Equations
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[inline]
              def ImportGraph.Diff.Transition.map {α : Type u_1} {β : Type u_2} (t : Transition α) (f : α → β) :

              Apply f to both the initial and final state.

              Equations
              Instances For
                @[inline]

                The difference between the measures of the final state and initial state.

                Equations
                Instances For
                  structure ImportGraph.Diff.Venn (α : Type u) :

                  A Venn diagram characterizing the changes between some (implicit, unspecified) initial and final state.

                  • plus : α

                    What the final state has gained that was not present in the initial state.

                  • minus : α

                    What the initial state has lost that is no longer present in the final state.

                  • shared : α

                    What the initial and final state have in common.

                  Instances For
                    def ImportGraph.Diff.instHashableVenn.hash {α✝ : Type u_1} [Hashable α✝] :
                    Venn α✝ → UInt64
                    Equations
                    Instances For
                      @[instance_reducible]
                      instance ImportGraph.Diff.instBEqVenn {α✝ : Type u_1} [BEq α✝] :
                      BEq (Venn α✝)
                      Equations
                      def ImportGraph.Diff.instBEqVenn.beq {α✝ : Type u_1} [BEq α✝] :
                      Venn α✝ → Venn α✝ → Bool
                      Equations
                      Instances For
                        def ImportGraph.Diff.instReprVenn.repr {α✝ : Type u_1} [Repr α✝] :
                        Venn α✝ → Nat → Std.Format
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[instance_reducible]
                          instance ImportGraph.Diff.instReprVenn {α✝ : Type u_1} [Repr α✝] :
                          Repr (Venn α✝)
                          Equations
                          @[inline]
                          def ImportGraph.Diff.Transition.toVennBy {α : Type u_1} {β : Type u_2} (t : Transition α) (sdiff inter : α → α → β) :
                          Venn β

                          Convert a Transition α into a Venn β according to the provided notions of set difference and interesection. Note that this is slightly more general than using a VennLike α instance, as it allows changing the type to β and does not require isEmpty.

                          Equations
                          Instances For
                            class ImportGraph.Diff.VennLike (α : Sort u_1) :
                            Sort (max 1 u_1)

                            Provides the structure necessary to view α as "setlike" enough to support Venn, namely a means of taking the set difference, a means of intersection, and a notion of emptiness. This typeclass is homogeneous, i.e. we assume that α itself is sufficient for representing both states and the differences/shared aspects between them.

                            • sdiff : α → α → α

                              A "set difference" such that VennLike.sdiff a b tells us what a has that b does not.

                            • inter : α → α → α

                              An "intersection" such that VennLike.inter a b tells us what is common to both a and b.

                            • isEmpty : α → Bool

                              A notion of emptiness. VennLike.isEmpty <| VennLike.sdiff a b = true should imply that, for the purposes of the Venn diagram, a is a "subset" of b. (Both directions should indicate equality.) Likewise, VennLike.isEmpty <| VennLike.inter a b should imply that a is disjoint from b.

                            Instances

                              Convert an initial and final state into their Venn diagram using the type's VennLike instance.

                              Equations
                              Instances For
                                @[inline]
                                def ImportGraph.Diff.Venn.map {α : Type u_1} {β : Type u_2} (v : Venn α) (f : α → β) :
                                Venn β

                                Apply f to each field of v.

                                Equations
                                Instances For
                                  @[inline]
                                  def ImportGraph.Diff.Venn.isUnchangedBy {α : Type u_1} (v : Venn α) (isEmpty : α → Bool) :

                                  A v : Venn α represents no change iff both isEmpty v.plus and isEmpty v.minus.

                                  Equations
                                  Instances For
                                    @[inline]
                                    def ImportGraph.Diff.Venn.isChangedBy {α : Type u_1} (v : Venn α) (isEmpty : α → Bool) :

                                    A v : Venn α represents a change of some kind iff v.plus is not isEmpty or
                                    v.minus is not isEmpty.

                                    Equations
                                    Instances For
                                      @[inline]
                                      def ImportGraph.Diff.Venn.compareBy? {α : Type u_1} (v : Venn α) (isEmpty : α → Bool) :

                                      If comparable, the relationship final ≷ initial, according to the provided notion of isEmpty.

                                      • some .gt: the Venn diagram implicitly represents a strict increase
                                      • some .lt: the Venn diagram implicitly represents a strict decrease
                                      • some .eq: no change in state at all
                                      • none: incomparable states (some increase, some decrease)
                                      Equations
                                      Instances For
                                        @[inline]

                                        The net difference between the implicit initial and final state, collapsing the independent measurements of plus and minus together.

                                        Equations
                                        Instances For
                                          @[inline]

                                          A v : VennMeasure represents no change iff both v.plus and v.minus satisfy VennLike.isEmpty.

                                          Equations
                                          Instances For
                                            @[inline]
                                            def ImportGraph.Diff.Venn.isChanged {α : Type u_1} (v : Venn α) [VennLike α] :

                                            A v : VennMeasure represents a change of some kind iff either v.plus is not empty or v.minus is not empty, according to VennLike.isEmpty.

                                            Equations
                                            Instances For
                                              @[inline]

                                              If comparable, the relationship final ≷ initial.

                                              • some .gt: the Venn diagram implicitly represents a strict increase
                                              • some .lt: the Venn diagram implicitly represents a strict decrease
                                              • some .eq: no change in state at all
                                              • none: incomparable states (some increase, some decrease)

                                              The presence of a change is determined by VennLike.isEmpty.

                                              Equations
                                              Instances For
                                                @[inline]
                                                def ImportGraph.Diff.Venn.modifyShared {α : Type u_1} (v : Venn α) (f : α → α) :
                                                Venn α

                                                Apply f to the shared field.

                                                Equations
                                                Instances For
                                                  def ImportGraph.Diff.Venn.ignoreShared {α : Type u_1} (ignored : α) (v : Venn α) [VennLike α] :
                                                  Venn α

                                                  Removes ignored from the shared field, according to VennLike.sdiff. This is useful when we want to ignore "obvious" common factors.

                                                  Equations
                                                  Instances For
                                                    @[reducible, inline]

                                                    Measurements of the parts of a Venn diagram comparing an (implicit, unspecified) initial state and final state. Abbrev for Venn Nat.

                                                    Equations
                                                    Instances For
                                                      @[inline]
                                                      Equations
                                                      Instances For