File: Mathlib/Tactic/Widget/StringDiagram.lean

full_name: Mathlib.Tactic.Widget.StringDiagram.AtomNode.hPosTar
code: /-- Nodes for 2-morphisms in a string diagram. -/
structure AtomNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  atom : Atom
goal: ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.AtomNode.atom
code: /-- Nodes for 2-morphisms in a string diagram. -/
structure AtomNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  atom : Atom
goal: Mathlib.Tactic.Monoidal.Atom

full_name: Mathlib.Tactic.Widget.StringDiagram.AtomNode.hPosSrc
code: /-- Nodes for 2-morphisms in a string diagram. -/
structure AtomNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  atom : Atom
goal: ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.AtomNode
code: /-- Nodes for 2-morphisms in a string diagram. -/
structure AtomNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  atom : Atom
goal: Type

full_name: Mathlib.Tactic.Widget.StringDiagram.AtomNode.vPos
code: /-- Nodes for 2-morphisms in a string diagram. -/
structure AtomNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  atom : Atom
goal: ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.IdNode.hPosTar
code: /-- Nodes for identity 2-morphisms in a string diagram. -/
structure IdNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  id : Atom₁
goal: ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.IdNode.hPosSrc
code: /-- Nodes for identity 2-morphisms in a string diagram. -/
structure IdNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  id : Atom₁
goal: ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.IdNode.vPos
code: /-- Nodes for identity 2-morphisms in a string diagram. -/
structure IdNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  id : Atom₁
goal: ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.IdNode.id
code: /-- Nodes for identity 2-morphisms in a string diagram. -/
structure IdNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  id : Atom₁
goal: Mathlib.Tactic.Monoidal.Atom₁

full_name: Mathlib.Tactic.Widget.StringDiagram.IdNode
code: /-- Nodes for identity 2-morphisms in a string diagram. -/
structure IdNode : Type where
  /-- The vertical position of the node in the string diagram. -/
  vPos : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in domains. -/
  hPosSrc : ℕ
  /-- The horizontal position of the node in the string diagram, counting strings in codomains. -/
  hPosTar : ℕ
  /-- The underlying expression of the node. -/
  id : Atom₁
goal: Type

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.id
code: /-- Nodes in a string diagram. -/
inductive Node : Type
  | atom : AtomNode → Node
  | id : IdNode → Node
goal: Mathlib.Tactic.Widget.StringDiagram.IdNode → Mathlib.Tactic.Widget.StringDiagram.Node

full_name: Mathlib.Tactic.Widget.StringDiagram.Node
code: /-- Nodes in a string diagram. -/
inductive Node : Type
  | atom : AtomNode → Node
  | id : IdNode → Node
goal: Type

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.atom
code: /-- Nodes in a string diagram. -/
inductive Node : Type
  | atom : AtomNode → Node
  | id : IdNode → Node
goal: Mathlib.Tactic.Widget.StringDiagram.AtomNode → Mathlib.Tactic.Widget.StringDiagram.Node

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.e
code: /-- The underlying expression of a node. -/
def Node.e : Node → Expr
  
goal: Mathlib.Tactic.Widget.StringDiagram.Node → Lean.Expr

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.srcList
code: /-- The domain of the 2-morphism associated with a node as a list
(the first component is the node itself). -/
def Node.srcList : Node → MetaM (List (Node × Atom₁))
  
goal: Mathlib.Tactic.Widget.StringDiagram.Node →
  Lean.MetaM (List (Mathlib.Tactic.Widget.StringDiagram.Node × Mathlib.Tactic.Monoidal.Atom₁))

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.tarList
code: /-- The codomain of the 2-morphism associated with a node as a list
(the first component is the node itself). -/
def Node.tarList : Node → MetaM (List (Node × Atom₁))
  
goal: Mathlib.Tactic.Widget.StringDiagram.Node →
  Lean.MetaM (List (Mathlib.Tactic.Widget.StringDiagram.Node × Mathlib.Tactic.Monoidal.Atom₁))

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.vPos
code: /-- The vertical position of a node in a string diagram. -/
def Node.vPos : Node → ℕ
  
