wlog_tac : term quotation -> term quotation list -> tactic
If the goal is hyp ?- t then the first subgoal is hyp, !vars. ant ==> t, ~P ?- t where ant is the conjunction of P and those hypotheses of the original subgoal where any variable in the user-provided list occurs free. The universal quantification is over the variables in the user-provided list plus any variable that appears free in P or t and is not a local constant. For convenience ~P is always added to the assumptions in the first subgoal because the case for P follows immediately from the hypothesis. Passing a non-empty list of variables allows to quantify over local constants in the hypothesis !vars. ant ==> t.
Detailed description: Given wlog_tac q vars_q let asm ?- c be the the goal. q is parsed in the goal context to a proposition P. vars_q are parsed to variables in the goal context. Let efv (effectively free variables) be the free variables of P and c that are not free in the assumptions and are not in vars from left to right and first P, then c. Let gen_vars be vars @ efv. Let asm' be the elements of asm in which any of vars is a free variable. Let ant be the result of splicing p :: asm'. The first subgoal is asm, (!(gen_vars). ant ==> c), ~P ?- c. The proposition P is added to the assumptions with strip_assume_tac. If this generates subgoals (as is usually the case), then those subgoals follow.
> g(`ABS_DIFF x y + ABS_DIFF y z <= ABS_DIFF x z`); ... > e(wlog_tac `x <= z` []); val it = ABS_DIFF x y + ABS_DIFF y z <= ABS_DIFF x z ------------------------------------ x <= z ABS_DIFF x y + ABS_DIFF y z <= ABS_DIFF x z ------------------------------------ 0. !x z y. x <= z ==> ABS_DIFF x y + ABS_DIFF y z <= ABS_DIFF x z 1. ~(x <= z) 2 subgoals : proof
> g`MAX x y <= z <=> x <= z /\ y <= z` ... > e(wlog_tac `x <= y` []); val it = MAX x y <= z <=> x <= z /\ y <= z ------------------------------------ x <= y MAX x y <= z <=> x <= z /\ y <= z ------------------------------------ 0. !x y z. x <= y ==> (MAX x y <= z <=> x <= z /\ y <= z) 1. ~(x <= y) 2 subgoals : proof