Skip to content

Commit 549778a

Browse files
grunwegbjoernkjoshanssen
authored andcommitted
chore: remove some open Classical, part 3 (#15417)
See #15371.
1 parent f0591bc commit 549778a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+189
-187
lines changed

Mathlib/Algebra/Order/CompleteField.lean

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ archimedean. We also construct the natural map from a `LinearOrderedField` to su
4242
reals, conditionally complete, ordered field, uniqueness
4343
-/
4444

45-
4645
variable {F α β γ : Type*}
4746

4847
noncomputable section

Mathlib/Analysis/Analytic/Composition.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ variable {𝕜 : Type*} {E F G H : Type*}
7070

7171
open Filter List
7272

73-
open scoped Topology Classical NNReal ENNReal
73+
open scoped Topology NNReal ENNReal
7474

7575
section Topological
7676

Mathlib/Analysis/Analytic/Inverse.lean

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ we prove that they coincide and study their properties (notably convergence).
2626
2727
-/
2828

29-
30-
open scoped Classical Topology
29+
open scoped Topology
3130

3231
open Finset Filter
3332

@@ -91,6 +90,7 @@ term is invertible. -/
9190
theorem leftInv_comp (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F)
9291
(h : p 1 = (continuousMultilinearCurryFin1 𝕜 E F).symm i) : (leftInv p i).comp p = id 𝕜 E := by
9392
ext (n v)
93+
classical
9494
match n with
9595
| 0 =>
9696
simp only [leftInv_coeff_zero, ContinuousMultilinearMap.zero_apply, id_apply_ne_one, Ne,
@@ -192,8 +192,8 @@ theorem comp_rightInv_aux1 {n : ℕ} (hn : 0 < n) (p : FormalMultilinearSeries
192192
(q : FormalMultilinearSeries 𝕜 F E) (v : Fin n → F) :
193193
p.comp q n v =
194194
∑ c ∈ {c : Composition n | 1 < c.length}.toFinset,
195-
p c.length (q.applyComposition c v) +
196-
p 1 fun _ => q n v := by
195+
p c.length (q.applyComposition c v) + p 1 fun _ => q n v := by
196+
classical
197197
have A :
198198
(Finset.univ : Finset (Composition n)) =
199199
{c | 1 < Composition.length c}.toFinset ∪ {Composition.single n hn} := by

Mathlib/Analysis/Analytic/Linear.lean

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCom
1717
[NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*}
1818
[NormedAddCommGroup G] [NormedSpace 𝕜 G]
1919

20-
open scoped Topology Classical NNReal ENNReal
21-
20+
open scoped Topology NNReal ENNReal
2221
open Set Filter Asymptotics
2322

2423
noncomputable section

Mathlib/Analysis/Analytic/RadiusLiminf.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ because this would create a circular dependency once we redefine `exp` using
1919
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
2020
[NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
2121

22-
open scoped Topology Classical NNReal ENNReal
22+
open scoped Topology NNReal ENNReal
2323

2424
open Filter Asymptotics
2525

Mathlib/Analysis/BoxIntegral/Basic.lean

+9-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ non-Riemann filter (e.g., Henstock-Kurzweil and McShane).
5050
integral
5151
-/
5252

53-
54-
open scoped Classical Topology NNReal Filter Uniformity BoxIntegral
53+
open scoped Topology NNReal Filter Uniformity BoxIntegral
5554

5655
open Set Finset Function Filter Metric BoxIntegral.IntegrationParams
5756

@@ -101,6 +100,7 @@ theorem integralSum_inf_partition (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[
101100
integralSum f vol (π.infPrepartition π') = integralSum f vol π :=
102101
integralSum_biUnion_partition f vol π _ fun _J hJ => h.restrict (Prepartition.le_of_mem _ hJ)
103102

103+
open Classical in
104104
theorem integralSum_fiberwise {α} (g : Box ι → α) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F)
105105
(π : TaggedPrepartition I) :
106106
(∑ y ∈ π.boxes.image g, integralSum f vol (π.filter (g · = y))) = integralSum f vol π :=
@@ -159,6 +159,7 @@ predicate. -/
159159
def Integrable (I : Box ι) (l : IntegrationParams) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) :=
160160
∃ y, HasIntegral I l f vol y
161161

162+
open Classical in
162163
/-- The integral of a function `f` over a box `I` along a filter `l` w.r.t. a volume `vol`.
163164
Returns zero on non-integrable functions. -/
164165
def integral (I : Box ι) (l : IntegrationParams) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) :=
@@ -260,8 +261,9 @@ theorem integrable_neg : Integrable I l (-f) vol ↔ Integrable I l f vol :=
260261
fun h => h.of_neg, fun h => h.neg⟩
261262

262263
@[simp]
263-
theorem integral_neg : integral I l (-f) vol = -integral I l f vol :=
264-
if h : Integrable I l f vol then h.hasIntegral.neg.integral_eq
264+
theorem integral_neg : integral I l (-f) vol = -integral I l f vol := by
265+
classical
266+
exact if h : Integrable I l f vol then h.hasIntegral.neg.integral_eq
265267
else by rw [integral, integral, dif_neg h, dif_neg (mt Integrable.of_neg h), neg_zero]
266268

267269
theorem HasIntegral.sub (h : HasIntegral I l f vol y) (h' : HasIntegral I l g vol y') :
@@ -298,6 +300,7 @@ theorem integral_zero : integral I l (fun _ => (0 : E)) vol = 0 :=
298300
theorem HasIntegral.sum {α : Type*} {s : Finset α} {f : α → ℝⁿ → E} {g : α → F}
299301
(h : ∀ i ∈ s, HasIntegral I l (f i) vol (g i)) :
300302
HasIntegral I l (fun x => ∑ i ∈ s, f i x) vol (∑ i ∈ s, g i) := by
303+
classical
301304
induction' s using Finset.induction_on with a s ha ihs; · simp [hasIntegral_zero]
302305
simp only [Finset.sum_insert ha]; rw [Finset.forall_mem_insert] at h
303306
exact h.1.add (ihs h.2)
@@ -661,6 +664,7 @@ theorem integrable_of_bounded_and_ae_continuousWithinAt [CompleteSpace E] {I : B
661664
let t₁ (J : Box ι) : ℝⁿ := (π₁.infPrepartition π₂.toPrepartition).tag J
662665
let t₂ (J : Box ι) : ℝⁿ := (π₂.infPrepartition π₁.toPrepartition).tag J
663666
let B := (π₁.toPrepartition ⊓ π₂.toPrepartition).boxes
667+
classical
664668
let B' := B.filter (fun J ↦ J.toSet ⊆ U)
665669
have hB' : B' ⊆ B := B.filter_subset (fun J ↦ J.toSet ⊆ U)
666670
have μJ_ne_top : ∀ J ∈ B, μ J ≠ ⊤ :=
@@ -777,6 +781,7 @@ theorem HasIntegral.of_bRiemann_eq_false_of_forall_isLittleO (hl : l.bRiemann =
777781
rcases hs.exists_pos_forall_sum_le (div_pos ε0' H0) with ⟨εs, hεs0, hεs⟩
778782
simp only [le_div_iff' H0, mul_sum] at hεs
779783
rcases exists_pos_mul_lt ε0' (B I) with ⟨ε', ε'0, hεI⟩
784+
classical
780785
set δ : ℝ≥0 → ℝⁿ → Ioi (0 : ℝ) := fun c x => if x ∈ s then δ₁ c x (εs x) else (δ₂ c) x ε'
781786
refine ⟨δ, fun c => l.rCond_of_bRiemann_eq_false hl, ?_⟩
782787
simp only [Set.mem_iUnion, mem_inter_iff, mem_setOf_eq]

Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Then `p I` is true.
2626
rectangular box, induction
2727
-/
2828

29-
30-
open Set Finset Function Filter Metric Classical Topology Filter ENNReal
29+
open Set Function Filter Topology
3130

3231
noncomputable section
3332

@@ -37,6 +36,7 @@ namespace Box
3736

3837
variable {ι : Type*} {I J : Box ι}
3938

39+
open Classical in
4040
/-- For a box `I`, the hyperplanes passing through its center split `I` into `2 ^ card ι` boxes.
4141
`BoxIntegral.Box.splitCenterBox I s` is one of these boxes. See also
4242
`BoxIntegral.Partition.splitCenter` for the corresponding `BoxIntegral.Partition`. -/

Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Henstock-Kurzweil integral.
3838
Henstock-Kurzweil integral, integral, Stokes theorem, divergence theorem
3939
-/
4040

41-
42-
open scoped Classical NNReal ENNReal Topology BoxIntegral
41+
open scoped NNReal ENNReal Topology BoxIntegral
4342

4443
open ContinuousLinearMap (lsmul)
4544

Mathlib/Analysis/BoxIntegral/Integrability.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ We deduce that the same is true for the Riemann integral for continuous function
2121
integral, McShane integral, Bochner integral
2222
-/
2323

24-
25-
open scoped Classical NNReal ENNReal Topology
24+
open scoped NNReal ENNReal Topology
2625

2726
universe u v
2827

@@ -63,6 +62,7 @@ theorem hasIntegralIndicatorConst (l : IntegrationParams) (hl : l.bRiemann = fal
6362
nhds_basis_closedBall.mem_iff.1 (hFc.isOpen_compl.mem_nhds fun hx' => hx.2 (hFs hx').1)
6463
exact ⟨⟨r, hr₀⟩, hr⟩
6564
choose! rs' hrs'F using this
65+
classical
6666
set r : (ι → ℝ) → Ioi (0 : ℝ) := s.piecewise rs rs'
6767
refine ⟨fun _ => r, fun c => l.rCond_of_bRiemann_eq_false hl, fun c π hπ hπp => ?_⟩; rw [mul_comm]
6868
/- Then the union of boxes `J ∈ π` such that `π.tag ∈ s` includes `F` and is included by `U`,

Mathlib/Analysis/BoxIntegral/Partition/Measure.lean

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ For the last statement, we both prove it as a proposition and define a bundled
2323
rectangular box, measure
2424
-/
2525

26-
2726
open Set
2827

2928
noncomputable section
3029

31-
open scoped ENNReal Classical BoxIntegral
30+
open scoped ENNReal BoxIntegral
3231

3332
variable {ι : Type*}
3433

Mathlib/Analysis/Calculus/ContDiff/Basic.lean

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ In this file, we denote `⊤ : ℕ∞` with `∞`.
3232
derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor series, formal series
3333
-/
3434

35-
3635
noncomputable section
3736

38-
open scoped Classical NNReal Nat
37+
open scoped NNReal Nat
3938

4039
local notation "∞" => (⊤ : ℕ∞)
4140

Mathlib/Analysis/Calculus/ContDiff/Bounds.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Mathlib.Data.Nat.Choose.Multinomial
1818

1919
noncomputable section
2020

21-
open scoped Classical NNReal Nat
21+
open scoped NNReal Nat
2222

2323
universe u uD uE uF uG
2424

Mathlib/Analysis/Calculus/Deriv/Basic.lean

+1-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ universe u v w
9090

9191
noncomputable section
9292

93-
open scoped Classical Topology Filter ENNReal NNReal
94-
93+
open scoped Topology ENNReal NNReal
9594
open Filter Asymptotics Set
9695

9796
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)

Mathlib/Analysis/Calculus/Deriv/Mul.lean

+8-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ For a more detailed overview of one-dimensional derivatives in mathlib, see the
2020
derivative, multiplication
2121
-/
2222

23-
2423
universe u v w
2524

2625
noncomputable section
2726

28-
open scoped Classical Topology Filter ENNReal
27+
open scoped Topology Filter ENNReal
2928

3029
open Filter Asymptotics Set
3130

@@ -326,12 +325,15 @@ variable {ι : Type*} {𝔸' : Type*} [NormedCommRing 𝔸'] [NormedAlgebra 𝕜
326325
{u : Finset ι} {f : ι → 𝕜 → 𝔸'} {f' : ι → 𝔸'}
327326

328327
theorem DifferentiableAt.finset_prod (hd : ∀ i ∈ u, DifferentiableAt 𝕜 (f i) x) :
329-
DifferentiableAt 𝕜 (∏ i ∈ u, f i ·) x :=
330-
(HasDerivAt.finset_prod (fun i hi ↦ DifferentiableAt.hasDerivAt (hd i hi))).differentiableAt
328+
DifferentiableAt 𝕜 (∏ i ∈ u, f i ·) x := by
329+
classical
330+
exact
331+
(HasDerivAt.finset_prod (fun i hi ↦ DifferentiableAt.hasDerivAt (hd i hi))).differentiableAt
331332

332333
theorem DifferentiableWithinAt.finset_prod (hd : ∀ i ∈ u, DifferentiableWithinAt 𝕜 (f i) s x) :
333-
DifferentiableWithinAt 𝕜 (∏ i ∈ u, f i ·) s x :=
334-
(HasDerivWithinAt.finset_prod (fun i hi ↦
334+
DifferentiableWithinAt 𝕜 (∏ i ∈ u, f i ·) s x := by
335+
classical
336+
exact (HasDerivWithinAt.finset_prod (fun i hi ↦
335337
DifferentiableWithinAt.hasDerivWithinAt (hd i hi))).differentiableWithinAt
336338

337339
theorem DifferentiableOn.finset_prod (hd : ∀ i ∈ u, DifferentiableOn 𝕜 (f i) s) :

Mathlib/Analysis/Calculus/Deriv/Polynomial.lean

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ derivative, polynomial
3030

3131
universe u v w
3232

33-
open scoped Classical Topology Filter ENNReal Polynomial
34-
35-
open Filter Asymptotics Set
33+
open scoped Topology Filter ENNReal Polynomial
34+
open Set
3635

3736
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
3837

Mathlib/Analysis/Calculus/Dslope.lean

+9-6
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,28 @@ In this file we define `dslope` and prove some basic lemmas about its continuity
1717
differentiability.
1818
-/
1919

20-
21-
open scoped Classical Topology Filter
20+
open scoped Topology Filter
2221

2322
open Function Set Filter
2423

2524
variable {𝕜 E : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E]
2625

26+
open Classical in
2727
/-- `dslope f a b` is defined as `slope f a b = (b - a)⁻¹ • (f b - f a)` for `a ≠ b` and
2828
`deriv f a` for `a = b`. -/
2929
noncomputable def dslope (f : 𝕜 → E) (a : 𝕜) : 𝕜 → E :=
3030
update (slope f a) a (deriv f a)
3131

3232
@[simp]
33-
theorem dslope_same (f : 𝕜 → E) (a : 𝕜) : dslope f a a = deriv f a :=
34-
update_same _ _ _
33+
theorem dslope_same (f : 𝕜 → E) (a : 𝕜) : dslope f a a = deriv f a := by
34+
classical
35+
exact update_same _ _ _
3536

3637
variable {f : 𝕜 → E} {a b : 𝕜} {s : Set 𝕜}
3738

38-
theorem dslope_of_ne (f : 𝕜 → E) (h : b ≠ a) : dslope f a b = slope f a b :=
39-
update_noteq h _ _
39+
theorem dslope_of_ne (f : 𝕜 → E) (h : b ≠ a) : dslope f a b = slope f a b := by
40+
classical
41+
exact update_noteq h _ _
4042

4143
theorem ContinuousLinearMap.dslope_comp {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
4244
(f : E →L[𝕜] F) (g : 𝕜 → E) (a b : 𝕜) (H : a = b → DifferentiableAt 𝕜 g a) :
@@ -89,6 +91,7 @@ theorem ContinuousOn.of_dslope (h : ContinuousOn (dslope f a) s) : ContinuousOn
8991
theorem continuousWithinAt_dslope_of_ne (h : b ≠ a) :
9092
ContinuousWithinAt (dslope f a) s b ↔ ContinuousWithinAt f s b := by
9193
refine ⟨ContinuousWithinAt.of_dslope, fun hc => ?_⟩
94+
classical
9295
simp only [dslope, continuousWithinAt_update_of_ne h]
9396
exact ((continuousWithinAt_id.sub continuousWithinAt_const).inv₀ (sub_ne_zero.2 h)).smul
9497
(hc.sub continuousWithinAt_const)

Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ We introduce some `local notation` to make formulas shorter:
4545

4646
open Function Set Filter Metric
4747

48-
open scoped Topology Classical NNReal
48+
open scoped Topology NNReal
4949

5050
noncomputable section
5151

Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ derivative, strictly differentiable, continuously differentiable, smooth, invers
4040

4141
open Function Set Filter Metric
4242

43-
open scoped Topology Classical NNReal
43+
open scoped Topology NNReal
4444

4545
noncomputable section
4646

Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ by translating the corresponding result `iteratedFDerivWithin_succ_apply_left` f
4040
iterated Fréchet derivative.
4141
-/
4242

43-
4443
noncomputable section
4544

46-
open scoped Classical Topology
47-
45+
open scoped Topology
4846
open Filter Asymptotics Set
4947

5048
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]

0 commit comments

Comments
 (0)