The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V34. The tactics of Mathlib

Mathlib.Tactic.CategoryTheory.Coherence.Basic

6 declarations. Mathlib docs · Source

The Core function for monoidal and bicategory tactics

This file provides the function BicategoryLike.main for proving equalities in monoidal categories and bicategories. Using main, we will define the following tactics:

  • monoidal at Mathlib/Tactic/CategoryTheory/Monoidal/Basic.lean
  • bicategory at Mathlib/Tactic/CategoryTheory/Bicategory/Basic.lean

The main first normalizes the both sides using eval, then compares the corresponding components. It closes the goal at non-structural parts with rfl and the goal at structural parts by pureCoherence.

theorem Mathlib.Tactic.BicategoryLike.mk_eq E0 #

∀ {α : Type u_1} (a b a' b' : α), a = a' → b = b' → a' = b' → a = b

def Mathlib.Tactic.BicategoryLike.normalForm E1 #

(ρ : Type) →
  [Mathlib.Tactic.BicategoryLike.Context ρ] →
    [Mathlib.Tactic.BicategoryLike.MonadMor₁ (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
      [Mathlib.Tactic.BicategoryLike.MonadMor₂Iso (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
        [Mathlib.Tactic.BicategoryLike.MonadNormalExpr (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
          [Mathlib.Tactic.BicategoryLike.MkEval (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
            [Mathlib.Tactic.BicategoryLike.MkMor₂ (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
              [Mathlib.Tactic.BicategoryLike.MonadMor₂ (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
                Lean.Name → Lean.MVarId → Lean.MetaM (List Lean.MVarId)

Transform an equality between 2-morphisms into the equality between their normalizations.

theorem Mathlib.Tactic.BicategoryLike.mk_eq_of_cons E1 #

∀ {C : Type u} [inst : CategoryTheory.CategoryStruct.{v, u} C] {f₁ f₂ f₃ f₄ : C} (α α' : f₁ ⟶ f₂) (η η' : f₂ ⟶ f₃)
  (ηs ηs' : f₃ ⟶ f₄),
  α = α' →
    η = η' →
      ηs = ηs' →
        CategoryTheory.CategoryStruct.comp α (CategoryTheory.CategoryStruct.comp η ηs) =
          CategoryTheory.CategoryStruct.comp α' (CategoryTheory.CategoryStruct.comp η' ηs')

def Mathlib.Tactic.BicategoryLike.ofNormalizedEq E1 #

Lean.MVarId → Lean.MetaM (List Lean.MVarId)

Split the goal α ≫ η ≫ ηs = α' ≫ η' ≫ ηs' into α = α', η = η', and ηs = ηs'.

def Mathlib.Tactic.BicategoryLike.List.splitEvenOdd E1 #

{α : Type u} → List α → List α × List α

List.splitEvenOdd [0, 1, 2, 3, 4] = ([0, 2, 4], [1, 3])

def Mathlib.Tactic.BicategoryLike.main E1 #

(ρ : Type) →
  [Mathlib.Tactic.BicategoryLike.Context ρ] →
    [Mathlib.Tactic.BicategoryLike.MonadMor₁ (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
      [Mathlib.Tactic.BicategoryLike.MonadMor₂Iso (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
        [Mathlib.Tactic.BicategoryLike.MonadNormalExpr (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
          [Mathlib.Tactic.BicategoryLike.MkEval (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
            [Mathlib.Tactic.BicategoryLike.MkMor₂ (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
              [Mathlib.Tactic.BicategoryLike.MonadMor₂ (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
                [Mathlib.Tactic.BicategoryLike.MonadCoherenceHom (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
                  [Mathlib.Tactic.BicategoryLike.MonadNormalizeNaturality
                        (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
                    [Mathlib.Tactic.BicategoryLike.MkEqOfNaturality (Mathlib.Tactic.BicategoryLike.CoherenceM ρ)] →
                      Lean.Name → Lean.MVarId → Lean.MetaM (List Lean.MVarId)

The core function for monoidal and bicategory tactics.