Metamath Proof Explorer


Theorem fnwe

Description: A variant on lexicographic order, which sorts first by some function of the base set, and then by a "backup" well-ordering when the function value is equal on both elements. (Contributed by Mario Carneiro, 10-Mar-2013) (Revised by Mario Carneiro, 18-Nov-2014)

Ref Expression
Hypotheses fnwe.1 T=xy|xAyAFxRFyFx=FyxSy
fnwe.2 φF:AB
fnwe.3 φRWeB
fnwe.4 φSWeA
fnwe.5 φFwV
Assertion fnwe φTWeA

Proof

Step Hyp Ref Expression
1 fnwe.1 T=xy|xAyAFxRFyFx=FyxSy
2 fnwe.2 φF:AB
3 fnwe.3 φRWeB
4 fnwe.4 φSWeA
5 fnwe.5 φFwV
6 eqid uv|uB×AvB×A1stuR1stv1stu=1stv2nduS2ndv=uv|uB×AvB×A1stuR1stv1stu=1stv2nduS2ndv
7 eqid zAFzz=zAFzz
8 1 2 3 4 5 6 7 fnwelem φTWeA