goal: Mathlib.Tactic.Widget.StringDiagram.Node → ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.hPosSrc
code: /-- The horizontal position of a node in a string diagram, counting strings in domains. -/
def Node.hPosSrc : Node → ℕ
  
goal: Mathlib.Tactic.Widget.StringDiagram.Node → ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.hPosTar
code: /-- The horizontal position of a node in a string diagram, counting strings in codomains. -/
def Node.hPosTar : Node → ℕ
  
goal: Mathlib.Tactic.Widget.StringDiagram.Node → ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.topNodes
code: /-- The list of nodes at the top of a string diagram. -/
def topNodes (η : WhiskerLeftExpr) : MetaM (List Node) 
goal: Lean.MetaM (List Mathlib.Tactic.Widget.StringDiagram.Node)

full_name: Mathlib.Tactic.Widget.StringDiagram.Strand
code: /-- Strings in a string diagram. -/
structure Strand : Type where
  /-- The horizontal position of the strand in the string diagram. -/
  hPos : ℕ
  /-- The start point of the strand in the string diagram. -/
  startPoint : Node
  /-- The end point of the strand in the string diagram. -/
  endPoint : Node
  /-- The underlying expression of the strand. -/
  atom₁ : Atom₁
goal: Type

full_name: Mathlib.Tactic.Widget.StringDiagram.Strand.atom₁
code: /-- Strings in a string diagram. -/
structure Strand : Type where
  /-- The horizontal position of the strand in the string diagram. -/
  hPos : ℕ
  /-- The start point of the strand in the string diagram. -/
  startPoint : Node
  /-- The end point of the strand in the string diagram. -/
  endPoint : Node
  /-- The underlying expression of the strand. -/
  atom₁ : Atom₁
goal: Mathlib.Tactic.Monoidal.Atom₁

full_name: Mathlib.Tactic.Widget.StringDiagram.Strand.startPoint
code: /-- Strings in a string diagram. -/
structure Strand : Type where
  /-- The horizontal position of the strand in the string diagram. -/
  hPos : ℕ
  /-- The start point of the strand in the string diagram. -/
  startPoint : Node
  /-- The end point of the strand in the string diagram. -/
  endPoint : Node
  /-- The underlying expression of the strand. -/
  atom₁ : Atom₁
goal: Mathlib.Tactic.Widget.StringDiagram.Node

full_name: Mathlib.Tactic.Widget.StringDiagram.Strand.endPoint
code: /-- Strings in a string diagram. -/
structure Strand : Type where
  /-- The horizontal position of the strand in the string diagram. -/
  hPos : ℕ
  /-- The start point of the strand in the string diagram. -/
  startPoint : Node
  /-- The end point of the strand in the string diagram. -/
  endPoint : Node
  /-- The underlying expression of the strand. -/
  atom₁ : Atom₁
goal: Mathlib.Tactic.Widget.StringDiagram.Node

full_name: Mathlib.Tactic.Widget.StringDiagram.Strand.hPos
code: /-- Strings in a string diagram. -/
structure Strand : Type where
  /-- The horizontal position of the strand in the string diagram. -/
  hPos : ℕ
  /-- The start point of the strand in the string diagram. -/
  startPoint : Node
  /-- The end point of the strand in the string diagram. -/
  endPoint : Node
  /-- The underlying expression of the strand. -/
  atom₁ : Atom₁
goal: ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.Strand.vPos
code: /-- The vertical position of a strand in a string diagram. -/
def Strand.vPos (s : Strand) : ℕ 
goal: ℕ

full_name: Mathlib.Tactic.Monoidal.WhiskerRightExpr.nodes
code: /-- The list of nodes associated with a 2-morphism. The position is counted from the
specified natural numbers. -/
def WhiskerRightExpr.nodes (v h₁ h₂ : ℕ) : WhiskerRightExpr → MetaM (List Node)
  
goal: Mathlib.Tactic.Monoidal.WhiskerRightExpr → Lean.MetaM (List Mathlib.Tactic.Widget.StringDiagram.Node)

