Help with beginning to contribute to set.mm

969 views
Skip to first unread message

Jon P

unread,
Mar 1, 2019, 2:52:17 PM3/1/19
to Metamath
Hi :) 

I recently discovered metamath and have been reading the book. I think it's a great project as having computer feedback on proofs is a really powerful tool, one which I wish I had access to during my PhD. I'm hopeful that I might be able to add some proofs to set.mm which would be great. So far I understand about the proof assistant and I was able to reprove eftcl using it which felt pretty good. Here's a bunch of questions I have about how to actually contribute a new proof, any help would be appreciated.

1. Presumably the first step is to find some material to contribute. My background is in PDE's and the more highschoolish the material the better (trigonometry, basic calculus etc) and I'm also ok at analysis and functional analysis topics. So what sort of things are at the boundary of metamath and need to be added? Are there any books which people want programmed in?

2. Once I find a proof to put in presumably the first step is to make sure it has no skipped steps so far as metamath is concerned, I don't know how hard this will be. Relevant to pt 1 are there any materials which have proofs already in very rigorous form which are easier to program in?

3. Say I have a theorem and the proof on paper. I think to add it to set.mm I need to first edit the text file to include the theorem. Would I just try to copy one of the current theorems, give it a comment, a name and put in the result formally? Where does it go, just in the most appropriate section?

4. This is a main issue. Say I have a theorem I want to prove and I know what steps I need to find in set.mm to substitute into it, how do I go about finding them? For example when reproving eftcl I just used the labels provided on the web page but if I had a new proof how would I find the labels for certain results? For example I didn't know "Closure law for division" was the name of what I was looking for so it was pretty difficult to try to find divcld (which is what is needed for that proof). Is there any advice on the best way of finding things? Is it trying to write out what you want in proper notation and searching inside the metamth program?

5. I guess after that it's a case of entering the proof into metamath, verifying, saving and writing to the source. What happens after this? Would I make a github pull request to get the proof included in the main repo? Can I make pull requests directly to the main repo or do I need to fork?

Maybe it would be good to try to make a beginners guide to contributing proofs? The book has a guide to proving demo.mm however that is quite a different process from this. 

Thank you for at least reading this far :) Any help appreciated. 

David A. Wheeler

unread,
Mar 1, 2019, 5:29:43 PM3/1/19
to metamath, Metamath
On Fri, 1 Mar 2019 10:34:12 -0800 (PST), Jon P <drjonp...@gmail.com> wrote:
> I recently discovered metamath and have been reading the book. I think it's
> a great project as having computer feedback on proofs is a really powerful
> tool, one which I wish I had access to during my PhD. I'm hopeful that I
> might be able to add some proofs to set.mm which would be great.

Fantastic!

> So far I
> understand about the proof assistant and I was able to reprove eftcl using
> it which felt pretty good.

Excellent.

> 1. Presumably the first step is to find some material to contribute. My
> background is in PDE's and the more highschoolish the material the better
> (trigonometry, basic calculus etc) and I'm also ok at analysis and
> functional analysis topics. So what sort of things are at the boundary of
> metamath and need to be added? Are there any books which people want
> programmed in?

A good place to start is the "Metamath 100" list of challenge proofs -
just look at the ones not done:
http://us.metamath.org/mm_100.html#todo

Some are harder than others; I suggest that you don't start with
#33. Fermat's Last Theorem :-). There are a number of theorems, however,
that have *known* proofs that are ripe for formalization.

Some people are already working on some of them or may have information
to help you, so before you begin I suggest that you post your intention here
on this mailing list.

> 2. Once I find a proof to put in presumably the first step is to make sure
> it has no skipped steps so far as metamath is concerned, I don't know how
> hard this will be. Relevant to pt 1 are there any materials which have
> proofs already in very rigorous form which are easier to program in?

Yes, though it depends on what you're trying to prove.
If you know what you want to prove, a Google search is a good start.
Works by the pseudonym Nicolas Bourbaki (actually a group) are one possible source.

Planar geometry related things tend to be easy if you're happy doing them
on the complex plane.

You might want to avoid more advanced geometry when you're starting out.
The reason is that there's been a long-standing discussion about
how to represent geometry in all its glory in metamath;
there are many different geometric systems.
Your help *longer* term would be greatly appreciated, I just suggest
that you start with something simpler first.

Speaking of which...

Jerry James: We haven't heard from you in a bit from your
experiments with representations of geometric systems.
Any new information to report? If so, start a new thread to report it!

> 3. Say I have a theorem and the proof on paper. I think to add it to set.mm
> I need to first edit the text file to include the theorem. Would I just try
> to copy one of the current theorems, give it a comment, a name and put in
> the result formally? Where does it go, just in the most appropriate section?

Here's what I do:
1. Edit set.mm with a text editor to enter what I intend to prove.
2. Start mmj2 and prove it.
3. Edit set.mm and copy the proof from step 2 into it.

It turns out that step 2 takes all the time :-). Technically 1 and 3 could be
done by mmj2, but I believe the original author wanted to be able to
assure that mmj2 would never corrupt the set.mm file.
When you're done with a proof, there's a feeling of completion
that makes step 3 a happy step :-).

> 4. This is a main issue. Say I have a theorem I want to prove and I know
> what steps I need to find in set.mm to substitute into it, how do I go
> about finding them?

I intentionally write proofs with very small steps and just ask
mmj2 to find them. If they're in the database in exactly that form
it will just fill them in. But that often won't work, especially at first
when you don't know what the forms look like :-).

There are a number of search systems built into mmj2 that can help
you find particular patterns. If that doesn't work, go to the table of contents
and look at the section that appears to be relevant.

> 5. I guess after that it's a case of entering the proof into metamath,
> verifying, saving and writing to the source. What happens after this? Would
> I make a github pull request to get the proof included in the main repo?
> Can I make pull requests directly to the main repo or do I need to fork?

You'll need to fork. We have instructions on how to do this.
And really, if you've got stuff to add, we'll find all sorts of ways to help at *that* point!!


> Maybe it would be good to try to make a beginners guide to contributing
> proofs? The book has a guide to proving demo.mm however that is quite a
> different process from this.

You might find my videos helpful:

"Metamath Proof Explorer: A Modern Principia Mathematica"
https://www.youtube.com/watch?v=8WH4Rd4UKGE

"Introduction to Metamath and mmj2"
https://www.youtube.com/watch?v=Rst2hZpWUbU

"Creating functions in Metamath"
https://www.youtube.com/watch?v=vE3v175cMKM


> Thank you for at least reading this far :) Any help appreciated.

I hope this helps!

--- David A. Wheeler

Jim Kingdon

unread,
Mar 1, 2019, 6:16:47 PM3/1/19
to Jon P, Metamath


On March 1, 2019 10:34:12 AM PST, Jon P <drjonp...@gmail.com> wrote:
>My
>
>background is in PDE's and the more highschoolish the material the
>better
>(trigonometry, basic calculus etc) and I'm also ok at analysis and
>functional analysis topics. So what sort of things are at the boundary
>of
>metamath and need to be added?


Most of those topics probably have textbook theorems which aren't proved yet. I just proved http://us2.metamath.org/mpeuni/taupi.html which is trigonometry (and in this case, related to topics like how infimum works on real numbers).

Maybe browsing through the metamath table of contents looking for those topics could help show what is already there?

>4. This is a main issue. Say I have a theorem I want to prove and I
>know
>what steps I need to find in set.mm to substitute into it, how do I go
>about finding them?

In addition to David's advice there is also SEARCH and SHOW STATEMENT with a wildcard in metamath.exe. For example, if you are looking for something about subsets and union you might try SEARCH 'C_ $* U.' or SHOW STATEMENT *ss*uni*


Jon P

unread,
Mar 1, 2019, 7:05:00 PM3/1/19
to Metamath

Thanks for the replies, I appreciate the help. That tau proof is pretty impressive :)

I wonder if maybe 57. Heron's formula is a good target as it doesn't seem that complicated and is on the 100 list. If anyone else is already working on it I am happy to look elsewhere.

I found this proof on wikipedia which seems really simple, if that's not a stupid place to look. It rests on the law of cosines (lawcos) and sinccossq which are in the database but I couldn't find Area of a Triangle = 1/2 base * height, is that in there? Also I'm also not sure how to get the opposite of a triangle = hypotenuse sin theta. After that it looks mostly like algebra which should be ok once I find the right substitutions.

Am I headed in the right direction at all? I hope it's ok to ask so many questions.


Mario Carneiro

unread,
Mar 1, 2019, 7:37:35 PM3/1/19
to metamath
On Fri, Mar 1, 2019 at 2:52 PM Jon P <drjonp...@gmail.com> wrote:
Hi :) 

I recently discovered metamath and have been reading the book. I think it's a great project as having computer feedback on proofs is a really powerful tool, one which I wish I had access to during my PhD. I'm hopeful that I might be able to add some proofs to set.mm which would be great. So far I understand about the proof assistant and I was able to reprove eftcl using it which felt pretty good. Here's a bunch of questions I have about how to actually contribute a new proof, any help would be appreciated.

1. Presumably the first step is to find some material to contribute. My background is in PDE's and the more highschoolish the material the better (trigonometry, basic calculus etc) and I'm also ok at analysis and functional analysis topics. So what sort of things are at the boundary of metamath and need to be added? Are there any books which people want programmed in?

The boundary of metamath depends on the area; it grows based on peoples' interests. On the whole it's about mid-level undergraduate stuff. There are no PDEs, although derivatives of real functions are available. Multivariate calculus isn't there, although I think there has been some work on getting the measure theory up to scratch. A lot of finite dimensional linear algebra is also needed for this direction.
 
2. Once I find a proof to put in presumably the first step is to make sure it has no skipped steps so far as metamath is concerned, I don't know how hard this will be. Relevant to pt 1 are there any materials which have proofs already in very rigorous form which are easier to program in?

More important than having books with rigorous proofs is your own understanding of the material. Unless *you* know how to fill in the steps you won't be able to explain how the proof goes to the computer. But I think that an average math textbook should be good enough if you can follow along without just nodding your head at the handwavy parts.

So your job as formalizer is to take this proof that you understand, and break it down to steps that are available as theorems in metamath. This might involve writing lemmas for subparts, and applying lots of prop calc theorems to manipulate the logic stuff. I recommend you get comfortable with that first, as it's an important part of getting started with doing real proofs of nontrivial theorems. I and others are available to help at any point if you get stuck or feel like you are doing it wrong.

As for targeting the mm100 theorems, I think that while they make great eventual goals, you should expect to spend most of your time on lemmas to subparts of supporting theorems in a completely different area which is needed to justify some step in the proof of the theorem itself. This is normal; you have to enjoy the journey not the destination.
 
3. Say I have a theorem and the proof on paper. I think to add it to set.mm I need to first edit the text file to include the theorem. Would I just try to copy one of the current theorems, give it a comment, a name and put in the result formally? Where does it go, just in the most appropriate section?

Copy pasting an existing theorem and modifying the relevant bits is an easy way to get the boilerplate right. It should go in the appropriate section, of course, except that it must come after all theorems that it depends on, which may sometimes necessitate putting it in a later section or starting a new section if it doesn't fit in an existing section.

Theorem names follow a fairly rigid convention to make them easy to find later. There is some documentation about that on the web site, but you can also ask about it here.
 
4. This is a main issue. Say I have a theorem I want to prove and I know what steps I need to find in set.mm to substitute into it, how do I go about finding them? For example when reproving eftcl I just used the labels provided on the web page but if I had a new proof how would I find the labels for certain results? For example I didn't know "Closure law for division" was the name of what I was looking for so it was pretty difficult to try to find divcld (which is what is needed for that proof). Is there any advice on the best way of finding things? Is it trying to write out what you want in proper notation and searching inside the metamth program?

This is what the naming convention is about. You can find theorems by their statements using the metamath.exe SEARCH command, or mmj2's Step Selection Search, but you can also try to guess the names and do a text search in set.mm for it. In the case of divcld, I can tell you now without looking it up that the statement of that theorem is

$e |- ( ph -> A e. CC )
$e |- ( ph -> B e. CC )
$p |- ( ph -> ( A / B ) e. CC )
 
because it's about CLosure of DIVision, in Deduction form (and it's over the complexes because that's the original/widest domain of definition of division). (Actually there is a side condition on this theorem but it's not important for the purpose of guessing names. When you apply the theorem you will find out that "B =/= 0" is also required, and that's not too much of a surprise.)

Conversely, if I saw I needed to prove |- ( ... -> ( ( 2 + 2 ) x. A ) e. ZZ ) then I would want to apply zmulcld, which is describing the type "z" = integers, the operation "mul" = multiplication, closure = "cl" and "d" for deduction form because it's a proof in some context "... ->". In this particular case mmj2 should be able to help and automatically apply zmulcld for you, but in general you want to leverage the naming convention as much as possible.

5. I guess after that it's a case of entering the proof into metamath, verifying, saving and writing to the source. What happens after this? Would I make a github pull request to get the proof included in the main repo? Can I make pull requests directly to the main repo or do I need to fork?

You can make PRs directly to the main repo, but the github process for that entails making a personal fork, pushing your work to it and then creating a PR from your branch to set.mm.
 
Maybe it would be good to try to make a beginners guide to contributing proofs? The book has a guide to proving demo.mm however that is quite a different process from this. 

I recommend David Wheeler's mmj2 tutorials, that he has already linked in this thread. 



On Fri, Mar 1, 2019 at 7:05 PM Jon P <drjonp...@gmail.com> wrote:
I wonder if maybe 57. Heron's formula is a good target as it doesn't seem that complicated and is on the 100 list. If anyone else is already working on it I am happy to look elsewhere.

Geometry is harder than it looks. It is notorious for "visual proofs", which are difficult to translate to a formalism correctly, and there are also lots of choices to be made with respect to what you even mean by geometry - it could be an axiomatic approach like Hilbert's or Tarski's axioms, or it could be a statement about subsets of R^2 or similar, in which case you will need lots of calculus or measure theory.
 
I found this proof on wikipedia which seems really simple, if that's not a stupid place to look. It rests on the law of cosines (lawcos) and sinccossq which are in the database but I couldn't find Area of a Triangle = 1/2 base * height, is that in there? Also I'm also not sure how to get the opposite of a triangle = hypotenuse sin theta. After that it looks mostly like algebra which should be ok once I find the right substitutions.

Here's a question for you, and I think that thinking carefully about the answer will help a lot with learning how to formalize: What does "Area of a Triangle = 1/2 base * height" mean? What even is a triangle, and how do you define its area? Is this theorem true by definition, and if not what are the relevant definitions? Depending on the answers, you will get very different proofs overall.
 
Am I headed in the right direction at all? I hope it's ok to ask so many questions.

Ask away. Don't be afraid to ask silly questions - we were all there once (and many of us are still there).

Mario

Giovanni Mascellani

unread,
Mar 2, 2019, 2:45:55 AM3/2/19
to meta...@googlegroups.com
Hi, welcome to Metamath!

Il 02/03/19 01:37, Mario Carneiro ha scritto:
> So your job as formalizer is to take this proof that you understand, and
> break it down to steps that are available as theorems in metamath. This
> might involve writing lemmas for subparts, and applying lots of prop
> calc theorems to manipulate the logic stuff. I recommend you get
> comfortable with that first, as it's an important part of getting
> started with doing real proofs of nontrivial theorems. I and others are
> available to help at any point if you get stuck or feel like you are
> doing it wrong.

In my experience this is the most difficult part, sometimes even
discouraging. Metamath is very low level, so you have to get your hands
dirty with all the details about the logical structure of the assertions
you need to prove. Working with quantifiers and doing substitutions is
especially painful in my experience. After some time working with it you
begin to get a grasp on this matter and everything goes much smoother,
although it always require some amount of brainpower to think at these
details.

My long term project about Metamath is to write some tooling that makes
all of this easier (i.e., make a program generate "trivial" steps that
humans do not like to care about). But very little is ready so far.

Keep in mind that when you are stuck there are very smart people on this
mailing list who are always very helpful.

Good luck, Giovanni.
--
Giovanni Mascellani <g.masc...@gmail.com>
Postdoc researcher - Université Libre de Bruxelles

signature.asc

Jon P

unread,
Mar 2, 2019, 6:21:19 AM3/2/19
to meta...@googlegroups.com

Edit: I feel a bit embarrassed by how simple these questions are so I'm going to go through the tutorial videos and the books a bit more to try and find answers. If anyone is interested in helping that would be nice but please don't feel any obligation. I feel I should try a bit harder before bothering people with simple questions. 

Edit 2: I made some progress and so have edited the post quite a lot. I managed to get a little chain of algebra going which was nice :)

Thank you for the helpful replies and encouragement. I've been playing a bit with mmj2 a bit this morning and have more newb questions. Please feel free to take time to answer or not to answer, I don't want to become a burden.

Firstly I was thinking about what you said Mario about triangles and areas and thought maybe a good idea is to state Heron's result in terms of vectors and the cross product. So a triangle is made of two vectors, A and B, and the area of it is 1/2 A X. B. What do you think? Is this a reasonable approach? Diagram

Here is my first scribblings in mmj2, it's not so good so far. Here are my questions with it.

1. with lawcos what is d1 about? I am a bit confused by it. Also how do I fill in the theorems for d1 - d5, for example it should be d2::something |-, what is the something?

2. With 220 is the number of conditions on that going to make it hard to work with? I pulled it out the air so maybe I need to prove that first before trying this theorem.

3. With 230 it didn't seem to like having 5 ands in a row in the conditions, is that a problem? When I put the last two in brackets it seemed to be happier, should it work without those brackets?

$( <MM> <PROOF_ASST> THEOREM=heron LOC_AFTER= aaa::df-area |- area = ( &S5 e. { &S4 e. ~P ( RR X. RR ) | ( A. &S3 e. RR ( &S4 " { &S3 } ) e. ( `' vol " RR ) /\ ( &S3 e. RR |-> ( vol ` ( &S4 " { &S3 } ) ) ) e. L^1 ) } |-> S. RR ( vol ` ( &S5 " { &S3 } ) ) _d &S3 ) !d1:: |- F = ( &S1 e. ( CC \ { 0 } ) , &S2 e. ( CC \ { 0 } ) |-> ( Im ` ( log ` ( &S2 / &S1 ) ) ) ) !d2:: |- a = ( abs ` ( A - 0 ) ) !d3:: |- b = ( abs ` ( B - 0 ) ) !d4:: |- c = ( abs ` ( B - A ) ) !d5:: |- O = ( ( A - 0 ) F ( B - 0 ) ) 10:d1,d2,d3,d4,d5:lawcos |- ( ( ( B e. CC /\ A e. CC /\ 0 e. CC ) /\ ( B =/= 0 /\ A =/= 0 ) ) -> ( c ^ 2 ) = ( ( ( a ^ 2 ) + ( b ^ 2 ) ) - ( 2 x. ( ( a x. b ) x. ( cos ` O ) ) ) ) ) *if O is complex then so are sin^2 O and cos^2 20::sincl |- ( O e. CC -> ( sin ` O ) e. CC ) 30::sqcl |- ( ( sin ` O ) e. CC -> ( ( sin ` O ) ^ 2 ) e. CC ) 40::coscl |- ( O e. CC -> ( cos ` O ) e. CC ) 50::sqcl |- ( ( cos ` O ) e. CC -> ( ( cos ` O ) ^ 2 ) e. CC ) *if you have A + B - B = C then A = C, strip this down so the conditions are just O 100::pncan |- ( ( ( ( sin ` O ) ^ 2 ) e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC ) -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) ) 101:30,100:sylan |- ( ( ( sin ` O ) e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC ) -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) ) 102:20,101:sylan |- ( ( O e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC ) -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) ) 103:50,102:sylan2 |- ( ( O e. CC /\ ( cos ` O ) e. CC ) -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) ) 104:40,103:sylan2 |- ( ( O e. CC /\ O e. CC ) -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) ) 105:104:anidms |- ( O e. CC -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) ) *start with sin^2 + cos^2 = 1 110::sincossq |- ( O e. CC -> ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 ) *add cos^2 to both sides 115:110:oveq1d |- ( O e. CC -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( 1 - ( ( cos ` O ) ^ 2 ) ) ) *simplify 120:105,115:eqtr3d |- ( O e. CC -> ( ( sin ` O ) ^ 2 ) = ( 1 - ( ( cos ` O ) ^ 2 ) ) ) *Use area formula 200:: |- ( ( A e. ( RR X. RR ) /\ B e. ( RR X. RR ) /\ O e. CC /\ ( a e. CC /\ b e. CC ) ) -> ( ( 1 / 2 ) x. ( A X. B ) ) = ( ( ( ( 1 / 2 ) x. a ) x. b ) x. ( sin ` O ) ) ) *square both sides 220:200:oveq1d |- ( ( A e. ( RR X. RR ) /\ B e. ( RR X. RR ) /\ O e. CC /\ ( a e. CC /\ b e. CC ) ) -> ( ( ( 1 / 2 ) x. ( A X. B ) ) ^ 2 ) = ( ( ( ( ( 1 / 2 ) x. a ) x. b ) x. ( sin ` O ) ) ^ 2 ) ) *distribute squared 230:220: |- ( ( A e. ( RR X. RR ) /\ B e. ( RR X. RR ) /\ O e. CC /\ ( a e. CC /\ b e. CC ) ) -> ( ( ( 1 / 2 ) x. ( A X. B ) ) ^ 2 ) = ( ( ( ( ( 1 / 2 ) x. a ) x. b ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) ) 1000:: |- s = ( ( ( a + b ) + c ) / 2 ) qed:: |- ( ( 1 / 2 ) x. ( A X. B ) ) = ( ( ( ( s x. ( s - a ) ) x. ( s - b ) ) x. ( s - c ) ) ^ ( 1 / 2 ) ) $)




Thierry Arnoux

unread,
Mar 3, 2019, 4:19:30 AM3/3/19
to meta...@googlegroups.com, Jon P

Hi Jon,

Let me try to answer, I hope I'll be clear enough:

1. What is lawcos.1 about?
It's actually written in the comments for ~lawcos:
` F ` is the signed angle construct (as used in ~ ang180 )
You could see ` F ` as a kind of local definition. In set.mm, we try to avoid as much as possible creating too many definitions (because they lead to additional axioms and theorems, and we would like to keep set.mm small). Here, the author has chosen not to define a new symbol for ` F `, and to instead repeat its definition in the hypothesis.

For example, I see that isosctrlem3.1 is using exactly the same definition, and that ~ angval exists to extract its value.

The way to fill this will probably ultimately be to use ~ eqid , like:
d1::eqid           |- ( x e. ( CC \ { 0 } ) , y e. ( CC \ { 0 } ) |-> ( Im ` ( log ` ( y / x ) ) ) ) = ( x e. ( CC \ { 0 } ) , y e. ( CC \ { 0 } ) |-> ( Im ` ( log ` ( y / x ) ) ) )

But what I would do would be to first keep "F" there, like this, without a proof for the step:
d1::           |- F = ( x e. ( CC \ { 0 } ) , y e. ( CC \ { 0 } ) |-> ( Im ` ( log ` ( y / x ) ) ) )

Then I would work through the final proof using "F". Once you are done, you can replace "F" everywhere by its long definition.

Alternatively, you could of course add this ' F = ... ' formula as a hypothesis in the final theorem. It does not make much sense if ` F ` actually appears nowhere in the theorem, so then you could drop it in a second version (again, using ~ eqid) - but it's more elegant to hide it throughout.

You can take care of steps d2~d4 in a similar way (using ~ eqid). This will result in having ` ( A - 0 ) ` in your formula: I would recommend simplifying it to ` A ` (using ~ subid1d) before further manipulating the formula. This exercise may be a bit annoying, it may have been avoided if a "deduction" formulation had been used for ~ lawcos.

2. With step 115 I wanted to just take something away from both sides, is there a way of doing this?

That would probably be ~ subcan2ad.
It looks like the other direction exists as a theorem (), but not this direction.
You'll see that all its hypothesis are filled in automatically, as well as the ~ mpbird which leads to your step 115.

111::subcan2ad |- ( O e. CC -> ( ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( 1 - ( ( cos ` O ) ^ 2 ) ) <-> ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 ) )

3. ovq1d filled in which was great :) Maybe I should be using sqr thoughout though, I am not sure, is the power ( 1 / 2 ) or sqr preferable?

I would use sqr! I guess you'll get ~ fveq2d automatically too!
I assume all the theorem you'll use will work with ` sqr `, so the conversion would be unnecessary effort, and sqr is a bit more natural/easier to read.

4. 140. I think is false, which is a problem, sqr (a ^ 2) = +- a however I only want the positive branch.

I have not tried to do the math, but I assume theorems like ~ sqrsq or ~ absre is what you'll end up using here (either adding an assumption that 0 <_ A, or working with ( abs ` A ) throughout.

One additional remark: the definition of S (it's your step 400, actually) should go into your hypothesis ($e), as this is something you'll not be able to prove.
Also, the theorem you state in QED misses assumptions: that A, B, C are complex numbers, for example. That theorem statement shall also probably not use sets (` a `, ` b `, ` c `), but instead the classes they correspond to (` A `, ` B ` , ` C `).

I hope this helps! Good luck, and don't hesitate to ask!
_
Thierry


On 02/03/2019 12:21, Jon P wrote:

Thank you for the helpful replies and encouragement. I've been playing a bit with mmj2 a bit this morning and have more newb questions. Please feel free to take time to answer or not to answer, I don't want to become a burden.

Firstly I was thinking about what you said Mario about triangles and areas and thought maybe a good idea is to state Heron's result in terms of vectors and the cross product. So a triangle is made of two vectors, A and B, and the area of it is 1/2 A X. B. What do you think? Is this a reasonable approach? Diagram

Here is my first scribblings in mmj2, it's not so good so far. Here are my questions with it.

1. with lawcos what is d1 about? I am a bit confused by it. Also how do I fill in the theorems for d1 - d5, for example it should be d2::something |-, what is the something?

2. With step 115 I wanted to just take something away from both sides, is there a way of doing this? I was hoping it would fill in automatically.

3. ovq1d filled in which was great :) Maybe I should be using sqr thoughout though, I am not sure, is the power ( 1 / 2 ) or sqr preferable?

4. 140. I think is false, which is a problem, sqr (a ^ 2) = +- a however I only want the positive branch. I am not sure what to do about this. I was wondering about squaring both sides of 500 and working from there but I will need to take a sqr at the end.



$( <MM> <PROOF_ASST> THEOREM=heron LOC_AFTER=




!d1::              |- F

                     = ( &S1

                       e. ( CC \ { 0 } )

                       , &S2

                       e. ( CC \ { 0 } )

                       |-> ( Im ` ( log ` ( &S2 / &S1 ) ) ) )

!d2::              |- a = ( abs ` ( A - 0 ) )

!d3::              |- b = ( abs ` ( B - 0 ) )

!d4::              |- c = ( abs ` ( B - A ) )

!d5::              |- O = ( ( A - 0 ) F ( B - 0 ) )

10:d1,d2,d3,d4,d5:lawcos

                  |- ( ( ( B e. CC /\ A e. CC /\ 0 e. CC )

                        /\ ( B =/= 0 /\ A =/= 0 ) )

                     -> ( c ^ 2 )

                        = ( ( ( a ^ 2 ) + ( b ^ 2 ) )

                            -

                            ( 2 x. ( ( a x. b ) x. ( cos ` O ) ) ) ) )

110::sincossq      |- ( O e. CC -> ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 )

115:: |- (  O e. CC -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) )

= ( 1 - ( ( cos ` O ) ^ 2 ) ) )

120:115: |- (  O e. CC -> ( ( sin ` O ) ^ 2 ) = ( 1 - ( ( cos ` O ) ^ 2 ) ) )

130:120:oveq1d |- (  O e. CC -> ( ( ( sin ` O ) ^ 2 ) ^ ( 1 / 2 ) )  = ( ( 1 - ( ( cos ` O ) ^ 2 ) ) ^ ( 1 / 2 ) ) )


140:: |- ( O e. CC -> ( sqr ` ( O ^ 2 ) ) = O )

150:130,140: |- (  O e. CC -> ( sin ` O )  = ( ( 1 - ( ( cos ` O ) ^ 2 ) ) ^ ( 1 / 2 ) ) )


400:: |- s = ( ( ( a + b ) + c ) / 2 )

500:: |- ( ( 1 / 2 ) x. ( A X. B ) ) = ( ( ( ( 1 / 2 ) x. a ) x. b ) x. ( sin ` O ) )

qed:: |- ( ( 1 / 2 ) x. ( A X. B ) )

= ( ( ( ( s x. ( s - a ) ) x. ( s - b ) ) x. ( s - c ) )  ^ ( 1 / 2 ) )


$)



--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+u...@googlegroups.com.
To post to this group, send email to meta...@googlegroups.com.
Visit this group at https://groups.google.com/group/metamath.
For more options, visit https://groups.google.com/d/optout.

Jon P

unread,
Mar 6, 2019, 12:04:57 PM3/6/19
to Metamath
Thanks for the help, that's been really useful.

I have been bashing away at the proof for a few days. I think I have got the hang of using the program a bit, I think the general idea is that every change to the string of symbols has to be justified.

If anyone is willing to look at what I have done and give me some advice that would be great. Is this proof worth continuing with? Am I doing things in a sensible way? It's been a great learning exercise however I wonder if it's not actually that useful. It's also getting pretty long so maybe it should be broken into lemmas?

For one thing the definition of the area at the top just hangs in the air, maybe it is better to do some work there first, I am unsure. Any guidance would be really helpful.

$( <MM> <PROOF_ASST> THEOREM=heron LOC_AFTER=

*Define Area formula
area:: |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( 1 / 2 ) x. ( A X. B ) ) = ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) )

*get lawcos
!d1::              |-   F
                      = (   x
                        e.  ( CC \ { 0 } )
                        ,   y
                        e.  ( CC \ { 0 } )
                        |-> ( Im ` ( log ` ( y / x ) ) ) )
!d2::              |- X = ( abs ` ( A - C ) )
!d3::              |- Y = ( abs ` ( B - C ) )
!d4::              |- Z = ( abs ` ( B - A ) )
!d5::              |- O = ( ( A - C ) F ( B - C ) )
12:d1,d2,d3,d4,d5:lawcos 
                   |- (  (  ( B e. CC /\ A e. CC /\ C e. CC )
                         /\ ( B =/= C /\ A =/= C ) )
                      ->   ( Z ^ 2 )
                         = ( ( ( X ^ 2 ) + ( Y ^ 2 ) )
                             -
                             ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) )

*prove conditions from lawcos
bacba::simpl |- ( ( ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( B e. CC /\ A e. CC /\ C e. CC ) )

*X e. CC
x1::subcl |- ( ( A e. CC /\ C e. CC ) -> ( A - C ) e. CC )
x2:x1:3adant1 |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( A - C ) e. CC )
x3:x2:abscld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( abs ` ( A - C ) ) e. RR )
x4:d2,x3:syl5eqel |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> X e. RR )
x5:x4:recnd |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> X e. CC )
xcc:x5:adantr |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> X e. CC )
x6::sqcl |- ( X e. CC -> ( X ^ 2 ) e. CC ) 
x7:x5,x6:syl |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( X ^ 2 ) e. CC )

*Y e. CC
y1::subcl |- ( ( B e. CC /\ C e. CC ) -> ( B - C ) e. CC )
y2:y1:3adant2 |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( B - C ) e. CC )
y3:y2:abscld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( abs ` ( B - C ) ) e. RR )
y4:d3,y3:syl5eqel |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> Y e. RR )
y5:y4:recnd |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> Y e. CC )
ycc:y5:adantr |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> Y e. CC )
y6::sqcl |- ( Y e. CC -> ( Y ^ 2 ) e. CC ) 
y7:y5,y6:syl |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( Y ^ 2 ) e. CC )

*Z e. CC
z1::subcl |- ( ( B e. CC /\ A e. CC ) -> ( B - A ) e. CC )
z2:z1:3adant3 |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( B - A ) e. CC )
z3:z2:abscld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( abs ` ( B - A ) ) e. RR )
z4:d4,z3:syl5eqel |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> Z e. RR )
z5:z4:recnd |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> Z e. CC )
zcc:z5:adantr |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> Z e. CC )
z6::sqcl |- ( Z e. CC -> ( Z ^ 2 ) e. CC ) 
z7:z5,z6:syl |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( Z ^ 2 ) e. CC )

xaycc:xcc,ycc:jca |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> ( X e. CC /\  Y e. CC ) )
xycc:x5,y5:mulcld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( X x. Y ) e. CC )
x2y2cc:x7,y7:addcld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( ( X ^ 2 ) + ( Y ^ 2 ) ) e. CC )

*O e. CC
o1:x2,y2:jca |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( ( A - C ) e. CC /\ ( B - C ) e. CC ) )
o2:d1,d5: |- ( ( ( A - C ) e. CC /\ ( B - C ) e. CC ) ->  ( ( A - C ) F ( B - C ) ) e. CC )
o3:o1,o2:syl |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( ( A - C ) F ( B - C ) ) e. CC ) 
o4:d5,o3:syl5eqel |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> O e. CC )
occ:o4:adantr |- ( ( ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) -> O e. CC )
*if O is complex then so are sin^2 O and cos^2
osin::sincl |- ( O e. CC -> ( sin ` O ) e. CC )
osincc:occ,osin:syl |- ( ( ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) -> ( sin ` O ) e. CC )

osin2::sqcl |- ( ( sin ` O ) e. CC -> ( ( sin ` O ) ^ 2 ) e. CC )
ocos::coscl |- ( O e. CC -> ( cos ` O ) e. CC )
ocoscc:o4:coscld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( cos ` O ) e. CC )
ocos2::sqcl |- ( ( cos ` O ) e. CC -> ( ( cos ` O ) ^ 2 ) e. CC )
xyocoscc:xycc,ocoscc:mulcld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> ( ( X x. Y ) x. ( cos ` O ) ) e. CC ) 
xyocoscc2:xyocoscc:adantr |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> ( ( X x. Y ) x. ( cos ` O ) ) e. CC )
*constants
2cc::2cnd |- ( ( B e. CC /\ A e. CC /\ C e. CC ) -> 2 e. CC )
1cc::ax1cn |- 1 e. CC 
2cc2::2cn |- 2 e. CC
2n0::2ne0 |- 2 =/= 0
1o2cc2::divcl |- (  ( 1 e. CC /\ 2 e. CC /\ 2 =/= 0 ) -> ( 1 / 2 ) e. CC )
1o2cc:1cc,2cc2,2n0:divcli |- ( 1 / 2 ) e. CC
cond102cc:1o2cc:a1i |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) -> ( 1 / 2 ) e. CC )

1o2xcc:cond102cc,xcc:mulcld |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( 1 / 2 ) x. X ) e. CC )
1o2xcc2:1o2xcc,ycc:mulcld |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( 1 / 2 ) x. X ) x. Y ) e. CC )
1o2xcc3:1o2xcc2,osincc:jca |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( ( 1 / 2 ) x. X ) x. Y ) e. CC /\ ( sin ` O ) e. CC ) )

