Without loss of generality tactic #
The tactic wlog h : P
will add an assumption h : P
to the main goal,
and add a new goal that requires showing that the case h : ¬ P
can be reduced to the case
where P
holds (typically by symmetry).
The new goal will be placed at the top of the goal stack.
- reductionGoal : Lean.MVarId
The
reductionGoal
requires showing that the caseh : ¬ P
can be reduced to the case whereP
holds. It has two additional assumptions in its context:h : ¬ P
: the assumption thatP
does not holdH
: the statement that in the original contextP
suffices to prove the goal.
- reductionFVarIds : Lean.FVarId × Lean.FVarId
The pair
(HFVarId, negHypFVarId)
ofFVarIds
forreductionGoal
:HFVarId
:H
, the statement that in the original contextP
suffices to prove the goal.negHypFVarId
:h : ¬ P
, the assumption thatP
does not hold
- hypothesisGoal : Lean.MVarId
The original goal with the additional assumption
h : P
. - hypothesisFVarId : Lean.FVarId
The
FVarId
of the hypothesish
inhypothesisGoal
- revertedFVarIds : Array Lean.FVarId
The array of
FVarId
s that was reverted to produce the reduction hypothesisH
inreductionGoal
, which are still present in the context ofreductionGoal
(but not necessarilyhypothesisGoal
).
The result of running wlog
on a goal.
Instances For
wlog goal h P xs H
will return two goals: the hypothesisGoal
, which adds an assumption
h : P
to the context of goal
, and the reductionGoal
, which requires showing that the case
h : ¬ P
can be reduced to the case where P
holds (typically by symmetry).
In reductionGoal
, there will be two additional assumptions:
h : ¬ P
: the assumption thatP
does not holdH
: which is the statement that in the old contextP
suffices to prove the goal. IfH
isnone
, the namethis
is used.
If xs
is none
, all hypotheses are reverted to produce the reduction goal's hypothesis H
.
Otherwise, the xs
are elaborated to hypotheses in the context of goal
, and only those
hypotheses are reverted (and any that depend on them).
If h
is none
, the hypotheses of types P
and ¬ P
in both branches will be inaccessible.
Equations
- One or more equations did not get rendered due to their size.
Instances For
wlog h : P
will add an assumption h : P
to the main goal, and add a side goal that requires
showing that the case h : ¬ P
can be reduced to the case where P
holds (typically by symmetry).
The side goal will be at the top of the stack. In this side goal, there will be two additional assumptions:
h : ¬ P
: the assumption thatP
does not holdthis
: which is the statement that in the old contextP
suffices to prove the goal. By default, the namethis
is used, but the idiomwith H
can be added to specify the name:wlog h : P with H
.
Typically, it is useful to use the variant wlog h : P generalizing x y
,
to revert certain parts of the context before creating the new goal.
In this way, the wlog-claim this
can be applied to x
and y
in different orders
(exploiting symmetry, which is the typical use case).
By default, the entire context is reverted.
Equations
- One or more equations did not get rendered due to their size.