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

full_name: Lean.Meta.isDefEqStuckExceptionId
code: builtin_initialize isDefEqStuckExceptionId : InternalExceptionId ← registerInternalExceptionId `isDefEqStuck
goal: Lean.InternalExceptionId

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.Basic._hyg.5
code: builtin_initialize isDefEqStuckExceptionId : InternalExceptionId ← registerInternalExceptionId `isDefEqStuck
goal: IO Lean.InternalExceptionId

full_name: Lean.Meta.Config
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Type

full_name: Lean.Meta.Config.quasiPatternApprox
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.constApprox
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.isDefEqStuckEx
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.foApprox
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.transparency
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Lean.Meta.TransparencyMode

full_name: Lean.Meta.Config.assignSyntheticOpaque
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.proofIrrelevance
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.univApprox
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.trackZetaDelta
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.unificationHints
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.ctxApprox
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.Config.etaStruct
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Lean.Meta.EtaStructMode

full_name: Lean.Meta.Config.offsetCnstrs
code: /--
Configuration flags for the `MetaM` monad.
Many of them are used to control the `isDefEq` function that checks whether two terms are definitionally equal or not.
Recall that when `isDefEq` is trying to check whether
`?m@C a₁ ... aₙ` and `t` are definitionally equal (`?m@C a₁ ... aₙ =?= t`), where
`?m@C` as a shorthand for `C |- ?m : t` where `t` is the type of `?m`.
We solve it using the assignment `?m := fun a₁ ... aₙ => t` if
1) `a₁ ... aₙ` are pairwise distinct free variables that are ​*not*​ let-variables.
2) `a₁ ... aₙ` are not in `C`
3) `t` only contains free variables in `C` and/or `{a₁, ..., aₙ}`
4) For every metavariable `?m'@C'` occurring in `t`, `C'` is a subprefix of `C`
5) `?m` does not occur in `t`
-/
structure Config where
  /--
    If `foApprox` is set to true, and some `aᵢ` is not a free variable,
    then we use first-order unification
    ```
      ?m a_1 ... a_i a_{i+1} ... a_{i+k} =?= f b_1 ... b_k
    ```
    reduces to
    ```
      ?m a_1 ... a_i =?= f
      a_{i+1}        =?= b_1
      ...
      a_{i+k}        =?= b_k
    ```
  -/
  foApprox           : Bool := false
  /--
    When `ctxApprox` is set to true, we relax condition 4, by creating an
    auxiliary metavariable `?n'` with a smaller context than `?m'`.
  -/
  ctxApprox          : Bool := false
  /--
    When `quasiPatternApprox` is set to true, we ignore condition 2.
  -/
  quasiPatternApprox : Bool := false
  /-- When `constApprox` is set to true,
     we solve `?m t =?= c` using
     `?m := fun _ => c`
     when `?m t` is not a higher-order pattern and `c` is not an application as -/
  constApprox        : Bool := false
  /--
    When the following flag is set,
    `isDefEq` throws the exception `Exeption.isDefEqStuck`
    whenever it encounters a constraint `?m ... =?= t` where
    `?m` is read only.
    This feature is useful for type class resolution where
    we may want to notify the caller that the TC problem may be solvable
    later after it assigns `?m`. -/
  isDefEqStuckEx     : Bool := false
  /-- Enable/disable the unification hints feature. -/
  unificationHints   : Bool := true
  /-- Enables proof irrelevance at `isDefEq` -/
  proofIrrelevance   : Bool := true
  /-- By default synthetic opaque metavariables are not assigned by `isDefEq`. Motivation: we want to make
      sure typing constraints resolved during elaboration should not "fill" holes that are supposed to be filled using tactics.
      However, this restriction is too restrictive for tactics such as `exact t`. When elaborating `t`, we dot not fill
      named holes when solving typing constraints or TC resolution. But, we ignore the restriction when we try to unify
      the type of `t` with the goal target type. We claim this is not a hack and is defensible behavior because
      this last unification step is not really part of the term elaboration. -/
  assignSyntheticOpaque : Bool := false
  /-- Enable/Disable support for offset constraints such as `?x + 1 =?= e` -/
  offsetCnstrs          : Bool := true
  /--
    Controls which definitions and theorems can be unfolded by `isDefEq` and `whnf`.
   -/
  transparency       : TransparencyMode := TransparencyMode.default
  /--
  When `trackZetaDelta = true`, we track all free variables that have been zetaDelta-expanded.
  That is, suppose the local context contains
  the declaration `x : t := v`, and we reduce `x` to `v`, then we insert `x` into `State.zetaDeltaFVarIds`.
  We use `trackZetaDelta` to discover which let-declarations `let x := v; e` can be represented as `(fun x => e) v`.
  When we find these declarations we set their `nonDep` flag with `true`.
  To find these let-declarations in a given term `s`, we
  1- Reset `State.zetaDeltaFVarIds`
  2- Set `trackZetaDelta := true`
  3- Type-check `s`.
  -/
  trackZetaDelta     : Bool := false
  /-- Eta for structures configuration mode. -/
  etaStruct          : EtaStructMode := .all
  /--
  When `univApprox` is set to true,
  we use approximations when solving postponed universe constraints.
  Examples:
  - `max u ?v =?= u` is solved with `?v := u` and ignoring the solution `?v := 0`.
  - `max u w =?= mav u ?v` is solved with `?v := w` ignoring the solution `?v := max u w`
  -/
  univApprox : Bool := true
goal: Bool

full_name: Lean.Meta.ParamInfo.hasFwdDeps
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Bool

full_name: Lean.Meta.ParamInfo.dependsOnHigherOrderOutParam
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Bool

full_name: Lean.Meta.ParamInfo.higherOrderOutParam
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Bool

full_name: Lean.Meta.ParamInfo.isProp
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Bool

full_name: Lean.Meta.ParamInfo.isDecInst
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Bool

full_name: Lean.Meta.instInhabitedParamInfo
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Inhabited Lean.Meta.ParamInfo

full_name: Lean.Meta.ParamInfo.binderInfo
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Lean.BinderInfo

full_name: Lean.Meta.ParamInfo
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Type

full_name: Lean.Meta.ParamInfo.backDeps
code: /--
  Function parameter information cache.
-/
structure ParamInfo where
  /-- The binder annotation for the parameter. -/
  binderInfo     : BinderInfo := BinderInfo.default
  /-- `hasFwdDeps` is true if there is another parameter whose type depends on this one. -/
  hasFwdDeps     : Bool       := false
  /-- `backDeps` contains the backwards dependencies. That is, the (0-indexed) position of previous parameters that this one depends on. -/
  backDeps       : Array Nat  := #[]
  /-- `isProp` is true if the parameter is always a proposition. -/
  isProp         : Bool       := false
  /--
    `isDecInst` is true if the parameter's type is of the form `Decidable ...`.
    This information affects the generation of congruence theorems.
  -/
  isDecInst      : Bool       := false
  /--
    `higherOrderOutParam` is true if this parameter is a higher-order output parameter
    of local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter `dom` because it is output parameter of
    `[self : GetElem cont idx elem dom]`
   -/
  higherOrderOutParam : Bool  := false
  /--
    `dependsOnHigherOrderOutParam` is true if the type of this parameter depends on
    the higher-order output parameter of a previous local instance.
    Example:
    ```
    getElem :
      {cont : Type u_1} → {idx : Type u_2} → {elem : Type u_3} →
      {dom : cont → idx → Prop} → [self : GetElem cont idx elem dom] →
      (xs : cont) → (i : idx) → dom xs i → elem
    ```
    This flag is true for the parameter with type `dom xs i` since `dom` is an output parameter
    of the instance `[self : GetElem cont idx elem dom]`
  -/
  dependsOnHigherOrderOutParam : Bool := false
  deriving Inhabited
goal: Array Nat

full_name: Lean.Meta.ParamInfo.isImplicit
code: def ParamInfo.isImplicit (p : ParamInfo) : Bool 
goal: Bool

full_name: Lean.Meta.ParamInfo.isInstImplicit
code: def ParamInfo.isInstImplicit (p : ParamInfo) : Bool 
goal: Bool

full_name: Lean.Meta.ParamInfo.isStrictImplicit
code: def ParamInfo.isStrictImplicit (p : ParamInfo) : Bool 
goal: Bool

full_name: Lean.Meta.ParamInfo.isExplicit
code: def ParamInfo.isExplicit (p : ParamInfo) : Bool 
goal: Bool

full_name: Lean.Meta.FunInfo.resultDeps
code: /--
  Function information cache. See `ParamInfo`.
-/
structure FunInfo where
  /-- Parameter information cache. -/
  paramInfo  : Array ParamInfo := #[]
  /--
    `resultDeps` contains the function result type backwards dependencies.
    That is, the (0-indexed) position of parameters that the result type depends on.
  -/
  resultDeps : Array Nat       := #[]
goal: Array Nat

full_name: Lean.Meta.FunInfo.paramInfo
code: /--
  Function information cache. See `ParamInfo`.
-/
structure FunInfo where
  /-- Parameter information cache. -/
  paramInfo  : Array ParamInfo := #[]
  /--
    `resultDeps` contains the function result type backwards dependencies.
    That is, the (0-indexed) position of parameters that the result type depends on.
  -/
  resultDeps : Array Nat       := #[]
goal: Array Lean.Meta.ParamInfo

full_name: Lean.Meta.FunInfo
code: /--
  Function information cache. See `ParamInfo`.
-/
structure FunInfo where
  /-- Parameter information cache. -/
  paramInfo  : Array ParamInfo := #[]
  /--
    `resultDeps` contains the function result type backwards dependencies.
    That is, the (0-indexed) position of parameters that the result type depends on.
  -/
  resultDeps : Array Nat       := #[]
goal: Type

full_name: Lean.Meta.instInhabitedInfoCacheKey
code: /--
  Key for the function information cache.
-/
structure InfoCacheKey where
  /-- The transparency mode used to compute the `FunInfo`. -/
  transparency : TransparencyMode
  /-- The function being cached information about. It is quite often an `Expr.const`. -/
  expr         : Expr
  /--
    `nargs? = some n` if the cached information was computed assuming the function has arity `n`.
    If `nargs? = none`, then the cache information consumed the arrow type as much as possible
    using the current transparency setting.
  X-/
  nargs?       : Option Nat
  deriving Inhabited, BEq
goal: Inhabited Lean.Meta.InfoCacheKey

full_name: Lean.Meta.InfoCacheKey.expr
code: /--
  Key for the function information cache.
-/
structure InfoCacheKey where
  /-- The transparency mode used to compute the `FunInfo`. -/
  transparency : TransparencyMode
  /-- The function being cached information about. It is quite often an `Expr.const`. -/
  expr         : Expr
  /--
    `nargs? = some n` if the cached information was computed assuming the function has arity `n`.
    If `nargs? = none`, then the cache information consumed the arrow type as much as possible
    using the current transparency setting.
  X-/
  nargs?       : Option Nat
  deriving Inhabited, BEq
goal: Lean.Expr

full_name: Lean.Meta.InfoCacheKey.transparency
code: /--
  Key for the function information cache.
-/
structure InfoCacheKey where
  /-- The transparency mode used to compute the `FunInfo`. -/
  transparency : TransparencyMode
  /-- The function being cached information about. It is quite often an `Expr.const`. -/
  expr         : Expr
  /--
    `nargs? = some n` if the cached information was computed assuming the function has arity `n`.
    If `nargs? = none`, then the cache information consumed the arrow type as much as possible
    using the current transparency setting.
  X-/
  nargs?       : Option Nat
  deriving Inhabited, BEq
goal: Lean.Meta.TransparencyMode

full_name: Lean.Meta.InfoCacheKey
code: /--
  Key for the function information cache.
