English
If p is a proposition and Decidable, the function x ↦ if p then f x else g x is continuous provided f is continuous when p holds and g is continuous when p does not hold.
Русский
Если p — предложение и разрешимо, функция x ↦ إذا p то f x иначе g x непрерывна, когда f непрерывна при p и g непрерывна при не-p.
LaTeX
$$$\text{Continuous}\ (\lambda a. \mathbf{1}_{p}\, f(a) + \mathbf{1}_{\neg p}\, g(a))$$$
Lean4
theorem «if» {p : α → Prop} [∀ a, Decidable (p a)] (hp : ∀ a ∈ frontier {x | p x}, f a = g a) (hf : Continuous f)
(hg : Continuous g) : Continuous fun a => if p a then f a else g a :=
continuous_if hp hf.continuousOn hg.continuousOn