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.FunProp.FunctionData

55 declarations. Mathlib docs · Source

funProp data structure holding information about a function

FunctionData holds data about function in the form fun x ↦ f x₁ ... xₙ.

theorem Mathlib.Meta.FunProp.MaybeFunctionData.data.injEq E0 #

∀ (fData fData_1 : Mathlib.Meta.FunProp.FunctionData),
  (Mathlib.Meta.FunProp.MaybeFunctionData.data fData = Mathlib.Meta.FunProp.MaybeFunctionData.data fData_1) =
    (fData = fData_1)

theorem Mathlib.Meta.FunProp.MaybeFunctionData.letE.injEq E0 #

∀ (f f_1 : Lean.Expr),
  (Mathlib.Meta.FunProp.MaybeFunctionData.letE f = Mathlib.Meta.FunProp.MaybeFunctionData.letE f_1) = (f = f_1)

def Mathlib.Meta.FunProp.MaybeFunctionData.ctorIdx E1 #

Mathlib.Meta.FunProp.MaybeFunctionData → ℕ

theorem Mathlib.Meta.FunProp.DecompositionResult.comp.inj E1 #

∀ {f g f_1 g_1 : Lean.Expr},
  Mathlib.Meta.FunProp.DecompositionResult.comp f g = Mathlib.Meta.FunProp.DecompositionResult.comp f_1 g_1 →
    f = f_1 ∧ g = g_1

def Mathlib.Meta.FunProp.MorApplication.ctorIdx E1 #

Mathlib.Meta.FunProp.MorApplication → ℕ

theorem Mathlib.Meta.FunProp.MaybeFunctionData.data.inj E1 #

∀ {fData fData_1 : Mathlib.Meta.FunProp.FunctionData},
  Mathlib.Meta.FunProp.MaybeFunctionData.data fData = Mathlib.Meta.FunProp.MaybeFunctionData.data fData_1 →
    fData = fData_1

theorem Mathlib.Meta.FunProp.FunctionData.mk.injEq E0 #

∀ (lctx : Lean.LocalContext) (insts : Lean.LocalInstances) (fn : Lean.Expr) (args : Array Mathlib.Meta.FunProp.Mor.Arg)
  (mainVar : Lean.Expr) (mainArgs : Array ℕ) (lctx_1 : Lean.LocalContext) (insts_1 : Lean.LocalInstances)
  (fn_1 : Lean.Expr) (args_1 : Array Mathlib.Meta.FunProp.Mor.Arg) (mainVar_1 : Lean.Expr) (mainArgs_1 : Array ℕ),
  ({ lctx := lctx, insts := insts, fn := fn, args := args, mainVar := mainVar, mainArgs := mainArgs } =
      { lctx := lctx_1, insts := insts_1, fn := fn_1, args := args_1, mainVar := mainVar_1, mainArgs := mainArgs_1 }) =
    (lctx = lctx_1 ∧ insts = insts_1 ∧ fn = fn_1 ∧ args = args_1 ∧ mainVar = mainVar_1 ∧ mainArgs = mainArgs_1)

def Mathlib.Meta.FunProp.DecompositionResult.ctorIdx E1 #

Mathlib.Meta.FunProp.DecompositionResult → ℕ

theorem Mathlib.Meta.FunProp.MaybeFunctionData.letE.inj E1 #

∀ {f f_1 : Lean.Expr},
  Mathlib.Meta.FunProp.MaybeFunctionData.letE f = Mathlib.Meta.FunProp.MaybeFunctionData.letE f_1 → f = f_1

theorem Mathlib.Meta.FunProp.FunctionData.mk.inj E1 #

∀ {lctx : Lean.LocalContext} {insts : Lean.LocalInstances} {fn : Lean.Expr} {args : Array Mathlib.Meta.FunProp.Mor.Arg}
  {mainVar : Lean.Expr} {mainArgs : Array ℕ} {lctx_1 : Lean.LocalContext} {insts_1 : Lean.LocalInstances}
  {fn_1 : Lean.Expr} {args_1 : Array Mathlib.Meta.FunProp.Mor.Arg} {mainVar_1 : Lean.Expr} {mainArgs_1 : Array ℕ},
  { lctx := lctx, insts := insts, fn := fn, args := args, mainVar := mainVar, mainArgs := mainArgs } =
      { lctx := lctx_1, insts := insts_1, fn := fn_1, args := args_1, mainVar := mainVar_1, mainArgs := mainArgs_1 } →
    lctx = lctx_1 ∧ insts = insts_1 ∧ fn = fn_1 ∧ args = args_1 ∧ mainVar = mainVar_1 ∧ mainArgs = mainArgs_1

abbrev Mathlib.Meta.FunProp.MaybeFunctionData.ctorElimType E1 #

