Documentation

Mathlib.Data.Opposite

Opposites #

In this file we define a structure Opposite α containing a single field of type α and two bijections op : α → αᵒᵖ and unop : αᵒᵖ → α. If α is a category, then αᵒᵖ is the opposite category, with all arrows reversed.

structure Opposite (α : Sort u) :
Sort (max 1 u)

The type of objects of the opposite of α; used to define the opposite category.

Now that Lean 4 supports definitional eta equality for records, both unop (op X) = X and op (unop X) = X are definitional equalities.

  • op :: (
    • unop : α

      The canonical map αᵒᵖ → α.

  • )
Instances For

    The type of objects of the opposite of α; used to define the opposite category.

    Now that Lean 4 supports definitional eta equality for records, both unop (op X) = X and op (unop X) = X are definitional equalities.

    Equations
    Instances For
      theorem Opposite.unop_injective {α : Sort u} :
      Function.Injective Opposite.unop
      @[simp]
      theorem Opposite.op_unop {α : Sort u} (x : αᵒᵖ) :
      { unop := x.unop } = x
      theorem Opposite.unop_op {α : Sort u} (x : α) :
      { unop := x }.unop = x
      theorem Opposite.op_inj_iff {α : Sort u} (x : α) (y : α) :
      { unop := x } = { unop := y } x = y
      @[simp]
      theorem Opposite.unop_inj_iff {α : Sort u} (x : αᵒᵖ) (y : αᵒᵖ) :
      x.unop = y.unop x = y

      The type-level equivalence between a type and its opposite.

      Equations
      • Opposite.equivToOpposite = { toFun := Opposite.op, invFun := Opposite.unop, left_inv := , right_inv := }
      Instances For
        @[simp]
        theorem Opposite.equivToOpposite_coe {α : Sort u} :
        Opposite.equivToOpposite = Opposite.op
        @[simp]
        theorem Opposite.equivToOpposite_symm_coe {α : Sort u} :
        Opposite.equivToOpposite.symm = Opposite.unop
        theorem Opposite.op_eq_iff_eq_unop {α : Sort u} {x : α} {y : αᵒᵖ} :
        { unop := x } = y x = y.unop
        theorem Opposite.unop_eq_iff_eq_op {α : Sort u} {x : αᵒᵖ} {y : α} :
        x.unop = y x = { unop := y }
        Equations
        • Opposite.instInhabited = { default := { unop := default } }
        Equations
        • =
        Equations
        • =
        def Opposite.rec' {α : Sort u} {F : αᵒᵖSort v} (h : (X : α) → F { unop := X }) (X : αᵒᵖ) :
        F X

        A recursor for Opposite. The @[induction_eliminator] attribute makes it the default induction principle for Opposite so you don't need to use induction x using Opposite.rec'.

        Equations
        Instances For