Documentation

Mathlib.Logic.Function.Defs

General operations on functions #

theorem Function.flip_def {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {f : αβφ} :
flip f = fun (b : β) (a : α) => f a b
@[reducible, inline]
def Function.dcomp {α : Sort u₁} {β : αSort u₂} {φ : {x : α} → β xSort u₃} (f : {x : α} → (y : β x) → φ y) (g : (x : α) → β x) (x : α) :
φ (g x)

Composition of dependent functions: (f ∘' g) x = f (g x), where type of g x depends on x and type of f (g x) depends on x and g x.

Equations
Instances For

    Composition of dependent functions: (f ∘' g) x = f (g x), where type of g x depends on x and type of f (g x) depends on x and g x.

    Equations
    Instances For
      @[reducible, inline]
      abbrev Function.onFun {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} (f : ββφ) (g : αβ) :
      ααφ

      Given functions f : β → β → φ and g : α → β, produce a function α → α → φ that evaluates g on each argument, then applies f to the results. Can be used, e.g., to transfer a relation from β to α.

      Equations
      Instances For

        Given functions f : β → β → φ and g : α → β, produce a function α → α → φ that evaluates g on each argument, then applies f to the results. Can be used, e.g., to transfer a relation from β to α.

        Equations
        Instances For
          @[reducible, inline]
          abbrev Function.swap {α : Sort u₁} {β : Sort u₂} {φ : αβSort u₃} (f : (x : α) → (y : β) → φ x y) (y : β) (x : α) :
          φ x y

          For a two-argument function f, swap f is the same function but taking the arguments in the reverse order. swap f y x = f x y.

          Equations
          Instances For
            theorem Function.swap_def {α : Sort u₁} {β : Sort u₂} {φ : αβSort u₃} (f : (x : α) → (y : β) → φ x y) :
            swap f = fun (y : β) (x : α) => f x y
            theorem Function.comp_assoc {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {δ : Sort u₄} (f : φδ) (g : βφ) (h : αβ) :
            (f g) h = f g h
            def Function.Bijective {α : Sort u₁} {β : Sort u₂} (f : αβ) :

            A function is called bijective if it is both injective and surjective.

            Equations
            Instances For
              theorem Function.Bijective.comp {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {g : βφ} {f : αβ} :
              Bijective gBijective fBijective (g f)
              theorem Function.Injective.beq_eq {α : Type u_1} {β : Type u_2} [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β] {f : αβ} (I : Injective f) {a b : α} :
              (f a == f b) = (a == b)
              def Function.bicompl {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {ε : Type u_5} (f : γδε) (g : αγ) (h : βδ) (a : α) (b : β) :
              ε

              Compose a binary function f with a pair of unary functions g and h. If both arguments of f have the same type and g = h, then bicompl f g g = f on g.

              Equations
              Instances For
                def Function.bicompr {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : γδ) (g : αβγ) (a : α) (b : β) :
                δ

                Compose a unary function f with a binary function g.

                Equations
                Instances For
                  theorem Function.uncurry_bicompr {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : αβγ) (g : γδ) :
                  theorem Function.uncurry_bicompl {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {ε : Type u_5} (f : γδε) (g : αγ) (h : βδ) :
                  def Function.IsFixedPt {α : Type u₁} (f : αα) (x : α) :

                  A point x is a fixed point of f : α → α if f x = x.

                  Equations
                  Instances For
                    theorem Function.IsFixedPt.eq {α : Type u₁} {f : αα} {x : α} (hf : IsFixedPt f x) :
                    f x = x

                    If x is a fixed point of f, then f x = x. This is useful, e.g., for rw or simp.

                    @[implicit_reducible]
                    instance Function.IsFixedPt.decidable {α : Type u₁} [h : DecidableEq α] {f : αα} {x : α} :
                    Equations
                    theorem Function.IsFixedPt.of_subsingleton {α : Type u₁} [Subsingleton α] (f : αα) (x : α) :
                    theorem Function.isFixedPt_id {α : Type u₁} (x : α) :

                    Every point is a fixed point of id.

                    @[simp]
                    theorem Function.forall_isFixedPt_iff {α : Type u₁} {f : αα} :
                    (∀ (x : α), IsFixedPt f x) f = id

                    A function fixes every point iff it is the identity.

                    def Pi.map {ι : Sort u_1} {α : ιSort u_2} {β : ιSort u_3} (f : (i : ι) → α iβ i) :
                    ((i : ι) → α i)(i : ι) → β i

                    Sends a dependent function a : ∀ i, α i to a dependent function Pi.map f a : ∀ i, β i by applying f i to i-th component.

                    Equations
                    Instances For
                      @[simp]
                      theorem Pi.map_apply {ι : Sort u_1} {α : ιSort u_2} {β : ιSort u_3} (f : (i : ι) → α iβ i) (a : (i : ι) → α i) (i : ι) :
                      Pi.map f a i = f i (a i)