{motive : Mathlib.Meta.FunProp.MaybeFunctionData → Sort u} → ℕ → Sort (max 1 u)

theorem Mathlib.Meta.FunProp.DecompositionResult.comp.injEq E0 #

∀ (f g f_1 g_1 : Lean.Expr),
  (Mathlib.Meta.FunProp.DecompositionResult.comp f g = Mathlib.Meta.FunProp.DecompositionResult.comp f_1 g_1) =
    (f = f_1 ∧ g = g_1)

abbrev Mathlib.Meta.FunProp.MorApplication.ctorElimType E1 #

{motive : Mathlib.Meta.FunProp.MorApplication → Sort u} → ℕ → Sort (max 1 u)

def Mathlib.Meta.FunProp.instInhabitedMorApplication.default E1 #

Mathlib.Meta.FunProp.MorApplication

def Mathlib.Meta.FunProp.FunctionData.ctorIdx E1 #

Mathlib.Meta.FunProp.FunctionData → ℕ

theorem Mathlib.Meta.FunProp.MaybeFunctionData.lam.inj E1 #

∀ {f f_1 : Lean.Expr},
  Mathlib.Meta.FunProp.MaybeFunctionData.lam f = Mathlib.Meta.FunProp.MaybeFunctionData.lam f_1 → f = f_1

abbrev Mathlib.Meta.FunProp.DecompositionResult.ctorElimType E1 #

{motive : Mathlib.Meta.FunProp.DecompositionResult → Sort u} → ℕ → Sort (max 1 u)

theorem Mathlib.Meta.FunProp.MaybeFunctionData.lam.injEq E0 #

∀ (f f_1 : Lean.Expr),
  (Mathlib.Meta.FunProp.MaybeFunctionData.lam f = Mathlib.Meta.FunProp.MaybeFunctionData.lam f_1) = (f = f_1)

structure Mathlib.Meta.FunProp.FunctionData E1 #

Type

Structure storing parts of a function in funProp-normal form.

ctor Mathlib.Meta.FunProp.FunctionData.mk E0 #

Lean.LocalContext →
  Lean.LocalInstances →
    Lean.Expr → Array Mathlib.Meta.FunProp.Mor.Arg → Lean.Expr → Array ℕ → Mathlib.Meta.FunProp.FunctionData

abbrev Mathlib.Meta.FunProp.FunctionData.lctx E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.LocalContext

local context where mainVar exists

abbrev Mathlib.Meta.FunProp.FunctionData.insts E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.LocalInstances

local instances

abbrev Mathlib.Meta.FunProp.FunctionData.fn E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.Expr

main function

abbrev Mathlib.Meta.FunProp.FunctionData.args E1 #

Mathlib.Meta.FunProp.FunctionData → Array Mathlib.Meta.FunProp.Mor.Arg

applied function arguments

abbrev Mathlib.Meta.FunProp.FunctionData.mainVar E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.Expr

main variable

abbrev Mathlib.Meta.FunProp.FunctionData.mainArgs E1 #

Mathlib.Meta.FunProp.FunctionData → Array ℕ

indices of args that contain mainVars

def Mathlib.Meta.FunProp.FunctionData.toExpr E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.MetaM Lean.Expr

Turn function data back to expression.

def Mathlib.Meta.FunProp.FunctionData.isIdentityFun E1 #

Mathlib.Meta.FunProp.FunctionData → Bool

Is f an identity function?

def Mathlib.Meta.FunProp.FunctionData.isConstantFun E1 #

Mathlib.Meta.FunProp.FunctionData → Bool

Is f a constant function?

def Mathlib.Meta.FunProp.FunctionData.domainType E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.MetaM Lean.Expr

Domain type of f.

def Mathlib.Meta.FunProp.FunctionData.getFnConstName? E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.MetaM (Option Lean.Name)

Is head function of f a constant?

If the head of f is a projection return the name of corresponding projection function.

def Mathlib.Meta.FunProp.getFunctionData E1 #

Lean.Expr → Lean.MetaM Mathlib.Meta.FunProp.FunctionData

Get FunctionData for f. Throws if f can't be put into funProp-normal form.

inductive Mathlib.Meta.FunProp.MaybeFunctionData E1 #

Type

Result of getFunctionData?. It returns function data if the function is in the form fun x ↦ f y₁ ... yₙ. Two other cases are fun x ↦ let y := ... or fun x y ↦ ...

ctor Mathlib.Meta.FunProp.MaybeFunctionData.letE E0 #

Lean.Expr → Mathlib.Meta.FunProp.MaybeFunctionData

Can't generate function data as function body has let binder.

ctor Mathlib.Meta.FunProp.MaybeFunctionData.lam E0 #

