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

Commit e20c730

Browse files
committed
feat(topology/continuous_map): formulas for sup and inf in terms of abs (#6720)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 3153153 commit e20c730

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

src/algebra/ordered_group.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,20 @@ section linear_ordered_add_comm_group
683683

684684
variables [linear_ordered_add_comm_group α] {a b c : α}
685685

686+
@[simp]
687+
lemma sub_le_sub_flip : a - b ≤ b - a ↔ a ≤ b :=
688+
begin
689+
rw [sub_le_iff_le_add, sub_add_eq_add_sub, le_sub_iff_add_le],
690+
split,
691+
{ intro h,
692+
by_contra H,
693+
rw not_le at H,
694+
apply not_lt.2 h,
695+
exact add_lt_add H H, },
696+
{ intro h,
697+
exact add_le_add h h, }
698+
end
699+
686700
lemma le_of_forall_pos_le_add [densely_ordered α] (h : ∀ ε : α, 0 < ε → a ≤ b + ε) : a ≤ b :=
687701
le_of_forall_le_of_dense $ λ c hc,
688702
calc a ≤ b + (c - b) : h _ (sub_pos_of_lt hc)

src/topology/algebra/continuous_functions.lean

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ instance continuous_map_group {α : Type*} {β : Type*} [topological_space α] [
120120
mul_left_inv := λ a, by ext; exact mul_left_inv _,
121121
..continuous_map_monoid }
122122

123+
@[simp, norm_cast, to_additive]
124+
lemma div_coe {α : Type*} {β : Type*} [topological_space α] [topological_space β]
125+
[group β] [topological_group β] (f g : C(α, β)) :
126+
((f / g : C(α, β)) : α → β) = (f : α → β) / (g : α → β) :=
127+
by { simp only [div_eq_mul_inv], refl, }
128+
123129
@[to_additive]
124130
instance continuous_map_comm_group {α : Type*} {β : Type*} [topological_space α]
125131
[topological_space β] [comm_group β] [topological_group β] : comm_group C(α, β) :=
@@ -372,3 +378,49 @@ instance continuous_map_module' {α : Type*} [topological_space α]
372378
end continuous_map
373379

374380
end module_over_continuous_functions
381+
382+
/-!
383+
We now provide formulas for `f ⊓ g` and `f ⊔ g`, where `f g : C(α, β)`,
384+
in terms of `continuous_map.abs`.
385+
-/
386+
387+
section
388+
variables {R : Type*} [linear_ordered_field R]
389+
390+
-- TODO:
391+
-- This lemma (and the next) could go all the way back in `algebra.ordered_field`,
392+
-- except that it is tedious to prove without tactics.
393+
-- Rather than stranding it at some intermediate location,
394+
-- it's here, immediately prior to the point of use.
395+
lemma min_eq_half_add_sub_abs_sub {x y : R} : min x y = 2⁻¹ * (x + y - abs (x - y)) :=
396+
begin
397+
dsimp [min, max, abs],
398+
simp only [neg_le_self_iff, if_congr, sub_nonneg, neg_sub],
399+
split_ifs; ring; linarith,
400+
end
401+
402+
lemma max_eq_half_add_add_abs_sub {x y : R} : max x y = 2⁻¹ * (x + y + abs (x - y)) :=
403+
begin
404+
dsimp [min, max, abs],
405+
simp only [neg_le_self_iff, if_congr, sub_nonneg, neg_sub],
406+
split_ifs; ring; linarith,
407+
end
408+
end
409+
410+
namespace continuous_map
411+
412+
section lattice
413+
variables {α : Type*} [topological_space α]
414+
variables {β : Type*} [linear_ordered_field β] [topological_space β]
415+
[order_topology β] [topological_ring β]
416+
417+
lemma inf_eq (f g : C(α, β)) : f ⊓ g = (2⁻¹ : β) • (f + g - (f - g).abs) :=
418+
ext (λ x, by simpa using min_eq_half_add_sub_abs_sub)
419+
420+
-- Not sure why this is grosser than `inf_eq`:
421+
lemma sup_eq (f g : C(α, β)) : f ⊔ g = (2⁻¹ : β) • (f + g + (f - g).abs) :=
422+
ext (λ x, by simpa [mul_add] using @max_eq_half_add_add_abs_sub _ _ (f x) (g x))
423+
424+
end lattice
425+
426+
end continuous_map

src/topology/continuous_map.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ def const (b : β) : C(α, β) := ⟨λ x, b⟩
8383
@[simp] lemma const_coe (b : β) : (const b : α → β) = (λ x, b) := rfl
8484
lemma const_apply (b : β) (a : α) : const b a = b := rfl
8585

86+
section
87+
variables [linear_ordered_add_comm_group β] [order_topology β]
88+
89+
/-- The pointwise absolute value of a continuous function as a continuous function. -/
90+
def abs (f : C(α, β)) : C(α, β) :=
91+
{ to_fun := λ x, abs (f x), }
92+
93+
@[simp] lemma abs_apply (f : C(α, β)) (x : α) : f.abs x = _root_.abs (f x) :=
94+
rfl
95+
96+
end
97+
8698
/-!
8799
We now set up the partial order and lattice structure (given by pointwise min and max)
88100
on continuous functions.

0 commit comments

Comments
 (0)