Skip to content

Commit c8e5a55

Browse files
proof(SafeAngle): DISCHARGE fromTo{Degrees,Radians}Roundtrip via Refl (proven#90) (#106)
Tenth "overly cautious OWED" discharge of today's [proven#90 Phase 3](#90) campaign. ## What it does \`\`\`idris public export fromToDegreesRoundtrip : (d : Double) -> toDegrees (fromDegrees d) = d fromToDegreesRoundtrip _ = Refl public export fromToRadiansRoundtrip : (r : Double) -> toRadians (fromRadians r) = r fromToRadiansRoundtrip _ = Refl \`\`\` ## Why it works Both proofs are unit-constructor pattern matches with no Double arithmetic: - \`fromDegrees d = MkAngle d Degrees\` (SafeAngle.idr L108-110) - \`toDegrees (MkAngle v Degrees) = v\` (first clause, L86) - Composition reduces by Refl The OWED's "Double-comparison opacity" blocker applies only to attempts to REDUCE \`d ?= d'\` for two different Doubles. Here the value passes through unchanged via constructor reduction; no Double arithmetic or comparison enters the proof. Refs #90 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8d4d45c commit c8e5a55

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/Proven/SafeAngle/Proofs.idr

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,20 @@ angleDifferenceIsRadians a b = Refl
217217
-- the residual debt is visible.
218218
--------------------------------------------------------------------------------
219219

220-
||| OWED: `fromDegrees` round-trips through `toDegrees`. Blocked on
221-
||| the absence of a numerical-equivalence tactic for `Double` literals
222-
||| in Idris2 0.8.0.
220+
||| DISCHARGED: `fromDegrees` round-trips through `toDegrees`.
221+
||| `fromDegrees d = MkAngle d Degrees` (SafeAngle.idr L108-110)
222+
||| then `toDegrees (MkAngle v Degrees) = v` (first clause, L86).
223+
||| No Double arithmetic enters — the `Degrees` unit constructor
224+
||| pattern-matches and the value passes through unchanged.
223225
public export
224-
0 fromToDegreesRoundtrip :
226+
fromToDegreesRoundtrip :
225227
(d : Double) -> toDegrees (fromDegrees d) = d
228+
fromToDegreesRoundtrip _ = Refl
226229

227-
||| OWED: `fromRadians` round-trips through `toRadians`. Same blocker
228-
||| as `fromToDegreesRoundtrip`.
230+
||| DISCHARGED: `fromRadians` round-trips through `toRadians`. Same
231+
||| structure as `fromToDegreesRoundtrip` — `fromRadians r = MkAngle r
232+
||| Radians` then `toRadians (MkAngle v Radians) = v` (first clause).
229233
public export
230-
0 fromToRadiansRoundtrip :
234+
fromToRadiansRoundtrip :
231235
(r : Double) -> toRadians (fromRadians r) = r
236+
fromToRadiansRoundtrip _ = Refl

0 commit comments

Comments
 (0)