-/
structure InfoCacheKey where
  /-- The transparency mode used to compute the `FunInfo`. -/
  transparency : TransparencyMode
  /-- The function being cached information about. It is quite often an `Expr.const`. -/
  expr         : Expr
  /--
    `nargs? = some n` if the cached information was computed assuming the function has arity `n`.
    If `nargs? = none`, then the cache information consumed the arrow type as much as possible
    using the current transparency setting.
  X-/
  nargs?       : Option Nat
  deriving Inhabited, BEq
goal: Type

full_name: Lean.Meta.InfoCacheKey.nargs?
code: /--
  Key for the function information cache.
-/
structure InfoCacheKey where
  /-- The transparency mode used to compute the `FunInfo`. -/
  transparency : TransparencyMode
  /-- The function being cached information about. It is quite often an `Expr.const`. -/
  expr         : Expr
  /--
    `nargs? = some n` if the cached information was computed assuming the function has arity `n`.
    If `nargs? = none`, then the cache information consumed the arrow type as much as possible
    using the current transparency setting.
  X-/
  nargs?       : Option Nat
  deriving Inhabited, BEq
goal: Option Nat

full_name: Lean.Meta.instBEqInfoCacheKey
code: /--
  Key for the function information cache.
-/
structure InfoCacheKey where
  /-- The transparency mode used to compute the `FunInfo`. -/
  transparency : TransparencyMode
  /-- The function being cached information about. It is quite often an `Expr.const`. -/
  expr         : Expr
  /--
    `nargs? = some n` if the cached information was computed assuming the function has arity `n`.
    If `nargs? = none`, then the cache information consumed the arrow type as much as possible
    using the current transparency setting.
  X-/
  nargs?       : Option Nat
  deriving Inhabited, BEq
goal: BEq Lean.Meta.InfoCacheKey

full_name: Lean.Meta.InfoCacheKey.instHashable
code: instance : Hashable InfoCacheKey 
goal: Hashable Lean.Meta.InfoCacheKey

full_name: Lean.Meta.SynthInstanceCacheKey.synthPendingDepth
code: structure SynthInstanceCacheKey where
  localInsts        : LocalInstances
  type              : Expr
  /--
  Value of `synthPendingDepth` when instance was synthesized or failed to be synthesized.
  See issue #2522.
  -/
  synthPendingDepth : Nat
  deriving Hashable, BEq
goal: Nat

full_name: Lean.Meta.SynthInstanceCacheKey
code: structure SynthInstanceCacheKey where
  localInsts        : LocalInstances
  type              : Expr
  /--
  Value of `synthPendingDepth` when instance was synthesized or failed to be synthesized.
  See issue #2522.
  -/
  synthPendingDepth : Nat
  deriving Hashable, BEq
goal: Type

full_name: Lean.Meta.SynthInstanceCacheKey.localInsts
code: structure SynthInstanceCacheKey where
  localInsts        : LocalInstances
  type              : Expr
  /--
  Value of `synthPendingDepth` when instance was synthesized or failed to be synthesized.
  See issue #2522.
  -/
  synthPendingDepth : Nat
  deriving Hashable, BEq
goal: Lean.LocalInstances

full_name: Lean.Meta.SynthInstanceCacheKey.type
code: structure SynthInstanceCacheKey where
  localInsts        : LocalInstances
  type              : Expr
  /--
  Value of `synthPendingDepth` when instance was synthesized or failed to be synthesized.
  See issue #2522.
  -/
  synthPendingDepth : Nat
  deriving Hashable, BEq
goal: Lean.Expr

full_name: Lean.Meta.instBEqSynthInstanceCacheKey
code: structure SynthInstanceCacheKey where
  localInsts        : LocalInstances
  type              : Expr
  /--
  Value of `synthPendingDepth` when instance was synthesized or failed to be synthesized.
  See issue #2522.
  -/
  synthPendingDepth : Nat
  deriving Hashable, BEq
goal: BEq Lean.Meta.SynthInstanceCacheKey

full_name: Lean.Meta.instHashableSynthInstanceCacheKey
code: structure SynthInstanceCacheKey where
  localInsts        : LocalInstances
  type              : Expr
  /--
  Value of `synthPendingDepth` when instance was synthesized or failed to be synthesized.
  See issue #2522.
  -/
  synthPendingDepth : Nat
  deriving Hashable, BEq
goal: Hashable Lean.Meta.SynthInstanceCacheKey

full_name: Lean.Meta.AbstractMVarsResult.paramNames
code: /-- Resulting type for `abstractMVars` -/
structure AbstractMVarsResult where
  paramNames : Array Name
  numMVars   : Nat
  expr       : Expr
  deriving Inhabited, BEq
goal: Array Lean.Name

full_name: Lean.Meta.instInhabitedAbstractMVarsResult
code: /-- Resulting type for `abstractMVars` -/
structure AbstractMVarsResult where
  paramNames : Array Name
  numMVars   : Nat
  expr       : Expr
  deriving Inhabited, BEq
goal: Inhabited Lean.Meta.AbstractMVarsResult

full_name: Lean.Meta.AbstractMVarsResult
code: /-- Resulting type for `abstractMVars` -/
structure AbstractMVarsResult where
  paramNames : Array Name
  numMVars   : Nat
  expr       : Expr
  deriving Inhabited, BEq
goal: Type

full_name: Lean.Meta.AbstractMVarsResult.numMVars
code: /-- Resulting type for `abstractMVars` -/
structure AbstractMVarsResult where
  paramNames : Array Name
  numMVars   : Nat
  expr       : Expr
  deriving Inhabited, BEq
goal: Nat

full_name: Lean.Meta.AbstractMVarsResult.expr
code: /-- Resulting type for `abstractMVars` -/
structure AbstractMVarsResult where
  paramNames : Array Name
  numMVars   : Nat
  expr       : Expr
  deriving Inhabited, BEq
goal: Lean.Expr

full_name: Lean.Meta.instBEqAbstractMVarsResult
code: /-- Resulting type for `abstractMVars` -/
structure AbstractMVarsResult where
  paramNames : Array Name
  numMVars   : Nat
  expr       : Expr
  deriving Inhabited, BEq
goal: BEq Lean.Meta.AbstractMVarsResult

full_name: Lean.Meta.SynthInstanceCache
code: abbrev SynthInstanceCache 
goal: Type

full_name: Lean.Meta.InferTypeCache
code: abbrev InferTypeCache 
goal: Type

full_name: Lean.Meta.FunInfoCache
code: abbrev FunInfoCache   
goal: Type

full_name: Lean.Meta.WhnfCache
code: abbrev WhnfCache      
goal: Type

full_name: Lean.Meta.DefEqCache.default
code: /--
  A mapping `(s, t) ↦ isDefEq s t` per transparency level.
  TODO: consider more efficient representations (e.g., a proper set) and caching policies (e.g., imperfect cache).
  We should also investigate the impact on memory consumption. -/
structure DefEqCache where
  reducible : PersistentHashMap (Expr × Expr) Bool := {}
  instances : PersistentHashMap (Expr × Expr) Bool := {}
  default   : PersistentHashMap (Expr × Expr) Bool := {}
  all       : PersistentHashMap (Expr × Expr) Bool := {}
  deriving Inhabited
goal: Lean.PersistentHashMap (Lean.Expr × Lean.Expr) Bool

full_name: Lean.Meta.DefEqCache.all
code: /--
  A mapping `(s, t) ↦ isDefEq s t` per transparency level.
  TODO: consider more efficient representations (e.g., a proper set) and caching policies (e.g., imperfect cache).
  We should also investigate the impact on memory consumption. -/
structure DefEqCache where
  reducible : PersistentHashMap (Expr × Expr) Bool := {}
  instances : PersistentHashMap (Expr × Expr) Bool := {}
  default   : PersistentHashMap (Expr × Expr) Bool := {}
  all       : PersistentHashMap (Expr × Expr) Bool := {}
  deriving Inhabited
goal: Lean.PersistentHashMap (Lean.Expr × Lean.Expr) Bool

full_name: Lean.Meta.DefEqCache.instances
code: /--
  A mapping `(s, t) ↦ isDefEq s t` per transparency level.
  TODO: consider more efficient representations (e.g., a proper set) and caching policies (e.g., imperfect cache).
  We should also investigate the impact on memory consumption. -/
structure DefEqCache where
  reducible : PersistentHashMap (Expr × Expr) Bool := {}
  instances : PersistentHashMap (Expr × Expr) Bool := {}
  default   : PersistentHashMap (Expr × Expr) Bool := {}
  all       : PersistentHashMap (Expr × Expr) Bool := {}
  deriving Inhabited
goal: Lean.PersistentHashMap (Lean.Expr × Lean.Expr) Bool

full_name: Lean.Meta.DefEqCache
code: /--
  A mapping `(s, t) ↦ isDefEq s t` per transparency level.
  TODO: consider more efficient representations (e.g., a proper set) and caching policies (e.g., imperfect cache).
  We should also investigate the impact on memory consumption. -/
structure DefEqCache where
  reducible : PersistentHashMap (Expr × Expr) Bool := {}
  instances : PersistentHashMap (Expr × Expr) Bool := {}
  default   : PersistentHashMap (Expr × Expr) Bool := {}
  all       : PersistentHashMap (Expr × Expr) Bool := {}
  deriving Inhabited
goal: Type

full_name: Lean.Meta.instInhabitedDefEqCache
code: /--
  A mapping `(s, t) ↦ isDefEq s t` per transparency level.
  TODO: consider more efficient representations (e.g., a proper set) and caching policies (e.g., imperfect cache).
  We should also investigate the impact on memory consumption. -/
structure DefEqCache where
  reducible : PersistentHashMap (Expr × Expr) Bool := {}
  instances : PersistentHashMap (Expr × Expr) Bool := {}
  default   : PersistentHashMap (Expr × Expr) Bool := {}
  all       : PersistentHashMap (Expr × Expr) Bool := {}
  deriving Inhabited
goal: Inhabited Lean.Meta.DefEqCache

full_name: Lean.Meta.DefEqCache.reducible
code: /--
  A mapping `(s, t) ↦ isDefEq s t` per transparency level.
  TODO: consider more efficient representations (e.g., a proper set) and caching policies (e.g., imperfect cache).
  We should also investigate the impact on memory consumption. -/
structure DefEqCache where
  reducible : PersistentHashMap (Expr × Expr) Bool := {}
  instances : PersistentHashMap (Expr × Expr) Bool := {}
  default   : PersistentHashMap (Expr × Expr) Bool := {}
  all       : PersistentHashMap (Expr × Expr) Bool := {}
  deriving Inhabited
goal: Lean.PersistentHashMap (Lean.Expr × Lean.Expr) Bool

full_name: Lean.Meta.Cache
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Type

full_name: Lean.Meta.Cache.whnfDefault
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Lean.Meta.WhnfCache

full_name: Lean.Meta.Cache.inferType
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Lean.Meta.InferTypeCache

full_name: Lean.Meta.Cache.synthInstance
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Lean.Meta.SynthInstanceCache

full_name: Lean.Meta.Cache.defEqTrans
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Lean.Meta.DefEqCache

full_name: Lean.Meta.instInhabitedCache
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Inhabited Lean.Meta.Cache

full_name: Lean.Meta.Cache.funInfo
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Lean.Meta.FunInfoCache

full_name: Lean.Meta.Cache.whnfAll
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Lean.Meta.WhnfCache

full_name: Lean.Meta.Cache.defEqPerm
code: /--
  Cache datastructures for type inference, type class resolution, whnf, and definitional equality.
