Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(analysis/special_functions/trigonometric/angle): continuity and signs #16204

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/analysis/special_functions/trigonometric/angle.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Authors: Calle Sönne
import analysis.special_functions.trigonometric.basic
import algebra.char_zero.quotient
import algebra.order.to_interval_mod
import data.sign
import topology.instances.sign

/-!
# The type of angles
Expand Down Expand Up @@ -521,6 +521,26 @@ lemma eq_iff_abs_to_real_eq_of_sign_eq {θ ψ : angle} (h : θ.sign = ψ.sign) :
θ = ψ ↔ |θ.to_real| = |ψ.to_real| :=
by simpa [h] using @eq_iff_sign_eq_and_abs_to_real_eq θ ψ

lemma continuous_at_sign {θ : angle} (h0 : θ ≠ 0) (hpi : θ ≠ π) : continuous_at sign θ :=
(continuous_at_sign_of_ne_zero (sin_ne_zero_iff.2 ⟨h0, hpi⟩)).comp continuous_sin.continuous_at

lemma _root_.continuous_on.angle_sign_comp {α : Type*} [topological_space α] {f : α → angle}
{s : set α} (hf : continuous_on f s) (hs : ∀ z ∈ s, f z ≠ 0 ∧ f z ≠ π) :
continuous_on (sign ∘ f) s :=
begin
refine (continuous_at.continuous_on (λ θ hθ, _)).comp hf (set.maps_to_image f s),
obtain ⟨z, hz, rfl⟩ := hθ,
exact continuous_at_sign (hs _ hz).1 (hs _ hz).2
end

/-- Suppose a function to angles is continuous on a connected set and never takes the values `0`
or `π` on that set. Then the values of the function on that set all have the same sign. -/
lemma sign_eq_of_continuous_on {α : Type*} [topological_space α] {f : α → angle} {s : set α}
{x y : α} (hc : is_connected s) (hf : continuous_on f s) (hs : ∀ z ∈ s, f z ≠ 0 ∧ f z ≠ π)
(hx : x ∈ s) (hy : y ∈ s) : (f y).sign = (f x).sign :=
(hc.image _ (hf.angle_sign_comp hs)).is_preconnected.subsingleton
(set.mem_image_of_mem _ hy) (set.mem_image_of_mem _ hx)

end angle

end real