2xyocoscc:2cc,xyocoscc:mulcld |- ( ( B e. CC /\ A e. CC /\ C e. CC ) 
-> ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC )
2xyocoscc2:bacba,2xyocoscc:syl |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
->  ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC )
2xyocoscc3:2xyocoscc2,cond102cc:jca |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ ( 1 / 2 ) e. CC ) )
2xyocoscc4:2xyocoscc2,2cc2:jctir |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ 2 e. CC ) )
x2y22xyocoscc:x2y2cc,2xyocoscc:jca |- ( ( B e. CC /\ A e. CC /\ C e. CC ) 
-> (  ( ( X ^ 2 ) + ( Y ^ 2 ) ) e. CC /\ ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC ) )



*rearrange lawcos so cos is on the right
*swap sides
13::eqcom  |- ( ( Z ^ 2 ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
 <->   ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) = ( Z ^ 2 ) )
14:12,13:sylib |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) = ( Z ^ 2 ) )
*subtract cos from both sides
15:14:oveq1d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
  = ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) )
*prepare to cancel coses
16::npcan |- (  (  ( ( X ^ 2 ) + ( Y ^ 2 ) ) e. CC /\    ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC )
->   ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
= ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
*cancel the coses on the left 
16z:x2y22xyocoscc,16:syl |- ( ( B e. CC /\ A e. CC /\ C e. CC ) 
->   ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
= ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
16zb:bacba,16z:syl |- ( ( ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
->   ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
= ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
17:16zb,15:eqtr3d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( X ^ 2 ) + ( Y ^ 2 ) )  
  = ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) ) 
*swap the sides 
18::eqcom  |- ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) = ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
<->   ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) = ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
19:17,18:sylib |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
 -> ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) = ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
*move Z^2 to the other side
20:19:oveq1d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) - ( Z ^ 2 ) ) 
= ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) )
21::pncan2 |- (  (  ( Z ^ 2 ) e. CC /\ ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC )
->   ( ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) - ( Z ^ 2 ) )
= ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
23:z7,2xyocoscc:pncan2d |- ( ( B e. CC /\ A e. CC /\ C e. CC )
->   ( ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) - ( Z ^ 2 ) )
= ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
24:23:adantr |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
->   ( ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) - ( Z ^ 2 ) )
= ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) 
25:24,20:eqtr3d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) )
*divide by 2
26::axmulcl |- ( ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ ( 1 / 2 ) e. CC ) 
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) x. ( 1 / 2 ) ) e. CC )
27:2xyocoscc3,26:syl |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) x. ( 1 / 2 ) ) e. CC )

34:25:oveq1d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) x. ( 1 / 2 ) ) = ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) x. ( 1 / 2 ) ) )
35::divrec |- ( ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ 2 e. CC /\ 2 =/= 0 )
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) x. ( 1 / 2 ) ) )
37:2xyocoscc4,2n0:jctir |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ 2 e. CC ) /\ 2 =/= 0 ) )
38:35:3expa |- (  ( ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ 2 e. CC ) /\ 2 =/= 0 )
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) x. ( 1 / 2 ) ) )
39:37,38:syl |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) x. ( 1 / 2 ) ) )
40::divcan3 |- ( ( ( ( X x. Y ) x. ( cos ` O ) ) e. CC /\ 2 e. CC /\ 2 =/= 0 )
->  ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( X x. Y ) x. ( cos ` O ) ) )
41:40:3expa |- ( ( ( ( ( X x. Y ) x. ( cos ` O ) ) e. CC /\ 2 e. CC ) /\ 2 =/= 0 )
->  ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( X x. Y ) x. ( cos ` O ) ) )
43:xyocoscc2,2cc2:jctir |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> ( ( ( X x. Y ) x. ( cos ` O ) ) e. CC /\ 2 e. CC ) )
44:43,2n0:jctir |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) ) 
-> ( ( ( ( X x. Y ) x. ( cos ` O ) ) e. CC /\ 2 e. CC ) /\ 2 =/= 0 ) )
50:44,41:syl |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
->  ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( X x. Y ) x. ( cos ` O ) ) )
51:39,34:eqtrd |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) x. ( 1 / 2 ) ) )
52:50,51:eqtr3d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( X x. Y ) x. ( cos ` O ) )  = ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) x. ( 1 / 2 ) ) )
* :) lawcos has been rearranged!

*if you have A + B - B = C then A = C, strip this down so the conditions are just O
100::pncan  |- (  (  ( ( sin ` O ) ^ 2 ) e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC )
->  ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )
101:osin2,100:sylan |- (  (  ( sin ` O ) e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC )
->   ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )
102:osin,101:sylan |- (  (  O e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC )
->   ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )
103:ocos2,102:sylan2 |- (  (  O e. CC /\ ( cos ` O ) e. CC )
->   ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )
104:ocos,103:sylan2 |- (  (  O e. CC /\ O e. CC )
->   ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )
105:104:anidms |- ( O e. CC
->   ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )

*start with sin^2 + cos^2 = 1
110::sincossq      |- (  O e. CC ->   ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 )
*subtract cos^2 from both sides
115:110:oveq1d |- (  O e. CC ->   ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) 
= ( 1 - ( ( cos ` O ) ^ 2 ) ) )
*simplify
120:105,115:eqtr3d |- (  O e. CC ->   ( ( sin ` O ) ^ 2 ) = ( 1 - ( ( cos ` O ) ^ 2 ) ) )


*take the area formula and square both sides
220:area:oveq1d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( 1 / 2 ) x. ( A X. B ) ) ^ 2 ) = ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) ) 
*distributing square rule
225a::sqmul |- ( ( X e. CC /\ Y e. CC ) -> ( ( X x. Y ) ^ 2 ) = ( ( X ^ 2 ) x. ( Y ^ 2 ) ) )
226:xaycc,225a:syl |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( X x. Y ) ^ 2 ) = ( ( X ^ 2 ) x. ( Y ^ 2 ) ) )
225::sqmul |- ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) e. CC /\ ( sin ` O ) e. CC ) 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) )
227:1o2xcc3,225:syl |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) )  
*distribute squared
230:220,227:eqtrd |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( ( 1 / 2 ) x. ( A X. B ) ) ^ 2 ) =  ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) ) 
*substitue cos for sin
236:occ,120:syl  |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
-> ( ( sin ` O ) ^ 2 ) = ( 1 - ( ( cos ` O ) ^ 2 ) ) )
237:236:oveq2d |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
->   ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) )
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( 1 - ( ( cos ` O ) ^ 2 ) ) ) )
240:230,237:eqtrd |- (  (  ( B e. CC /\ A e. CC /\ C e. CC ) /\ ( B =/= C /\ A =/= C ) )
->   ( ( ( 1 / 2 ) x. ( A X. B ) ) ^ 2 )
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( 1 - ( ( cos ` O ) ^ 2 ) ) ) )

Thierry Arnoux

unread,
Mar 6, 2019, 8:24:12 PM3/6/19
to meta...@googlegroups.com, Jon P

Hi Jon,

Ok, let me try to help again.

First, obviously you've progressed well already, well done!

Still, let's get back to the basics: in your proof,

  • A, B, and C are the complex representations of the 3 vertices of your triangle.
  • X, Y and Z are the lengths of the segments AC, BC and BA respectively. They correspond to a, b, c in the Wikipedia proof.
  • O is the angle opposite to the side Z, it corresponds to γ in the Wikipedia proof.
  • S shall be a new class variable, corresponding to s in the Wikipedia proof, the semi-perimeter of the triangle

So I would first rewrite the theorem in your MM file:

  ${
    heron.f $e |- F = ( x e. ( CC \ { 0 } ) , y e. ( CC \ { 0 } ) |->
( Im ` ( log ` ( y / x ) ) ) ) $.
    heron.x $e |- X = ( abs ` ( B - C ) ) $.
    heron.y $e |- Y = ( abs ` ( A - C ) ) $.
    heron.z $e |- Z = ( abs ` ( A - B ) ) $.
    heron.o $e |- O = ( ( B - C ) F ( A - C ) ) $.
   
heron.s $e |- S = ( ( ( X + Y ) + Z ) / 2 ) $.
    heron.a $e |- ( ph -> A e. CC ) $.
    heron.b $e |- ( ph -> B e. CC ) $.
    heron.c $e |- ( ph -> C e. CC ) $.
   
heron.d $e |- ( ph ->
( A =/= C /\ B =/= C ) ) $.
    $( Heron's Formula ... $)
    heron $p |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) )
         = ( sqr ` ( ( S x. ( S - Z ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) ) $=
      ? $.
  $}

Here, I have added in the hypothesis the definitions for F, X, Y, Z, O (same as in the law of cosines) and for S (the semi perimeter).
I have also added conditions to the theorem's formula: all points of the triangle are distinct complex numbers. And I have corrected the variables (X, Y, Z, S instead of a, b, c, s).
This way, we have a clear goal  :)

With this formulation "area", is actually the left hand side of the theorem (it's using X and Y and not A and B), and it's not something you need to prove. (I've also added "abs" there because with our definition of "O", "O" can be negative, and so its sine, but we want a positive area here)

Of course one may wish to prove that ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) is indeed the area of the triangle, but that's another story, let's leave that for your second proof ;-)

The formulation I chose is a "deduction" one, meaning I also introduce a wff variable ph. This shall make proof writing a bit less tedious, since you will not have to repeat "( A e. CC /\ B e. CC /\ ..." etc. at the start of each line.

You should be able to prove things like ( ph -> O e. RR ) easily, you're almost there (hint: use ~ ovmpt2d for your step o2).

Your next step would be using ~ fveq2d and ~ absre, to get something like:

    |- ( ph -> ( abs ` ( sin ` O ) ) = ( sqr ` ( ( sin ` O ) ^ 2 ) ) )

Continue like this, I believe you're on the right track!

_
Thierry

Jon P

unread,
Mar 7, 2019, 6:49:36 AM3/7/19
to Metamath

Thank you so much for your help and encouragement :) :)

I think you've given me the pieces I needed so hopefully I can finish the proof now, just a lot of wrestling with algebra ahead.
Message has been deleted

Jon P

unread,
Mar 9, 2019, 5:57:48 AM3/9/19
to Metamath
Can anyone help me find this? I have searched and cannot see it.

( ( ( B - C ) e. CC /\ ( B - C ) =/= 0 ) -> ( B - C ) e. ( CC / { 0 } ) )

Mario Carneiro

unread,
Mar 9, 2019, 6:10:44 AM3/9/19
to metamath
I think it's called eldifsn

On Sat, Mar 9, 2019 at 5:57 AM Jon P <drjonp...@gmail.com> wrote:
Can anyone help me find this? I have searched and cannot see it.

( ( ( B - C ) e. CC /\ ( B - C ) =/= 0 ) -> ( B - C ) e. ( CC / { 0 } ) )

--

Mario Carneiro

unread,
Mar 9, 2019, 6:11:46 AM3/9/19
to metamath
Your search is probably failing because you used the division symbol "/" instead of set difference "\"

Jon P

unread,
Mar 9, 2019, 6:40:21 AM3/9/19
to Metamath
Great thanks :)

Jon P

unread,
Mar 9, 2019, 12:14:43 PM3/9/19
to Metamath
Does anyone have advice for this sort of situation. The specific algebra is not so important, it's more a question about how to replace a value inside a big expression.

Say I have

A = B

and

( Y * Q ) = ( ( X * A ) / L )

what is the fastest way to get to 

( Y * Q ) = ( ( X * B ) / L )

because at the moment I am basically doing this every time:

A = B
( X * A ) = ( X * B )
( ( X * A ) / L ) = ( ( X * B )  / L )

and then the substitution is allowed.

I am crawling along because doing any algebra at all on a reasonably large expression takes forever. For example to go from here

( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) )

to here

( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 )
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( ( X x. Y ) ^ 2 ) x. 1 )  
- ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )

has taken 15 steps! And all that has happened is the (XY)^2 term is moved into the bracket an distributed. Is this normal for metamath? 

To finish this proof I have 6 lines on my piece of paper but it has taken these 15 steps to do part of one of them. This could make the proof need 90 more steps.

Jim Kingdon

unread,
Mar 9, 2019, 12:52:42 PM3/9/19
to Jon P, Metamath
Sadly, that's how you do substitution.

Sometimes you can rearrange the proof so that you deal with the inner part of the formula/term first and only later need to embed it into the larger formula/term.

David A. Wheeler

unread,
Mar 9, 2019, 1:00:18 PM3/9/19
to Jon P, Metamath
I have started some experiments on doing algebra in a more efficient way in metamath. You can check it out in my math box. Let me know if that would be useful.

--- David A.Wheeler

Thierry Arnoux

unread,
Mar 9, 2019, 1:06:52 PM3/9/19
to meta...@googlegroups.com, Jon P
Yes, unfortunately that’s what the « no plumbing » is about!
MMJ2 has some mechanisms to fill in blanks, that would be a nice addition!
_
Thierry

Mario Carneiro

unread,
Mar 9, 2019, 2:14:28 PM3/9/19
to metamath, Jon P

If I write this in a slightly more compact way, you wanted to get from
((((1/2) * x) * y) * sin O)^2 = (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
to
((((1/2) * x) * y) * sin O)^2 = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)

(I took the liberty of simplifying the ovbious cancellations once you get to that point.) Here are the metamath steps I would expect to see for this (numbered in the order I wrote them, and ignoring closure steps):

H1: |- ((((1/2) * x) * y) * sin O)^2 = (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
8:mulassd |- ((1/2) * x) * y = (1/2) * (x * y)
6:8 |- (((1/2) * x) * y)^2 = ((1/2) * (x * y))^2
7:mulexp |- ((1/2) * (x * y))^2 = (1/2)^2 * (x * y)^2
5:6,7 |- (((1/2) * x) * y)^2 = (1/2)^2 * (x * y)^2
3:5 |- (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = ((1/2)^2 * (x * y)^2) * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) 
9:mulassd |- ((1/2)^2 * (x * y)^2) * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (1/2)^2 * ((x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2))
12:mulsubdid |- (x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (x * y)^2 * 1 - (x * y)^2 * ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
14:mulid1d |- (x * y)^2 * 1 = (x * y)^2
15:divcan2d |- (x * y)^2 * ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = ((x^2 + y^2 - z^2)/2)^2
13:14,15 |- (x * y)^2 * 1 - (x * y)^2 * ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (x * y)^2 - ((x^2 + y^2 - z^2)/2)^2
11:12,13 |- (x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) =  (x * y)^2 - ((x^2 + y^2 - z^2)/2)^2
10:11 |- (1/2)^2 * ((x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)) = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)
4:9,10 |- ((1/2)^2 * (x * y)^2) * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)
2:3,4 |- (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)
qed:1,2 |- ((((1/2) * x) * y) * sin O)^2 = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)

The basic strategy is to perform top level simplifications first, then try to break up the expression into subparts with equality lemmas and then work on the smaller terms.

Mario Carneiro

David A. Wheeler

unread,
Mar 9, 2019, 2:19:03 PM3/9/19
to metamath
On Sat, 9 Mar 2019 09:14:42 -0800 (PST), Jon P <drjonp...@gmail.com> wrote:
> Does anyone have advice for this sort of situation. The specific algebra is
> not so important, it's more a question about how to replace a value inside
> a big expression.

"Growing" the expression works every time, but can be a pain.

You might look at my "Algebra helpers" section, which is an experiment
in trying to do something simpler.

To see what *using* them looks like, check out:

* ilines http://us.metamath.org/mpeuni/i2lines.html
* ilinesd http://us.metamath.org/mpeuni/i2linesd.html

The "-d" suffix version is in deduction form ("ph -> " starts everything).

The algebra helpers add a bunch of small rules that
work at a slightly higher level. For example:

mvlraddi http://us.metamath.org/mpeuni/mvlraddi.html
is "Move LHS right addition to RHS", that is,
A e. CC, B e. CC, (A + B ) = C => A = ( C - B )

There are some obvious steps that aren't implemented, but
it's also pretty obvious how to do them.
I haven't gone further because it wasn't clear if anyone would
want to use them. They're more interesting to complete if
someone will use them :-).

I say "experiment" because I wasn't sure who would use them.
They are, of course, proven to be correct.

Please take a look & tell me if they appear to be useful to you!

--- David A. Wheeler

Mario Carneiro

unread,
Mar 9, 2019, 2:47:40 PM3/9/19
to metamath
On Sat, Mar 9, 2019 at 2:14 PM Mario Carneiro <di....@gmail.com> wrote:
H1: |- ((((1/2) * x) * y) * sin O)^2 = (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
8:mulassd |- ((1/2) * x) * y = (1/2) * (x * y)
6:8 |- (((1/2) * x) * y)^2 = ((1/2) * (x * y))^2
7:mulexp |- ((1/2) * (x * y))^2 = (1/2)^2 * (x * y)^2
5:6,7 |- (((1/2) * x) * y)^2 = (1/2)^2 * (x * y)^2
3:5 |- (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = ((1/2)^2 * (x * y)^2) * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) 
9:mulassd |- ((1/2)^2 * (x * y)^2) * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (1/2)^2 * ((x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2))
12:mulsubdid |- (x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (x * y)^2 * 1 - (x * y)^2 * ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
14:mulid1d |- (x * y)^2 * 1 = (x * y)^2
15:divcan2d |- (x * y)^2 * ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = ((x^2 + y^2 - z^2)/2)^2
13:14,15 |- (x * y)^2 * 1 - (x * y)^2 * ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (x * y)^2 - ((x^2 + y^2 - z^2)/2)^2
11:12,13 |- (x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) =  (x * y)^2 - ((x^2 + y^2 - z^2)/2)^2
10:11 |- (1/2)^2 * ((x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)) = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)
4:9,10 |- ((1/2)^2 * (x * y)^2) * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)
2:3,4 |- (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2) = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)
qed:1,2 |- ((((1/2) * x) * y) * sin O)^2 = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)

Another way to understand what's going on is to view this relative to the equivalent mathematician's equational proof:


((((1/2) * x) * y) * sin O)^2
(1)   = (((1/2) * x) * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
(8)   = ((1/2) * (x * y))^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
(7)   = ((1/2)^2 * (x * y)^2) * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2)
(9)   = (1/2)^2 * ((x * y)^2 * (1 - ((x^2 + y^2 - z^2)/2)^2 / (x*y)^2))
(12)   = (1/2)^2 * ((x * y)^2 * 1 - (x * y)^2 * (((x^2 + y^2 - z^2)/2)^2 / (x*y)^2))
(14)   = (1/2)^2 * ((x * y)^2 - (x * y)^2 * (((x^2 + y^2 - z^2)/2)^2 / (x*y)^2))
(15)   = (1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)

(The equalities are labeled after the equivalent steps in the metamath proof.) Note that most of these intermediates don't ever appear as terms in the metamath version. If you proved each of these equalities separately and rebuilt the terms each time, the metamath proof would be a lot longer.

If have a top level rewrite proof like this you can get the metamath proof by observing that steps 12,14,15 here are all working on the subterm (1/2)^2 * _ , so you can do all four steps inside a subterm rewrite. Similarly, 8 and 7 happen together in the left subterm, and 14 and 15 are working on disjoint subterms so they can be done simultaneously (this is step 13 in the metamath proof, which uses oveq12d to break out two subproofs). Sometimes you have to arrange the steps to happen in a certain order so that you get a lot of subterm rewrites like this, but for the most part it's almost unique. If I proved this theorem on two different days I would expect to see no difference at all in the proof approach - it's a pretty rigid style.

Also, one consequence of this style is that it's really best if you do the entire proof end to end this way, where the LHS and RHS are from the full theorem, rather than just a subproof, because of the way that these proofs combine. If I wanted to throw in another rewrite to the proof, for example simplifying (1/2)^2 to 1/4, I would not prove

(1/2)^2 * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2) = (1/4) * ((x * y)^2 - ((x^2 + y^2 - z^2)/2)^2)

and tack it on the end of the above proof. Instead I would insert it into the middle of the rewrite chain, so that 1/4 appears on the RHS of steps qed,2,4,10, and 10 changes to a oveq12d proof so I can insert the proof that (1/2)^2 = 1/4 on the left.

Jon P

unread,
Mar 9, 2019, 2:50:26 PM3/9/19
to Metamath
Thanks for all the help :)

I see the idea of doing more inside the bracket before substituting the whole expression, this is an improvement I think. Thanks for writing that out Mario, I will take a look.

David those are theorems I looked for, like A + B = C -> A = C - B, as doing it in two steps now is not so great. So yes I think that is an interesting approach. I think it might be helpful to develop some more of these higher level formulas, I could maybe help you when I am done with this monster :)

Jon P

unread,
Mar 10, 2019, 6:38:21 AM3/10/19
to meta...@googlegroups.com
Hey, so I think I'm going to stop doing this proof, it is just extremely painful to try and do algebra on large expressions with these tools. I am just trying to multiply up by ( 2 ^ 2 ) = 4 and it's just a nightmare of so many steps. I didn't understand when I started this proof how difficult the algebra was going to be, on wikipedia it's just 5 lines a highschooler could do so I figured it wouldn't take so long.

I think these would be my thoughts about MetaMath having played around with it for 2 weeks:

1. Metamath is awesome, it's amazing how many theorems there are and how much progress has been made. 

2. I am convinced computer assisted proofs are the future of mathematics. It always seemed insane to me that I would prove something and show it to my supervisor and if we both felt it was right then we assumed it was. Having the computer check your work is super helpful and I think in 20 years it will seem ridiculous to try and prove things by hand.

3. It would have been helpful to get a warning when I started on this proof about how long and hard it would be. If you have beginners come along maybe it is worth trying to set them a 5 line proof or something as an exercise. Basically I just waded in way too deep and got stuck and have now failed which is not such a nice experience, though I have learned a lot which is good and am also thankful for all the help people gave.

4. The biggest weakness of Metamath is the tooling. I think mmj2 is great and obviously has had a lot of work go into it so I want to praise that. I think there's 4 areas where it could really be improved:

A. It's hard how strict it is that there must be a gap between brackets and how it can't tell you which bracket isn't closed. When it parses the line into a tree I think there will be a point where it expects a bracket and doesn't find one so should be able to tell you that info maybe, though I am not sure. 

B. Also I wanted to ask, if it is true that A = B -> F(A) = F(B), which I think is something that is proven in set.mm, then should it not be possible to replace any sub expression of a statement? For example if A = B -> ((W x. A)/C) = ((W x. B)/C) by the same reasoning?

C. Using work variables is a nice system however when you fill them in it formats the result in a difficult way (with many line breaks) and so it is then a time consuming task to delete all this extra whitespace to get back to a reasonable form. This is connected to the fact that the editor is cannot wrap around lines. 

On the subject of work variables it would be great if you could wrap an expression into a temporary variable and then work with this for a while and then at the end just replace that temporary variable with the expression it represents. I think that is the idea for work variables and it would be really nice if it could make things a lot easier.

D. Before anyone would seriously use metamath as a theorem prover it would need to work at a higher level, it would be amazing to have a computer algebra system or similar which let you do standard manipulations easily. I understand David you are working in this direction and the stuff you are doing looks helpful.

I had a bit of a look at Norm's talk about MM and one of the things in it is that the goal isn't to make MM into a theorem prover that working mathematicians would use. However I am sure that over the next while some tool will come to fill this position just because it is such an enormous assistance in proving things, however it is a lot of work to get to that point as it needs the whole tree of mathematics filled in and it needs to be a flexible and easy to use tool.

Anyway I would love to be able to help make a really fluid tool, I can program however I am not so good with large programs already written and I don't know Java so it would be a bit difficult to help with that. I wondered about making my own tool however that is probably more work than I can accomplish so sorry about that.

Thanks to everyone who has tried to help me, I am thankful for that.

Here is the proof as far as I got with it in case it is any help to anyone, as you can see it is reasonably well progressed however there is still quite a distance to go.

$( <MM> <PROOF_ASST> THEOREM=heron  LOC_AFTER=?

* Heron's Formula ...

h1::heron.f  |-   F = (   x e.  ( CC \ { 0 } ) , y e.  ( CC \ { 0 } ) |-> ( Im ` ( log ` ( y / x ) ) ) )
h2::heron.x        |- X = ( abs ` ( B - C ) )
h3::heron.y        |- Y = ( abs ` ( A - C ) )
h4::heron.z        |- Z = ( abs ` ( A - B ) )
h5::heron.o        |- O = ( ( B - C ) F ( A - C ) )
h6::heron.s        |- S = ( ( ( X + Y ) + Z ) / 2 )
h7::heron.a        |- ( ph -> A e. CC )
h8::heron.b        |- ( ph -> B e. CC )
h9::heron.c        |- ( ph -> C e. CC )
h10::heron.d       |- ( ph -> ( A =/= C /\ B =/= C ) )

*prove the range of F is RR
rf1x::eldifi |- ( x e. ( CC \ { 0 } ) -> x e. CC )
rf1y::eldifi |- ( y e. ( CC \ { 0 } ) -> y e. CC )
rf2::divcl |- ( ( y e. CC /\ x e. CC /\ x =/= 0 ) -> ( y / x ) e. CC )
rf3:rf2:3expa |- ( ( ( y e. CC /\ x e. CC ) /\ x =/= 0 ) -> ( y / x ) e. CC )
rf4x::eldifsni |- ( x e. ( CC \ { 0 } ) ->  x =/= 0 )
rf4y::eldifsni |- ( y e. ( CC \ { 0 } ) ->  y =/= 0 )
rf5x:rf1x,rf4x:jca |- ( x e. ( CC \ { 0 } ) ->  ( x e. CC /\ x =/= 0 )  )
rf5y:rf1y,rf4y:jca |- ( y e. ( CC \ { 0 } ) ->  ( y e. CC /\ y =/= 0 )  )
rf6:rf4x:adantl |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> x =/= 0 )
rf7:rf1y,rf1x:anim12i |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( y e. CC /\ x e. CC ) )
rf8:rf7,rf6:jca |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( ( y e. CC /\ x e. CC ) /\ x =/= 0 ) )
rf9:rf8,rf3:syl |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( y / x ) e. CC )
rf10::divne0 |- (  ( ( y e. CC /\ y =/= 0 ) /\ ( x e. CC /\ x =/= 0 ) ) -> ( y / x ) =/= 0 )
rf11x:rf5x:adantl |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( x e. CC /\ x =/= 0 ) )
rf11y:rf5y:adantr |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( y e. CC /\ y =/= 0 ) )
rf12:rf11y,rf11x:jca |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( ( y e. CC /\ y =/= 0 ) /\ ( x e. CC /\ x =/= 0 ) ) )
rf13:rf12,rf10:syl |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( y / x ) =/= 0 )
rf14::logcl |- ( ( ( y / x ) e. CC /\ ( y / x ) =/= 0 ) -> ( log ` ( y / x ) ) e. CC )
rf15:rf9,rf13:jca |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( ( y / x ) e. CC /\ ( y / x ) =/= 0 ) )
rf16:rf15,rf14:syl |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( log ` ( y / x ) ) e. CC )
rf17::imcl |- ( ( log ` ( y / x ) ) e. CC ->  ( Im ` ( log ` ( y / x ) ) ) e. RR )
rf18:rf16,rf17:syl |- ( ( y e. ( CC \ { 0 } ) /\ x e. ( CC \ { 0 } ) ) -> ( Im ` ( log ` ( y / x ) ) ) e. RR )

*use lawcos
lawcos:1,2,3,4,5:lawcos  |- (  (  ( A e. CC /\ B e. CC /\ C e. CC ) /\ ( A =/= C /\ B =/= C ) )
->   ( Z ^ 2 ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) )
*change lawcos conditions
ph1:7,8,9:3jca |- ( ph -> ( A e. CC /\ B e. CC /\ C e. CC ) ) 
ph2:ph1,10:jca |- ( ph -> (  ( A e. CC /\ B e. CC /\ C e. CC ) /\ ( A =/= C /\ B =/= C ) ) )
lawcosph:ph2,lawcos:syl |- (  ph
->   ( Z ^ 2 ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) )

*build conditions
*X e. CC
x1::subcl |- ( ( B e. CC /\ C e. CC ) -> ( B - C ) e. CC )
x2:8,9:jca |- ( ph -> ( B e. CC /\ C e. CC ) )
x3:x2,x1:syl |- ( ph -> ( B - C ) e. CC )
x4:x3:abscld |- ( ph -> ( abs ` ( B - C ) ) e. RR )
x5:2,x4:syl5eqel |- ( ph -> X e. RR )
x6:x5:recnd |- ( ph -> X e. CC )
x7:x6:sqcld |- ( ph -> ( X ^ 2 ) e. CC ) 
x8:10:simprd       |- ( ph -> B =/= C )
x9:8,9,x8:subne0d   |- ( ph -> ( B - C ) =/= 0 )
x10::absgt0 |- (  ( B - C ) e. CC -> (   ( B - C ) =/= 0 <-> 0 < ( abs ` ( B - C ) ) ) )
x11:x3,x10:syl |- ( ph -> (  ( B - C ) =/= 0 <-> 0 < ( abs ` ( B - C ) ) ) )
x12:x9,x11:mpbid |- ( ph -> 0 < ( abs ` ( B - C ) ) )
x13:x12:gt0ne0d |- ( ph -> ( abs ` ( B - C ) ) =/= 0 )
x14:2:a1i |- ( ph ->  X = ( abs ` ( B - C ) ) )
x15::eldifsn  |- ( ( B - C ) e. ( CC \ { 0 } ) <-> ( ( B - C ) e. CC /\ ( B - C ) =/= 0 ) )
x16:x3,x9:jca |- ( ph -> ( ( B - C ) e. CC /\ ( B - C ) =/= 0 ) )
x17:x16,x15:sylibr |- ( ph -> ( B - C ) e. ( CC \ { 0 } ) )
x18:x14,x13:eqnetrd |- ( ph -> X =/= 0 ) 
x19:x6,x18:jca |- ( ph -> ( X e. CC /\ X =/= 0 ) )

*Y e. CC
y1::subcl |- ( ( A e. CC /\ C e. CC ) -> ( A - C ) e. CC )
y2:7,9:jca |- ( ph -> ( A e. CC /\ C e. CC ) )
y3:y2,y1:syl |- ( ph -> ( A - C ) e. CC )
y4:y3:abscld |- ( ph -> ( abs ` ( A - C ) ) e. RR )
y5:3,y4:syl5eqel |- ( ph -> Y e. RR )
y6:y5:recnd |- ( ph -> Y e. CC )
y7:y6:sqcld |- ( ph -> ( Y ^ 2 ) e. CC ) 
y8:10:simpld |- ( ph -> A =/= C )
y9:7,9,y8:subne0d   |- ( ph -> ( A - C ) =/= 0 )
y10::absgt0 |- (  ( A - C ) e. CC -> (   ( A - C ) =/= 0 <-> 0 < ( abs ` ( A - C ) ) ) )
y11:y3,y10:syl |- ( ph -> (  ( A - C ) =/= 0 <-> 0 < ( abs ` ( A - C ) ) ) )
y12:y9,y11:mpbid |- ( ph -> 0 < ( abs ` ( A - C ) ) )
y13:y12:gt0ne0d |- ( ph -> ( abs ` ( A - C ) ) =/= 0 )
y14:3:a1i |- ( ph ->  Y = ( abs ` ( A - C ) ) )
y15::eldifsn  |- ( ( A - C ) e. ( CC \ { 0 } ) <-> ( ( A - C ) e. CC /\ ( A - C ) =/= 0 ) )
y16:y3,y9:jca |- ( ph -> ( ( A - C ) e. CC /\ ( A - C ) =/= 0 ) )
y17:y16,y15:sylibr |- ( ph -> ( A - C ) e. ( CC \ { 0 } ) )
y18:y14,y13:eqnetrd |- ( ph -> Y =/= 0 ) 
y19:y6,y18:jca |- ( ph -> ( Y e. CC /\ Y =/= 0 ) )
*Z e. CC
z1::subcl |- ( ( A e. CC /\ B e. CC ) -> ( A - B ) e. CC )
z2:7,8:jca |- ( ph -> ( A e. CC /\ B e. CC ) )
z3:z2,z1:syl |- ( ph -> ( A - B ) e. CC )
z4:z3:abscld |- ( ph -> ( abs ` ( A - B ) ) e. RR )
z5:4,z4:syl5eqel |- ( ph -> Z e. RR )
z6:z5:recnd |- ( ph -> Z e. CC )
z7:z6:sqcld |- ( ph -> ( Z ^ 2 ) e. CC ) 
*O e. CC
o1:x3,y3:jca |- ( ph -> ( ( B - C ) e. CC /\ ( A - C ) e. CC ) )
!d2:1,rf18: |- (  ph ->  F : ( ( CC \ { 0 } ) X. ( CC \ { 0 } ) ) --> RR )
d1:d2:fovrnda  |- (  (  ph /\ (  x e. ( CC \ { 0 } ) /\ y e. ( CC \ { 0 } ) ) ) -> ( x F y ) e. RR )
o2:d1:caovclg  |- (  (  ph /\ (  ( B - C ) e. ( CC \ { 0 } ) /\ ( A - C ) e. ( CC \ { 0 } ) ) )
-> ( ( B - C ) F ( A - C ) ) e. RR )
o2b:x17,y17:jca |- ( ph ->  (  ( B - C ) e. ( CC \ { 0 } ) /\ ( A - C ) e. ( CC \ { 0 } ) ) )
o2c:o2b,o2:mpdan |- ( ph -> ( ( B - C ) F ( A - C ) ) e. RR ) 
o3:o2c:recnd |- ( ph -> ( ( B - C ) F ( A - C ) ) e. CC ) 
o4:5,o3:syl5eqel |- ( ph -> O e. CC )
o5:o4:sincld |- ( ph -> ( sin ` O ) e. CC )
o6:o5:sqcld |- ( ph -> ( ( sin ` O ) ^ 2 ) e. CC )
o7:o4:coscld |- ( ph -> ( cos ` O ) e. CC )
o8:o7:sqcld |- ( ph -> ( ( cos ` O ) ^ 2 ) e. CC )
o9:o6,o8:jca |- ( ph -> (  ( ( sin ` O ) ^ 2 ) e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC ) )
*constants
1cc::ax1cn |- 1 e. CC 
1cc2::1cnd |- ( ph -> 1 e. CC )
2cc::2cn |- 2 e. CC
2cc2:2cc:a1i |- ( ph -> 2 e. CC )
4aa::sq2 |- ( 2 ^ 2 ) = 4
4ab:4aa:a1i |- ( ph -> ( 2 ^ 2 ) = 4 )
4cc::4cn |- 4 e. CC
4cc2:4cc:a1i |- ( ph -> 4 e. CC )
2n0::2ne0 |- 2 =/= 0
2n01:2n0:a1i |- ( ph -> 2 =/= 0 )
12cc1::divcl |- (  ( 1 e. CC /\ 2 e. CC /\ 2 =/= 0 ) -> ( 1 / 2 ) e. CC )
12cc2:1cc,2cc,2n0:divcli |- ( 1 / 2 ) e. CC
12cc3:12cc2:a1i |- (  ph -> ( 1 / 2 ) e. CC )
12cc4:12cc3:sqcld |- (  ph -> ( ( 1 / 2 ) ^ 2 ) e. CC ) 
*compound expressions
xy1:x6,y6:jca |- (  ph -> ( X e. CC /\  Y e. CC ) )
xy2:x6,y6:mulcld |- ( ph -> ( X x. Y ) e. CC )
xy3:x7,y7:addcld |- ( ph -> ( ( X ^ 2 ) + ( Y ^ 2 ) ) e. CC ) 
xy4:12cc3,x6:mulcld |- ( ph -> ( ( 1 / 2 ) x. X ) e. CC )
xy5:xy4,y6:mulcld |- ( ph -> ( ( ( 1 / 2 ) x. X ) x. Y ) e. CC )
xy6::mulne0 |- ( ( ( X e. CC /\ X =/= 0 ) /\ ( Y e. CC /\ Y =/= 0 ) ) -> ( X x. Y ) =/= 0 )
xy7:x19,y19,xy6:syl2anc |- ( ph -> ( X x. Y ) =/= 0 ) 
xy8::sqne0 |- ( ( X x. Y ) e. CC -> ( ( ( X x. Y ) ^ 2 ) =/= 0 <-> ( X x. Y ) =/= 0 ) )
xy9:xy2,xy8:syl |- ( ph -> ( ( ( X x. Y ) ^ 2 ) =/= 0 <-> ( X x. Y ) =/= 0 ) )   
xy10:xy7,xy9:mpbird |- ( ph -> ( ( X x. Y ) ^ 2 ) =/= 0 ) 
xy11:xy2:sqcld |- ( ph -> ( ( X x. Y ) ^ 2 ) e. CC )
*xy12:xy11,xy10:jca |- ( ph -> ( ( ( X x. Y ) ^ 2 ) e. CC /\ ( ( X x. Y ) ^ 2 ) =/= 0 ) )
xyo1:xy2,o7:mulcld |- ( ph -> ( ( X x. Y ) x. ( cos ` O ) ) e. CC )
xyo2:xy5,o5:jca |- ( ph -> ( ( ( ( 1 / 2 ) x. X ) x. Y ) e. CC /\ ( sin ` O ) e. CC ) )
xyo3:2cc2,xyo1:mulcld |- ( ph -> ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC )
*xyo4:xyo3,12cc3:jca |- ( ph -> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ ( 1 / 2 ) e. CC ) )
xyo5:xyo3,2cc2:jca |- ( ph -> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC /\ 2 e. CC ) )
xyo6:xy3,xyo3:jca |- ( ph -> (  ( ( X ^ 2 ) + ( Y ^ 2 ) ) e. CC /\ ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC ) )
xyo7:xyo1,2cc2,2n01:3jca |- ( ph -> ( ( ( X x. Y ) x. ( cos ` O ) ) e. CC /\ 2 e. CC /\ 2 =/= 0 ) )
xyo8:o7,xy2,xy7:3jca |- ( ph -> ( ( cos ` O ) e. CC /\ ( X x. Y ) e. CC /\ ( X x. Y ) =/= 0 ) )
xyz1:xy3,z7:subcld |- ( ph -> ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) e. CC ) 
xyz2:xyz1,2cc2,2n01:divcld |- ( ph -> ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) e. CC ) 
xyz3:xyz2:sqcld |- ( ph -> ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) e. CC ) 
xyz4:xyz3,xy11,xy10:divcld |- ( ph 
-> ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) e. CC ) 
xyz5:1cc2,xyz4:subcld |- ( ph 
-> ( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) e. CC )  

*rearrange lawcos
*add cos term to both sides
15:lawcosph:oveq1d |- ( ph ->  ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) =
( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) 
+ ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) )
*cancel cos term on the right
16::npcan |- (  (  ( ( X ^ 2 ) + ( Y ^ 2 ) ) e. CC /\    ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC )
->   ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
= ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
17:xyo6,16:syl |- (  ph
->   ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
= ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
18:15,17:eqtrd |- ( ph -> ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) = ( ( X ^ 2 ) + ( Y ^ 2 ) ) )
*move z^2 to the right
19:18:oveq1d |- ( ph -> ( ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) - ( Z ^ 2 ) ) 
= ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) )
20:z7,xyo3:pncan2d |- ( ph ->   ( ( ( Z ^ 2 ) + ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) - ( Z ^ 2 ) )
= ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
21:20,19:eqtr3d |- ( ph -> ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) )
*divide by 2
22:21:oveq1d |- ( ph -> ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) 
= ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) )
23::divcan3 |- ( ( ( ( X x. Y ) x. ( cos ` O ) ) e. CC /\ 2 e. CC /\ 2 =/= 0 )
->  ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( X x. Y ) x. ( cos ` O ) ) )
24:xyo7,23:syl |- ( ph  ->  ( ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) / 2 ) = ( ( X x. Y ) x. ( cos ` O ) ) )
25:24,22:eqtr3d |- ( ph -> ( ( X x. Y ) x. ( cos ` O ) )
= ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) )
*divide by ( X x. Y )
26:25:oveq1d |- ( ph -> ( ( ( X x. Y ) x. ( cos ` O ) ) / ( X x. Y ) )
= ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) )
27::divcan3 |- ( ( ( cos ` O ) e. CC /\ ( X x. Y ) e. CC /\ ( X x. Y ) =/= 0 ) ->
( ( ( X x. Y ) x. ( cos ` O ) ) / ( X x. Y ) ) = ( cos ` O ) )
28:xyo8,27:syl |- ( ph -> ( ( ( X x. Y ) x. ( cos ` O ) ) / ( X x. Y ) ) = ( cos ` O ) )
29:28,26:eqtr3d |- ( ph -> ( cos ` O ) = ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ) 
*get lawcos in the form ( 1 - ( (cos ` O ) ^ 2 ))
30:29:oveq1d  |- (  ph ->   ( ( cos ` O ) ^ 2 ) 
= ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ^ 2 ) )
31:30:oveq2d |- ( ph -> ( 1 - ( ( cos ` O ) ^ 2 )  )
= ( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ^ 2 ) ) )
*lawcos is rearranged :)

*rearrange sincossq
100::sincossq  |- (  O e. CC ->   ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 )
101:o4,100:syl |- ( ph ->   ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 )
102::pncan |- (  (  ( ( sin ` O ) ^ 2 ) e. CC /\ ( ( cos ` O ) ^ 2 ) e. CC )
->   ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )
103:o9,102:syl |- ( ph  
-> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) = ( ( sin ` O ) ^ 2 ) )
104:101:oveq1d |- ( ph -> ( ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) - ( ( cos ` O ) ^ 2 ) ) 
= ( 1 - ( ( cos ` O ) ^ 2 ) ) )
105:103,104:eqtr3d |- ( ph ->   ( ( sin ` O ) ^ 2 ) = ( 1 - ( ( cos ` O ) ^ 2 ) ) ) 

