code wiki / (root) / nx_unicode_math.nx

nx_unicode_math.nx source

↩ module page · 107 lines · 6215 B

1// nx_unicode_math.nx -- Unicode math symbol library, no LaTeX needed. 2// 3// Per user 2026-05-14: "ability to test actually using all the 4// algorithms in a notebook like fashion without needing latex or all 5// that but still having all the benefits of these other systems from 6// our ability to easily represent all the required symbols for even 7// the most advanced mathmatician". 8// 9// Each symbol is a UTF-8 sequence stored as a *u8 constant. Output 10// goes straight to stdout / browser without any LaTeX dependency. 11// 12// Symbol categories covered: 13// * logic forall, exists, not, and, or, implies, iff 14// * set theory empty, in, notin, subset, superset, union, intersect 15// * relations le, ge, neq, approx, equiv, propto 16// * operators sum, product, integral, partial, nabla, sqrt 17// * sets R (reals), C (complex), Z (integers), N (naturals), Q (rationals) 18// * arrows to, mapsto, leftarrow, leftrightarrow 19// * greek lowercase alpha..omega 20// * misc infinity, dagger, plus_minus 21 22// nx_safety_envelope: 23// intended_use: AUTO_APPLIED -- primitive-specific tuning queued 24// sil_target: SIL1 25// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail] 26// verdict: NOT_YET_EVALUATED 27 28import "nx_syscalls.nx" 29import "nx_runtime.nx" 30import "nx_tier.nx" 31 32// ===== Logic ======================================================== 33func nx_sym_forall() -> *u8 { return "\xE2\x88\x80" as *u8 } // ∀ 34func nx_sym_exists() -> *u8 { return "\xE2\x88\x83" as *u8 } // ∃ 35func nx_sym_not() -> *u8 { return "\xC2\xAC" as *u8 } // ¬ 36func nx_sym_and() -> *u8 { return "\xE2\x88\xA7" as *u8 } // ∧ 37func nx_sym_or() -> *u8 { return "\xE2\x88\xA8" as *u8 } // ∨ 38func nx_sym_implies() -> *u8 { return "\xE2\x87\x92" as *u8 } // ⇒ 39func nx_sym_iff() -> *u8 { return "\xE2\x87\x94" as *u8 } // ⇔ 40 41// ===== Set theory =================================================== 42func nx_sym_empty() -> *u8 { return "\xE2\x88\x85" as *u8 } // ∅ 43func nx_sym_in() -> *u8 { return "\xE2\x88\x88" as *u8 } // ∈ 44func nx_sym_notin() -> *u8 { return "\xE2\x88\x89" as *u8 } // ∉ 45func nx_sym_subset() -> *u8 { return "\xE2\x8A\x86" as *u8 } // ⊆ 46func nx_sym_superset() -> *u8 { return "\xE2\x8A\x87" as *u8 } // ⊇ 47func nx_sym_union() -> *u8 { return "\xE2\x88\xAA" as *u8 } // ∪ 48func nx_sym_intersect() -> *u8 { return "\xE2\x88\xA9" as *u8 } // ∩ 49 50// ===== Relations ==================================================== 51func nx_sym_le() -> *u8 { return "\xE2\x89\xA4" as *u8 } // ≤ 52func nx_sym_ge() -> *u8 { return "\xE2\x89\xA5" as *u8 } // ≥ 53func nx_sym_neq() -> *u8 { return "\xE2\x89\xA0" as *u8 } // ≠ 54func nx_sym_approx() -> *u8 { return "\xE2\x89\x88" as *u8 } // ≈ 55func nx_sym_equiv() -> *u8 { return "\xE2\x89\xA1" as *u8 } // ≡ 56func nx_sym_propto() -> *u8 { return "\xE2\x88\x9D" as *u8 } // ∝ 57 58// ===== Operators ==================================================== 59func nx_sym_sum() -> *u8 { return "\xE2\x88\x91" as *u8 } // ∑ 60func nx_sym_product() -> *u8 { return "\xE2\x88\x8F" as *u8 } // ∏ 61func nx_sym_integral() -> *u8 { return "\xE2\x88\xAB" as *u8 } // ∫ 62func nx_sym_partial() -> *u8 { return "\xE2\x88\x82" as *u8 } // ∂ 63func nx_sym_nabla() -> *u8 { return "\xE2\x88\x87" as *u8 } // ∇ 64func nx_sym_sqrt() -> *u8 { return "\xE2\x88\x9A" as *u8 } // √ 65func nx_sym_infinity() -> *u8 { return "\xE2\x88\x9E" as *u8 } // ∞ 66 67// ===== Number sets (blackboard bold) ================================ 68func nx_sym_reals() -> *u8 { return "\xE2\x84\x9D" as *u8 } // ℝ 69func nx_sym_complex() -> *u8 { return "\xE2\x84\x82" as *u8 } // ℂ 70func nx_sym_integers() -> *u8 { return "\xE2\x84\xA4" as *u8 } // ℤ 71func nx_sym_naturals() -> *u8 { return "\xE2\x84\x95" as *u8 } // ℕ 72func nx_sym_rationals() -> *u8 { return "\xE2\x84\x9A" as *u8 } // ℚ 73 74// ===== Arrows ======================================================= 75func nx_sym_to() -> *u8 { return "\xE2\x86\x92" as *u8 } // → 76func nx_sym_mapsto() -> *u8 { return "\xE2\x86\xA6" as *u8 } // ↦ 77func nx_sym_leftarrow() -> *u8 { return "\xE2\x86\x90" as *u8 } // ← 78 79// ===== Greek lowercase (subset most used in math) =================== 80func nx_sym_alpha() -> *u8 { return "\xCE\xB1" as *u8 } // α 81func nx_sym_beta() -> *u8 { return "\xCE\xB2" as *u8 } // β 82func nx_sym_gamma() -> *u8 { return "\xCE\xB3" as *u8 } // γ 83func nx_sym_delta() -> *u8 { return "\xCE\xB4" as *u8 } // δ 84func nx_sym_epsilon() -> *u8 { return "\xCE\xB5" as *u8 } // ε 85func nx_sym_theta() -> *u8 { return "\xCE\xB8" as *u8 } // θ 86func nx_sym_lambda() -> *u8 { return "\xCE\xBB" as *u8 } // λ 87func nx_sym_mu() -> *u8 { return "\xCE\xBC" as *u8 } // μ 88func nx_sym_pi() -> *u8 { return "\xCF\x80" as *u8 } // π 89func nx_sym_rho() -> *u8 { return "\xCF\x81" as *u8 } // ρ 90func nx_sym_sigma() -> *u8 { return "\xCF\x83" as *u8 } // σ 91func nx_sym_phi() -> *u8 { return "\xCF\x86" as *u8 } // φ 92func nx_sym_omega() -> *u8 { return "\xCF\x89" as *u8 } // ω 93 94// ===== Misc ========================================================= 95func nx_sym_plus_minus() -> *u8 { return "\xC2\xB1" as *u8 } // ± 96func nx_sym_times() -> *u8 { return "\xC3\x97" as *u8 } // × 97func nx_sym_divide() -> *u8 { return "\xC3\xB7" as *u8 } // ÷ 98func nx_sym_dot() -> *u8 { return "\xE2\x8B\x85" as *u8 } // ⋅ 99func nx_sym_degree() -> *u8 { return "\xC2\xB0" as *u8 } // ° 100 101// Total: 50 named math symbols. Combine with print() and print_i64() 102// for notebook-style output: e.g. 103// print(nx_sym_forall()); print(" x "); 104// print(nx_sym_in()); print(" "); 105// print(nx_sym_reals()); print(": x"); 106// print(nx_sym_ge()); print(" 0"); 107// renders as "∀ x ∈ ℝ: x ≥ 0" -- no LaTeX, no MathJax, pure UTF-8.