-/
structure Cache where
  inferType      : InferTypeCache := {}
  funInfo        : FunInfoCache   := {}
  synthInstance  : SynthInstanceCache := {}
  whnfDefault    : WhnfCache := {} -- cache for closed terms and `TransparencyMode.default`
  whnfAll        : WhnfCache := {} -- cache for closed terms and `TransparencyMode.all`
  defEqTrans     : DefEqCache := {} -- transient cache for terms containing mvars or using nonstandard configuration options, it is frequently reset.
  defEqPerm      : DefEqCache := {} -- permanent cache for terms not containing mvars and using standard configuration options
  deriving Inhabited
goal: Lean.Meta.DefEqCache

full_name: Lean.Meta.DefEqContext.lctx
code: /--
 "Context" for a postponed universe constraint.
 `lhs` and `rhs` are the surrounding `isDefEq` call when the postponed constraint was created.
-/
structure DefEqContext where
  lhs            : Expr
  rhs            : Expr
  lctx           : LocalContext
  localInstances : LocalInstances
goal: Lean.LocalContext

full_name: Lean.Meta.DefEqContext.localInstances
code: /--
 "Context" for a postponed universe constraint.
 `lhs` and `rhs` are the surrounding `isDefEq` call when the postponed constraint was created.
-/
structure DefEqContext where
  lhs            : Expr
  rhs            : Expr
  lctx           : LocalContext
  localInstances : LocalInstances
goal: Lean.LocalInstances

full_name: Lean.Meta.DefEqContext
code: /--
 "Context" for a postponed universe constraint.
 `lhs` and `rhs` are the surrounding `isDefEq` call when the postponed constraint was created.
-/
structure DefEqContext where
  lhs            : Expr
  rhs            : Expr
  lctx           : LocalContext
  localInstances : LocalInstances
goal: Type

full_name: Lean.Meta.DefEqContext.rhs
code: /--
 "Context" for a postponed universe constraint.
 `lhs` and `rhs` are the surrounding `isDefEq` call when the postponed constraint was created.
-/
structure DefEqContext where
  lhs            : Expr
  rhs            : Expr
  lctx           : LocalContext
  localInstances : LocalInstances
goal: Lean.Expr

full_name: Lean.Meta.DefEqContext.lhs
code: /--
 "Context" for a postponed universe constraint.
 `lhs` and `rhs` are the surrounding `isDefEq` call when the postponed constraint was created.
-/
structure DefEqContext where
  lhs            : Expr
  rhs            : Expr
  lctx           : LocalContext
  localInstances : LocalInstances
goal: Lean.Expr

full_name: Lean.Meta.PostponedEntry.ref
code: /--
  Auxiliary structure for representing postponed universe constraints.
  Remark: the fields `ref` and `rootDefEq?` are used for error message generation only.
  Remark: we may consider improving the error message generation in the future.
-/
structure PostponedEntry where
  /-- We save the `ref` at entry creation time. This is used for reporting errors back to the user. -/
  ref  : Syntax
  lhs  : Level
  rhs  : Level
  /-- Context for the surrounding `isDefEq` call when the entry was created. -/
  ctx? : Option DefEqContext
  deriving Inhabited
goal: Lean.Syntax

full_name: Lean.Meta.PostponedEntry.lhs
code: /--
  Auxiliary structure for representing postponed universe constraints.
  Remark: the fields `ref` and `rootDefEq?` are used for error message generation only.
  Remark: we may consider improving the error message generation in the future.
-/
structure PostponedEntry where
  /-- We save the `ref` at entry creation time. This is used for reporting errors back to the user. -/
  ref  : Syntax
  lhs  : Level
  rhs  : Level
  /-- Context for the surrounding `isDefEq` call when the entry was created. -/
  ctx? : Option DefEqContext
  deriving Inhabited
goal: Lean.Level

full_name: Lean.Meta.PostponedEntry.ctx?
code: /--
  Auxiliary structure for representing postponed universe constraints.
  Remark: the fields `ref` and `rootDefEq?` are used for error message generation only.
  Remark: we may consider improving the error message generation in the future.
-/
structure PostponedEntry where
  /-- We save the `ref` at entry creation time. This is used for reporting errors back to the user. -/
  ref  : Syntax
  lhs  : Level
  rhs  : Level
  /-- Context for the surrounding `isDefEq` call when the entry was created. -/
  ctx? : Option DefEqContext
  deriving Inhabited
goal: Option Lean.Meta.DefEqContext

full_name: Lean.Meta.PostponedEntry.rhs
code: /--
  Auxiliary structure for representing postponed universe constraints.
  Remark: the fields `ref` and `rootDefEq?` are used for error message generation only.
  Remark: we may consider improving the error message generation in the future.
-/
structure PostponedEntry where
  /-- We save the `ref` at entry creation time. This is used for reporting errors back to the user. -/
  ref  : Syntax
  lhs  : Level
  rhs  : Level
  /-- Context for the surrounding `isDefEq` call when the entry was created. -/
  ctx? : Option DefEqContext
  deriving Inhabited
goal: Lean.Level

full_name: Lean.Meta.instInhabitedPostponedEntry
code: /--
  Auxiliary structure for representing postponed universe constraints.
  Remark: the fields `ref` and `rootDefEq?` are used for error message generation only.
  Remark: we may consider improving the error message generation in the future.
-/
structure PostponedEntry where
  /-- We save the `ref` at entry creation time. This is used for reporting errors back to the user. -/
  ref  : Syntax
  lhs  : Level
  rhs  : Level
  /-- Context for the surrounding `isDefEq` call when the entry was created. -/
  ctx? : Option DefEqContext
  deriving Inhabited
goal: Inhabited Lean.Meta.PostponedEntry

full_name: Lean.Meta.PostponedEntry
code: /--
  Auxiliary structure for representing postponed universe constraints.
  Remark: the fields `ref` and `rootDefEq?` are used for error message generation only.
  Remark: we may consider improving the error message generation in the future.
-/
structure PostponedEntry where
  /-- We save the `ref` at entry creation time. This is used for reporting errors back to the user. -/
  ref  : Syntax
  lhs  : Level
  rhs  : Level
  /-- Context for the surrounding `isDefEq` call when the entry was created. -/
  ctx? : Option DefEqContext
  deriving Inhabited
goal: Type

full_name: Lean.Meta.instInhabitedDiagnostics
code: structure Diagnostics where
  /-- Number of times each declaration has been unfolded -/
  unfoldCounter : PHashMap Name Nat := {}
  /-- Number of times `f a =?= f b` heuristic has been used per function `f`. -/
  heuristicCounter : PHashMap Name Nat := {}
  /-- Number of times a TC instance is used. -/
  instanceCounter : PHashMap Name Nat := {}
  /-- Pending instances that were not synthesized because `maxSynthPendingDepth` has been reached. -/
  synthPendingFailures : PHashMap Expr MessageData := {}
  deriving Inhabited
goal: Inhabited Lean.Meta.Diagnostics

full_name: Lean.Meta.Diagnostics.instanceCounter
code: structure Diagnostics where
  /-- Number of times each declaration has been unfolded -/
  unfoldCounter : PHashMap Name Nat := {}
  /-- Number of times `f a =?= f b` heuristic has been used per function `f`. -/
  heuristicCounter : PHashMap Name Nat := {}
  /-- Number of times a TC instance is used. -/
  instanceCounter : PHashMap Name Nat := {}
  /-- Pending instances that were not synthesized because `maxSynthPendingDepth` has been reached. -/
  synthPendingFailures : PHashMap Expr MessageData := {}
  deriving Inhabited
goal: Lean.PHashMap Lean.Name Nat

full_name: Lean.Meta.Diagnostics.synthPendingFailures
code: structure Diagnostics where
  /-- Number of times each declaration has been unfolded -/
  unfoldCounter : PHashMap Name Nat := {}
  /-- Number of times `f a =?= f b` heuristic has been used per function `f`. -/
  heuristicCounter : PHashMap Name Nat := {}
  /-- Number of times a TC instance is used. -/
  instanceCounter : PHashMap Name Nat := {}
  /-- Pending instances that were not synthesized because `maxSynthPendingDepth` has been reached. -/
  synthPendingFailures : PHashMap Expr MessageData := {}
  deriving Inhabited
goal: Lean.PHashMap Lean.Expr Lean.MessageData

full_name: Lean.Meta.Diagnostics.unfoldCounter
code: structure Diagnostics where
  /-- Number of times each declaration has been unfolded -/
  unfoldCounter : PHashMap Name Nat := {}
  /-- Number of times `f a =?= f b` heuristic has been used per function `f`. -/
  heuristicCounter : PHashMap Name Nat := {}
  /-- Number of times a TC instance is used. -/
  instanceCounter : PHashMap Name Nat := {}
  /-- Pending instances that were not synthesized because `maxSynthPendingDepth` has been reached. -/
  synthPendingFailures : PHashMap Expr MessageData := {}
  deriving Inhabited
goal: Lean.PHashMap Lean.Name Nat

full_name: Lean.Meta.Diagnostics
code: structure Diagnostics where
  /-- Number of times each declaration has been unfolded -/
  unfoldCounter : PHashMap Name Nat := {}
  /-- Number of times `f a =?= f b` heuristic has been used per function `f`. -/
  heuristicCounter : PHashMap Name Nat := {}
  /-- Number of times a TC instance is used. -/
  instanceCounter : PHashMap Name Nat := {}
  /-- Pending instances that were not synthesized because `maxSynthPendingDepth` has been reached. -/
  synthPendingFailures : PHashMap Expr MessageData := {}
  deriving Inhabited
goal: Type

full_name: Lean.Meta.Diagnostics.heuristicCounter
code: structure Diagnostics where
  /-- Number of times each declaration has been unfolded -/
  unfoldCounter : PHashMap Name Nat := {}
  /-- Number of times `f a =?= f b` heuristic has been used per function `f`. -/
  heuristicCounter : PHashMap Name Nat := {}
  /-- Number of times a TC instance is used. -/
  instanceCounter : PHashMap Name Nat := {}
  /-- Pending instances that were not synthesized because `maxSynthPendingDepth` has been reached. -/
  synthPendingFailures : PHashMap Expr MessageData := {}
  deriving Inhabited
goal: Lean.PHashMap Lean.Name Nat

full_name: Lean.Meta.instInhabitedState
code: /--
  `MetaM` monad state.
-/
structure State where
  mctx             : MetavarContext := {}
  cache            : Cache := {}
  /-- When `trackZetaDelta == true`, then any let-decl free variable that is zetaDelta-expanded by `MetaM` is stored in `zetaDeltaFVarIds`. -/
  zetaDeltaFVarIds : FVarIdSet := {}
  /-- Array of postponed universe level constraints -/
  postponed        : PersistentArray PostponedEntry := {}
  diag             : Diagnostics := {}
  deriving Inhabited
goal: Inhabited Lean.Meta.State

full_name: Lean.Meta.State.zetaDeltaFVarIds
code: /--
  `MetaM` monad state.
-/
structure State where
  mctx             : MetavarContext := {}
  cache            : Cache := {}
  /-- When `trackZetaDelta == true`, then any let-decl free variable that is zetaDelta-expanded by `MetaM` is stored in `zetaDeltaFVarIds`. -/
  zetaDeltaFVarIds : FVarIdSet := {}
  /-- Array of postponed universe level constraints -/
  postponed        : PersistentArray PostponedEntry := {}
  diag             : Diagnostics := {}
  deriving Inhabited
goal: Lean.FVarIdSet

full_name: Lean.Meta.State.postponed
code: /--
  `MetaM` monad state.
-/
structure State where
  mctx             : MetavarContext := {}
  cache            : Cache := {}
  /-- When `trackZetaDelta == true`, then any let-decl free variable that is zetaDelta-expanded by `MetaM` is stored in `zetaDeltaFVarIds`. -/
  zetaDeltaFVarIds : FVarIdSet := {}
  /-- Array of postponed universe level constraints -/
  postponed        : PersistentArray PostponedEntry := {}
  diag             : Diagnostics := {}
  deriving Inhabited