*sub sin^2 into the area formula
225::sqmul |- ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) e. CC /\ ( sin ` O ) e. CC ) 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) )
226:xyo2,225:syl |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) )
227:105:oveq2d |- (  ph ->   ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) )
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( 1 - ( ( cos ` O ) ^ 2 ) ) ) )
228:226,227:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( 1 - ( ( cos ` O ) ^ 2 ) ) ) ) 
*sub rearranged lawcos in place of cos^2
229:31:oveq2d |- ( ph -> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( 1 - ( ( cos ` O ) ^ 2 )  ) )
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ^ 2 ) ) ) )
230:228,229:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ^ 2 ) ) ) ) 
*distribute square
231::sqdiv |- ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) e. CC /\ 
( X x. Y ) e. CC /\ ( X x. Y ) =/= 0 )
->   ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ^ 2 )
= ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) )
232:xyz2,xy2,xy7,231:syl3anc |- ( ph
-> ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ^ 2 )
=  ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) )
233:232:oveq2d |- (  ph 
-> ( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) / ( X x. Y ) ) ^ 2 ) )
= ( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) )
234:233:oveq2d |- (  ph 
->  ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) )
/ 2 ) / ( X x. Y ) ) ^ 2 ) ) )
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. ( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) )
/ 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )
235:230,234:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 ) 
= ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) 
*distribute (X x. Y) ^2
*get ( X x. Y) ^2 into the bracket
250::axmulass |- ( ( ( 1 / 2 ) e. CC /\ X e. CC /\ Y e. CC )
-> ( ( ( 1 / 2 ) x. X ) x. Y ) = ( ( 1 / 2 ) x. ( X x. Y ) ) )
251:12cc3,x6,y6,250:syl3anc |- ( ph 
-> ( ( ( 1 / 2 ) x. X ) x. Y ) = ( ( 1 / 2 ) x. ( X x. Y ) ) )
252:251:oveq1d |- ( ph 
-> ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) = ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) )
253:252:oveq1d |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) ^ 2 ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) )
= ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )
254:235,253:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 )
= ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )
255::sqmul |- ( ( ( 1 / 2 ) e. CC /\ ( X x. Y ) e. CC ) 
-> ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) = ( ( ( 1 / 2 ) ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) )
256:12cc3,xy2:sqmuld |- ( ph 
-> ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) = ( ( ( 1 / 2 ) ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) )
257:256:oveq1d |- ( ph 
-> ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) )
= ( ( ( ( 1 / 2 ) ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )
258:254,257:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 )
= ( ( ( ( 1 / 2 ) ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) 
259::axmulass |- ( ( ( ( 1 / 2 ) ^ 2 ) e. CC /\ ( ( X x. Y ) ^ 2 ) e. CC 
/\ ( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) e. CC )  
-> ( ( ( ( 1 / 2 ) ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) 
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) )
260:12cc4,xy11,xyz5,259:syl3anc |- ( ph 
-> ( ( ( ( 1 / 2 ) ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) x. 
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) 
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) )
261:258,260:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 )
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) )
*distribute (X x. Y)^2 inside the bracket
262::subdi |- ( ( ( ( X x. Y ) ^ 2 ) e. CC /\ 1 e. CC 
/\ ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) e. CC )
-> ( ( ( X x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) 
=  ( ( ( ( X x. Y ) ^ 2 ) x. 1 )  - ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )
263:xy11,1cc2,xyz4:subdid |- ( ph
-> ( ( ( X x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) 
=  ( ( ( ( X x. Y ) ^ 2 ) x. 1 )  - ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )
264:263:oveq2d |- ( ph 
-> ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) x.
( 1 - ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) )
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( ( X x. Y ) ^ 2 ) x. 1 )  - ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) )
265:261,264:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 )
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( ( X x. Y ) ^ 2 ) x. 1 )  
- ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) ) 
*reduce the 1 and cancel (XY)^2
*266::mulid1 |- ( ( ( X x. Y ) ^ 2 ) e. CC
-> ( ( ( X x. Y ) ^ 2 ) x. 1 )  = ( ( X x. Y ) ^ 2 ) )
267:xy11:mulid1d |- ( ph -> ( ( ( X x. Y ) ^ 2 ) x. 1 )  = ( ( X x. Y ) ^ 2 ) )  
268::divcan2 |- ( ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) e. CC 
/\ ( ( X x. Y ) ^ 2 ) e. CC /\ ( ( X x. Y ) ^ 2 ) =/= 0 ) 
-> ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) 
= ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) )
269:xyz3,xy11,xy10,268:syl3anc |- ( ph 
-> ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) 
= ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) )
270:267,269:oveq12d |- ( ph
->  ( ( ( ( X x. Y ) ^ 2 ) x. 1 )  
- ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) 
= ( ( ( X x. Y ) ^ 2 ) 
- ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) ) )
271:270:oveq2d |- ( ph
-> ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( ( X x. Y ) ^ 2 ) x. 1 )  
- ( ( ( X x. Y ) ^ 2 ) x. ( ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) / ( ( X x. Y ) ^ 2 ) ) ) ) ) 
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) 
- ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) ) ) )
272:265,271:eqtrd |- ( ph 
-> ( ( ( ( ( 1 / 2 ) x. X ) x. Y ) x. ( sin ` O ) ) ^ 2 )
= ( ( ( 1 / 2 ) ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) 
- ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) / 2 ) ^ 2 ) ) ) )
*move the /2 on the second term to the outside
273::sqdiv |- ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) e. CC /\ 2 e. CC /\ 2 =/= 0 ) 
-> ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) 
= ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) )
274:xyz1,2cc2,2n01:sqdivd |- ( ph 
-> ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) 
= ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) )
275:274:oveq2d |- ( ph
-> ( ( ( X x. Y ) ^ 2 )  - ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) / 2 ) ^ 2 ) ) 
= ( ( ( X x. Y ) ^ 2 )  - ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) 
- ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) ) )
276::divcan2 |- (  ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) e. CC /\ ( 2 ^ 2 ) e. CC /\ ( 2 ^ 2 ) =/= 0 )
->   ( ( 2 ^ 2 ) x. ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) )
= ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) )
277:276: |- (  ph -> ( ( 2 ^ 2 ) x. ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) )
= ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) )
278:277:oveq2d  |- (  ph ->   ( ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) - ( ( 2 ^ 2 )
x. ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) ) )
= ( ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) - ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) ) )
279::subdi |- (  (  ( 2 ^ 2 ) e. CC /\ ( ( X x. Y ) ^ 2 ) e. CC 
/\    ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) e. CC )
-> ( ( 2 ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) - ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) ) )
= ( ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) - ( ( 2 ^ 2 ) x. ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 )
/ ( 2 ^ 2 ) ) ) ) )
280:: |- (  ph ->   ( ( 2 ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) - ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 )
/ ( 2 ^ 2 ) ) ) )
= ( ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) - ( ( 2 ^ 2 ) x. ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 )
/ ( 2 ^ 2 ) ) ) ) )
281:280,278:eqtrd  |- (  ph
->   ( ( 2 ^ 2 ) x. ( ( ( X x. Y ) ^ 2 ) - ( ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) / ( 2 ^ 2 ) ) ) )
= ( ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) - ( ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) ^ 2 ) ) )


!qed:: |- (  ph ->   ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) )
= ( sqr ` ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )

$)

Mario Carneiro

unread,
Mar 10, 2019, 10:46:39 AM3/10/19
to metamath
I'm sorry to hear that it got too hard for you to continue with it. I admit that large scale algebraic manipulations are one of the biggest areas where a decision procedure exists but metamath doesn't have any automation for it. If I had known that Heron's formula involved expanding out quartic expressions I would have warned you about this. I've finished the proof below; hopefully you can learn some tricks from it. In particular, I went to pains to not expand everything out to keep the terms manageable; I use subsq at least five times in the proof to express all the factoring identities.

If you have some higher level mathematics knowledge, you will find that it is usually easier to prove "advanced" theorems rather than "elementary" theorems like this one, because elementary proofs have lots of fiddly computations while (many) advanced proofs are just definition pushing for the most part.

A remark on mmj2 usage: You should make sure you have step autocompletion enabled (with the ! before steps). This is absolutely invaluable for these kinds of proofs, because it means I don't have to worry about or organize the closure theorems (proving things like " ( abs ` ( B - C ) ) e. RR"). The fact that you have them all nicely labeled suggests to me that you spent far more time dealing with these proofs than you should have, and it was probably a factor in the burnout. For example, if I put in the following for the first few steps of the proof:

61::sqrsqd      |- ( ph -> ( sqr ` ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) ) = ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) )
62::fveq2d  |- ( ph -> ( sqr ` ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) ) = ( sqr ` ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )
qed:61,62:eqtr3d   |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) = ( sqr ` ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )

and press unify, I immediately get the following:

d4::1red           |- ( ph -> 1 e. RR )
d5:d4:rehalfcld    |- ( ph -> ( 1 / 2 ) e. RR )
!d6::              |- ( ph -> X e. RR )
!d7::              |- ( ph -> Y e. RR )
d8:d6,d7:remulcld  |- ( ph -> ( X x. Y ) e. RR )
d9:d5,d8:remulcld  |- ( ph -> ( ( 1 / 2 ) x. ( X x. Y ) ) e. RR )
!d10::             |- ( ph -> O e. CC )
d11:d10:sincld     |- ( ph -> ( sin ` O ) e. CC )
d12:d11:abscld     |- ( ph -> ( abs ` ( sin ` O ) ) e. RR )
d1:d9,d12:remulcld |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) e. RR )
d14::2rp           |- 2 e. RR+
!d13::             |- ( ph -> 2 e. RR+ )
!d15::             |- ( ph -> 0 <_ 1 )
d16:d4,d13,d15:divge0d 
                   |- ( ph -> 0 <_ ( 1 / 2 ) )
!d17::             |- ( ph -> 0 <_ X )
!d18::             |- ( ph -> 0 <_ Y )
d19:d6,d7,d17,d18:mulge0d 
                   |- ( ph -> 0 <_ ( X x. Y ) )
d20:d5,d8,d16,d19:mulge0d 
                   |- ( ph -> 0 <_ ( ( 1 / 2 ) x. ( X x. Y ) ) )
d21:d11:absge0d    |- ( ph -> 0 <_ ( abs ` ( sin ` O ) ) )
d2:d9,d12,d20,d21:mulge0d |- ( ph -> 0 <_ ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) )
61:d1,d2:sqrsqd |- ( ph -> ( sqr ` ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) ) = ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) )
!d22::             |- ( ph -> ^ = x. )
!d23::             |- ( ph -> ( ( 1 / 2 ) x. ( X x. Y ) ) = S )
!d24::             |- ( ph -> ( abs ` ( sin ` O ) ) = ( S - X ) )
d25:d23,d24:oveq12d 
                   |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) = ( S x. ( S - X ) ) )
!d26::             |- ( ph -> 2 = ( ( S - Y ) x. ( S - Z ) ) )
d3:d22,d25,d26:oveq123d |- ( ph -> ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) = ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) )
62:d3:fveq2d |- ( ph -> ( sqr ` ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) ) = ( sqr ` ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )
qed:61,62:eqtr3d   |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) = ( sqr ` ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )

You can see that mmj2 has gone off the rails on d3, but it's done a pretty good job of proving the closure lemmas up until the definition unfolding of X and Y and so on. If this doesn't happen in your mmj2 install, try putting

ProofAsstUseAutotransformations,yes,no,yes

in your RunParms.

Mario

h50::heron.f                           |- F = ( x e. ( CC \ { 0 } ) , y e. ( CC \ { 0 } ) |-> ( Im ` ( log ` ( y / x ) ) ) )
h51::heron.x                           |- X = ( abs ` ( B - C ) )
h52::heron.y                           |- Y = ( abs ` ( A - C ) )
h53::heron.z                           |- Z = ( abs ` ( A - B ) )
h54::heron.o                           |- O = ( ( B - C ) F ( A - C ) )
h55::heron.s                         |- S = ( ( ( X + Y ) + Z ) / 2 )
h56::heron.a                          |- ( ph -> A e. CC )
h57::heron.b                          |- ( ph -> B e. CC )
h58::heron.c                          |- ( ph -> C e. CC )
h59::heron.ac                         |- ( ph -> A =/= C )
h60::heron.bc                         |- ( ph -> B =/= C )
61::1red                |- ( ph -> 1 e. RR )
62:61:rehalfcld        |- ( ph -> ( 1 / 2 ) e. RR )
63:57,58:subcld           |- ( ph -> ( B - C ) e. CC )
64:63:abscld                 |- ( ph -> ( abs ` ( B - C ) ) e. RR )
65:51,64:syl5eqel           |- ( ph -> X e. RR )
66:56,58:jca               |- ( ph -> ( A e. CC /\ C e. CC ) )
67::subcl                  |- ( ( A e. CC /\ C e. CC ) -> ( A - C ) e. CC )
68:66,67:syl              |- ( ph -> ( A - C ) e. CC )
69:68:abscld                 |- ( ph -> ( abs ` ( A - C ) ) e. RR )
70:52,69:syl5eqel           |- ( ph -> Y e. RR )
71:65,70:remulcld      |- ( ph -> ( X x. Y ) e. RR )
72:62,71:remulcld     |- ( ph -> ( ( 1 / 2 ) x. ( X x. Y ) ) e. RR )
73::negpitopissre          |- ( -u pi (,] pi ) C_ RR
74:57,58,60:subne0d         |- ( ph -> ( B - C ) =/= 0 )
75:56,58,59:subne0d         |- ( ph -> ( A - C ) =/= 0 )
76:50,63,74,68,75:angcld   |- ( ph -> ( ( B - C ) F ( A - C ) ) e. ( -u pi (,] pi ) )
77:73,76:sseldi           |- ( ph -> ( ( B - C ) F ( A - C ) ) e. RR )
78:77:recnd                      |- ( ph -> ( ( B - C ) F ( A - C ) ) e. CC )
79:54,78:syl5eqel               |- ( ph -> O e. CC )
80:79:sincld             |- ( ph -> ( sin ` O ) e. CC )
81:80:abscld            |- ( ph -> ( abs ` ( sin ` O ) ) e. RR )
82:72,81:remulcld    |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) e. RR )
83::0re                  |- 0 e. RR
84::halfre               |- ( 1 / 2 ) e. RR
85::halfgt0              |- 0 < ( 1 / 2 )
86:83,84,85:ltleii      |- 0 <_ ( 1 / 2 )
87:86:a1i              |- ( ph -> 0 <_ ( 1 / 2 ) )
88:63:absge0d            |- ( ph -> 0 <_ ( abs ` ( B - C ) ) )
89:88,51:syl6breqr      |- ( ph -> 0 <_ X )
90:68:absge0d            |- ( ph -> 0 <_ ( abs ` ( A - C ) ) )
91:90,52:syl6breqr      |- ( ph -> 0 <_ Y )
92:65,70,89,91:mulge0d |- ( ph -> 0 <_ ( X x. Y ) )
93:62,71,87,92:mulge0d
                      |- ( ph -> 0 <_ ( ( 1 / 2 ) x. ( X x. Y ) ) )
94:80:absge0d         |- ( ph -> 0 <_ ( abs ` ( sin ` O ) ) )
95:72,81,93,94:mulge0d
                     |- ( ph -> 0 <_ ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) )
96:82,95:sqrsqd     |- ( ph -> ( sqr ` ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) ) = ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) )
97::ax1cn                 |- 1 e. CC
98::2cn                          |- 2 e. CC
99::2ne0                              |- 2 =/= 0
100:97,98,99:divcli      |- ( 1 / 2 ) e. CC
101:100:a1i             |- ( ph -> ( 1 / 2 ) e. CC )
102:65:recnd                        |- ( ph -> X e. CC )
103:70:recnd                        |- ( ph -> Y e. CC )
104:102,103:mulcld                  |- ( ph -> ( X x. Y ) e. CC )
105:101,104:mulcld     |- ( ph -> ( ( 1 / 2 ) x. ( X x. Y ) ) e. CC )
106:81:recnd           |- ( ph -> ( abs ` ( sin ` O ) ) e. CC )
107:105,106:sqmuld    |- ( ph -> ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) = ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) x. ( ( abs ` ( sin ` O ) ) ^ 2 ) ) )
108:98:a1i                      |- ( ph -> 2 e. CC )
109:99:a1i                           |- ( ph -> 2 =/= 0 )
110:104,108,109:sqdivd  |- ( ph -> ( ( ( X x. Y ) / 2 ) ^ 2 ) = ( ( ( X x. Y ) ^ 2 ) / ( 2 ^ 2 ) ) )
111:104,108,109:divrec2d |- ( ph -> ( ( X x. Y ) / 2 ) = ( ( 1 / 2 ) x. ( X x. Y ) ) )
112:111:oveq1d          |- ( ph -> ( ( ( X x. Y ) / 2 ) ^ 2 ) = ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) )
113::sq2                      |- ( 2 ^ 2 ) = 4
114:113:a1i                  |- ( ph -> ( 2 ^ 2 ) = 4 )
115:114:oveq2d          |- ( ph -> ( ( ( X x. Y ) ^ 2 ) / ( 2 ^ 2 ) ) = ( ( ( X x. Y ) ^ 2 ) / 4 ) )
116:110,112,115:3eqtr3d
                       |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) = ( ( ( X x. Y ) ^ 2 ) / 4 ) )
117:54,77:syl5eqel       |- ( ph -> O e. RR )
118:117:resincld        |- ( ph -> ( sin ` O ) e. RR )
119::absresq            |- ( ( sin ` O ) e. RR -> ( ( abs ` ( sin ` O ) ) ^ 2 ) = ( ( sin ` O ) ^ 2 ) )
120:118,119:syl        |- ( ph -> ( ( abs ` ( sin ` O ) ) ^ 2 ) = ( ( sin ` O ) ^ 2 ) )
121:116,120:oveq12d   |- ( ph -> ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) ^ 2 ) x. ( ( abs ` ( sin ` O ) ) ^ 2 ) ) = ( ( ( ( X x. Y ) ^ 2 ) / 4 ) x. ( ( sin ` O ) ^ 2 ) ) )
122:104:sqcld           |- ( ph -> ( ( X x. Y ) ^ 2 ) e. CC )
123:80:sqcld            |- ( ph -> ( ( sin ` O ) ^ 2 ) e. CC )
124:122,123:mulcld       |- ( ph -> ( ( ( X x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) e. CC )
125::4cn                 |- 4 e. CC
126:125:a1i             |- ( ph -> 4 e. CC )
127:65,70:readdcld                     |- ( ph -> ( X + Y ) e. RR )
128:56,57:jca                  |- ( ph -> ( A e. CC /\ B e. CC ) )
129::subcl                     |- ( ( A e. CC /\ B e. CC ) -> ( A - B ) e. CC )
130:128,129:syl               |- ( ph -> ( A - B ) e. CC )
131:130:abscld               |- ( ph -> ( abs ` ( A - B ) ) e. RR )
132:53,131:syl5eqel         |- ( ph -> Z e. RR )
133:127,132:readdcld                  |- ( ph -> ( ( X + Y ) + Z ) e. RR )
134:133:rehalfcld            |- ( ph -> ( ( ( X + Y ) + Z ) / 2 ) e. RR )
135:55,134:syl5eqel         |- ( ph -> S e. RR )
136:135:recnd                      |- ( ph -> S e. CC )
137:136,102:subcld              |- ( ph -> ( S - X ) e. CC )
138:136,137:mulcld           |- ( ph -> ( S x. ( S - X ) ) e. CC )
139:136,103:subcld              |- ( ph -> ( S - Y ) e. CC )
140:132:recnd                       |- ( ph -> Z e. CC )
141:136,140:subcld              |- ( ph -> ( S - Z ) e. CC )
142:139,141:mulcld           |- ( ph -> ( ( S - Y ) x. ( S - Z ) ) e. CC )
143:138,142:mulcld        |- ( ph -> ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) e. CC )
144:126,143:mulcld       |- ( ph -> ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) e. CC )
145::4ne0                |- 4 =/= 0
146:145:a1i             |- ( ph -> 4 =/= 0 )
147:108,104:sqmuld                    |- ( ph -> ( ( 2 x. ( X x. Y ) ) ^ 2 ) = ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) )
148:114:oveq1d              |- ( ph -> ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) = ( 4 x. ( ( X x. Y ) ^ 2 ) ) )
149:147,148:eqtr2d         |- ( ph -> ( 4 x. ( ( X x. Y ) ^ 2 ) ) = ( ( 2 x. ( X x. Y ) ) ^ 2 ) )
150:149:oveq1d            |- ( ph -> ( ( 4 x. ( ( X x. Y ) ^ 2 ) ) x. ( ( sin ` O ) ^ 2 ) ) = ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) )
151:126,122,123:mulassd   |- ( ph -> ( ( 4 x. ( ( X x. Y ) ^ 2 ) ) x. ( ( sin ` O ) ^ 2 ) ) = ( 4 x. ( ( ( X x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) ) )
152:108,104:mulcld                |- ( ph -> ( 2 x. ( X x. Y ) ) e. CC )
153:152:sqcld                   |- ( ph -> ( ( 2 x. ( X x. Y ) ) ^ 2 ) e. CC )
154:153,123:mulcld           |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) e. CC )
155:103,140:mulcld                     |- ( ph -> ( Y x. Z ) e. CC )
156:108,155:mulcld                 |- ( ph -> ( 2 x. ( Y x. Z ) ) e. CC )
157:156:sqcld                    |- ( ph -> ( ( 2 x. ( Y x. Z ) ) ^ 2 ) e. CC )
158:103:sqcld                     |- ( ph -> ( Y ^ 2 ) e. CC )
159:140:sqcld                      |- ( ph -> ( Z ^ 2 ) e. CC )
160:102:sqcld                   |- ( ph -> ( X ^ 2 ) e. CC )
161:159,160:subcld                 |- ( ph -> ( ( Z ^ 2 ) - ( X ^ 2 ) ) e. CC )
162:158,161:addcld           |- ( ph -> ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) e. CC )
163:162:sqcld                    |- ( ph -> ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) e. CC )
164:157,163:subcld           |- ( ph -> ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) e. CC )
165:79:coscld                     |- ( ph -> ( cos ` O ) e. CC )
166:165:sqcld                  |- ( ph -> ( ( cos ` O ) ^ 2 ) e. CC )
167:153,166:mulcld           |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) e. CC )
168::sincossq                   |- ( O e. CC -> ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 )
169:79,168:syl                 |- ( ph -> ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) = 1 )
170:169:oveq2d                |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) ) = ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. 1 ) )
171:153,123,166:adddid        |- ( ph ->
                                   ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( ( sin ` O ) ^ 2 ) + ( ( cos ` O ) ^ 2 ) ) ) =
                                   ( ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) + ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) ) )
172:158:2timesd                     |- ( ph -> ( 2 x. ( Y ^ 2 ) ) = ( ( Y ^ 2 ) + ( Y ^ 2 ) ) )
173:158,161,158:ppncand             |- ( ph -> ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) + ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( ( Y ^ 2 ) + ( Y ^ 2 ) ) )
174:172,173:eqtr4d                 |- ( ph -> ( 2 x. ( Y ^ 2 ) ) = ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) + ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) )
175:161:2timesd                     |- ( ph -> ( 2 x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( ( Z ^ 2 ) - ( X ^ 2 ) ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) )
176:158,161,161:pnncand             |- ( ph ->
                                         ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) - ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( ( ( Z ^ 2 ) - ( X ^ 2 ) ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) )
                                             )
177:175,176:eqtr4d                 |- ( ph -> ( 2 x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) - ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) )
178:174,177:oveq12d               |- ( ph ->
                                       ( ( 2 x. ( Y ^ 2 ) ) x. ( 2 x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) =
                                       ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) + ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) )
                                         x.
                                         ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) - ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) ) )
179::2t2e4                       |- ( 2 x. 2 ) = 4
180:179:a1i                     |- ( ph -> ( 2 x. 2 ) = 4 )
181:180,126:eqeltrd                    |- ( ph -> ( 2 x. 2 ) e. CC )
182:181,158,161:mulassd            |- ( ph -> ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( 2 x. 2 ) x. ( ( Y ^ 2 ) x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) )
183:181,158:mulcld                   |- ( ph -> ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) e. CC )
184:183,159,160:subdid              |- ( ph ->
                                         ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) =
                                         ( ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( Z ^ 2 ) ) - ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( X ^ 2 ) ) ) )
185:108:sqvald                         |- ( ph -> ( 2 ^ 2 ) = ( 2 x. 2 ) )
186:103,140:sqmuld                     |- ( ph -> ( ( Y x. Z ) ^ 2 ) = ( ( Y ^ 2 ) x. ( Z ^ 2 ) ) )
187:185,186:oveq12d                   |- ( ph -> ( ( 2 ^ 2 ) x. ( ( Y x. Z ) ^ 2 ) ) = ( ( 2 x. 2 ) x. ( ( Y ^ 2 ) x. ( Z ^ 2 ) ) ) )
188:108,155:sqmuld                    |- ( ph -> ( ( 2 x. ( Y x. Z ) ) ^ 2 ) = ( ( 2 ^ 2 ) x. ( ( Y x. Z ) ^ 2 ) ) )
189:181,158,159:mulassd               |- ( ph -> ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( Z ^ 2 ) ) = ( ( 2 x. 2 ) x. ( ( Y ^ 2 ) x. ( Z ^ 2 ) ) ) )
190:187,188,189:3eqtr4d              |- ( ph -> ( ( 2 x. ( Y x. Z ) ) ^ 2 ) = ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( Z ^ 2 ) ) )
191:102,103:sqmuld                      |- ( ph -> ( ( X x. Y ) ^ 2 ) = ( ( X ^ 2 ) x. ( Y ^ 2 ) ) )
192:160,158:mulcomd                     |- ( ph -> ( ( X ^ 2 ) x. ( Y ^ 2 ) ) = ( ( Y ^ 2 ) x. ( X ^ 2 ) ) )
193:191,192:eqtrd                      |- ( ph -> ( ( X x. Y ) ^ 2 ) = ( ( Y ^ 2 ) x. ( X ^ 2 ) ) )
194:185,193:oveq12d                   |- ( ph -> ( ( 2 ^ 2 ) x. ( ( X x. Y ) ^ 2 ) ) = ( ( 2 x. 2 ) x. ( ( Y ^ 2 ) x. ( X ^ 2 ) ) ) )
195:181,158,160:mulassd               |- ( ph -> ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( X ^ 2 ) ) = ( ( 2 x. 2 ) x. ( ( Y ^ 2 ) x. ( X ^ 2 ) ) ) )
196:194,147,195:3eqtr4d              |- ( ph -> ( ( 2 x. ( X x. Y ) ) ^ 2 ) = ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( X ^ 2 ) ) )
197:190,196:oveq12d                 |- ( ph ->
                                         ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( 2 x. ( X x. Y ) ) ^ 2 ) ) =
                                         ( ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( Z ^ 2 ) ) - ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( X ^ 2 ) ) ) )
198:184,197:eqtr4d                 |- ( ph -> ( ( ( 2 x. 2 ) x. ( Y ^ 2 ) ) x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( 2 x. ( X x. Y ) ) ^ 2 ) ) )
199:108,108,158,161:mul4d          |- ( ph -> ( ( 2 x. 2 ) x. ( ( Y ^ 2 ) x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( ( 2 x. ( Y ^ 2 ) ) x. ( 2 x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) )
200:182,198,199:3eqtr3d           |- ( ph -> ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( 2 x. ( X x. Y ) ) ^ 2 ) ) = ( ( 2 x. ( Y ^ 2 ) ) x. ( 2 x. ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) )
201:158,161:subcld                |- ( ph -> ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) e. CC )
202::subsq                         |- ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) e. CC /\ ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) e. CC ) ->
                                        ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) - ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) =
                                        ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) + ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) )
                                          x.
                                          ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) - ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) ) )
203:162,201,202:syl2anc           |- ( ph ->
                                       ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) - ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) =
                                       ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) + ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) )
                                         x.
                                         ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) - ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) ) )
204:178,200,203:3eqtr4d          |- ( ph ->
                                      ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( 2 x. ( X x. Y ) ) ^ 2 ) ) =
                                      ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) - ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) )
205:204:oveq2d                  |- ( ph ->
                                     ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( 2 x. ( X x. Y ) ) ^ 2 ) ) ) =
                                     ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) - ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) ) )
206:157,153:nncand              |- ( ph -> ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( 2 x. ( X x. Y ) ) ^ 2 ) ) ) = ( ( 2 x. ( X x. Y ) ) ^ 2 ) )
207:201:sqcld                    |- ( ph -> ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) e. CC )
208:157,163,207:subsubd         |- ( ph ->
                                     ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) - ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) ) =
                                     ( ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) + ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) )
209:205,206,208:3eqtr3d        |- ( ph ->
                                    ( ( 2 x. ( X x. Y ) ) ^ 2 ) =
                                    ( ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) + ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) )
210:153:mulid1d                |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. 1 ) = ( ( 2 x. ( X x. Y ) ) ^ 2 ) )
211:160,158:addcld                  |- ( ph -> ( ( X ^ 2 ) + ( Y ^ 2 ) ) e. CC )
212:104,165:mulcld                   |- ( ph -> ( ( X x. Y ) x. ( cos ` O ) ) e. CC )
213:108,212:mulcld                  |- ( ph -> ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) e. CC )
214:211,213:nncand                 |- ( ph ->
                                        ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) ) = ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
