Skip to content

Add set-mbox-jag mathbox - #5432

Open
jorge-agra wants to merge 4 commits into
metamath:developfrom
jorge-agra:jag/tgaas-aas-mathbox
Open

jorge-agra wants to merge 4 commits into
metamath:developfrom
jorge-agra:jag/tgaas-aas-mathbox

Conversation

@jorge-agra

Copy link
Copy Markdown

Summary

This PR adds a mathbox for Jorge Agra with a proof of the AAS triangle congruence theorem tgaas, addressing #2983.

The change is intended to be mathbox-only apart from the contributor-list entry. The new mathbox contains the live dependency cone needed for tgaas, including the exterior-angle theorem tgexta, the side-equality main tgaas1, and the final congruence wrapper tgaas.

Notes on provenance

The proofs were produced with heavy use of LLM's tooling and then inserted into set.mm.

The proof skeleton started with https://github.com/tirix/metamath-blueprints Triangle Congruence blueprint, but derived to a path closer to the one used by GeoCoq, used as a route map: its formalization identified useful intermediate geometry lemmas and the proof outline. No Coq proof term was translated or ported into Metamath.

The route avoids introducing a new strict-angle definition. Since set.mm has leA but no ltA, strictness is carried inline as leA together with non-congruence.

Validation

Local validation performed before submission using only metamath-exe:

@tirix

tirix commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

You'll need to run scripts/rewrap to make the failing test pass.

@jorge-agra

Copy link
Copy Markdown
Author

From first push I think I followed the steps at CONTRIBUTING.md, but seems some extraneous line spaces got through. it.
Cant get a clear diagnostic from pipeline, probably I am looking into the wrong place.

Comment thread set.mm Outdated
|- ( ph -> G TarskiGDim>= 2 )
$=
( ncoltgdim2 ) AEFGHBCDIJKLMNOPQ $.
$}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a exactly theorem ncoltgdim2, it's probably superfluous to define a new theorem.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed

Comment thread set.mm Outdated
tgdefncol $p
|- ( ph -> -. ( F e. ( D L E ) \/ D = E ) )
$=
( cgrancol ) ABCDEFGHIJKLMONQRSTUAUBUCUEPUDUF $.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same remark: this is exactly cgrancol. You could propose improvements to the theorem comments or propose to rename it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed

Comment thread set.mm Outdated
~ cgrane4 ), and betweenness alone permits a collapsed arm. Same
skeleton as ~ cgrahlb with segment addition ( ~ tgcgrextend ) in place
of subtraction. (Contributed by JAG, 12-Aug-2026.) $)
cgrabtwnb $p |- ( ph -> <" A B C "> ( cgrA ` G ) <" D E F "> )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is the same as ~ flatcgra

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed

Comment thread set.mm
Comment on lines +508823 to +508829
( cv cs3 cinag cfv wbr ccgra wa wceq simpr breq1d eqidd breq2d anbi12d cstrkg
s3eqd cgrane3 cgrane4 cds eqid tgbtwntriv1 hlid olcd isinagd cgrahlb rspcedvd
necomd jca ) ABUGZKLMUHZGUIUJZUKZCEJUHZKLVNUHZGULUJZUKZUMKVOVPUKZVRKLKUHZVTUK
ZUMBKDUBAVNKUNZUMZVQWBWAWDWFVNKVOVPAWEUOZUPWFVSWCVRVTWFKLVNKKLWFKUQWFLUQWGVAU
RUSAWBWDAKLMDGHIUTKKNOPUBUBUCUDQUBALKACEFKDLMGHINOPQRSTUBUCUDUEVBVLZALMACEFKD
LMGHINOPQRSTUBUCUDUEVCVLWHAKMDGHGVDUJZNWIVEZOQUBUDVFAKKLIUJUKKLUNAKKLDGHINOPU
BUBUCQWHVGZVHVIACEJKDLKGHIWINOPWJQRSUAUBUCUBUFWKVJVMVK $.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The proof block takes the whole 80 chars width. I'm surprised rewrap did not indent, usually there is an indentation of 4 blank spaces.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

rewrap didnt complain so I didnt changed it. The 4 spaces indent is required?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, I see a few other theorems also do not indent the proof blocks. I'll check the opinion of the community, but this is certainly not blocking.

Comment thread set.mm Outdated
trichotomy and its first two disjuncts collapse into the half-line exit
through ~ btwnhl2 . Generic ray/betweenness bookkeeping; ~ cgrainag
uses it to route the collinear half of its case analysis. (Contributed
by JAG, 12-Aug-2026.) $)

@tirix tirix Aug 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A note on the comment: E is not really the "middle one", since D and W could be on the same size of E.
I find it's often easier to name the objects when describing a theorem:

Given three colinear points `D`, `E` and `W`, the point `E` is either between `D` and `W`, or both `D` and `W` lie on a ray starting at `E`.

Comment thread set.mm Outdated
through ~ btwnhl2 . Generic ray/betweenness bookkeeping; ~ cgrainag
uses it to route the collinear half of its case analysis. (Contributed
by JAG, 12-Aug-2026.) $)
hlorbtwn $p |- ( ph -> ( D ( K ` E ) W \/ E e. ( D I W ) ) )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems to be the same theorem as lnhl

