File: .lake/packages/lean4/src/lean/Lean/Meta/AppBuilder.lean

full_name: Lean.Meta.mkId
code: /-- Return `id e` -/
def mkId (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkExpectedTypeHint
code: /--
  Given `e` s.t. `inferType e` is definitionally equal to `expectedType`, return
  term `@id expectedType e`. -/
def mkExpectedTypeHint (e : Expr) (expectedType : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLetFun
code: /--
`mkLetFun x v e` creates the encoding for the `let_fun x := v; e` expression.
The expression `x` can either be a free variable or a metavariable, and the function suitably abstracts `x` in `e`.
-/
def mkLetFun (x : Expr) (v : Expr) (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEq
code: /-- Return `a = b`. -/
def mkEq (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkHEq
code: /-- Return `HEq a b`. -/
def mkHEq (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqHEq
code: /--
  If `a` and `b` have definitionally equal types, return `Eq a b`, otherwise return `HEq a b`.
-/
def mkEqHEq (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqRefl
code: /-- Return a proof of `a = a`. -/
def mkEqRefl (a : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkHEqRefl
code: /-- Return a proof of `HEq a a`. -/
def mkHEqRefl (a : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAbsurd
code: /-- Given `hp : P` and `nhp : Not P` returns an instance of type `e`. -/
def mkAbsurd (e : Expr) (hp hnp : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFalseElim
code: /-- Given `h : False`, return an instance of type `e`. -/
def mkFalseElim (e : Expr) (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.infer
code: private def infer (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.hasTypeMsg
code: private def hasTypeMsg (e type : Expr) : MessageData 
goal: Lean.MessageData

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.throwAppBuilderException
code: private def throwAppBuilderException {α} (op : Name) (msg : MessageData) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.mkEqSymm
code: /-- Given `h : a = b`, returns a proof of `b = a`. -/
def mkEqSymm (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqTrans
code: /-- Given `h₁ : a = b` and `h₂ : b = c` returns a proof of `a = c`. -/
def mkEqTrans (h₁ h₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqTrans?
code: /--
Similar to `mkEqTrans`, but arguments can be `none`.
`none` is treated as a reflexivity proof.
-/
def mkEqTrans? (h₁? h₂? : Option Expr) : MetaM (Option Expr) 
goal: Lean.MetaM (Option Lean.Expr)

full_name: Lean.Meta.mkHEqSymm
code: /-- Given `h : HEq a b`, returns a proof of `HEq b a`.  -/
def mkHEqSymm (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkHEqTrans
code: /-- Given `h₁ : HEq a b`, `h₂ : HEq b c`, returns a proof of `HEq a c`. -/
def mkHEqTrans (h₁ h₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqOfHEq
code: /-- Given `h : HEq a b` where `a` and `b` have the same type, returns a proof of `Eq a b`. -/
def mkEqOfHEq (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.isRefl?
code: /--
If `e` is `@Eq.refl α a`, return `a`.
-/
def isRefl? (e : Expr) : Option Expr 
goal: Option Lean.Expr

full_name: Lean.Meta.congrArg?
code: /--
If `e` is `@congrArg α β a b f h`, return `α`, `f` and `h`.
Also works if `e` can be turned into such an application (e.g. `congrFun`).
-/
def congrArg? (e : Expr) : MetaM (Option (Expr × Expr × Expr)) 
goal: Lean.MetaM (Option (Lean.Expr × Lean.Expr × Lean.Expr))

full_name: Lean.Meta.mkCongrArg
code: /-- Given `f : α → β` and `h : a = b`, returns a proof of `f a = f b`.-/
partial def mkCongrArg (f h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkCongrFun
code: /-- Given `h : f = g` and `a : α`, returns a proof of `f a = g a`.-/
def mkCongrFun (h a : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkCongr
code: /-- Given `h₁ : f = g` and `h₂ : a = b`, returns a proof of `f a = g b`. -/
def mkCongr (h₁ h₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkAppMFinal
code: private def mkAppMFinal (methodName : Name) (f : Expr) (args : Array Expr) (instMVars : Array MVarId) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkAppMArgs
code: private partial def mkAppMArgs (f : Expr) (fType : Expr) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkAppMArgs.loop
code: private partial def mkAppMArgs (f : Expr) (fType : Expr) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkFun
code: private def mkFun (constName : Name) : MetaM (Expr × Expr) 
goal: Lean.MetaM (Lean.Expr × Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.withAppBuilderTrace
code: private def withAppBuilderTrace [ToMessageData α] [ToMessageData β]
    (f : α) (xs : β) (k : MetaM Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAppM
code: /--
  Return the application `constName xs`.
  It tries to fill the implicit arguments before the last element in `xs`.

  Remark:
  ``mkAppM `arbitrary #[α]`` returns `@arbitrary.{u} α` without synthesizing
  the implicit argument occurring after `α`.
  Given a `x : ([Decidable p] → Bool) × Nat`, ``mkAppM `Prod.fst #[x]`` returns `@Prod.fst ([Decidable p] → Bool) Nat x`.
-/
def mkAppM (constName : Name) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAppM'
code: /-- Similar to `mkAppM`, but takes an `Expr` instead of a constant name. -/
def mkAppM' (f : Expr) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkAppOptMAux
code: private partial def mkAppOptMAux (f : Expr) (xs : Array (Option Expr)) : Nat → Array Expr → Nat → Array MVarId → Expr → MetaM Expr
  
goal: Nat → Array Lean.Expr → Nat → Array Lean.MVarId → Lean.Expr → Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAppOptM
code: /--
  Similar to `mkAppM`, but it allows us to specify which arguments are provided explicitly using `Option` type.
  Example:
  Given `Pure.pure {m : Type u → Type v} [Pure m] {α : Type u} (a : α) : m α`,
  ```
  mkAppOptM `Pure.pure #[m, none, none, a]
  ```
  returns a `Pure.pure` application if the instance `Pure m` can be synthesized, and the universe match.
  Note that,
  ```
  mkAppM `Pure.pure #[a]
  ```
  fails because the only explicit argument `(a : α)` is not sufficient for inferring the remaining arguments,
  we would need the expected type. -/
def mkAppOptM (constName : Name) (xs : Array (Option Expr)) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAppOptM'
code: /-- Similar to `mkAppOptM`, but takes an `Expr` instead of a constant name. -/
def mkAppOptM' (f : Expr) (xs : Array (Option Expr)) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqNDRec
code: def mkEqNDRec (motive h1 h2 : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqRec
code: def mkEqRec (motive h1 h2 : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqMP
code: def mkEqMP (eqProof pr : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqMPR
code: def mkEqMPR (eqProof pr : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkNoConfusion
code: def mkNoConfusion (target : Expr) (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkPure
code: /-- Given a `monad` and `e : α`, makes `pure e`.-/
def mkPure (monad : Expr) (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkProjection
code: /--
  `mkProjection s fieldName` returns an expression for accessing field `fieldName` of the structure `s`.
  Remark: `fieldName` may be a subfield of `s`. -/
partial def mkProjection (s : Expr) (fieldName : Name) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkListLitAux
code: private def mkListLitAux (nil : Expr) (cons : Expr) : List Expr → Expr
  
goal: List Lean.Expr → Lean.Expr

full_name: Lean.Meta.mkListLit
code: def mkListLit (type : Expr) (xs : List Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkArrayLit
code: def mkArrayLit (type : Expr) (xs : List Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkSorry
code: def mkSorry (type : Expr) (synthetic : Bool) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkDecide
code: /-- Return `Decidable.decide p` -/
def mkDecide (p : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkDecideProof
code: /-- Return a proof for `p : Prop` using `decide p` -/
def mkDecideProof (p : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLt
code: /-- Return `a < b` -/
def mkLt (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLe
code: /-- Return `a <= b` -/
def mkLe (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkDefault
code: /-- Return `Inhabited.default α` -/
def mkDefault (α : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkOfNonempty
code: /-- Return `@Classical.ofNonempty α _` -/
def mkOfNonempty (α : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkSyntheticSorry
code: /-- Return `sorryAx type` -/
def mkSyntheticSorry (type : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFunExt
code: /-- Return `funext h` -/
def mkFunExt (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkPropExt
code: /-- Return `propext h` -/
def mkPropExt (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLetCongr
code: /-- Return `let_congr h₁ h₂` -/
def mkLetCongr (h₁ h₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLetValCongr
code: /-- Return `let_val_congr b h` -/
def mkLetValCongr (b h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLetBodyCongr
code: /-- Return `let_body_congr a h` -/
def mkLetBodyCongr (a h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkOfEqTrue
code: /-- Return `of_eq_true h` -/
def mkOfEqTrue (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqTrue
code: /-- Return `eq_true h` -/
def mkEqTrue (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqFalse
code: /--
  Return `eq_false h`
  `h` must have type definitionally equal to `¬ p` in the current
  reducibility setting. -/
def mkEqFalse (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkEqFalse'
code: /--
  Return `eq_false' h`
  `h` must have type definitionally equal to `p → False` in the current
  reducibility setting. -/
def mkEqFalse' (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkImpCongr
code: def mkImpCongr (h₁ h₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkImpCongrCtx
code: def mkImpCongrCtx (h₁ h₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkImpDepCongrCtx
code: def mkImpDepCongrCtx (h₁ h₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkForallCongr
code: def mkForallCongr (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.isMonad?
code: /-- Return instance for `[Monad m]` if there is one -/
def isMonad? (m : Expr) : MetaM (Option Expr) 
goal: Lean.MetaM (Option Lean.Expr)

full_name: Lean.Meta.mkNumeral
code: /-- Return `(n : type)`, a numeric literal of type `type`. The method fails if we don't have an instance `OfNat type n` -/
def mkNumeral (type : Expr) (n : Nat) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkBinaryOp
code: /--
  Return `a op b`, where `op` has name `opName` and is implemented using the typeclass `className`.
  This method assumes `a` and `b` have the same type, and typeclass `className` is heterogeneous.
  Examples of supported classes: `HAdd`, `HSub`, `HMul`.
  We use heterogeneous operators to ensure we have a uniform representation.
  -/
private def mkBinaryOp (className : Name) (opName : Name) (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAdd
code: /-- Return `a + b` using a heterogeneous `+`. This method assumes `a` and `b` have the same type. -/
def mkAdd (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkSub
code: /-- Return `a - b` using a heterogeneous `-`. This method assumes `a` and `b` have the same type. -/
def mkSub (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkMul
code: /-- Return `a * b` using a heterogeneous `*`. This method assumes `a` and `b` have the same type. -/
def mkMul (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.AppBuilder.0.Lean.Meta.mkBinaryRel
code: /--
  Return `a r b`, where `r` has name `rName` and is implemented using the typeclass `className`.
  This method assumes `a` and `b` have the same type.
  Examples of supported classes: `LE` and `LT`.
  We use heterogeneous operators to ensure we have a uniform representation.
  -/
private def mkBinaryRel (className : Name) (rName : Name) (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLE
code: /-- Return `a ≤ b`. This method assumes `a` and `b` have the same type. -/
def mkLE (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLT
code: /-- Return `a < b`. This method assumes `a` and `b` have the same type. -/
def mkLT (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkIffOfEq
code: /-- Given `h : a = b`, return a proof for `a ↔ b`. -/
def mkIffOfEq (h : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAndIntroN
code: /--
Given proofs of `P₁`, …, `Pₙ`, returns a proof of `P₁ ∧ … ∧ Pₙ`.
If `n = 0` returns a proof of `True`.
If `n = 1` returns the proof of `P₁`.
-/
def mkAndIntroN : Array Expr → MetaM Expr

goal: Array Lean.Expr → Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkProjAndN
code: /-- Given a proof of `P₁ ∧ … ∧ Pᵢ ∧ … ∧ Pₙ`, return the proof of `Pᵢ` -/
def mkProjAndN (n i : Nat) (e : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.AppBuilder._hyg.7506
code: builtin_initialize do
  registerTraceClass `Meta.appBuilder
  registerTraceClass `Meta.appBuilder.result (inherited := true)
  registerTraceClass `Meta.appBuilder.error (inherited := true)
goal: IO Unit