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 = x y | x A y A F x R F y F x = F y x S y
fnwe.2 φ F : A B
fnwe.3 φ R We B
fnwe.4 φ S We A
fnwe.5 φ F w V
Assertion fnwe φ T We A

Proof

Step Hyp Ref Expression
1 fnwe.1 T = x y | x A y A F x R F y F x = F y x S y
2 fnwe.2 φ F : A B
3 fnwe.3 φ R We B
4 fnwe.4 φ S We A
5 fnwe.5 φ F w V
6 eqid u v | u B × A v B × A 1 st u R 1 st v 1 st u = 1 st v 2 nd u S 2 nd v = u v | u B × A v B × A 1 st u R 1 st v 1 st u = 1 st v 2 nd u S 2 nd v
7 eqid z A F z z = z A F z z
8 1 2 3 4 5 6 7 fnwelem φ T We A