215:158,159:subcld                    |- ( ph -> ( ( Y ^ 2 ) - ( Z ^ 2 ) ) e. CC )
216:215,160:addcomd                  |- ( ph -> ( ( ( Y ^ 2 ) - ( Z ^ 2 ) ) + ( X ^ 2 ) ) = ( ( X ^ 2 ) + ( ( Y ^ 2 ) - ( Z ^ 2 ) ) ) )
217:158,159,160:subsubd              |- ( ph -> ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( ( Y ^ 2 ) - ( Z ^ 2 ) ) + ( X ^ 2 ) ) )
218:160,158,159:addsubassd           |- ( ph -> ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) = ( ( X ^ 2 ) + ( ( Y ^ 2 ) - ( Z ^ 2 ) ) ) )
219:216,217,218:3eqtr4d             |- ( ph -> ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) )
220:50,51,52,53,54:lawcos             |- ( ( ( A e. CC /\ B e. CC /\ C e. CC ) /\ ( A =/= C /\ B =/= C ) ) ->

                                           ( Z ^ 2 ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) )
221:56,57,58,59,60,220:syl32anc      |- ( ph -> ( Z ^ 2 ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) )
222:221:oveq2d                      |- ( ph ->
                                         ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( Z ^ 2 ) ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) ) )
223:219,222:eqtrd                  |- ( ph ->
                                        ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( ( ( X ^ 2 ) + ( Y ^ 2 ) ) - ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) ) ) )
224:108,104,165:mulassd            |- ( ph -> ( ( 2 x. ( X x. Y ) ) x. ( cos ` O ) ) = ( 2 x. ( ( X x. Y ) x. ( cos ` O ) ) ) )
225:214,223,224:3eqtr4d           |- ( ph -> ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) = ( ( 2 x. ( X x. Y ) ) x. ( cos ` O ) ) )
226:225:oveq1d                   |- ( ph -> ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) = ( ( ( 2 x. ( X x. Y ) ) x. ( cos ` O ) ) ^ 2 ) )
227:152,165:sqmuld               |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) x. ( cos ` O ) ) ^ 2 ) = ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) )
228:226,227:eqtr2d              |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) = ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) )
229:228:oveq2d                 |- ( ph ->
                                    ( ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) + ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) ) =
                                    ( ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) + ( ( ( Y ^ 2 ) - ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) )
230:209,210,229:3eqtr4d       |- ( ph ->
                                   ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. 1 ) =
                                   ( ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) + ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) ) )
231:170,171,230:3eqtr3d      |- ( ph ->
                                  ( ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) + ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) ) =
                                  ( ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) + ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( cos ` O ) ^ 2 ) ) ) )
232:154,164,167,231:addcan2ad
                            |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) = ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) )
233::subsq                   |- ( ( ( 2 x. ( Y x. Z ) ) e. CC /\ ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) e. CC ) ->
                                  ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) =
                                  ( ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) x. ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) ) )
234:156,162,233:syl2anc     |- ( ph ->
                                 ( ( ( 2 x. ( Y x. Z ) ) ^ 2 ) - ( ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ^ 2 ) ) =
                                 ( ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) x. ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) ) )
235:158,159:addcld              |- ( ph -> ( ( Y ^ 2 ) + ( Z ^ 2 ) ) e. CC )
236:156,235,160:addsubassd     |- ( ph -> ( ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) - ( X ^ 2 ) ) = ( ( 2 x. ( Y x. Z ) ) + ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( X ^ 2 ) ) ) )
237:158,159,160:addsubassd       |- ( ph -> ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( X ^ 2 ) ) = ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) )
238:237:oveq2d                 |- ( ph -> ( ( 2 x. ( Y x. Z ) ) + ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( X ^ 2 ) ) ) = ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) )
239:236,238:eqtr2d            |- ( ph -> ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) - ( X ^ 2 ) ) )
240::binom2                       |- ( ( Y e. CC /\ Z e. CC ) -> ( ( Y + Z ) ^ 2 ) = ( ( ( Y ^ 2 ) + ( 2 x. ( Y x. Z ) ) ) + ( Z ^ 2 ) ) )
241:103,140,240:syl2anc          |- ( ph -> ( ( Y + Z ) ^ 2 ) = ( ( ( Y ^ 2 ) + ( 2 x. ( Y x. Z ) ) ) + ( Z ^ 2 ) ) )
242:158,156,159:add32d           |- ( ph -> ( ( ( Y ^ 2 ) + ( 2 x. ( Y x. Z ) ) ) + ( Z ^ 2 ) ) = ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) + ( 2 x. ( Y x. Z ) ) ) )
243:235,156:addcomd              |- ( ph -> ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) + ( 2 x. ( Y x. Z ) ) ) = ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) )
244:241,242,243:3eqtrd          |- ( ph -> ( ( Y + Z ) ^ 2 ) = ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) )
245:244:oveq1d                 |- ( ph -> ( ( ( Y + Z ) ^ 2 ) - ( X ^ 2 ) ) = ( ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) - ( X ^ 2 ) ) )
246:245:eqcomd                |- ( ph -> ( ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) - ( X ^ 2 ) ) = ( ( ( Y + Z ) ^ 2 ) - ( X ^ 2 ) ) )
247:103,140:addcld                 |- ( ph -> ( Y + Z ) e. CC )
248::subsq                       |- ( ( ( Y + Z ) e. CC /\ X e. CC ) -> ( ( ( Y + Z ) ^ 2 ) - ( X ^ 2 ) ) = ( ( ( Y + Z ) + X ) x. ( ( Y + Z ) - X ) ) )
249:247,102,248:syl2anc         |- ( ph -> ( ( ( Y + Z ) ^ 2 ) - ( X ^ 2 ) ) = ( ( ( Y + Z ) + X ) x. ( ( Y + Z ) - X ) ) )
250:55:oveq2i                       |- ( 2 x. S ) = ( 2 x. ( ( ( X + Y ) + Z ) / 2 ) )
251:133:recnd                        |- ( ph -> ( ( X + Y ) + Z ) e. CC )
252:251,108,109:divcan2d            |- ( ph -> ( 2 x. ( ( ( X + Y ) + Z ) / 2 ) ) = ( ( X + Y ) + Z ) )
253:250,252:syl5eq                 |- ( ph -> ( 2 x. S ) = ( ( X + Y ) + Z ) )
254:102,103,140:addassd             |- ( ph -> ( ( X + Y ) + Z ) = ( X + ( Y + Z ) ) )
255:102,247:addcomd               |- ( ph -> ( X + ( Y + Z ) ) = ( ( Y + Z ) + X ) )
256:253,254,255:3eqtrd           |- ( ph -> ( 2 x. S ) = ( ( Y + Z ) + X ) )
257:108,136,102:subdid            |- ( ph -> ( 2 x. ( S - X ) ) = ( ( 2 x. S ) - ( 2 x. X ) ) )
258:253,254:eqtrd                  |- ( ph -> ( 2 x. S ) = ( X + ( Y + Z ) ) )
259:102:2timesd                    |- ( ph -> ( 2 x. X ) = ( X + X ) )
260:258,259:oveq12d               |- ( ph -> ( ( 2 x. S ) - ( 2 x. X ) ) = ( ( X + ( Y + Z ) ) - ( X + X ) ) )
261:102,247,102:pnpcand           |- ( ph -> ( ( X + ( Y + Z ) ) - ( X + X ) ) = ( ( Y + Z ) - X ) )
262:257,260,261:3eqtrd           |- ( ph -> ( 2 x. ( S - X ) ) = ( ( Y + Z ) - X ) )
263:256,262:oveq12d             |- ( ph -> ( ( 2 x. S ) x. ( 2 x. ( S - X ) ) ) = ( ( ( Y + Z ) + X ) x. ( ( Y + Z ) - X ) ) )
264:249,263:eqtr4d             |- ( ph -> ( ( ( Y + Z ) ^ 2 ) - ( X ^ 2 ) ) = ( ( 2 x. S ) x. ( 2 x. ( S - X ) ) ) )
265:108,136,108,137:mul4d      |- ( ph -> ( ( 2 x. S ) x. ( 2 x. ( S - X ) ) ) = ( ( 2 x. 2 ) x. ( S x. ( S - X ) ) ) )
266:180:oveq1d                 |- ( ph -> ( ( 2 x. 2 ) x. ( S x. ( S - X ) ) ) = ( 4 x. ( S x. ( S - X ) ) ) )
267:264,265,266:3eqtrd        |- ( ph -> ( ( ( Y + Z ) ^ 2 ) - ( X ^ 2 ) ) = ( 4 x. ( S x. ( S - X ) ) ) )
268:239,246,267:3eqtrd       |- ( ph -> ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( 4 x. ( S x. ( S - X ) ) ) )
269:156,235:subcld              |- ( ph -> ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) e. CC )
270:269,160:addcomd            |- ( ph -> ( ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) + ( X ^ 2 ) ) = ( ( X ^ 2 ) + ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) ) )
271:237:oveq2d                  |- ( ph -> ( ( 2 x. ( Y x. Z ) ) - ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( X ^ 2 ) ) ) = ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) )
272:156,235,160:subsubd         |- ( ph -> ( ( 2 x. ( Y x. Z ) ) - ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( X ^ 2 ) ) ) = ( ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) + ( X ^ 2 ) ) )
273:271,272:eqtr3d             |- ( ph -> ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) + ( X ^ 2 ) ) )
274:160,235,156:subsub2d       |- ( ph -> ( ( X ^ 2 ) - ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( 2 x. ( Y x. Z ) ) ) ) = ( ( X ^ 2 ) + ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( Z ^ 2 ) ) ) ) )
275:270,273,274:3eqtr4d       |- ( ph -> ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( ( X ^ 2 ) - ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( 2 x. ( Y x. Z ) ) ) ) )
276:158,159,156:addsubassd       |- ( ph -> ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( 2 x. ( Y x. Z ) ) ) = ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( 2 x. ( Y x. Z ) ) ) ) )
277:159,156:subcld                |- ( ph -> ( ( Z ^ 2 ) - ( 2 x. ( Y x. Z ) ) ) e. CC )
278:158,277:addcomd              |- ( ph -> ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( 2 x. ( Y x. Z ) ) ) ) = ( ( ( Z ^ 2 ) - ( 2 x. ( Y x. Z ) ) ) + ( Y ^ 2 ) ) )
279:103,140:mulcomd                 |- ( ph -> ( Y x. Z ) = ( Z x. Y ) )
280:279:oveq2d                     |- ( ph -> ( 2 x. ( Y x. Z ) ) = ( 2 x. ( Z x. Y ) ) )
281:280:oveq2d                    |- ( ph -> ( ( Z ^ 2 ) - ( 2 x. ( Y x. Z ) ) ) = ( ( Z ^ 2 ) - ( 2 x. ( Z x. Y ) ) ) )
282:281:oveq1d                   |- ( ph -> ( ( ( Z ^ 2 ) - ( 2 x. ( Y x. Z ) ) ) + ( Y ^ 2 ) ) = ( ( ( Z ^ 2 ) - ( 2 x. ( Z x. Y ) ) ) + ( Y ^ 2 ) ) )
283:276,278,282:3eqtrd          |- ( ph -> ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( 2 x. ( Y x. Z ) ) ) = ( ( ( Z ^ 2 ) - ( 2 x. ( Z x. Y ) ) ) + ( Y ^ 2 ) ) )
284::binom2sub                   |- ( ( Z e. CC /\ Y e. CC ) -> ( ( Z - Y ) ^ 2 ) = ( ( ( Z ^ 2 ) - ( 2 x. ( Z x. Y ) ) ) + ( Y ^ 2 ) ) )
285:140,103,284:syl2anc         |- ( ph -> ( ( Z - Y ) ^ 2 ) = ( ( ( Z ^ 2 ) - ( 2 x. ( Z x. Y ) ) ) + ( Y ^ 2 ) ) )
286:283,285:eqtr4d             |- ( ph -> ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( 2 x. ( Y x. Z ) ) ) = ( ( Z - Y ) ^ 2 ) )
287:286:oveq2d                |- ( ph -> ( ( X ^ 2 ) - ( ( ( Y ^ 2 ) + ( Z ^ 2 ) ) - ( 2 x. ( Y x. Z ) ) ) ) = ( ( X ^ 2 ) - ( ( Z - Y ) ^ 2 ) ) )
288:140,103:subcld               |- ( ph -> ( Z - Y ) e. CC )
289::subsq                       |- ( ( X e. CC /\ ( Z - Y ) e. CC ) -> ( ( X ^ 2 ) - ( ( Z - Y ) ^ 2 ) ) = ( ( X + ( Z - Y ) ) x. ( X - ( Z - Y ) ) ) )
290:102,288,289:syl2anc         |- ( ph -> ( ( X ^ 2 ) - ( ( Z - Y ) ^ 2 ) ) = ( ( X + ( Z - Y ) ) x. ( X - ( Z - Y ) ) ) )
291:108,136,103:subdid            |- ( ph -> ( 2 x. ( S - Y ) ) = ( ( 2 x. S ) - ( 2 x. Y ) ) )
292:102,103,140:add32d              |- ( ph -> ( ( X + Y ) + Z ) = ( ( X + Z ) + Y ) )
293:253,292:eqtrd                  |- ( ph -> ( 2 x. S ) = ( ( X + Z ) + Y ) )
294:103:2timesd                    |- ( ph -> ( 2 x. Y ) = ( Y + Y ) )
295:293,294:oveq12d               |- ( ph -> ( ( 2 x. S ) - ( 2 x. Y ) ) = ( ( ( X + Z ) + Y ) - ( Y + Y ) ) )
296:102,140:addcld                  |- ( ph -> ( X + Z ) e. CC )
297:296,103,103:pnpcan2d           |- ( ph -> ( ( ( X + Z ) + Y ) - ( Y + Y ) ) = ( ( X + Z ) - Y ) )
298:102,140,103:addsubassd         |- ( ph -> ( ( X + Z ) - Y ) = ( X + ( Z - Y ) ) )
299:297,298:eqtrd                 |- ( ph -> ( ( ( X + Z ) + Y ) - ( Y + Y ) ) = ( X + ( Z - Y ) ) )
300:291,295,299:3eqtrd           |- ( ph -> ( 2 x. ( S - Y ) ) = ( X + ( Z - Y ) ) )
301:108,136,140:subdid            |- ( ph -> ( 2 x. ( S - Z ) ) = ( ( 2 x. S ) - ( 2 x. Z ) ) )
302:140:2timesd                    |- ( ph -> ( 2 x. Z ) = ( Z + Z ) )
303:253,302:oveq12d               |- ( ph -> ( ( 2 x. S ) - ( 2 x. Z ) ) = ( ( ( X + Y ) + Z ) - ( Z + Z ) ) )
304:102,103:addcld                  |- ( ph -> ( X + Y ) e. CC )
305:304,140,140:pnpcan2d           |- ( ph -> ( ( ( X + Y ) + Z ) - ( Z + Z ) ) = ( ( X + Y ) - Z ) )
306:102,140,103:subsub3d           |- ( ph -> ( X - ( Z - Y ) ) = ( ( X + Y ) - Z ) )
307:305,306:eqtr4d                |- ( ph -> ( ( ( X + Y ) + Z ) - ( Z + Z ) ) = ( X - ( Z - Y ) ) )
308:301,303,307:3eqtrd           |- ( ph -> ( 2 x. ( S - Z ) ) = ( X - ( Z - Y ) ) )
309:300,308:oveq12d             |- ( ph -> ( ( 2 x. ( S - Y ) ) x. ( 2 x. ( S - Z ) ) ) = ( ( X + ( Z - Y ) ) x. ( X - ( Z - Y ) ) ) )
310:290,309:eqtr4d             |- ( ph -> ( ( X ^ 2 ) - ( ( Z - Y ) ^ 2 ) ) = ( ( 2 x. ( S - Y ) ) x. ( 2 x. ( S - Z ) ) ) )
311:108,139,108,141:mul4d      |- ( ph -> ( ( 2 x. ( S - Y ) ) x. ( 2 x. ( S - Z ) ) ) = ( ( 2 x. 2 ) x. ( ( S - Y ) x. ( S - Z ) ) ) )
312:180:oveq1d                 |- ( ph -> ( ( 2 x. 2 ) x. ( ( S - Y ) x. ( S - Z ) ) ) = ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) )
313:310,311,312:3eqtrd        |- ( ph -> ( ( X ^ 2 ) - ( ( Z - Y ) ^ 2 ) ) = ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) )
314:275,287,313:3eqtrd       |- ( ph -> ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) = ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) )
315:268,314:oveq12d         |- ( ph ->
                                 ( ( ( 2 x. ( Y x. Z ) ) + ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) x. ( ( 2 x. ( Y x. Z ) ) - ( ( Y ^ 2 ) + ( ( Z ^ 2 ) - ( X ^ 2 ) ) ) ) ) =
                                 ( ( 4 x. ( S x. ( S - X ) ) ) x. ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) ) )
316:232,234,315:3eqtrd     |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) = ( ( 4 x. ( S x. ( S - X ) ) ) x. ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) ) )
317:126,142:mulcld          |- ( ph -> ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) e. CC )
318:126,138,317:mulassd    |- ( ph -> ( ( 4 x. ( S x. ( S - X ) ) ) x. ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) ) = ( 4 x. ( ( S x. ( S - X ) ) x. ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) ) ) )
319:138,126,142:mul12d      |- ( ph -> ( ( S x. ( S - X ) ) x. ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) ) = ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )
320:319:oveq2d             |- ( ph -> ( 4 x. ( ( S x. ( S - X ) ) x. ( 4 x. ( ( S - Y ) x. ( S - Z ) ) ) ) ) = ( 4 x. ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) ) )
321:316,318,320:3eqtrd    |- ( ph -> ( ( ( 2 x. ( X x. Y ) ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) = ( 4 x. ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) ) )
322:150,151,321:3eqtr3d  |- ( ph -> ( 4 x. ( ( ( X x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) ) = ( 4 x. ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) ) )
323:124,144,126,146,322:mulcanad
                        |- ( ph -> ( ( ( X x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) = ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )
324:323:oveq1d         |- ( ph -> ( ( ( ( X x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) / 4 ) = ( ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) / 4 ) )
325:122,123,126,146:div23d
                       |- ( ph -> ( ( ( ( X x. Y ) ^ 2 ) x. ( ( sin ` O ) ^ 2 ) ) / 4 ) = ( ( ( ( X x. Y ) ^ 2 ) / 4 ) x. ( ( sin ` O ) ^ 2 ) ) )
326:135,65:resubcld        |- ( ph -> ( S - X ) e. RR )
327:135,326:remulcld      |- ( ph -> ( S x. ( S - X ) ) e. RR )
328:135,70:resubcld        |- ( ph -> ( S - Y ) e. RR )
329:135,132:resubcld       |- ( ph -> ( S - Z ) e. RR )
330:328,329:remulcld      |- ( ph -> ( ( S - Y ) x. ( S - Z ) ) e. RR )
331:327,330:remulcld     |- ( ph -> ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) e. RR )
332:331:recnd           |- ( ph -> ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) e. CC )
333:332,126,146:divcan3d
                       |- ( ph -> ( ( 4 x. ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) / 4 ) = ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) )
334:324,325,333:3eqtr3d
                      |- ( ph -> ( ( ( ( X x. Y ) ^ 2 ) / 4 ) x. ( ( sin ` O ) ^ 2 ) ) = ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) )
335:107,121,334:3eqtrd
                     |- ( ph -> ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) = ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) )
336:335:fveq2d      |- ( ph -> ( sqr ` ( ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) ^ 2 ) ) = ( sqr ` ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )
qed:96,336:eqtr3d  |- ( ph -> ( ( ( 1 / 2 ) x. ( X x. Y ) ) x. ( abs ` ( sin ` O ) ) ) = ( sqr ` ( ( S x. ( S - X ) ) x. ( ( S - Y ) x. ( S - Z ) ) ) ) )

$)

On Sun, Mar 10, 2019 at 6:38 AM Jon P <drjonp...@gmail.com> wrote:
Hey, so I think I'm going to stop doing this proof, it is just extremely painful to try and do algebra on large expressions with these tools. I am just trying to multiply up by ( 2 ^ 2 ) = 4 and it's just a nightmare of so many steps. I didn't understand when I started this proof how difficult the algebra was going to be, on wikipedia it's just 5 lines a highschooler could do so I figured it wouldn't take so long.

I think these would be my thoughts about MetaMath having played around with it for 2 weeks:

1. Metamath is awesome, it's amazing how many theorems there are and how much progress has been made. 

2. I am convinced computer assisted proofs are the future of mathematics. It always seemed insane to me that I would prove something and show it to my supervisor and if we both felt it was right then we assumed it was. Having the computer check your work is super helpful and I think in 20 years it will seem ridiculous to try and prove things by hand.

3. It would have been helpful to get a warning when I started on this proof about how long and hard it would be. If you have beginners come along maybe it is worth trying to set them a 5 line proof or something as an exercise. Basically I just waded in way too deep and got stuck and have now failed which is not such a nice experience, though I have learned a lot which is good.

4. The biggest weakness of Metamath is the tooling. I think mmj2 is great and obviously has had a lot of work go into it so I want to praise that. I think there's 3 areas where it could really be improved:

A. It's annoying how strict it is that there must be a gap between brackets and how it can't tell you which bracket isn't closed. When it parses the line into a tree I think there will be a point where it expects a bracket and doesn't find one so should be able to tell you that info maybe, though I am not sure. 

B. Using work variables is a nice system however when you fill them in it formats the result in a difficult way (with many line breaks) and so it is then a nightmare to delete all this extra whitespace to get back to a reasonable form. This is connected to the fact that the editor is not so good and you cannot wrap around lines. 

On the subject of work variables it would be great if you could wrap an expression into a temporary variable and then work with this for a while and then at the end just replace that temporary variable with the expression it represents. I think that is the idea for work variables and it would be really nice if it could make things a lot easier.

C. Before anyone would seriously use metamath as a theorem prover it would need to work at a higher level, it would be amazing to have a computer algebra system or similar which let you do standard manipulations easily. I understand David you are working in this direction and the stuff you are doing looks helpful.

I had a bit of a look at Norm's talk about MM and one of the things in it is that the goal isn't to make MM into a theorem prover that working mathematicians would use. However I am sure that over the next while some tool will come to fill this position just because it is such an enormous assistance in proving things, however it is a lot of work to get to that point as it needs the whole tree of mathematics filled in and it needs to be a flexible and easy to use tool.

Anyway I would love to be able to help make a really fluid tool, I can program however I am not so good with large programs already written and I don't know Java so it would be a bit difficult to help with that. I wondered about making my own tool however that is probably more work than I can accomplish so sorry about that.

--

Mario Carneiro

unread,
Mar 10, 2019, 11:10:10 AM3/10/19
to metamath


On Sun, Mar 10, 2019 at 6:38 AM Jon P <drjonp...@gmail.com> wrote:
4. The biggest weakness of Metamath is the tooling. I think mmj2 is great and obviously has had a lot of work go into it so I want to praise that. I think there's 3 areas where it could really be improved:

A. It's annoying how strict it is that there must be a gap between brackets and how it can't tell you which bracket isn't closed. When it parses the line into a tree I think there will be a point where it expects a bracket and doesn't find one so should be able to tell you that info maybe, though I am not sure. 

Maybe some of my work on proper parsing for metamath zero can bleed back to metamath with a custom whitespace-optional precedence parser.

B. Using work variables is a nice system however when you fill them in it formats the result in a difficult way (with many line breaks) and so it is then a nightmare to delete all this extra whitespace to get back to a reasonable form. This is connected to the fact that the editor is not so good and you cannot wrap around lines. 

You can fix this by setting the format option ("set format number" ). My favorite setting is AlignVarDepth99, or sometimes Unformatted or Flat when I really need the real estate. The default setting is far too much whitespace; in a big proof like this it is important to be able to see lots of lines (50 at least) so you can get the backrefs right.

On the subject of work variables it would be great if you could wrap an expression into a temporary variable and then work with this for a while and then at the end just replace that temporary variable with the expression it represents. I think that is the idea for work variables and it would be really nice if it could make things a lot easier.

You can fake this with an expression like "a" which is a stand-in for the real expression, say "2 + 2". You put an unproven step in your proof like

|- a = 2 + 2

and refer to it freely. When the proof is done except for your abbreviation, just find/replace " a " with " 2 + 2 " and delete the superfluous steps referencing this equality.

That said, I'm on board with actually having a mechanism for doing this from within mmj2. After working with lean for so long I'm spoiled for these kinds of things - this was my first real metamath proof in over a year, and there are definitely some things I miss from lean.
 
C. Before anyone would seriously use metamath as a theorem prover it would need to work at a higher level, it would be amazing to have a computer algebra system or similar which let you do standard manipulations easily. I understand David you are working in this direction and the stuff you are doing looks helpful.

In lean, I actually wrote this automation: there is a tactic called "ring" that solves any equation in the language of commutative rings. It would have killed all the messy algebra in this proof easily. I should port it to mmj2...
 
I had a bit of a look at Norm's talk about MM and one of the things in it is that the goal isn't to make MM into a theorem prover that working mathematicians would use. However I am sure that over the next while some tool will come to fill this position just because it is such an enormous assistance in proving things, however it is a lot of work to get to that point as it needs the whole tree of mathematics filled in and it needs to be a flexible and easy to use tool.

There are already many theorem provers out there. The big ones are Isabelle, Coq, Mizar, and the HOL family. All of these are focused on user interaction and ease of use, but the code is big and complicated as a result, and monolithic with often only one verifier. Metamath is trying to address this problem, with distributed verifiers and a simple spec. Because metamath is a specification more than a tool, the development on tools has also fragmented somewhat, and automation is not at the same level. But there is no major blocker besides a collective lack of time and attention to the subject by the volunteers on the project.
 
Anyway I would love to be able to help make a really fluid tool, I can program however I am not so good with large programs already written and I don't know Java so it would be a bit difficult to help with that. I wondered about making my own tool however that is probably more work than I can accomplish so sorry about that.

Heh, Java's not my favorite language either. But writing a new tool is hard, much less one with a decent interface...
 
Mario

Jon P

unread,
Mar 10, 2019, 11:20:18 AM3/10/19
to meta...@googlegroups.com
Thank you so much for your kind response Mario I appreciate it. Also it is cool that you finished the proof! Is it of any use for the project?

It is a usual mistake I make, to try and rush in and do something too difficult at the beginning :) Hopefully I can find something easier to do in smaller steps. 

I see what you mean about the difference between "advanced" and "elementary" theorems, it makes sense to work in a way which suits the system the best. I tried some of your suggestions for mmj2 and it looks like they will make things easier.


David A. Wheeler

unread,
Mar 10, 2019, 3:36:34 PM3/10/19
to Jon P, Metamath
I'm wondering, would my algebra helpers have helped? Or some variant of them?

In the longer-term, I think both tooling improvements and Theorem improvements would make these kinds of tasks easier. I've been focusing more on the theorem improvements, but I'm not certain that they actually improve things. Any feedback on whether or not they really help would be useful.
--- David A.Wheeler

Jon P

unread,
Mar 10, 2019, 4:16:04 PM3/10/19
to Metamath

Is it possible to use theorems from math boxes in a proof? I was under the impression that a proof can only reference theorems which are before it in set.mm

I think chunking steps together is a good idea, like A + B = C -> A = C - B are very natural to have as one result.

I have been thinking more about whether it is possible to directly substitute things, ( for example if A = B -> ((W x. A)/C) = ((W x. B)/C) or whatever ). Is there any way this could be defined for an arbitrary symbol string? Presumably MM is doing this sort of substitution all the time when unifying etc? If it were possible to have something like this I think it would result in a massive speedup because you can work on small pieces of a large formula and then quickly swap them.

Norman Megill

unread,
Mar 10, 2019, 5:04:50 PM3/10/19
to Metamath
We encourage the use of theorems from others' mathboxes.  The fact that more than one person found them useful is an indication that they are useful, and typically they will be moved to the main set.mm.

The reason we don't have all mathbox content in the main set.mm is that it may use nonstandard notation, or is too arcane to be of general interest, or is experimental, or is mainly an exercise by a new user learning Metamath, or essentially repeats what has already been done, or a theorem may be a trivial variant of an existing theorem that doesn't shorten enough other proofs to "pay" for itself in terms of reduced file size, or any of a number of other reasons.  To the greatest extend practical, we like to include in the main set.mm material that will be useful for further developments.  Making a judgment of what should go in the main set.mm can be difficult and time-consuming and has led to disagreements on occasion.

An objective criterion that addresses some of these issues is that if something is used by two people, that is a good indication that it is useful.  Usually we will then "automatically" move it into the main set.mm, although we may revise it by changing its label to conform to our general conventions and/or restating the theorem to be closer to the style of related theorems in the main set.mm.

Norm

Mario Carneiro

unread,
Mar 10, 2019, 9:08:02 PM3/10/19
to metamath
On Sun, Mar 10, 2019 at 4:16 PM Jon P <drjonp...@gmail.com> wrote:
I have been thinking more about whether it is possible to directly substitute things, ( for example if A = B -> ((W x. A)/C) = ((W x. B)/C) or whatever ). Is there any way this could be defined for an arbitrary symbol string? Presumably MM is doing this sort of substitution all the time when unifying etc? If it were possible to have something like this I think it would result in a massive speedup because you can work on small pieces of a large formula and then quickly swap them.

mmj2 will do this automatically, as I demonstrated. In fact, given a goal (ph -> ((W x. A)/C) = ((W x. B)/C)) it will automatically apply the relevant equality lemmas and give you back (ph -> A = B) as a goal, even when it doesn't know that this is given.  This can sometimes lead to incorrect directions, for example if A =/= B but (W x. A) = (W x. B) then mmj2 might go down the wrong path trying to prove A = B, but on the whole this has really freed my mind up from all the equality lemmas.

What mmj2 won't do on its own is to take a goal ((W x. A)/C) = &C1 and an equality A = B and invent and prove the substitution ((W x. B)/C) for &C1. You have to explicitly insert the substitution for the work variable, probably by copying ((W x. A)/C) onto &C1 and changing the A's for B's in the relevant locations. This could potentially be done by mmj2 but the interaction mode doesn't quite support it - there isn't a place to insert the information "A = B and substitute" into the unify mechanism, and other methods like macro invocations are more clunky to use.

Jon P

unread,
Mar 13, 2019, 2:30:00 PM3/13/19
to meta...@googlegroups.com
Thanks Mario.

Can I ask some questions, to anyone interested, about establishing the area of a triangle in CC? I think it would be helpful for heron and will also be needed for Pick's Theorem (though that looks very hard).

I'm not sure I really understand this thing; ∫ℝ(vol‘(𝑆 “ {𝑡})) d𝑡   As far as I understand it means that t runs from -inf to inf and is kind of all the possible areas that S could have? And then S[{t}] is any part of S which has area t, and then vol' is the inverse measure of this? 

So say I had a unit square in CC, then S[{t}] = null for all t except t = 1 and at that value it's the square? As you can see I am quite confused.

Further to this what is a good strategy for finding the area of a triangle? Maybe start with a step function and prove the area of a box is width x height, the have a sawtooth function like f(x) = 1 - x for x = 0..1 and 0 otherwise and integrate this? This could be extended to other triangles maybe? I don't know if this is the right sort of idea.

Mario Carneiro

unread,
Mar 13, 2019, 2:56:08 PM3/13/19
to metamath
On Wed, Mar 13, 2019 at 2:30 PM Jon P <drjonp...@gmail.com> wrote:
Thanks Mario.

Can I ask some questions about establishing the area of a triangle in CC? I think it would be helpful for heron and will also be needed for Pick's Theorem (though that looks very hard).

I'm not sure I really understand this thing; ∫ℝ(vol‘(𝑆 “ {𝑡})) d𝑡   As far as I understand it means that t runs from -inf to inf and is kind of all the possible areas that S could have? And then S[{t}] is any part of S which has area t, and then vol' is the inverse measure of this? 

"area" is defined on subsets of (RR X. RR), not subsets of CC. You will need to make another version of "area" for subsets of CC. (Or perhaps this function should be redefined, since we seem to be doing all our geometry on CC.)

If we define the unit square as S = ( II X. II ) (where II = [0, 1]), then S " { t } is the forward image of S, or the fiber of S, at the point t. This is the set II if t e. II and (/) otherwise. If we take the volume of that set, it's 1 if t e. II and 0 otherwise. So

S. RR if ( t e. II , 1 , 0 ) _d t = S. II 1 _d t = ( vol ` II ) = 1,

hence the volume of the (axis-aligned) unit square is 1.
 
So say I had a unit square in CC, then S[{t}] = null for all t except t = 1 and at that value it's the square? As you can see I am quite confused.

Further to this what is a good strategy for finding the area of a triangle? Maybe start with a step function and prove the area of a box is width x height, the have a sawtooth function like f(x) = 1 - x for x = 0..1 and 0 otherwise and integrate this? This could be extended to other triangles maybe? I don't know if this is the right sort of idea.

You have the right idea. If you look at an arbitrary triangle, the integral of the sections goes up linearly for a while and then goes back down. We can integrate linear functions, so you get the result from there. It's a lot of messy algebra, but it should be doable. It might help to split the triangle into almost disjoint axis-aligned triangles. (This will require some facts about the area of almost disjoint sets, which might be more trouble than is worth it unless you do the measure theory properly. This "area" function isn't correct from the measure theory point of view because the domain is too large; it should only be defined on the product measure.)

Mario

Jon P

unread,
Mar 15, 2019, 7:09:44 AM3/15/19
to Metamath
I'm trying to copy areacirc but to do it with just a unit square to try and get the idea and I'm pretty lost. 

I managed to prove, |- ( ph -> ( t e. ( 0 [,] 1 ) |-> 1 ) e. L^1 ), which was nice. (I used deduction form just because I am a bit more used to that.)

However I don't quite understand why areacirc and it's lemmas are so long. To perform this

S. RR if ( t e. II , 1 , 0 ) _d t = S. II 1 _d t = ( vol ` II ) = 1,

do I really need 800 steps? More generally how do I evaluate an integral, is there a theorem for this? 

Thierry Arnoux

unread,
Mar 15, 2019, 7:53:51 AM3/15/19
to meta...@googlegroups.com
Hi Jon,

I believe you won’t need the 800 steps!
The function you try to integrate is the union of  three constant functions,
- the constant function equal to 0 over (-oo,0)
- the constant function equal to 1 over [0,1]
- the constant function equal to 0 over (1,+oo)
So I believe you can split it using ~ itgsplit (twice), and the integrate each of the three parts using ~ itgconst.

I suppose the tricky part (where you will use a lot of steps, and efforts) will be to actually split your function.
_
Thierry
--

Thierry Arnoux

unread,
Mar 15, 2019, 8:01:47 AM3/15/19
to meta...@googlegroups.com
PS. I see there is in my mathbox a theorem call ~ partfun which may help you.
Combined with ~ fresaunres1 and ~ fresaunres2, it might be what you need for “splitting” your function.

Mario Carneiro

unread,
Mar 15, 2019, 8:11:08 AM3/15/19
to metamath
Those two equalities should be single steps. There is no need to further split the function. Lebesgue integrals are about integrating sets; S. RR if ( x e. A , B , 0 ) _d x = S. A B _d x should be either the definition or an early theorem.

Edit: it's itgss2

Thierry Arnoux

unread,
Mar 15, 2019, 8:37:08 AM3/15/19
to meta...@googlegroups.com
Right, thank you Mario!
Then, what about the computation of ( vol ‘ [ 0 , 1 ] ) = ( 1 - 0 ) ?
I would try ~ ovolioo, ~ volinun and ~ iccvolcl  , ~ iccmbl, but maybe there is a simpler way?
If it does not exist, it might be worth a theorem of its own!
_
Thierry

Mario Carneiro

unread,
Mar 15, 2019, 8:38:23 AM3/15/19
to metamath
is ovolicc not there?

Thierry Arnoux

unread,
Mar 15, 2019, 8:52:38 AM3/15/19
to meta...@googlegroups.com
Indeed!
Then with ~ mblvol, there is the equality of the volume and the outer volume.
A bit of arithmetic, and I guess Jon has his proof.

Jon P

unread,
Mar 15, 2019, 1:46:40 PM3/15/19
to Metamath
Thanks for the help :)

I think I've mostly got it (sorry it's a bit of a mess). Has anyone got advice for the top bit? I can't quite get from the area definition to step 40.

area1::areaval     |- ( S e. dom area -> ( area ` S ) = S. RR ( vol ` ( S " { x } ) ) _d x )
!d2::              |- ( ph -> S e. dom area )
area2:d2,area1:syl |- ( ph -> ( area ` S ) = S. RR ( vol ` ( S " { x } ) ) _d x )
sdef:: |- S = ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) )

39:: |- ( ph -> ( vol ` ( S " { x } ) ) = if ( x e. ( 0 [,] 1 ) , 1 , 0 ) )
39a:: |- ( ph -> ( ( A e. dom vol /\ B e. dom vol /\ A = B ) -> S. RR A _d x = S. RR B _d x ) )
40:39,39a: |- ( ph -> S. RR ( vol ` ( S " { x } ) ) _d x = S. RR if ( x e. ( 0 [,] 1 ) , 1 , 0 ) _d x )

51::iccmbl         |- ( ( 0 e. RR /\ 1 e. RR ) -> ( 0 [,] 1 ) e. dom vol )
52:13,11,51:syl2anc |- ( ph -> ( 0 [,] 1 ) e. dom vol )

100::itgconst      |- ( ( ( 0 [,] 1 ) e. dom vol /\ ( vol ` ( 0 [,] 1 ) ) e. RR /\ 1 e. CC ) 
-> S. ( 0 [,] 1 ) 1 _d x = ( 1 x. ( vol ` ( 0 [,] 1 ) ) ) )


200::itgss2        |- ( ( 0 [,] 1 ) C_ RR -> S. ( 0 [,] 1 ) 1 _d x = S. RR if ( x e. ( 0 [,] 1 ) , 1 , 0 ) _d x )
201::unitssre |- ( 0 [,] 1 ) C_ RR
202:201:a1i |- ( ph -> ( 0 [,] 1 ) C_ RR )
203:202,200:syl |- ( ph -> S. ( 0 [,] 1 ) 1 _d x = S. RR if ( x e. ( 0 [,] 1 ) , 1 , 0 ) _d x ) 

300::ovolicc       |- ( ( 0 e. RR /\ 1 e. RR /\ 0 <_ 1 ) -> ( vol* ` ( 0 [,] 1 ) ) = ( 1 - 0 ) )
301:13,11,13b,300:syl3anc |- ( ph -> ( vol* ` ( 0 [,] 1 ) ) = ( 1 - 0 ) ) 
400::mblvol        |- ( ( 0 [,] 1 ) e. dom vol -> ( vol ` ( 0 [,] 1 ) ) = ( vol* ` ( 0 [,] 1 ) ) )
401:52,400:syl |- ( ph -> ( vol ` ( 0 [,] 1 ) ) = ( vol* ` ( 0 [,] 1 ) ) )
402:401,301:eqtrd |- ( ph -> ( vol ` ( 0 [,] 1 ) ) = ( 1 - 0 ) )
403::1m0e1 |- ( 1 - 0 ) = 1
404:403:a1i |- ( ph -> ( 1 - 0 ) = 1 )
405:402,404:eqtrd |- ( ph -> ( vol ` ( 0 [,] 1 ) ) = 1 )
406:405:oveq2d |- ( ph -> ( 1 x. ( vol ` ( 0 [,] 1 ) ) ) = ( 1 x. 1 ) )
408:405,11:eqeltrd |- ( ph -> ( vol ` ( 0 [,] 1 ) ) e. RR )
409:52,408,11c,100:syl3anc |- ( ph -> S. ( 0 [,] 1 ) 1 _d x = ( 1 x. ( vol ` ( 0 [,] 1 ) ) ) )
410:409,406:eqtrd |- ( ph -> S. ( 0 [,] 1 ) 1 _d x = ( 1 x. 1 ) ) 
411::1t1e1 |- ( 1 x. 1 ) = 1
412:411:a1i |- ( ph -> ( 1 x. 1 ) = 1 )
413:410,412:eqtrd |- ( ph -> S. ( 0 [,] 1 ) 1 _d x = 1 )

500:413,203:eqtr3d |- ( ph -> 1 =  S. RR if ( x e. ( 0 [,] 1 ) , 1 , 0 ) _d x )
501:500:eqcomd |- ( ph -> S. RR if ( x e. ( 0 [,] 1 ) , 1 , 0 ) _d x = 1 )


999:40,501:eqtrd |- ( ph -> S. RR ( vol ` ( S " { x } ) ) _d x = 1 )
1000:area2,999:eqtrd |- ( ph -> ( area ` S ) = 1 )

Mario Carneiro

unread,
Mar 15, 2019, 2:35:59 PM3/15/19
to metamath
The predicate S e. dom area is shorthand for a particular measurability claim; use dmarea to apply the definition. This gives you three subgoals: it is a subset of ( RR X. RR ) (this is easy), ( S " { x } ) is finitely measurable for each x, and the function ( x e. RR |-> ( vol ` ( S " { x } ) ) ) that gives that measure is integrable.

The good news is that you basically already had to know this stuff in order to provve the equality, you just have to trace it back. You proved ( 0 [,] 1 ) is measurable on line 52, and (/) is also measurable, so by ifcl

 ( S " { x } ) = if ( x e. ( 0 [,] 1 ) , ( 0 [,] 1 ) , (/) )

is also measurable. That proves the second goal. For the third goal, you have to know the actual measure of this set; you have or are calculating this on line 52, which follows from line 405 and ( vol ` (/) ) = 0 and another if theorem. Once you have rewritten, you need to prove that ( x e. RR |-> if ( x e. ( 0 [,] 1 ) , 1 , 0 ) ) is integrable. This follows by the theorem analogous to itgss2, which is iblss2; it is stated a bit weird but it says that if the function is 0 outside a set A and it is integrable on A, (and A is measurable,) then it is integrable on B as well. You have all of these facts already except integrability of ( x e. ( 0 [,] 1 ) |-> if ( x e. ( 0 [,] 1 ) , 1 , 0 ) ); but this can be rewritten to a constant function, and then iblconst does the job.

Mario

--

Thierry Arnoux

unread,
Mar 15, 2019, 3:15:04 PM3/15/19
to meta...@googlegroups.com, Mario Carneiro

Here would be some of the missing pieces for step 40 - Mario, I'm curious if there is a shorter way!

600::xpimasn        |- ( x e. ( 0 [,] 1 ) -> ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) = ( 0 [,] 1 ) )
610::xpima1         |- ( ( ( 0 [,] 1 ) i^i { x } ) = (/) -> ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) = (/) )
620::disjsn         |- ( ( ( 0 [,] 1 ) i^i { x } ) = (/) <-> -. x e. ( 0 [,] 1 ) )
630:620,610:sylbir  |- ( -. x e. ( 0 [,] 1 ) -> ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) = (/) )
635::ovol0          |- ( vol* ` (/) ) = 0
636::mblvol         |- ( (/) e. dom vol -> ( vol ` (/) ) = ( vol* ` (/) ) )
637::0mbl           |- (/) e. dom vol
638:637,636:ax-mp   |- ( vol ` (/) ) = ( vol* ` (/) )
639:638,635:eqtri   |- ( vol ` (/) ) = 0
641::               |- ( vol ` ( 0 [,] 1 ) ) = 1
650:600:fveq2d      |- ( x e. ( 0 [,] 1 ) -> ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) ) = ( vol ` ( 0 [,] 1 ) ) )
660:630:fveq2d      |- ( -. x e. ( 0 [,] 1 ) -> ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) ) = ( vol ` (/) ) )
670:650,641:syl6req |- ( x e. ( 0 [,] 1 ) -> 1 = ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) ) )
680:660,639:syl6req |- ( -. x e. ( 0 [,] 1 ) -> 0 = ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) ) )
d17:670:adantl      |- ( ( ( ph /\ x e. RR ) /\ x e. ( 0 [,] 1 ) ) -> 1 = ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) ) )
d18:680:adantl      |- ( ( ( ph /\ x e. RR ) /\ -. x e. ( 0 [,] 1 ) ) -> 0 = ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) ) )
690:d17,d18:ifeqda  |- ( ( ph /\ x e. RR ) -> if ( x e. ( 0 [,] 1 ) , 1 , 0 ) = ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) ) )

36:sdef:imaeq1i     |- ( S " { x } ) = ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } )
37:36:fveq2i        |- ( vol ` ( S " { x } ) ) = ( vol ` ( ( ( 0 [,] 1 ) X. ( 0 [,] 1 ) ) " { x } ) )
39:690,37:syl6reqr  |- ( ( ph /\ x e. RR ) -> ( vol ` ( S " { x } ) ) = if ( x e. ( 0 [,] 1 ) , 1 , 0 ) )
40:39:itgeq2dv      |- ( ph -> S. RR ( vol ` ( S " { x } ) ) _d x = S. RR if ( x e. ( 0 [,] 1 ) , 1 , 0 ) _d x )

Jon P

unread,
Mar 17, 2019, 1:30:25 PM3/17/19
to meta...@googlegroups.com
Awesome thanks :)

I think I only have 1 step left, which is pretty cool, though I would not be suprised if I am wrong and there are more.

I have this 62 and need to prove 64. Unfortunately 63 is not an equality so it doesn't help. I had a look for other thms with   `' vol "  but couldn't really find any.
 
62:sdef13,61:eqeltri |- ( S " { x } ) e. dom vol 
63::cnvimass       |- ( `' vol " RR ) C_ dom vol
64:: |- A. x e. RR ( S " { x } ) e. ( `' vol " RR ) 

I have lots of other related things like 

695a:695:rgen |- A. x e. RR ( vol ` ( S " { x } ) ) = if ( x e. ( 0 [,] 1 ) , 1 , 0 )
850:12,802:ax-mp |- ( x e. RR |-> ( vol ` ( S " { x } ) ) ) e. L^1 

so I think I should have the pieces I need, just need one theorem linking dom vol with `' vol " RR :)

Thierry Arnoux

unread,
Mar 17, 2019, 6:58:54 PM3/17/19
to meta...@googlegroups.com

Hi Jon,

The expression ` ( S " { x } ) e. ( `' vol " RR ) ` means that ` ( S " { x } ) ` is in the preimage of ` RR ` under the function ` vol `. Theorem ~ fvimacnv shows that this is equivalent to ` ( vol ` ( S " { x } ) ) e. RR ` . Indeed a the measure of a set could be a non-negative real number, or +oo, so saying that it is real basically means saying that it is not infinite.

Another way to say it is ` ( S " { x } ) ` is Lebesgue-measurable (see ~ df-vol). Since the measure of ` ( S " { x } ) ` is either 0 or 1, it is obviously always a real number.

63a::fvimacnv        |- ( ( Fun vol /\ ( S " { x } ) e. dom vol ) -> ( ( vol ` ( S " { x } ) ) e. RR <-> ( S " { x } ) e. ( `' vol " RR ) ) )
63b::volf            |- vol : dom vol --> ( 0 [,] +oo )
63c::ffun            |- ( vol : dom vol --> ( 0 [,] +oo ) -> Fun vol )
63d:63b,63c:ax-mp    |- Fun vol
63e:63d,62,63a:mp2an |- ( ( vol ` ( S " { x } ) ) e. RR <-> ( S " { x } ) e. ( `' vol " RR ) )
63f::ifcl            |- ( ( 1 e. RR /\ 0 e. RR ) -> if ( x e. ( 0 [,] 1 ) , 1 , 0 ) e. RR )
63g:d8,d7,63f:mp2an  |- if ( x e. ( 0 [,] 1 ) , 1 , 0 ) e. RR
63h:695,63g:syl6eqel |- ( x e. RR -> ( vol ` ( S " { x } ) ) e. RR )
63i:63h,63e:sylib    |- ( x e. RR -> ( S " { x } ) e. ( `' vol " RR ) )
64:63i:rgen          |- A. x e. RR ( S " { x } ) e. ( `' vol " RR )

_
Thierry

Jon P

unread,
Mar 18, 2019, 6:42:29 AM3/18/19
to meta...@googlegroups.com
:) :) :) Thanks Thierry that was the last piece, proof generated :) :) :) :) 

I know it's not a great proof but it's really nice to actually do one. Thanks also to Mario, you've both been really helpful and I appreciate it. If anyone is interested I pasted the proof here (it's a bit of a mess).

I wanted to ask about where to go next. My plan is to try to compute the area of quadrilaterals with vertical sides, like this. I think this is a reasonable extension on the proof I have just done. Then I think I can compute the area of any triangle, like this by splitting it into two quadrilaterals, AADB and DBCC where each has two coincident vertices. I think that this will be a general theorem for any triangle because if the triangle has a vertical side, for example, then one of it's quadrilaterals will have 0 area so the thm should work fine. Any advice or guidance would be really appreciated if this is a good plan or not.

One issue is that I don't know whether to work in RR X. RR = R2 or CC. The area definition is in R2, area of a circle is computed in R2. However heron is in C and I looked at moving it to R2 but it relies on lawcos which is in C. There are also quite a lot of thms about triangles in C already here. Can someone more senior in the project make a judgement call on which way to go? 

Is it better to move heron to R2 and move the things it relies on too, like lawcos and anything needed below that? Is it better to do a new area definition for C and then work with that? Maybe there is some possible thm that maps areas in R2 to areas in C like <x,y> <-> x + iy which means we could use the R2 def in C? I am unsure and would like some guidance. 

Thierry Arnoux

unread,
Mar 18, 2019, 7:59:07 AM3/18/19
to meta...@googlegroups.com, Jon P

Hi Jon,

That's great! I The best place to share your proof would be in your Mathbox - it's quite easy to create, and your proof would be made available as a new theorem.

I think your next steps are the correct ones, and your suggestion to tackle the two triangles in one general case seems to be a clever choice.

I would continue your proof in RR X. RR, I think it's where area is the most naturally expressed, and it's that expression we'll get when we'll derive it using Fubini's theorem.

We have ~ cnref1o to convert back-and forth, if a proof is more convenient in CC.

_
Thierry


savask

unread,
Mar 18, 2019, 8:34:23 AM3/18/19
to Metamath
I'm definitely not "more senior in the project", but I will express an opinion opposite to Thierry's: doing it in CC is more convenient. CC has been our main geometric playground in metamath, also vector calculus, rotations, shifts and other geometric transformations are easier to do in CC. Measuring angles and distances, using continuity is also more direct, and I bet someone experienced could name more advantages of doing geometry in CC. Having all that in mind, I admit that our current area definition is rooted in RR X. RR, but if CC will continue to be our standard Euclidean plane, then it makes sense to define area for it as well (by the way, the comment to carea tells that perhaps it was an original idea).

Jon P

unread,
Mar 20, 2019, 8:18:22 AM3/20/19
to Metamath

1 vote for each direction :) I'd be interested if anyone else has input. I'll carry on as I am for now.

Can I ask a question about the best way to define this quadrilateral with vertical sides, is this a good approach?

1a:: |- A e. ( RR X. RR )
1b:: |- B e. ( RR X. RR )
1c:: |- C e. ( RR X. RR )
1d:: |- D e. ( RR X. RR )
2a:: |- ( 1st ` A ) = ( 1st ` B )
2b:: |- ( 1st ` C ) = ( 1st ` D )
2c:: |- ( 1st ` A ) <_ ( 1st ` C )

9:: |- E = ( ( 1st ` A ) [,] ( 1st ` C ) ) *this is the subset of the x axis where the quadrilateral is, if I am using 1st correctly

10:: |- ( x e. E ->  ( I ` { x } ) = ( ( { x } - ( 1st ` A ) ) / ( ( 1st ` C ) - ( 1st ` A ) ) ) ) *this is a function that goes from 0 to 1 as x goes from (1st A) to (1st C)

11:: |- ( x e. E -> ( S ` { x } ) 
= ( ( ( ( I ` { x } ) x. ( 2nd ` C ) ) + ( ( 1 - ( I ` { x } ) ) x. ( 2nd ` A ) ) ) 
[,] ( ( ( I ` { x } ) x. ( 2nd ` D ) ) + ( ( 1 - ( I ` { x } ) ) x. ( 2nd ` B ) ) ) ) ) *so S is a line segment in the y direction at each point in the domain

15::ftc2  |- ( &W1 -> S. ( ( 1st ` A ) (,) ( 1st ` C ) ) ( ( RR _D ( vol ` S ) ) ` x ) _d x = ( ( ( vol ` S ) ` ( 1st ` C ) ) - ( ( vol ` S ) ` ( 1st ` A ) ) ) ) *use the fundamental theorem of calculus to work out the area integral?

I think I am a bit lost and not so sure what I am doing. Maybe computing RR _D (vol ` S) will be hard? Also I am not sure if I am defining those functions correctly. Any help appreciated :)



Thierry Arnoux

unread,
Mar 20, 2019, 9:44:04 AM3/20/19
to meta...@googlegroups.com, Jon P

Hi Jon,

It's true what you need to build is a bit complex :-)

Here is maybe an easier way to describe the shape:

|- S = { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) }

with

|- U = ( C + ( ( ( x - A ) / ( B - A ) ) x. ( D - C ) ) )

|- V = ( E + ( ( ( x - A ) / ( B - A ) ) x. ( F - E ) ) )

(And in this case, A, B, C, D, E, F in RR)

This tells that S is a set of pairs <. x , y >., with x between A and B, and y between U and V. The trick here is that U and V actually depend on x, so you have to think of them as U(x) and V(x).

The coordinates of the quadrilateral are: <. A , C >. and <. A , E >. on one side, and <. B , D >. and <. B , F >. on the other side.

Then if you look at ( S " { x } ), a "slice" of that quadrilateral, you should get ( S " { x } ) = ( U [,] V ), which Lebesgue measure you already know.

The similarities between the formulas of U and V may be exploited by some appropriate lemma.

In the end, you'll have to simplify and integrate ( V - U ) ( to be thought as V(x) - U(x) ).

BR,
_
Thierry

Jon P

unread,
Mar 23, 2019, 5:59:56 AM3/23/19
to meta...@googlegroups.com
Thanks Thierry.

I have another question, how do I evaluate the image on this set definition? Before I had

h7::areaboxg.7     |- S = ( ( A [,] B ) X. ( C [,] D ) )
s1:7:imaeq1i |- ( S " { x } ) = ( ( ( A [,] B ) X. ( C [,] D ) ) " { x } )
s2::xpimasn    |- ( x e. ( A [,] B ) -> ( ( ( A [,] B ) X. ( C [,] D ) ) " { x } ) = ( C [,] D ) )

and also with xpima1 and some working this gave

s11:s1,s10:eqtr4i |- ( S " { x } ) = if ( x e. ( A [,] B ) , ( C [,] D ) , (/) )

I think things should be similar this time however is there something else to use in place of xpimasn? I had a look at the various defima's but couldn't quite work it out. What theroem would apply to the following to get it's image at x? 

13:: |- S = { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) } 

If my questions become annoying please feel free not to answer :)

Mario Carneiro

unread,
Mar 23, 2019, 6:53:08 AM3/23/19
to metamath
I don't think there is a ready made theorem, but you can do it like this:

50::                    |- S = { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) }
51::vex                 |- x e. _V
52::vex                 |- y e. _V
53:51,52:elimasn       |- ( y e. ( S " { x } ) <-> <. x , y >. e. S )
54::nfopab2           |- F/_ y { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) }
55:50,54:nfcxfr      |- F/_ y S
56::nfcv             |- F/_ y { x }
57:55,56:nfima      |- F/_ y ( S " { x } )
58::nfcv            |- F/_ y ( U [,] V )
59::nfv              |- F/ y x e. ( A [,] B )
60:50:eleq2i           |- ( <. x , y >. e. S <-> <. x , y >. e. { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) } )
61::opabid             |- ( <. x , y >. e. { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) } <-> ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) )
62:53,60,61:3bitri    |- ( y e. ( S " { x } ) <-> ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) )
63:62:baib          |- ( x e. ( A [,] B ) -> ( y e. ( S " { x } ) <-> y e. ( U [,] V ) ) )
64:59,57,58,63:eqrd
                   |- ( x e. ( A [,] B ) -> ( S " { x } ) = ( U [,] V ) )

65:59:nfn           |- F/ y -. x e. ( A [,] B )
66::nfcv            |- F/_ y (/)
67:62:simplbi        |- ( y e. ( S " { x } ) -> x e. ( A [,] B ) )
68::noel              |- -. y e. (/)
69:68:pm2.21i        |- ( y e. (/) -> x e. ( A [,] B ) )
70:67,69:pm5.21ni   |- ( -. x e. ( A [,] B ) -> ( y e. ( S " { x } ) <-> y e. (/) ) )
qed:65,57,66,70:eqrd
                   |- ( -. x e. ( A [,] B ) -> ( S " { x } ) = (/) )


On Sat, Mar 23, 2019 at 5:59 AM Jon P <drjonp...@gmail.com> wrote:
Thanks Thierry.

I have another question, how do I evaluate the image on this set definition? Before I had

h7::areaboxg.7     |- S = ( ( A [,] B ) X. ( C [,] D ) )
s1:7:imaeq1i |- ( S " { x } ) = ( ( ( A [,] B ) X. ( C [,] D ) ) " { x } )
s2::xpimasn    |- ( x e. ( A [,] B ) -> ( ( ( A [,] B ) X. ( C [,] D ) ) " { x } ) = ( C [,] D ) )

and also with xpima1 this gave

s11:s1,s10:eqtr4i |- ( S " { x } ) = if ( x e. ( A [,] B ) , ( C [,] D ) , (/) )

I think things should be similar this time however is there something else to use in place of xpimasn? I had a look at the various defima's but couldn't quite work it out. What would apply to 

13:: |- S = { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) } 

If my questions become annoying please feel free not to answer :)

--

Jon P

unread,
Mar 25, 2019, 7:23:58 AM3/25/19
to Metamath
Thanks this is very helpful :) Progress is reasonable.

I used iccleub and I also used the same idea for the lower bound, i.e., if C e. [A,B] then A <_ C but I couldn't find it in the database, maybe it would be iccgrlb? 

If it is not there then here is a proof for it, I can make a pull request for it if it would be helpful.

41::elicc1         |- ( ( A e. RR* /\ B e. RR* ) -> ( C e. ( A [,] B ) <-> ( C e. RR* /\ A <_ C /\ C <_ B ) ) )
41a::simp2         |- ( ( C e. RR* /\ A <_ C /\ C <_ B ) -> A <_ C )
41b:41,41a:syl6bi  |- ( ( A e. RR* /\ B e. RR* ) -> ( C e. ( A [,] B ) -> A <_ C ) )
41c:41b:3impia     |- ( ( A e. RR* /\ B e. RR* /\ C e. ( A [,] B ) ) -> A <_ C )

Jon P

unread,
Mar 26, 2019, 6:37:19 AM3/26/19
to Metamath

I think I am making some progress, the proof is pretty far along. If anyone is willing to help me with some issues that would be excellent :) You can see the proof here. Apologies it is quite messy, I have tried to take your advice Mario and do inner computations first and that helped a bit.

1. I am stuck on step 74, I have the information but it just doesn't want to lock in. That "t" in 73cb should be an <. x , y >. but it won't accept it, same with the $S1 in 73e. The only thing is to establish 74.

73c:60ba,73b:sylbi |- ( <. x , y >. e. S -> <. x , y >. e. ( RR X. RR ) )
73cb:73c:rgenw |- A. t e. S ( <. x , y >. e. S -> <. x , y >. e. ( RR X. RR ) )
73e::dfss2         |- ( S C_ ( RR X. RR ) <-> A. &S1 ( &S1 e. S -> &S1 e. ( RR X. RR ) ) )
74:73e,73cb: |- S C_ ( RR X. RR )

2. I can't quite get iblss2 to work on line 236. I tried having x e. ( A [,] B ) in place of 0 e. RR (which is a stupid thing I just put in there to have something to deduce from). However this gave me a DjVars error which I don't really understand, I have had this error before and am not sure what it is. 

3. How do I compute the integral? Before I had this, 40 and 40a look fine but I can't use itgconst anymore as U,V are functions of x.

40::itgss2         |- ( ( A [,] B ) C_ RR -> S. ( A [,] B ) ( D - C ) _d x = S. RR if ( x e. ( A [,] B ) , ( D - C ) , 0 ) _d x )
40a:11,40:ax-mp |- S. ( A [,] B ) ( D - C ) _d x = S. RR if ( x e. ( A [,] B ) , ( D - C ) , 0 ) _d x
41::itgconst       |- ( ( ( A [,] B ) e. dom vol /\ ( vol ` ( A [,] B ) ) e. RR /\ ( D - C ) e. CC ) -> S. ( A [,] B ) ( D - C ) _d x = ( ( D - C ) x. ( vol ` ( A [,] B ) ) ) )
42:16a,25d,25ac,41:mp3an |- S. ( A [,] B ) ( D - C ) _d x = ( ( D - C ) x. ( vol ` ( A [,] B ) ) )
43:40a,42:eqtr3i |- S. RR if ( x e. ( A [,] B ) , ( D - C ) , 0 ) _d x = ( ( D - C ) x. ( vol ` ( A [,] B ) ) )
44:43,25aaa:eqtri |- S. RR if ( x e. ( A [,] B ) , ( D - C ) , 0 ) _d x = ( ( D - C ) x. ( B - A ) )
45:39c,44:eqtri |-  S. RR ( vol ` ( S " { x } ) ) _d x = ( ( D - C ) x. ( B - A ) ) 
46:45,25acb:eqtri |-  S. RR ( vol ` ( S " { x } ) ) _d x = ( ( B - A ) x. ( D - C ) ) 

Thierry Arnoux

unread,
Mar 26, 2019, 8:47:29 AM3/26/19
to meta...@googlegroups.com, Jon P

Hi Jon,

1. Here is how I would solve your step 74:

73e::df-xp         |- ( RR X. RR ) = { <. x , y >. | ( x e. RR /\ y e. RR ) }
73f:72b:ssopab2i   |- { <. x , y >. | ( x e. ( A [,] B ) /\ y e. ( U [,] V ) ) } C_ { <. x , y >. | ( x e. RR /\ y e. RR ) }
74:73f,13,73e:3sstr4i |- S C_ ( RR X. RR )

In your mail, you cannot substitute ` t ` with ` <. x , y >. ` because ` <. x , y >. ` is a class variable (see ~ cop) and ` t ` is a setvar variable (see ~ vt). Setvar variables are class variables (see ~ cv), but not vice-versa.

2. Since ~ iblss2 is only written in the deduction form, you need some dummy true constant wff for ph. Your choice of 0 e. RR is as good a choice as any other. I would say the usual way for this is to use ` T. ` , the constant true wff. You can then eliminate it using ~ trud.

BR,
_
Thierry

Thierry Arnoux

unread,
Mar 26, 2019, 9:31:37 AM3/26/19
to meta...@googlegroups.com, Jon P
Hi again Jon,

About your point 3., we're not integrating a constant anymore, so it's
not going to be that easy :-)

You'll have to develop ` ( V - U ) ` and use elementary theorems for
each multiplication, addition, subtraction.

Maybe you could take this opportunity to complement set.mm's library
with new utility theorems like ~ itgmulc1 (to integrate the product with
a constant on the right side), ~ itgdivc2 (to integrate a division with
a constant). Otherwise you will have to swap your products before
getting their integrals.

Another way would be to write a new utility theorem to integrate a
linear function, and then use it in your proof.

In any case, here is what some of your steps may look like:

1000::itgeq2dv       |- ( T. -> S. ( A [,] B ) ( vol ` ( S " { x } ) )
_d x = S. ( A [,] B ) ( V - U ) _d x )
2000::itgsub         |- ( T. -> S. ( A [,] B ) ( V - U ) _d x = ( S. ( A
[,] B ) V _d x - S. ( A [,] B ) U _d x ) )
2008:12a:a1i         |- ( ( T. /\ x e. ( A [,] B ) ) -> U = ( C + ( ( (
x - A ) / ( B - A ) ) x. ( D - C ) ) ) )
2010:2008:itgeq2dv   |- ( T. -> S. ( A [,] B ) U _d x = S. ( A [,] B ) (
C + ( ( ( x - A ) / ( B - A ) ) x. ( D - C ) ) ) _d x )
2020::itgadd         |- ( T. -> S. ( A [,] B ) ( C + ( ( ( x - A ) / ( B
- A ) ) x. ( D - C ) ) ) _d x = ( S. ( A [,] B ) C _d x + S. ( A [,] B )
( ( ( x - A ) / ( B - A ) ) x. ( D - C ) ) _d x ) )
2030::itgconst       |- ( ( ( A [,] B ) e. dom vol /\ ( vol ` ( A [,] B
) ) e. RR /\ C e. CC ) -> S. ( A [,] B ) C _d x = ( C x. ( vol ` ( A [,]
B ) ) ) )
2040::itgmulc2       |- ( T. -> ( ( D - C ) x. S. ( A [,] B ) ( ( x - A
) / ( B - A ) ) _d x ) = S. ( A [,] B ) ( ( D - C ) x. ( ( x - A ) / ( B
- A ) ) ) _d x )
2050::divrecd        |- ( x e. ( A [,] B ) -> ( ( x - A ) / ( B - A ) )
= ( ( x - A ) x. ( 1 / ( B - A ) ) ) )
2060::mulcomd        |- ( x e. ( A [,] B ) -> ( ( x - A ) x. ( 1 / ( B -
A ) ) ) = ( ( 1 / ( B - A ) ) x. ( x - A ) ) )
2070:2050,2060:eqtrd |- ( x e. ( A [,] B ) -> ( ( x - A ) / ( B - A ) )
= ( ( 1 / ( B - A ) ) x. ( x - A ) ) )
2080::itgmulc2       |- ( T. -> ( ( 1 / ( B - A ) ) x. S. ( A [,] B ) (
x - A ) _d x ) = S. ( A [,] B ) ( ( 1 / ( B - A ) ) x. ( x - A ) ) _d x )

I've used "T." as a dummy true wff variable - why not use "ph" instead
and turn your proof into the "deduction format"? It would keep it much
more general.

Do I miss a more direct proof here?

BR,
_
Thierry


Jon P

unread,
Mar 28, 2019, 2:01:47 PM3/28/19
to Metamath
Thanks for your help Thierry :) :)

I think I have made some progress, after only 300 lines of algebra I have got the value of the integral! There are only a small number of issues remaining, which is nice. New version is here.

Here is the main thing, I cannot connect these steps.

234a:15f,234:syl |- ( x e. ( A [,] B ) -> ( x e. ( A [,] B ) |-> ( vol ` ( S " { x } ) ) ) e. L^1 )
234ab:234:rgen |- A. x e. RR ( x e. ( A [,] B ) |-> ( vol ` ( S " { x } ) ) ) e. L^1
234b:234ab: |- ( x e. ( A [,] B ) |-> ( vol ` ( S " { x } ) ) ) e. L^1
235:234b:a1i   |- ( 0 e. RR -> ( x e. ( A [,] B ) |-> ( vol ` ( S " { x } ) ) ) e. L^1 )

The  ( x e. ( A [,] B ) -> is needed in the top step because S is based on U and V which are functions of x. However this means I cannot prove 234b and therefore cannot have 235 which I need for the next step. Here are other steps which are missing which have the same issue, hopefully once one can be fixed the all can be.

!d26::             |- ( T. -> ( x e. ( A [,] B ) |-> V ) e. L^1 )
!d28::             |- ( T. -> ( x e. ( A [,] B ) |-> U ) e. L^1 )
!d32::             |- ( T. -> ( x e. ( A [,] B ) |-> ( ( ( x - A ) / ( B - A ) ) x. ( D - C ) ) ) e. L^1 )
!d35::             |- ( T. -> ( x e. ( A [,] B ) |-> ( ( x - A ) / ( B - A ) ) ) e. L^1 )
!d42::             |- ( T. -> ( x e. ( A [,] B ) |-> ( x - A ) ) e. L^1 )
!d54::             |- ( T. -> ( x e. ( A [,] B ) |-> x ) e. L^1 )
!d67::             |- ( T. -> ( x e. ( A [,] B ) |-> ( ( ( x - A ) / ( B - A ) ) x. ( F - E ) ) ) e. L^1 )

I think it is true that if  ( x e. ( A [,] B ) -> ( x e. ( A [,] B ) |-> ( vol ` ( S " { x } ) ) ) e. L^1 ) then ( x e. ( A [,] B ) |-> ( vol ` ( S " { x } ) ) ) e. L^1 because it's true at each point in the domain so surely it is true for the function as a whole?

Also I have started a proof of this 

250:: |- S. ( A [,] B ) x _d x = ( ( ( B ^ 2 ) - ( A ^ 2 ) ) / 2 )

and it is not going well ha ha, but fixing it is a problem for the future and I think it should be a separate proof. Any help appreciated, thanks for reading :)  

Thierry Arnoux

unread,
Mar 28, 2019, 9:29:09 PM3/28/19
to meta...@googlegroups.com, Jon P

Hi Jon,

Actually, you should not need ` x e. ( A [,] B ) ` as a hypothesis for ` ( x e. ( A [,] B ) |-> ( vol ` ( S " { x } ) ) ) e. L^1 ` , because x is free in the second expression. You could think ` x ` as local to this formula expression. It could as well be ` ( y e. ( A [,] B ) |-> ( vol ` ( S " { y } ) ) ) e. L^1 ` , or any other setvar (see ~ cbvmpt). So, I've tried to find out where this requirement came from.

It turns out that on line 227, you apply ~ cncfmptc, like for the square. The comment for this theorem says "a constant function is continuous". However you apply it for ` ( V - U ) ` which is not a constant function anymore. You could also say that x is not free in V and U (you can think of them as V(x) and U(x)). You can however apply it on ` C ` or ` D `, because these are real constants.

So, similar to the integral, we will have to show that ( V - U ) is integrable by splitting it out:

d77::eqid                     |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
238:d77:subcn                 |- - e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) )
d87:d77:addcn                 |- + e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) )
d78:238:a1i                   |- ( T. -> - e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) ) )
d82:d87:a1i                   |- ( T. -> + e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) ) )
239:10:mpteq2i                |- ( x e. ( A [,] B ) |-> U ) = ( x e. ( A [,] B ) |-> ( C + ( ( ( x - A ) / ( B - A ) ) x. ( D - C ) ) ) )

240::cncfmptc                 |- ( ( C e. CC /\ ( A [,] B ) C_ CC /\ CC C_ CC ) -> ( x e. ( A [,] B ) |-> C ) e. ( ( A [,] B ) -cn-> CC ) )
d96::cncfmptc                 |- ( ( D e. CC /\ ( A [,] B ) C_ CC /\ CC C_ CC ) -> ( x e. ( A [,] B ) |-> D ) e. ( ( A [,] B ) -cn-> CC ) )
d88:10cc,15b,228,240:mp3an    |- ( x e. ( A [,] B ) |-> C ) e. ( ( A [,] B ) -cn-> CC )
d92:10dc,15b,228,d96:mp3an    |- ( x e. ( A [,] B ) |-> D ) e. ( ( A [,] B ) -cn-> CC )
d83:d88:a1i                   |- ( T. -> ( x e. ( A [,] B ) |-> C ) e. ( ( A [,] B ) -cn-> CC ) )
d91:d92:a1i                   |- ( T. -> ( x e. ( A [,] B ) |-> D ) e. ( ( A [,] B ) -cn-> CC ) )
!d85::                        |- ( T. -> ( x e. ( A [,] B ) |-> ( ( x - A ) / ( B - A ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
d86:d77,d78,d91,d83:cncfmpt2f |- ( T. -> ( x e. ( A [,] B ) |-> ( D - C ) ) e. ( ( A [,] B ) -cn-> CC ) )
d84:d85,d86:mulcncf           |- ( T. -> ( x e. ( A [,] B ) |-> ( ( ( x - A ) / ( B - A ) ) x. ( D - C ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
247:d77,d82,d83,d84:cncfmpt2f |- ( T. -> ( x e. ( A [,] B ) |-> ( C + ( ( ( x - A ) / ( B - A ) ) x. ( D - C ) ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
d79:239,247:syl5eqel          |- ( T. -> ( x e. ( A [,] B ) |-> U ) e. ( ( A [,] B ) -cn-> CC ) )
!d80::                        |- ( T. -> ( x e. ( A [,] B ) |-> V ) e. ( ( A [,] B ) -cn-> CC ) )
249:d77,d78,d80,d79:cncfmpt2f |- ( T. -> ( x e. ( A [,] B ) |-> ( V - U ) ) e. ( ( A [,] B ) -cn-> CC ) )

This will remove the necessary hypothesis ` x e. ( A [,] B ) ` from your line 227, and subsequently you will be able to remove it all the way to your line 234a.

I hope this puts you on the right path!

BR,
_
Thierry


Jon P

unread,
Apr 2, 2019, 6:11:06 AM4/2/19
to Metamath
Thanks again Thierry. I would like to make you a coauthor if you would be comfortable with that as you have helped so much :)

I'm afraid there there is still one problem remaining in the proof, it's is 212e. 

212b:d77,d78,212a,211g:cncfmpt2f |- ( T. -> ( x e. ( A [,] B ) |-> ( x - A ) ) e. ( ( A [,] B ) -cn-> CC ) )
212c:d77,d78,211h,211g:cncfmpt2f |- ( T. -> ( x e. ( A [,] B ) |-> ( B - A ) ) e. ( ( A [,] B ) -cn-> CC ) )
212e:: |- ( T. -> ( x e. ( A [,] B ) |-> ( ( x - A ) / ( B - A ) ) ) e. ( ( A [,] B ) -cn-> CC ) )

I don't know how to do this division. I tried using divcn 

d87a:d77,d98:divcn |- / e. ( ( ( TopOpen ` CCfld ) tX ( ( TopOpen ` CCfld ) |`t ( CC \ { 0 } ) ) ) Cn ( TopOpen ` CCfld ) )

but the domain is different (as it excludes 0) and so cncfmpt2f doesn't work. I had a look around at cnmpt12f but am a bit out of my depth I think.

Also I have tried to write a proof for the integral of x^N and as you can see here most of the ideas are in but it is a total mess. I am sorry to post something not so good. If you (or anyone) is willing to help I appreciate it. I don't think I understood how hard this proof would turn out to be, at least it is nearly done :)


Thierry Arnoux

unread,
Apr 2, 2019, 7:19:57 PM4/2/19
to meta...@googlegroups.com, Jon P

Hi Jon!

Concerning your proof of the integral X^N, your problem is with these statements (there are other similar ones) :


  1. !d14::             |- ( ph -> ( x ^ N ) : ( A [,] B ) --> CC )
  2. !d5::              |- ( ph -> ( RR _D ( x ^ ( N + 1 ) ) ) e. L^1 )

Here,  ( x ^ N ) does not represents the function, but just the expression at the point ' x '.
What you want instead is ` ( x e. ( A [,] B ) |-> ( x ^ N ) ) ` : this one represents the function.
I believe if you make that change, you should be unblocked.

For your 212e, I'll look at it, it shall be feasible since you already have A =/= B as an assumption, so ( B - A ) cannot be zero. It may involve a bit of Topology.
Just one quick comment: your 212b obviously could have been proven using ~ cncfmptc, since ( B - A ) is a constant. Maybe this could lead to a somewhat shorter proof (maybe not).

_
Thierry

Thierry Arnoux

unread,
Apr 2, 2019, 8:27:32 PM4/2/19
to meta...@googlegroups.com, Jon P

Hi Jon!

I've put what you need for your step 212e on pastebin. (actually, no Topology involved!)

You're almost there!

_
Thierry


Jon P

unread,
Apr 4, 2019, 7:10:18 AM4/4/19
to Metamath
Thanks Thierry, that is super helpful, things are progressing well I think. The first proof is complete (proof generated is a nice message :) and the second is much better thanks to your advice. These are the problems that remain with it which I can't resolve:

There is this

176:175,174:eqtr3i |- ( RR _D ( t  e. RR |-> ( t  ^ ( N + 1 ) ) ) ) = ( t  e. RR |-> ( ( N + 1 ) x. ( t  ^ N ) ) )

and so I think these

!d21::             |- ( T. -> ( RR _D ( t  e. RR |-> ( t  ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
!d22::             |- ( T. -> ( RR _D ( t  e. RR |-> ( t  ^ ( N + 1 ) ) ) ) e. L^1 )
!d23::             |- ( T. -> ( t  e. RR |-> ( t  ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
!d35::             |- ( T. -> ( x e. ( A (,) B ) |-> ( x ^ N ) ) e. L^1 )

all boil down to proving 

( t  e. RR |-> ( t  ^ N ) e. ( ( A [,] B ) -cn-> CC ) 

I think that would be sufficient. I wondered if it should be a separate proof as maybe it is a useful result for the continuity section? I also wondered if it could be proven recursively, the identity function is cts by cncfmptid and if x^n is cts then x^(n+1) is cts by cncfmpt2f I think. But I am not sure how to write a recursive proof like this. 

These are the other things I am struggling with though I think they should be quite simple, I feel there must be a simple theorem out there for them, and that will complete it I think.

!d41::             |- S. ( A (,) B ) ( x ^ N ) _d x e. CC
120:116a: |- ( t  e. CC |-> ( t  ^ ( N + 1 ) ) ) : CC --> CC
120a:: |- ( t  e. CC |-> ( ( N + 1 ) x. ( t  ^ N ) ) ) : CC --> CC

I really appreciate your help. Please do not feel any obligation to respond quickly or respond at all, it's kind of you to help and there is no need to if you are not enjoying it. 

Thierry Arnoux

unread,
Apr 4, 2019, 1:52:32 PM4/4/19
to meta...@googlegroups.com
Hi Jon,

I'm glad I can help, and it's still relatively easy for me to do so!
It's nice to see your proofs progressing well!

For the first part, this is probably what you need:

200::expcncf         |- ( N e. NN0 -> ( t e. CC |-> ( t ^ N ) ) e. ( CC
-cn-> CC ) )
201::rescncf         |- ( ( A (,) B ) C_ CC -> ( ( t e. CC |-> ( t ^ N )
) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A (,) B ) ) e.
( ( A (,) B ) -cn-> CC ) ) )
202::resmpt          |- ( ( A (,) B ) C_ CC -> ( ( t e. CC |-> ( t ^ N )
) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( t ^ N ) ) )
210:9f,200:ax-mp     |- ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC )
211:114a,201:ax-mp   |- ( ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC )
-> ( ( t e. CC |-> ( t ^ N ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn->
CC ) )
212:114a,202:ax-mp   |- ( ( t e. CC |-> ( t ^ N ) ) |` ( A (,) B ) ) = (
t e. ( A (,) B ) |-> ( t ^ N ) )
220:210,211:ax-mp    |- ( ( t e. CC |-> ( t ^ N ) ) |` ( A (,) B ) ) e.
( ( A (,) B ) -cn-> CC )
230:212,220:eqeltrri |- ( t e. ( A (,) B ) |-> ( t ^ N ) ) e. ( ( A (,)
B ) -cn-> CC )

As you see, ~ expcncf is already the proof you need, the rest is just
for restricting it to the interval ( A , B ). It is derived from ~
expcn, which is indeed proven by induction, you can have a look at its
proof to see how induction is done.

For d41, you can use ~ itgcl.

For 120 and 120a, you can use ~ fmpti (with ~ eqid).

Once you know how things work, one of the hardest things in set.mm is
probably to guess if a theorem already exists for what you're looking
for or not, and to find it.

In the case of ~ itgcl, it's the "closure" (cl) theorem for the integral
(itg), so once you're used to it it's easy to guess the name (itg+cl =
itgcl).

Similarly, ~ fmpti is the inductive version (i) of the proof that a
mapping-to construct (mpt) is a function (f) : f+mpt+i = fmpti.

You can go on and fill in the blanks!

_
Thierry


Jon P

unread,
Apr 6, 2019, 5:33:53 AM4/6/19
to Metamath
Ok great :)

I have managed to fix most of the issues, unfortunately I am stuck on a bit of a thorny problem. Here is the current state.

The problem is that in the conditions for ftc2 I have used 

!d21::             |- ( T. -> ( RR _D ( t  e. RR |-> ( t  ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )

but I think this has a different domain, t e. RR, than what you have kindly shown me, which was

230:212,220:eqeltrri |- ( t e. ( A (,) B ) |-> ( t ^ N ) ) e. ( ( A (,)  B ) -cn-> CC ) 

Is d21 even meaningful, can a map from RR to CC be in ( ( A (,) B ) -cn-> CC )?

This problem kind of cascades through the rest of the proof where the domains vary. For example I tried using ( A (,) B ) as the domain for the map in ftc2 however you can't evaluate that at t = A or t = B so it needs to be at least ( A [,] B ). 

I am a bit confused about how to sort this out.

Mario Carneiro

unread,
Apr 6, 2019, 5:43:47 AM4/6/19
to metamath
As you suspect, that theorem is false: F e. ( A -cn-> B ) implies F : A --> B, so you must have made a mistake earlier, maybe applying a theorem that isn't applicable.

--

Mario Carneiro

unread,
Apr 6, 2019, 5:50:00 AM4/6/19
to metamath
In ftc2, the map must have exactly the domain ( A [,] B ), no more no less. If you have a function defined on RR, or a proof that this RR defined function is differentiable on RR, you can restrict the continuity to a subset using rescncf, and the differentiability proof using dvmptres.

Jon P

unread,
Apr 9, 2019, 6:12:26 AM4/9/19
to Metamath
Thanks Mario :)

I'm afraid I still have a couple of problems, one is easy, I am not sure what to fill in here, I was thinking maybe C5 = ( TopOpen ` CCfld ) and C4 = ( TopOpen ` RRfld ) but that is not a thing apparently. 

!d64::             |- &C4 = ( &C5 |`t RR )
!d65::             |- &C5 = ( TopOpen ` CCfld )
!d66::             |- ( T. -> ( A [,] B ) e. &C4 )
177:d48,d49,d50,d51,d52,d64,d65,d66:dvmptres 
                   |- ( T. -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) 
= ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )

The other is a bit more complicated. So I have this line

!d21::         |- ( T. -> ( RR _D ( t  e. ( A [,] B ) |-> ( t  ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )

which is part of the conditions of ftc2. I think it makes sense that when you differentiate you lose the end point of the domain, however dvmptres has the map on the same domain ( Y = (A [,] B )) in this case. So I am not sure how to equate the differential with a map on ( A (,) B ). You can see 177 doesn't have the right domain to help fill d21. I already have 

231a:15,231:ax-mp |- ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC )

and can get this on (A (,) B ) if required so it is only the domain that is the problem. Full text here


Mario Carneiro

unread,
Apr 9, 2019, 6:49:22 AM4/9/19
to metamath
d64 and d65 there are saying that &C5 is the topology of CC and &C4 is the topology of RR, and d66 says that ( A [,] B ) is open, so that's the wrong move. You can't prove 177 because a derivative always has an open domain. You should try to prove:

|- ( T. -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )

Presumably it's not so hard to see that the RHS has the domain ( A (,) B ), which is open.

As for how to go from the closed interval to the open one, that's what dvmptres2 is for. See the uses of this theorem for help on how to discharge the side goals, for example logccv.

Jon P

unread,
Apr 10, 2019, 5:03:59 AM4/10/19
to Metamath
Thanks for the help Mario.

I managed to prove something today! Which was a nice feeling, I don't think it exists in set.mm already, I think it's called cnioobibld.

I think using that I can finish off the proof for the integral of x^N :)

Jon P

unread,
Apr 11, 2019, 6:27:15 AM4/11/19
to Metamath
Unfortunately I am a bit stuck again :( If anyone has any clues that would be really helpful. 

I am trying to prove t^N is bounded on ( A (,) B ) and I am not quite sure how to proceed. I wondered about trying to argue that it's bounded on ( A [,] B ) by cniccbdd and then trying to show if a function is bounded on a set then it's bounded on a subset. However I am having trouble because of using this which limits my options in that regard, I think I have to prove it on the open interval

181a:15,181:ax-mp |- ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) )

this is what I have, I feel like it's close but it's clearly not right

241e:241d,241c:eqtr3i |- dom (  RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( A (,) B )
241f::cniccbdd     |- ( ( A e. RR /\ B e. RR  /\ ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A [,] B ) -cn-> CC ) ) 
-> E. z e. RR A. y e. ( A [,] B )  ( abs ` ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` y ) ) <_ z )
!241g:: |- E. z e. RR A. y e. ( A [,] B )  ( abs ` ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` y ) ) <_ z
!d79::             |- ( T. -> E. z e. RR A. y e. dom ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )  ( abs ` ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` y ) ) <_ z )
242:d76,d77,d78,d79:cnioobibld  |- ( T. -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )

Full text here


Mario Carneiro

unread,
Apr 11, 2019, 8:48:32 AM4/11/19
to metamath
Hi Jon and others,

I've been wondering whether to write a tutorial for a while now, but I am bad at doing recorded voiceovers. Instead, I have here a step by step proof of this theorem, where I've taken care to work through my process rather than just displaying a completed proof, so you can see how it came about. Maybe this could be hosted somewhere?

Mario

--------------------------------------------

*** The goal today is to prove the following theorem:

h50::itexp.1         |- ( ph -> A e. RR )
h51::itexp.2         |- ( ph -> B e. RR )
h52::itexp.3         |- ( ph -> A <_ B )
h53::itexp.4       |- ( ph -> N e. NN )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )

*** Jon thinks it would be easier to do this without the "ph ->", but I think he may regret that decision later.
*** Anyway it is epsilon harder to have a context so let's just go with it.

*** Let's try ftc2 with the right substitution:

h50::itexp.1         |- ( ph -> A e. RR )
h51::itexp.2         |- ( ph -> B e. RR )
h52::itexp.3         |- ( ph -> A <_ B )
h53::itexp.4       |- ( ph -> N e. NN )
!54::               |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
!55::               |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )
!56::               |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
57:50,51,52,54,55,56:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )


*** We prove the derivative is equal to something, which we use for 54 and 55:
!d1::              |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = &C1 )
!d2::              |- ( ph -> &C1 e. ( ( A (,) B ) -cn-> CC ) )
54:d1,d2:eqeltrd           |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )


*** and apply dvmptres2 and substitute:
!d3::              |- ( ph -> RR e. { RR , CC } )
!d4::                 |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. CC )
!d5::                 |- ( ( ph /\ t e. RR ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. &C5 )
!d6::                 |- ( ph -> ( RR _D ( t e. RR |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. RR |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
!d7::                 |- ( ph -> ( A [,] B ) C_ RR )
!d8::              |- &C3 = ( &C4 |`t RR )
!d9::              |- &C4 = ( TopOpen ` CCfld )
!d10::                |- ( ph -> ( ( int ` &C3 ) ` ( A [,] B ) ) = ( A (,) B ) )
d1:d3,d4,d5,d6,d7,d8,d9,d10:dvmptres2
                     |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )


*** let's clean up some side conditions:
h50::itexp.1        |- ( ph -> A e. RR )
h51::itexp.2        |- ( ph -> B e. RR )
h52::itexp.3        |- ( ph -> A <_ B )
h53::itexp.4       |- ( ph -> N e. NN )
54::reelprrecn         |- RR e. { RR , CC }
55:54:a1i             |- ( ph -> RR e. { RR , CC } )
56::simpr               |- ( ( ph /\ t e. RR ) -> t e. RR )
!57::                   |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. NN0 )
58:56,57:reexpcld      |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. RR )
59:58:recnd           |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. CC )
!60::                 |- ( ( ph /\ t e. RR ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. &C5 )
!61::                 |- ( ph -> ( RR _D ( t e. RR |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. RR |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
62::iccssre            |- ( ( A e. RR /\ B e. RR ) -> ( A [,] B ) C_ RR )
63:50,51,62:syl2anc   |- ( ph -> ( A [,] B ) C_ RR )
!64::                 |- &C3 = ( &C4 |`t RR )
!65::                 |- &C4 = ( TopOpen ` CCfld )
!66::                 |- ( ph -> ( ( int ` &C3 ) ` ( A [,] B ) ) = ( A (,) B ) )
67:55,59,60,61,63,64,65,66:dvmptres2
                     |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
!68::                |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
69:67,68:eqeltrd    |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
!70::               |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )
!71::               |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
72:50,51,52,69,70,71:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )



*** Oops, I forgot the name of this one:
!                   |- ( ( ph /\ t e. RR ) -> N e. NN0 )
!57::                   |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. NN0 )

*** thanks mmj2!
!d1::               |- ( ( ph /\ t e. RR ) -> N e. NN0 )
d2::peano2nn0      |- ( N e. NN0 -> ( N + 1 ) e. NN0 )
57:d1,d2:syl            |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. NN0 )


*** Okay, cleaned up:
h50::itexp.1        |- ( ph -> A e. RR )
h51::itexp.2        |- ( ph -> B e. RR )
h52::itexp.3        |- ( ph -> A <_ B )
h53::itexp.4              |- ( ph -> N e. NN )
54::reelprrecn         |- RR e. { RR , CC }
55:54:a1i             |- ( ph -> RR e. { RR , CC } )
56::simpr               |- ( ( ph /\ t e. RR ) -> t e. RR )
57:53:nnnn0d             |- ( ph -> N e. NN0 )
58:57:adantr            |- ( ( ph /\ t e. RR ) -> N e. NN0 )
59::peano2nn0            |- ( N e. NN0 -> ( N + 1 ) e. NN0 )
60:58,59:syl            |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. NN0 )
61:56,60:reexpcld      |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. RR )
62:61:recnd           |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. CC )
63:60:nn0red           |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. RR )
64:56,58:reexpcld      |- ( ( ph /\ t e. RR ) -> ( t ^ N ) e. RR )
65:63,64:remulcld     |- ( ( ph /\ t e. RR ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. RR )
!66::                 |- ( ph -> ( RR _D ( t e. RR |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. RR |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
67::iccssre            |- ( ( A e. RR /\ B e. RR ) -> ( A [,] B ) C_ RR )
68:50,51,67:syl2anc   |- ( ph -> ( A [,] B ) C_ RR )
69::eqid              |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
70:69:tgioo2          |- ( topGen ` ran (,) ) = ( ( TopOpen ` CCfld ) |`t RR )
!71::                 |- ( ph -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
72:55,62,65,66,68,70,69,71:dvmptres2
                     |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
!73::                |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
74:72,73:eqeltrd    |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
!75::                |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
76:72,75:eqeltrd    |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )
!77::               |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
78:50,51,52,74,76,77:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )


*** Now line 66 is provable without too much trouble.
*** let's ask mmj2 for dvexp:

!dvexp

d1::dvexp          |- ( &C1 e. NN -> ( CC _D ( &S1 e. CC |-> ( &S1 ^ &C1 ) ) ) = ( &S1 e. CC |-> ( &C1 x. ( &S1 ^ ( &C1 - 1 ) ) ) ) )

*** so we need to further relax the domain to CC, that's dvmptres3:
!d2::              |- &C2 = ( TopOpen ` CCfld )
!d3::                  |- ( ph -> CC e. &C2 )
!d4::              |- ( ph -> ( RR i^i CC ) = RR )
!d5::                  |- ( ( ph /\ t e. CC ) -> ( t ^ ( N + 1 ) ) e. CC )
!d6::                  |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. &C3 )
!d7::                  |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
66:d2,55,d3,d4,d5,d6,d7:dvmptres3 |- ( ph -> ( RR _D ( t e. RR |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. RR |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )


*** Here d3 says CC is open, toponmax is useful for that, and d4 is just set theory:
!d2::eqid              |- &C2 = ( TopOpen ` CCfld )
!d8::                   |- &C2 e. ( TopOn ` CC )
d9::toponmax            |- ( &C2 e. ( TopOn ` CC ) -> CC e. &C2 )
d3:d8,d9:mp1i              |- ( ph -> CC e. &C2 )

*** thanks mmj2:
d2::eqid               |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
d8:d2:cnfldtopon        |- ( TopOpen ` CCfld ) e. ( TopOn ` CC )
d9::toponmax            |- ( ( TopOpen ` CCfld ) e. ( TopOn ` CC ) -> CC e. ( TopOpen ` CCfld ) )
d3:d8,d9:mp1i          |- ( ph -> CC e. ( TopOpen ` CCfld ) )

*** for the other, apply sylib:
!d10::             |- ( ph -> &W1 )
!d11::             |- ( &W1 <-> ( RR i^i CC ) = RR )
d4:d10,d11:sylib        |- ( ph -> ( RR i^i CC ) = RR )

*** and double click on d11, because I know there is a theorem about this one but I forget the name:
!d10::                  |- ( ph -> RR C_ CC )
d11::df-ss              |- ( RR C_ CC <-> ( RR i^i CC ) = RR )
d4:d10,d11:sylib        |- ( ph -> ( RR i^i CC ) = RR )

*** Turns out it's the definition. Moving on...
d12::ax-resscn     |- RR C_ CC
d10:d12:a1i                |- ( ph -> RR C_ CC )


*** Now we have these closure lemmas; unfortunately the previous closure lemmas don't apply because we are on CC now:
!d5::                  |- ( ( ph /\ t e. CC ) -> ( t ^ ( N + 1 ) ) e. CC )
!d6::                  |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. &C3 )

*** (I typed expcld and then adantr to get the following:)
d13::simpr         |- ( ( ph /\ t e. CC ) -> t e. CC )
d15:57,59:syl      |- ( ph -> ( N + 1 ) e. NN0 )
d14:d15:adantr           |- ( ( ph /\ t e. CC ) -> ( N + 1 ) e. NN0 )
d5:d13,d14:expcld            |- ( ( ph /\ t e. CC ) -> ( t ^ ( N + 1 ) ) e. CC )

*** (and expcld and adantr again:)
d18:57:adantr      |- ( ( ph /\ t e. CC ) -> N e. NN0 )
d17:d13,d18:expcld       |- ( ( ph /\ t e. CC ) -> ( t ^ N ) e. CC )
d6:d16,d17:mulcld      |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. CC )


*** Finally, we have the real goal:
!d7::                  |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )

*** which unfortunately doesn't quite match dvexp because it uses -1 instead of +1. So we will use transitivity:
d21:53:peano2nnd   |- ( ph -> ( N + 1 ) e. NN )
d19:d21,d1:syl          |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) )
!d20::                  |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
d7:d19,d20:eqtrd           |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )

*** use mpteq2dva, oveq2 twice then pncan, and we're done.
d26:53:nncnd       |- ( ph -> N e. CC )
d27::1cnd          |- ( ph -> 1 e. CC )
d25:d26,d27:pncand       |- ( ph -> ( ( N + 1 ) - 1 ) = N )
d24:d25:adantr           |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) - 1 ) = N )
d23:d24:oveq2d           |- ( ( ph /\ t e. CC ) -> ( t ^ ( ( N + 1 ) - 1 ) ) = ( t ^ N ) )
d22:d23:oveq2d           |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) = ( ( N + 1 ) x. ( t ^ N ) ) )
d20:d22:mpteq2dva                |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )



*** Let's clean up and take stock, which means use Ctrl-Shift-U to unify/renumber and Ctrl-R to reformat:
h50::itexp.1        |- ( ph -> A e. RR )
h51::itexp.2        |- ( ph -> B e. RR )
h52::itexp.3        |- ( ph -> A <_ B )
h53::itexp.4                  |- ( ph -> N e. NN )
54::reelprrecn         |- RR e. { RR , CC }
55:54:a1i             |- ( ph -> RR e. { RR , CC } )
56::simpr               |- ( ( ph /\ t e. RR ) -> t e. RR )
57:53:nnnn0d              |- ( ph -> N e. NN0 )
58:57:adantr            |- ( ( ph /\ t e. RR ) -> N e. NN0 )
59::peano2nn0              |- ( N e. NN0 -> ( N + 1 ) e. NN0 )
60:58,59:syl            |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. NN0 )
61:56,60:reexpcld      |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. RR )
62:61:recnd           |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. CC )
63:60:nn0red           |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. RR )
64:56,58:reexpcld      |- ( ( ph /\ t e. RR ) -> ( t ^ N ) e. RR )
65:63,64:remulcld     |- ( ( ph /\ t e. RR ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. RR )
66::dvexp                |- ( ( N + 1 ) e. NN -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) )
67::eqid               |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
68:67:cnfldtopon        |- ( TopOpen ` CCfld ) e. ( TopOn ` CC )
69::toponmax            |- ( ( TopOpen ` CCfld ) e. ( TopOn ` CC ) -> CC e. ( TopOpen ` CCfld ) )
70:68,69:mp1i          |- ( ph -> CC e. ( TopOpen ` CCfld ) )
71::ax-resscn            |- RR C_ CC
72:71:a1i               |- ( ph -> RR C_ CC )
73::df-ss               |- ( RR C_ CC <-> ( RR i^i CC ) = RR )
74:72,73:sylib         |- ( ph -> ( RR i^i CC ) = RR )
75::simpr                |- ( ( ph /\ t e. CC ) -> t e. CC )
76:57,59:syl              |- ( ph -> ( N + 1 ) e. NN0 )
77:76:adantr             |- ( ( ph /\ t e. CC ) -> ( N + 1 ) e. NN0 )
78:75,77:expcld        |- ( ( ph /\ t e. CC ) -> ( t ^ ( N + 1 ) ) e. CC )
79:77:nn0cnd            |- ( ( ph /\ t e. CC ) -> ( N + 1 ) e. CC )
80:57:adantr             |- ( ( ph /\ t e. CC ) -> N e. NN0 )
81:75,80:expcld         |- ( ( ph /\ t e. CC ) -> ( t ^ N ) e. CC )
82:79,81:mulcld        |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. CC )
83:53:peano2nnd          |- ( ph -> ( N + 1 ) e. NN )
84:83,66:syl            |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) )
85:53:nncnd                  |- ( ph -> N e. CC )
86::1cnd                     |- ( ph -> 1 e. CC )
87:85,86:pncand             |- ( ph -> ( ( N + 1 ) - 1 ) = N )
88:87:adantr               |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) - 1 ) = N )
89:88:oveq2d              |- ( ( ph /\ t e. CC ) -> ( t ^ ( ( N + 1 ) - 1 ) ) = ( t ^ N ) )
90:89:oveq2d             |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) = ( ( N + 1 ) x. ( t ^ N ) ) )
91:90:mpteq2dva         |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
92:84,91:eqtrd         |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
93:67,55,70,74,78,82,92:dvmptres3
                      |- ( ph -> ( RR _D ( t e. RR |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. RR |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
94::iccssre            |- ( ( A e. RR /\ B e. RR ) -> ( A [,] B ) C_ RR )
95:50,51,94:syl2anc   |- ( ph -> ( A [,] B ) C_ RR )
96::eqid              |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
97:96:tgioo2          |- ( topGen ` ran (,) ) = ( ( TopOpen ` CCfld ) |`t RR )
!98::                 |- ( ph -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
99:55,62,65,93,95,97,96,98:dvmptres2
                     |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
!100::               |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
101:99,100:eqeltrd  |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
!102::               |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
103:99,102:eqeltrd  |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )
!104::              |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
105:50,51,52,101,103,104:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )


*** The next goal is:
!98::                 |- ( ph -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )

*** I know there is some theorem about this, I'll use syl2anc because I know it takes the assumptions A e. RR and B e. RR
!d1::              |- ( ph -> &W1 )
!d2::              |- ( ph -> &W2 )
!d3::              |- ( ( &W1 /\ &W2 ) -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
98:d1,d2,d3:syl2anc          |- ( ph -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )

*** and double click so mmj2 finds it for me:
d3::iccntr             |- ( ( A e. RR /\ B e. RR ) -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
98:50,51,d3:syl2anc          |- ( ph -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )


*** Okay, so we are getting to the hard goals:
!100::               |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
!102::               |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
!104::              |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )


*** well the first one isn't that hard. That's a thing about restrictions of continuous functions:
rescncf

d4::rescncf        |- ( &C3 C_ &C1 -> ( &C4 e. ( &C1 -cn-> &C2 ) -> ( &C4 |` &C3 ) e. ( &C3 -cn-> &C2 ) ) )

