File: .lake/packages/batteries/Batteries/Tactic/Init.lean

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___macroRules_Batteries_Tactic_tactic__1»
code: macro "_" : tactic => `(tactic| {})
goal: Lean.Macro

full_name: Batteries.Tactic.tactic_
code: macro "_" : tactic => `(tactic| {})
goal: Lean.ParserDescr

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___elabRules_Batteries_Tactic_exacts_1»
code: /--
Like `exact`, but takes a list of terms and checks that all goals are discharged after the tactic.
-/
elab (name := exacts) "exacts " "[" hs:term,* "]" : tactic => do
  for stx in hs.getElems do
    evalTactic (← `(tactic| exact $stx))
  evalTactic (← `(tactic| done))
goal: Lean.Elab.Tactic.Tactic

full_name: Batteries.Tactic.exacts
code: /--
Like `exact`, but takes a list of terms and checks that all goals are discharged after the tactic.
-/
elab (name := exacts) "exacts " "[" hs:term,* "]" : tactic => do
  for stx in hs.getElems do
    evalTactic (← `(tactic| exact $stx))
  evalTactic (← `(tactic| done))
goal: Lean.ParserDescr

full_name: Batteries.Tactic.byContra
code: macro (name := byContra) tk:"by_contra" e?:(ppSpace colGt binderIdent)? : tactic => do
  let e := match e? with
    | some e => match e with
      | `(binderIdent| $e:ident) => e
      | e => Unhygienic.run `(_%$e) -- HACK: hover fails without Unhygienic here
    | none => Unhygienic.run `(_%$tk)
  `(tactic| first
    | guard_target = Not _; intro $e:term
    | refine Decidable.byContradiction fun $e => ?_
    | refine Classical.byContradiction fun $e => ?_)
goal: Lean.ParserDescr

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___macroRules_Batteries_Tactic_byContra_1»
code: macro (name := byContra) tk:"by_contra" e?:(ppSpace colGt binderIdent)? : tactic => do
  let e := match e? with
    | some e => match e with
      | `(binderIdent| $e:ident) => e
      | e => Unhygienic.run `(_%$e) -- HACK: hover fails without Unhygienic here
    | none => Unhygienic.run `(_%$tk)
  `(tactic| first
    | guard_target = Not _; intro $e:term
    | refine Decidable.byContradiction fun $e => ?_
    | refine Classical.byContradiction fun $e => ?_)
goal: Lean.Macro

full_name: Batteries.Tactic.tacticAbsurd_
code: macro "absurd " h:term : tactic =>
  `(tactic| first | refine absurd ?_ $h | refine absurd $h ?_)
goal: Lean.ParserDescr

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___macroRules_Batteries_Tactic_tacticAbsurd__1»
code: macro "absurd " h:term : tactic =>
  `(tactic| first | refine absurd ?_ $h | refine absurd $h ?_)
goal: Lean.Macro

full_name: Batteries.Tactic.tacticSplit_ands
code: /-- `split_ands` applies `And.intro` until it does not make progress. -/
syntax "split_ands" : tactic
goal: Lean.ParserDescr

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___macroRules_Batteries_Tactic_tacticSplit_ands_1»
code: macro_rules | `(tactic| split_ands) => `(tactic| repeat' refine And.intro ?_ ?_)
goal: Lean.Macro

full_name: Batteries.Tactic.tacticFapply_
code: /--
`fapply e` is like `apply e` but it adds goals in the order they appear,
rather than putting the dependent goals first.
-/
elab "fapply " e:term : tactic =>
  evalApplyLikeTactic (·.apply (cfg := {newGoals := .all})) e
goal: Lean.ParserDescr

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___elabRules_Batteries_Tactic_tacticFapply__1»
code: /--
`fapply e` is like `apply e` but it adds goals in the order they appear,
rather than putting the dependent goals first.
-/
elab "fapply " e:term : tactic =>
  evalApplyLikeTactic (·.apply (cfg := {newGoals := .all})) e
goal: Lean.Elab.Tactic.Tactic

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___elabRules_Batteries_Tactic_tacticEapply__1»
code: /--
`eapply e` is like `apply e` but it does not add subgoals for variables that appear
in the types of other goals. Note that this can lead to a failure where there are
no goals remaining but there are still metavariables in the term:
```
example (h : ∀ x : Nat, x = x → True) : True := by
  eapply h
  rfl
  -- no goals
-- (kernel) declaration has metavariables '_example'
```
-/
elab "eapply " e:term : tactic =>
  evalApplyLikeTactic (·.apply (cfg := {newGoals := .nonDependentOnly})) e
goal: Lean.Elab.Tactic.Tactic

full_name: Batteries.Tactic.tacticEapply_
code: /--
`eapply e` is like `apply e` but it does not add subgoals for variables that appear
in the types of other goals. Note that this can lead to a failure where there are
no goals remaining but there are still metavariables in the term:
```
example (h : ∀ x : Nat, x = x → True) : True := by
  eapply h
  rfl
  -- no goals
-- (kernel) declaration has metavariables '_example'
```
-/
elab "eapply " e:term : tactic =>
  evalApplyLikeTactic (·.apply (cfg := {newGoals := .nonDependentOnly})) e
goal: Lean.ParserDescr

full_name: Batteries.Tactic.triv
code: /-- Deprecated variant of `trivial`. -/
elab (name := triv) "triv" : tactic => throwError "`triv` has been removed; use `trivial` instead"
goal: Lean.ParserDescr

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___elabRules_Batteries_Tactic_triv_1»
code: /-- Deprecated variant of `trivial`. -/
elab (name := triv) "triv" : tactic => throwError "`triv` has been removed; use `trivial` instead"
goal: Lean.Elab.Tactic.Tactic

full_name: Batteries.Tactic.Conv.exact
code: macro (name := Conv.exact) "exact " t:term : conv => `(conv| tactic => exact $t)
goal: Lean.ParserDescr

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___macroRules_Batteries_Tactic_Conv_exact_1»
code: macro (name := Conv.exact) "exact " t:term : conv => `(conv| tactic => exact $t)
goal: Lean.Macro

full_name: Batteries.Tactic.«_aux_.lake_packages_batteries_Batteries_Tactic_Init___macroRules_Batteries_Tactic_Conv_equals_1»
code: macro (name := Conv.equals) "equals " t:term " => " tac:tacticSeq : conv =>
  `(conv| tactic => show (_ = $t); next => $tac)
goal: Lean.Macro

full_name: Batteries.Tactic.Conv.equals
code: macro (name := Conv.equals) "equals " t:term " => " tac:tacticSeq : conv =>
  `(conv| tactic => show (_ = $t); next => $tac)
goal: Lean.ParserDescr