goal: Lean.PersistentArray Lean.Meta.PostponedEntry

full_name: Lean.Meta.State.mctx
code: /--
  `MetaM` monad state.
-/
structure State where
  mctx             : MetavarContext := {}
  cache            : Cache := {}
  /-- When `trackZetaDelta == true`, then any let-decl free variable that is zetaDelta-expanded by `MetaM` is stored in `zetaDeltaFVarIds`. -/
  zetaDeltaFVarIds : FVarIdSet := {}
  /-- Array of postponed universe level constraints -/
  postponed        : PersistentArray PostponedEntry := {}
  diag             : Diagnostics := {}
  deriving Inhabited
goal: Lean.MetavarContext

full_name: Lean.Meta.State.diag
code: /--
  `MetaM` monad state.
-/
structure State where
  mctx             : MetavarContext := {}
  cache            : Cache := {}
  /-- When `trackZetaDelta == true`, then any let-decl free variable that is zetaDelta-expanded by `MetaM` is stored in `zetaDeltaFVarIds`. -/
  zetaDeltaFVarIds : FVarIdSet := {}
  /-- Array of postponed universe level constraints -/
  postponed        : PersistentArray PostponedEntry := {}
  diag             : Diagnostics := {}
  deriving Inhabited
goal: Lean.Meta.Diagnostics

full_name: Lean.Meta.State.cache
code: /--
  `MetaM` monad state.
-/
structure State where
  mctx             : MetavarContext := {}
  cache            : Cache := {}
  /-- When `trackZetaDelta == true`, then any let-decl free variable that is zetaDelta-expanded by `MetaM` is stored in `zetaDeltaFVarIds`. -/
  zetaDeltaFVarIds : FVarIdSet := {}
  /-- Array of postponed universe level constraints -/
  postponed        : PersistentArray PostponedEntry := {}
  diag             : Diagnostics := {}
  deriving Inhabited
goal: Lean.Meta.Cache

full_name: Lean.Meta.State
code: /--
  `MetaM` monad state.
-/
structure State where
  mctx             : MetavarContext := {}
  cache            : Cache := {}
  /-- When `trackZetaDelta == true`, then any let-decl free variable that is zetaDelta-expanded by `MetaM` is stored in `zetaDeltaFVarIds`. -/
  zetaDeltaFVarIds : FVarIdSet := {}
  /-- Array of postponed universe level constraints -/
  postponed        : PersistentArray PostponedEntry := {}
  diag             : Diagnostics := {}
  deriving Inhabited
goal: Type

full_name: Lean.Meta.SavedState.meta
code: /--
  Backtrackable state for the `MetaM` monad.
-/
structure SavedState where
  core        : Core.SavedState
  meta        : State
  deriving Nonempty
goal: Lean.Meta.State

full_name: Lean.Meta.instNonemptySavedState
code: /--
  Backtrackable state for the `MetaM` monad.
-/
structure SavedState where
  core        : Core.SavedState
  meta        : State
  deriving Nonempty
goal: Nonempty Lean.Meta.SavedState

full_name: Lean.Meta.SavedState.core
code: /--
  Backtrackable state for the `MetaM` monad.
-/
structure SavedState where
  core        : Core.SavedState
  meta        : State
  deriving Nonempty
goal: Lean.Core.SavedState

full_name: Lean.Meta.SavedState
code: /--
  Backtrackable state for the `MetaM` monad.
-/
structure SavedState where
  core        : Core.SavedState
  meta        : State
  deriving Nonempty
goal: Type

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.Basic._hyg.1398
code: register_builtin_option maxSynthPendingDepth : Nat := {
  defValue := 1
  descr    := "maximum number of nested `synthPending` invocations. When resolving unification constraints, pending type class problems may need to be synthesized. These type class problems may create new unification constraints that again require solving new type class problems. This option puts a threshold on how many nested problems are created."
}
goal: IO (Lean.Option Nat)

full_name: Lean.Meta.maxSynthPendingDepth
code: register_builtin_option maxSynthPendingDepth : Nat := {
  defValue := 1
  descr    := "maximum number of nested `synthPending` invocations. When resolving unification constraints, pending type class problems may need to be synthesized. These type class problems may create new unification constraints that again require solving new type class problems. This option puts a threshold on how many nested problems are created."
}
goal: Lean.Option Nat

full_name: Lean.Meta.Context.config
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Lean.Meta.Config

full_name: Lean.Meta.Context.defEqCtx?
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Option Lean.Meta.DefEqContext

full_name: Lean.Meta.Context
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Type

full_name: Lean.Meta.Context.synthPendingDepth
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Nat

full_name: Lean.Meta.Context.univApprox
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Bool

full_name: Lean.Meta.Context.lctx
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Lean.LocalContext

full_name: Lean.Meta.Context.inTypeClassResolution
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Bool

full_name: Lean.Meta.Context.localInstances
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Lean.LocalInstances

full_name: Lean.Meta.Context.canUnfold?
code: /--
  Contextual information for the `MetaM` monad.
-/
structure Context where
  config            : Config               := {}
  /-- Local context -/
  lctx              : LocalContext         := {}
  /-- Local instances in `lctx`. -/
  localInstances    : LocalInstances       := #[]
  /-- Not `none` when inside of an `isDefEq` test. See `PostponedEntry`. -/
  defEqCtx?         : Option DefEqContext  := none
  /--
    Track the number of nested `synthPending` invocations. Nested invocations can happen
    when the type class resolution invokes `synthPending`.

    Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
  -/
  synthPendingDepth : Nat                  := 0
  /--
    A predicate to control whether a constant can be unfolded or not at `whnf`.
    Note that we do not cache results at `whnf` when `canUnfold?` is not `none`. -/
  canUnfold?        : Option (Config → ConstantInfo → CoreM Bool) := none
  /--
  When `Config.univApprox := true`, this flag is set to `true` when there is no
  progress processing universe constraints.
  -/
  univApprox        : Bool := false
  /--
  `inTypeClassResolution := true` when `isDefEq` is invoked at `tryResolve` in the type class
   resolution module. We don't use `isDefEqProjDelta` when performing TC resolution due to performance issues.
   This is not a great solution, but a proper solution would require a more sophisticased caching mechanism.
  -/
  inTypeClassResolution : Bool := false
goal: Option (Lean.Meta.Config → Lean.ConstantInfo → Lean.CoreM Bool)

full_name: Lean.Meta.MetaM
code: /--
The `MetaM` monad is a core component of Lean's metaprogramming framework, facilitating the
construction and manipulation of expressions (`Lean.Expr`) within Lean.

It builds on top of `CoreM` and additionally provides:
- A `LocalContext` for managing free variables.
- A `MetavarContext` for managing metavariables.
- A `Cache` for caching results of the key `MetaM` operations.

The key operations provided by `MetaM` are:
- `inferType`, which attempts to automatically infer the type of a given expression.
- `whnf`, which reduces an expression to the point where the outermost part is no longer reducible
  but the inside may still contain unreduced expression.
- `isDefEq`, which determines whether two expressions are definitionally equal, possibly assigning
  meta variables in the process.
- `forallTelescope` and `lambdaTelescope`, which make it possible to automatically move into
  (nested) binders while updating the local context.

The following is a small example that demonstrates how to obtain and manipulate the type of a
`Fin` expression:
```
import Lean

open Lean Meta

def getFinBound (e : Expr) : MetaM (Option Expr) := do
  let type ← whnf (← inferType e)
  let_expr Fin bound := type | return none
  return bound

def a : Fin 100 := 42

run_meta
  match ← getFinBound (.const ``a []) with
  | some limit => IO.println (← ppExpr limit)
  | none => IO.println "no limit found"
```
-/
abbrev MetaM  
goal: Type

full_name: Lean.Meta.instMonadMetaM
code: @[always_inline]
instance : Monad MetaM 
goal: Monad Lean.MetaM

full_name: Lean.Meta.instInhabitedMetaM
code: instance : Inhabited (MetaM α) 
goal: Inhabited (Lean.MetaM α)

full_name: Lean.Meta.instMonadLCtxMetaM
code: instance : MonadLCtx MetaM 
goal: Lean.MonadLCtx Lean.MetaM

full_name: Lean.Meta.instMonadMCtxMetaM
code: instance : MonadMCtx MetaM 
goal: Lean.MonadMCtx Lean.MetaM

full_name: Lean.Meta.instMonadEnvMetaM
code: instance : MonadEnv MetaM 
goal: Lean.MonadEnv Lean.MetaM

full_name: Lean.Meta.instAddMessageContextMetaM
code: instance : AddMessageContext MetaM 
goal: Lean.AddMessageContext Lean.MetaM

full_name: Lean.Meta.saveState
code: protected def saveState : MetaM SavedState 
goal: Lean.MetaM Lean.Meta.SavedState

full_name: Lean.Meta.SavedState.restore
code: /-- Restore backtrackable parts of the state. -/
def SavedState.restore (b : SavedState) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.withRestoreOrSaveFull
code: @[specialize, inherit_doc Core.withRestoreOrSaveFull]
def withRestoreOrSaveFull (reusableResult? : Option (α × SavedState)) (act : MetaM α) :
    MetaM (α × SavedState) 
goal: Lean.MetaM (α × Lean.Meta.SavedState)

full_name: Lean.Meta.instMonadBacktrackSavedStateMetaM
code: instance : MonadBacktrack SavedState MetaM 
goal: Lean.MonadBacktrack Lean.Meta.SavedState Lean.MetaM

full_name: Lean.Meta.MetaM.run
code: @[inline] def MetaM.run (x : MetaM α) (ctx : Context := {}) (s : State := {}) : CoreM (α × State) 
goal: Lean.CoreM (α × Lean.Meta.State)

full_name: Lean.Meta.MetaM.run'
code: @[inline] def MetaM.run' (x : MetaM α) (ctx : Context := {}) (s : State := {}) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.Meta.MetaM.toIO
code: @[inline] def MetaM.toIO (x : MetaM α) (ctxCore : Core.Context) (sCore : Core.State) (ctx : Context := {}) (s : State := {}) : IO (α × Core.State × State) 
goal: IO (α × Lean.Core.State × Lean.Meta.State)

full_name: Lean.Meta.instMetaEvalMetaM
code: instance [MetaEval α] : MetaEval (MetaM α) 
goal: Lean.MetaEval (Lean.MetaM α)

full_name: Lean.Meta.throwIsDefEqStuck
code: protected def throwIsDefEqStuck : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.Basic._hyg.2363
code: builtin_initialize
  registerTraceClass `Meta
  registerTraceClass `Meta.debug
goal: IO Unit

full_name: Lean.Meta.liftMetaM
code: @[inline] def liftMetaM [MonadLiftT MetaM m] (x : MetaM α) : m α 
goal: m α

full_name: Lean.Meta.mapMetaM
code: @[inline] def mapMetaM [MonadControlT MetaM m] [Monad m] (f : forall {α}, MetaM α → MetaM α) {α} (x : m α) : m α 
goal: m α

full_name: Lean.Meta.map1MetaM
code: @[inline] def map1MetaM [MonadControlT MetaM m] [Monad m] (f : forall {α}, (β → MetaM α) → MetaM α) {α} (k : β → m α) : m α 
goal: m α

full_name: Lean.Meta.map2MetaM
code: @[inline] def map2MetaM [MonadControlT MetaM m] [Monad m] (f : forall {α}, (β → γ → MetaM α) → MetaM α) {α} (k : β → γ → m α) : m α 
goal: m α