*** Oh, it uses explicit restrictions so we need to use the theorem on restrictions of a mapping.
d4::rescncf            |- ( ( A (,) B ) C_ &C1 ->
                            ( ( t e. &C5 |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( &C1 -cn-> CC ) -> ( ( t e. &C5 |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn-> CC ) )
                                )
!d9::                  |- ( ph -> ( A (,) B ) C_ &C5 )
d10::resmpt            |- ( ( A (,) B ) C_ &C5 -> ( ( t e. &C5 |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
d5:d9,d10:syl         |- ( ph -> ( ( t e. &C5 |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
!d7::              |- ( ph -> ( A (,) B ) C_ &C1 )
!d8::                  |- ( ph -> ( t e. &C5 |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( &C1 -cn-> CC ) )
d6:d7,d8,d4:sylc      |- ( ph -> ( ( t e. &C5 |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn-> CC ) )
100:d5,d6:eqeltrrd           |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A (,) B ) -cn-> CC ) )

*** A bit of duplication here, I want &C5 and &C1 to be CC:
!d9::                  |- ( ph -> ( A (,) B ) C_ CC )
d10::resmpt            |- ( ( A (,) B ) C_ CC -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
d5:d9,d10:syl         |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
!d8::                  |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) )
d6:d9,d8,d4:sylc      |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn-> CC ) )

*** We've already proved most of this subsetting so it's easy:
d12::ioossicc            |- ( A (,) B ) C_ ( A [,] B )
d11:d12,95:syl5ss             |- ( ph -> ( A (,) B ) C_ RR )
d9:d11,71:syl6ss             |- ( ph -> ( A (,) B ) C_ CC )

*** To prove d8, we use the mapping functions for proving continuity:
!d13::             |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
!d14::a1i             |- ( ph -> x. e. ( ( &C1 tX &C1 ) Cn &C1 ) )
!d15::             |- ( ph -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )
!d16::             |- ( ph -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )
d8:d13,d14,d15,d16:cncfmpt2f    |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) )

d17:67:mulcn             |- x. e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) )
d14:d17:a1i             |- ( ph -> x. e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) ) )
!d15::             |- ( ph -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )
!d16::             |- ( ph -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )
d8:67,d14,d15,d16:cncfmpt2f     |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) )


d18:85,86:addcld         |- ( ph -> ( N + 1 ) e. CC )
!d19::                   |- ( ph -> CC C_ CC )
d21::cncfmptc            |- ( ( ( N + 1 ) e. CC /\ CC C_ CC /\ CC C_ CC ) -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )
d15:d18,d19,d19,d21:syl3anc |- ( ph -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )

d22::ssid          |- CC C_ CC
d19:d22:a1i                 |- ( ph -> CC C_ CC )

d23::expcncf             |- ( N e. NN0 -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )
d16:57,d23:syl            |- ( ph -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )



*** Okay, that finishes continuity on ( A (,) B ). Luckily we can overlap the work for continuity on ( A [,] B ):
!d29::                |- ( ph -> ( A [,] B ) C_ &C4 )
d30::resmpt           |- ( ( A [,] B ) C_ &C4 -> ( ( t e. &C4 |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
d24:d29,d30:syl      |- ( ph -> ( ( t e. &C4 |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
!d26::                |- ( ph -> ( A [,] B ) C_ &C2 )
!d27::                |- ( ph -> ( t e. &C4 |-> ( t ^ ( N + 1 ) ) ) e. ( &C2 -cn-> CC ) )
d28::rescncf          |- ( ( A [,] B ) C_ &C2 ->
                           ( ( t e. &C4 |-> ( t ^ ( N + 1 ) ) ) e. ( &C2 -cn-> CC ) -> ( ( t e. &C4 |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) ) )
d25:d26,d27,d28:sylc |- ( ph -> ( ( t e. &C4 |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
104:d24,d25:eqeltrrd        |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )


d29:95,72:sstrd       |- ( ph -> ( A [,] B ) C_ CC )
d30::resmpt           |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
d24:d29,d30:syl      |- ( ph -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
!d27::                |- ( ph -> ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) )
d28::rescncf          |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) ) )
d25:d29,d27,d28:sylc |- ( ph -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
104:d24,d25:eqeltrrd        |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )

d32::expcncf           |- ( ( N + 1 ) e. NN0 -> ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) )
d27:76,d32:syl           |- ( ph -> ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) )



*** Yay, almost done. We have left the best for last:
!102::               |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
*** and also we haven't started on connecting this whole proof to the qed step.
105:50,51,52,101,103,104:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )



*** I looked around the library and found iblss, which helps:
d33:d12:a1i        |- ( ph -> ( A (,) B ) C_ ( A [,] B ) )
d37::ioombl        |- ( A (,) B ) e. dom vol
d34:d37:a1i           |- ( ph -> ( A (,) B ) e. dom vol )
!d35::                |- ( ( ph /\ t e. ( A [,] B ) ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. &C2 )
!d36::                |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
102:d33,d34,d35,d36:iblss |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )

*** We can do d35 by reference to a previous proof of it in a different context:
d38:d29:sselda        |- ( ( ph /\ t e. ( A [,] B ) ) -> t e. CC )
d35:d38,82:syldan     |- ( ( ph /\ t e. ( A [,] B ) ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. CC )

*** (I had to move d38 up from below to avoid duplicate steps, although it's not a big deal as it would
*** get deduplicated anyway in the final proof.)
*** For d36 we use cniccibl:
!d39::                 |- ( ph -> &C1 e. RR )
!d40::                 |- ( ph -> &C2 e. RR )
!d41::                 |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( &C1 [,] &C2 ) -cn-> CC ) )
d42::cniccibl          |- ( ( &C1 e. RR /\ &C2 e. RR /\ ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( &C1 [,] &C2 ) -cn-> CC ) ) ->
                            ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
d36:d39,d40,d41,d42:syl3anc  |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )

!d41::                 |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
d42::cniccibl          |- ( ( A e. RR /\ B e. RR /\ ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC ) ) ->
                            ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
d36:50,51,d41,d42:syl3anc    |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )

*** I guess we still haven't proven this variation yet. Once again, let's take it to CC so we can use the previous result.
d46::resmpt              |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
d43:d29,d46:syl         |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
d49::rescncf             |- ( ( A [,] B ) C_ CC ->
                              ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
                                  )
d44:d29,d8,d49:sylc         |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
d41:d43,d44:eqeltrrd           |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC ) )


*** Wow, we're done! Let's clean up and renumber again:
h50::itexp.1        |- ( ph -> A e. RR )
h51::itexp.2        |- ( ph -> B e. RR )
h52::itexp.3        |- ( ph -> A <_ B )
h53::itexp.4                 |- ( ph -> N e. NN )
54::reelprrecn         |- RR e. { RR , CC }
55:54:a1i             |- ( ph -> RR e. { RR , CC } )
56::simpr               |- ( ( ph /\ t e. RR ) -> t e. RR )
57:53:nnnn0d               |- ( ph -> N e. NN0 )
58:57:adantr            |- ( ( ph /\ t e. RR ) -> N e. NN0 )
59::peano2nn0           |- ( N e. NN0 -> ( N + 1 ) e. NN0 )
60:58,59:syl            |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. NN0 )
61:56,60:reexpcld      |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. RR )
62:61:recnd           |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. CC )
63:60:nn0red           |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. RR )
64:56,58:reexpcld      |- ( ( ph /\ t e. RR ) -> ( t ^ N ) e. RR )
65:63,64:remulcld     |- ( ( ph /\ t e. RR ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. RR )
66::dvexp                |- ( ( N + 1 ) e. NN -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) )
67::eqid                  |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
68:67:cnfldtopon        |- ( TopOpen ` CCfld ) e. ( TopOn ` CC )
69::toponmax            |- ( ( TopOpen ` CCfld ) e. ( TopOn ` CC ) -> CC e. ( TopOpen ` CCfld ) )
70:68,69:mp1i          |- ( ph -> CC e. ( TopOpen ` CCfld ) )
71::ax-resscn           |- RR C_ CC
72:71:a1i              |- ( ph -> RR C_ CC )
73::df-ss               |- ( RR C_ CC <-> ( RR i^i CC ) = RR )
74:72,73:sylib         |- ( ph -> ( RR i^i CC ) = RR )
75::simpr                |- ( ( ph /\ t e. CC ) -> t e. CC )
76:57,59:syl           |- ( ph -> ( N + 1 ) e. NN0 )
77:76:adantr             |- ( ( ph /\ t e. CC ) -> ( N + 1 ) e. NN0 )
78:75,77:expcld        |- ( ( ph /\ t e. CC ) -> ( t ^ ( N + 1 ) ) e. CC )
79:77:nn0cnd            |- ( ( ph /\ t e. CC ) -> ( N + 1 ) e. CC )
80:57:adantr             |- ( ( ph /\ t e. CC ) -> N e. NN0 )
81:75,80:expcld         |- ( ( ph /\ t e. CC ) -> ( t ^ N ) e. CC )
82:79,81:mulcld        |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. CC )
83:53:peano2nnd          |- ( ph -> ( N + 1 ) e. NN )
84:83,66:syl            |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) )
85:53:nncnd                 |- ( ph -> N e. CC )
86::1cnd                    |- ( ph -> 1 e. CC )
87:85,86:pncand             |- ( ph -> ( ( N + 1 ) - 1 ) = N )
88:87:adantr               |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) - 1 ) = N )
89:88:oveq2d              |- ( ( ph /\ t e. CC ) -> ( t ^ ( ( N + 1 ) - 1 ) ) = ( t ^ N ) )
90:89:oveq2d             |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) = ( ( N + 1 ) x. ( t ^ N ) ) )
91:90:mpteq2dva         |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
92:84,91:eqtrd         |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
93:67,55,70,74,78,82,92:dvmptres3
                      |- ( ph -> ( RR _D ( t e. RR |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. RR |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
94::iccssre             |- ( ( A e. RR /\ B e. RR ) -> ( A [,] B ) C_ RR )
95:50,51,94:syl2anc    |- ( ph -> ( A [,] B ) C_ RR )
96::eqid              |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
97:96:tgioo2          |- ( topGen ` ran (,) ) = ( ( TopOpen ` CCfld ) |`t RR )
98::iccntr             |- ( ( A e. RR /\ B e. RR ) -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
99:50,51,98:syl2anc   |- ( ph -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
100:55,62,65,93,95,97,96,99:dvmptres2
                     |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
101::rescncf           |- ( ( A (,) B ) C_ CC ->
                            ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn-> CC ) ) )
102::ioossicc          |- ( A (,) B ) C_ ( A [,] B )
103:102,95:syl5ss       |- ( ph -> ( A (,) B ) C_ RR )
104:103,71:syl6ss      |- ( ph -> ( A (,) B ) C_ CC )
105::resmpt            |- ( ( A (,) B ) C_ CC -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
106:104,105:syl       |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
107:67:mulcn               |- x. e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) )
108:107:a1i               |- ( ph -> x. e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) ) )
109:85,86:addcld           |- ( ph -> ( N + 1 ) e. CC )
110::ssid                   |- CC C_ CC
111:110:a1i                |- ( ph -> CC C_ CC )
112::cncfmptc              |- ( ( ( N + 1 ) e. CC /\ CC C_ CC /\ CC C_ CC ) -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )
113:109,111,111,112:syl3anc
                          |- ( ph -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )
114::expcncf               |- ( N e. NN0 -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )
115:57,114:syl            |- ( ph -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )
116:67,108,113,115:cncfmpt2f
                         |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) )
117:104,116,101:sylc  |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn-> CC ) )
118:106,117:eqeltrrd |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
119:100,118:eqeltrd |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
120:102:a1i           |- ( ph -> ( A (,) B ) C_ ( A [,] B ) )
121::ioombl            |- ( A (,) B ) e. dom vol
122:121:a1i           |- ( ph -> ( A (,) B ) e. dom vol )
123:95,72:sstrd       |- ( ph -> ( A [,] B ) C_ CC )
124:123:sselda         |- ( ( ph /\ t e. ( A [,] B ) ) -> t e. CC )
125:124,82:syldan     |- ( ( ph /\ t e. ( A [,] B ) ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. CC )
126::resmpt              |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
127:123,126:syl         |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
128::rescncf             |- ( ( A [,] B ) C_ CC ->
                              ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
                                  )
129:123,116,128:sylc    |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
130:127,129:eqeltrrd   |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
131::cniccibl          |- ( ( A e. RR /\ B e. RR /\ ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC ) ) ->
                            ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
132:50,51,130,131:syl3anc
                      |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
133:120,122,125,132:iblss
                     |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
134:100,133:eqeltrd |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )
135::resmpt           |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
136:123,135:syl      |- ( ph -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
137::expcncf           |- ( ( N + 1 ) e. NN0 -> ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) )
138:76,137:syl        |- ( ph -> ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) )
139::rescncf          |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) ) )
140:123,138,139:sylc |- ( ph -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
141:136,140:eqeltrrd
                    |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
142:50,51,52,119,134,141:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )


*** One step left, which is to connect this all to the goal.
!d1::              |- ( ph -> S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A [,] B ) ( x ^ N ) _d x )
!d2::              |- ( ph ->
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) =
                        ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )
qed:142,d1,d2:3eqtr3d         |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )

*** Oh, that first one is inconvenient, it uses the wrong interval. That's a measure zero difference,
*** surely there's a theorem about that. (Later:) Aha, it's itgioo.
!d3::                |- ( ph -> S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( x ^ N ) _d x )
d6:123:sselda      |- ( ( ph /\ x e. ( A [,] B ) ) -> x e. CC )
d7:57:adantr       |- ( ( ph /\ x e. ( A [,] B ) ) -> N e. NN0 )
d5:d6,d7:expcld          |- ( ( ph /\ x e. ( A [,] B ) ) -> ( x ^ N ) e. CC )
d4:50,51,d5:itgioo   |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x = S. ( A [,] B ) ( x ^ N ) _d x )
*** Thank goodness for mmj2 coming up with that closure proof so I don't have to.
*** (I had to give expcld and it figured out the rest)

*** Now back to equality lemmas:
!d3::itgeq2dva                |- ( ph -> S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( x ^ N ) _d x )
*** Oops, invalid ref. What's it called again? (Later:) It's just itgeq2, no one bothered to make the deduction version.
!d10::             |- ( ( ph /\ x e. ( A (,) B ) ) -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( x ^ N ) )
d8:d10:ralrimiva |- ( ph -> A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( x ^ N ) )
d9::itgeq2            |- ( A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( x ^ N ) ->
                           S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( x ^ N ) _d x )
d3:d8,d9:syl            |- ( ph -> S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( x ^ N ) _d x )


*** Okay, let's be clever here, and prove that the left bit is the derivative mapping and the right bit is the substitution:
!d13::             |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = &C2 )
d11:d13:fveq1d          |- ( ph -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( &C2 ` x ) )
!d12::                  |- ( x e. ( A (,) B ) -> ( &C2 ` x ) = ( x ^ N ) )
d10:d11,d12:sylan9eq       |- ( ( ph /\ x e. ( A (,) B ) ) -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( x ^ N ) )

*** I'm sure d13 is above somewhere: (Later: it's 100)
!d13::#100             |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = &C2 )

d11:100:fveq1d          |- ( ph -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) )
!d12::                  |- ( x e. ( A (,) B ) -> ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) = ( x ^ N ) )
d10:d11,d12:sylan9eq       |- ( ( ph /\ x e. ( A (,) B ) ) -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( x ^ N ) )


!d13::                   |- ( t = x -> ( ( N + 1 ) x. ( t ^ N ) ) = ( x ^ N ) )
d14::eqid                |- ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) )
d15::ovex          |- ( x ^ N ) e. _V
d12:d13,d14,d15:fvmpt        |- ( x e. ( A (,) B ) -> ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) = ( x ^ N ) )


*** Oh no! I wasn't paying enough attention to the goal, and I've got some nonsense in the proof.
*** The integrands aren't actually equal, they differ by a constant. Okay, let's delete all the
*** garbage steps and double check our place, starting at the ftc proof:
142:50,51,52,119,134,141:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
143:100:fveq1d     |- ( ph -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) )
144::eqid          |- ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) )
145::ovex          |- ( x ^ N ) e. _V
146::itgeq2        |- ( A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( x ^ N ) ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( x ^ N ) _d x )
147:123:sselda       |- ( ( ph /\ x e. ( A [,] B ) ) -> x e. CC )
148:57:adantr        |- ( ( ph /\ x e. ( A [,] B ) ) -> N e. NN0 )
149:147,148:expcld  |- ( ( ph /\ x e. ( A [,] B ) ) -> ( x ^ N ) e. CC )
150:50,51,149:itgioo
                   |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x = S. ( A [,] B ) ( x ^ N ) _d x )
qed::              |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )


*** What we should actually be doing here is move the ( N + 1 ) to the other side
!d2::                |- ( ph -> ( &C2 / ( N + 1 ) ) = S. ( A (,) B ) ( x ^ N ) _d x )
!d4::              |- ( ph -> &C2 = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )
d3:d4:oveq1d         |- ( ph -> ( &C2 / ( N + 1 ) ) = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )
d1:d2,d3:eqtr3d          |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )
qed:150,d1:eqtr3d            |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )

*** We will prove d4 by transitivity to the ftc.
!d5::              |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x e. CC )
d6:83:nnne0d       |- ( ph -> ( N + 1 ) =/= 0 )
d2:d5,109,d6:divcan3d
                     |- ( ph -> ( ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) / ( N + 1 ) ) = S. ( A (,) B ) ( x ^ N ) _d x )

!d7::              |- ( ( ph /\ x e. ( A (,) B ) ) -> ( x ^ N ) e. &C1 )
!d8::              |- ( ph -> ( x e. ( A (,) B ) |-> ( x ^ N ) ) e. L^1 )
d5:d7,d8:itgcl          |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x e. CC )
*** Just in case you haven't seen enough of integrability proofs.
*** I don't like using x as a bound variable though, all our earlier results used t, so let's back up and change it:
d9::oveq1               |- ( x = t -> ( x ^ N ) = ( t ^ N ) )
d7:d9:cbvitgv          |- S. ( A (,) B ) ( x ^ N ) _d x = S. ( A (,) B ) ( t ^ N ) _d t
!d8::                  |- ( ph -> S. ( A (,) B ) ( t ^ N ) _d t e. CC )
d5:d7,d8:syl5eqel          |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x e. CC )

*** Look at all those previous results that match. So nice.
d13:124,81:syldan        |- ( ( ph /\ t e. ( A [,] B ) ) -> ( t ^ N ) e. CC )
d15:102:sseli      |- ( t e. ( A (,) B ) -> t e. ( A [,] B ) )
d10:d15,d13:sylan2           |- ( ( ph /\ t e. ( A (,) B ) ) -> ( t ^ N ) e. CC )
!d14::             |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. L^1 )
d11:120,122,d13,d14:iblss |- ( ph -> ( t e. ( A (,) B ) |-> ( t ^ N ) ) e. L^1 )
d8:d10,d11:itgcl            |- ( ph -> S. ( A (,) B ) ( t ^ N ) _d t e. CC )

!d18::                    |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. ( ( A [,] B ) -cn-> CC ) )
d19::cniccibl             |- ( ( A e. RR /\ B e. RR /\ ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. ( ( A [,] B ) -cn-> CC ) ) -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. L^1 )
d14:50,51,d18,d19:syl3anc   |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. L^1 )

*** You know the drill.
d23::resmpt                 |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ N ) ) )
d20:123,d23:syl            |- ( ph -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ N ) ) )
d26::rescncf                |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) ) )
d21:123,115,d26:sylc           |- ( ph -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
d18:d20,d21:eqeltrrd              |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. ( ( A [,] B ) -cn-> CC ) )

*** In hindsight, I might not have bothered to prove that
***    |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
*** if I had known we would do it for this function too. Let's move that proof (step 133) right here:
d11:120,122,d13,d14:iblss |- ( ph -> ( t e. ( A (,) B ) |-> ( t ^ N ) ) e. L^1 )
133:120,122,125,132:iblss
                     |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )

*** and now mmj2 reorders the steps, moving ftc down to restore the dag order:

d11:120,122,d13,d14:iblss |- ( ph -> ( t e. ( A (,) B ) |-> ( t ^ N ) ) e. L^1 )
133:120,122,125,132:iblss
                     |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
134:100,133:eqeltrd |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )
142:50,51,52,119,134,141:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )


*** Instead of iblss, let's use iblmulc2:
!d27::             |- ( ( ph /\ t e. ( A (,) B ) ) -> ( t ^ N ) e. &C1 )
133:109,d27,d11:iblmulc2
                     |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )

*** Nice! No side conditions except the easy one...
133:109,d10,d11:iblmulc2
                     |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
*** and we've already done it.

*** One last step, and then we're done. Luckily it's an easy one.
142:50,51,52,119,134,141:ftc2
                   |- ( ph ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                        ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
!d4::                 |- ( ph -> ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )

!d30::             |- ( ( ph /\ x e. ( A (,) B ) ) -> ( x ^ N ) e. CC )
!d31::             |- ( ph -> ( x e. ( A (,) B ) |-> ( x ^ N ) ) e. L^1 )
d27:109,d30,d31:itgmulc2
                       |- ( ph -> ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) = S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x )
!d28::                 |- ( ph -> S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x = &C2 )
!d29::             |- ( ph -> &C2 = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )
d4:d27,d28,d29:3eqtrd       |- ( ph -> ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )

*** Eh, we're back to x again. I won't rename it this time since it's going to interact with t in ftc2.
*** Still, we proved d30 already, on a different domain:
d32:102:sseli      |- ( x e. ( A (,) B ) -> x e. ( A [,] B ) )
d30:d32,149:sylan2           |- ( ( ph /\ x e. ( A (,) B ) ) -> ( x ^ N ) e. CC )

*** Definitely not proving integrability again
d33:d9:cbvmptv     |- ( x e. ( A (,) B ) |-> ( x ^ N ) ) = ( t e. ( A (,) B ) |-> ( t ^ N ) )
d31:d33,d11:syl5eqel           |- ( ph -> ( x e. ( A (,) B ) |-> ( x ^ N ) ) e. L^1 )

*** Okay, for these we want to use ftc2
!d28::                 |- ( ph -> S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x = &C2 )
!d29::             |- ( ph -> &C2 = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )
*** so we need another transitivity

!d28:,142:eqtr3d                 |- ( ph -> S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x = &C2 )
!d29::             |- ( ph -> &C2 = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )

!d34::             |- ( ph -> S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x )
d28:d34,142:eqtr3d     |- ( ph ->
                            S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x = ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
!d29::                 |- ( ph -> ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )

*** As we saw, there is no itgeq2dva, so we make do
!d37::             |- ( ( ph /\ x e. ( A (,) B ) ) -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )
d35:d37:ralrimiva                 |- ( ph -> A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )
d36::itgeq2              |- ( A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) ->
                              S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x )
d34:d35,d36:syl       |- ( ph -> S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x )

*** and I'm bound and determined to use my trick
!d40::#100             |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = &C2 )
d38:d40:fveq1d             |- ( ph -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( &C2 ` x ) )
!d39::                     |- ( x e. ( A (,) B ) -> ( &C2 ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )
d37:d38,d39:sylan9eq       |- ( ( ph /\ x e. ( A (,) B ) ) -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )

!d40::             |- ( &S1 = x -> &C1 = ( ( N + 1 ) x. ( x ^ N ) ) )
!d41::eqid             |- ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) = ( &S1 e. ( A (,) B ) |-> &C1 )
d42::ovex          |- ( ( N + 1 ) x. ( x ^ N ) ) e. _V
d39:d40,d41,d42:fvmpt           |- ( x e. ( A (,) B ) -> ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )

*** Hey look it works this time
d43::oveq1         |- ( t = x -> ( t ^ N ) = ( x ^ N ) )
d40:d43:oveq2d                    |- ( t = x -> ( ( N + 1 ) x. ( t ^ N ) ) = ( ( N + 1 ) x. ( x ^ N ) ) )
d41::eqid                   |- ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) )
d42::ovex          |- ( ( N + 1 ) x. ( x ^ N ) ) e. _V
d39:d40,d41,d42:fvmpt           |- ( x e. ( A (,) B ) -> ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )

*** One last proof:
!d29::                 |- ( ph -> ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )

!d46::                   |- ( ph -> B e. ( A [,] B ) )
d48::oveq1                |- ( t = B -> ( t ^ ( N + 1 ) ) = ( B ^ ( N + 1 ) ) )
d49::eqid                 |- ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) )
d50::ovex          |- ( B ^ ( N + 1 ) ) e. _V
d47:d48,d49,d50:fvmpt    |- ( B e. ( A [,] B ) -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) = ( B ^ ( N + 1 ) ) )
d44:d46,d47:syl       |- ( ph -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) = ( B ^ ( N + 1 ) ) )
!d45::             |- ( ph -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) = ( A ^ ( N + 1 ) ) )
d29:d44,d45:oveq12d           |- ( ph -> ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )

*** d46 has a name, let's use syl3anc and double click to look it up (scroll to the bottom past the boring lemmas):
*** It's ubicc2 and the rest gets filled in.
d51:50:rexrd              |- ( ph -> A e. RR* )
d52:51:rexrd              |- ( ph -> B e. RR* )
d54::ubicc2               |- ( ( A e. RR* /\ B e. RR* /\ A <_ B ) -> B e. ( A [,] B ) )
d46:d51,d52,52,d54:syl3anc      |- ( ph -> B e. ( A [,] B ) )

*** Do it again for the other goal:
d63::lbicc2               |- ( ( A e. RR* /\ B e. RR* /\ A <_ B ) -> A e. ( A [,] B ) )
d55:d51,d52,52,d63:syl3anc      |- ( ph -> A e. ( A [,] B ) )
d57::oveq1                |- ( t = A -> ( t ^ ( N + 1 ) ) = ( A ^ ( N + 1 ) ) )
d58::eqid                 |- ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) )
d59::ovex          |- ( A ^ ( N + 1 ) ) e. _V
d56:d57,d58,d59:fvmpt    |- ( A e. ( A [,] B ) -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) = ( A ^ ( N + 1 ) ) )
d45:d55,d56:syl       |- ( ph -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) = ( A ^ ( N + 1 ) ) )


*** And we're done! Cleanup and renumber again, and here's the final result:
h50::itexp.1               |- ( ph -> A e. RR )
h51::itexp.2               |- ( ph -> B e. RR )
h52::itexp.3              |- ( ph -> A <_ B )
h53::itexp.4              |- ( ph -> N e. NN )
54::reelprrecn                |- RR e. { RR , CC }
55:54:a1i                    |- ( ph -> RR e. { RR , CC } )
56::simpr                      |- ( ( ph /\ t e. RR ) -> t e. RR )
57:53:nnnn0d               |- ( ph -> N e. NN0 )
58:57:adantr                   |- ( ( ph /\ t e. RR ) -> N e. NN0 )
59::peano2nn0                |- ( N e. NN0 -> ( N + 1 ) e. NN0 )
60:58,59:syl                   |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. NN0 )
61:56,60:reexpcld             |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. RR )
62:61:recnd                  |- ( ( ph /\ t e. RR ) -> ( t ^ ( N + 1 ) ) e. CC )
63:60:nn0red                  |- ( ( ph /\ t e. RR ) -> ( N + 1 ) e. RR )
64:56,58:reexpcld             |- ( ( ph /\ t e. RR ) -> ( t ^ N ) e. RR )
65:63,64:remulcld            |- ( ( ph /\ t e. RR ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. RR )
66::dvexp                       |- ( ( N + 1 ) e. NN -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) )
67::eqid               |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
68:67:cnfldtopon               |- ( TopOpen ` CCfld ) e. ( TopOn ` CC )
69::toponmax                   |- ( ( TopOpen ` CCfld ) e. ( TopOn ` CC ) -> CC e. ( TopOpen ` CCfld ) )
70:68,69:mp1i                 |- ( ph -> CC e. ( TopOpen ` CCfld ) )
71::ax-resscn                |- RR C_ CC
72:71:a1i                     |- ( ph -> RR C_ CC )
73::df-ss                      |- ( RR C_ CC <-> ( RR i^i CC ) = RR )
74:72,73:sylib                |- ( ph -> ( RR i^i CC ) = RR )
75::simpr                   |- ( ( ph /\ t e. CC ) -> t e. CC )
76:57,59:syl                |- ( ph -> ( N + 1 ) e. NN0 )
77:76:adantr          |- ( ( ph /\ t e. CC ) -> ( N + 1 ) e. NN0 )
78:75,77:expcld               |- ( ( ph /\ t e. CC ) -> ( t ^ ( N + 1 ) ) e. CC )
79:77:nn0cnd         |- ( ( ph /\ t e. CC ) -> ( N + 1 ) e. CC )
80:57:adantr                |- ( ( ph /\ t e. CC ) -> N e. NN0 )
81:75,80:expcld            |- ( ( ph /\ t e. CC ) -> ( t ^ N ) e. CC )
82:79,81:mulcld     |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. CC )
83:53:peano2nnd        |- ( ph -> ( N + 1 ) e. NN )
84:83,66:syl                   |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) )
85:53:nncnd              |- ( ph -> N e. CC )
86::1cnd                 |- ( ph -> 1 e. CC )
87:85,86:pncand                    |- ( ph -> ( ( N + 1 ) - 1 ) = N )
88:87:adantr                      |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) - 1 ) = N )
89:88:oveq2d                     |- ( ( ph /\ t e. CC ) -> ( t ^ ( ( N + 1 ) - 1 ) ) = ( t ^ N ) )
90:89:oveq2d                    |- ( ( ph /\ t e. CC ) -> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) = ( ( N + 1 ) x. ( t ^ N ) ) )
91:90:mpteq2dva                |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ ( ( N + 1 ) - 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
92:84,91:eqtrd                |- ( ph -> ( CC _D ( t e. CC |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
93:67,55,70,74,78,82,92:dvmptres3
                             |- ( ph -> ( RR _D ( t e. RR |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. RR |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
94::iccssre                    |- ( ( A e. RR /\ B e. RR ) -> ( A [,] B ) C_ RR )
95:50,51,94:syl2anc           |- ( ph -> ( A [,] B ) C_ RR )
96::eqid                     |- ( TopOpen ` CCfld ) = ( TopOpen ` CCfld )
97:96:tgioo2                 |- ( topGen ` ran (,) ) = ( ( TopOpen ` CCfld ) |`t RR )
98::iccntr                    |- ( ( A e. RR /\ B e. RR ) -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
99:50,51,98:syl2anc          |- ( ph -> ( ( int ` ( topGen ` ran (,) ) ) ` ( A [,] B ) ) = ( A (,) B ) )
100:55,62,65,93,95,97,96,99:dvmptres2
                            |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
101::rescncf                |- ( ( A (,) B ) C_ CC ->
                                 ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) ->
                                   ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn-> CC ) ) )
102::ioossicc             |- ( A (,) B ) C_ ( A [,] B )
103:102,95:syl5ss            |- ( ph -> ( A (,) B ) C_ RR )
104:103,71:syl6ss           |- ( ph -> ( A (,) B ) C_ CC )
105::resmpt                 |- ( ( A (,) B ) C_ CC -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
106:104,105:syl            |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
107:67:mulcn            |- x. e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) )
108:107:a1i            |- ( ph -> x. e. ( ( ( TopOpen ` CCfld ) tX ( TopOpen ` CCfld ) ) Cn ( TopOpen ` CCfld ) ) )
109:85,86:addcld        |- ( ph -> ( N + 1 ) e. CC )
110::ssid                |- CC C_ CC
111:110:a1i             |- ( ph -> CC C_ CC )
112::cncfmptc           |- ( ( ( N + 1 ) e. CC /\ CC C_ CC /\ CC C_ CC ) -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )
113:109,111,111,112:syl3anc
                       |- ( ph -> ( t e. CC |-> ( N + 1 ) ) e. ( CC -cn-> CC ) )
114::expcncf                  |- ( N e. NN0 -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )
115:57,114:syl               |- ( ph -> ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) )
116:67,108,113,115:cncfmpt2f
                      |- ( ph -> ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) )
117:104,116,101:sylc       |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A (,) B ) ) e. ( ( A (,) B ) -cn-> CC ) )
118:106,117:eqeltrrd      |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
119:100,118:eqeltrd      |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. ( ( A (,) B ) -cn-> CC ) )
120:102:a1i               |- ( ph -> ( A (,) B ) C_ ( A [,] B ) )
121::ioombl                |- ( A (,) B ) e. dom vol
122:121:a1i               |- ( ph -> ( A (,) B ) e. dom vol )
123:95,72:sstrd              |- ( ph -> ( A [,] B ) C_ CC )
124:123:sselda             |- ( ( ph /\ t e. ( A [,] B ) ) -> t e. CC )
125:124,82:syldan  |- ( ( ph /\ t e. ( A [,] B ) ) -> ( ( N + 1 ) x. ( t ^ N ) ) e. CC )
126::resmpt           |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
127:123,126:syl      |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) )
128::rescncf          |- ( ( A [,] B ) C_ CC ->
                           ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) ) )
129:123,116,128:sylc |- ( ph -> ( ( t e. CC |-> ( ( N + 1 ) x. ( t ^ N ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
130:127,129:eqeltrrd
                    |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
131::cniccibl       |- ( ( A e. RR /\ B e. RR /\ ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. ( ( A [,] B ) -cn-> CC ) ) ->
                         ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
132:50,51,130,131:syl3anc
                   |- ( ph -> ( t e. ( A [,] B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
133::resmpt                |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
134:123,133:syl           |- ( ph -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) )
135::expcncf                |- ( ( N + 1 ) e. NN0 -> ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) )
136:76,135:syl             |- ( ph -> ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) )
137::rescncf               |- ( ( A [,] B ) C_ CC ->
                                ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) ) )
138:123,136,137:sylc      |- ( ph -> ( ( t e. CC |-> ( t ^ ( N + 1 ) ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
139:134,138:eqeltrrd     |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) e. ( ( A [,] B ) -cn-> CC ) )
140:100:fveq1d     |- ( ph -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) )
141::eqid          |- ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) )
142::ovex          |- ( x ^ N ) e. _V
143::itgeq2        |- ( A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( x ^ N ) ->
                        S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( x ^ N ) _d x )
144:123:sselda            |- ( ( ph /\ x e. ( A [,] B ) ) -> x e. CC )
145:57:adantr             |- ( ( ph /\ x e. ( A [,] B ) ) -> N e. NN0 )
146:144,145:expcld       |- ( ( ph /\ x e. ( A [,] B ) ) -> ( x ^ N ) e. CC )
147:50,51,146:itgioo
                    |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x = S. ( A [,] B ) ( x ^ N ) _d x )
148::oveq1                |- ( x = t -> ( x ^ N ) = ( t ^ N ) )
149:148:cbvitgv        |- S. ( A (,) B ) ( x ^ N ) _d x = S. ( A (,) B ) ( t ^ N ) _d t
150:124,81:syldan         |- ( ( ph /\ t e. ( A [,] B ) ) -> ( t ^ N ) e. CC )
151:102:sseli            |- ( t e. ( A (,) B ) -> t e. ( A [,] B ) )
152:151,150:sylan2      |- ( ( ph /\ t e. ( A (,) B ) ) -> ( t ^ N ) e. CC )
153::resmpt                  |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ N ) ) )
154:123,153:syl             |- ( ph -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) = ( t e. ( A [,] B ) |-> ( t ^ N ) ) )
155::rescncf                 |- ( ( A [,] B ) C_ CC -> ( ( t e. CC |-> ( t ^ N ) ) e. ( CC -cn-> CC ) -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) ) )
156:123,115,155:sylc        |- ( ph -> ( ( t e. CC |-> ( t ^ N ) ) |` ( A [,] B ) ) e. ( ( A [,] B ) -cn-> CC ) )
157:154,156:eqeltrrd       |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. ( ( A [,] B ) -cn-> CC ) )
158::cniccibl              |- ( ( A e. RR /\ B e. RR /\ ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. ( ( A [,] B ) -cn-> CC ) ) -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. L^1 )
159:50,51,157,158:syl3anc |- ( ph -> ( t e. ( A [,] B ) |-> ( t ^ N ) ) e. L^1 )
160:120,122,150,159:iblss
                         |- ( ph -> ( t e. ( A (,) B ) |-> ( t ^ N ) ) e. L^1 )
161:109,152,160:iblmulc2  |- ( ph -> ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) e. L^1 )
162:100,161:eqeltrd      |- ( ph -> ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) e. L^1 )
163:50,51,52,119,162,139:ftc2
                        |- ( ph ->
                             S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x =
                             ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
164:152,160:itgcl      |- ( ph -> S. ( A (,) B ) ( t ^ N ) _d t e. CC )
165:149,164:syl5eqel  |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x e. CC )
166:83:nnne0d         |- ( ph -> ( N + 1 ) =/= 0 )
167:165,109,166:divcan3d
                     |- ( ph -> ( ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) / ( N + 1 ) ) = S. ( A (,) B ) ( x ^ N ) _d x )
