Skip to content

Commit a1bda00

Browse files
2 parents f84bd34 + 26cd1c7 commit a1bda00

File tree

407 files changed

+8482
-2502
lines changed

Some content is hidden

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

407 files changed

+8482
-2502
lines changed

.github/workflows/discover-lean-pr-testing.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,11 @@ jobs:
102102
103103
# Check if the diff contains files other than the specified ones
104104
if echo "$DIFF_FILES" | grep -v -e 'lake-manifest.json' -e 'lakefile.lean' -e 'lean-toolchain'; then
105-
# Extract the PR number and actual branch name
106-
PR_NUMBER=$(echo "$BRANCH" | grep -oP '\d+$')
105+
# Extract the actual branch name
107106
ACTUAL_BRANCH=${BRANCH#origin/}
108-
GITHUB_DIFF="https://github.com/leanprover-community/mathlib4/compare/nightly-testing...$ACTUAL_BRANCH"
109107
110108
# Append the branch details to RELEVANT_BRANCHES
111-
RELEVANT_BRANCHES="$RELEVANT_BRANCHES"$'\n- '"$ACTUAL_BRANCH (lean4#$PR_NUMBER) ([diff with \`nightly-testing\`]($GITHUB_DIFF))"
109+
RELEVANT_BRANCHES="$RELEVANT_BRANCHES""$ACTUAL_BRANCH"$' '
112110
fi
113111
done
114112
@@ -133,7 +131,10 @@ jobs:
133131
printf $'```bash\n'
134132
for BRANCH in $BRANCHES; do
135133
PR_NUMBER=$(echo "$BRANCH" | grep -oP '\d+$')
134+
GITHUB_DIFF="https://github.com/leanprover-community/mathlib4/compare/nightly-testing...lean-pr-testing-$PR_NUMBER"
135+
printf $'# Diff: %s\n' "$GITHUB_DIFF"
136136
printf $'scripts/merge-lean-testing-pr.sh %s # %s\n' "$PR_NUMBER" "$BRANCH"
137+
printf '\n'
137138
done
138139
printf $'```\n'
139140
printf "EOF"

Counterexamples/DiscreteTopologyNonDiscreteUniformity.lean

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ condition needed to be a basis of a filter: moreover, the filter generated by th
6161
the condition for being a uniformity, and this is the uniformity we put on `ℕ`.
6262
6363
For each `n`, the set `fundamentalEntourage n : Set (ℕ × ℕ)` consists of the `n+1` points
64-
`{(0,0),(1,1)...(n,n)}` on the diagonal; together with the half plane `{(x,y) | n ≤ x ∧ n ≤ y}`
64+
`{(0,0),(1,1)...(n,n)}` on the diagonal; together with the half plane `{(x,y) | n ≤ x ∧ n ≤ y}`
6565
6666
That this collection can be used as a filter basis is proven in the definition `counterBasis` and
6767
that the filter `counterBasis.filterBasis` is a uniformity is proven in the definition
@@ -98,7 +98,7 @@ noncomputable local instance : PseudoMetricSpace ℕ where
9898
lemma dist_def {n m : ℕ} : dist n m = |2 ^ (-n : ℤ) - 2 ^ (-m : ℤ)| := rfl
9999

100100
lemma Int.eq_of_pow_sub_le {d : ℕ} {m n : ℤ} (hd1 : 1 < d)
101-
(h : |(d : ℝ) ^ (-m) - d ^ (-n)| < d ^ (-n - 1)) : m = n := by
101+
(h : |(d : ℝ) ^ (-m) - d ^ (-n)| < d ^ (-n - 1)) : m = n := by
102102
have hd0 : 0 < d := one_pos.trans hd1
103103
replace h : |(1 : ℝ) - d ^ (n - m)| < (d : ℝ)⁻¹ := by
104104
rw [← mul_lt_mul_iff_of_pos_left (a := (d : ℝ) ^ (-n)) (zpow_pos _ _),
@@ -114,17 +114,17 @@ lemma Int.eq_of_pow_sub_le {d : ℕ} {m n : ℤ} (hd1 : 1 < d)
114114
rw [ha, ← mul_lt_mul_iff_of_pos_left (a := (d : ℝ)) <| Nat.cast_pos'.mpr hd0,
115115
mul_inv_cancel₀ <| Nat.cast_ne_zero.mpr (ne_of_gt hd0),
116116
← abs_of_nonneg (a := (d : ℝ)) <| Nat.cast_nonneg' d, ← abs_mul,
117-
show |(d : ℝ) * (1 - |(d : ℝ)| ^ (a : ℤ))| = |(d : ℤ) * (1 - |(d : ℤ)| ^ a)| by
118-
norm_cast, ← Int.cast_one (R := ℝ), Int.cast_lt, Int.abs_lt_one_iff, Int.mul_eq_zero,
117+
show |(d : ℝ) * (1 - |(d : ℝ)| ^ (a : ℤ))| = |(d : ℤ) * (1 - |(d : ℤ)| ^ a)| by norm_cast,
118+
← Int.cast_one (R := ℝ), Int.cast_lt, Int.abs_lt_one_iff, Int.mul_eq_zero,
119119
sub_eq_zero, eq_comm (a := 1), pow_eq_one_iff_cases] at h
120120
simp only [Nat.cast_eq_zero, ne_of_gt hd0, Nat.abs_cast, Nat.cast_eq_one, ne_of_gt hd1,
121121
Int.reduceNeg, reduceCtorEq, false_and, or_self, or_false, false_or] at h
122122
rwa [h, Nat.cast_zero, sub_eq_zero, eq_comm] at ha
123-
· have h1 : (d : ℝ) ^ (n - m) ≤ 1 - (d : ℝ)⁻¹ := by
124-
calc (d : ℝ) ^ (n - m) ≤ (d : ℝ)⁻¹ := by
125-
rw [← zpow_neg_one]
126-
apply zpow_right_mono₀ <| Nat.one_le_cast.mpr hd0
127-
linarith
123+
· have h1 : (d : ℝ) ^ (n - m) ≤ 1 - (d : ℝ)⁻¹ := calc
124+
(d : ℝ) ^ (n - m) ≤ (d : ℝ)⁻¹ := by
125+
rw [← zpow_neg_one]
126+
apply zpow_right_mono₀ <| Nat.one_le_cast.mpr hd0
127+
linarith
128128
_ ≤ 1 - (d : ℝ)⁻¹ := by
129129
rw [inv_eq_one_div, one_sub_div <| Nat.cast_ne_zero.mpr (ne_of_gt hd0),
130130
div_le_div_iff_of_pos_right <| Nat.cast_pos'.mpr hd0, le_sub_iff_add_le]
@@ -149,15 +149,15 @@ theorem TopIsDiscrete : DiscreteTopology ℕ := by
149149
lemma idIsCauchy : CauchySeq (id : ℕ → ℕ) := by
150150
rw [Metric.cauchySeq_iff]
151151
refine fun ε ↦ Metric.cauchySeq_iff.mp
152-
(@cauchySeq_of_le_geometric_two ℝ _ 1 (fun n ↦ 2 ^(-n : ℤ)) fun n ↦ ?_) ε
152+
(@cauchySeq_of_le_geometric_two ℝ _ 1 (fun n ↦ 2 ^(-n : ℤ)) fun n ↦ le_of_eq ?_) ε
153153
simp only [zpow_natCast, Nat.cast_add, Nat.cast_one, neg_add_rev, Int.reduceNeg, one_div]
154154
rw [Real.dist_eq, zpow_add' <| Or.intro_left _ two_ne_zero]
155-
calc |2 ^ (- n : ℤ) - 2 ^ (-1 : ℤ) * 2 ^ (- n : ℤ)| =
156-
|(1 - (2 : ℝ)⁻¹) * 2 ^ (- n : ℤ)| := by rw [← one_sub_mul, zpow_neg_one]
157-
_ = |2⁻¹ * 2 ^ (-(n : ℤ))| := by congr; rw [inv_eq_one_div 2, sub_half 1]
158-
_ = 2⁻¹ / 2 ^ n := by rw [zpow_neg, abs_mul, abs_inv, abs_inv, inv_eq_one_div,
159-
Nat.abs_ofNat, one_div, zpow_natCast, abs_pow, ← div_eq_mul_inv, Nat.abs_ofNat]
160-
rfl
155+
calc
156+
|2 ^ (- n : ℤ) - 2 ^ (-1 : ℤ) * 2 ^ (- n : ℤ)|
157+
_ = |(1 - (2 : ℝ)⁻¹) * 2 ^ (- n : ℤ)| := by rw [← one_sub_mul, zpow_neg_one]
158+
_ = |2⁻¹ * 2 ^ (-(n : ℤ))| := by congr; rw [inv_eq_one_div 2, sub_half 1]
159+
_ = 2⁻¹ / 2 ^ n := by rw [zpow_neg, abs_mul, abs_inv, abs_inv, inv_eq_one_div,
160+
Nat.abs_ofNat, one_div, zpow_natCast, abs_pow, ← div_eq_mul_inv, Nat.abs_ofNat]
161161

162162
end Metric
163163

@@ -170,7 +170,7 @@ discrete. -/
170170

171171
/-- The fundamental entourages (index by `n : ℕ`) used to construct a basis of the uniformity: for
172172
each `n`, the set `fundamentalEntourage n : Set (ℕ × ℕ)` consists of the `n+1` points
173-
`{(0,0),(1,1)...(n,n)}` on the diagonal; together with the half plane `{(x,y) | n ≤ x ∧ n ≤ y}`-/
173+
`{(0,0),(1,1)...(n,n)}` on the diagonal; together with the half plane `{(x,y) | n ≤ x ∧ n ≤ y}`-/
174174
def fundamentalEntourage (n : ℕ) : Set (ℕ × ℕ) :=
175175
(⋃ i : Icc 0 n, {((i : ℕ), (i : ℕ))}) ∪ Set.Ici (n , n)
176176

@@ -196,9 +196,9 @@ lemma mem_fundamentalEntourage (n : ℕ) (P : ℕ × ℕ) : P ∈ fundamentalEnt
196196
true_and, exists_prop', nonempty_prop, mem_Ici, fundamentalEntourage]
197197
rcases h with h | h
198198
· exact Or.inr h
199-
· by_cases h_le : n ≤ P.1
200-
· exact Or.inr ⟨h_le, h ▸ h_le⟩
201-
· refine Or.inl ⟨P.1, ⟨le_of_lt <| not_le.mp h_le, congrArg _ h⟩⟩
199+
· cases le_total n P.1 with
200+
| inl h_le => exact Or.inr ⟨h_le, h ▸ h_le⟩
201+
| inr h_le => exact Or.inl ⟨P.1, ⟨h_le, congrArg _ h⟩⟩
202202

203203
/-- The collection `fundamentalEntourage` satisfies the axioms to be a basis for a filter on
204204
`ℕ × ℕ` and gives rise to a term in the relevant type.-/
@@ -262,10 +262,10 @@ def counterCoreUniformity : UniformSpace.Core ℕ := by
262262
aesop
263263

264264
/--The topology on `ℕ` induced by the "crude" uniformity-/
265-
instance counterTopology: TopologicalSpace ℕ := counterCoreUniformity.toTopologicalSpace
265+
instance counterTopology : TopologicalSpace ℕ := counterCoreUniformity.toTopologicalSpace
266266

267267
/-- The uniform structure on `ℕ` bundling together the "crude" uniformity and the topology-/
268-
instance counterUniformity: UniformSpace ℕ := UniformSpace.ofCore counterCoreUniformity
268+
instance counterUniformity : UniformSpace ℕ := UniformSpace.ofCore counterCoreUniformity
269269

270270
lemma HasBasis_counterUniformity :
271271
(uniformity ℕ).HasBasis (fun _ ↦ True) fundamentalEntourage := by

Counterexamples/Phillips.lean

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,21 +415,17 @@ theorem continuousPart_evalCLM_eq_zero [TopologicalSpace α] [DiscreteTopology
415415
calc
416416
f.continuousPart s = f.continuousPart (s \ {x}) :=
417417
(continuousPart_apply_diff _ _ _ (countable_singleton x)).symm
418-
_ = f (univ \ f.discreteSupport ∩ (s \ {x})) := rfl
418+
_ = f (univ \ f.discreteSupport ∩ (s \ {x})) := by simp [continuousPart]
419419
_ = indicator (univ \ f.discreteSupport ∩ (s \ {x})) 1 x := rfl
420420
_ = 0 := by simp
421421

422422
theorem toFunctions_toMeasure [MeasurableSpace α] (μ : Measure α) [IsFiniteMeasure μ] (s : Set α)
423423
(hs : MeasurableSet s) :
424424
μ.extensionToBoundedFunctions.toBoundedAdditiveMeasure s = (μ s).toReal := by
425-
change
426-
μ.extensionToBoundedFunctions
427-
(ofNormedAddCommGroupDiscrete (indicator s 1) 1 (norm_indicator_le_one s)) =
428-
(μ s).toReal
425+
simp only [ContinuousLinearMap.toBoundedAdditiveMeasure]
429426
rw [extensionToBoundedFunctions_apply]
430-
· change ∫ x, s.indicator (fun _ => (1 : ℝ)) x ∂μ = _
431-
simp [integral_indicator hs]
432-
· change Integrable (indicator s 1) μ
427+
· simp [integral_indicator hs]
428+
· simp only [coe_ofNormedAddCommGroupDiscrete]
433429
have : Integrable (fun _ => (1 : ℝ)) μ := integrable_const (1 : ℝ)
434430
apply
435431
this.mono' (Measurable.indicator (@measurable_const _ _ _ _ (1 : ℝ)) hs).aestronglyMeasurable

Counterexamples/SorgenfreyLine.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ theorem exists_Ico_disjoint_closed {a : ℝₗ} {s : Set ℝₗ} (hs : IsClosed
126126
@[simp]
127127
theorem map_toReal_nhds (a : ℝₗ) : map toReal (𝓝 a) = 𝓝[≥] toReal a := by
128128
refine ((nhds_basis_Ico a).map _).eq_of_same_basis ?_
129-
simpa only [toReal.image_eq_preimage] using nhdsWithin_Ici_basis_Ico (toReal a)
129+
simpa only [toReal.image_eq_preimage] using nhdsGE_basis_Ico (toReal a)
130130

131131
theorem nhds_eq_map (a : ℝₗ) : 𝓝 a = map toReal.symm (𝓝[≥] (toReal a)) := by
132132
simp_rw [← map_toReal_nhds, map_map, Function.comp_def, toReal.symm_apply_apply, map_id']

0 commit comments

Comments
 (0)