@tirix tirix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry I lack time to review carefully.
I only reviewed until hlorbtwn for now.
To be continued

Comment thread set.mm Outdated
Comment on lines +509096 to +509097
$( 'v' is bound in the conclusion, so these are mandatory and propagate to
every caller. $)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's correct, but it's also the case for all theorems with bound variables.

Comment thread set.mm
Comment on lines +508905 to +508909
inagcgrabtwn $p
|- ( ph -> E. v e. P
( v ( inA ` G ) <" X Y Z ">
/\ <" D E W "> ( cgrA ` G ) <" X Y v "> ) )
$=

@tirix tirix Aug 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As a general remark: the labels for the essential hypotheses (iabtw) do not match the labels for the theorem (inagcgrabtwn). It's better to keep them aligned, in order to avoid possible future conflicts.

This also applies to the 3~4 previous theorems.

Comment thread set.mm
VKEVPVQVAZVSNOEURZWAVAZVKBEDUJAVOEVCZVKZVRWCWBWEWGVOEVPVQAWFVDZVEWGVTWDVSWAWG
NOVOENOWGNVFWGOVFWHVGVHVIACDEFGHIJKLIVJUTZMNOPQRSWIVLTUAUBUCUDUEUFUGUHUIUJUKU
LUMUNUOUPVMVN $.
$}

@tirix tirix Aug 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like the essential hypotheses $e for inagcgratrgmain and inagcgratrgw are exactly the same: in that case, you can put both theorems in the same scope ${ ... $} and avoid duplicating them.

This also works for inagcgratrgncol and inagcgratrgncol: inagcgratrgncol has a few additional hypotheses, you can put it in a nested scope and share the common ones.

@jorge-agra

Copy link
Copy Markdown
Author

Hypothesis-block deduplication (comment + sweep) — 9 groups collapsed into shared ${ ... } scopes, first-member-owns-the-labels convention:

inagcgratrgmain/inagcgratrgw, inagcgratrgncol/inagcgratrgn (the two pairs on comments)
tgmircgrg/tgmircgra/tgextamirn
tgextalem1inag/tgextale/tgextamirnhl/tgextahp/tgextancgra
tgaascgra/tgaas1h
tgaas1/tgaas (shared labels renamed to tgaas1.*, the first member)

@jorge-agra

Copy link
Copy Markdown
Author

Duplicate theorems removed :

tgatgdim2 → callers now cite ~ ncoltgdim2 directly
tgdefncol → callers now cite ~ cgrancol directly
cgrabtwnb → callers now cite ~ flatcgra directly
hlorbtwn → callers now cite ~ lnhl + ~ hlcomd (commuted disjunct)

@jorge-agra

Copy link
Copy Markdown
Author

No warnings from metamath or metamath-knife

@wlammen

wlammen commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

If no one objects, I will merge this next week.

@avekens

avekens commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

There is still no approval. @tirix what do you think? Can this PR be merged, although there are may be some issues to be discussed? Since this PR concerns a mathbox only, I think the discussion can be continued after this PR is merged.

@icecream17 icecream17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I looked at about half of it and nothing is blocking, which might slightly help with mergability.

