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: volume of a complex ball #6907

Closed
wants to merge 57 commits into from

Conversation

xroblot
Copy link
Collaborator

@xroblot xroblot commented Aug 31, 2023

We prove the formula for the area of a disc

theorem volume_ball (x : EuclideanSpace ℝ (Fin 2)) (r : ℝ) :
    volume (Metric.ball x r) = NNReal.pi * (ENNReal.ofReal r) ^ 2 

and deduce from this, the volume of complex balls

theorem volume_ball (a : ℂ) (r : ℝ) :  
    volume (Metric.ball a r) = NNReal.pi * (ENNReal.ofReal r) ^ 2

Co-authored-by: James Arthur
Co-authored-by: Benjamin Davidson
Co-authored-by: Andrew Souther


Open in Gitpod

@jsm28
Copy link
Collaborator

jsm28 commented Sep 1, 2023

Can Archive.Wiedijk100Theorems.AreaOfACircle be refactored in terms of this (or alternatively the 100.yaml entry repointed to this result, with something done about the doc string discussing how there should be a more general result for the n-ball)? I don't think we should need to have two completely separate proofs of essentially the same result.

@xroblot
Copy link
Collaborator Author

xroblot commented Sep 1, 2023

Can Archive.Wiedijk100Theorems.AreaOfACircle be refactored in terms of this (or alternatively the 100.yaml entry repointed to this result, with something done about the doc string discussing how there should be a more general result for the n-ball)? I don't think we should need to have two completely separate proofs of essentially the same result.

As the matter of fact, I took some ideas from AreaOfACircle for this PR (and I am planning to add the authors of this file as co-authors of this PR when I write down the description), the main difference being the way the integral of $\sqrt {1 - x ^2 }$ is computed. I did not explicitly state the result about the area of the disc since I was not sure where to put it, but now that I rethink about it, it could belong in theEuclideanSpace namespace (with a doc string about the $n$-dimensional ball).

In any case, I think it is fine to keep AreaOfACircle with the same proof since it is in Archive and was historically the first one to solve the corresponding 100.yaml problem.

@hrmacbeth
Copy link
Member

with something done about the doc string discussing how there should be a more general result for the n-ball

By the way, @fpvandoorn and I recently proved the n-ball result. We will PR it soon (I hope) but had not discussed where it should go.

@xroblot
Copy link
Collaborator Author

xroblot commented Sep 1, 2023

with something done about the doc string discussing how there should be a more general result for the n-ball

By the way, @fpvandoorn and I recently proved the n-ball result. We will PR it soon (I hope) but had not discussed where it should go.

Great! I'll will wait until you PR your result with Floris and then use it to prove the volume of the complex ball.

Do you think #6905 is still worth keeping?

@hrmacbeth
Copy link
Member

Actually, I think there's no reason to kill this PR -- it can join mathlib now and when ours is ready we can generalize it.

@xroblot
Copy link
Collaborator Author

xroblot commented Sep 1, 2023

Ok, in that case, I think it would be better to also have the result on the area of the disc in this PR and the question of where it belongs is still open...

@xroblot
Copy link
Collaborator Author

xroblot commented Sep 1, 2023

So we do have Euclidean.ball

@eric-wieser
Copy link
Member

I think Euclidean.ball is intended only as an implementation detail elsewhere

@xroblot
Copy link
Collaborator Author

xroblot commented Sep 2, 2023

I think Euclidean.ball is intended only as an implementation detail elsewhere

So something like

example : volume (Euclidean.ball (0 : Fin 2 → ℝ) 1) = NNReal.pi 

is not the right way to state the result?

@eric-wieser
Copy link
Member

In any case, I think it is fine to keep AreaOfACircle with the same proof since it is in Archive and was historically the first one to solve the corresponding 100.yaml problem.

I think we should replace the proof anyway, though perhaps leave the statement as is for now. If people want to see the historical solution, they can always look at the git history for that file. If you don't agree, it's perhaps worth starting a Zulip thread to see what the wider opinion on this is.

My view is that Archive should be demonstrations of the best way to do things with current mathlib, not just a historical leaderboard.

@xroblot
Copy link
Collaborator Author

xroblot commented Sep 5, 2023

By the way, @fpvandoorn and I recently proved the n-ball result. We will PR it soon (I hope) but had not discussed where it should go.

@hrmacbeth can you please share the statement that you proved with Floris. I am still not sure of the best way to state the dimension 2 version...

kodyvajjha pushed a commit that referenced this pull request Sep 22, 2023
We prove 
```lean
theorem integral_sqrt_one_sub_sq : ∫ x in (-1 : ℝ)..1, sqrt (1 - x ^ 2) = π / 2
```
which will in turn be used to compute the area of the disc and then the volume of the unit complex ball in #6907
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it makes sense to add the ProdLp case now too (refactoring the existing proof), or leave that to a future PR?

@xroblot
Copy link
Collaborator Author

xroblot commented Sep 30, 2023

Do you think it makes sense to add the ProdLp case now too (refactoring the existing proof), or leave that to a future PR?

I think that will be for a future PR. The proof for this case is completely different than the one in this PR and, in any case, I think the more general proof in the future PR by @hrmacbeth and @fpvandoorn should be easier to adapt to the case Lp.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors d+

Thanks! sorry for forgetting about this.

@bors
Copy link

bors bot commented Oct 23, 2023

✌️ xroblot can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added delegated and removed awaiting-review The author would like community review of the PR labels Oct 23, 2023
@xroblot
Copy link
Collaborator Author

xroblot commented Oct 23, 2023

bors d+

Thanks! sorry for forgetting about this.

Thanks. In fact, I have a new PR coming soon with the computation of the volume of the unit ball in all dimensions, for all Lp norms over the real and over the complex using #7693. I just need to do some clean up and finish proving one or two easy lemmas (famous last words).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@xroblot
Copy link
Collaborator Author

xroblot commented Oct 24, 2023

bors r+

bors bot pushed a commit that referenced this pull request Oct 24, 2023
We prove the formula for the area of a disc
```lean
theorem volume_ball (x : EuclideanSpace ℝ (Fin 2)) (r : ℝ) :
    volume (Metric.ball x r) = NNReal.pi * (ENNReal.ofReal r) ^ 2 
```
and deduce from this, the volume of complex balls 
```lean
theorem volume_ball (a : ℂ) (r : ℝ) :  
    volume (Metric.ball a r) = NNReal.pi * (ENNReal.ofReal r) ^ 2
```

Co-authored-by: James Arthur
Co-authored-by: Benjamin Davidson
Co-authored-by: Andrew Souther



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link

bors bot commented Oct 24, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: volume of a complex ball [Merged by Bors] - feat: volume of a complex ball Oct 24, 2023
@bors bors bot closed this Oct 24, 2023
@bors bors bot deleted the xfr-complex_ball branch October 24, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated t-measure-probability Measure theory / Probability theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants