File: Mathlib/Tactic/ProdAssoc.lean

full_name: Lean.Expr.ProdTree.prod
code: /-- A helper type to keep track of universe levels and types in iterated produts. -/
inductive ProdTree where
  | type (tp : Expr) (l : Level)
  | prod (fst snd : ProdTree) (lfst lsnd : Level)
deriving Repr
goal: Lean.Expr.ProdTree

full_name: Lean.Expr.ProdTree.type
code: /-- A helper type to keep track of universe levels and types in iterated produts. -/
inductive ProdTree where
  | type (tp : Expr) (l : Level)
  | prod (fst snd : ProdTree) (lfst lsnd : Level)
deriving Repr
goal: Lean.Expr.ProdTree

full_name: Lean.Expr.instReprProdTree
code: /-- A helper type to keep track of universe levels and types in iterated produts. -/
inductive ProdTree where
  | type (tp : Expr) (l : Level)
  | prod (fst snd : ProdTree) (lfst lsnd : Level)
deriving Repr
goal: Repr Lean.Expr.ProdTree

full_name: Lean.Expr.ProdTree
code: /-- A helper type to keep track of universe levels and types in iterated produts. -/
inductive ProdTree where
  | type (tp : Expr) (l : Level)
  | prod (fst snd : ProdTree) (lfst lsnd : Level)
deriving Repr
goal: Type

full_name: Lean.Expr.ProdTree.getType
code: /-- The iterated product corresponding to a `ProdTree`. -/
def ProdTree.getType : ProdTree → Expr
  
goal: Lean.Expr.ProdTree → Lean.Expr

full_name: Lean.Expr.ProdTree.size
code: /-- The number of types appearing in an iterated product encoded as a `ProdTree`. -/
def ProdTree.size : ProdTree → Nat
  
goal: Lean.Expr.ProdTree → ℕ

full_name: Lean.Expr.ProdTree.components
code: /-- The components of an interated product, presented as a `ProdTree`. -/
def ProdTree.components : ProdTree → List Expr
  
goal: Lean.Expr.ProdTree → List Lean.Expr

full_name: Lean.Expr.mkProdTree
code: /-- Make a `ProdTree` out of an `Expr`. -/
partial def mkProdTree (e : Expr) : MetaM ProdTree 
goal: Lean.MetaM Lean.Expr.ProdTree

full_name: Lean.Expr.ProdTree.unpack
code: /-- Given `P : ProdTree` representing an iterated product and `e : Expr` which
should correspond to a term of the iterated product, this will return
a list, whose items correspond to the leaves of `P` (i.e. the types appearing in the product),
where each item is the appropriate composition of `Prod.fst` and `Prod.snd` applied to `e`
resulting in an element of the type corresponding to the leaf.

For example, if `P` corresponds to `(X × Y) × Z` and `t : (X × Y) × Z`, then this
should return `[t.fst.fst, t.fst.snd, t.snd]`.
-/
def ProdTree.unpack (t : Expr) : ProdTree → MetaM (List Expr)
  
goal: Lean.Expr.ProdTree → Lean.MetaM (List Lean.Expr)

full_name: Lean.Expr.ProdTree.pack
code: /-- This function should act as the "reverse" of `ProdTree.unpack`, constructing
a term of the iterated product out of a list of terms of the types appearing in the product. -/
def ProdTree.pack (ts : List Expr) : ProdTree → MetaM Expr
  
goal: Lean.Expr.ProdTree → Lean.MetaM Lean.Expr

full_name: Lean.Expr.ProdTree.convertTo
code: /-- Converts a term `e` in an iterated product `P1` into a term of an iterated product `P2`.
Here `e` is an `Expr` representing the term, and the iterated products are represented
by terms of `ProdTree`. -/
def ProdTree.convertTo (P1 P2 : ProdTree) (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Expr.mkProdFun
code: /-- Given two expressions corresponding to iterated products of the same types, associated in
possibly different ways, this constructs the "obvious" function from one to the other. -/
def mkProdFun (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Expr.mkProdEquiv
code: /-- Construct the equivalence between iterated products of the same type, associated
in possibly different ways. -/
def mkProdEquiv (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Expr.prodAssocStx
code: /-- IMPLEMENTATION: Syntax used in the implementation of `prod_assoc%`.
This elaborator postpones if there are metavariables in the expected type,
and to propagate the fact that this elaborator produces an `Equiv`,
the `prod_assoc%` macro sets things up with a type ascription.
This enables using `prod_assoc%` with, for example `Equiv.trans` dot notation. -/
syntax (name := prodAssocStx) "prod_assoc_internal%" : term
goal: Lean.ParserDescr

full_name: Lean.Expr.elabProdAssoc
code: /-- Elaborator for `prod_assoc%`. -/
@[term_elab prodAssocStx]
def elabProdAssoc : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Expr.«_aux_Mathlib_Tactic_ProdAssoc___macroRules_Lean_Expr_termProd_assoc%_1»
code: macro "prod_assoc%" : term => `((prod_assoc_internal% : _ ≃ _))
goal: Lean.Macro

full_name: Lean.Expr.«termProd_assoc%»
code: macro "prod_assoc%" : term => `((prod_assoc_internal% : _ ≃ _))
goal: Lean.ParserDescr