Lean.Expr → Mathlib.Meta.FunProp.MaybeFunctionData

Can't generate function data as function body has lambda binder.

ctor Mathlib.Meta.FunProp.MaybeFunctionData.data E0 #

Mathlib.Meta.FunProp.FunctionData → Mathlib.Meta.FunProp.MaybeFunctionData

Function data has been successfully generated.

def Mathlib.Meta.FunProp.MaybeFunctionData.get E1 #

Mathlib.Meta.FunProp.MaybeFunctionData → Lean.MetaM Lean.Expr

Turn MaybeFunctionData to the function.

def Mathlib.Meta.FunProp.getFunctionData? E1 #

Lean.Expr → (Lean.Meta.Config → Lean.ConstantInfo → Lean.CoreM Bool) → Lean.MetaM Mathlib.Meta.FunProp.MaybeFunctionData

Get FunctionData for f.

def Mathlib.Meta.FunProp.FunctionData.unfoldHeadFVar? E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.MetaM (Option Lean.Expr)

If head function is a let-fvar unfold it and return resulting function. Return none otherwise.

inductive Mathlib.Meta.FunProp.MorApplication E1 #

Type

Type of morphism application.

ctor Mathlib.Meta.FunProp.MorApplication.underApplied E0 #

Mathlib.Meta.FunProp.MorApplication

Of the form ⇑f i.e. missing argument.

ctor Mathlib.Meta.FunProp.MorApplication.exact E0 #

Mathlib.Meta.FunProp.MorApplication

Of the form ⇑f x i.e. morphism and one argument is provided.

ctor Mathlib.Meta.FunProp.MorApplication.overApplied E0 #

Mathlib.Meta.FunProp.MorApplication

Of the form ⇑f x y ... i.e. additional applied arguments y ....

ctor Mathlib.Meta.FunProp.MorApplication.none E0 #

Mathlib.Meta.FunProp.MorApplication

Not a morphism application.

instance Mathlib.Meta.FunProp.instInhabitedMorApplication E0 #

Inhabited Mathlib.Meta.FunProp.MorApplication

def Mathlib.Meta.FunProp.instBEqMorApplication.beq E1 #

Mathlib.Meta.FunProp.MorApplication → Mathlib.Meta.FunProp.MorApplication → Bool

instance Mathlib.Meta.FunProp.instBEqMorApplication E0 #

BEq Mathlib.Meta.FunProp.MorApplication

def Mathlib.Meta.FunProp.FunctionData.isMorApplication E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.MetaM Mathlib.Meta.FunProp.MorApplication

Is function body of f a morphism application? What kind?

inductive Mathlib.Meta.FunProp.DecompositionResult E1 #

Type

The result of FunctionData.decomposition and FunctionData.peeloffArgDecomposition.

ctor Mathlib.Meta.FunProp.DecompositionResult.comp E0 #

Lean.Expr → Lean.Expr → Mathlib.Meta.FunProp.DecompositionResult

The function can be decomposed in a non-trivial way.

ctor Mathlib.Meta.FunProp.DecompositionResult.uncurried E0 #

Mathlib.Meta.FunProp.DecompositionResult

The function is in uncurried form.

ctor Mathlib.Meta.FunProp.DecompositionResult.failed E0 #

Mathlib.Meta.FunProp.DecompositionResult

The decomposition failed for some other reason.

def Mathlib.Meta.FunProp.FunctionData.peeloffArgDecomposition E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.MetaM Mathlib.Meta.FunProp.DecompositionResult

Decomposes fun x ↦ f y₁ ... yₙ into (fun g ↦ g yₙ) ∘ (fun x y ↦ f y₁ ... yₙ₋₁ y)

Returns DecompositionResult.failed if:

  • n=0
  • yₙ contains x
  • n=1 and (fun x y ↦ f y) is identity function i.e. x=f

def Mathlib.Meta.FunProp.FunctionData.decomposition E1 #

Mathlib.Meta.FunProp.FunctionData → Lean.MetaM Mathlib.Meta.FunProp.DecompositionResult

Decompose function f = (← fData.toExpr) into composition of two functions.

def Mathlib.Meta.FunProp.FunctionData.decompositionOverArgs E1 #

Mathlib.Meta.FunProp.FunctionData → Array ℕ → Lean.MetaM (Option (Lean.Expr × Lean.Expr))

Decompose function fun x ↦ f y₁ ... yₙ over specified argument indices #[i, j, ...].

The result is:

(fun (yᵢ',yⱼ',...) ↦ f y₁ .. yᵢ' .. yⱼ' .. yₙ) ∘ (fun x ↦ (yᵢ, yⱼ, ...))

This is not possible if yₗ for l ∉ #[i,j,...] still contains x. In such case none is returned.