Documentation

Cslib.Data.FinFun

Finite Functions #

Note: the API and notation of FinFun is still unstable.

A FinFun α β is a function from α to β with a finite domain of definition.

structure FinFun (α : Type u) (β : Type v) :
Type (max u v)

A finite function FinFun is a function f equipped with a domain of definition dom.

Instances For
    @[reducible, inline]
    abbrev CompleteDom {β : Type u_1} {α : Type u_2} [Zero β] (f : α β) :
    Equations
    Instances For
      def FinFun.defined {α : Type u_1} {β : Type u_2} (f : α β) (x : α) :
      Equations
      Instances For
        @[reducible, inline]
        abbrev FinFun.apply {α : Type u_1} {β : Type u_2} (f : α β) (x : α) :
        β
        Equations
        Instances For
          def FinFun.toFun {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] (f : α β) :
          αβ
          Equations
          Instances For
            instance instCoeFinFunForallOfDecidableEqOfZero {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] :
            Coe (α β) (αβ)
            Equations
            theorem FinFun.toFun_char {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] {f g : α β} (h : f = g) (x : α) :
            (x f.dom g.domf.apply x = g.apply x) (x f.dom \ g.domf.apply x = Zero.zero) (x g.dom \ f.domg.apply x = Zero.zero)
            theorem FinFun.toFun_dom {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] {f : α β} (h : xf.dom, f.apply x = Zero.zero) :
            f = f.f
            def FinFun.mapBin {α : Type u_1} {β : Type u_2} [DecidableEq α] (f g : α β) (op : Option βOption βOption β) :
            Option (α β)
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem FinFun.mapBin_dom {α : Type u_1} {β : Type u_2} {fg : α β} [DecidableEq α] (f g : α β) (op : Option βOption βOption β) (h : f.mapBin g op = some fg) :
              fg.dom = f.dom fg.dom = g.dom
              theorem FinFun.mapBin_char₁ {α : Type u_1} {β : Type u_2} {fg : α β} {y : β} [DecidableEq α] (f g : α β) (op : Option βOption βOption β) (h : f.mapBin g op = some fg) (x : α) :
              x fg.dom → (fg.apply x = y op (some (f.f x)) (some (g.f x)) = some y)
              theorem FinFun.mapBin_char₂ {α : Type u_1} {β : Type u_2} [DecidableEq α] (f g : α β) (op : Option βOption βOption β) (hdom : f.dom = g.dom) (hop : xf.dom, (op (some (f.f x)) (some (g.f x))).isSome = true) :
              (f.mapBin g op).isSome = true
              def Function.toFinFun {α : Type u_1} {β : Type u_2} [DecidableEq α] (f : αβ) (dom : Finset α) :
              α β
              Equations
              Instances For
                theorem Function.toFinFun_eq {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] (f : αβ) (dom : Finset α) (h : xdom, f x = 0) :
                f = (toFinFun f dom)
                def FinFun.toDomFun {α : Type u_1} {β : Type u_2} (f : α β) :
                { x : α // x f.dom }β
                Equations
                • f x = f.f x
                Instances For
                  theorem FinFun.toDomFun_char {α : Type u_1} {β : Type u_2} {x : α} (f : α β) (h : x f.dom) :
                  f x, h = f.f x
                  theorem FinFun.congrFinFun {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] {f g : α β} (h : f = g) (a : α) :
                  f.apply a = g.apply a
                  theorem FinFun.eq_char₁ {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] {f g : α β} (h : f = g) :
                  f.f = g.f f.dom = g.dom
                  theorem FinFun.eq_char₂ {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] {f g : α β} (heq : f.f = g.f f.dom = g.dom) :
                  f = g
                  theorem FinFun.eq_char {α : Type u_1} {β : Type u_2} [DecidableEq α] [Zero β] {f g : α β} :
                  f = g f.f = g.f f.dom = g.dom