Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit ec5835d

Browse files
committed
chore(order/*): use to_dual and of_dual in statements instead of implicit coercions between and α and order_dual α (#9593)
Previously the meaning of the statement was hidden away in an invisible surprising typeclass argument. Before this change, the docs suggested the nonsensical statement that `monotone f` implies `antitone f`! ![image](https://user-images.githubusercontent.com/425260/136348562-d3ecbb85-2a54-4c13-adda-806eb150b00a.png) Most of the proof changes in this PR are a consequence of changing the interval lemmas, not the monotonicity or convexity ones.
1 parent ef46da8 commit ec5835d

File tree

14 files changed

+115
-119
lines changed

14 files changed

+115
-119
lines changed

src/analysis/convex/function.lean

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alexander Bentkamp, François Dupuis
55
-/
66
import analysis.convex.basic
7+
import order.order_dual
78
import tactic.field_simp
89
import tactic.linarith
910
import tactic.ring
@@ -70,16 +71,16 @@ convex 𝕜 s ∧
7071

7172
variables {𝕜 s f}
7273

73-
lemma convex_on.dual (hf : convex_on 𝕜 s f) : @concave_on 𝕜 E (order_dual β) _ _ _ _ _ s f := hf
74+
open order_dual (to_dual of_dual)
7475

75-
lemma concave_on.dual (hf : concave_on 𝕜 s f) : @convex_on 𝕜 E (order_dual β) _ _ _ _ _ s f := hf
76+
lemma convex_on.dual (hf : convex_on 𝕜 s f) : concave_on 𝕜 s (to_dual ∘ f) := hf
7677

77-
lemma strict_convex_on.dual (hf : strict_convex_on 𝕜 s f) :
78-
@strict_concave_on 𝕜 E (order_dual β) _ _ _ _ _ s f :=
78+
lemma concave_on.dual (hf : concave_on 𝕜 s f) : convex_on 𝕜 s (to_dual ∘ f) := hf
79+
80+
lemma strict_convex_on.dual (hf : strict_convex_on 𝕜 s f) : strict_concave_on 𝕜 s (to_dual ∘ f) :=
7981
hf
8082

81-
lemma strict_concave_on.dual (hf : strict_concave_on 𝕜 s f) :
82-
@strict_convex_on 𝕜 E (order_dual β) _ _ _ _ _ s f :=
83+
lemma strict_concave_on.dual (hf : strict_concave_on 𝕜 s f) : strict_convex_on 𝕜 s (to_dual ∘ f) :=
8384
hf
8485

8586
lemma convex_on_id {s : set β} (hs : convex 𝕜 s) : convex_on 𝕜 s id := ⟨hs, by { intros, refl }⟩

src/data/set/intervals/basic.lean

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot, Yury Kudryashov, Rémy
66
import algebra.order.group
77
import data.set.basic
88
import order.rel_iso
9+
import order.order_dual
910

1011
/-!
1112
# Intervals
@@ -31,6 +32,7 @@ universe u
3132
namespace set
3233

3334
open set
35+
open order_dual (to_dual of_dual)
3436

3537
section intervals
3638
variables {α : Type u} [preorder α] {a a₁ a₂ b b₁ b₂ x : α}
@@ -95,17 +97,17 @@ lemma left_mem_Ici : a ∈ Ici a := by simp
9597
@[simp] lemma right_mem_Ioc : b ∈ Ioc a b ↔ a < b := by simp [le_refl]
9698
lemma right_mem_Iic : a ∈ Iic a := by simp
9799

98-
@[simp] lemma dual_Ici : @Ici (order_dual α) _ a = @Iic α _ a := rfl
99-
@[simp] lemma dual_Iic : @Iic (order_dual α) _ a = @Ici α _ a := rfl
100-
@[simp] lemma dual_Ioi : @Ioi (order_dual α) _ a = @Iio α _ a := rfl
101-
@[simp] lemma dual_Iio : @Iio (order_dual α) _ a = @Ioi α _ a := rfl
102-
@[simp] lemma dual_Icc : @Icc (order_dual α) _ a b = @Icc α _ b a :=
100+
@[simp] lemma dual_Ici : Ici (to_dual a) = of_dual ⁻¹' Iic a := rfl
101+
@[simp] lemma dual_Iic : Iic (to_dual a) = of_dual ⁻¹' Ici a := rfl
102+
@[simp] lemma dual_Ioi : Ioi (to_dual a) = of_dual ⁻¹' Iio a := rfl
103+
@[simp] lemma dual_Iio : Iio (to_dual a) = of_dual ⁻¹' Ioi a := rfl
104+
@[simp] lemma dual_Icc : Icc (to_dual a) (to_dual b) = of_dual ⁻¹' Icc b a :=
103105
set.ext $ λ x, and_comm _ _
104-
@[simp] lemma dual_Ioc : @Ioc (order_dual α) _ a b = @Ico α _ b a :=
106+
@[simp] lemma dual_Ioc : Ioc (to_dual a) (to_dual b) = of_dual ⁻¹' Ico b a :=
105107
set.ext $ λ x, and_comm _ _
106-
@[simp] lemma dual_Ico : @Ico (order_dual α) _ a b = @Ioc α _ b a :=
108+
@[simp] lemma dual_Ico : Ico (to_dual a) (to_dual b) = of_dual ⁻¹' Ioc b a :=
107109
set.ext $ λ x, and_comm _ _
108-
@[simp] lemma dual_Ioo : @Ioo (order_dual α) _ a b = @Ioo α _ b a :=
110+
@[simp] lemma dual_Ioo : Ioo (to_dual a) (to_dual b) = of_dual ⁻¹' Ioo b a :=
109111
set.ext $ λ x, and_comm _ _
110112

111113
@[simp] lemma nonempty_Icc : (Icc a b).nonempty ↔ a ≤ b :=
@@ -430,14 +432,14 @@ by rw [← Ico_diff_left, diff_union_self,
430432
union_eq_self_of_subset_right (singleton_subset_iff.2 $ left_mem_Ico.2 hab)]
431433

432434
lemma Ioo_union_right (hab : a < b) : Ioo a b ∪ {b} = Ioc a b :=
433-
by simpa only [dual_Ioo, dual_Ico] using @Ioo_union_left (order_dual α) _ b a hab
435+
by simpa only [dual_Ioo, dual_Ico] using Ioo_union_left hab.dual
434436

435437
lemma Ioc_union_left (hab : a ≤ b) : Ioc a b ∪ {a} = Icc a b :=
436438
by rw [← Icc_diff_left, diff_union_self,
437439
union_eq_self_of_subset_right (singleton_subset_iff.2 $ left_mem_Icc.2 hab)]
438440

439441
lemma Ico_union_right (hab : a ≤ b) : Ico a b ∪ {b} = Icc a b :=
440-
by simpa only [dual_Ioc, dual_Icc] using @Ioc_union_left (order_dual α) _ b a hab
442+
by simpa only [dual_Ioc, dual_Icc] using Ioc_union_left hab.dual
441443

442444
lemma mem_Ici_Ioi_of_subset_of_subset {s : set α} (ho : Ioi a ⊆ s) (hc : s ⊆ Ici a) :
443445
s ∈ ({Ici a, Ioi a} : set (set α)) :=
@@ -492,7 +494,7 @@ end
492494
lemma mem_Ioo_or_eq_right_of_mem_Ioc {x : α} (hmem : x ∈ Ioc a b) :
493495
x = b ∨ x ∈ Ioo a b :=
494496
begin
495-
have := @mem_Ioo_or_eq_left_of_mem_Ico (order_dual α) _ b a x,
497+
have := @mem_Ioo_or_eq_left_of_mem_Ico _ _ (to_dual b) (to_dual a) (to_dual x),
496498
rw [dual_Ioo, dual_Ico] at this,
497499
exact this hmem
498500
end

src/data/set/intervals/disjoint.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ universe u
1717

1818
variables {α : Type u}
1919

20+
open order_dual (to_dual)
2021

2122
namespace set
2223

@@ -45,7 +46,8 @@ by simp_rw [set.disjoint_iff_inter_eq_empty, Ico_inter_Ico, Ico_eq_empty_iff,
4546
inf_eq_min, sup_eq_max, not_lt]
4647

4748
@[simp] lemma Ioc_disjoint_Ioc : disjoint (Ioc a₁ a₂) (Ioc b₁ b₂) ↔ min a₂ b₂ ≤ max a₁ b₁ :=
48-
by simpa only [dual_Ico] using @Ico_disjoint_Ico (order_dual α) _ a₂ a₁ b₂ b₁
49+
have h : _ ↔ min (to_dual a₁) (to_dual b₁) ≤ max (to_dual a₂) (to_dual b₂) := Ico_disjoint_Ico,
50+
by simpa only [dual_Ico] using h
4951

5052
/-- If two half-open intervals are disjoint and the endpoint of one lies in the other,
5153
then it must be equal to the endpoint of the other. -/

src/data/set/intervals/ord_connected.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ instance ord_connected.inter' {s t : set α} [ord_connected s] [ord_connected t]
6565
ord_connected (s ∩ t) :=
6666
ord_connected.inter ‹_› ‹_›
6767

68-
lemma ord_connected.dual {s : set α} (hs : ord_connected s) : @ord_connected (order_dual α) _ s :=
68+
lemma ord_connected.dual {s : set α} (hs : ord_connected s) :
69+
ord_connected (order_dual.of_dual ⁻¹' s) :=
6970
⟨λ x hx y hy z hz, hs.out hy hx ⟨hz.2, hz.1⟩⟩
7071

71-
lemma ord_connected_dual {s : set α} : @ord_connected (order_dual α) _ s ↔ ord_connected s :=
72+
lemma ord_connected_dual {s : set α} : ord_connected (order_dual.of_dual ⁻¹' s) ↔ ord_connected s :=
7273
⟨λ h, by simpa only [ord_connected_def] using h.dual, λ h, h.dual⟩
7374

7475
lemma ord_connected_sInter {S : set (set α)} (hS : ∀ s ∈ S, ord_connected s) :

src/data/set/intervals/surj_on.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permutations of interval endpoints.
1616

1717
variables {α : Type*} {β : Type*} [linear_order α] [partial_order β] {f : α → β}
1818

19-
open set function
19+
open set function order_dual (to_dual)
2020

2121
lemma surj_on_Ioo_of_monotone_surjective
2222
(h_mono : monotone f) (h_surj : function.surjective f) (a b : α) :
@@ -51,10 +51,7 @@ end
5151
lemma surj_on_Ioc_of_monotone_surjective
5252
(h_mono : monotone f) (h_surj : function.surjective f) (a b : α) :
5353
surj_on f (Ioc a b) (Ioc (f a) (f b)) :=
54-
begin
55-
convert @surj_on_Ico_of_monotone_surjective _ _ _ _ _ h_mono.dual h_surj b a;
56-
simp
57-
end
54+
by simpa using surj_on_Ico_of_monotone_surjective h_mono.dual h_surj (to_dual b) (to_dual a)
5855

5956
-- to see that the hypothesis `a ≤ b` is necessary, consider a constant function
6057
lemma surj_on_Icc_of_monotone_surjective

src/order/bounded_lattice.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Johannes Hölzl
66
import data.option.basic
77
import logic.nontrivial
88
import order.lattice
9+
import order.order_dual
910
import tactic.pi_instances
1011

1112
/-!
@@ -1162,7 +1163,9 @@ lemma inf_eq_bot (h : is_compl x y) : x ⊓ y = ⊥ := h.disjoint.eq_bot
11621163

11631164
lemma sup_eq_top (h : is_compl x y) : x ⊔ y = ⊤ := top_unique h.top_le_sup
11641165

1165-
lemma to_order_dual (h : is_compl x y) : @is_compl (order_dual α) _ x y := ⟨h.2, h.1
1166+
open order_dual (to_dual)
1167+
1168+
lemma to_order_dual (h : is_compl x y) : is_compl (to_dual x) (to_dual y) := ⟨h.2, h.1
11661169

11671170
end bounded_lattice
11681171

src/order/bounds.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In this file we define:
2222
We also prove various lemmas about monotonicity, behaviour under `∪`, `∩`, `insert`, and provide
2323
formulas for `∅`, `univ`, and intervals.
2424
-/
25-
open set
25+
open set order_dual (to_dual of_dual)
2626

2727
universes u v w x
2828
variables {α : Type u} {β : Type v} {γ : Type w} {ι : Sort x}
@@ -461,13 +461,13 @@ section
461461
variables [semilattice_inf γ] [densely_ordered γ]
462462

463463
lemma is_lub_Ioo {a b : γ} (hab : a < b) : is_lub (Ioo a b) b :=
464-
by simpa only [dual_Ioo] using @is_glb_Ioo (order_dual γ) _ _ b a hab
464+
by simpa only [dual_Ioo] using is_glb_Ioo hab.dual
465465

466466
lemma upper_bounds_Ioo {a b : γ} (hab : a < b) : upper_bounds (Ioo a b) = Ici b :=
467467
(is_lub_Ioo hab).upper_bounds_eq
468468

469469
lemma is_lub_Ico {a b : γ} (hab : a < b) : is_lub (Ico a b) b :=
470-
by simpa only [dual_Ioc] using @is_glb_Ioc (order_dual γ) _ _ b a hab
470+
by simpa only [dual_Ioc] using is_glb_Ioc hab.dual
471471

472472
lemma upper_bounds_Ico {a b : γ} (hab : a < b) : upper_bounds (Ico a b) = Ici b :=
473473
(is_lub_Ico hab).upper_bounds_eq

src/order/filter/extr.lean

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,22 +156,24 @@ lemma is_extr_on_const {b : β} : is_extr_on (λ _, b) s a := is_extr_filter_con
156156

157157
/-! ### Order dual -/
158158

159-
lemma is_min_filter_dual_iff : @is_min_filter α (order_dual β) _ f l a ↔ is_max_filter f l a :=
159+
open order_dual (to_dual)
160+
161+
lemma is_min_filter_dual_iff : is_min_filter (to_dual ∘ f) l a ↔ is_max_filter f l a :=
160162
iff.rfl
161163

162-
lemma is_max_filter_dual_iff : @is_max_filter α (order_dual β) _ f l a ↔ is_min_filter f l a :=
164+
lemma is_max_filter_dual_iff : is_max_filter (to_dual ∘ f) l a ↔ is_min_filter f l a :=
163165
iff.rfl
164166

165-
lemma is_extr_filter_dual_iff : @is_extr_filter α (order_dual β) _ f l a ↔ is_extr_filter f l a :=
167+
lemma is_extr_filter_dual_iff : is_extr_filter (to_dual ∘ f) l a ↔ is_extr_filter f l a :=
166168
or_comm _ _
167169

168170
alias is_min_filter_dual_iff ↔ is_min_filter.undual is_max_filter.dual
169171
alias is_max_filter_dual_iff ↔ is_max_filter.undual is_min_filter.dual
170172
alias is_extr_filter_dual_iff ↔ is_extr_filter.undual is_extr_filter.dual
171173

172-
lemma is_min_on_dual_iff : @is_min_on α (order_dual β) _ f s a ↔ is_max_on f s a := iff.rfl
173-
lemma is_max_on_dual_iff : @is_max_on α (order_dual β) _ f s a ↔ is_min_on f s a := iff.rfl
174-
lemma is_extr_on_dual_iff : @is_extr_on α (order_dual β) _ f s a ↔ is_extr_on f s a := or_comm _ _
174+
lemma is_min_on_dual_iff : is_min_on (to_dual ∘ f) s a ↔ is_max_on f s a := iff.rfl
175+
lemma is_max_on_dual_iff : is_max_on (to_dual ∘ f) s a ↔ is_min_on f s a := iff.rfl
176+
lemma is_extr_on_dual_iff : is_extr_on (to_dual ∘ f) s a ↔ is_extr_on f s a := or_comm _ _
175177

176178
alias is_min_on_dual_iff ↔ is_min_on.undual is_max_on.dual
177179
alias is_max_on_dual_iff ↔ is_max_on.undual is_min_on.dual

src/order/monotone.lean

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Mario Carneiro, Yaël Dillies
55
-/
66
import order.compare
7+
import order.order_dual
78

89
/-!
910
# Monotonicity
@@ -97,106 +98,93 @@ def strict_anti_on (f : α → β) (s : set α) : Prop :=
9798

9899
end monotone_def
99100

100-
/-! #### Monotonicity on the dual order -/
101+
/-! #### Monotonicity on the dual order
102+
103+
Strictly many of the `*_on.dual` lemmas in this section should use `of_dual ⁻¹' s` instead of `s`,
104+
but right now this is not possible as `set.preimage` is not defined yet, and importing it creates
105+
an import cycle.
106+
-/
101107

102108
section order_dual
103109
open order_dual
104110
variables [preorder α] [preorder β] {f : α → β} {s : set α}
105111

106-
protected theorem monotone.dual (hf : monotone f) :
107-
@monotone (order_dual α) (order_dual β) _ _ f :=
112+
protected theorem monotone.dual (hf : monotone f) : monotone (to_dual ∘ f ∘ of_dual) :=
108113
λ a b h, hf h
109114

110-
protected lemma monotone.dual_left (hf : monotone f) :
111-
@antitone (order_dual α) β _ _ f :=
115+
protected lemma monotone.dual_left (hf : monotone f) : antitone (f ∘ of_dual) :=
112116
λ a b h, hf h
113117

114-
protected lemma monotone.dual_right (hf : monotone f) :
115-
@antitone α (order_dual β) _ _ f :=
118+
protected lemma monotone.dual_right (hf : monotone f) : antitone (to_dual ∘ f) :=
116119
λ a b h, hf h
117120

118-
protected theorem antitone.dual (hf : antitone f) :
119-
@antitone (order_dual α) (order_dual β) _ _ f :=
121+
protected theorem antitone.dual (hf : antitone f) : antitone (to_dual ∘ f ∘ of_dual) :=
120122
λ a b h, hf h
121123

122-
protected lemma antitone.dual_left (hf : antitone f) :
123-
@monotone (order_dual α) β _ _ f :=
124+
protected lemma antitone.dual_left (hf : antitone f) : monotone (f ∘ of_dual) :=
124125
λ a b h, hf h
125126

126-
protected lemma antitone.dual_right (hf : antitone f) :
127-
@monotone α (order_dual β) _ _ f :=
127+
protected lemma antitone.dual_right (hf : antitone f) : monotone (to_dual ∘ f) :=
128128
λ a b h, hf h
129129

130-
protected theorem monotone_on.dual (hf : monotone_on f s) :
131-
@monotone_on (order_dual α) (order_dual β) _ _ f s :=
130+
protected theorem monotone_on.dual (hf : monotone_on f s) : monotone_on (to_dual ∘ f ∘ of_dual) s :=
132131
λ a ha b hb, hf hb ha
133132

134-
protected lemma monotone_on.dual_left (hf : monotone_on f s) :
135-
@antitone_on (order_dual α) β _ _ f s :=
133+
protected lemma monotone_on.dual_left (hf : monotone_on f s) : antitone_on (f ∘ of_dual) s :=
136134
λ a ha b hb, hf hb ha
137135

138-
protected lemma monotone_on.dual_right (hf : monotone_on f s) :
139-
@antitone_on α (order_dual β) _ _ f s :=
136+
protected lemma monotone_on.dual_right (hf : monotone_on f s) : antitone_on (to_dual ∘ f) s :=
140137
λ a ha b hb, hf ha hb
141138

142-
protected theorem antitone_on.dual (hf : antitone_on f s) :
143-
@antitone_on (order_dual α) (order_dual β) _ _ f s :=
139+
protected theorem antitone_on.dual (hf : antitone_on f s) : antitone_on (to_dual ∘ f ∘ of_dual) s :=
144140
λ a ha b hb, hf hb ha
145141

146-
protected lemma antitone_on.dual_left (hf : antitone_on f s) :
147-
@monotone_on (order_dual α) β _ _ f s :=
142+
protected lemma antitone_on.dual_left (hf : antitone_on f s) : monotone_on (f ∘ of_dual) s :=
148143
λ a ha b hb, hf hb ha
149144

150-
protected lemma antitone_on.dual_right (hf : antitone_on f s) :
151-
@monotone_on α (order_dual β) _ _ f s :=
145+
protected lemma antitone_on.dual_right (hf : antitone_on f s) : monotone_on (to_dual ∘ f) s :=
152146
λ a ha b hb, hf ha hb
153147

154-
protected theorem strict_mono.dual (hf : strict_mono f) :
155-
@strict_mono (order_dual α) (order_dual β) _ _ f :=
148+
protected theorem strict_mono.dual (hf : strict_mono f) : strict_mono (to_dual ∘ f ∘ of_dual) :=
156149
λ a b h, hf h
157150

158-
protected lemma strict_mono.dual_left (hf : strict_mono f) :
159-
@strict_anti (order_dual α) β _ _ f :=
151+
protected lemma strict_mono.dual_left (hf : strict_mono f) : strict_anti (f ∘ of_dual) :=
160152
λ a b h, hf h
161153

162-
protected lemma strict_mono.dual_right (hf : strict_mono f) :
163-
@strict_anti α (order_dual β) _ _ f :=
154+
protected lemma strict_mono.dual_right (hf : strict_mono f) : strict_anti (to_dual ∘ f) :=
164155
λ a b h, hf h
165156

166-
protected theorem strict_anti.dual (hf : strict_anti f) :
167-
@strict_anti (order_dual α) (order_dual β) _ _ f :=
157+
protected theorem strict_anti.dual (hf : strict_anti f) : strict_anti (to_dual ∘ f ∘ of_dual) :=
168158
λ a b h, hf h
169159

170-
protected lemma strict_anti.dual_left (hf : strict_anti f) :
171-
@strict_mono (order_dual α) β _ _ f :=
160+
protected lemma strict_anti.dual_left (hf : strict_anti f) : strict_mono (f ∘ of_dual) :=
172161
λ a b h, hf h
173162

174-
protected lemma strict_anti.dual_right (hf : strict_anti f) :
175-
@strict_mono α (order_dual β) _ _ f :=
163+
protected lemma strict_anti.dual_right (hf : strict_anti f) : strict_mono (to_dual ∘ f) :=
176164
λ a b h, hf h
177165

178166
protected theorem strict_mono_on.dual (hf : strict_mono_on f s) :
179-
@strict_mono_on (order_dual α) (order_dual β) _ _ f s :=
167+
strict_mono_on (to_dual ∘ f ∘ of_dual) s :=
180168
λ a ha b hb, hf hb ha
181169

182170
protected lemma strict_mono_on.dual_left (hf : strict_mono_on f s) :
183-
@strict_anti_on (order_dual α) β _ _ f s :=
171+
strict_anti_on (f ∘ of_dual) s :=
184172
λ a ha b hb, hf hb ha
185173

186174
protected lemma strict_mono_on.dual_right (hf : strict_mono_on f s) :
187-
@strict_anti_on α (order_dual β) _ _ f s :=
175+
strict_anti_on (to_dual ∘ f) s :=
188176
λ a ha b hb, hf ha hb
189177

190178
protected theorem strict_anti_on.dual (hf : strict_anti_on f s) :
191-
@strict_anti_on (order_dual α) (order_dual β) _ _ f s :=
179+
strict_anti_on (to_dual ∘ f ∘ of_dual) s :=
192180
λ a ha b hb, hf hb ha
193181

194182
protected lemma strict_anti_on.dual_left (hf : strict_anti_on f s) :
195-
@strict_mono_on (order_dual α) β _ _ f s :=
183+
strict_mono_on (f ∘ of_dual) s :=
196184
λ a ha b hb, hf hb ha
197185

198186
protected lemma strict_anti_on.dual_right (hf : strict_anti_on f s) :
199-
@strict_mono_on α (order_dual β) _ _ f s :=
187+
strict_mono_on (to_dual ∘ f) s :=
200188
λ a ha b hb, hf ha hb
201189

202190
end order_dual
@@ -347,7 +335,7 @@ protected lemma strict_anti.ite' (hf : strict_anti f) (hg : strict_anti g) {p :
347335
[decidable_pred p] (hp : ∀ ⦃x y⦄, x < y → p y → p x)
348336
(hfg : ∀ ⦃x y⦄, p x → ¬p y → x < y → g y < f x) :
349337
strict_anti (λ x, if p x then f x else g x) :=
350-
@strict_mono.ite' α (order_dual β) _ _ f g hf hg p _ hp hfg
338+
(strict_mono.ite' hf.dual_right hg.dual_right hp hfg).dual_right
351339

352340
protected lemma strict_anti.ite (hf : strict_anti f) (hg : strict_anti g) {p : α → Prop}
353341
[decidable_pred p] (hp : ∀ ⦃x y⦄, x < y → p y → p x) (hfg : ∀ x, g x ≤ f x) :

src/order/order_dual.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,13 @@ lemma to_dual_lt [has_lt α] {a : α} {b : order_dual α} :
7575
protected def rec {C : order_dual α → Sort*} (h₂ : Π (a : α), C (to_dual a)) :
7676
Π (a : order_dual α), C a := h₂
7777

78+
@[simp] protected lemma «forall» {p : order_dual α → Prop} : (∀ a, p a) ↔ ∀ a, p (to_dual a) :=
79+
iff.rfl
80+
81+
@[simp] protected lemma «exists» {p : order_dual α → Prop} : (∃ a, p a) ↔ ∃ a, p (to_dual a) :=
82+
iff.rfl
83+
7884
end order_dual
85+
86+
alias order_dual.to_dual_lt_to_dual ↔ _ has_lt.lt.dual
87+
alias order_dual.to_dual_le_to_dual ↔ _ has_le.le.dual

0 commit comments

Comments
 (0)