wiedijk_100_theorems.area_of_a_circle
⟷
Archive.Wiedijk100Theorems.AreaOfACircle
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -74,7 +74,7 @@ theorem disc_eq_regionBetween :
simp only [disc, regionBetween, mem_set_of_eq, mem_Ioo, mem_Ioc, Pi.neg_apply]
constructor <;> intro h
· cases abs_lt_of_sq_lt_sq' (lt_of_add_lt_of_nonneg_left h (sq_nonneg p.2)) r.2
- rw [add_comm, ← lt_sub_iff_add_lt] at h
+ rw [add_comm, ← lt_sub_iff_add_lt] at h
exact ⟨⟨left, right.le⟩, sq_lt.mp h⟩
· rw [add_comm, ← lt_sub_iff_add_lt]
exact sq_lt.mpr h.2
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2021 James Arthur, Benjamin Davidson, Andrew Souther. All rights r
Released under Apache 2.0 license as described in the file LICENSE.
Authors: James Arthur, Benjamin Davidson, Andrew Souther
-/
-import Mathbin.Analysis.SpecialFunctions.Sqrt
-import Mathbin.Analysis.SpecialFunctions.Trigonometric.InverseDeriv
-import Mathbin.MeasureTheory.Integral.FundThmCalculus
-import Mathbin.MeasureTheory.Measure.Lebesgue.Integral
+import Analysis.SpecialFunctions.Sqrt
+import Analysis.SpecialFunctions.Trigonometric.InverseDeriv
+import MeasureTheory.Integral.FundThmCalculus
+import MeasureTheory.Measure.Lebesgue.Integral
#align_import wiedijk_100_theorems.area_of_a_circle from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2021 James Arthur, Benjamin Davidson, Andrew Souther. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: James Arthur, Benjamin Davidson, Andrew Souther
-
-! This file was ported from Lean 3 source module wiedijk_100_theorems.area_of_a_circle
-! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Analysis.SpecialFunctions.Sqrt
import Mathbin.Analysis.SpecialFunctions.Trigonometric.InverseDeriv
import Mathbin.MeasureTheory.Integral.FundThmCalculus
import Mathbin.MeasureTheory.Measure.Lebesgue.Integral
+#align_import wiedijk_100_theorems.area_of_a_circle from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
+
/-!
# Freek № 9: The Area of a Circle
mathlib commit https://github.com/leanprover-community/mathlib/commit/bf2428c9486c407ca38b5b3fb10b87dad0bc99fa
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: James Arthur, Benjamin Davidson, Andrew Souther
! This file was ported from Lean 3 source module wiedijk_100_theorems.area_of_a_circle
-! leanprover-community/mathlib commit 5563b1b49e86e135e8c7b556da5ad2f5ff881cad
+! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -16,6 +16,9 @@ import Mathbin.MeasureTheory.Measure.Lebesgue.Integral
/-!
# Freek № 9: The Area of a Circle
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
In this file we show that the area of a disc with nonnegative radius `r` is `π * r^2`. The main
tools our proof uses are `volume_region_between_eq_integral`, which allows us to represent the area
of the disc as an integral, and `interval_integral.integral_eq_sub_of_has_deriv_at'_of_le`, the
mathlib commit https://github.com/leanprover-community/mathlib/commit/893964fc28cefbcffc7cb784ed00a2895b4e65cf
@@ -3,8 +3,8 @@ Copyright (c) 2021 James Arthur, Benjamin Davidson, Andrew Souther. All rights r
Released under Apache 2.0 license as described in the file LICENSE.
Authors: James Arthur, Benjamin Davidson, Andrew Souther
-! This file was ported from Lean 3 source module «100-theorems-list».«9_area_of_a_circle»
-! leanprover-community/mathlib commit 328375597f2c0dd00522d9c2e5a33b6a6128feeb
+! This file was ported from Lean 3 source module wiedijk_100_theorems.area_of_a_circle
+! leanprover-community/mathlib commit 5563b1b49e86e135e8c7b556da5ad2f5ff881cad
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -131,7 +131,7 @@ theorem area_disc : volume (disc r) = NNReal.pi * r ^ 2 := by
integral_eq_sub_of_hasDerivAt_of_le (neg_le_self r.2) hcont hderiv
(continuous_const.mul hf).continuousOn.intervalIntegrable
_ = NNReal.pi * (r : ℝ) ^ 2 := by
- norm_num [inv_mul_cancel hlt.ne', ← mul_div_assoc, mul_comm π]
+ norm_num [F, inv_mul_cancel hlt.ne', ← mul_div_assoc, mul_comm π]
#align theorems_100.area_disc Theorems100.area_disc
end Theorems100
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -43,9 +43,6 @@ to the n-ball.
-/
-
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
open Set Real MeasureTheory intervalIntegral
open scoped Real NNReal
Four lemmas are moved from Algebra/Order/Monoid/Defs.lean to Algebra/Order/Group/Defs.lean and generalized
Four lemmas are moved from Algebra/Order/Ring/Abs.lean to Algebra/Order/Group/Abs.lean and generalized
Four lemmas are added in Algebra/Order/Monoid/Defs.lean. They're special cases of one_le_pow_iff, but I can't import the file without offending assert_not_exists.
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
@@ -99,7 +99,8 @@ theorem area_disc : volume (disc r) = NNReal.pi * r ^ 2 := by
_ = ENNReal.ofReal (∫ x in Ioc (-r : ℝ) r, (f - Neg.neg ∘ f) x) :=
(volume_regionBetween_eq_integral h.neg h measurableSet_Ioc fun x _ =>
neg_le_self (sqrt_nonneg _))
- _ = ENNReal.ofReal (∫ x in (-r : ℝ)..r, 2 * f x) := by simp [two_mul, integral_of_le]
+ _ = ENNReal.ofReal (∫ x in (-r : ℝ)..r, 2 * f x) := by
+ rw [integral_of_le] <;> simp [two_mul, neg_le_self]
_ = NNReal.pi * r ^ 2 := by rw_mod_cast [this, ← ENNReal.coe_nnreal_eq]
have hle := NNReal.coe_nonneg r
obtain heq | hlt := hle.eq_or_lt; · simp [← heq]
norm_num
was passing the wrong syntax node to elabSimpArgs
when elaborating, which essentially had the effect of ignoring all arguments it was passed, i.e. norm_num [add_comm]
would not try to commute addition in the simp step.
The fix itself is very simple (though not obvious to debug!), probably using TSyntax more would help avoid such issues in future.
Due to this bug many norm_num [blah]
became rw [blah]; norm_num
or similar, sometimes with porting notes, sometimes not, we fix these porting notes and other regressions during the port also.
Interestingly cancel_denoms
uses norm_num [<- mul_assoc]
internally, so cancel_denoms
also got stronger with this change.
@@ -133,8 +133,7 @@ theorem area_disc : volume (disc r) = NNReal.pi * r ^ 2 := by
integral_eq_sub_of_hasDerivAt_of_le (neg_le_self r.2) hcont hderiv
(continuous_const.mul hf).continuousOn.intervalIntegrable
_ = NNReal.pi * (r : ℝ) ^ 2 := by
- norm_num
- simp [inv_mul_cancel hlt.ne', ← mul_div_assoc, mul_comm π]
+ norm_num [inv_mul_cancel hlt.ne', ← mul_div_assoc, mul_comm π]
#align theorems_100.area_disc Theorems100.area_disc
end Theorems100
The main reasons is that having h : 0 < denom
in the context should suffice for field_simp
to do its job, without the need to manually pass h.ne
or similar.
Quite a few have := … ≠ 0
could be dropped, and some field_simp
calls no longer need explicit arguments; this is promising.
This does break some proofs where field_simp
was not used as a closing tactic, and it now
shuffles terms around a bit different. These were fixed. Using field_simp
in the middle of a proof seems rather fragile anyways.
As a drive-by contribution, positivity
now knows about π > 0
.
fixes: #4835
Co-authored-by: Matthew Ballard <matt@mrb.email>
@@ -111,13 +111,13 @@ theorem area_disc : volume (disc r) = NNReal.pi * r ^ 2 := by
((hasDerivAt_const x (r : ℝ)⁻¹).mul (hasDerivAt_id' x)))).add
((hasDerivAt_id' x).mul ((((hasDerivAt_id' x).pow 2).const_sub ((r : ℝ) ^ 2)).sqrt _))
using 1
- · have h : sqrt ((1 : ℝ) - x ^ 2 / (r : ℝ) ^ 2) * r = sqrt ((r : ℝ) ^ 2 - x ^ 2) := by
- rw [← sqrt_sq hle, ← sqrt_mul, sub_mul, sqrt_sq hle, mul_comm_div,
- div_self (pow_ne_zero 2 hlt.ne'), one_mul, mul_one]
- simpa [sqrt_sq hle, div_le_one (pow_pos hlt 2)] using sq_le_sq' hx1.le hx2.le
+ · have h₁ : (r:ℝ) ^ 2 - x ^ 2 > 0 := sub_pos_of_lt (sq_lt_sq' hx1 hx2)
+ have h : sqrt ((r:ℝ) ^ 2 - x ^ 2) ^ 3 = ((r:ℝ) ^ 2 - x ^ 2) * sqrt ((r: ℝ) ^ 2 - x ^ 2) := by
+ rw [pow_three, ← mul_assoc, mul_self_sqrt (by positivity)]
field_simp
- rw [h, mul_left_comm, ← sq, neg_mul_eq_mul_neg, mul_div_mul_left (-x ^ 2) _ two_ne_zero,
- add_left_comm, div_add_div_same, ← sub_eq_add_neg, div_sqrt, two_mul]
+ ring_nf
+ rw [h]
+ ring
· suffices -(1 : ℝ) < (r : ℝ)⁻¹ * x by exact this.ne'
calc
-(1 : ℝ) = (r : ℝ)⁻¹ * -r := by simp [inv_mul_cancel hlt.ne']
@@ -44,7 +44,7 @@ to the n-ball.
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
open Set Real MeasureTheory intervalIntegral
@@ -2,17 +2,14 @@
Copyright (c) 2021 James Arthur, Benjamin Davidson, Andrew Souther. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: James Arthur, Benjamin Davidson, Andrew Souther
-
-! This file was ported from Lean 3 source module wiedijk_100_theorems.area_of_a_circle
-! leanprover-community/mathlib commit 5563b1b49e86e135e8c7b556da5ad2f5ff881cad
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Analysis.SpecialFunctions.Sqrt
import Mathlib.Analysis.SpecialFunctions.Trigonometric.InverseDeriv
import Mathlib.MeasureTheory.Integral.FundThmCalculus
import Mathlib.MeasureTheory.Measure.Lebesgue.Integral
+#align_import wiedijk_100_theorems.area_of_a_circle from "leanprover-community/mathlib"@"5563b1b49e86e135e8c7b556da5ad2f5ff881cad"
+
/-!
# Freek № 9: The Area of a Circle
@@ -47,7 +47,7 @@ to the n-ball.
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
open Set Real MeasureTheory intervalIntegral
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
algebra.order.monoid.cancel.basic
init.data.list.default
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file