File: .lake/packages/lean4/src/lean/Lean/Meta/Match/CaseValues.lean

full_name: Lean.Meta.CaseValueSubgoal.subst
code: structure CaseValueSubgoal where
  mvarId : MVarId
  newH   : FVarId
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Lean.Meta.FVarSubst

full_name: Lean.Meta.CaseValueSubgoal.newH
code: structure CaseValueSubgoal where
  mvarId : MVarId
  newH   : FVarId
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Lean.FVarId

full_name: Lean.Meta.CaseValueSubgoal
code: structure CaseValueSubgoal where
  mvarId : MVarId
  newH   : FVarId
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Type

full_name: Lean.Meta.instInhabitedCaseValueSubgoal
code: structure CaseValueSubgoal where
  mvarId : MVarId
  newH   : FVarId
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Inhabited Lean.Meta.CaseValueSubgoal

full_name: Lean.Meta.CaseValueSubgoal.mvarId
code: structure CaseValueSubgoal where
  mvarId : MVarId
  newH   : FVarId
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Lean.MVarId

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.Match.CaseValues.0.Lean.Meta.caseValueAux
code: /--
  Split goal `... |- C x` into two subgoals
  `..., (h : x = value)  |- C value`
  `..., (h : x != value) |- C x`
  where `fvarId` is `x`s id.
  The type of `x` must have decidable equality.

  Remark: `subst` field of the second subgoal is equal to the input `subst`. -/
private def caseValueAux (mvarId : MVarId) (fvarId : FVarId) (value : Expr) (hName : Name := `h) (subst : FVarSubst := {})
    : MetaM (CaseValueSubgoal × CaseValueSubgoal) 
goal: Lean.MetaM (Lean.Meta.CaseValueSubgoal × Lean.Meta.CaseValueSubgoal)

full_name: Lean.Meta.caseValue
code: def caseValue (mvarId : MVarId) (fvarId : FVarId) (value : Expr) : MetaM (CaseValueSubgoal × CaseValueSubgoal) 
goal: Lean.MetaM (Lean.Meta.CaseValueSubgoal × Lean.Meta.CaseValueSubgoal)

full_name: Lean.Meta.CaseValuesSubgoal.subst
code: structure CaseValuesSubgoal where
  mvarId : MVarId
  newHs  : Array FVarId := #[]
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Lean.Meta.FVarSubst

full_name: Lean.Meta.CaseValuesSubgoal
code: structure CaseValuesSubgoal where
  mvarId : MVarId
  newHs  : Array FVarId := #[]
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Type

full_name: Lean.Meta.instInhabitedCaseValuesSubgoal
code: structure CaseValuesSubgoal where
  mvarId : MVarId
  newHs  : Array FVarId := #[]
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Inhabited Lean.Meta.CaseValuesSubgoal

full_name: Lean.Meta.CaseValuesSubgoal.mvarId
code: structure CaseValuesSubgoal where
  mvarId : MVarId
  newHs  : Array FVarId := #[]
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Lean.MVarId

full_name: Lean.Meta.CaseValuesSubgoal.newHs
code: structure CaseValuesSubgoal where
  mvarId : MVarId
  newHs  : Array FVarId := #[]
  subst  : FVarSubst := {}
  deriving Inhabited
goal: Array Lean.FVarId

full_name: Lean.Meta.caseValues.loop
code: /--
  Split goal `... |- C x` into values.size + 1 subgoals
  1) `..., (h_1 : x = value[0])  |- C value[0]`
  ...
  n) `..., (h_n : x = value[n - 1])  |- C value[n - 1]`
  n+1) `..., (h_1 : x != value[0]) ... (h_n : x != value[n-1]) |- C x`
  where `n = values.size`
  where `fvarId` is `x`s id.
  The type of `x` must have decidable equality.

  Remark: the last subgoal is for the "else" catchall case, and its `subst` is `{}`.
  Remark: the field `newHs` has size 1 forall but the last subgoal.

  If `substNewEqs = true`, then the new `h_i` equality hypotheses are substituted in the first `n` cases.
-/
def caseValues (mvarId : MVarId) (fvarId : FVarId) (values : Array Expr) (hNamePrefix := `h) (substNewEqs := false) : MetaM (Array CaseValuesSubgoal) 
goal: Nat →
  Lean.MVarId →
    List Lean.Expr →
      Array Lean.FVarId → Array Lean.Meta.CaseValuesSubgoal → Lean.MetaM (Array Lean.Meta.CaseValuesSubgoal)

full_name: Lean.Meta.caseValues
code: /--
  Split goal `... |- C x` into values.size + 1 subgoals
  1) `..., (h_1 : x = value[0])  |- C value[0]`
  ...
  n) `..., (h_n : x = value[n - 1])  |- C value[n - 1]`
  n+1) `..., (h_1 : x != value[0]) ... (h_n : x != value[n-1]) |- C x`
  where `n = values.size`
  where `fvarId` is `x`s id.
  The type of `x` must have decidable equality.

  Remark: the last subgoal is for the "else" catchall case, and its `subst` is `{}`.
  Remark: the field `newHs` has size 1 forall but the last subgoal.

  If `substNewEqs = true`, then the new `h_i` equality hypotheses are substituted in the first `n` cases.
-/
def caseValues (mvarId : MVarId) (fvarId : FVarId) (values : Array Expr) (hNamePrefix := `h) (substNewEqs := false) : MetaM (Array CaseValuesSubgoal) 
goal: Lean.MetaM (Array Lean.Meta.CaseValuesSubgoal)