full_name: Mathlib.Tactic.Monoidal.WhiskerLeftExpr.nodes
code: /-- The list of nodes associated with a 2-morphism. The position is counted from the
specified natural numbers. -/
def WhiskerLeftExpr.nodes (v h₁ h₂ : ℕ) : WhiskerLeftExpr → MetaM (List Node)
  
goal: Mathlib.Tactic.Monoidal.WhiskerLeftExpr → Lean.MetaM (List Mathlib.Tactic.Widget.StringDiagram.Node)

full_name: Mathlib.Tactic.Monoidal.NormalExpr.nodesAux
code: /-- The list of nodes at the top of a string diagram. The position is counted from the
specified natural number. -/
def NormalExpr.nodesAux (v : ℕ) : NormalExpr → MetaM (List (List Node))
  
goal: Mathlib.Tactic.Monoidal.NormalExpr → Lean.MetaM (List (List Mathlib.Tactic.Widget.StringDiagram.Node))

full_name: Mathlib.Tactic.Monoidal.NormalExpr.nodes
code: /-- The list of nodes associated with a 2-morphism. -/
def NormalExpr.nodes (e : NormalExpr) : MetaM (List (List Node)) 
goal: Lean.MetaM (List (List Mathlib.Tactic.Widget.StringDiagram.Node))

full_name: Mathlib.Tactic.Monoidal.pairs
code: /-- `pairs [a, b, c, d]` is `[(a, b), (b, c), (c, d)]`. -/
def pairs {α : Type} : List α → List (α × α)
  
goal: List α → List (α × α)

full_name: Mathlib.Tactic.Monoidal.NormalExpr.strands
code: /-- The list of strands associated with a 2-morphism. -/
def NormalExpr.strands (e : NormalExpr) : MetaM (List (List Strand)) 
goal: Lean.MetaM (List (List Mathlib.Tactic.Widget.StringDiagram.Strand))

full_name: Mathlib.Tactic.Widget.StringDiagram.PenroseVar.indices
code: /-- A type for Penrose variables. -/
structure PenroseVar : Type where
  /-- The identifier of the variable. -/
  ident : String
  /-- The indices of the variable. -/
  indices : List ℕ
  /-- The underlying expression of the variable. -/
  e : Expr
goal: List ℕ

full_name: Mathlib.Tactic.Widget.StringDiagram.PenroseVar.ident
code: /-- A type for Penrose variables. -/
structure PenroseVar : Type where
  /-- The identifier of the variable. -/
  ident : String
  /-- The indices of the variable. -/
  indices : List ℕ
  /-- The underlying expression of the variable. -/
  e : Expr
goal: String

full_name: Mathlib.Tactic.Widget.StringDiagram.PenroseVar.e
code: /-- A type for Penrose variables. -/
structure PenroseVar : Type where
  /-- The identifier of the variable. -/
  ident : String
  /-- The indices of the variable. -/
  indices : List ℕ
  /-- The underlying expression of the variable. -/
  e : Expr
goal: Lean.Expr

full_name: Mathlib.Tactic.Widget.StringDiagram.PenroseVar
code: /-- A type for Penrose variables. -/
structure PenroseVar : Type where
  /-- The identifier of the variable. -/
  ident : String
  /-- The indices of the variable. -/
  indices : List ℕ
  /-- The underlying expression of the variable. -/
  e : Expr
goal: Type

full_name: Mathlib.Tactic.Widget.StringDiagram.instToStringPenroseVar
code: instance : ToString PenroseVar 
goal: ToString Mathlib.Tactic.Widget.StringDiagram.PenroseVar

full_name: Mathlib.Tactic.Widget.StringDiagram.Node.toPenroseVar
code: /-- The penrose variable assciated with a node. -/
def Node.toPenroseVar (n : Node) : PenroseVar 
goal: Mathlib.Tactic.Widget.StringDiagram.PenroseVar