168:102:sseli            |- ( x e. ( A (,) B ) -> x e. ( A [,] B ) )
169:168,146:sylan2      |- ( ( ph /\ x e. ( A (,) B ) ) -> ( x ^ N ) e. CC )
170:148:cbvmptv          |- ( x e. ( A (,) B ) |-> ( x ^ N ) ) = ( t e. ( A (,) B ) |-> ( t ^ N ) )
171:170,160:syl5eqel    |- ( ph -> ( x e. ( A (,) B ) |-> ( x ^ N ) ) e. L^1 )
172:109,169,171:itgmulc2
                       |- ( ph -> ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) = S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x )
173:100:fveq1d             |- ( ph -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) )
174::oveq1                   |- ( t = x -> ( t ^ N ) = ( x ^ N ) )
175:174:oveq2d              |- ( t = x -> ( ( N + 1 ) x. ( t ^ N ) ) = ( ( N + 1 ) x. ( x ^ N ) ) )
176::eqid                   |- ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) = ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) )
177::ovex                   |- ( ( N + 1 ) x. ( x ^ N ) ) e. _V
178:175,176,177:fvmpt      |- ( x e. ( A (,) B ) -> ( ( t e. ( A (,) B ) |-> ( ( N + 1 ) x. ( t ^ N ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )
179:173,178:sylan9eq      |- ( ( ph /\ x e. ( A (,) B ) ) -> ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )
180:179:ralrimiva        |- ( ph -> A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) )
181::itgeq2              |- ( A. x e. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) = ( ( N + 1 ) x. ( x ^ N ) ) ->
                              S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x )
182:180,181:syl         |- ( ph -> S. ( A (,) B ) ( ( RR _D ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ) ` x ) _d x = S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x )
183:182,163:eqtr3d     |- ( ph ->
                            S. ( A (,) B ) ( ( N + 1 ) x. ( x ^ N ) ) _d x = ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) )
184:50:rexrd              |- ( ph -> A e. RR* )
185:51:rexrd              |- ( ph -> B e. RR* )
186::ubicc2               |- ( ( A e. RR* /\ B e. RR* /\ A <_ B ) -> B e. ( A [,] B ) )
187:184,185,52,186:syl3anc
                         |- ( ph -> B e. ( A [,] B ) )
188::oveq1                |- ( t = B -> ( t ^ ( N + 1 ) ) = ( B ^ ( N + 1 ) ) )
189::eqid                 |- ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) )
190::ovex                 |- ( B ^ ( N + 1 ) ) e. _V
191:188,189,190:fvmpt    |- ( B e. ( A [,] B ) -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) = ( B ^ ( N + 1 ) ) )
192:187,191:syl         |- ( ph -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) = ( B ^ ( N + 1 ) ) )
193::lbicc2               |- ( ( A e. RR* /\ B e. RR* /\ A <_ B ) -> A e. ( A [,] B ) )
194:184,185,52,193:syl3anc
                         |- ( ph -> A e. ( A [,] B ) )
195::oveq1                |- ( t = A -> ( t ^ ( N + 1 ) ) = ( A ^ ( N + 1 ) ) )
196::eqid                 |- ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) = ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) )
197::ovex                 |- ( A ^ ( N + 1 ) ) e. _V
198:195,196,197:fvmpt    |- ( A e. ( A [,] B ) -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) = ( A ^ ( N + 1 ) ) )
199:194,198:syl         |- ( ph -> ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) = ( A ^ ( N + 1 ) ) )
200:192,199:oveq12d    |- ( ph -> ( ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` B ) - ( ( t e. ( A [,] B ) |-> ( t ^ ( N + 1 ) ) ) ` A ) ) = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )
201:172,183,200:3eqtrd
                      |- ( ph -> ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) = ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) )
202:201:oveq1d       |- ( ph -> ( ( ( N + 1 ) x. S. ( A (,) B ) ( x ^ N ) _d x ) / ( N + 1 ) ) = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )
203:167,202:eqtr3d  |- ( ph -> S. ( A (,) B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )
qed:147,203:eqtr3d |- ( ph -> S. ( A [,] B ) ( x ^ N ) _d x = ( ( ( B ^ ( N + 1 ) ) - ( A ^ ( N + 1 ) ) ) / ( N + 1 ) ) )
$d t x
$d A t
$d A x
$d B t
$d B x
$d N t
$d N x
$d ph t
$d ph x
$=  ( itexp.1 itexp.2 vt co cexp wcel cc cr wss a1i cmul cmpt wceq syl cfv cioo
    itexp.4 itexp.3 cv citg cicc c1 caddc cmin cdiv wa iccssre ax-resscn sselda
    syl2anc sstrd cn0 nnnn0d adantr expcld itgioo oveq1 cbvitgv ioossicc syldan
    sseli simpr sylan2 cvol cdm ioombl ccncf cibl cres expcncf rescncf eqeltrrd
    resmpt sylc cniccibl syl3anc iblss itgcl nncnd 1cnd addcld peano2nnd nnne0d
    syl5eqel divcan3d cbvmptv itgmulc2 cdv wral crn ctg ccnfld ctopn reelprrecn
    cpr peano2nn0 reexpcld nn0red remulcld eqid ctopon cnfldtopon toponmax mp1i
    recnd cin df-ss sylib nn0cnd mulcld dvexp pncand oveq2d mpteq2dva dvmptres3
    cn eqtrd tgioo2 cnt iccntr dvmptres2 fveq1d fvmpt sylan9eq ralrimiva itgeq2
    ovex syl5ss syl6ss ctx ccn eqeltrd eqtr3d cxr rexrd ssid cncfmptc cncfmpt2f
    mulcn iblmulc2 ftc2 cle wbr ubicc2 lbicc2 oveq12d 3eqtrd oveq1d ) ABCDUAIZB
    UDZEJIZUEZBCDUFIZUUPUEDEUGUHIZJIZCUUSJIZUIIZUUSUJIZABCDUUPFGAUUOUURKZUKUUOE
    AUURLUUOAUURMLACMKZDMKZUURMNFGCDULUOZMLNZAUMOZUPZUNAEUQKZUVDAEUBURZUSUTZVAA
    UUSUUQPIZUUSUJIUUQUVCAUUQUUSAUUQHUUNHUDZEJIZUELBHUUNUUPUVPUUOUVOEJVBZVCAHUU
    NUVPLUVOUUNKAUVOUURKZUVPLKZUUNUURUVOCDVDZVFAUVRUVOLKZUVSAUURLUVOUVJUNAUWAUK
    ZUVOEAUWAVGZAUVKUWAUVLUSUTZVEZVHZAHUUNUURUVPLUUNUURNAUVTOUUNVIVJKACDVKOUWEA
    UVEUVFHUURUVPQZUURLVLIZKUWGVMKFGAHLUVPQZUURVNZUWGUWHAUURLNZUWJUWGRUVJHLUURU
    VPVRSAUWKUWILLVLIZKZUWJUWHKUVJAUVKUWMUVLHEVOSZLLUURUWIVPVSVQCDUWGVTWAWBZWCW
    IAEUGAEUBWDZAWEZWFZAUUSAEUBWGZWHWJAUVNUVBUUSUJAUVNBUUNUUSUUPPIZUEZDHUURUVOU
    USJIZQZTZCUXCTZUIIZUVBABUUNUUPUUSLUWRUUOUUNKZAUVDUUPLKUUNUURUUOUVTVFUVMVHAB
    UUNUUPQHUUNUVPQVMBHUUNUUPUVPUVQWKUWOWIWLABUUNUUOMUXCWMIZTZUEZUXAUXFAUXIUWTR
    ZBUUNWNUXJUXARAUXKBUUNAUXGUXIUUOHUUNUUSUVPPIZQZTUWTAUUOUXHUXMAHUXBUXLMUAWOW
    PTZWQWRTZMMUUNUURMMLWTKAWSOZAUVOMKZUKZUXBUXRUVOUUSAUXQVGZUXRUVKUUSUQKZAUVKU
    XQUVLUSZEXAZSZXBXJUXRUUSUVPUXRUUSUYCXCUXRUVOEUXSUYAXBXDAHUXBUXLMUXOLLMUXOXE
    ZUXPUXOLXFTKLUXOKAUXOUYDXGLUXOXHXIAUVHMLXKMRUVIMLXLXMUWBUVOUUSUWCAUXTUWAAUV
    KUXTUVLUYBSZUSZUTUWBUUSUVPUWBUUSUYFXNUWDXOALHLUXBQZWMIZHLUUSUVOUUSUGUIIZJIZ
    PIZQZHLUXLQZAUUSYAKUYHUYLRUWSHUUSXPSAHLUYKUXLUWBUYJUVPUUSPUWBUYIEUVOJAUYIER
    UWAAEUGUWPUWQXQUSXRXRXSYBXTUVGUXOUYDYCUYDAUVEUVFUURUXNYDTTUUNRFGCDYEUOYFZYG
    HUUOUXLUWTUUNUXMUVOUUORUVPUUPUUSPUVOUUOEJVBXRUXMXEUUSUUPPYLYHYIYJBUUNUXIUWT
    YKSABCDUXCFGUCAUXHUXMUUNLVLIZUYNAUYMUUNVNZUXMUYOAUUNLNZUYPUXMRAUUNMLAUUNUUR
    MUVTUVGYMUMYNZHLUUNUXLVRSAUYQUYMUWLKUYPUYOKUYRAHUUSUVPPUXOLUYDPUXOUXOYOIUXO
    YPIKAUXOUYDUUDOAUUSLKLLNZUYSHLUUSQUWLKUWRUYSALUUAOZUYTHUUSLLUUBWAUWNUUCLLUU
    NUYMVPVSVQYQAUXHUXMVMUYNAHUUNUVPUUSLUWRUWFUWOUUEYQAUYGUURVNZUXCUWHAUWKVUAUX
    CRUVJHLUURUXBVRSAUWKUYGUWLKZVUAUWHKUVJAUXTVUBUYEHUUSVOSLLUURUYGVPVSVQUUFYRA
    UXDUUTUXEUVAUIADUURKZUXDUUTRACYSKZDYSKZCDUUGUUHZVUCACFYTZADGYTZUCCDUUIWAHDU
    XBUUTUURUXCUVODUUSJVBUXCXEZDUUSJYLYHSACUURKZUXEUVARAVUDVUEVUFVUJVUGVUHUCCDU
    UJWAHCUXBUVAUURUXCUVOCUUSJVBVUICUUSJYLYHSUUKUULUUMYRYR $.

*** I've never been so happy to see a perfectly rectangular encrypted mess. :)


Jon P

unread,
Apr 12, 2019, 5:02:41 AM4/12/19
to Metamath
Hi Mario, this is quite interesting. I think maybe your post has been cutoff at the bottom maybe? It ends with line 105 and doesn't show the QED I think.

Mario Carneiro

unread,
Apr 12, 2019, 6:08:54 AM4/12/19
to metamath
Hm... The email contains the full message but the google groups post only has the first half. Here it is in a gist: https://gist.github.com/digama0/d547ff03f3616a5df0beea6224de558a

On Fri, Apr 12, 2019 at 5:02 AM Jon P <drjonp...@gmail.com> wrote:
Hi Mario, this is quite interesting. I think maybe your post has been cutoff at the bottom maybe? It ends with line 105 and doesn't show the QED I think.

--

Jon P

unread,
Apr 19, 2019, 9:36:41 AM4/19/19
to Metamath
Thanks Mario, I've been meaning to give a more full response but have been busy. Hopefully I'll have more time soon :)

Jon P

unread,
May 30, 2019, 5:28:10 AM5/30/19
to Metamath
So I finally have a little time to work on this. 

One issue I have, when my proofs are at the very end of set.mm they work fine. However when I move them to my mathbox I get errors like these, 

E-LA-0101 Theorem cnioobibld: compressed proof contains invalid statement label, not found in Statement Table. Label position within the compressed proof's parentheses = 28. Statement label = ioovolcl
E-LA-0101 Theorem itexp: compressed proof contains invalid statement label, not found in Statement Table. Label position within the compressed proof's parentheses = 41. Statement label = expcncf

I believe this is because those theorems are after my mathbox, for example expcncf is in the mathbox of Glauco Siliprandi. How is it recommended to work with this?

Thierry Arnoux

unread,
May 30, 2019, 8:36:46 AM5/30/19
to meta...@googlegroups.com
Hi Jon,

Yes, exactly.
You may ask to move those theorems you need to the main part of set.mm.
Chances are that if you need them, others may too.
BR,
_
Thierry
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+u...@googlegroups.com.

Thierry Arnoux

unread,
May 30, 2019, 1:02:26 PM5/30/19
to meta...@googlegroups.com
FYI, Norm has already accepted the change into the last revision of set.mm, y=
ou can pull it from GitHub and continue your developments based on it! :)
_
Thierry


Jon P

unread,
May 30, 2019, 5:41:27 PM5/30/19
to Metamath
This is very kind to organise this for me, thank you.

Jon P

unread,
Jun 2, 2019, 4:46:22 AM6/2/19
to Metamath
Thanks for all help, area quad is now included in set.mm so that is pretty nice :)

If I have a chance I am thinking of these as next steps, if anyone is interested and has thoughts that would be appreciated. 

First take any 3 points in R^2 and make a triangle. I think if you order the points by x coord there are 5 cases (as RR is well ordered). Here is an image of them.  Computing the area of Case 1 (all x coords the same) is trivial (though needs to be covered), cases 2 and 3 (two x coords the same) are covered by area quad directly, which is nice. Cases 4 and 5 are a bit trickier. 

The approach I am thinking of is to split the domain at the point Q e. RR. This will make the triangle in to two triangles which are case 2 and 3 so are computable. 

I started down this road but I am not sure about the direction, this general result is what I was thinking of trying to prove first. 

*hypothesis
54::  |- A e. dom area 
55::  |- Q e. RR
56::  |- B = { <. x , y >. | ( <. x , y >. e. A /\ x <_ Q ) }
57::  |- C = { <. x , y >. | ( <. x , y >. e. A /\ Q <_ x ) }
*resutls
600:: |- B e. dom area
601:: |- C e. dom area
qed:: ( area ` A ) = ( area ` B ) + ( area ` C )

Here is how far I have got, it is not so easy. I was then going to try to write an "area of a triangle" theorem which covers all cases. I do not have so much energy to work on it but hopefully I can do something :)

Thierry Arnoux

unread,
Jun 2, 2019, 5:59:07 AM6/2/19
to meta...@googlegroups.com
Hi Jon,

One thought which may help you:

I would start from the end, resolving your last statement using a ‘mpjaodan’, ‘pm2.61dane’, or, if you use induction, ‘pm2.61i’.

This will create new sub goals for your different cases, which you can then proceed to prove.

BR,
_
Thierry
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+u...@googlegroups.com.

Benoit

unread,
Jun 2, 2019, 7:11:18 AM6/2/19
to Metamath
Maybe you can also begin a new thread, with a subject like "Area of a triangle".
Thanks,
Benoit

Thierry Arnoux

unread,
Jun 2, 2019, 10:42:20 PM6/2/19
to meta...@googlegroups.com
More thoughts - in a new thread as suggested by Benoît.

Have you thought what your final theorem statement would be?
I assume you're shooting for something like areacirc and arearect, in
the form of

    ( area ` S ) = ...

Where S is our triangle (as a subset of ( RR X. RR ) ), and what's after
the equal sign is the formula giving the area.

Like in Heron's formula, it would be interesting to start from three
complex numbers A, B, and C. Here is what I came up with:

    |- ( ph -> A e. CC )
    |- ( ph -> B e. CC )
    |- ( ph -> C e. CC )

    |- X = ( Re ` ( B - C ) )
    |- Y = ( Im ` ( B - C ) )
    |- Z = ( Re ` ( A - C ) )
    |- T = ( Im ` ( A - C ) )
    |- D = ( ( Z x. Y ) - ( T x. X ) )

    |- U = ( x - ( Re ` C) )
    |- V = ( y - ( Im ` C) )
    |- E = ( ( Y x. U ) - ( X x. V ) )
    |- F = ( ( T x. U ) - ( Z x. V ) )

    |- S = { <. x , y >. | ( ( x e. RR /\ y e. RR ) /\ ( E e. ( 0 [,] D
) /\ F e. ( 0 [,] D ) ) ) }

    |- ( ph -> ( area ` S ) = ( ( abs ` D ) / 2 ) )

Or did you have something else in mind, e.g. where the "height" and
"base" of the triangle are explicit?

Here's a quote from Mario (from earlier on this thread), I think it's
still very valid here:

> Here's a question for you, and I think that thinking carefully about
> the answer will help a lot with learning how to formalize: What does
> "Area of a Triangle = 1/2 base * height" mean? What even is a
> triangle, and how do you define its area? Is this theorem true by
> definition, and if not what are the relevant definitions? Depending on
> the answers, you will get very different proofs overall.

BR,
_
Thierry


Jon P

unread,
Jun 4, 2019, 5:17:33 AM6/4/19
to Metamath
One very small question I think is appropriate for this thread as the area triangle stuff is moved. 

The theorems in my Mathbox have been moved to us.metamath.org which is nice. However there is no "structured version" for them at the moment (the button in the top right you can click to see more usual notation). Does this just take time or is there anything I can do to activate it? I'd like to show what I am doing to my old supervisor and they will get on much better with the structured versions I think.

Thierry Arnoux

unread,
Jun 4, 2019, 6:05:26 AM6/4/19
to meta...@googlegroups.com
Hi Jon,

There is no automatic generation (yet) for the structured version, I run it manually (and too seldom). I will launch another one today, it takes long (days) to generate everything. (but luckily, Mathematics is not at risk of disappearing in a few days)
BR,
_
Thierry

Le 4 juin 2019 à 17:17, Jon P <drjonp...@gmail.com> a écrit :

One very small question I think is appropriate for this thread as the area triangle stuff is moved. 

The theorems in my Mathbox have been moved to us.metamath.org which is nice. However there is no "structured version" for them at the moment (the button in the top right you can click to see more usual notation). Does this just take time or is there anything I can do to activate it? I'd like to show what I am doing to my old supervisor and they will get on much better with the structured versions I think.

--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+u...@googlegroups.com.

Jon P

unread,
Jun 10, 2019, 5:46:02 AM6/10/19
to Metamath
Is anyone willing to give me a little help with this error?

E-PR-0009 Theorem iocinico.Step 79: Step 79: Label ss2abdv: VerifyProof: DjVars restriction violated! The step lists <ph x> as a DjVars restriction, but the substitutions share variable x.

I'm no sure I understand what a DjVars restriction is or how to fix it. I think it's something to do with having enough distinct variables in an expression, like you can't have S. f(x) dx or something? Any help appreciated, here is the offending line.

78::id  |- ( ( ( x e. ( A (,] B ) /\ x e. ( B [,) C ) ) 
-> x e. ( B [,] B ) ) 
-> ( ( x e. ( A (,] B ) /\ x e. ( B [,) C ) ) -> x e. ( B [,] B ) ) )
79:78:ss2abdv |- ( ( ( x e. ( A (,] B ) /\ x e. ( B [,) C ) ) 
->   x e. ( B [,] B ) )
->  { x | ( x e. ( A (,] B ) /\ x e. ( B [,) C ) ) } 
C_   { x | x e. ( B [,] B ) }  )


Here is the full proof.

Thierry Arnoux

unread,
Jun 10, 2019, 7:20:56 AM6/10/19
to meta...@googlegroups.com
Hi Jon,

Yes this is a distinct variable restriction: x is not allowed to occur in the “ph” of ss2abdv, i.e. in your 
( ( x e. ( A (,] B ) /\ x e. ( B [,) C ) ) 
-> x e. ( B [,] B ) ) 
The solution is maybe to replace x by another set variable.
_
Thierry
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+u...@googlegroups.com.

Thierry Arnoux

unread,
Jun 10, 2019, 7:41:30 AM6/10/19
to meta...@googlegroups.com

Actually, in this case, you can just skip your steps 78 and 79:

80:77:ss2abdv  |-  ( ( A e. RR* /\ B e. RR* /\ C e. RR* )


    ->  { x | ( x e. ( A (,] B ) /\ x e. ( B [,) C ) ) }
    C_   { x | x e. ( B [,] B ) }  )

Note that bnj1153 is discouraged!

I guess you have to revert to using elin directly.

Jon P

unread,
Jun 10, 2019, 9:09:25 AM6/10/19
to Metamath
Ok cool thanks I'll have a go.

It is a bit tricky with discouraged theorems because almost everything I use is found automatically by mmj2. Is there any way to tell it not to use discouraged theorems?

Norman Megill

unread,
Jun 10, 2019, 1:58:20 PM6/10/19
to Metamath

It sounds like mmj2 is allowing matches to discouraged theorems, which ideally shouldn't happen.  But I'm not sure to what extent the recognition of discouraged tags has been implemented in mmj2.

A few years ago I moved the useful bnj* theorems that I found to main and added discouraged tags to the rest.  It seems I missed bnj1153, which is very useful.  I renamed it to elind and moved it to main, so you can use it now.  It minimized 187 proofs out of the 597 that originally used elin, reducing set.mm by 4500 bytes.

Norm

Jon P

unread,
Jun 11, 2019, 5:57:22 AM6/11/19
to Metamath
Awesome, thanks for the help :)

I can find icombl and icombl1 but can't find iocmbl and iocmbl1, am I right in thinking they don't exist? If so I could have a go at cooking them up.

Also I think maybe the proof of icombl1 could be shorted by using icombl. I haven't shortened a proof before, would this be helpful? Do I just edit the proof and then submit it?

Mario Carneiro

unread,
Jun 11, 2019, 6:17:20 AM6/11/19
to metamath
The proof of icombl uses icombl1. In fact icombl1 isn't really even intended for general use, since icombl is strictly more general; icombl is proven by splitting the set into a difference of left-closed right-infinite sets which are measurable by icombl1.

iocmbl isn't proven mostly because right closed intervals are not that useful. Usually left closed intervals are just as good and they have all the theorems.

--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+u...@googlegroups.com.

Benoit

unread,
Jun 11, 2019, 6:01:03 PM6/11/19
to Metamath
Hi Jon,
I have a few suggestions concerning your theorem "itexp", if it doesn't take you too much time:
* In set.mm, NN does not denote the natural numbers: it excludes zero (there was a recent flame war about this on this discussion group, let's not reopen it!).  The set.mm symbol for natural numbers is NN0, so you could prove your theorem with NN0 in place of NN (of course, your theorem using NN is perfectly correct, but it is awkwardly restricted, ever so slightly).
* Since your theorem could be useful, it might be worth to put it in deduction form (i.e. prepend "( ph -> " to the hypotheses and the conclusion).
* I would label it "itpow" rather than "itexp" since it integrates power functions, and not exponential functions.
* It would be nice to have the similar theorem for general polynomials, with something like sum_ k e. ( 0 ... N ) ( ( P ` k ) x. ( x ^ k ) ) on the LHS.  Up to you to see if it's worth your time.

Benoit

Jon P

unread,
Jun 12, 2019, 9:26:55 AM6/12/19
to Metamath
Thanks for the response Mario, I see the link between the theorems now. I proved iocmbl as I think I need it but it's fine for it to stay in my math box if no one else is interested :)

Benoit, these sound like interesting suggestions. I have used itexp in areaquad so it is not super simple to change it however it is also not so bad. Now is the time to make changes if it can be strengthened. Replacing NN with NN0 I think should be quite simple. Though I think the case of n = 0 is covered by itgconst it will be nice to make itexp a little more general.

With putting the theorem in deduction form with "( ph ->" how does making that change work? Would I need to replace almost all theorems in the text so they begin with "( ph ->" or is there some way of just changing the beginning and the end? Sounds like it could be quite a lot of work.

Re names I am willing to make the change, I think exp for exponential is a bit confusing in this context. Does anyone else have input? One of the reviewers suggested using the word monomial so maybe itmon is possible, itpow is fine or something else? Using exp does match with itgsinexp, though that is only in Glauco's math box. I looked for the theorem of the integral of e^x but couldn't find it :(

As for a general theorem that sounds nice, I would like to do more calculus stuff, however it will have to wait until I have finished this triangle stuff at least. If anyone else wants to take it on feel free :)


Benoit

unread,
Jun 12, 2019, 12:20:29 PM6/12/19
to Metamath
With putting the theorem in deduction form with "( ph ->" how does making that change work? Would I need to replace almost all theorems in the text so they begin with "( ph ->" or is there some way of just changing the beginning and the end? Sounds like it could be quite a lot of work.

I did this a few times, but with smaller proofs.  What I did was having the old proof in mmj2 format in a separate window in a text editor, and proving the deduction form in mmj2 from scratch, starting from the conclusion, and at each step, "copying" the old proof but using the "deduction version" of the theorem used in the old proof. E.g. in the present case, I would open mmj2, enter "mvllmuld" (instead of mvllmuli) on the "qed" line, then enter "eqtrd" (instead of eqtri) on the previous line, etc.  Sometimes, the "deduction version" of a theorem does not exist, in particular when the old proof was already using a deduction version ("double deduction versions" are very rare), so you need to "export" the antecedent, continue, and then "import" it back, using ~im and ~exp). Other tweaks might be necessary, like some extra uses of ~syl.  Indeed, this sounds boring indeed :-(  Maybe more experienced practitionners know a faster way?  Maybe it would be worth trying to shorten the proof first?  It looks a bit long, given that ftc2 and dvexp should provide most of the work.  Again, it would be nice to have experienced users' opinions.

The slides by Mario on the "deduction method" are interesting (see http://us.metamath.org/downloads/natded.pdf).

The fact that your current proof already has T. as antecedent in several steps, and uses ~trud several times, shows that it already uses "deduction forms" in some parts, and not in others, which gives it an awkward look. (Roughly, in these steps, the global antecedent ph would replace T.)

Re names I am willing to make the change, I think exp for exponential is a bit confusing in this context. Does anyone else have input? One of the reviewers suggested using the word monomial so maybe itmon is possible, itpow is fine or something else? Using exp does match with itgsinexp, though that is only in Glauco's math box. I looked for the theorem of the integral of e^x but couldn't find it :(

I was the one suggesting "monomial" for the comment (since I see this theorem as a step towards integrals of polynomials).  But as for the label, I still prefer itpow.  Or should it be itgpow?  (And similarly, "dvexp" could be relabeled "dvpow".)

Benoit

Thierry Arnoux

unread,
Jun 12, 2019, 12:45:53 PM6/12/19
to meta...@googlegroups.com, Benoit

About "pow" vs. "exp":

The table in the "convention" lists some commonly used abbreviations.

Shall we try to make it as exhaustive as possible so that it becomes a reference, which can be used when one wants to find an existing theorem, or name a new one?

We could list there "pow" for power, "exp" for exponential, and "itg" for integral. Same for "ico", "ioc", "icc", "ixx", etc. which Jon has encountered recently.

On one hand I understand we might want to keep the table on that page small and readable for those who want to get a high level view and a generic understanding about how theorems are named, but on the other hand I think an exhaustive reference would also have its use. So shall there be two tables? What are your thoughts?


David A. Wheeler

unread,
Jun 12, 2019, 1:15:26 PM6/12/19
to metamath, metamath, Benoit
On Thu, 13 Jun 2019 00:45:47 +0800, Thierry Arnoux <thierry...@gmx.net> wrote:
> The table in the "convention" lists /some commonly used/ abbreviations.
>
> Shall we try to make it as exhaustive as possible so that it becomes a
> /reference/, which can be used when one wants to find an existing
> theorem, or name a new one?

If we made an exhaustive table then it'd have to include all the "df-..." entries.
Ignoring mathboxes, that would require 779 definitions, only a few of
which are there now (counted with grep 'df-.*$a' ,set.mm | wc -l).

That's a pretty big table.
I think the shorter table is easier to deal with, so I don't think we
should eliminate the short table.

If you want an exhaustive table,
we could create a script to automatically generate
an exhaustive table by combining the short table and the "df-... $a" definitions.
We could run that once & edit by hand, or just rerun the script
to keep generating the full table. An exhaustive table produced from a
script is more likely to actually stay correct, once it's correct :-).

--- David A. Wheeler

Jon P

unread,
Jun 12, 2019, 3:17:40 PM6/12/19
to Metamath
Re deduction form is there any way to create a general wrapper? I imagine you've considered this already.

If ( A -> B ) does that imply ( ( ph -> A ) -> ( ph -> B ) )? If so could I just prove the deduction version from the current version by adding that at the start? I think that might be possible.

Benoit

unread,
Jun 12, 2019, 4:13:08 PM6/12/19
to Metamath
On Wednesday, June 12, 2019 at 9:17:40 PM UTC+2, Jon P wrote:
Re deduction form is there any way to create a general wrapper? I imagine you've considered this already.

If ( A -> B ) does that imply ( ( ph -> A ) -> ( ph -> B ) )? If so could I just prove the deduction version from the current version by adding that at the start? I think that might be possible.

Your first sentence is true, but it does not imply the second.  In the case of itexp, you don't have the closed form "A -> B", but only the inference.  There is no such straightforward way to get the deduction form from the inference form. In addition to Mario's slides I linked to above, you can have a look at http://us2.metamath.org/mpeuni/mmnatded.html and http://us2.metamath.org/mpeuni/mmdeduction.html

 

Thierry Arnoux

unread,
Jun 12, 2019, 9:33:52 PM6/12/19
to meta...@googlegroups.com, Benoit
Hi David!

You=E2=80=99re right!
Then the integral of the exponential function (df-ef) shall be in a theorem c=
alled itgef.

And =E2=80=9Cexp=E2=80=9D alone could name both x^A and A^x, so I believe =E2=
=80=9Citgmon=E2=80=9D (for monomial) would be a better choice, but then it w=
ould be nice to document it, since it does not correspond to any df- definit=
ion!

BR,
_
Thierry

_
Thierry

> Le 13 juin 2019 =C3=A0 01:15, David A. Wheeler <dwhe...@dwheeler.com> a =C3=
=A9crit :
>=20
>> On Thu, 13 Jun 2019 00:45:47 +0800, Thierry Arnoux <thierry...@gmx.ne=
t> wrote:
>> The table in the "convention" lists /some commonly used/ abbreviations.
>>=20
>> Shall we try to make it as exhaustive as possible so that it becomes a
>> /reference/, which can be used when one wants to find an existing
>> theorem, or name a new one?
>=20
> If we made an exhaustive table then it'd have to include all the "df-..." e=
ntries.
> Ignoring mathboxes, that would require 779 definitions, only a few of
> which are there now (counted with grep 'df-.*$a' ,set.mm | wc -l).
>=20
> That's a pretty big table.
> I think the shorter table is easier to deal with, so I don't think we
> should eliminate the short table.
>=20
> If you want an exhaustive table,
> we could create a script to automatically generate
> an exhaustive table by combining the short table and the "df-... $a" defin=
itions.
> We could run that once & edit by hand, or just rerun the script
> to keep generating the full table. An exhaustive table produced from a
> script is more likely to actually stay correct, once it's correct :-).
>=20
> --- David A. Wheeler
>=20
> --=20
> You received this message because you are subscribed to the Google Groups "=
Metamath" group.
> To unsubscribe from this group and stop receiving emails from it, send an e=
mail to metamath+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid=
/metamath/E1hb6qL-0005Yf-6C%40rmmprod07.runbox.

It is loading more messages.
0 new messages