@@ -11,18 +11,67 @@ Authors: Leonardo de Moura
11
11
import Mathlib.Init.Data.Sigma.Basic
12
12
13
13
/-!
14
- # Facts about `PSigma.Lex` from Lean 3 core.
14
+ # Well-foundedness of orders of well-founded relations
15
+
16
+ Porting note: many declarations that were here in mathlib3 have been moved to `Init.WF`
17
+ in Lean 4 core. The ones below are all the exceptions.
15
18
-/
16
19
17
20
universe u v
18
21
19
22
namespace PSigma
20
23
24
+ section
25
+
26
+ open WellFounded
27
+
21
28
variable {α : Sort u} {β : α → Sort v} {r : α → α → Prop } {s : ∀ a : α, β a → β a → Prop }
22
29
23
- -- The lexicographical order of well founded relations is well-founded
30
+ #align psigma.lex PSigma.Lex
31
+ #align psigma.lex_accessible PSigma.lexAccessible
32
+
33
+ /-- The lexicographical order of well-founded relations is well-founded. -/
24
34
theorem lex_wf (ha : WellFounded r) (hb : ∀ x, WellFounded (s x)) : WellFounded (Lex r s) :=
25
35
WellFounded.intro fun ⟨a, b⟩ => lexAccessible (WellFounded.apply ha a) hb b
26
36
#align psigma.lex_wf PSigma.lex_wf
27
37
38
+ #align psigma.lex_ndep PSigma.lexNdep
39
+ #align psigma.lex_ndep_wf PSigma.lexNdepWf
40
+
41
+ end
42
+
43
+ section
44
+
45
+ open WellFounded
46
+
47
+ variable {α : Sort u} {β : Sort v} {r : α → α → Prop } {s : β → β → Prop }
48
+
49
+ #align psigma.rev_lex PSigma.RevLex
50
+ #align psigma.rev_lex_accessible PSigma.revLexAccessible
51
+
52
+ theorem revLex_wf (ha : WellFounded r) (hb : WellFounded s) : WellFounded (RevLex r s) :=
53
+ WellFounded.intro fun ⟨a, b⟩ => revLexAccessible (apply hb b) (WellFounded.apply ha) a
54
+ #align psigma.rev_lex_wf PSigma.revLex_wf
55
+
56
+ end
57
+
58
+ section
59
+
60
+ #align psigma.skip_left PSigma.SkipLeft
61
+
62
+ theorem skipLeft_wf (α : Type u) {β : Type v} {s : β → β → Prop } (hb : WellFounded s) :
63
+ WellFounded (SkipLeft α s) :=
64
+ revLex_wf emptyWf.wf hb
65
+ #align psigma.skip_left_wf PSigma.skipLeft_wf
66
+
67
+ #align psigma.mk_skip_left PSigma.mkSkipLeft
68
+
69
+ end
70
+
71
+ instance hasWellFounded {α : Type u} {β : α → Type v} [s₁ : WellFoundedRelation α]
72
+ [s₂ : ∀ a, WellFoundedRelation (β a)] : WellFoundedRelation (PSigma β) where
73
+ rel := Lex s₁.rel fun a => (s₂ a).rel
74
+ wf := lex_wf s₁.wf fun a => (s₂ a).wf
75
+ #align psigma.has_well_founded PSigma.hasWellFounded
76
+
28
77
end PSigma
0 commit comments