full_name: Lean.Meta.modifyCache
code: @[inline] def modifyCache (f : Cache → Cache) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.modifyInferTypeCache
code: @[inline] def modifyInferTypeCache (f : InferTypeCache → InferTypeCache) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.modifyDefEqTransientCache
code: @[inline] def modifyDefEqTransientCache (f : DefEqCache → DefEqCache) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.modifyDefEqPermCache
code: @[inline] def modifyDefEqPermCache (f : DefEqCache → DefEqCache) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.resetDefEqPermCaches
code: @[inline] def resetDefEqPermCaches : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.modifyDiag
code: @[inline] def modifyDiag (f : Diagnostics → Diagnostics) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.recordUnfold
code: /-- If diagnostics are enabled, record that `declName` has been unfolded. -/
def recordUnfold (declName : Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.recordDefEqHeuristic
code: /-- If diagnostics are enabled, record that heuristic for solving `f a =?= f b` has been used. -/
def recordDefEqHeuristic (declName : Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.recordInstance
code: /-- If diagnostics are enabled, record that instance `declName` was used during TC resolution. -/
def recordInstance (declName : Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.recordSynthPendingFailure
code: /-- If diagnostics are enabled, record that synth pending failures. -/
def recordSynthPendingFailure (type : Expr) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.getLocalInstances
code: def getLocalInstances : MetaM LocalInstances 
goal: Lean.MetaM Lean.LocalInstances

full_name: Lean.Meta.getConfig
code: def getConfig : MetaM Config 
goal: Lean.MetaM Lean.Meta.Config

full_name: Lean.Meta.resetZetaDeltaFVarIds
code: def resetZetaDeltaFVarIds : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.getZetaDeltaFVarIds
code: def getZetaDeltaFVarIds : MetaM FVarIdSet 
goal: Lean.MetaM Lean.FVarIdSet

full_name: Lean.Meta.getPostponed
code: /-- Return the array of postponed universe level constraints. -/
def getPostponed : MetaM (PersistentArray PostponedEntry) 
goal: Lean.MetaM (Lean.PersistentArray Lean.Meta.PostponedEntry)

full_name: Lean.Meta.setPostponed
code: /-- Set the array of postponed universe level constraints. -/
def setPostponed (postponed : PersistentArray PostponedEntry) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.modifyPostponed
code: /-- Modify the array of postponed universe level constraints. -/
@[inline] def modifyPostponed (f : PersistentArray PostponedEntry → PersistentArray PostponedEntry) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.useEtaStruct
code: /--
  `useEtaStruct inductName` return `true` if we eta for structures is enabled for
  for the inductive datatype `inductName`.

  Recall we have three different settings: `.none` (never use it), `.all` (always use it), `.notClasses`
  (enabled only for structure-like inductive types that are not classes).

  The parameter `inductName` affects the result only if the current setting is `.notClasses`.
-/
def useEtaStruct (inductName : Name) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.whnf
code: /-- Reduces an expression to its Weak Head Normal Form.
This is when the topmost expression has been fully reduced,
but may contain subexpressions which have not been reduced. -/
@[extern 6 "lean_whnf"] opaque whnf : Expr → MetaM Expr
goal: Lean.Expr → Lean.MetaM Lean.Expr

full_name: Lean.Meta.inferType
code: /-- Returns the inferred type of the given expression, or fails if it is not type-correct. -/
@[extern 6 "lean_infer_type"] opaque inferType : Expr → MetaM Expr
goal: Lean.Expr → Lean.MetaM Lean.Expr

full_name: Lean.Meta.isExprDefEqAux
code: @[extern 7 "lean_is_expr_def_eq"] opaque isExprDefEqAux : Expr → Expr → MetaM Bool
goal: Lean.Expr → Lean.Expr → Lean.MetaM Bool

full_name: Lean.Meta.isLevelDefEqAux
code: @[extern 7 "lean_is_level_def_eq"] opaque isLevelDefEqAux : Level → Level → MetaM Bool
goal: Lean.Level → Lean.Level → Lean.MetaM Bool

full_name: Lean.Meta.synthPending
code: @[extern 6 "lean_synth_pending"] protected opaque synthPending : MVarId → MetaM Bool
goal: Lean.MVarId → Lean.MetaM Bool

full_name: Lean.Meta.whnfForall
code: def whnfForall (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.withIncRecDepth
code: protected def withIncRecDepth (x : n α) : n α 
goal: n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.mkFreshExprMVarAtCore
code: private def mkFreshExprMVarAtCore
    (mvarId : MVarId) (lctx : LocalContext) (localInsts : LocalInstances) (type : Expr) (kind : MetavarKind) (userName : Name) (numScopeArgs : Nat) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFreshExprMVarAt
code: def mkFreshExprMVarAt
    (lctx : LocalContext) (localInsts : LocalInstances) (type : Expr)
    (kind : MetavarKind := MetavarKind.natural) (userName : Name := Name.anonymous) (numScopeArgs : Nat := 0)
    : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFreshLevelMVar
code: def mkFreshLevelMVar : MetaM Level 
goal: Lean.MetaM Lean.Level

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.mkFreshExprMVarCore
code: private def mkFreshExprMVarCore (type : Expr) (kind : MetavarKind) (userName : Name) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.mkFreshExprMVarImpl
code: private def mkFreshExprMVarImpl (type? : Option Expr) (kind : MetavarKind) (userName : Name) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFreshExprMVar
code: def mkFreshExprMVar (type? : Option Expr) (kind := MetavarKind.natural) (userName := Name.anonymous) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFreshTypeMVar
code: def mkFreshTypeMVar (kind := MetavarKind.natural) (userName := Name.anonymous) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.mkFreshExprMVarWithIdCore
code: /-- Low-level version of `MkFreshExprMVar` which allows users to create/reserve a `mvarId` using `mkFreshId`, and then later create
   the metavar using this method. -/
private def mkFreshExprMVarWithIdCore (mvarId : MVarId) (type : Expr)
    (kind : MetavarKind := MetavarKind.natural) (userName : Name := Name.anonymous) (numScopeArgs : Nat := 0)
    : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFreshExprMVarWithId
code: def mkFreshExprMVarWithId (mvarId : MVarId) (type? : Option Expr := none) (kind : MetavarKind := MetavarKind.natural) (userName := Name.anonymous) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFreshLevelMVars
code: def mkFreshLevelMVars (num : Nat) : MetaM (List Level) 
goal: Lean.MetaM (List Lean.Level)

full_name: Lean.Meta.mkFreshLevelMVarsFor
code: def mkFreshLevelMVarsFor (info : ConstantInfo) : MetaM (List Level) 
goal: Lean.MetaM (List Lean.Level)

full_name: Lean.Meta.mkConstWithFreshMVarLevels
code: /--
Create a constant with the given name and new universe metavariables.
Example: ``mkConstWithFreshMVarLevels `Monad`` returns `@Monad.{?u, ?v}`
-/
def mkConstWithFreshMVarLevels (declName : Name) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.getTransparency
code: /-- Return current transparency setting/mode. -/
def getTransparency : MetaM TransparencyMode 
goal: Lean.MetaM Lean.Meta.TransparencyMode

full_name: Lean.Meta.shouldReduceAll
code: def shouldReduceAll : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.shouldReduceReducibleOnly
code: def shouldReduceReducibleOnly : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.MVarId.findDecl?
code: /--
Return `some mvarDecl` where `mvarDecl` is `mvarId` declaration in the current metavariable context.
Return `none` if `mvarId` has no declaration in the current metavariable context.
-/
def _root_.Lean.MVarId.findDecl? (mvarId : MVarId) : MetaM (Option MetavarDecl) 
goal: Lean.MetaM (Option Lean.MetavarDecl)

full_name: Lean.Meta.findMVarDecl?
code: @[deprecated MVarId.findDecl? (since := "2022-07-15")]
def findMVarDecl? (mvarId : MVarId) : MetaM (Option MetavarDecl) 
goal: Lean.MetaM (Option Lean.MetavarDecl)

full_name: Lean.MVarId.getDecl
code: /--
Return `mvarId` declaration in the current metavariable context.
Throw an exception if `mvarId` is not declared in the current metavariable context.
-/
def _root_.Lean.MVarId.getDecl (mvarId : MVarId) : MetaM MetavarDecl 
goal: Lean.MetaM Lean.MetavarDecl

full_name: Lean.Meta.getMVarDecl
code: @[deprecated MVarId.getDecl (since := "2022-07-15")]
def getMVarDecl (mvarId : MVarId) : MetaM MetavarDecl 
goal: Lean.MetaM Lean.MetavarDecl

full_name: Lean.MVarId.getKind
code: /--
Return `mvarId` kind. Throw an exception if `mvarId` is not declared in the current metavariable context.
-/
def _root_.Lean.MVarId.getKind (mvarId : MVarId) : MetaM MetavarKind 
goal: Lean.MetaM Lean.MetavarKind

full_name: Lean.Meta.getMVarDeclKind
code: @[deprecated MVarId.getKind (since := "2022-07-15")]
def getMVarDeclKind (mvarId : MVarId) : MetaM MetavarKind 
goal: Lean.MetaM Lean.MetavarKind

full_name: Lean.Meta.isSyntheticMVar
code: /-- Return `true` if `e` is a synthetic (or synthetic opaque) metavariable -/
def isSyntheticMVar (e : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.MVarId.setKind
code: /--
Set `mvarId` kind in the current metavariable context.
-/
def _root_.Lean.MVarId.setKind (mvarId : MVarId) (kind : MetavarKind) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.setMVarKind
code: @[deprecated MVarId.setKind (since := "2022-07-15")]
def setMVarKind (mvarId : MVarId) (kind : MetavarKind) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.MVarId.setType
code: /-- Update the type of the given metavariable. This function assumes the new type is
   definitionally equal to the current one -/
def _root_.Lean.MVarId.setType (mvarId : MVarId) (type : Expr) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.setMVarType
code: @[deprecated MVarId.setType (since := "2022-07-15")]
def setMVarType (mvarId : MVarId) (type : Expr) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.MVarId.isReadOnly
code: /--
Return true if the given metavariable is "read-only".
That is, its `depth` is different from the current metavariable context depth.
-/
def _root_.Lean.MVarId.isReadOnly (mvarId : MVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isReadOnlyExprMVar
code: @[deprecated MVarId.isReadOnly (since := "2022-07-15")]
def isReadOnlyExprMVar (mvarId : MVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.MVarId.isReadOnlyOrSyntheticOpaque
code: /--
Returns true if `mvarId.isReadOnly` returns true or if `mvarId` is a synthetic opaque metavariable.

Recall `isDefEq` will not assign a value to `mvarId` if `mvarId.isReadOnlyOrSyntheticOpaque`.
-/
def _root_.Lean.MVarId.isReadOnlyOrSyntheticOpaque (mvarId : MVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isReadOnlyOrSyntheticOpaqueExprMVar
code: @[deprecated MVarId.isReadOnlyOrSyntheticOpaque (since := "2022-07-15")]
def isReadOnlyOrSyntheticOpaqueExprMVar (mvarId : MVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.LMVarId.getLevel
code: /--
Return the level of the given universe level metavariable.
-/
def _root_.Lean.LMVarId.getLevel (mvarId : LMVarId) : MetaM Nat 
goal: Lean.MetaM Nat

full_name: Lean.Meta.getLevelMVarDepth
code: @[deprecated LMVarId.getLevel (since := "2022-07-15")]
def getLevelMVarDepth (mvarId : LMVarId) : MetaM Nat 
goal: Lean.MetaM Nat

full_name: Lean.LMVarId.isReadOnly
code: /--
Return true if the given universe metavariable is "read-only".
That is, its `depth` is different from the current metavariable context depth.
-/
def _root_.Lean.LMVarId.isReadOnly (mvarId : LMVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isReadOnlyLevelMVar
code: @[deprecated LMVarId.isReadOnly (since := "2022-07-15")]
def isReadOnlyLevelMVar (mvarId : LMVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.MVarId.setUserName
code: /--
Set the user-facing name for the given metavariable.
-/
def _root_.Lean.MVarId.setUserName (mvarId : MVarId) (newUserName : Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.setMVarUserName
code: @[deprecated MVarId.setUserName (since := "2022-07-15")]
def setMVarUserName (mvarId : MVarId) (userNameNew : Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.FVarId.throwUnknown
code: /--
Throw an exception saying `fvarId` is not declared in the current local context.
-/
def _root_.Lean.FVarId.throwUnknown (fvarId : FVarId) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.Meta.throwUnknownFVar
code: @[deprecated FVarId.throwUnknown (since := "2022-07-15")]
def throwUnknownFVar (fvarId : FVarId) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.FVarId.findDecl?
code: /--
Return `some decl` if `fvarId` is declared in the current local context.
-/
def _root_.Lean.FVarId.findDecl? (fvarId : FVarId) : MetaM (Option LocalDecl) 
goal: Lean.MetaM (Option Lean.LocalDecl)

full_name: Lean.Meta.findLocalDecl?
code: @[deprecated FVarId.findDecl? (since := "2022-07-15")]
def findLocalDecl? (fvarId : FVarId) : MetaM (Option LocalDecl) 
goal: Lean.MetaM (Option Lean.LocalDecl)

full_name: Lean.FVarId.getDecl
code: /--
  Return the local declaration for the given free variable.
  Throw an exception if local declaration is not in the current local context.
-/
def _root_.Lean.FVarId.getDecl (fvarId : FVarId) : MetaM LocalDecl 
goal: Lean.MetaM Lean.LocalDecl

full_name: Lean.Meta.getLocalDecl
code: @[deprecated FVarId.getDecl (since := "2022-07-15")]
def getLocalDecl (fvarId : FVarId) : MetaM LocalDecl 
goal: Lean.MetaM Lean.LocalDecl

full_name: Lean.FVarId.getType
code: /-- Return the type of the given free variable. -/
def _root_.Lean.FVarId.getType (fvarId : FVarId) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.FVarId.getBinderInfo
code: /-- Return the binder information for the given free variable. -/
def _root_.Lean.FVarId.getBinderInfo (fvarId : FVarId) : MetaM BinderInfo 
goal: Lean.MetaM Lean.BinderInfo

full_name: Lean.FVarId.getValue?
code: /-- Return `some value` if the given free variable is a let-declaration, and `none` otherwise. -/
def _root_.Lean.FVarId.getValue? (fvarId : FVarId) : MetaM (Option Expr) 
goal: Lean.MetaM (Option Lean.Expr)

full_name: Lean.FVarId.getUserName
code: /-- Return the user-facing name for the given free variable. -/
def _root_.Lean.FVarId.getUserName (fvarId : FVarId) : MetaM Name 
goal: Lean.MetaM Lean.Name

full_name: Lean.FVarId.isLetVar
code: /-- Return `true` is the free variable is a let-variable. -/
def _root_.Lean.FVarId.isLetVar (fvarId : FVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.getFVarLocalDecl
code: /-- Get the local declaration associated to the given `Expr` in the current local
context. Fails if the given expression is not a fvar or if no such declaration exists. -/
def getFVarLocalDecl (fvar : Expr) : MetaM LocalDecl 
goal: Lean.MetaM Lean.LocalDecl

full_name: Lean.FVarId.hasForwardDeps
code: /--
Returns `true` if another local declaration in the local context depends on `fvarId`.
-/
def _root_.Lean.FVarId.hasForwardDeps (fvarId : FVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.getLocalDeclFromUserName
code: /--
Given a user-facing name for a free variable, return its declaration in the current local context.
Throw an exception if free variable is not declared.
-/
def getLocalDeclFromUserName (userName : Name) : MetaM LocalDecl 
goal: Lean.MetaM Lean.LocalDecl

full_name: Lean.Meta.getFVarFromUserName
code: /-- Given a user-facing name for a free variable, return the free variable or throw if not declared. -/
def getFVarFromUserName (userName : Name) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.liftMkBindingM
code: /--
Lift a `MkBindingM` monadic action `x` to `MetaM`.
-/
@[inline] def liftMkBindingM (x : MetavarContext.MkBindingM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Expr.abstractRangeM
code: /--
Similar to `abstracM` but consider only the first `min n xs.size` entries in `xs`

It is also similar to `Expr.abstractRange`, but handles metavariables correctly.
It uses `elimMVarDeps` to ensure `e` and the type of the free variables `xs` do not
contain a metavariable `?m` s.t. local context of `?m` contains a free variable in `xs`.
-/
def _root_.Lean.Expr.abstractRangeM (e : Expr) (n : Nat) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.abstractRange
code: @[deprecated Expr.abstractRangeM (since := "2022-07-15")]
def abstractRange (e : Expr) (n : Nat) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Expr.abstractM
code: /--
Replace free (or meta) variables `xs` with loose bound variables.
Similar to `Expr.abstract`, but handles metavariables correctly.
-/
def _root_.Lean.Expr.abstractM (e : Expr) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.abstract
code: @[deprecated Expr.abstractM (since := "2022-07-15")]
def abstract (e : Expr) (xs : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.collectForwardDeps
code: /--
Collect forward dependencies for the free variables in `toRevert`.
Recall that when reverting free variables `xs`, we must also revert their forward dependencies.
-/
def collectForwardDeps (toRevert : Array Expr) (preserveOrder : Bool) : MetaM (Array Expr) 
goal: Lean.MetaM (Array Lean.Expr)

full_name: Lean.Meta.mkForallFVars
code: /-- Takes an array `xs` of free variables or metavariables and a term `e` that may contain those variables, and abstracts and binds them as universal quantifiers.

- if `usedOnly = true` then only variables that the expression body depends on will appear.
- if `usedLetOnly = true` same as `usedOnly` except for let-bound variables. (That is, local constants which have been assigned a value.)
 -/
def mkForallFVars (xs : Array Expr) (e : Expr) (usedOnly : Bool := false) (usedLetOnly : Bool := true) (binderInfoForMVars := BinderInfo.implicit) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLambdaFVars
code: /-- Takes an array `xs` of free variables and metavariables and a
body term `e` and creates `fun ..xs => e`, suitably
abstracting `e` and the types in `xs`. -/
def mkLambdaFVars (xs : Array Expr) (e : Expr) (usedOnly : Bool := false) (usedLetOnly : Bool := true) (etaReduce : Bool := false) (binderInfoForMVars := BinderInfo.implicit) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkLetFVars
code: def mkLetFVars (xs : Array Expr) (e : Expr) (usedLetOnly := true) (binderInfoForMVars := BinderInfo.implicit) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkFunUnit
code: /-- `fun _ : Unit => a` -/
def mkFunUnit (a : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.elimMVarDeps
code: def elimMVarDeps (xs : Array Expr) (e : Expr) (preserveOrder : Bool := false) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.withConfig
code: /-- `withConfig f x` executes `x` using the updated configuration object obtained by applying `f`. -/
@[inline] def withConfig (f : Config → Config) : n α → n α 
goal: n α → n α

full_name: Lean.Meta.withTrackingZetaDelta
code: /--
Executes `x` tracking zetaDelta reductions `Config.trackZetaDelta := true`
-/
@[inline] def withTrackingZetaDelta (x : n α) : n α 
goal: n α

full_name: Lean.Meta.withoutProofIrrelevance
code: @[inline] def withoutProofIrrelevance (x : n α) : n α 
goal: n α

full_name: Lean.Meta.withTransparency
code: @[inline] def withTransparency (mode : TransparencyMode) : n α → n α 
goal: n α → n α

full_name: Lean.Meta.withDefault
code: /-- `withDefault x` executes `x` using the default transparency setting. -/
@[inline] def withDefault (x : n α) : n α 
goal: n α

full_name: Lean.Meta.withReducible
code: /-- `withReducible x` executes `x` using the reducible transparency setting. In this setting only definitions tagged as `[reducible]` are unfolded. -/
@[inline] def withReducible (x : n α) : n α 
goal: n α

full_name: Lean.Meta.withReducibleAndInstances
code: /--
`withReducibleAndInstances x` executes `x` using the `.instances` transparency setting. In this setting only definitions tagged as `[reducible]`
or type class instances are unfolded.
-/
@[inline] def withReducibleAndInstances (x : n α) : n α 
goal: n α

full_name: Lean.Meta.withAtLeastTransparency
code: /--
Execute `x` ensuring the transparency setting is at least `mode`.
Recall that `.all > .default > .instances > .reducible`.
-/
@[inline] def withAtLeastTransparency (mode : TransparencyMode) (x : n α) : n α 
goal: n α

full_name: Lean.Meta.withAssignableSyntheticOpaque
code: /-- Execute `x` allowing `isDefEq` to assign synthetic opaque metavariables. -/
@[inline] def withAssignableSyntheticOpaque (x : n α) : n α 
goal: n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.savingCacheImpl
code: /-- Save cache, execute `x`, restore cache -/
@[inline] private def savingCacheImpl (x : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.savingCache
code: @[inline] def savingCache : n α → n α 
goal: n α → n α

full_name: Lean.Meta.getTheoremInfo
code: def getTheoremInfo (info : ConstantInfo) : MetaM (Option ConstantInfo) 
goal: Lean.MetaM (Option Lean.ConstantInfo)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.getDefInfoTemp
code: private def getDefInfoTemp (info : ConstantInfo) : MetaM (Option ConstantInfo) 
goal: Lean.MetaM (Option Lean.ConstantInfo)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.getConstTemp?
code: /-- Remark: we later define `getUnfoldableConst?` at `GetConst.lean` after we define `Instances.lean`.
   This method is only used to implement `isClassQuickConst?`.
   It is very similar to `getUnfoldableConst?`, but it returns none when `TransparencyMode.instances` and
   `constName` is an instance. This difference should be irrelevant for `isClassQuickConst?`. -/
private def getConstTemp? (constName : Name) : MetaM (Option ConstantInfo) 
goal: Lean.MetaM (Option Lean.ConstantInfo)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.isClassQuickConst?
code: private def isClassQuickConst? (constName : Name) : MetaM (LOption Name) 
goal: Lean.MetaM (Lean.LOption Lean.Name)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.isClassQuick?
code: private partial def isClassQuick? : Expr → MetaM (LOption Name)
  
goal: Lean.Expr → Lean.MetaM (Lean.LOption Lean.Name)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withNewLocalInstanceImp
code: private def withNewLocalInstanceImp (className : Name) (fvar : Expr) (k : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withNewLocalInstance
code: /-- Add entry `{ className := className, fvar := fvar }` to localInstances,
    and then execute continuation `k`. -/
def withNewLocalInstance (className : Name) (fvar : Expr) : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.fvarsSizeLtMaxFVars
code: private def fvarsSizeLtMaxFVars (fvars : Array Expr) (maxFVars? : Option Nat) : Bool 
goal: Bool

full_name: Lean.Meta.isClass?
code: /--
  `isClass? type` return `some ClsName` if `type` is an instance of the class `ClsName`.
  Example:
  ```
  #eval do
    let x ← mkAppM ``Inhabited #[mkConst ``Nat]
    IO.println (← isClass? x)
    -- (some Inhabited)
  ```
-/
def isClass? (type : Expr) : MetaM (Option Name) 
goal: Lean.MetaM (Option Lean.Name)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withNewLocalInstancesImpAux
code: private def withNewLocalInstancesImpAux (fvars : Array Expr) (j : Nat) : n α → n α 
goal: n α → n α

full_name: Lean.Meta.withNewLocalInstances
code: partial def withNewLocalInstances (fvars : Array Expr) (j : Nat) : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.forallTelescopeImp
code: @[inline] private def forallTelescopeImp (type : Expr) (k : Array Expr → Expr → MetaM α) (cleanupAnnotations : Bool) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.forallTelescope
code: /--
  Given `type` of the form `forall xs, A`, execute `k xs A`.
  This combinator will declare local declarations, create free variables for them,
  execute `k` with updated local context, and make sure the cache is restored after executing `k`.

  If `cleanupAnnotations` is `true`, we apply `Expr.cleanupAnnotations` to each type in the telescope.
-/
def forallTelescope (type : Expr) (k : Array Expr → Expr → n α) (cleanupAnnotations := false) : n α 
goal: n α

full_name: Lean.Meta.mapForallTelescope'
code: /--
Given a monadic function `f` that takes a type and a term of that type and produces a new term,
lifts this to the monadic function that opens a `∀` telescope, applies `f` to the body,
and then builds the lambda telescope term for the new term.
-/
def mapForallTelescope' (f : Expr → Expr → MetaM Expr) (forallTerm : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mapForallTelescope
code: /--
Given a monadic function `f` that takes a term and produces a new term,
lifts this to the monadic function that opens a `∀` telescope, applies `f` to the body,
and then builds the lambda telescope term for the new term.
-/
def mapForallTelescope (f : Expr → MetaM Expr) (forallTerm : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.forallTelescopeReducingImp
code: private def forallTelescopeReducingImp (type : Expr) (k : Array Expr → Expr → MetaM α) (cleanupAnnotations : Bool) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.forallTelescopeReducing
code: /--
  Similar to `forallTelescope`, but given `type` of the form `forall xs, A`,
  it reduces `A` and continues building the telescope if it is a `forall`.

  If `cleanupAnnotations` is `true`, we apply `Expr.cleanupAnnotations` to each type in the telescope.
-/
def forallTelescopeReducing (type : Expr) (k : Array Expr → Expr → n α) (cleanupAnnotations := false) : n α 
goal: n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.forallBoundedTelescopeImp
code: private def forallBoundedTelescopeImp (type : Expr) (maxFVars? : Option Nat) (k : Array Expr → Expr → MetaM α) (cleanupAnnotations : Bool) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.forallBoundedTelescope
code: /--
  Similar to `forallTelescopeReducing`, stops constructing the telescope when
  it reaches size `maxFVars`.

  If `cleanupAnnotations` is `true`, we apply `Expr.cleanupAnnotations` to each type in the telescope.
-/
def forallBoundedTelescope (type : Expr) (maxFVars? : Option Nat) (k : Array Expr → Expr → n α) (cleanupAnnotations := false) : n α 
goal: n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.lambdaTelescopeImp.process
code: private partial def lambdaTelescopeImp (e : Expr) (consumeLet : Bool) (k : Array Expr → Expr → MetaM α) (cleanupAnnotations := false) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.lambdaTelescopeImp
code: private partial def lambdaTelescopeImp (e : Expr) (consumeLet : Bool) (k : Array Expr → Expr → MetaM α) (cleanupAnnotations := false) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.lambdaLetTelescope
code: /--
Similar to `lambdaTelescope` but for lambda and let expressions.

If `cleanupAnnotations` is `true`, we apply `Expr.cleanupAnnotations` to each type in the telescope.
-/
def lambdaLetTelescope (e : Expr) (k : Array Expr → Expr → n α) (cleanupAnnotations := false) : n α 
goal: n α

full_name: Lean.Meta.lambdaTelescope
code: /--
  Given `e` of the form `fun ..xs => A`, execute `k xs A`.
  This combinator will declare local declarations, create free variables for them,
  execute `k` with updated local context, and make sure the cache is restored after executing `k`.

  If `cleanupAnnotations` is `true`, we apply `Expr.cleanupAnnotations` to each type in the telescope.
-/
def lambdaTelescope (e : Expr) (k : Array Expr → Expr → n α) (cleanupAnnotations := false) : n α 
goal: n α

full_name: Lean.Meta.getParamNames
code: /-- Return the parameter names for the given global declaration. -/
def getParamNames (declName : Name) : MetaM (Array Name) 
goal: Lean.MetaM (Array Lean.Name)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.forallMetaTelescopeReducingAux
code: private partial def forallMetaTelescopeReducingAux
    (e : Expr) (reducing : Bool) (maxMVars? : Option Nat) (kind : MetavarKind) : MetaM (Array Expr × Array BinderInfo × Expr) 
goal: Lean.MetaM (Array Lean.Expr × Array Lean.BinderInfo × Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.forallMetaTelescopeReducingAux.process
code: private partial def forallMetaTelescopeReducingAux
    (e : Expr) (reducing : Bool) (maxMVars? : Option Nat) (kind : MetavarKind) : MetaM (Array Expr × Array BinderInfo × Expr) 
goal: Lean.MetaM (Array Lean.Expr × Array Lean.BinderInfo × Lean.Expr)

full_name: Lean.Meta.forallMetaTelescope
code: /-- Given `e` of the form `forall ..xs, A`, this combinator will create a new
  metavariable for each `x` in `xs` and instantiate `A` with these.
  Returns a product containing
  - the new metavariables
  - the binder info for the `xs`
  - the instantiated `A`
  -/
def forallMetaTelescope (e : Expr) (kind := MetavarKind.natural) : MetaM (Array Expr × Array BinderInfo × Expr) 
goal: Lean.MetaM (Array Lean.Expr × Array Lean.BinderInfo × Lean.Expr)

full_name: Lean.Meta.forallMetaTelescopeReducing
code: /-- Similar to `forallMetaTelescope`, but if `e = forall ..xs, A`
it will reduce `A` to construct further mvars.  -/
def forallMetaTelescopeReducing (e : Expr) (maxMVars? : Option Nat := none) (kind := MetavarKind.natural) : MetaM (Array Expr × Array BinderInfo × Expr) 
goal: Lean.MetaM (Array Lean.Expr × Array Lean.BinderInfo × Lean.Expr)

full_name: Lean.Meta.forallMetaBoundedTelescope
code: /-- Similar to `forallMetaTelescopeReducing`, stops
constructing the telescope when it reaches size `maxMVars`. -/
def forallMetaBoundedTelescope (e : Expr) (maxMVars : Nat) (kind : MetavarKind := MetavarKind.natural) : MetaM (Array Expr × Array BinderInfo × Expr) 
goal: Lean.MetaM (Array Lean.Expr × Array Lean.BinderInfo × Lean.Expr)

full_name: Lean.Meta.lambdaMetaTelescope.process
code: /-- Similar to `forallMetaTelescopeReducingAux` but for lambda expressions. -/
partial def lambdaMetaTelescope (e : Expr) (maxMVars? : Option Nat := none) : MetaM (Array Expr × Array BinderInfo × Expr) 
goal: Lean.MetaM (Array Lean.Expr × Array Lean.BinderInfo × Lean.Expr)

full_name: Lean.Meta.lambdaMetaTelescope
code: /-- Similar to `forallMetaTelescopeReducingAux` but for lambda expressions. -/
partial def lambdaMetaTelescope (e : Expr) (maxMVars? : Option Nat := none) : MetaM (Array Expr × Array BinderInfo × Expr) 
goal: Lean.MetaM (Array Lean.Expr × Array Lean.BinderInfo × Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withNewFVar
code: private def withNewFVar (fvar fvarType : Expr) (k : Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withLocalDeclImp
code: private def withLocalDeclImp (n : Name) (bi : BinderInfo) (type : Expr) (k : Expr → MetaM α) (kind : LocalDeclKind) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withLocalDecl
code: /-- Create a free variable `x` with name, binderInfo and type, add it to the context and run in `k`.
Then revert the context. -/
def withLocalDecl (name : Name) (bi : BinderInfo) (type : Expr) (k : Expr → n α) (kind : LocalDeclKind := .default) : n α 
goal: n α

full_name: Lean.Meta.withLocalDeclD
code: def withLocalDeclD (name : Name) (type : Expr) (k : Expr → n α) : n α 
goal: n α

full_name: Lean.Meta.withLocalDecls
code: /-- Append an array of free variables `xs` to the local context and execute `k xs`.
`declInfos` takes the form of an array consisting of:
- the name of the variable
- the binder info of the variable
- a type constructor for the variable, where the array consists of all of the free variables
  defined prior to this one. This is needed because the type of the variable may depend on prior variables.
-/
partial def withLocalDecls
    [Inhabited α]
    (declInfos : Array (Name × BinderInfo × (Array Expr → n Expr)))
    (k : (xs : Array Expr) → n α)
    : n α 
goal: n α

full_name: Lean.Meta.withLocalDecls.loop
code: /-- Append an array of free variables `xs` to the local context and execute `k xs`.
`declInfos` takes the form of an array consisting of:
- the name of the variable
- the binder info of the variable
- a type constructor for the variable, where the array consists of all of the free variables
  defined prior to this one. This is needed because the type of the variable may depend on prior variables.
-/
partial def withLocalDecls
    [Inhabited α]
    (declInfos : Array (Name × BinderInfo × (Array Expr → n Expr)))
    (k : (xs : Array Expr) → n α)
    : n α 
goal: n α

full_name: Lean.Meta.withLocalDeclsD
code: def withLocalDeclsD [Inhabited α] (declInfos : Array (Name × (Array Expr → n Expr))) (k : (xs : Array Expr) → n α) : n α 
goal: n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withNewBinderInfosImp
code: private def withNewBinderInfosImp (bs : Array (FVarId × BinderInfo)) (k : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withNewBinderInfos
code: def withNewBinderInfos (bs : Array (FVarId × BinderInfo)) (k : n α) : n α 
goal: n α

full_name: Lean.Meta.withInstImplicitAsImplict
code: /--
 Execute `k` using a local context where any `x` in `xs` that is tagged as
 instance implicit is treated as a regular implicit. -/
def withInstImplicitAsImplict (xs : Array Expr) (k : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withLetDeclImp
code: private def withLetDeclImp (n : Name) (type : Expr) (val : Expr) (k : Expr → MetaM α) (kind : LocalDeclKind) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withLetDecl
code: /--
  Add the local declaration `<name> : <type> := <val>` to the local context and execute `k x`, where `x` is a new
  free variable corresponding to the `let`-declaration. After executing `k x`, the local context is restored.
-/
def withLetDecl (name : Name) (type : Expr) (val : Expr) (k : Expr → n α) (kind : LocalDeclKind := .default) : n α 
goal: n α

full_name: Lean.Meta.withLocalInstancesImp
code: def withLocalInstancesImp (decls : List LocalDecl) (k : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withLocalInstances
code: /-- Register any local instance in `decls` -/
def withLocalInstances (decls : List LocalDecl) : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withExistingLocalDeclsImp
code: private def withExistingLocalDeclsImp (decls : List LocalDecl) (k : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withExistingLocalDecls
code: /--
  `withExistingLocalDecls decls k`, adds the given local declarations to the local context,
  and then executes `k`. This method assumes declarations in `decls` have valid `FVarId`s.
  After executing `k`, the local context is restored.

  Remark: this method is used, for example, to implement the `match`-compiler.
  Each `match`-alternative commes with a local declarations (corresponding to pattern variables),
  and we use `withExistingLocalDecls` to add them to the local context before we process
  them.
-/
def withExistingLocalDecls (decls : List LocalDecl) : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withNewMCtxDepthImp
code: private def withNewMCtxDepthImp (allowLevelAssignments : Bool) (x : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withReplaceFVarId
code: /--
Removes `fvarId` from the local context, and replaces occurrences of it with `e`.
It is the responsibility of the caller to ensure that `e` is well-typed in the context
of any occurrence of `fvarId`.
-/
def withReplaceFVarId {α} (fvarId : FVarId) (e : Expr) : MetaM α → MetaM α 
goal: Lean.MetaM α → Lean.MetaM α

full_name: Lean.Meta.withNewMCtxDepth
code: /--
  `withNewMCtxDepth k` executes `k` with a higher metavariable context depth,
  where metavariables created outside the `withNewMCtxDepth` (with a lower depth) cannot be assigned.
  If `allowLevelAssignments` is set to true, then the level metavariable depth
  is not increased, and level metavariables from the outer scope can be
  assigned.  (This is used by TC synthesis.)
-/
def withNewMCtxDepth (k : n α) (allowLevelAssignments := false) : n α 
goal: n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withLocalContextImp
code: private def withLocalContextImp (lctx : LocalContext) (localInsts : LocalInstances) (x : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withLCtx
code: /--
  `withLCtx lctx localInsts k` replaces the local context and local instances, and then executes `k`.
  The local context and instances are restored after executing `k`.
  This method assumes that the local instances in `localInsts` are in the local context `lctx`.
-/
def withLCtx (lctx : LocalContext) (localInsts : LocalInstances) : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withMVarContextImp
code: private def withMVarContextImp (mvarId : MVarId) (x : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.MVarId.withContext
code: /--
  Execute `x` using the given metavariable `LocalContext` and `LocalInstances`.
  The type class resolution cache is flushed when executing `x` if its `LocalInstances` are
  different from the current ones. -/
def _root_.Lean.MVarId.withContext (mvarId : MVarId) : n α → n α 
goal: n α → n α

full_name: Lean.Meta.withMVarContext
code: @[deprecated MVarId.withContext (since := "2022-07-15")]
def withMVarContext (mvarId : MVarId) : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.withMCtxImp
code: private def withMCtxImp (mctx : MetavarContext) (x : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.withMCtx
code: /--
  `withMCtx mctx k` replaces the metavariable context and then executes `k`.
  The metavariable context is restored after executing `k`.

  This method is used to implement the type class resolution procedure. -/
def withMCtx (mctx : MetavarContext) : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.approxDefEqImp
code: @[inline] private def approxDefEqImp (x : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.approxDefEq
code: /-- Execute `x` using approximate unification: `foApprox`, `ctxApprox` and `quasiPatternApprox`.  -/
@[inline] def approxDefEq : n α → n α 
goal: n α → n α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.fullApproxDefEqImp
code: @[inline] private def fullApproxDefEqImp (x : MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.fullApproxDefEq
code: /--
  Similar to `approxDefEq`, but uses all available approximations.
  We don't use `constApprox` by default at `approxDefEq` because it often produces undesirable solution for monadic code.
  For example, suppose we have `pure (x > 0)` which has type `?m Prop`. We also have the goal `[Pure ?m]`.
  Now, assume the expected type is `IO Bool`. Then, the unification constraint `?m Prop =?= IO Bool` could be solved
  as `?m := fun _ => IO Bool` using `constApprox`, but this spurious solution would generate a failure when we try to
  solve `[Pure (fun _ => IO Bool)]` -/
@[inline] def fullApproxDefEq : n α → n α 
goal: n α → n α

full_name: Lean.Meta.normalizeLevel
code: /-- Instantiate assigned universe metavariables in `u`, and then normalize it. -/
def normalizeLevel (u : Level) : MetaM Level 
goal: Lean.MetaM Lean.Level

full_name: Lean.Meta.whnfR
code: /-- `whnf` with reducible transparency.-/
def whnfR (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.whnfD
code: /-- `whnf` with default transparency.-/
def whnfD (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.whnfI
code: /-- `whnf` with instances transparency.-/
def whnfI (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.whnfAtMostI
code: /-- `whnf` with at most instances transparency. -/
def whnfAtMostI (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.setInlineAttribute
code: /--
  Mark declaration `declName` with the attribute `[inline]`.
  This method does not check whether the given declaration is a definition.

  Recall that this attribute can only be set in the same module where `declName` has been declared.
-/
def setInlineAttribute (declName : Name) (kind := Compiler.InlineAttributeKind.inline): MetaM Unit 
goal: Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.instantiateForallAux
code: private partial def instantiateForallAux (ps : Array Expr) (i : Nat) (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.instantiateForall
code: /-- Given `e` of the form `forall (a_1 : A_1) ... (a_n : A_n), B[a_1, ..., a_n]` and `p_1 : A_1, ... p_n : A_n`, return `B[p_1, ..., p_n]`. -/
def instantiateForall (e : Expr) (ps : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.instantiateLambdaAux
code: private partial def instantiateLambdaAux (ps : Array Expr) (i : Nat) (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.instantiateLambda
code: /-- Given `e` of the form `fun (a_1 : A_1) ... (a_n : A_n) => t[a_1, ..., a_n]` and `p_1 : A_1, ... p_n : A_n`, return `t[p_1, ..., p_n]`.
   It uses `whnf` to reduce `e` if it is not a lambda -/
def instantiateLambda (e : Expr) (ps : Array Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.ppExprWithInfos
code: /-- Pretty-print the given expression. -/
def ppExprWithInfos (e : Expr) : MetaM FormatWithInfos 
goal: Lean.MetaM Lean.FormatWithInfos

full_name: Lean.Meta.ppExpr
code: /-- Pretty-print the given expression. -/
def ppExpr (e : Expr) : MetaM Format 
goal: Lean.MetaM Lean.Format

full_name: Lean.Meta.orElse
code: @[inline] protected def orElse (x : MetaM α) (y : Unit → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.instOrElseMetaM
code: instance : OrElse (MetaM α) 
goal: OrElse (Lean.MetaM α)

full_name: Lean.Meta.instAlternativeMetaM
code: instance : Alternative MetaM 
goal: Alternative Lean.MetaM

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.orelseMergeErrorsImp
code: @[inline] private def orelseMergeErrorsImp (x y : MetaM α)
    (mergeRef : Syntax → Syntax → Syntax := fun r₁ _ => r₁)
    (mergeMsg : MessageData → MessageData → MessageData := fun m₁ m₂ => m₁ ++ Format.line ++ m₂) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.orelseMergeErrors
code: /--
  Similar to `orelse`, but merge errors. Note that internal errors are not caught.
  The default `mergeRef` uses the `ref` (position information) for the first message.
  The default `mergeMsg` combines error messages using `Format.line ++ Format.line` as a separator. -/
@[inline] def orelseMergeErrors [MonadControlT MetaM m] [Monad m] (x y : m α)
    (mergeRef : Syntax → Syntax → Syntax := fun r₁ _ => r₁)
    (mergeMsg : MessageData → MessageData → MessageData := fun m₁ m₂ => m₁ ++ Format.line ++ Format.line ++ m₂) : m α 
goal: m α

full_name: Lean.Meta.mapErrorImp
code: /-- Execute `x`, and apply `f` to the produced error message -/
def mapErrorImp (x : MetaM α) (f : MessageData → MessageData) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.mapError
code: @[inline] def mapError [MonadControlT MetaM m] [Monad m] (x : m α) (f : MessageData → MessageData) : m α 
goal: m α

full_name: Lean.Meta.sortFVarIds
code: /--
  Sort free variables using an order `x < y` iff `x` was defined before `y`.
  If a free variable is not in the local context, we use their id. -/
def sortFVarIds (fvarIds : Array FVarId) : MetaM (Array FVarId) 
goal: Lean.MetaM (Array Lean.FVarId)

full_name: Lean.Meta.isInductivePredicate
code: /-- Return `true` if `declName` is an inductive predicate. That is, `inductive` type in `Prop`. -/
def isInductivePredicate (declName : Name) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isListLevelDefEqAux
code: def isListLevelDefEqAux : List Level → List Level → MetaM Bool
  
goal: List Lean.Level → List Lean.Level → Lean.MetaM Bool

full_name: Lean.Meta.getNumPostponed
code: def getNumPostponed : MetaM Nat 
goal: Lean.MetaM Nat

full_name: Lean.Meta.getResetPostponed
code: def getResetPostponed : MetaM (PersistentArray PostponedEntry) 
goal: Lean.MetaM (Lean.PersistentArray Lean.Meta.PostponedEntry)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.exposeRelevantUniverses
code: /-- Annotate any constant and sort in `e` that satisfies `p` with `pp.universes true` -/
private def exposeRelevantUniverses (e : Expr) (p : Level → Bool) : Expr 
goal: Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.mkLeveErrorMessageCore
code: private def mkLeveErrorMessageCore (header : String) (entry : PostponedEntry) : MetaM MessageData 
goal: Lean.MetaM Lean.MessageData

full_name: Lean.Meta.mkLevelStuckErrorMessage
code: def mkLevelStuckErrorMessage (entry : PostponedEntry) : MetaM MessageData 
goal: Lean.MetaM Lean.MessageData

full_name: Lean.Meta.mkLevelErrorMessage
code: def mkLevelErrorMessage (entry : PostponedEntry) : MetaM MessageData 
goal: Lean.MetaM Lean.MessageData

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Basic.0.Lean.Meta.processPostponedStep
code: private def processPostponedStep (exceptionOnFailure : Bool) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.processPostponed
code: partial def processPostponed (mayPostpone : Bool := true) (exceptionOnFailure := false) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.processPostponed.loop
code: partial def processPostponed (mayPostpone : Bool := true) (exceptionOnFailure := false) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.checkpointDefEq
code: /--
  `checkpointDefEq x` executes `x` and process all postponed universe level constraints produced by `x`.
  We keep the modifications only if `processPostponed` return true and `x` returned `true`.

  If `mayPostpone == false`, all new postponed universe level constraints must be solved before returning.
  We currently try to postpone universe constraints as much as possible, even when by postponing them we
  are not sure whether `x` really succeeded or not.
-/
@[specialize] def checkpointDefEq (x : MetaM Bool) (mayPostpone : Bool := true) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isLevelDefEq
code: /--
  Determines whether two universe level expressions are definitionally equal to each other.
-/
def isLevelDefEq (u v : Level) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isExprDefEq
code: /-- See `isDefEq`. -/
def isExprDefEq (t s : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isDefEq
code: /--
  Determines whether two expressions are definitionally equal to each other.

  To control how metavariables are assigned and unified, metavariables and their context have a "depth".
  Given a metavariable `?m` and a `MetavarContext` `mctx`, `?m` is not assigned if `?m.depth != mctx.depth`.
  The combinator `withNewMCtxDepth x` will bump the depth while executing `x`.
  So, `withNewMCtxDepth (isDefEq a b)` is `isDefEq` without any mvar assignment happening
  whereas `isDefEq a b` will assign any metavariables of the current depth in `a` and `b` to unify them.

  For matching (where only mvars in `b` should be assigned), we create the term inside the `withNewMCtxDepth`.
  For an example, see [Lean.Meta.Simp.tryTheoremWithExtraArgs?](https://github.com/leanprover/lean4/blob/master/src/Lean/Meta/Tactic/Simp/Rewrite.lean#L100-L106)
 -/
abbrev isDefEq (t s : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isExprDefEqGuarded
code: def isExprDefEqGuarded (a b : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isDefEqGuarded
code: /-- Similar to `isDefEq`, but returns `false` if an exception has been thrown. -/
abbrev isDefEqGuarded (t s : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.isDefEqNoConstantApprox
code: def isDefEqNoConstantApprox (t s : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.MVarId.checkedAssign
code: /-- Shorthand for `isDefEq (mkMVar mvarId) val` -/
def _root_.Lean.MVarId.checkedAssign (mvarId : MVarId) (val : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.etaExpand
code: /--
  Eta expand the given expression.
  Example:
  ```
  etaExpand (mkConst ``Nat.add)
  ```
  produces `fun x y => Nat.add x y`
-/
def etaExpand (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.instantiateMVarsIfMVarApp
code: /--
If `e` is of the form `?m ...` instantiate metavars
-/
def instantiateMVarsIfMVarApp (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.Basic._hyg.17020
code: builtin_initialize
  registerTraceClass `Meta.isLevelDefEq.postponed
goal: IO Unit