Plenty of (somewhat vague) thoughts to chew on for a later pr though.

Comment thread set.mm
Comment on lines +508561 to +508578
$( Proof of the exterior-angle theorem 'tgexta' and the
AAS triangle congruence criterion 'tgaas' in Tarski geometry.

Elementary consequences of triangle non-collinearity, the
degenerate-angle congruence constructor, in-angle transport
across an angle congruence, the exterior-angle theorem and its strictness
half, and finally the AAS assembly, with 'tgaas'.

Strictness of an angle comparison has no primitive here: 'set.mm' defines
'leA' but no 'ltA', so "strictly less" is carried inline as 'leA' together
with the failure of 'cgrA'. $)

$( Consequences of triangle non-collinearity: vertex inequalities, the
dimension condition, and non-collinearity transported across an angle
congruence. $)


${

@icecream17 icecream17 Sep 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
$( Proof of the exterior-angle theorem 'tgexta' and the
AAS triangle congruence criterion 'tgaas' in Tarski geometry.
Elementary consequences of triangle non-collinearity, the
degenerate-angle congruence constructor, in-angle transport
across an angle congruence, the exterior-angle theorem and its strictness
half, and finally the AAS assembly, with 'tgaas'.
Strictness of an angle comparison has no primitive here: 'set.mm' defines
'leA' but no 'ltA', so "strictly less" is carried inline as 'leA' together
with the failure of 'cgrA'. $)
$( Consequences of triangle non-collinearity: vertex inequalities, the
dimension condition, and non-collinearity transported across an angle
congruence. $)
${
$( The exterior-angle theorem ~ tgexta and the
AAS triangle congruence criterion ~ tgaas in Tarski geometry.
In order: Elementary consequences of triangle non-collinearity, the
degenerate-angle congruence constructor, in-angle transport across an
angle congruence, the exterior-angle theorem and its strictness half,
and finally the AAS assembly, with ~ tgaas .
Strict less-than angle comparison is notated as 'leA' together
with the failure of 'cgrA', since 'set.mm' defines 'leA' but not 'ltA'. $)
$( Consequences of triangle non-collinearity: vertex inequalities, the
dimension condition, and non-collinearity transported across an angle
congruence. $)
${

non-blocking

feel free to choose only the changes that look good to you:

  1. Shorter "title" first paragraph
  2. Clarify what the second paragraph is for
  3. Simplify the third paragraph (more readable I think)
  4. Remove newline: double newline very uncommon + the second comment becomes a bit closer to the theorems its about, which is clearer (edit: see below suggestion for an alternative to this)

Comment thread set.mm
Comment on lines +508683 to +508687
$( A flat sub-angle forces the containing angle flat: if ' W ' is inside
angle ' <" D E F "> ' and ' E ' lies between ' D ' and ' W ' ,
then ' E ' lies between ' D ' and ' F ' . This is
GeoCoq ' bet__in__angle__bet '. Proved by unfolding ~ isinag and
following its segment point. (Contributed by JAG, 12-Aug-2026.) $)

This comment was marked as resolved.

Comment thread set.mm
Comment on lines +508722 to +508731
$( In-angle transport, degenerate branch (i): the sub-angle ' <" D E W
"> ' is **null**, ' W ' lying on ray ' ED ' . The witness is not
constructed -- it is ' X ' , the target's own first arm -- and ~ cgrahlb
supplies the copied angle from the two ray degeneracies. No GeoCoq
counterpart: GeoCoq's branch only locates a witness supplied by its
universal statement. (Contributed by JAG, 12-Aug-2026.) $)
inagcgrasubhl $p
|- ( ph -> E. v e. P
( v ( inA ` G ) <" X Y Z ">
/\ <" D E W "> ( cgrA ` G ) <" X Y v "> ) )

This comment was marked as resolved.

Comment thread set.mm
Comment on lines +509337 to +509344
$}

$( Angle order ('leA') and its witnesses: passing between "inside the angle"
and 'leA', transporting a witness across a congruent target angle, and
replacing either compared angle by a congruent one. $)


${

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, as an alternative to my earlier suggestion, maybe it would make more sense to have:

2 empty lines before
1 empty line after

such comments.

Comment thread set.mm
Comment on lines +509345 to +509359
inaglea.p $e |- P = ( Base ` G ) $.
inaglea.i $e |- I = ( Itv ` G ) $.
inaglea.k $e |- K = ( hlG ` G ) $.
inaglea.g $e |- ( ph -> G e. TarskiG ) $.
inaglea.a $e |- ( ph -> A e. P ) $.
inaglea.b $e |- ( ph -> B e. P ) $.
inaglea.c $e |- ( ph -> C e. P ) $.
inaglea.y $e |- ( ph -> Y e. P ) $.
inaglea.1 $e |- ( ph -> C ( inA ` G ) <" A B Y "> ) $.
$( If ' C ' lies inside angle ' <" A B Y "> ' , then angle ' <" A B C
"> ' is less than or equal to ' <" A B Y "> ' . (Contributed by JAG,
12-Aug-2026.) $)
inaglea $p
|- ( ph -> <" A B C "> ( leA ` G ) <" A B Y "> )
$=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if it is valid to order the theorems like this, but I'm thinking this theorem could shorten the proof of ~ inagbtwn .

Anyhow:

Suggested change
inaglea.p $e |- P = ( Base ` G ) $.
inaglea.i $e |- I = ( Itv ` G ) $.
inaglea.k $e |- K = ( hlG ` G ) $.
inaglea.g $e |- ( ph -> G e. TarskiG ) $.
inaglea.a $e |- ( ph -> A e. P ) $.
inaglea.b $e |- ( ph -> B e. P ) $.
inaglea.c $e |- ( ph -> C e. P ) $.
inaglea.y $e |- ( ph -> Y e. P ) $.
inaglea.1 $e |- ( ph -> C ( inA ` G ) <" A B Y "> ) $.
$( If ' C ' lies inside angle ' <" A B Y "> ' , then angle ' <" A B C
"> ' is less than or equal to ' <" A B Y "> ' . (Contributed by JAG,
12-Aug-2026.) $)
inaglea $p
|- ( ph -> <" A B C "> ( leA ` G ) <" A B Y "> )
$=
inaglea.p $e |- P = ( Base ` G ) $.
inaglea.i $e |- I = ( Itv ` G ) $.
inaglea.k $e |- K = ( hlG ` G ) $.
inaglea.g $e |- ( ph -> G e. TarskiG ) $.
inaglea.a $e |- ( ph -> A e. P ) $.
inaglea.b $e |- ( ph -> B e. P ) $.
inaglea.c $e |- ( ph -> C e. P ) $.
inaglea.y $e |- ( ph -> Y e. P ) $.
inaglea.1 $e |- ( ph -> C ( inA ` G ) <" A B Y "> ) $.
$( If ` C ` lies inside angle ` <" A B Y "> ` , then angle ` <" A B C "> `
is less than or equal to ` <" A B Y "> ` . (Contributed by JAG,
12-Aug-2026.) $)
inaglea $p
|- ( ph -> <" A B C "> ( leA ` G ) <" A B Y "> )
$=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(the code bracket formatting suggestion can probably be applied to several other theorems)

Comment thread set.mm
Comment on lines +509544 to +509546
$d F w $. $d G w $. $d H w $. $d J w $. $d P w $. $d U w $.

$( Source-side ' leA ' transport: replacing the smaller angle by a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not gonna lie, this pr has plenty of unusual formatting events. For instance, normally this empty line would not exist and the dv conditions would be above the hypotheses.

But I guess it's fine (?)

Comment thread set.mm
KVLVM $.
$}

$( Angle order under congruence of both compared angles ( ~ leacgra ), used by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only reviewed up to here (around halfway)

@tirix

tirix commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

I meant to take more time to review this PR but I've been pretty busy lately, thanks for jumping in!

@david-a-wheeler

Copy link
Copy Markdown
Member

@jorge-agra - thank you SO MUCH for setting up a mathbox, and I'm always excited to see our geometry material expand.

There are some review comments above, but please don't let that discourage you. Our goal is high quality, and that means that we get picky sometimes, but we're always delighted to see people working to make real contributions.

@jorge-agra

Copy link
Copy Markdown
Author

Will try to address @icecream17 review comments during this week/next weekend. Thank you for taking the time to take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants