# Question 8060: Toggle a Typed Nonloop Edge and Compute Degree Changes

[Return to catalogue page 41](https://ocme.evemisslab.com/en/questions/page/41/)

[← Question derivation index](https://ocme.evemisslab.com/en/questions/) · [Original question batch](https://ocme.evemisslab.com/en/practice/batch-20261012-advance-20261017-r05-graph-foundations/#q-20261012-advance-20261017-r05-graph-0060)

This teaching derivation has second-context AI mathematical and bilingual semantic review, limited to the model and assumptions stated in this question. It has no human review or new Lean proof and does not promote the original question or MKO to Canonical truth.

R0015-08060 · q-20261012-advance-20261017-r05-graph-0060



## Original question and givens

Use a complete simple undirected graph on Fin(5)={0,…,4} with raw edges=[[0, 2], [0, 3]]. Endpoints are typed and loops are prohibited. Reversed or repeated edges count once; normalize endpoints and edge order. Do not infer adjacency from a drawing. Toggle edge=[0, 4]. Give (original normalized edges, normalized toggled edge, removed/added action, new edges, old degrees, new degrees, degree differences, degree-sum difference).


- G001 — Use a complete simple undirected graph on Fin(5)={0,…,4} with raw edges=[[0, 2], [0, 3]]. Endpoints are typed and loops are prohibited. Reversed or repeated edges count once; normalize endpoints and edge order. Do not infer adjacency from a drawing. Toggle edge=[0, 4]. Give (original normalized edges, normalized toggled edge, removed/added action, new edges, old degrees, new degrees, degree differences, degree-sum difference).





## Definition and scope

Use the original question domain, assumptions and cited MKO definitions. This item has second-context mathematical and bilingual review, with the model, answer and every arithmetic step independently recomputed from the original parameters; the source question remains a candidate.


- [mko-graph](https://ocme.evemisslab.com/en/mko/mko-graph/)





## Step-by-step derivation

S001 · impliesBefore

n=5;raw edges=[[0, 2], [0, 3]]

After

canonical edges=[[0, 2], [0, 3]]

Conditions: none

Validate every simple undirected edge for typed distinct endpoints.Sort endpoints and count reversed or repeated edges once;do not infer adjacency from a drawing.

Step identifiers and dependenciesRule: simple_graph_edge_normalization · Uses: G001





S002 · impliesBefore

phase=original;vertex=0;all edges=[[0, 2], [0, 3]]

After

neighbors=[2, 3];degree=2

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S001





S003 · impliesBefore

phase=original;vertex=1;all edges=[[0, 2], [0, 3]]

After

neighbors=[];degree=0

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S002





S004 · impliesBefore

phase=original;vertex=2;all edges=[[0, 2], [0, 3]]

After

neighbors=[0];degree=1

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S003





S005 · impliesBefore

phase=original;vertex=3;all edges=[[0, 2], [0, 3]]

After

neighbors=[0];degree=1

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S004





S006 · impliesBefore

phase=original;vertex=4;all edges=[[0, 2], [0, 3]]

After

neighbors=[];degree=0

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S005





S007 · impliesBefore

typed candidate=[0, 4];old edges=[[0, 2], [0, 3]]

After

action=added;new edges=[[0, 2], [0, 3], [0, 4]]

Conditions: none

Normalize a reversed candidate first,then decide addition/removal from the original edge set.Exactly one undirected edge changes.

Step identifiers and dependenciesRule: toggle_one_undirected_nonloop_edge · Uses: G001, S006





S008 · impliesBefore

phase=toggled;vertex=0;all edges=[[0, 2], [0, 3], [0, 4]]

After

neighbors=[2, 3, 4];degree=3

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S007





S009 · impliesBefore

phase=toggled;vertex=1;all edges=[[0, 2], [0, 3], [0, 4]]

After

neighbors=[];degree=0

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S008





S010 · impliesBefore

phase=toggled;vertex=2;all edges=[[0, 2], [0, 3], [0, 4]]

After

neighbors=[0];degree=1

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S009





S011 · impliesBefore

phase=toggled;vertex=3;all edges=[[0, 2], [0, 3], [0, 4]]

After

neighbors=[0];degree=1

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S010





S012 · impliesBefore

phase=toggled;vertex=4;all edges=[[0, 2], [0, 3], [0, 4]]

After

neighbors=[0];degree=1

Conditions: none

Scan all canonical edges.An incident edge contributes its other endpoint as a distinct neighbor.Keep original vertex labels.

Step identifiers and dependenciesRule: complete_graph_neighbor_inventory · Uses: G001, S011





S013 · calculationBefore

degree delta0 := sub(3, 2)

After

degree delta0 = 1

Conditions: none

Substitute the source data exactly in the stated operand order;division requires a nonzero denominator.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S012





S014 · calculationBefore

degree delta1 := sub(0, 0)

After

degree delta1 = 0

Conditions: none

Substitute the source data exactly in the stated operand order;division requires a nonzero denominator.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S013





S015 · calculationBefore

degree delta2 := sub(1, 1)

After

degree delta2 = 0

Conditions: none

Substitute the source data exactly in the stated operand order;division requires a nonzero denominator.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S014





S016 · calculationBefore

degree delta3 := sub(1, 1)

After

degree delta3 = 0

Conditions: none

Substitute the source data exactly in the stated operand order;division requires a nonzero denominator.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S015





S017 · calculationBefore

degree delta4 := sub(1, 0)

After

degree delta4 = 1

Conditions: none

Substitute the source data exactly in the stated operand order;division requires a nonzero denominator.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S016





S018 · calculationBefore

degree delta sum := sum(1, 0, 0, 0, 1)

After

degree delta sum = 2

Conditions: none

Substitute the source data exactly in the stated operand order;division requires a nonzero denominator.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S017









## Reverse checks


- S018 · premise_and_result_audit — Recompute degree delta sum with exact rational arithmetic, not rounded decimals.
- S017 · premise_and_result_audit — Recompute degree delta4 with exact rational arithmetic, not rounded decimals.
- S016 · premise_and_result_audit — Recompute degree delta3 with exact rational arithmetic, not rounded decimals.
- S015 · premise_and_result_audit — Recompute degree delta2 with exact rational arithmetic, not rounded decimals.
- S014 · premise_and_result_audit — Recompute degree delta1 with exact rational arithmetic, not rounded decimals.
- S013 · premise_and_result_audit — Recompute degree delta0 with exact rational arithmetic, not rounded decimals.
- S012 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S011 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S010 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S009 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S008 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S007 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S006 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S005 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S004 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S003 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S002 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S001 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.





## Result

([[0, 2], [0, 3]], [0, 4], added, [[0, 2], [0, 3], [0, 4]], [2, 0, 1, 1, 0], [3, 0, 1, 1, 1], [1, 0, 0, 0, 1], 2)

The full substitutions and premise checks give the original answer; source identity,format and status are unchanged.





## This question review and source binding

Review date: 2026-10-26

Original questions, answers, step expressions, numeric ASTs and historical records are retained. Source candidate labels remain historical and are not overwritten as formal proof.

Source hashes and review receipts
- input commit: 0f7be61e2c22317a4075561dc822c87d881a50db
- original question SHA-256: 271c5bd76364e51c94bbde720cbbda52aeea49baf3963432c9b6db852ed9c283
- candidate record SHA-256: 35d3981fd08b0acad9f2c84dd070ad0054dc3759719ebb9ebc3139ff3fff2b9f
- semantic review receipt SHA-256: 6ecad9d909199221a07e923f87425e80b3bdec3eed46fe5910d04fca694cae18
- question-first witness SHA-256: e8f00458977a09493b5f9f05ab9e6feec72debaf4c7d1c609d1fc95900a35a1b
- Lean: NOT_RUN · human review: NOT_PERFORMED

[Same-source full JSON](https://ocme.evemisslab.com/data/question-derivations/questions/q-20261012-advance-20261017-r05-graph-0060.json)




