File: .lake/packages/lean4/src/lean/Init/Coe.lean

full_name: Coe
code: /--
`Coe α β` is the typeclass for coercions from `α` to `β`. It can be transitively
chained with other `Coe` instances, and coercion is automatically used when
`x` has type `α` but it is used in a context where `β` is expected.
You can use the `↑x` operator to explicitly trigger coercion.
-/
class Coe (α : semiOutParam (Sort u)) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: Coe.coe
code: /--
`Coe α β` is the typeclass for coercions from `α` to `β`. It can be transitively
chained with other `Coe` instances, and coercion is automatically used when
`x` has type `α` but it is used in a context where `β` is expected.
You can use the `↑x` operator to explicitly trigger coercion.
-/
class Coe (α : semiOutParam (Sort u)) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: CoeTC
code: /--
Auxiliary class implementing `Coe*`.
Users should generally not implement this directly.
-/
class CoeTC (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: CoeTC.coe
code: /--
Auxiliary class implementing `Coe*`.
Users should generally not implement this directly.
-/
class CoeTC (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: instCoeTCOfCoe
code: instance [Coe β γ] [CoeTC α β] : CoeTC α γ 
goal: CoeTC α γ

full_name: instCoeTCOfCoe_1
code: instance [Coe α β] : CoeTC α β 
goal: CoeTC α β

full_name: instCoeTC
code: instance : CoeTC α α 
goal: CoeTC α α

full_name: CoeOut
code: /--
`CoeOut α β` is for coercions that are applied from left-to-right.
-/
class CoeOut (α : Sort u) (β : semiOutParam (Sort v)) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: CoeOut.coe
code: /--
`CoeOut α β` is for coercions that are applied from left-to-right.
-/
class CoeOut (α : Sort u) (β : semiOutParam (Sort v)) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: CoeOTC.coe
code: /--
Auxiliary class implementing `CoeOut* Coe*`.
Users should generally not implement this directly.
-/
class CoeOTC (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: CoeOTC
code: /--
Auxiliary class implementing `CoeOut* Coe*`.
Users should generally not implement this directly.
-/
class CoeOTC (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: instCoeOTCOfCoeOut
code: instance [CoeOut α β] [CoeOTC β γ] : CoeOTC α γ 
goal: CoeOTC α γ

full_name: instCoeOTCOfCoeTC
code: instance [CoeTC α β] : CoeOTC α β 
goal: CoeOTC α β

full_name: instCoeOTC
code: instance : CoeOTC α α 
goal: CoeOTC α α

full_name: CoeHead
code: /--
`CoeHead α β` is for coercions that are applied from left-to-right at most once
at beginning of the coercion chain.
-/
class CoeHead (α : Sort u) (β : semiOutParam (Sort v)) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: CoeHead.coe
code: /--
`CoeHead α β` is for coercions that are applied from left-to-right at most once
at beginning of the coercion chain.
-/
class CoeHead (α : Sort u) (β : semiOutParam (Sort v)) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: CoeHTC
code: /--
Auxiliary class implementing `CoeHead CoeOut* Coe*`.
Users should generally not implement this directly.
-/
class CoeHTC (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: CoeHTC.coe
code: /--
Auxiliary class implementing `CoeHead CoeOut* Coe*`.
Users should generally not implement this directly.
-/
class CoeHTC (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: instCoeHTCOfCoeHeadOfCoeOTC
code: instance [CoeHead α β] [CoeOTC β γ] : CoeHTC α γ 
goal: CoeHTC α γ

full_name: instCoeHTCOfCoeOTC
code: instance [CoeOTC α β] : CoeHTC α β 
goal: CoeHTC α β

full_name: instCoeHTC
code: instance : CoeHTC α α 
goal: CoeHTC α α

full_name: CoeTail
code: /--
`CoeTail α β` is for coercions that can only appear at the end of a
sequence of coercions. That is, `α` can be further coerced via `Coe σ α` and
`CoeHead τ σ` instances but `β` will only be the expected type of the expression.
-/
class CoeTail (α : semiOutParam (Sort u)) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: CoeTail.coe
code: /--
`CoeTail α β` is for coercions that can only appear at the end of a
sequence of coercions. That is, `α` can be further coerced via `Coe σ α` and
`CoeHead τ σ` instances but `β` will only be the expected type of the expression.
-/
class CoeTail (α : semiOutParam (Sort u)) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: CoeHTCT.coe
code: /--
Auxiliary class implementing `CoeHead* Coe* CoeTail?`.
Users should generally not implement this directly.
-/
class CoeHTCT (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: α → β

full_name: CoeHTCT
code: /--
Auxiliary class implementing `CoeHead* Coe* CoeTail?`.
Users should generally not implement this directly.
-/
class CoeHTCT (α : Sort u) (β : Sort v) where
  /-- Coerces a value of type `α` to type `β`. Accessible by the notation `↑x`,
  or by double type ascription `((x : α) : β)`. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: instCoeHTCTOfCoeTailOfCoeHTC
code: instance [CoeTail β γ] [CoeHTC α β] : CoeHTCT α γ 
goal: CoeHTCT α γ

full_name: instCoeHTCTOfCoeHTC
code: instance [CoeHTC α β] : CoeHTCT α β 
goal: CoeHTCT α β

full_name: instCoeHTCT
code: instance : CoeHTCT α α 
goal: CoeHTCT α α

full_name: CoeDep.coe
code: /--
`CoeDep α (x : α) β` is a typeclass for dependent coercions, that is, the type `β`
can depend on `x` (or rather, the value of `x` is available to typeclass search
so an instance that relates `β` to `x` is allowed).

Dependent coercions do not participate in the transitive chaining process of
regular coercions: they must exactly match the type mismatch on both sides.
-/
class CoeDep (α : Sort u) (_ : α) (β : Sort v) where
  /-- The resulting value of type `β`. The input `x : α` is a parameter to
  the type class, so the value of type `β` may possibly depend on additional
  typeclasses on `x`. -/
  coe : β
goal: (x : α) → {β : Sort v} → [self : CoeDep α x β] → β

full_name: CoeDep
code: /--
`CoeDep α (x : α) β` is a typeclass for dependent coercions, that is, the type `β`
can depend on `x` (or rather, the value of `x` is available to typeclass search
so an instance that relates `β` to `x` is allowed).

Dependent coercions do not participate in the transitive chaining process of
regular coercions: they must exactly match the type mismatch on both sides.
-/
class CoeDep (α : Sort u) (_ : α) (β : Sort v) where
  /-- The resulting value of type `β`. The input `x : α` is a parameter to
  the type class, so the value of type `β` may possibly depend on additional
  typeclasses on `x`. -/
  coe : β
goal: α → Sort v → Sort (max 1 v)

full_name: CoeT
code: /--
`CoeT` is the core typeclass which is invoked by Lean to resolve a type error.
It can also be triggered explicitly with the notation `↑x` or by double type
ascription `((x : α) : β)`.

A `CoeT` chain has the grammar `CoeHead? CoeOut* Coe* CoeTail? | CoeDep`.
-/
class CoeT (α : Sort u) (_ : α) (β : Sort v) where
  /-- The resulting value of type `β`. The input `x : α` is a parameter to
  the type class, so the value of type `β` may possibly depend on additional
  typeclasses on `x`. -/
  coe : β
goal: α → Sort v → Sort (max 1 v)

full_name: CoeT.coe
code: /--
`CoeT` is the core typeclass which is invoked by Lean to resolve a type error.
It can also be triggered explicitly with the notation `↑x` or by double type
ascription `((x : α) : β)`.

A `CoeT` chain has the grammar `CoeHead? CoeOut* Coe* CoeTail? | CoeDep`.
-/
class CoeT (α : Sort u) (_ : α) (β : Sort v) where
  /-- The resulting value of type `β`. The input `x : α` is a parameter to
  the type class, so the value of type `β` may possibly depend on additional
  typeclasses on `x`. -/
  coe : β
goal: (x : α) → {β : Sort v} → [self : CoeT α x β] → β

full_name: instCoeTOfCoeHTCT
code: instance [CoeHTCT α β] : CoeT α a β 
goal: CoeT α a β

full_name: instCoeTOfCoeDep
code: instance [CoeDep α a β] : CoeT α a β 
goal: CoeT α a β

full_name: instCoeT
code: instance : CoeT α a α 
goal: CoeT α a α

full_name: CoeFun
code: /--
`CoeFun α (γ : α → Sort v)` is a coercion to a function. `γ a` should be a
(coercion-to-)function type, and this is triggered whenever an element
`f : α` appears in an application like `f x`, which would not make sense since
`f` does not have a function type.
`CoeFun` instances apply to `CoeOut` as well.
-/
class CoeFun (α : Sort u) (γ : outParam (α → Sort v)) where
  /-- Coerces a value `f : α` to type `γ f`, which should be either be a
  function type or another `CoeFun` type, in order to resolve a mistyped
  application `f x`. -/
  coe : (f : α) → γ f
goal: Sort (max (max 1 u) v)

full_name: CoeFun.coe
code: /--
`CoeFun α (γ : α → Sort v)` is a coercion to a function. `γ a` should be a
(coercion-to-)function type, and this is triggered whenever an element
`f : α` appears in an application like `f x`, which would not make sense since
`f` does not have a function type.
`CoeFun` instances apply to `CoeOut` as well.
-/
class CoeFun (α : Sort u) (γ : outParam (α → Sort v)) where
  /-- Coerces a value `f : α` to type `γ f`, which should be either be a
  function type or another `CoeFun` type, in order to resolve a mistyped
  application `f x`. -/
  coe : (f : α) → γ f
goal: γ f

full_name: instCoeOutOfCoeFun
code: instance [CoeFun α fun _ => β] : CoeOut α β 
goal: CoeOut α β

full_name: CoeSort.coe
code: /--
`CoeSort α β` is a coercion to a sort. `β` must be a universe, and this is
triggered when `a : α` appears in a place where a type is expected, like
`(x : a)` or `a → a`.
`CoeSort` instances apply to `CoeOut` as well.
-/
class CoeSort (α : Sort u) (β : outParam (Sort v)) where
  /-- Coerces a value of type `α` to `β`, which must be a universe. -/
  coe : α → β
goal: α → β

full_name: CoeSort
code: /--
`CoeSort α β` is a coercion to a sort. `β` must be a universe, and this is
triggered when `a : α` appears in a place where a type is expected, like
`(x : a)` or `a → a`.
`CoeSort` instances apply to `CoeOut` as well.
-/
class CoeSort (α : Sort u) (β : outParam (Sort v)) where
  /-- Coerces a value of type `α` to `β`, which must be a universe. -/
  coe : α → β
goal: Sort (max (max 1 u) v)

full_name: instCoeOutOfCoeSort
code: instance [CoeSort α β] : CoeOut α β 
goal: CoeOut α β

full_name: coeNotation
code: /--
`↑x` represents a coercion, which converts `x` of type `α` to type `β`, using
typeclasses to resolve a suitable conversion function. You can often leave the
`↑` off entirely, since coercion is triggered implicitly whenever there is a
type error, but in ambiguous cases it can be useful to use `↑` to disambiguate
between e.g. `↑x + ↑y` and `↑(x + y)`.
-/
syntax:1024 (name := coeNotation) "↑" term:1024 : term
goal: Lean.ParserDescr

full_name: coeFunNotation
code: /-- `⇑ t` coerces `t` to a function. -/
syntax:1024 (name := coeFunNotation) "⇑" term:1024 : term
goal: Lean.ParserDescr

full_name: coeSortNotation
code: /-- `↥ t` coerces `t` to a type. -/
syntax:1024 (name := coeSortNotation) "↥" term:1024 : term
goal: Lean.ParserDescr

full_name: boolToProp
code: instance boolToProp : Coe Bool Prop 
goal: Coe Bool Prop

full_name: boolToSort
code: instance boolToSort : CoeSort Bool Prop 
goal: CoeSort Bool Prop

full_name: decPropToBool
code: instance decPropToBool (p : Prop) [Decidable p] : CoeDep Prop p Bool 
goal: CoeDep Prop p Bool

full_name: optionCoe
code: instance optionCoe {α : Type u} : Coe α (Option α) 
goal: Coe α (Option α)

full_name: subtypeCoe
code: instance subtypeCoe {α : Sort u} {p : α → Prop} : CoeOut (Subtype p) α 
goal: CoeOut (Subtype p) α

full_name: Lean.Internal.liftCoeM
code: /--
Helper definition used by the elaborator. It is not meant to be used directly by users.

This is used for coercions between monads, in the case where we want to apply
a monad lift and a coercion on the result type at the same time.
-/
@[coe_decl] abbrev Lean.Internal.liftCoeM {m : Type u → Type v} {n : Type u → Type w} {α β : Type u}
    [MonadLiftT m n] [∀ a, CoeT α a β] [Monad n] (x : m α) : n β 
goal: n β

full_name: Lean.Internal.coeM
code: /--
Helper definition used by the elaborator. It is not meant to be used directly by users.

This is used for coercing the result type under a monad.
-/
@[coe_decl] abbrev Lean.Internal.coeM {m : Type u → Type v} {α β : Type u}
    [∀ a, CoeT α a β] [Monad m] (x : m α) : m β 
goal: m β