full_name: Mathlib.Tactic.Widget.StringDiagram.Strand.toPenroseVar
code: /-- The penrose variable assciated with a strand. -/
def Strand.toPenroseVar (s : Strand) : PenroseVar 
goal: Mathlib.Tactic.Widget.StringDiagram.PenroseVar

full_name: Mathlib.Tactic.Widget.StringDiagram.addPenroseVar
code: /-- Add the variable `v` with the type `tp` to the substance program. -/
def addPenroseVar (tp : String) (v : PenroseVar) :
    DiagramBuilderM Unit 
goal: ProofWidgets.Penrose.DiagramBuilderM Unit

full_name: Mathlib.Tactic.Widget.StringDiagram.addConstructor
code: /-- Add constructor `tp v := nm (vs)` to the substance program. -/
def addConstructor (tp : String) (v : PenroseVar) (nm : String) (vs : List PenroseVar) :
    DiagramBuilderM Unit 
goal: ProofWidgets.Penrose.DiagramBuilderM Unit

full_name: Mathlib.Tactic.Widget.StringDiagram.mkStringDiagram
code: /-- Construct a string diagram from a Penrose `sub`stance program and expressions `embeds` to
display as labels in the diagram. -/
def mkStringDiagram (e : NormalExpr) : DiagramBuilderM PUnit 
goal: ProofWidgets.Penrose.DiagramBuilderM PUnit.{1}

full_name: Mathlib.Tactic.Widget.StringDiagram.dsl
code: /-- Penrose dsl file for string diagrams. -/
def dsl 
goal: String

full_name: Mathlib.Tactic.Widget.StringDiagram.sty
code: /-- Penrose sty file for string diagrams. -/
def sty 
goal: String

full_name: Mathlib.Tactic.Widget.StringDiagram.fromExpr
code: /-- Construct a string diagram from the expression of a 2-morphism. -/
def fromExpr (e : Expr) : MonoidalM Html 
goal: Mathlib.Tactic.Monoidal.MonoidalM ProofWidgets.Html

full_name: Mathlib.Tactic.Widget.StringDiagram.stringM?
code: /-- Given a 2-morphism, return a string diagram. Otherwise `none`. -/
def stringM? (e : Expr) : MetaM (Option Html) 
goal: Lean.MetaM (Option ProofWidgets.Html)

full_name: Mathlib.Tactic.Widget.StringDiagram.mkEqHtml
code: /-- Help function for displaying two string diagrams in an equality. -/
def mkEqHtml (lhs rhs : Html) : Html 
goal: ProofWidgets.Html

full_name: Mathlib.Tactic.Widget.StringDiagram.stringEqM?
code: /-- Given an equality between 2-morphisms, return a string diagram of the LHS and RHS.
Otherwise `none`. -/
def stringEqM? (e : Expr) : MetaM (Option Html) 
goal: Lean.MetaM (Option ProofWidgets.Html)

full_name: Mathlib.Tactic.Widget.StringDiagram.stringMorOrEqM?
code: /-- Given an 2-morphism or equality between 2-morphisms, return a string diagram.
Otherwise `none`. -/
def stringMorOrEqM? (e : Expr) : MetaM (Option Html) 
goal: Lean.MetaM (Option ProofWidgets.Html)

full_name: Mathlib.Tactic.Widget.StringDiagram.stringPresenter
code: /-- The `Expr` presenter for displaying string diagrams. -/
@[expr_presenter]
def stringPresenter : ExprPresenter 
goal: ProofWidgets.ExprPresenter

full_name: Mathlib.Tactic.Widget.StringDiagram.rpc
code: /-- The RPC method for displaying string diagrams. -/
@[server_rpc_method]
def rpc (props : PanelWidgetProps) : RequestM (RequestTask Html) 
goal: Lean.Server.RequestM (Lean.Server.RequestTask ProofWidgets.Html)

full_name: Mathlib.Tactic.Widget.StringDiagram
code: /-- Display the string diagrams if the goal is an equality of morphisms in a monoidal category. -/
@[widget_module]
def StringDiagram : Component PanelWidgetProps 
goal: ProofWidgets.Component ProofWidgets.PanelWidgetProps