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

full_name: Lean.Parser.colonR
code: /-- Reducible defeq matching for `guard_hyp` types -/
syntax colonR := " : "
goal: Lean.ParserDescr

full_name: Lean.Parser.colonD
code: /-- Default-reducibility defeq matching for `guard_hyp` types -/
syntax colonD := " :~ "
goal: Lean.ParserDescr

full_name: Lean.Parser.colonS
code: /-- Syntactic matching for `guard_hyp` types -/
syntax colonS := " :ₛ "
goal: Lean.ParserDescr

full_name: Lean.Parser.colonA
code: /-- Alpha-eq matching for `guard_hyp` types -/
syntax colonA := " :ₐ "
goal: Lean.ParserDescr

full_name: Lean.Parser.colon
code: /-- The `guard_hyp` type specifier, one of `:`, `:~`, `:ₛ`, `:ₐ` -/
syntax colon := colonR <|> colonD <|> colonS <|> colonA
goal: Lean.ParserDescr

full_name: Lean.Parser.colonEqR
code: /-- Reducible defeq matching for `guard_hyp` values -/
syntax colonEqR := " := "
goal: Lean.ParserDescr

full_name: Lean.Parser.colonEqD
code: /-- Default-reducibility defeq matching for `guard_hyp` values -/
syntax colonEqD := " :=~ "
goal: Lean.ParserDescr

full_name: Lean.Parser.colonEqS
code: /-- Syntactic matching for `guard_hyp` values -/
syntax colonEqS := " :=ₛ "
goal: Lean.ParserDescr

full_name: Lean.Parser.colonEqA
code: /-- Alpha-eq matching for `guard_hyp` values -/
syntax colonEqA := " :=ₐ "
goal: Lean.ParserDescr

full_name: Lean.Parser.colonEq
code: /-- The `guard_hyp` value specifier, one of `:=`, `:=~`, `:=ₛ`, `:=ₐ` -/
syntax colonEq := colonEqR <|> colonEqD <|> colonEqS <|> colonEqA
goal: Lean.ParserDescr

full_name: Lean.Parser.equalR
code: /-- Reducible defeq matching for `guard_expr` -/
syntax equalR := " = "
goal: Lean.ParserDescr

full_name: Lean.Parser.equalD
code: /-- Default-reducibility defeq matching for `guard_expr` -/
syntax equalD := " =~ "
goal: Lean.ParserDescr

full_name: Lean.Parser.equalS
code: /-- Syntactic matching for `guard_expr` -/
syntax equalS := " =ₛ "
goal: Lean.ParserDescr

full_name: Lean.Parser.equalA
code: /-- Alpha-eq matching for `guard_expr` -/
syntax equalA := " =ₐ "
goal: Lean.ParserDescr

full_name: Lean.Parser.equal
code: /-- The `guard_expr` matching specifier, one of `=`, `=~`, `=ₛ`, `=ₐ` -/
syntax equal := equalR <|> equalD <|> equalS <|> equalA
goal: Lean.ParserDescr

full_name: Lean.Parser.Tactic.guardExpr
code: /--
Tactic to check equality of two expressions.
* `guard_expr e = e'` checks that `e` and `e'` are defeq at reducible transparency.
* `guard_expr e =~ e'` checks that `e` and `e'` are defeq at default transparency.
* `guard_expr e =ₛ e'` checks that `e` and `e'` are syntactically equal.
* `guard_expr e =ₐ e'` checks that `e` and `e'` are alpha-equivalent.

Both `e` and `e'` are elaborated then have their metavariables instantiated before the equality
check. Their types are unified (using `isDefEqGuarded`) before synthetic metavariables are
processed, which helps with default instance handling.
-/
syntax (name := guardExpr) "guard_expr " term:51 equal term : tactic
goal: Lean.ParserDescr

full_name: Lean.Parser.Tactic.guardExprConv
code: @[inherit_doc guardExpr]
syntax (name := guardExprConv) "guard_expr " term:51 equal term : conv
goal: Lean.ParserDescr

full_name: Lean.Parser.Tactic.guardTarget
code: /--
Tactic to check that the target agrees with a given expression.
* `guard_target = e` checks that the target is defeq at reducible transparency to `e`.
* `guard_target =~ e` checks that the target is defeq at default transparency to `e`.
* `guard_target =ₛ e` checks that the target is syntactically equal to `e`.
* `guard_target =ₐ e` checks that the target is alpha-equivalent to `e`.

The term `e` is elaborated with the type of the goal as the expected type, which is mostly
useful within `conv` mode.
-/
syntax (name := guardTarget) "guard_target " equal term : tactic
goal: Lean.ParserDescr

full_name: Lean.Parser.Tactic.guardTargetConv
code: @[inherit_doc guardTarget]
syntax (name := guardTargetConv) "guard_target " equal term : conv
goal: Lean.ParserDescr

full_name: Lean.Parser.Tactic.guardHyp
code: /--
Tactic to check that a named hypothesis has a given type and/or value.

* `guard_hyp h : t` checks the type up to reducible defeq,
* `guard_hyp h :~ t` checks the type up to default defeq,
* `guard_hyp h :ₛ t` checks the type up to syntactic equality,
* `guard_hyp h :ₐ t` checks the type up to alpha equality.
* `guard_hyp h := v` checks value up to reducible defeq,
* `guard_hyp h :=~ v` checks value up to default defeq,
* `guard_hyp h :=ₛ v` checks value up to syntactic equality,
* `guard_hyp h :=ₐ v` checks the value up to alpha equality.

The value `v` is elaborated using the type of `h` as the expected type.
-/
syntax (name := guardHyp)
  "guard_hyp " term:max (colon term)? (colonEq term)? : tactic
goal: Lean.ParserDescr

full_name: Lean.Parser.Tactic.guardHypConv
code: @[inherit_doc guardHyp] syntax (name := guardHypConv)
  "guard_hyp " term:max (colon term)? (colonEq term)? : conv
goal: Lean.ParserDescr

full_name: Lean.Parser.Command.guardExprCmd
code: /--
Command to check equality of two expressions.
* `#guard_expr e = e'` checks that `e` and `e'` are defeq at reducible transparency.
* `#guard_expr e =~ e'` checks that `e` and `e'` are defeq at default transparency.
* `#guard_expr e =ₛ e'` checks that `e` and `e'` are syntactically equal.
* `#guard_expr e =ₐ e'` checks that `e` and `e'` are alpha-equivalent.

This is a command version of the `guard_expr` tactic. -/
syntax (name := guardExprCmd) "#guard_expr " term:51 equal term : command
goal: Lean.ParserDescr

full_name: Lean.Parser.Command.guardCmd
code: /--
Command to check that an expression evaluates to `true`.

`#guard e` elaborates `e` ensuring its type is `Bool` then evaluates `e` and checks that
the result is `true`. The term is elaborated *without* variables declared using `variable`, since
these cannot be evaluated.

Since this makes use of coercions, so long as a proposition `p` is decidable, one can write
`#guard p` rather than `#guard decide p`. A consequence to this is that if there is decidable
equality one can write `#guard a = b`. Note that this is not exactly the same as checking
if `a` and `b` evaluate to the same thing since it uses the `DecidableEq` instance to do
the evaluation.

Note: this uses the untrusted evaluator, so `#guard` passing is *not* a proof that the
expression equals `true`. -/
syntax (name := guardCmd) "#guard " term : command
goal: Lean.ParserDescr