Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import type {
PropositionDef,
ConstructionElement,
ConstructionState,
TutorialSubStep,
} from '../types'
import { BYRNE } from '../types'
import type { FactStore } from '../engine/factStore'
import type { ProofFact } from '../engine/facts'
import { distancePair } from '../engine/facts'
import { addFact } from '../engine/factStore'
function getProp6Tutorial(isTouch: boolean): TutorialSubStep[][] {
const tap = isTouch ? 'Tap' : 'Click'
const tapHold = isTouch ? 'Tap and hold' : 'Click and hold'
return [
// ── Step 0: I.3 macro — cut DB from BA equal to AC ──
[
{
instruction: `${tap} point {pt:B}`,
speech:
"We'll prove this by contradiction. Assume AB is not equal to AC — specifically, AB is greater. We use Proposition I.3 to cut off from BA a part equal to AC. Start by clicking point B — the cut point on the greater line.",
hint: { type: 'point', pointId: 'pt-B' },
advanceOn: { kind: 'macro-select' as const, index: 0 },
},
{
instruction: `${tap} point {pt:A}`,
speech: 'Click point A — the other end of line BA.',
hint: { type: 'point', pointId: 'pt-A' },
advanceOn: { kind: 'macro-select' as const, index: 1 },
},
{
instruction: `${tap} point {pt:A}`,
speech: 'Now select the segment to copy. Click A — the start of AC.',
hint: { type: 'point', pointId: 'pt-A' },
advanceOn: { kind: 'macro-select' as const, index: 2 },
},
{
instruction: `${tap} point {pt:C}`,
speech: 'Click C to finish. Proposition I.3 places point D on BA where BD equals AC.',
hint: { type: 'point', pointId: 'pt-C' },
advanceOn: null,
},
],
// ── Step 1: Join D to C (straightedge) ──
[
{
instruction: `${tapHold} point {pt:D}, drag to {pt:C}`,
speech: isTouch
? 'Now join D to C to form triangle DBC. Press and hold on D and drag to C.'
: 'Now join D to C to form triangle DBC. Click and hold on D and drag to C.',
hint: { type: 'point', pointId: 'pt-D' },
advanceOn: null,
},
],
]
}
/**
* Derive I.6 conclusion: proof by contradiction
*
* Construction gives us:
* BD = AC (I.3: cut off from BA a part equal to AC)
* ∠DBC = ∠ACB (given — same as ∠ABC = ∠ACB since D is on BA)
* BC = BC (common)
*
* Reductio:
* If AB ≠ AC, then by I.3 we can cut BD = AC with D between A and B.
* By I.4 (SAS): BD = AC, BC = BC, ∠DBC = ∠ACB → △DBC ≅ △ACB.
* But △DBC is contained in △ACB, so the lesser equals the greater,
* contradicting Common Notion 5. Therefore AB = AC.
*/
function deriveProp6Conclusion(
store: FactStore,
_state: ConstructionState,
atStep: number
): ProofFact[] {
const dpAB = distancePair('pt-A', 'pt-B')
const dpAC = distancePair('pt-A', 'pt-C')
// Single fact: AB = AC by reductio via I.4
return addFact(
store,
dpAB,
dpAC,
{ type: 'prop', propId: 4 },
'AB = AC',
'Reductio: BD = AC (I.3), BC = BC, ∠DBC = ∠ACB (given) → △DBC ≅ △ACB (I.4). But D is between A and B, so △DBC ⊂ △ACB — contradicting C.N.5. Therefore AB = AC.',
atStep
)
}
// ── Default positions ──
// A at apex, B and C at base. AB > AC for non-degenerate D.
const DEFAULT_A = { x: 0, y: 2.5 }
const DEFAULT_B = { x: -2, y: 0 }
const DEFAULT_C = { x: 1, y: 0 }
// ── Rotation angle and scale from vector AB to vector AC ──
// C = A + AC_RATIO * Rot(ROTATION_ANGLE) * (B − A)
// This preserves the triangle shape (apex angle + side ratio) during drag.
const vxDefault = DEFAULT_B.x - DEFAULT_A.x
const vyDefault = DEFAULT_B.y - DEFAULT_A.y
const wxDefault = DEFAULT_C.x - DEFAULT_A.x
const wyDefault = DEFAULT_C.y - DEFAULT_A.y
const abLen = Math.sqrt(vxDefault * vxDefault + vyDefault * vyDefault)
const acLen = Math.sqrt(wxDefault * wxDefault + wyDefault * wyDefault)
// Ratio |AC| / |AB| — always < 1, guaranteeing AB > AC
const AC_RATIO = acLen / abLen
const ROTATION_ANGLE = Math.atan2(
vxDefault * wyDefault - vyDefault * wxDefault,
vxDefault * wxDefault + vyDefault * wyDefault
)
/**
* Recompute all given elements from current draggable point positions.
* C is derived from A and B to maintain the apex angle and side ratio:
* C = A + AC_RATIO * Rot(ROTATION_ANGLE) · (B − A)
* This guarantees AB > AC always holds (needed for non-degenerate D).
*/
export function computeProp6GivenElements(
positions: Map<string, { x: number; y: number }>
): ConstructionElement[] {
const A = positions.get('pt-A') ?? DEFAULT_A
const B = positions.get('pt-B') ?? DEFAULT_B
// Derive C by rotating and scaling vector (B − A)
const vx = B.x - A.x
const vy = B.y - A.y
const cosR = Math.cos(ROTATION_ANGLE)
const sinR = Math.sin(ROTATION_ANGLE)
const C = {
x: A.x + AC_RATIO * (cosR * vx - sinR * vy),
y: A.y + AC_RATIO * (sinR * vx + cosR * vy),
}
return [
{ kind: 'point', id: 'pt-A', x: A.x, y: A.y, label: 'A', color: BYRNE.given, origin: 'given' },
{ kind: 'point', id: 'pt-B', x: B.x, y: B.y, label: 'B', color: BYRNE.given, origin: 'given' },
{ kind: 'point', id: 'pt-C', x: C.x, y: C.y, label: 'C', color: BYRNE.given, origin: 'given' },
{
kind: 'segment',
id: 'seg-AB',
fromId: 'pt-A',
toId: 'pt-B',
color: BYRNE.given,
origin: 'given',
},
{
kind: 'segment',
id: 'seg-AC',
fromId: 'pt-A',
toId: 'pt-C',
color: BYRNE.given,
origin: 'given',
},
{
kind: 'segment',
id: 'seg-BC',
fromId: 'pt-B',
toId: 'pt-C',
color: BYRNE.given,
origin: 'given',
},
] as ConstructionElement[]
}
/**
* Proposition I.6 — Converse of Pons Asinorum
*
* If in a triangle two angles equal one another, then the sides
* opposite the equal angles also equal one another.
*
* Given: Triangle ABC with ∠ABC = ∠ACB.
* To prove: AB = AC.
*
* Proof (by contradiction / reductio ad absurdum):
* Suppose AB ≠ AC. Then one is greater — let AB > AC.
* 0. Cut off DB from BA equal to AC (I.3)
* 1. Join D to C (Post.1)
*
* Now BD = AC, BC = BC, ∠DBC = ∠ACB (given).
* So △DBC ≅ △ACB by I.4 (SAS).
* But △DBC is part of △ACB, so the lesser equals the greater,
* which is absurd (C.N.5). Therefore AB = AC. Q.E.D.
*/
export const PROP_6: PropositionDef = {
id: 6,
title: 'If two angles of a triangle are equal, the sides opposite them are equal',
kind: 'theorem',
givenAngleFacts: [
{
left: { vertex: 'pt-B', ray1: 'pt-A', ray2: 'pt-C' },
right: { vertex: 'pt-C', ray1: 'pt-A', ray2: 'pt-B' },
statement: '∠ABC = ∠ACB',
},
],
givenAngles: [
{ spec: { vertex: 'pt-B', ray1End: 'pt-A', ray2End: 'pt-C' }, color: BYRNE.blue },
{ spec: { vertex: 'pt-C', ray1End: 'pt-A', ray2End: 'pt-B' }, color: BYRNE.blue },
],
equalAngles: [
[
{ vertex: 'pt-B', ray1End: 'pt-A', ray2End: 'pt-C' },
{ vertex: 'pt-C', ray1End: 'pt-A', ray2End: 'pt-B' },
],
],
theoremConclusion: 'AB = AC',
draggablePointIds: ['pt-A', 'pt-B'],
computeGivenElements: computeProp6GivenElements,
givenElements: [
{
kind: 'point',
id: 'pt-A',
x: DEFAULT_A.x,
y: DEFAULT_A.y,
label: 'A',
color: BYRNE.given,
origin: 'given',
},
{
kind: 'point',
id: 'pt-B',
x: DEFAULT_B.x,
y: DEFAULT_B.y,
label: 'B',
color: BYRNE.given,
origin: 'given',
},
{
kind: 'point',
id: 'pt-C',
x: DEFAULT_C.x,
y: DEFAULT_C.y,
label: 'C',
color: BYRNE.given,
origin: 'given',
},
{
kind: 'segment',
id: 'seg-AB',
fromId: 'pt-A',
toId: 'pt-B',
color: BYRNE.given,
origin: 'given',
},
{
kind: 'segment',
id: 'seg-AC',
fromId: 'pt-A',
toId: 'pt-C',
color: BYRNE.given,
origin: 'given',
},
{
kind: 'segment',
id: 'seg-BC',
fromId: 'pt-B',
toId: 'pt-C',
color: BYRNE.given,
origin: 'given',
},
] as ConstructionElement[],
steps: [
// 0. Cut off DB from BA equal to AC (I.3)
{
instruction: 'Cut off from {seg:BA} a part equal to {seg:AC} ({prop:3|I.3})',
expected: {
type: 'macro',
propId: 3,
inputPointIds: ['pt-B', 'pt-A', 'pt-A', 'pt-C'],
outputLabels: { result: 'D' },
},
highlightIds: ['pt-B', 'pt-A', 'pt-C'],
tool: 'macro',
citation: 'I.3',
},
// 1. Join D to C
{
instruction: 'Join {pt:D} to {pt:C}',
expected: { type: 'straightedge', fromId: 'pt-D', toId: 'pt-C' },
highlightIds: ['pt-D', 'pt-C'],
tool: 'straightedge',
citation: 'Post.1',
},
],
resultSegments: [
{ fromId: 'pt-A', toId: 'pt-B' },
{ fromId: 'pt-A', toId: 'pt-C' },
],
getTutorial: getProp6Tutorial,
explorationNarration: {
introSpeech:
"Euclid's first proof by contradiction! If the base angles are equal, the triangle must be isosceles. Together with Proposition I.5, this gives us a biconditional: a triangle is isosceles if and only if its base angles are equal. Try dragging the points to see the contradiction construction adapt.",
pointTips: [
{
pointId: 'pt-A',
speech:
'As you move the apex, the triangle changes shape — but the base angles stay equal, and the contradiction always works.',
},
{
pointId: 'pt-B',
speech:
'Watch how D adjusts along BA. It always lands between A and B because AB is always greater than AC.',
},
],
breakdownTip:
'AB must exceed AC for the contradiction to work — D needs to fall between A and B so that △DBC is properly contained in △ACB.',
},
deriveConclusion: deriveProp6Conclusion,
}
|