Arithmetic with H = -1: subtraction, negative numbers, division, rationals and mixed numbers

Thomas Colignatus
http://thomascool.eu
April 2 and May 23 2018

© Thomas Cool CC-BY-NC-ND

Abstract

H = -1 is an universal constant. H represents a half turn along a circle, like i represents a quarter turn. Kids know what it is to turn around and walk back along the same path. H creates the additive inverse with x + H x = 0 and the multiplicative inverse with x (x^H) = 1 for x ≠ 0. Pronounce H as “ehta” or “symbolic negative one”. The choice of H is well-considered: its shape reminds of -1 and even more (-1). Pierre van Hiele (1909-2010) already proposed to use y (x^(-1)) and drop the fraction bar y / x with its needless complexity. Students must learn exponents anyway. The negative exponent might confuse pupils to think that they must subtract something, but the use of an algebraic symbol clinches the proposal. Also 5/2 can be written as 2 + (2^H), so that it is clearer where it is on the number line. This approach also causes a re-evaluation of the didactics of the negative numbers. The US Common Core has them only in Grade 6 which is remarkably late. The negative numbers arise from the positive axis x by rotating or alternatively mirroring into H x. Algebraic thinking starts with the rules that a + H a can be replaced by 0 and that H H can be replaced by 1. Subtraction a - b ≥ 0 may be extended into a - b < 0 with its present didactics, e.g. 2 - 5 = 2 - (2 + 3) = 2 - 2 - 3 = 0 - 3 = -3, but there is an intermediate stage with familiar addition 2 + 5 H = 2 + (2 + 3) H = 2 + 2 H + 3 H = 0 + 3 H = 3 H, that does not require (i) the switch at the brackets from plus to minus and (ii) the transformation of binary 0 - 3 to number -3. The expression a - (-b) involves (scalar) multiplication which indicates why pupils find this hard, and a + H H b is clearer. The use of H would affect the whole curriculum. There appears to be a remarkable incoherence in mathematics education and its research w.r.t. the negative numbers, which reminds of the problems that the world itself had since the discovery of direction by Albert Girard in 1629 and the introduction of the number line by John Wallis in 1673. This notebook provides a package to support the use of H in Mathematica. The notebook and package are intended for researchers, teachers and (Common Core) educators in mathematics education. Pupils in elementary school would work with pencil and paper of course.

Keywords

mathematics education, kindergarten, elementary school, highschool, Common Core, H = -1, negative number, division, rational number, fraction, mixed number, power, exponent, Mathematica, Wolfram language, programming, package

MSC2010

97M70 Mathematics education. Behavioral and social sciences

Cloud

A version of this notebook with package is also available at (same link, major update of notebook and packages):

https://www.wolframcloud.com/objects/thomas-cool/MathEd/2018-04-02-Arithmetic-with-H.nb

http://community.wolfram.com/groups/-/m/t/1313302

https://zenodo.org/record/1241383 or DOI 10.5281/zenodo.1241383

Contents

. Introduction

. Overview on the inverses with H

. Didactics on the negative numbers

. Stages in didactics and properties of Mathematica

. Conclusions

. Stage 1. Kindergarten. Place value

. Stage 2. Grade 1 & 2. Addition and subtraction in the nonnegative realm

. Stage 3. Grade 2. Introduction of the negative integers, i.e. H

. Stage 4. Grade 2 & 3. Addition with H, outcomes still nonnegative

. Stage 5. Grade 3. Extension with a + H b = H c < 0

. Stage 6. Grade 3. Writing -c as alternative to H c

. Stage 7. Grade 4, 5, 6. Exponent H:  multiplicative inverse, rational number, mixed number

. Appendix A. More details on using Mathematica

. Appendix B. The routines

. Appendix C. Basic properties of the routines

. Appendix D. SimplifyH

. Appendix E. Mathematica: Rational[n, m] and n Power[m, -1]

. Appendix F. Lowest Common Denominator

. Appendix G. Terminology of mathematics by computer

. Literature

Start (subsection for the initialisation cells with the packages)

Tables of addition and subtraction without H

(*******************************************

Cool`MathEd`AdditionTable` package

*******************************************)
(* :Author: Thomas Cool*)
(* :Copyright: Copyright 2018 Thomas Cool*)
(* :Package Version: 3.0, March 31 and May 8 2018*)
(* :Mathematica Version:11.2*)
(* :Keywords:*)
(* :Limitation:*)
(* :License: see http://thomascool.eu/TheEconomicsPack/index.html*)

BeginPackage["Cool`MathEd`AdditionTable`"];

Unprotect[AdditionTable, BothMixedAdditionTables,BothSubtractionTables, MixedAdditionTable,  SquareTableOfAddition, SubtractionTable,  TableOfBasicAddition, TableOfBasicGrouping, ToSingleDigits, ToSingleDigitsTable];

AdditionTable::usage ="AdditionTable[n__Integer] gives a table that adds the integers, that must be positive, using the place value system. The integers are added per digit position, and each overflow generates a new line in the table\nAdditionTable[{n__Integer}] is another input format\nOptions are passed on to ToSingleDigitsTable. Default there is Differences -> True (default); otherwise levels\nWhen all integers are in [0, 9] then there is a warning that the routine is overly complex for such a case";

SubtractionTable::usage ="SubtractionTable[n, m] gives a table for n - m, for n > m > 0, using the place value system. The integers are subtracted per digit position, and each underflow generates a new line in the table. If n < m then the routine switches the order. When subtracting a block of numbers, perhaps first add the numbers that must be subtracted, so that subtraction only applies to n - m\nSubtractionTable[n__Integer] (for more than 2) or SubtractionTable[{n__Integer}] cannot switch the order though. Integers must be positive\nOptions are passed on to ToSingleDigitsTable. Default there is Differences -> True (default); otherwise levels\nWhen all integers are in [0, 9] then there is a warning that the routine is overly complex for such a case";

MixedAdditionTable::usage ="MixedAdditionTable[n__Integer] (for more than 2) or MixedAdditionTable[{n__Integer}] adds positive or negative integers. Options are passed on to ToSingleDigitsTable. Default there is Differences -> True (default); otherwise levels\nWhen all integers are in [0, 9] then there is a warning that the routine is overly complex for such a case";

BothMixedAdditionTables::usage = "BothMixedAdditionTables[n__Integer] or [{n__Integer}] jointly shows with Differences -> True and Differences -> False";

TableOfBasicAddition::usage = "TableOfBasicAddition[n:0, m:10] gives i + j in the range [n, m] for values Abs[i + j] <= Max[Abs[n], Abs[m]], and n and m may be negative. Elements x within the table show j = x - i. Options are passed on to Grid. This routine has the entry divider line correctly at the bottom";

(* no export

TableFormOfBasicAddition::usage = "TableOfBasicAddition[n:0, m:10] gives i + j in the range [n, m] for values Abs[i + j] <= Max[Abs[n], Abs[m]], and n and m may be negative. Elements x within the table show j = x - i. Options are passed on to TableForm. Unfortunately, the entry divider line is at the top";

SquareTableFormOfAddition::usage = "SquareTableFormOfAddition[n:0, m:10] gives the addition of i + j, both in the range [n, m], that may be negative. Elements x within the table show j = x - i. Options are passed on to TableForm";

*)

ToSingleDigitsTable::usage = "ToSingleDigitsTable[vec] decomposes the place value vector. Vec must have integers, and may be a list or a sequence.\nToSingleDigitsTable[\"Tested\", vec, table] complements the table, and then vec and table must be lists. The test is on the proper length of vec for the table (overflow digits). The routine is called by AdditionTable, SubtractionTable and MixedAdditionTable for completion, and its option setting controls their output. Default option is Differences -> True; otherwise levels";

ToSingleDigits::usage = "ToSingleDigits[vec] multiplies the elements with 10^pos, counting pos from 0 from right to left. Vec can be a list or a sequence of elements";

BothSubtractionTables::usage = "BothSubtractionTables[n__Integer] or [{n__Integer}] jointly shows with Differences -> True and Differences -> False";

TableOfBasicGrouping::usage = "TableOfBasicGrouping[n:0, m:10] gives i * j in the range [n, m] for values Abs[i + j] <= Max[Abs[n], Abs[m]], and n and m may be negative. Elements x within the table show j = x * i^(-1). Options are passed on to Grid. This routine has the entry divider line correctly at the bottom";

SquareTableOfAddition::usage = "SquareTableOfAddition[n:0, m:10] gives the addition of i + j, both in the range [n, m], that may be negative. Elements x within the table show j = x - i. Options are passed on to Grid. This display has the divider line at the bottom where it should be";

Begin["`Private`"];

SquareTableOfAddition[n_Integer:0, m_Integer:10, opts___Rule] := 
Module[{ran, tab, k, d},
ran = Range[n, m];
d = Table[False, {m-n }];
tab = 
Table[k= i+ j,
{j,m, n, -1}, {i, n,m}];
tab = Append[tab, ran];
tab = Prepend[Transpose[tab], Reverse[Prepend[ran, "+"]]] // Transpose;
Grid[tab, opts, Alignment -> {Right, Baseline}, Spacings -> {1.15, .5}, 
Dividers -> {{False, True} ~Join~ d, d ~Join~ {False, True}}]
]

TableOfBasicGrouping[n_Integer:0, m_Integer:10, opts___Rule] := 
Module[{ran, tab, k, d},
ran = Range[n, m];
d = Table[False, {m-n }];
tab = 
Table[k= i* j; 
If[Abs[k] ≤ Max[Abs[n] , Abs[m]], k, ""],
{j,m, n, -1}, {i, n,m}];
tab = Append[tab, ran];
tab = Prepend[Transpose[tab], Reverse[Prepend[ran, "×"]]] // Transpose;
Grid[tab, opts, Alignment -> {Right, Baseline}, Spacings -> {1.15, .5}, 
Dividers -> {{False, True} ~Join~ d, d ~Join~ {False, True}}]
]

(*perhaps leave opts for future passing on to TableForm ?*)

BothSubtractionTables[n__Integer, opts___Rule] :=
BothSubtractionTables[{n}, opts]

BothSubtractionTables[{n__Integer}, opts___Rule] :=
{{SubtractionTable[{n},  Differences -> True],"          ", SubtractionTable[{n},  Differences -> False]}}  // TableForm

ToSingleDigits[lis_List?VectorQ] := 
Module[{max, powers}, 
max = Length[lis];
powers = Table[10^x, {x,  max-1, 0, -1}];
lis . powers]

ToSingleDigits[x__] := ToSingleDigits[{x}]   (*not before the above*)

(* no export: See above 

SquareTableFormOfAddition[n_Integer:0, m_Integer:10, opts___Rule] := 
TableForm[
Table[k= i+ j,{j,m, n, -1}, {i, n,m}],opts, TableHeadings -> {Range[m, n, -1], Range[n, m]}, TableSpacing -> {1, 1.5}]

TableFormOfBasicAddition[n_Integer:0, m_Integer:10, opts___Rule] := 
TableForm[
Table[k= i+ j; If[Abs[k] ≤ Max[Abs[n] , Abs[m]], k, ""],  {j,m, n, -1}, {i, n,m}],opts, TableHeadings -> {Range[m, n, -1], Range[n, m]}, TableSpacing -> {1, 1.5}]

*)

TableOfBasicAddition[n_Integer:0, m_Integer:10, opts___Rule] := 
Module[{ran, tab, k, d},
ran = Range[n, m];
d = Table[False, {m-n }];
tab = 
Table[k= i+ j; 
If[Abs[k] ≤ Max[Abs[n] , Abs[m]], k, ""],
{j,m, n, -1}, {i, n,m}];
tab = Append[tab, ran];
tab = Prepend[Transpose[tab], Reverse[Prepend[ran, "+"]]] // Transpose;
Grid[tab, opts, Alignment -> {Right, Baseline}, Spacings -> {1.15, .5}, 
Dividers -> {{False, True} ~Join~ d, d ~Join~ {False, True}}]
]



AdditionTable::two= "Addition of `1` number ?";
AdditionTable::pos = "Numbers `1` must be positive";
AdditionTable::lss = "Numbers all less than 10: routine is overly complex";


AdditionTable[n__Integer, opts___Rule] :=
AdditionTable[{n}, opts]

AdditionTable[{n__Integer}, opts___Rule]  :=
Module[{nd, max, line, res, tab,  outcome,lis,m, sel, t},
lis = {n};
m = Length[lis];
If[m < 2, Message[AdditionTable::two, m]; Return[{n}]];
sel = Select[lis, # < 0&];
If[{} =!= sel,  Message[AdditionTable::pos, sel];Return[$Failed]];
If[And @@ (# < 10 &  /@  lis), Message[AdditionTable::lss]];
nd= IntegerDigits /@ lis;
outcome = IntegerDigits[Total[lis]];
max = Length[outcome];
tab= (t = #; While[Length[t] =!= max, PrependTo[t, 0]]; t)& /@ nd;
res = Total /@ Transpose[tab];
line = Table["+", {i, max}];
AppendTo[tab, line];
AppendTo[tab,  res];
ToSingleDigitsTable["Tested",res, tab, opts]]

(* used in the past
split = IntegerDigits[elem];
change = Drop[split, -1] ~Join~ {Last[split] - elem} ~Join~ rhs;
*)


SubtractionTable::two= "Subtraction of `1` number ?";
SubtractionTable::pos = "Numbers `1` must be positive";
SubtractionTable::ord = "Order switched into `1` - `2`";

SubtractionTable::lss = "Numbers all less than 10: routine is overly complex";


SubtractionTable[n_Integer, m_Integer, opts___Rule] :=
Module[{},
If[!(n > 0 && m > 0), Message[SubtractionTable::pos, {n, m}];Return[$Failed]];
If[And @@ (# < 10 &  /@  {m, n}), Message[SubtractionTable::lss]];
If[ n  ≥ m, SubtractionTable[True, n, m, opts],
Message[SubtractionTable::ord, m, n];
SubtractionTable[True, m, n, opts]]]


SubtractionTable[True, n_Integer, m_Integer, opts___Rule] :=
Module[{nd, md, max, line,  res, tab,  outcome},
outcome = IntegerDigits[n- m];
nd= IntegerDigits[n];
md = IntegerDigits[m];
max = Max[Length /@ {nd, md, outcome}];
line = Table["-", {i, max}];
While[Length[nd] =!= max, PrependTo[nd, 0]];
While[Length[md] =!= max, PrependTo[md, 0]];
res = nd - md;
tab = {nd, md, line, res};
(* largest minus smallest always generates a nonnegative outcome *)
ToSingleDigitsTable["Tested",res, tab, opts]]

(* at the most
If[MemberQ[digits, elem], 
change = {-1, 10} ~Join~ rhs;
*)

SubtractionTable[n__Integer, opts___Rule] :=
SubtractionTable[{n}, opts]

SubtractionTable[{n__Integer}, opts___Rule] :=
Module[{lis, m, sel, nd, max, line,  res, tab, outcome, difq, first, sign, t},
lis = {n};
m = Length[lis];
If[m < 2, Message[SubtractionTable::two, m]; Return[{n}]];
sel = Select[lis, # < 0&];
If[{} =!= sel,  Message[SubtractionTable::pos, sel];Return[$Failed]];
If[And @@ (# < 10 &  /@  lis), Message[SubtractionTable::lss]];
difq = Differences /. {opts} /.  Options[SubtractionTable];
first = First[lis];
res= Rest[lis];
outcome = first - Total[res];
sign= Sign[outcome];
max = Max[Append[Abs[lis], Abs[outcome]]]; (*maximal number involved*)
max = Length[IntegerDigits[max]];
nd= IntegerDigits /@ lis;
outcome = IntegerDigits[outcome];
tab= (t = #; While[Length[t] =!= max, PrependTo[t, 0]]; t)& /@ nd;
first = First[tab];
res = Rest[tab];
res = first -  (Total /@ Transpose[res]);
line = Table["-", {i, max}];
AppendTo[tab, line];
AppendTo[tab, res];
ToSingleDigitsTable["Tested",res, tab, opts]]


MixedAdditionTable::two= "Mixed addtion of `1` number ?";
MixedAdditionTable::lss = "Numbers all in [-9, 9]: routine is overly complex";


MixedAdditionTable[n__Integer, opts___Rule] :=
MixedAdditionTable[{n}, opts]

MixedAdditionTable[{n__Integer}, opts___Rule] :=
Module[{lis, m,  nd, max, line,  res,  tab,  outcome,  sign, t, signs},
lis = {n};
m = Length[lis];
If[m < 2, Message[MixedAdditionTable::two, m]; Return[{n}]];
If[And @@ (-10 < # < 10 &  /@  lis), Message[MixedAdditionTable::lss]];
outcome = Total[lis];
sign= Sign[outcome];
max = Max[Append[Abs[lis], Abs[outcome]]]; (*maximal number involved*)
max = Length[IntegerDigits[max]];
nd= IntegerDigits /@ lis;
signs = Sign /@ lis;
(* outcome = IntegerDigits[outcome];   no longer used: res *)
tab= (t = #; While[Length[t] =!= max, PrependTo[t, 0]];t)& /@ nd;
tab = tab signs;
res = Total /@ Transpose[tab];
line = Table["+", {i, max}];
AppendTo[tab, line];
AppendTo[tab, res];
ToSingleDigitsTable["Tested",res, tab, opts]]

(*perhaps leave opts for future passing on to TableForm ?*)

BothMixedAdditionTables[n__Integer, opts___Rule] :=
BothMixedAdditionTables[{n}, opts]

BothMixedAdditionTables[{n__Integer}, opts___Rule] :=

{{MixedAdditionTable[{n}],"          ", MixedAdditionTable[{n},  Differences -> False]}}  // TableForm


Options[ToSingleDigitsTable] = {Differences -> True};

ToSingleDigitsTable[{x__Integer},  opts___Rule] :=
Module[{outcome, max, res, t, nd, lis}, 
lis  = {x};
outcome = ToSingleDigits[lis];
nd = IntegerDigits[outcome];
max = Length[nd];
res = (t = #; While[Length[t] < max, PrependTo[t, 0]]; t)& [lis];
ToSingleDigitsTable["Tested", res, {res}, opts]]

ToSingleDigitsTable[x__Integer,  opts___Rule] :=
ToSingleDigitsTable[{x},  opts]

ToSingleDigitsTable["Tested", lis_List, tablis_List, opts___Rule] :=
Module[{pos, rhs, func, digits, elem, lineplus, change, k, res, tab, difq, max , sign, outcome},
difq = Differences /. {opts} /.  Options[ToSingleDigitsTable];
max = Length[lis]; (* when tested then max = Length[lis] *)
outcome = ToSingleDigits[lis];
sign = Sign[outcome];
lineplus = Table["+", {i, max}];
digits = Range[0, 9];
pos = max;
rhs = {};
res = lis;
tab = tablis;
(*Return[{res, tab, outcome, sign, max}];*)
Switch[sign , 0, "nothing", 1, func = Floor, -1, func = Ceiling; digits = -digits]; 
While[pos ≠ 0,
elem = res[[pos]];
If[!MemberQ[digits, elem], 
k =  func[elem/10];
change ={k, -10  k} ~Join~ rhs;
While[Length[change] =!= max, PrependTo[change, 0]];
res = res +  change;
If[difq === True, AppendTo[tab, change /. 0 -> ""], AppendTo[tab, res]]
]; (*endif*)
pos = pos - 1;
AppendTo[rhs, 0];
];  (*endwhile*)
If[difq === True, AppendTo[tab, lineplus]; AppendTo[tab, res]];
TableForm[tab, TableAlignments -> Right, TableHeadings -> {Automatic, Reverse[Table["10"^ToString[i], {i, 0, max-1}]]}]]

End[];

Protect[AdditionTable, BothMixedAdditionTables,BothSubtractionTables, MixedAdditionTable,  SquareTableOfAddition, SubtractionTable,  TableOfBasicAddition, TableOfBasicGrouping, ToSingleDigits, ToSingleDigitsTable];

EndPackage[];

Main package

(*******************************************

Cool`MathEd`H` package

*******************************************)
(* :Author: Thomas Cool*)
(* :Copyright: Copyright 2018 Thomas Cool*)
(* :Package Version: 2.1, March 31, April 29 and May 5 2018*)
(* :Mathematica Version: 11.2*)
(* :Keywords:*)
(* :Limitation:*)
(* :License: see http://thomascool.eu/TheEconomicsPack/index.html*)

BeginPackage["Cool`MathEd`H`" ];

Unprotect[above,AlgebraH,AlgebraHHelper,BothToH,FromH,H,HoldFirstH,TimesToH,TimesToHoldFormH,MixedNumberH,NH,PowerHeadToH,PowerHToMixedNumber,PowerToRational,RationalInactive,RuleAlgebraH,RuleTimesToH,RulePowerHeadToH,RulePowerHToMixedNumber,RulePowerToRational,SimplifyH,ToH, RuleAnyToH, RuleHToZero, HToZero, SortH, IntegerLineH, ExpressionHQ, IntegerLineHQ, IntegerHQ,RuleNegativeToH, MinusSignIntegerQ, RuleMinusSignToH , MinusSignToH, FlattenTimesH, TextReflect, TextRotate, PowerToH];

H::usage="H is the universal constant with value -1. Pronounce as \"eta\" or \"symbolic negative one (or unit)\". It represents a half turn along a circle, compared to the complex number I that gives a quarter turn. It is unevaluated and used symbolically like in 5 / 2 = 2 + 2^H. For evaluation, see symbolic FromH and numeric NH. See also TimesToH and ToH";


FromH::usage="FromH[expr] replaces H by -1";

NH::usage="NH[expr (, n)] is N[FromH[expr] (, n)]";

ToH::usage="ToH[expr] checks whether some elements can be turned into a Rational number with a MixedNumber format, then turns all Power[x, -1] expressions into x^H. It has property HoldFirst, applies the replacement routines to the unevaluated expression, and then has ReleaseHold. ToH works like a \"PowerToH\" (deliberately not defined here), and internally handles RationalToH and PowerHeadToH";

RationalInactive::usage="RationalInactive[expr] puts all Rational[x, y] in expr into Inactive[Plus][IntegerPart[expr], FractionalPart[expr]]";

MixedNumberH::usage="MixedNumberH[expr] puts all Rational[n, m] or n Power[m, -1] in expr into IntegerPart[expr] + ToH[FractionalPart[expr]]\nMixedNumberH[x_Rational] is a helper routine\nMixedNumberH[\"Example\"] gives an example comparison of using H and the fraction bar";

RulePowerHeadToH::usage="Power[x, -y] :> Power[x, H y]";

PowerHeadToH::usage = "PowerHeadToH[expr] applies RulePowerHeadToH, with FoldFirst and then ReleaseHold. It does not check on a MixedNumber format: see ToH. The former name of this routine was PowerToH, but this was better renamed to discourage its use. One better uses ToH";

RulePowerToRational::usage = "n m^-1 :> Rational[n, m]";


PowerToRational::usage="PowerToRational[expr] turns n m^-1 into Rational[n, m] by applying RulePowerToRational, with HoldFirst and then ReleaseHold";

RulePowerHToMixedNumber ::usage = "Rule to turn n Power[m, H] into a mixed number form";

PowerHToMixedNumber::usage="PowerHToMixedNumber[expr] turns n m^H into a mixed number form";

RuleAlgebraH::usage="RuleAlgebraH gives algebraic rules that tend to keep H. Used in AlgebraH[expr]";

RuleTimesToH::usage="Rule(s) for -x :> H x";

TimesToH::usage="TimesToH[expr] replaces variables -x by H x. Has HoldFirst, applies RuleTimesToH, and then ReleaseHold. For the negative integers use RuleNegativeToH, though this might affect Power[x, -1] too";

AlgebraH::usage="AlgebraH[expr] applies RuleAlgebraH to expr repeatedly, which is algebraic and tends to keep H. With HoldFirst and then ReleaseHold. Use FromH[expr] to fully eliminate H\nAlgebraH[HoldForm[expr]] calls AlgebraHHelper[HoldForm[expr]], applies RuleAlgebraH repeatedly, and calls ReleaseHold";

above::usage = "above is the same as % or Out[$Line - 1]. It seems clearer for education. Most routines in the MathEd`H` package have HoldFirst, but recognise a func[above] case and then change to func[Evaluate[above]]";

BothToH::usage = "BothToH[expr] is TimesToH[ToH[expr]], with HoldFirst. The idea is that education proceeds in steps, such that TimesToH is important first, BothToH intermediately, and later only ToH";

SimplifyH::usage = "SimplifyH[expr, f:ToH] is f[Evaluate[Simplify[FromH[expr]]]]";

TimesToHoldFormH::usage = "TimesToHoldFormH is TimesToH with HoldForm and not ReleaseHold. It transforms a - (-b) into HoldForm[a + b H H]";

AlgebraHHelper::usage = "AlgebraHHelper[HoldForm[... H * H ....]] for replacement of H H -> 1 without the occurrence of H^2 from ReleaseHold. See e.g. TimesToHoldFormH[a - (-b)]. AlgebraHHelper does not apply ReleaseHold. The routine is called by AlgebraH when it spots a HoldForm";

HoldFirstH::usage = "HoldFirstH[Set] (default) sets the Attribute HoldFirst for the main routines AlgebraH, TimesToH, ToH and BothToH\nHoldFirstH[Clear] clears again (not affecting this property for the subroutines that are called from the main ones). When Cleared, input might require HoldForm[expr]";

RuleAnyToH::usage = "RuleAnyToH replaces -1 by H, using only -1 -> H. This substitutes indiscriminately but leaves -2, -3, ... unaffected. See TimesToH and ToH for particular patterns (not using Inactive), and RuleMinusSignToH for the negative integers";

RuleHToZero::usage = "RuleHToZero applies x + H x -> 0";

HToZero::usage = "HToZero[expr, s:SortH] applies x + H x -> 0, with some steps shown in MatrixForm. If necessary it applies a ReleaseHold to collect all terms first. It plits x + H y into\neither (a + y + H y) -> a, for x = a + y\nor (x + H x + H b) -> b, for y = x + b,\ndepending upon which is larger, and puts this expression into HoldForm. Each line has s applied to it, default SortH";

SortH::usage = "SortH[expr] sorts Lists using the values of FromH, and sorts Plus in canonical order so that we get 2 + 2^H";

IntegerLineH::usage ="IntegerLineH[n, m] gives a list of integers, from n to the left of 0, to m to right of 0. Input of negative numbers like -n and -m is allowed\nIntegerLineH[n] is IntegerLineH[n, n]";

IntegerLineHQ::usage ="IntegerLineHQ[expr] tests whether expr strictly would be on the IntegerLineH, thus with expr one of ..., 2 H, H, 0, 1, 2, ...";

ExpressionHQ::usage = "ExpressionHQ[expr] tests whether H occurs in expr";

IntegerHQ::usage = "IntegerHQ[expr] is IntegerQ[expr] || IntegerLineHQ[expr], thus allowing integers with the minus sign and H, with the leniency of allowing also for -x with symbolic x (assumed to be an integer)";

FlattenTimesH::usage = "FlattenTimesH[expr] turns H (n H) into n H H, in Holdform, avoiding H^2";

MinusSignIntegerQ::usage = "MinusSignIntegerQ[x] is IntegerQ[x] && Negative[x]";

RuleNegativeToH::usage = "RuleNegativeToH is (x_?Negative :> - H x). Observe that it also affects Power[x, -1], which might not be intended";

RuleMinusSignToH ::usage = "RuleMinusSignToH replaces negative integers x by -H x. Thus this also replaces -1 by H. Variable -b has form Times[-1, b] and then will also be replaced by H b. See RuleAnyToH that does not recognise the negative numbers -2, -3, -4, ... See RuleNegativeToH that also replaces negative reals and whole expressions";

MinusSignToH::usage = "MinusSignToH[expr] applies RuleMinusSignToH, has HoldFirst, and leaves the result into HoldForm. The occurence of H (H n) is turned into n H H instead of n H^2";

TextReflect::usage = "TextReflect[string] shows string in reflection\nTextReflect[n] shows the list of integers 0, ..., n (standing for the number line) reflected around 0\nTextReflect[s, m:1.2, w:12, h:12, opts] is the full call, with Magnification -> m, FontSize -> w, and ImageSize height UpTo[m h]. Options are passed onto BaseStyle of Graphics object Text, e.g. FontFamily";

TextRotate::usage = "TextRotate[theta:(1/2)][string] shows string in rotation by theta * 2 Pi\nTextRotate[theta:(1/2)][n] shows the list of integers 0, ..., n (standing for the number line) rotated around 0\nTextRotate[theta:Pi][s, m:1.0, w:12, h:12, opts] is the full call, with Magnification -> m, FontSize -> w, and ImageSize height UpTo[m h]. Options are passed onto BaseStyle of Graphics object Text, e.g. FontFamily";

PowerToH::usage = "PowerToH is deliberately undefined. It tends to be a confusing term. Use either PowerHeadToH for only Power[expr, -1] or ToH for inclusion of Rational (mixed number)";

ShowInversesH::usage ="ShowInversesH[n] plots a number line with curved arrows from n to n H and n^H\nShowInversesH[H, n] gives the arrow for n H\nShowInversesH[Inverse, n] gives the curved arrow for the multiplicative inverse\nShowInversesH[Ticks, n] gives the legend under the number line";

Begin["`Private`"];

ShowInversesH[H,n_Integer, eps_:0] := 
Module[{p, qh},
p = {n, eps}; qh = {-n, eps}; 
Graphics[{ 
 Arrow[BezierCurve[{p, (p+qh)/2 +  {0, 2}, qh}]]
 }] ]

ShowInversesH[Inverse,n_Integer, eps_:0] := 
Module[{p, qi},
p = {n, eps}; qi = {1/n, eps};
Graphics[{ 
Arrow[BezierCurve[{p, (p+qi)/3 +  {0, 1}, qi }]]
 }] ]

ShowInversesH[Ticks, n_Integer, off_:1.5] := 
Graphics[{
Join[
{ Text[(n^H), {n^-1, 0}, {0, off}] },
Table[Style[Text[i H, {-i, 0}, {0,off} ], "Italic"],  {i, n, 1, -1}], 
Table[Text[ToString[i] , {i, 0}, {0,off} ],  {i, 0, n}]] }]

ShowInversesH[n_Integer, opts___Rule] := 
Show[
{ShowInversesH[H, n], ShowInversesH[Inverse, n],ShowInversesH[Ticks, n]}, opts, Axes -> {True, False},  Ticks -> False, PlotRange -> {-.3, 1.2}, BaseStyle -> {FontSize -> 12}]

(*assume Print FontSize 10, so now a bit larger at 10.5*)

TextRotate[theta_:(1/2)][n_Integer, r___] := 
{TextRotate[theta][nobracket[Range[1, n]], r], nobracket[Range[0, n]]}

TextRotate[theta_:(1/2)][x_String, m:(_?NumberQ):1.0, w_Integer:10.5, h_Integer:10.5, opts___Rule  ]:= 
Module[{n, g}, n = StringLength[x];
g  = Graphics[{Text[Style[x, Magnification  ->  m], BaseStyle -> {opts, FontSize -> w,  FontFamily -> "Times"}]} ,ImageSize-> {UpTo[Round[w n m]], UpTo[Round[m h]]}];
Rotate[g, 2 Pi theta]]

nobracket[s_] := StringDrop[StringDrop[ToString[s], 1], -1]

TextReflect[n_Integer, r___] := 
{TextReflect[nobracket[Range[1, n]], r], nobracket[Range[0, n]]}

TextReflect[x_String, m:(_?NumberQ):1.2, w_Integer:10.5, h_Integer:10.5, opts___Rule  ]:= 
Module[{n, g}, n = StringLength[x];
g  = Graphics[{Text[Style[x, Magnification  ->  m], BaseStyle -> {opts, FontSize -> w,  FontFamily -> "Times"}]} ,ImageSize-> {UpTo[Round[w n m]], UpTo[Round[m h]]}];
ImageReflect[g, Left]]



MinusSignIntegerQ[x_] := IntegerQ[x] && Negative[x]

RuleMinusSignToH :={x_?MinusSignIntegerQ :> With[{eval = - H x}, eval/; True]}

SetAttributes[MinusSignToH, HoldFirst]

MinusSignToH[above] := MinusSignToH[Evaluate[above]]

MinusSignToH[HoldForm[expr_]] := MinusSignToH[expr]

MinusSignToH[x_]:= 
(alreadyH[Hold[x]];
FlattenTimesH[Replace[HoldForm[x], RuleMinusSignToH, Infinity]])

(*Flatten does not work:
TimesToHoldFormH[x_]:= Flatten[HoldForm[x]//.RuleTimesToH, 1, Times]
  Directly using Times in pattern does not work, so replace with Tms
*)

FlattenTimesH[expr_] :=
Module[{res, Tms},  
res  = expr/. Times -> Tms;
res = res //. Tms[x___, Tms[y___], z___]  :> 
With[{eval = Sort[Tms[x, y, z] ]}, eval/; True];
res =  res /. Tms[x___, 1, z___]  :> 
With[{eval = Tms[x, z] }, eval/; True];
res =  res //. Tms[x___]  :> 
With[{eval = Tms[x] /.  {Tms[] -> 1, Tms[u_] :>  u}}, eval/; True];
res /. Tms -> Times]



lis1 = {HoldForm[(2 + 2*3^H) + (3 + 4*5^H)], HoldForm[5 + 2*3^H + 4*5^H], 
    HoldForm[5 + 2*5*5^H*3^H + 4*3*3^H*5^H], HoldForm[5 + 10*15^H + 12*15^H], 
    HoldForm[5 + 22*15^H], HoldForm[5 + (15 + 7)*15^H], HoldForm[6 + 7*15^H]} /. H -> Style[H, Italic];

lis2 = {HoldForm[(2 + 2/3) + (3 + 4/5)
     ], HoldForm[ 5 + 2/3 + 4/5
     ], HoldForm[ 5 + (5 2)/(5 3) + (3 4)/(3 5)
     ], HoldForm[ 5 + 10/15 + 12/15 ], 
   HoldForm[ 5 + 22/15],
   HoldForm[ 5 + 15/15 + 7/15 ], 
    HoldForm[6 + 7/15]} ;

MixedNumberH["Example"] := TableForm[{lis1, lis2} // Transpose, 
TableSpacing -> {1.5, 7}, TableHeadings ->  {Automatic, {"Using H", "Fraction bar"}}]

IntegerHQ[Times[H, n_Symbol]] := True
IntegerHQ[Times[-1, n_Symbol]] := True

IntegerHQ[n_] := Or[IntegerQ[n],IntegerLineHQ[n]]

IntegerLineH[n_Integer, m_Integer] := (Range[-n, m] /. RuleNegativeToH)

IntegerLineH[n_Integer] :=  IntegerLineH[n, n]

IntegerLineHQ[0] = True;
IntegerLineHQ[H] = True;
IntegerLineHQ[n_Integer] := Positive[n];
IntegerLineHQ[Times[H, n_Integer]] := Positive[n];
IntegerLineHQ[n__] := False;

ExpressionHQ[expr_] := (Position[expr, H] =!= {})

ExpressionHQ::H = "Warning: expression already contains H";

(*not exported*)

alreadyH[expr_] := If[ExpressionHQ[expr] === True, Message[ExpressionHQ::H ]]

(*SortHRule not exported, SortH HoldFirst but not in HoldFirstH*)

SetAttributes[SortH, HoldFirst];

SortHRule[head_, sort_] := (x_head :> With[{eval = sort[x]}, eval/; True])

SortH[above] := SortH[Evaluate[above]]

SortH[expr_] := Module[{res},
  res = HoldForm[expr] /.  SortHRule[List, SortBy[FromH]];
((res /. Plus -> MyList) /. SortHRule[MyList, Sort]) /. MyList -> Plus
] /. HoldForm[HoldForm[x_]] :> HoldForm[x]

ahum[x_Integer, y_Integer] := If[x === y, 0, If[x > y, x - y, H (y-x)]]

(* does not work
RuleHToZero := ((x_Integer + H y_Integer) :> Evaluate[ahum[x, y]])

See Pillsy 2010: https://stackoverflow.com/questions/3136604/evaluate-beyond-one-level-within-hold-in-mathematica
*)

RuleHToZero := {(x_ + H x_) :> 0,
(x_Integer + H ) :> With[{eval = ahum[x, 1]}, eval/; True],
(x_Integer + H y_Integer) :> With[{eval = ahum[x, y]}, eval/; True]}

(* Helper not exported *)

RuleHToZeroHelper1[x_Integer, y_Integer] := If[x === y, 0,
Module[{str},
str = "{x + y H, HoldForm[c + b + a],  e}";
str = StringReplace[str, "x" -> ToString[x]];
str = StringReplace[str, "y" -> ToString[y]];
If[x > y,
str = StringReplace[str, "a" -> ToString[x - y]];
str = StringReplace[str, "e" -> ToString[x - y]];
str = StringReplace[str, "b" -> ToString[y]];
str = StringReplace[str, "c" -> ToString[H y]],
(*else x < y *)
str = StringReplace[str, "a" -> ToString[x]];
str = StringReplace[str, "b" -> ToString[H x]];
str = StringReplace[str, "c" -> ToString[H (y-x)]];
str = StringReplace[str, "e" -> ToString[H (y-x)]]
]; (*endif*)
ToExpression[str]]]

RuleHToZeroHelper2 := {
(x_Integer + H ) :> RuleHToZeroHelper1[x, 1],
(x_Integer + H y_Integer) :> RuleHToZeroHelper1[x, y]}

HToZero[expr_, s_:SortH] :=  Module[{h}, 
h= ReleaseHold[expr] ;
h = If[IntegerHQ[h], {h}, h/. RuleHToZeroHelper2];
If[Head[expr] === HoldForm, PrependTo[h, expr]];
h = s /@ h;
h // MatrixForm]

RuleAnyToH := (-1 -> H)

HoldFirstH[Set] := {
SetAttributes[AlgebraH, HoldFirst];AlgebraH,
SetAttributes[TimesToH, HoldFirst]; TimesToH, 
SetAttributes[ToH,HoldFirst];ToH, 
SetAttributes[BothToH, HoldFirst]; BothToH}

HoldFirstH[Clear] := {
ClearAttributes[AlgebraH, HoldFirst];AlgebraH,
ClearAttributes[TimesToH, HoldFirst];TimesToH, 
ClearAttributes[ToH,HoldFirst];ToH, 
ClearAttributes[BothToH, HoldFirst]; BothToH}

SimplifyH[x_, f_Symbol:ToH] := f[Evaluate[Simplify[FromH[x]]]]


above := Out[$Line-1]

SetAttributes[BothToH, HoldFirst];

BothToH[above] := BothToH[Evaluate[above]]

BothToH[expr_] :=
Module[{gr},
alreadyH[expr];
Off[ExpressionHQ::H ];
(*better in steps*)
gr = ToH[expr];
gr =  TimesToH[Evaluate[gr]];
On[ExpressionHQ::H ];
gr]

RuleAlgebraH={H + 1 -> 0, 
HoldPattern[H H]->1, H^2 -> 1,
H^H->H, 0^H  -> Indeterminate,
HoldPattern[(Global`x_ )(Global`x_^H)] :> 1,
(Global`x_)^(H+1) :> 1,
(Global`x_^H)^H:> Global`x,
(Global`y__ Global`x_)^H :> ((Global`y)^H  Global`x^H)
};

SetAttributes[AlgebraH, HoldFirst];

AlgebraH[above] := AlgebraH[Evaluate[above]]

AlgebraH[HoldForm[x_]] := 
 ReleaseHold[AlgebraHHelper[HoldForm[x]] //. RuleAlgebraH]

AlgebraH[x_]:= ReleaseHold[Hold[x]//.RuleAlgebraH]


(* inserting RuleTimesToH somewhat protects when the next is called with //. *)

RuleNegativeToH := RuleTimesToH  ~Join~
                { x_?Negative :> With[{eval = - H x}, eval/; True]}


(************* TimesToH **************)

(* do not use this
RuleTimesToH := {Times[-1,b_] :> With[{eval =  Times[H,b]}, eval/; True]}
*)

RuleTimesToH :={Times[-1,b_]:>Times[H,b]};


SetAttributes[TimesToH, HoldFirst]

TimesToH[above] := TimesToH[Evaluate[above]]

TimesToH[HoldForm[expr_]] := TimesToH[expr]

TimesToH[x_]:= 
(alreadyH[Hold[x]];
ReleaseHold[Hold[x] //.RuleTimesToH])

(************* TimesToHoldH **************)


SetAttributes[TimesToHoldFormH, HoldFirst]

TimesToHoldFormH[above] := TimesToHoldFormH[Evaluate[above]]

TimesToHoldFormH[expr_]:= 
 Module[{res}, 
alreadyH[res];
res = HoldForm[expr];
res = res//.RuleTimesToH;
FlattenTimesH[res]]


AlgebraHHelper[gr_HoldForm] := ((((gr /. Times -> Tms) /. Tms[x___, H, y___, H, z___] :>  Tms[x, y, z])  /. {Tms[] -> 1, Tms[u_] :>  u}) /. Tms -> Times)

FromH[x_]:=x/.H->-1

(************ Mixed Number *************)

MixedNumberH[x_Rational,Rational]:=IntegerPart[x]+(FractionalPart[x]/.(Rational[a_,b_]:>(a b^H)))

MixedNumberH[x_Rational]:=MixedNumberH[x,Rational]

SetAttributes[MixedNumberH, HoldFirst];

MixedNumberH[above] := MixedNumberH[Evaluate[above]]

(* NoReleaseMixedNumberH not exported *)

NoReleaseMixedNumberH[Hold[expr_]] := 
(alreadyH[Hold[expr]];
(((Hold[expr] /. RulePowerToRational) /. RuleTimesRational)/.y_Rational->MixedNumberH[y,Rational]))

MixedNumberH[x_]:= ReleaseHold[NoReleaseMixedNumberH[Hold[x]]]


RulePowerHeadToH := (Power[a_, b_] :> 
Module[{c},c=FromH[b];If[c<0,a^(H (-b)),a^b]])

SetAttributes[PowerHeadToH, HoldFirst];

PowerHeadToH[above] := PowerHeadToH[Evaluate[above]]

PowerHeadToH[x_]  := ReleaseHold[Hold[x] /. RulePowerHeadToH]

RulePowerToRational := (Times[w___,n_Integer,y___, Power[m_Integer,-1],z___]:>Times[w, y,Rational[n,m],z])

(* not exported*)

RuleTimesRational := (Times[Rational[a_, b_]] :> Rational[a, b])

SetAttributes[PowerToRational, HoldFirst];

PowerToRational[above] := PowerToRational[Evaluate[above]]

PowerToRational[x_]:= ReleaseHold[Hold[x]/. RulePowerToRational ]

RulePowerHToMixedNumber := 
Times[w___,n_Integer,y___,Power[m_Integer,H],z___]:>Times[w, y,MixedNumberH[Rational[n,m],Rational],z]

PowerHToMixedNumber[x_]:=x/. RulePowerHToMixedNumber 


SetAttributes[ToH,HoldFirst];

ToH[above] := ToH[Evaluate[above]]

ToH[HoldForm[expr_]] := ToH[expr]

ToH[x_]:= ReleaseHold[NoReleaseMixedNumberH[Hold[x]]/.RulePowerHeadToH]

NH[x_,y___]:=N[FromH[x],y]

RationalInactive[x_Rational,Inactive]:=Module[{h,f,intpart},intpart=IntegerPart[x];
If[intpart===0,x,Inactive[Plus][h,f]/.{h->intpart,f->FractionalPart[x]}]]

RationalInactive[x_]:=x/.y_Rational->RationalInactive[y,Inactive]


End[];

Protect[above,AlgebraH,AlgebraHHelper,BothToH,FromH,H,HoldFirstH,TimesToH,TimesToHoldFormH,MixedNumberH,NH,PowerHeadToH,PowerHToMixedNumber,PowerToRational,RationalInactive,RuleAlgebraH,RuleTimesToH,RulePowerHeadToH,RulePowerHToMixedNumber,RulePowerToRational,SimplifyH,ToH, RuleAnyToH, RuleHToZero, HToZero, SortH, IntegerLineH, ExpressionHQ, IntegerLineHQ, IntegerHQ, RuleNegativeToH, MinusSignIntegerQ, RuleMinusSignToH , MinusSignToH, FlattenTimesH, TextReflect,TextRotate,PowerToH];

EndPackage[];

Tables of addition and subtraction with H

(*******************************************

Cool`MathEd`AdditionTableH` package

*******************************************)
(* :Author: Thomas Cool*)
(* :Copyright: Copyright 2018 Thomas Cool*)
(* :Package Version:1.2, May 8 2018*)
(* :Mathematica Version:11.2*)
(* :Keywords:*)
(* :Limitation:*)
(* :License: see http://thomascool.eu/TheEconomicsPack/index.html*)

BeginPackage["Cool`MathEd`AdditionTableH`", {"Cool`MathEd`H`", "Cool`MathEd`AdditionTable`"}];

Unprotect[AdditionTableH, BothMixedAdditionTablesH,SubtractionTableH, MixedAdditionTableH,    TableOfBasicAdditionH, ToSingleDigitsTableH];


AdditionTableH::usage ="AdditionTableH[n__Integer] is AdditionTable[n] with display of -10 replaced by 10 H\nAdditionTableH[{n__Integer}] works also";

SubtractionTableH::usage ="SubtractionTableH[n__Integer] is SubtractionTable[n] with display of -10 replaced by 10 H\nSubtractionTableH[{n__Integer}] works also";

MixedAdditionTableH::usage ="MixedAdditionTableH[n__?IntegerHQ] is MixedAdditionTable[n] with display of -x replaced by x H\nMixedAdditionTableH[{n__?IntegerHQ}] works aloso";

ToSingleDigitsTableH::usage =  "ToSingleDigitsTableH[n__?IntegerHQ] is ToSingleDigitsTable[n] with display of -x replaced by x H\nToSingleDigitsTableH[{n__?IntegerHQ}] works also";

BothMixedAdditionTablesH::usage = "BothMixedAdditionTablesH[n__Integer] or [{n__Integer}] jointly shows with Differences -> True and Differences -> False";

TableOfBasicAdditionH::usage = "TableOfBasicAdditionH[n:-10, m:10] gives i + j in the range [n, m] for values Abs[i + j] <= Max[Abs[n], Abs[m]], presenting negative numbers with H, while n and m may be negative. Elements x within the table show j = x - i. Options are passed on to Grid. This routine has the entry divider line correctly at the bottom";

Begin["`Private`"];

TableOfBasicAdditionH[x:(_?IntegerHQ):-10, y:(_?IntegerHQ):10, opts___Rule] :=
Module[{xs, ys, s},
{xs, ys} = {x, y} /. H -> -1;
s = Abs[xs] + Abs[ys];
s = If[s < 12, {1.2, .5},{.8, .5}];
TableOfBasicAddition[xs, ys, opts, 
Spacings -> s]] /. RuleMinusSignToH


ToSingleDigitsTableH[x__?IntegerHQ, opts___Rule] :=
ToSingleDigitsTable[{x} /. H -> -1, opts] /. RuleMinusSignToH

ToSingleDigitsTableH[{x__?IntegerHQ}, opts___Rule] :=
ToSingleDigitsTable[{x} /. H -> -1, opts] /. RuleMinusSignToH

AdditionTableH[n__Integer, opts___Rule] :=
AdditionTableH[{n}, opts]

AdditionTableH[{n__Integer}, opts___Rule]  := 
AdditionTable[{n}, opts] /. RuleMinusSignToH

SubtractionTableH[n__Integer, opts___Rule] :=
SubtractionTableH[{n}, opts]

SubtractionTableH[{n__Integer}, opts___Rule] :=
SubtractionTable[{n}, opts] /. RuleMinusSignToH

MixedAdditionTableH::pls = "Input has been summed. Use commas for separate terms";

MixedAdditionTableH[Plus[n__], opts___Rule] :=
Module[{lis}, lis = Flatten[ {n} /. Plus -> List];  (*module with this curious construction to prevent Mathematica recursion*)
Message[MixedAdditionTableH::pls];
MixedAdditionTableH[lis, opts]]

MixedAdditionTableH[n__?IntegerHQ, opts___Rule] :=
MixedAdditionTableH[{n}, opts]

MixedAdditionTableH[{n__?IntegerHQ}, opts___Rule]  := 
MixedAdditionTable[{n}/. H -> -1, opts] /. RuleMinusSignToH

(* leave opts for potential passing on to TableForm ? *)

BothMixedAdditionTablesH[n__?IntegerHQ, opts___Rule] :=
BothMixedAdditionTablesH[{n}, opts]

BothMixedAdditionTablesH[{n__?IntegerHQ}, opts___Rule]  := 
BothMixedAdditionTables[{n}/. H -> -1, opts] /. RuleMinusSignToH


End[];

Protect[AdditionTableH, BothMixedAdditionTablesH,SubtractionTableH, MixedAdditionTableH,    TableOfBasicAdditionH, ToSingleDigitsTableH];


EndPackage[];

Pronunciation of the integers with full use of the place value system

(*******************************************

Cool`MathEd`PronounceInteger` package

*******************************************)
(* :Author: Thomas Cool*)
(* :Copyright: Copyright 2018 Thomas Cool*)
(* :Package Version:2.0, May 17 2018*)
(* :Mathematica Version:11.2*)
(* :Keywords:*)
(* :Limitation:*)
(* :License: see http://thomascool.eu/TheEconomicsPack/index.html*)

BeginPackage["Cool`MathEd`PronounceInteger`", {"Cool`MathEd`H`"}];

Unprotect[PlaceValue, PlaceValueH,PronounceIntegers, SpeakTransliteration,PlaceValueBlock, PlaceValueDigits, PlaceValueDigits$Language,PronounceIntegerReadMe, PronounceInteger, PartialPlaceValue, PlaceValueTable];

LatestPronunciation::usage = "LatestPronunciation[] contains what a routine in the MathEd`PronounceInteger` package could have spoken (but perhaps suppressed by an option choice not to speak)";

PronounceIntegerReadMe::usage  = "PronounceIntegerReadMe[] explains the package";

PronounceIntegerReadMe[]= 
"Mathematica already provides for (i) IntegerName[n, \"language\"], (ii) IntegerName[n, \"DigitsWords\"] for blocks of three digits, and (iii) WordTranslation for \"negative\", and (iv) a wealth of expression in IntegerString. These all encode tradition: with 56 = fifty-six instead of ten·five & six, except in IntegerString[n, \"TraditionalChineseDecimal\"]. Also, these all tend to hide the steps in the place value system that we want to show. Our routines are:\n(1) PronounceInteger provides a switch between methods, and helps to focus on your preferred method\n(2) PlaceValue (main routine): word based, so that the pronunciation is unambiguous for the particular language. It also allows transliteration (speaking foreign words with approximations in English)\n(3) PlaceValueDigits: integer based, for when kids go from sounds to reading and writing numerals\n(4)PlaceValueBlock: show in blocks of three digits (quite alike DigitsWords, but notice the differences).\n(5) PlaceValueIntegerName builds around IntegerName DigitsWords for full place value speech\nLikely, teaching is best done likely in order (2)-(5) so that first the individual steps are shown and then the block form. PM. A routine f stores what is spoken in LatestPronunciation[] and may display differently, see the documentation of f";


PlaceValueRules::usage ="PlaceValueRules[\"Language\"] = {True -> t, \"OtherLanguage\" -> f}, with t = {Negative -> string, And -> \"&\", N -> {strings for 0...9}, Power -> {strings for 10, ..., 10^6}}, for the true way of writing and pronunciation (when this original language = $Language), and f = {... similar ...} for the transliteration into the actual $Language. See the examples for \"English\" (f is not required given $Language = \"English\") and \"Dutch\" (t <> f).\nNegative -> how the sign of a negative number is written or pronounced\nAnd-> what string is used to separate the product terms of weights and place values\nN -> {names how the digits 0 ... 9 are written or pronounced}\nPower -> {names how 10 ... 10^6 are written or pronounced}.\nSee SpeakTransliteration for checking on $Language.\nImplemented are English, German, French, Dutch and Danish (with some guessing on transliteration). The language Amplish has True -> with an ampersand in a smaller font, and otherwise English. Englishty has ty for 10 pronounced as tee. The languages have (Greek) myriad for 10^4 and (Indian) lakh for 10^5\nPlaceValueRules[] contains the list of languages for which there is transliteration\nPlaceValueRules[Select, item, lan, translit:\"English\"] selects for lan the item (e.g. Power) from both True and translit, and gives a rule or list of rules (true -> transliteration) for replacement\nPlaceValueRules[Set, \"ToLanguage\", FromLanguage:\"English\"] uses IntegerName for the digits and WordTranslation for \"negative\", \"and\" and \"million\" and imposes myriad and lakh. These routines may take time, and thus one is advised to save the result. There is no automation for the transliteration\nPlaceValueRules[Check, \"Language\"] for another language than in PlaceValueRules[\"Checked\"] will issue a warning that the place value pronunciation is generated by automation and hasn't been checked on conflicts. When you have done the checking then this list can be adapted manually or by AppendTo";

SpeakTransliteration ::usage = "SpeakTransliteration is an option of PlaceValue with default $Language. It selects the relevant setting from the PlaceValueRules. If the Language option is equal to the transliterator ($Language) then writing and speaking will be done from the True rule. When the option Language is set to another value, then the integers are written from True but spoken by the transliterator";

PlaceValue::usage = "PlaceValue[n] gives n in the full place value system, as text or in Speak, and the latter with pauses for hearing and possible transliteration in the system default language (e.g. $Language = English). n is in (-10^7, 10^7).\nThe routine is also called with PronounceInteger[n, Level -> 1]\nOptions with defaults are:\nLanguage -> \"Amplish\" uses PlaceValueRules[\"Amplish\"], see there\nWordTranslation -> Automatic calls IntegerName and WordTranslation when the language is not available in PlaceValueRules, which takes some time for initialisation and does not provide for transliteration\nSpeakTransliteration :> $Language (often \"English\"), see there\nSpeak -> True,\nLength -> 300, an integer for the duration of pause between the positions,\nJoin -> \"·\" (unpronounced center dot) between the texts of the weight and place value\nSimplify -> True eliminates terms with 0 weights and replaces 1 P by P, for P = 1, 10, ..., 10^6\nShow -> False does not show the input for Speak, so that one reads the words in the language itself and hears the transliteration (while reading affects hearing)\nPronounceInteger[Options, \"Reset\"] resets the options to loading time";

PlaceValueH::usage = "PlaceValueH[expr] is PlaceValue[expr /. H -> -1]";

PronounceIntegers::usage ="PronounceIntegers is obsolete (first version of the package), see PlaceValue";

PlaceValueDigits$Language::usage = "PlaceValueDigits$Language[n] pronounces n by using digits for the place values rather than words (PlaceValue): n can be as large as Mathematica allows, but also relies on how $Language pronounces those integers. In English 2 100 is pronounced as \"two one-hundred\". Option Simplify -> True (default) for handling of 0 and 1 weights, StepMonitor -> False (default) whether to show an intermediate step, Length -> 300 (default) for the pause, Join -> \"·\" (default) for connection of terms in display (not spoken), Speak -> True (default).\nThe routine is also called as a subroutine by PlaceValueDigits[n], which is also called by PronounceInteger[n, Level -> 2]";

PlaceValueBlock::usage = "PlaceValueBlock[n] pronounces n in digit blocks of 3, and within those blocks in place value manner.\nThe routine is also called with PronounceInteger[n, Level -> 3]\nFor example 123456 = {{1 hundred & 2 ten & 3}, thousand} & {4 hundred & 5 ten & 6}. This is like common usage except for the integers in 11-99. Option Length -> 300 (default) puts \"&\" in the middle of that pause. Option Power -> {...} by default replaces 100 by hundred, 1000 by thousand and 10^6 by million. (This is not done in PlaceValueDigits$Language, because there are more words, like for the digits, and including the awkward 10^4 and 10^5). The numbers 11-99 use the options of PlaceValueDigits$Language, namely to display in numbers and not words. If your $Language is not \"English\", then you might consider to adapt the settings manually. The following is an automation though:\nPlaceValueBlock[SetOptions, \"language\"] sets the options to stated \"language\", using WordTranslation from the current language in the Options (default \"English\")\nPlaceValueBlock[Options, \"Reset\"] resets to the Options at loading";

PlaceValueIntegerName::usage = "PlaceValueIntegerName[n] lets IntegerName[n, \"DigitsWords\"] make the blocks of 3 digits, and then calls PlaceValue on these digits. IntegerName DigitsWords uses text for Abs[n] < 1000, and we follow this. The block bases of thousand, million etcetera are translated by WordTranslation. The text displayed has blocks of digits, with block bases separated by option And -> \", \" (default). This option is not passed on to PlaceValue for speech of the blocks. The spoken text can be recovered from LatestPronunciation[]. Transliteration is called but will slow the execution\nThe routine is also called with PronounceInteger[n, Level -> 4]";

PronounceInteger::usage = "PronounceInteger[n] pronounces n. Options are passed on to the routine that is called, except: if the chosen Language is equal to $Language then it is not passed on. It uses first the Level and then the Method setting in the options, default Level -> 1, Method -> PlaceValue. Option All -> {...} gives the methods in the MathEd`PronounceInteger` package. See the documentation per routine. If you want to specify the selection by Method -> routine name, select also Level -> 0. Perhaps easier to remember than the routine names, and taking advantage of the levels of understanding, you can also specify the Level -> lev:\nchosen =Switch[lev, \n 1, PlaceValue,\n 2, PlaceValueDigits,\n 3, PlaceValueBlock,\n 4, PlaceValueIntegerName,\n-4, PartialPlaceValue,\n_, Null];\n If none of these is used (say with Level -> 0) then the Method -> m option is used. If no method is in the list that All provided: $Failed";

PartialPlaceValue::usage = "PartialPlaceValue[n] has the traditional pronunciation and words of the numbers 11-99, thus in opposite order of the place value system, when speaking the number from Left To Right, and morphing of words. It calls IntegerName with DigitsWords. If Abs[n] < 1000 then there are words only, and higher n get combinations of both digit blocks and words for digit block values (thousand, million). Option defaults are Language -> \"English\" and Speak -> True. Speak apparently fails on the hyphen and thus this replaced by a space. Speak[-10] says Minus 10 but IntegerName uses Negative 10. There is no transliteration.\nThe routine is also called with PronounceInteger[n, Level -> -4]";


PlaceValueDigits::usage = "PlaceValueDigits[n] pronounces n by PlaceValue[n] and displays by PlaceValueDigits$Language[n]\nOptions are passed on to said routines, and see their own options, like Simplify and Show\nOwn options are Speak -> True (default), Print -> True (default) prints the outcome of PlaceValue[n]. LatestPronunciation[Print] stores what is printed\nThe routine is also called with PronounceInteger[n, Level -> 2]";

PlaceValueTable::usage = "PlaceValueTable[{n}] gives a table of {n} with rows {n, pronunciation in PlaceValue, PV Digits, traditional pronunciation}. Options are passed on to PlaceValue (default Speak -> True) and PartialPlaceValue(default Speak -> False)\nPlaceValueTable[n] gives the table with only n\nPlaceValueTable[Row, n || {n}] gives the rows as lists only\nPlaceValueTable[First, n] gives {n, PV, PV Digits}";

Begin["`Private`"];

PlaceValueRules::wrn = "Warning: automated translation of `1` and not carefully checked on conflicts and peculiarities";

PlaceValueRules[Check, lan_String]:=
If[!MemberQ[PlaceValueRules["Checked"], lan], Message[PlaceValueRules::wrn, lan]];

PlaceValueTable[First, n_Integer, opts___Rule] := 
{n, PlaceValue[n, opts], PlaceValueDigits[n, Print -> False, Speak -> False, opts]}

PlaceValueTable[Row, n_Integer, opts___Rule] := 
{n, " ", PlaceValue[n, opts], 
PlaceValueDigits[n, Print -> False, Speak -> False, opts],
  " ",PartialPlaceValue[n, opts, Speak -> False]}

PlaceValueTable[Row, {n__Integer}, opts___Rule] := 
PlaceValueTable[Row,#, opts]& /@ {n}

PlaceValueTable[ n_Integer, opts___Rule] := 
PlaceValueTable[ {n}, opts]

PlaceValueTable[{n__Integer}, opts___Rule] := 
(PlaceValueRules[Check, Language /. {opts} /. Options[PlaceValue]];
TableForm[PlaceValueTable[Row, {n}, opts],opts, TableSpacing -> {1.5, 3},
 TableHeadings -> {None,
{"Integer", "", "Place Value", "PV Digits", "", "Traditional"}}])

Options[PlaceValueDigits] = {Speak -> True, Print -> True} ;

PlaceValueDigits[n_Integer, opts___Rule] := 
Module[{res, speakq,  toshow, prq}, 
(*split show and speak *)
{speakq, prq} = {Speak, Print} /. {opts} /. Options[PlaceValueDigits];
toshow = PlaceValueDigits$Language[n, Speak -> False, opts];
res =  PlaceValue[n, Speak -> speakq, opts];
If[prq === True,  LatestPronunciation[Print] = res;Print[res]]; 
(* LatestPronunciation[] set by P.V.O. *)
toshow]

Options[PartialPlaceValue] = {Language -> "English", Speak -> True};

PartialPlaceValue[n_Integer, opts___Rule] :=
Module[{res, lan, speakq, rul},
{lan, speakq} = {Language, Speak} /. {opts} /. Options[PartialPlaceValue] ;
rul = If[MemberQ[{$Language, "Amplish", "Englishty"}, lan], 
ToExpression["Sequence[]"], Language -> lan];
res =  IntegerName[n, {"DigitsWords"}, rul] ;
res = StringReplace[res, "\[Hyphen]" -> " "];
LatestPronunciation[] =res;
If[speakq, Speak[res]];
res]

Options[PronounceInteger] = {Level -> 1, Method -> PlaceValue, Language -> "English",  
Speak -> True, All -> {
PlaceValue, PlaceValueH, PlaceValueDigits,
PlaceValueDigits$Language,PlaceValueBlock,
PlaceValueIntegerName, PartialPlaceValue, PlaceValueTable}};

PronounceInteger::unk = "Unknown Level -> `1` and Method -> `2`";

PronounceInteger[n_Integer, opts___Rule] :=
Module[{m, lan, all, rul, res, speakq, lev, k},
{lev, m, lan, all, speakq} = {Level, Method, Language, All, Speak} /. {opts} /. Options[PronounceInteger] ;
rul = If[lan === $Language, ToExpression["Sequence[]"], Language -> lan];
k =Switch[lev, 
1, PlaceValue,
2, PlaceValueDigits,
3, PlaceValueBlock,
4, PlaceValueIntegerName,
-4, PartialPlaceValue,
_, Null];
If[MemberQ[{-4, 1, 2, 3, 4}, lev], Return[k[n, rul, Speak -> speakq, opts]]];
(* routines that have not been assigned a level*)
If[MemberQ[all, m], Return[m[n, rul, Speak -> speakq, opts]]];
Message[PronounceInteger::unk, lev, m]; 
$Failed]

Options[PlaceValueIntegerName] = {Language -> "English", Speak -> True, And -> ", "};

pvoin[x_, lan_String] := If[lan === "English", x,
First[WordTranslation[x, "English" -> lan]]];

pvoin[x_, lan_String, rul_] := If[lan === "English", x,
(First[WordTranslation[x, "English" -> lan]]) /. rul];

PlaceValueIntegerName[n_Integer, opts___Rule] := 
Module[{lan},
lan= Language /. {opts} /. Options[PlaceValueIntegerName];
If[lan === $Language,
PlaceValueIntegerName["Fast", n, opts],
PlaceValueIntegerName["Slow", n, opts]]
]


PlaceValueIntegerName["Fast", n_Integer, opts___Rule] := 
Module[{res, lan, speakq, rul, toshow, tospeak, and,nopts, na}, 
(*IntegerName in English displays blocks of 3 digits, 
but for values Abs[n] < 1000 and in 
translation it switches to names. We need the digits*)
{lan, speakq, and} = {Language, Speak, And} /. {opts} /. Options[PlaceValueIntegerName];
Check[IntegerName[0, "Words", Language -> lan], Return[$Failed]];
speakq = speakq === True;
If[!StringQ[and],  Message[PlaceValue::str , And, and];Return[$Failed]];
nopts = Sequence @@ ({opts} /. (Rule[And, x_] :> Sequence[]));
rul = If[lan === $Language, ToExpression["Sequence[]"], Language -> lan];
If[Abs[n] < 1000,
Return[PlaceValue[n, rul, Speak -> speakq, nopts]],
(*else*)
res = IntegerName[n, {"DigitsWords", "English"}] ;
res = StringSplit[res];
toshow = If[DigitQ[#], #, pvoin[#, lan]<>and]& /@ res;
toshow = StringJoin @@  Riffle[toshow , "  "];
na= StringLength[and];
If[StringTake[toshow, -na] ===  and, toshow = StringDrop[toshow, -na]];
res = If[DigitQ[#], ToExpression[#], pvoin[#, lan]<> and]& /@ res;
(* re-introduce English because of Amplish *)
res = res /. x_Integer :> PlaceValue[x, rul, Language -> "English", Speak -> False, nopts];
tospeak = StringJoin @@  Riffle[res, "  "];
If[StringTake[tospeak, -na] ===  and, tospeak = StringDrop[tospeak, -na]];
];
LatestPronunciation[]= tospeak;
If[speakq === True, Speak[tospeak]]; 
toshow
]

PlaceValueIntegerName["Slow", n_Integer, opts___Rule] := 
Module[{res, lan, speakq, rul, toshow, tospeak, and,na, nopts, sp, h, trans, las}, 
(*IntegerName in English displays blocks of 3 digits, 
but for values Abs[n] < 1000 and in 
translation it switches to names. We need the digits*)
{lan, speakq, and} = {Language, Speak, And} /. {opts} /. Options[PlaceValueIntegerName];
Check[IntegerName[0, "Words", Language -> lan], Return[$Failed]];
speakq = speakq === True;
If[!StringQ[and],  Message[PlaceValue::str , And, and];Return[$Failed]];
nopts = Sequence @@ ({opts} /. (Rule[And, x_] :> Sequence[]));
rul = If[lan === $Language, ToExpression["Sequence[]"], Language -> lan];
If[Abs[n] < 1000,
Return[PlaceValue[n, rul, Speak -> speakq, nopts]],
(*else*)
res = IntegerName[n, {"DigitsWords", "English"}] ;
res = StringSplit[res];
(*toshow*)
toshow = If[DigitQ[#], #, pvoin[#, lan]<> and]& /@ res;
toshow = StringJoin @@  Riffle[toshow , "  "];
na= StringLength[and];
If[StringTake[toshow, -na] ===  and, toshow = StringDrop[toshow, -na]];
(*tospeak*)
h[x_] := (Speak[x];x);
sp[x_] := If[speakq, Hold[h][x], x];
trans = PlaceValueRules[Select,Power, lan];
If[trans === $Failed || !speakq, trans = ToExpression["Sequence[]"]];
res = If[DigitQ[#], 
Hold[ PlaceValue][ToExpression[#], rul, Speak -> speakq, Show -> True, nopts],
sp[pvoin[#, lan, trans]<> and]]& /@ res;
(* clean up if last is a base with and *)
las = Last[res];
las = las /. x_String :> If[StringTake[x, -na] ===  and, StringDrop[x, -na], x];
res = Append[Drop[res, -1], las];
res = ReleaseHold[res];
tospeak = StringJoin @@  Riffle[res, "  "];
LatestPronunciation[]= tospeak;
];
toshow]


Options[PlaceValueDigits$Language] = {Length -> 300, Simplify -> True, Join -> "·", And -> "&", StepMonitor -> False,
Speak -> True} // Sort;

PlaceValueDigits$Language[n_Integer, opts___Rule] :=
Module[{g, h, len, res, pause, simpq, np, join, smq, temp, speakq, and, paund},
{simpq, pause, join, smq, speakq, and} = {Simplify, Length, Join, StepMonitor, Speak, And} /. {opts} /. Options[PlaceValueDigits$Language] ;
 If[!StringQ[and], Message[PlaceValue::str, "and", and]; Return[$Failed]];
join = StringJoin[" ", join, " "];
If[NumberQ[pause],
pause = " <silence msec=\"" <> ToString[pause] <> "\"/> " ,
 Message[PlaceValue::pau, pause];Return[]];
h = IntegerDigits[n];
len = Length[h];
g = Table[10^k, {k, 0, len}];
g = Reverse[Take[g, len]];
res = Inner[times, h, g, TheSum];
(* no speaking since wrong pauses*)
If[smq === True , 
temp = ToString[res];
temp = StringReplace[temp,{ToString[times] -> "times", ToString[TheSum] -> "TheSum"}];
Print[temp]; 
(*Speak[temp] *)];
If[simpq === True,
res = res /. times[0, x_] :> Sequence[];
res = res /. times[ 1, x_] :> x;
res = res /. times[ x_, 1] :> x;
If[n === 0, res = {0}]
]; 
res = res /. TheSum -> List;
paund = pause <> " " <> and <> "   ";
res = StringJoin[paund, ToString[#]]& /@ res;
res = StringJoin @@ res;
res = StringDrop[res,  StringLength[paund]];
If[n < 0,  res = StringJoin["negative ", res]];
res = StringReplace[res, { ToString[TheSum]-> "", ToString[times]-> "",  ", " ->  join, "[" -> "", "]" -> ""}];
If[speakq === True, Speak[res]];
LatestPronunciation[] =res;
StringReplace[res, pause -> "  "]
]

PronounceIntegers[x__] := PlaceValue[x]

PlaceValueH[n_, opts___Rule] := PlaceValue[n /. H -> -1, opts]

digits = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
powers = {"ten", "hundred", "thousand", "myriad", "lakh", "million"};

PlaceValue[IntegerDigits] = digits;
PlaceValue[Power] = powers;

amp =  "&";

PlaceValueRules["English"]  = 
{True ->  {Negative -> "negative",  And  -> "&", N -> digits, Power ->  powers}};

PlaceValueRules["Amplish"]  = 
{True ->  {Negative -> "negative",  And  -> amp, N -> digits, Power ->  powers},
"English" ->  {Negative -> "negative",  And  ->  "&", N -> digits, Power ->  powers}
};

PlaceValueRules["Englishty"]  = 
{True ->  {Negative -> "negative",  And  -> amp, N -> digits, 
Power ->  {"ty", "hundred", "thousand", "myriad", "lakh", "million"}},
"English" ->  {Negative -> "negative",  And  ->  "&", N -> digits, Power ->  {"tee", "hundred", "thousand", "myriad", "lakh", "million"}}
};

PlaceValueRules[] = {(* not "English", *) "Dutch", "French", "German", "Danish", "Amplish", "Englishty"} // Sort;

PlaceValueRules["Checked"] = {"English"} ~Join~  PlaceValueRules[];

PlaceValueRules["Dutch"]  = 
{True ->  {Negative -> "min" (* "negatief" *), And  -> amp, (*"en"*)
N -> {"nul", "een", "twee", "drie", "vier", "vijf", "zes", "zeven", "acht", "negen"}, 
Power ->  {"tig", "honderd", "duizend", "myriad", "lakh", "miljoen"}},  
"English"->  {
Negative -> "min" (*"nayguhteef"*), And -> "n",
N ->  {"nuhl", "ayn", "tway", "dree", "fear", "vaif", "zes" ,"zayven",  "ahgt"(*"akht" "ugt"*),  "naigen" }, 
Power -> {"tikgh", "hon dairt", "duuzand", "myriad", "lakh", "milyoon"}}};

(* deux as in bird, but no way to get it*)

PlaceValueRules["French"]  = 
{True ->  {Negative -> "negative" , And  ->  amp, (* And -> "et", *)
N -> {"zero", "un", "deux", "trois", "quatre", "cinq", "six", "sept", "huit", "neuf" }, 
Power ->  {"dix", "cent", "mille", "myriade", "lakh", "million"}},  
"English"->  {Negative -> "nayguhteef", And -> "ayh",
N ->  {"zeyrouh", "uhnn", "duh", "trouwah", "kahtruh", "saink", "sees", "seht", "weet", "neuhf" }, 
Power -> {"dees", "sun", "meel", "meeri udd", "lakh", "meelyon"}}};

PlaceValueRules["German"]  = 
{True ->  {Negative -> "negativ" , And  -> amp, (*And -> "und",*)
N -> {"null", "ein", "zwei", "drei", "vier", "fuenf", "sechs", "sieb", "acht", "neun" }, 
Power ->  {"zig", "hundert", "tausend", "myriad", "lakh", "million"}},  
"English"->  {Negative -> "nayguhteef", And -> "oond",
N ->  {"noul", "ayen", "tsvwaayie", "dryie", "fear", "fuihnf", "sex", "sieb", "akht", "noin" }, 
Power -> {"tzeeg", "hoondert", "tausand", "myriad", "lakh", "meelyohn"}}};

PlaceValueRules["Danish"]  = 
{True ->  {Negative -> "negativ" , And  -> amp, (*And -> "og",*)
N -> {"nul", "en", "to", "tre", "fire", "fem", "seks", "syv", "otte", "ni" }, 
Power ->  {"ti", "hundrede", "tusind", "myriade", "lakh", "million"}},  
"English"->  {Negative -> "nayguhtew", And -> "oh",
N ->  {"nul", "ayn", "toh", "trya", "fear", "fem", "sex", "suwe", "ude", "knee" }, 
Power -> {"tee", "hoonah", "toosind", "myriade", "lakh", "meelyohn"}}};


PlaceValueRules[Set, lan_String, org_String:"English"]  :=
Module[{res, f, g, zero},
Check[IntegerName[0, "Words", Language -> lan], Return[$Failed]];
f[x_] := IntegerName[x, "Words", Language -> lan];
g[x_] := First[WordTranslation[x, org -> lan]];
res = {Negative -> g["negative"], And -> g["and"],
N -> (f /@ Range[0, 9]), 
Power ->  {f[10], f[100], f[100], "myriad", "lakh",  g["million"]}
};
AppendTo[PlaceValueRules[], lan];
PlaceValueRules[Check, lan];
Set[PlaceValueRules[lan], {True -> res,  org -> res}]
]

PlaceValueRules[Select, item_, lan_String, trans_String:"English"] :=
Module[{res, true},
If[MemberQ[PlaceValueRules[], lan],
res = PlaceValueRules[lan];
true = True /. res;
true = item /. true;
res = trans /. res;
res = item/. res;
Thread[true -> res], $Failed]]

compose[digits_List, lis_List, pause_String, s_Integer, neg_String, and_String] :=
Module[{combination, paund},
paund = pause <> " "  <> and <> "  ";
combination =  MapThread[StringJoin, {digits , lis}];
combination = paund <> #  &/@ combination;
combination = StringJoin @@ combination;
combination = StringDrop[combination, StringLength[paund]];
If[s < 0, neg <> pause <> combination, combination]]

Options[PlaceValue] = reset = {Show -> False, Speak -> True, 
Language -> "Amplish", SpeakTransliteration  :> $Language,
Length -> 300 (* was " <silence msec=\"300\"/> " *), 
Simplify ->  True, Join -> "·",
WordTranslation -> Automatic}  // Sort;

PlaceValue[Options, "Reset"] :=
(Unprotect[PlaceValue];
Options[PlaceValue] = reset;
Protect[PlaceValue]; reset )

PlaceValue::rul = "No list of rules found for `1` `2`";
PlaceValue::int = "Initialisation with IntegerName and WordTranslation: please wait";
PlaceValue::len = "Length of `1` is not `2` but `3`";
PlaceValue::num = "No list of names found for `1` `2`";
PlaceValue::not = "Not tested: Speak with other than $Language";
PlaceValue::ran = "Integer not in domain -`1` < `2` < `1`";
PlaceValue::pau = "Pause length `1` must be a number";
PlaceValue::str = "Symbol for `1` is `2` but must be a string";

inputtest[ns_, ps_, type_, neg_, and_] :=
(If[!ListQ[ns], Message[PlaceValue::num , {type,"digits"}, ns];Throw[$Failed]];
If[!ListQ[ps], Message[PlaceValue::num ,{type,"powers"}, ps];Throw[$Failed]];
If[Length[ns] =!= 10, Message[PlaceValue::len ,{type,"digits"}, 10, Length[ns]]; Throw[$Failed]];
If[Length[ps] =!= 6, Message[PlaceValue::len , {type,"powers"}, 6, Length[ps]]; Throw[$Failed]];
  If[!StringQ[neg], Message[PlaceValue::str, "negative", neg]; Throw[$Failed]];
 If[!StringQ[and], Message[PlaceValue::str, "and", and]; Throw[$Failed]];
  )

pihelper[n_Integer, neg_String, ipause_String, nsi_List, psi_List, simpq_, join_String, speakq_, and_String] :=
Module[{pause, s, powers, d, digits, len, lis, sel, h, zeros, pos, ns , ps},
pause = If[speakq =!= True, " ", ipause];
s = Sign[n]; ns = nsi; ps = psi;
(*** actual ***)
PrependTo[ps, ns[[2]]];
powers = Table[10^k, {k, 0, 6}];
d= IntegerDigits[n];
digits = ns[[#+1]]& /@ d; 
len = Length[d];
lis = Take[ps, len];
(* basically finished but simplification*)
(* 1 *)
If[simpq === True,  
h = Last[d];
AppendTo[ns, ""];
d = d /. 1 -> 10  ;
digits = ns[[#+1]]& /@ d; 
If[h =!= 1, (*then not removed at the last position, and thus adjust lis*)
lis = {""} ~Join~ Rest[lis]; (* reverse: india and arabia *) 
]]; (*end simpq*)
lis =  Reverse[join <> #  &/@ lis];
(* 0 *)
If[simpq === True && d =!= {0},
zeros = If[# === 0, 0, 1]& /@ d;
pos = Position[zeros, 1];
If[pos =!= {},  (*superfluous ...*)
digits = Extract[digits, pos];
lis = Extract[lis, pos];
]]; (*end simpq*)
compose[digits, lis, pause, s, neg, and]
]

PlaceValue[n_Integer, opts___Rule] := 
Catch[Module[{ns, ps, speakq,  combination, pause, neg, simpq, join, translit, lan, rul,  lanrul, nottested, showq, missingq, and},
{speakq, pause, simpq, join, translit, lan, showq, missingq}  =
{Speak, Length, Simplify, Join,SpeakTransliteration, Language, Show, WordTranslation} /. {opts} /. Options[PlaceValue];
(*** input and testing of it ***)
(* also test even when not spoken *)
If[NumberQ[pause],
pause = " <silence msec=\"" <> ToString[pause] <> "\"/> " ,
 Message[PlaceValue::pau, pause];Throw[$Failed]];
If[Abs[n] > 10^7-1, Message[PlaceValue::ran,  "10^7", n];Throw[$Failed]];
nottested = (speakq === True && translit =!= $Language);
If[nottested, Message[PlaceValue::not]];
(* if lan <> $Language then write in lan True or speak in translit*)
lanrul =  PlaceValueRules[lan];
If[!ListQ[lanrul], 
Message[PlaceValue::rul , "language", lan];
If[missingq === Automatic,
Message[PlaceValue::int];
Check[IntegerName[0, "Words", Language -> lan], Throw[$Failed]];
PlaceValueRules[Set,lan],
Throw[$Failed]]];
If[lan === translit, translit = True]; (*key*)

(* using a switch in case only one call suffices *)
rul = If[(speakq === True), translit, True] /. lanrul;
If[!ListQ[rul], Message[PlaceValue::rul ,{translit, True}, rul];Throw[$Failed]];
{ns, ps,  neg, and}  = {N, Power, Negative, And} /. {opts} /. rul;
inputtest[ns, ps, speakq, neg, and] ;
combination = pihelper[n, neg, pause, ns, ps, simpq, join, speakq, and] ;

LatestPronunciation[] =combination;
If[speakq =!= True, 
combination,
Speak[combination];
If[showq === True, combination,
(* redo the whole thing for the written version *)
(* overdone to turn this into a subroutine *)
rul = True /. lanrul;
If[!ListQ[rul], Message[PlaceValue::rul ,{translit, True}, rul];Throw[$Failed]];
{ns, ps,  neg,and}  = {N, Power, Negative, And} /. {opts} /. rul;
inputtest[ns, ps, False, neg, and] ;
combination = pihelper[n, neg, pause, ns, ps, simpq, join, False,and] 
]] (*endif*)
]] (*end catch module*)


tosimp[{0, 0, 0}] := {}
tosimp[{0, y_, x_}] := { myspeak[y * 10 + x]}
tosimp[{z_, 0, 0}] := {speak[ToString[z] <>  hundred]}
tosimp[{z_, y_, x_}] := {speak[ToString[z] <> hundred], nfx, myspeak[y * 10 + x]}
tosimp[{0, 0}] := {}
tosimp[{y_, x_}] := {myspeak[y * 10 + x]}
tosimp[{0}] := {}
tosimp[{x_}] := {speak[x]}

tospeak[{z_, y_, x_}] := {speak[ToString[z] <> hundred],nfx,  myspeak[y * 10 + x]}
tospeak[{y_, x_}] := {myspeak[y * 10 + x]}
tospeak[{x_}] := {speak[x]}
(* this applies to g *)
tospeak[1] := one
tospeak[x_Integer] := speak[x]

Options[PlaceValueBlock] = resetblock =
{Language  -> "Amplish", And -> "&",
Length -> 300, Speak -> True, Join  -> "·", Simplify -> True,
Power ->  {10^6 -> "million", 10^3 -> "thousand", 100 -> "hundred"}} // Sort;

PlaceValueBlock[Options, "Reset"] :=
(Unprotect[PlaceValueBlock];
Options[PlaceValueBlock] = resetblock;
Protect[PlaceValueBlock]; resetblock )


PlaceValueBlock[SetOptions, lan_String] :=
Module[{rul, numbers, words, trans, default},
{default, rul} = {Language, Power} /. Options[PlaceValueBlock];
{numbers, words} = Transpose[rul /. Rule -> List];
trans = WordTranslation[#, default -> lan]& /@ words;
trans = First /@ trans;
SetOptions[PlaceValueBlock, Language -> lan, Power -> Thread[numbers -> trans]]
]

PlaceValueBlock[n_Integer, opts___Rule] :=
Module[{h, len, g, q, p, res, pause, rep, speakq, join, rule100, simpq, and, paund},
{pause, rep, speakq, join, simpq, and}  = {Length, Power, Speak, Join, Simplify, And} /. {opts} /. Options[PlaceValueBlock];
hundred = " " <> join <> " " <>  (100 /. rep);
 If[!StringQ[and], Message[PlaceValue::str, "and", and]; Return[$Failed]];
rule100 = (100 /. rep) ->  "100";
speakq = speakq === True;
If[NumberQ[pause],
pause = " <silence msec=\"" <> ToString[Round[pause/2]] <> "\"/> " ,
 Message[PlaceValue::pau, pause];Return[]];
h = IntegerDigits[n];
len = Length[h];
g = Table[10^k, {k, 0, len-1, 3}] //Reverse;
p = Partition[Reverse[h], UpTo[3]];
p = Reverse[Reverse /@ p];
If[simpq === True, q = (u/@ (tosimp /@ p))  /. u[{}] :> u[] ];  
If[simpq =!= True, q = (u/@ (tospeak /@ p))  /. u[{}] :> u[] ];
g = (u /@ (tospeak /@ g));
res = Inner[w, q,  g,  head]/. u -> Sequence ;
res = res /. w[] :> Sequence[]  /. w[speak[y_]] :> Sequence[];  (*zero weights*)
res =res /.  w -> List /. head -> List;
res = res /. {x___List, one} :> x;
If[speakq,
sp[x_] := Hold[Speak[x]; x],
sp[x_] := Hold[x]];
mysp[x_] := Hold[PlaceValueDigits$Language[x, Evaluate[Speak -> speakq, And -> and,  opts]]];
(* never show the pause *)
paund = pause <>and <> pause;
and = " "<>and<>" ";
res = Riffle[res, If[speakq, Hold[Speak[paund]; and], and]];
If[n < 0, PrependTo[res, Hold[Speak["negative"];"negative"]]];
res = res /. rep;
res = res /. nfx -> sp[and];
res = res /. {myspeak -> mysp, speak -> sp};
LatestPronunciation[Hold] =res;
res = ReleaseHold[res];
LatestPronunciation[] =res;
res = res /. (rep /. Rule[a_, b_] :> Rule[b, a]);
res /. x_String :> StringReplace[x, rule100]
]

End[];

Protect[PlaceValue, PlaceValueH, PronounceIntegers, SpeakTransliteration, PlaceValueBlock, PlaceValueDigits, PlaceValueDigits$Language,PronounceIntegerReadMe, PronounceInteger, PartialPlaceValue, PlaceValueTable];

EndPackage[];

MathEd`CCSSMath`

(*******************************************

Cool`MathEd`CCSSMath` package

*******************************************)
(* :Author: Thomas Cool*)
(* :Copyright: Copyright 2018 Thomas Cool - except for CCSS texts of course*)
(* :Package Version: 1.1, May 19 2018*)
(* :Mathematica Version:11.2*)
(* :Reference: http://www.corestandards.org/Math/Content/NBT *)
(* :Keywords:*)
(* :Limitation:*)
(* :License: see http://thomascool.eu/TheEconomicsPack/index.html*)

BeginPackage["Cool`MathEd`CCSSMath`", {"Cool`MathEd`PronounceInteger`"}];

Unprotect[CCSSMathContent, CCSSMathExercise];

CCSSMathContent::usage = "CCSSMathContent[grade, domain, labels] quotes the CCSS standards for the grade and domain\nCCSSMathContent[] contains the list what is included in the package. Only included are parts of NBT = Number & Operations in Base Ten, and then only for Kindergarten, Grade 1 and a bit of Grade 2, and some of OA and NF for higher grades";

CCSSMathExercise::usage = "CCSSMathExercise[n, ..., m, opts] passes the numbers on to a routine that recognises the CCSSMathContent labels in opts, see Options[CCSSMathExercise] and CCSSMathContent. When Show -> True then the CCSSMathContent on those labels is shown (default False)\nCCSSMathExercice[n, m:10] for \"Grade\" -> \"Kindergarten\" or \"Grade 1\" counts from m to n. Defaults Speak -> False, IntegerDigits -> False (if True, the exercise question shows digits, but still speaks full place value)";



Begin["`Private`"];



Options[CCSSMathExercise] = {Domain -> "NBT", "Grade" -> "Kindergarten", "Code" -> "A.1", Show -> False, Speak -> False, IntegerDigits-> False};

CCSSMathExercise[n__Integer, opts___Rule] := 
Module[{sq, kind, res},
kind = {"Grade",Domain, "Code"} /. {opts} /. Options[CCSSMathExercise];
sq = Show /. {opts} /. Options[CCSSMathExercise] ;
If[sq === True, 
res = CCSSMathContent @@ kind; Print[res]];
CCSSMathExercise[n,  kind, opts]]

CCSSMathExercise::ran = "Number `1` must be in range `2`";

CCSSMathExercise[n_Integer,m___Integer , {"Kindergarten", "NBT", "A.1"}, opts___Rule] :=
If[10 < n < 20,
CCSSMathExercise["Kindergarten", Count, n,m, opts] , Message[CCSSMathExercise::ran, n, "11-19"]]

CCSSMathExercise["Kindergarten", Count,xtext_String, basetext_String, ytext_String] :=
StringReplace["You know the numbers yyy and base, and how to speak them. You now count yyy up from base, and then you find the number xxx. You now learn to speak the number xxx.", {"xxx" ->  xtext, "base" -> basetext, "yyy" ->  ytext}]

CCSSMathExercise["Kindergarten", Count, x_Integer, base_Integer:10, opts___Rule] := 
Module[{xtext, basetext, ytext, digits, speakq, f, famp, fpv, toshow, tospeak},
{digits, speakq} = {IntegerDigits, Speak} /. {opts} /. Options[CCSSMathExercise] ;
fpv = (PlaceValue[#, Speak -> False, Language -> "English", opts]&);
famp = (PlaceValue[#, Speak -> False, Language -> "Amplish", opts]&);
(* to show *)
f = If[digits === False, famp, ToString];
{xtext, basetext, ytext} = f /@ {x, base, x - base};
toshow = CCSSMathExercise["Kindergarten", Count,xtext, basetext, ytext] ;
(* to speak *)
If[speakq === True,
{xtext, basetext, ytext} = fpv /@ {x, base, x - base};
tospeak = CCSSMathExercise["Kindergarten", Count,xtext, basetext, ytext] ;
LatestPronunciation[] = tospeak;
Speak[tospeak]
]; 
toshow]


CCSSMathExercise[n_Integer, m___Integer, {"Grade 1", "NBT", "A.1"}, opts___Rule] :=
If[0 <= n <= 120,
CCSSMathExercise[Count, n, m, opts] , Message[CCSSMathExercise::ran, n, "0-120"]]

CCSSMathExercise[Count,xtext_String, basetext_String, ytext_String] :=
StringReplace["You know the numbers yyy and base, and how to write and speak them. You now count yyy up from base, and then you find the number xxx. You now learn to write and speak the number xxx.", {"xxx" ->  xtext, "base" -> basetext, "yyy" ->  ytext}]


CCSSMathExercise[Count, x_Integer, base_Integer:10, opts___Rule] := 
Module[{xtext, basetext, ytext, digits, speakq, f, famp, fpv, toshow, tospeak},
{digits, speakq} = {IntegerDigits, Speak} /. {opts} /. Options[CCSSMathExercise] ;
fpv = (PlaceValue[#, Speak -> False, Language -> "English", opts]&);
famp = (PlaceValue[#, Speak -> False, Language -> "Amplish", opts]&);
(* to show *)
f = If[digits === False, famp, ToString];
{xtext, basetext, ytext} = f /@ {x, base, x - base};
toshow = CCSSMathExercise[Count,xtext, basetext, ytext] ;
(* to speak *)
If[speakq === True,
{xtext, basetext, ytext} = fpv /@ {x, base, x - base};
tospeak = CCSSMathExercise[Count,xtext, basetext, ytext] ;
LatestPronunciation[] = tospeak;
Speak[tospeak]
]; 
toshow]




CCSSMathContent["Kindergarten", "NBT","A.1"]= "Work with numbers 11-19 to gain foundations for place value. CCSS.Math.Content.K.NBT.A.1.\n  Compose and decompose numbers from 11 to 19 into ten ones and some further ones, e.g., by using objects or drawings, and record each composition or decomposition by a drawing or equation (such as 18 = 10 + 8); understand that these numbers are composed of ten ones and one, two, three, four, five, six, seven, eight, or nine ones.";

CCSSMathContent["Grade 1", "NBT","A.1"]="Extend the counting sequence. CCSS.Math.Content.1.NBT.A.1
  Count to 120, starting at any number less than 120. In this range, read and write numerals and represent a number of objects with a written numeral.";
CCSSMathContent["Grade 1", "NBT","B.2"]="Understand place value. CCSS.Math.Content.1.NBT.B.2
Understand that the two digits of a two-digit number represent amounts of tens and ones. Understand the following as special cases: B.2.A, B.2.B, B.2.C";
CCSSMathContent["Grade 1", "NBT","B.2.A"]="Understand place value. CCSS.Math.Content.1.NBT.B.2.A
  10 can be thought of as a bundle of ten ones — called a \"ten.\"";
CCSSMathContent["Grade 1", "NBT","B.2.B"]=
"Understand place value. CCSS.Math.Content.1.NBT.B.2.B
  The numbers from 11 to 19 are composed of a ten and one, two, three, four, five, six, seven, eight, or nine ones.";
CCSSMathContent["Grade 1", "NBT","B.2.C"]="Understand place value. CCSS.Math.Content.1.NBT.B.2.C
The numbers 10, 20, 30, 40, 50, 60, 70, 80, 90 refer to one, two, three, four, five, six, seven, eight, or nine tens (and 0 ones)";
CCSSMathContent["Grade 1", "NBT","B.3"]="Understand place value. CCSS.Math.Content.1.NBT.B.3
  Compare two two-digit numbers based on meanings of the tens and ones digits, recording the results of comparisons with the symbols >, =, and <.
  Use place value understanding and properties of operations to add and subtract.";
CCSSMathContent["Grade 1", "NBT","C.4"]="Use place value understanding and properties of operations to add and subtract. CCSS.Math.Content.1.NBT.C.4
  Add within 100, including adding a two-digit number and a one-digit number, and adding a two-digit number and a multiple of 10, using concrete models or drawings and strategies based on place value, properties of operations, and/or the relationship between addition and subtraction; relate the strategy to a written method and explain the reasoning used. Understand that in adding two-digit numbers, one adds tens and tens, ones and ones; and sometimes it is necessary to compose a ten.";
CCSSMathContent["Grade 1", "NBT","C.5"]="Use place value understanding and properties of operations to add and subtract. 
CCSS.Math.Content.1.NBT.C.5
  Given a two-digit number, mentally find 10 more or 10 less than the number, without having to count; explain the reasoning used.";
CCSSMathContent["Grade 1", "NBT","C.6"]="Use place value understanding and properties of operations to add and subtract. CCSS.Math.Content.1.NBT.C.6
Subtract multiples of 10 in the range 10-90 from multiples of 10 in the range 10-90 (positive or zero differences), using concrete models or drawings and strategies based on place value, properties of operations, and/or the relationship between addition and subtraction; relate the strategy to a written method and explain the reasoning used.";
CCSSMathContent["Grade 2", "NBT","A.1"]="Understand place value. CCSS.Math.Content.2.NBT.A.1
Understand that the three digits of a three-digit number represent amounts of hundreds, tens, and ones; e.g., 706 equals 7 hundreds, 0 tens, and 6 ones. Understand the following as special cases: A.1.A, A.1.B";
CCSSMathContent["Grade 2", "NBT","A.1.A"]="Understand place value. CCSS.Math.Content.2.NBT.A.1.A
  100 can be thought of as a bundle of ten tens — called a \"hundred.\"";
CCSSMathContent["Grade 2", "NBT","A.1.B"]="Understand place value. CCSS.Math.Content.2.NBT.A.1.B
  The numbers 100, 200, 300, 400, 500, 600, 700, 800, 900 refer to one, two, three, four, five, six, seven, eight, or nine hundreds (and 0 tens and 0 ones).";
CCSSMathContent["Grade 2", "NBT","A.2"]="Understand place value. CCSS.Math.Content.2.NBT.A.2
  Count within 1000; skip-count by 5s, 10s, and 100s.";
CCSSMathContent["Grade 2", "NBT","A.3"]="Understand place value. CCSS.Math.Content.2.NBT.A.3
  Read and write numbers to 1000 using base-ten numerals, number names, and expanded form.";
CCSSMathContent["Grade 2", "NBT","A.4"]="Understand place value. CCSS.Math.Content.2.NBT.A.4
  Compare two three-digit numbers based on meanings of the hundreds, tens, and ones digits, using >, =, and < symbols to record the results of comparisons.
  Use place value understanding and properties of operations to add and subtract.";
CCSSMathContent["Grade 2", "NBT","B.5"]="Use place value understanding and properties of operations to add and subtract. CCSS.Math.Content.2.NBT.B.5
  Fluently add and subtract within 100 using strategies based on place value, properties of operations, and/or the relationship between addition and subtraction.";

CCSSMathContent["Grade 4","NBT","A.2"]="Generalize place value understanding for multi-digit whole numbers. CCSS.Math.Content.4.NBT.A.2
Read and write multi-digit whole numbers using base-ten numerals, number names, and expanded form. Compare two multi-digit numbers based on meanings of the digits in each place, using >, =, and < symbols to record the results of comparisons.";

CCSSMathContent["Grade 2","OA","A.1"]="Represent and solve problems involving addition and subtraction. CCSS.Math.Content.2.OA.A.1
Use addition and subtraction within 100 to solve one- and two-step word problems involving situations of adding to, taking from, putting together, taking apart, and comparing, with unknowns in all positions, e.g., by using drawings and equations with a symbol for the unknown number to represent the problem";

CCSSMathContent["Grade 2", "OA", "B.2"] = "Add and subtract within 20. CCSS.Math.Content.2.OA.B.2
Fluently add and subtract within 20 using mental strategies. [Footnote] By end of Grade 2, know from memory all sums of two one-digit numbers." ;

CCSSMathContent["Grade 2", "OA", "C.3"]  ="Work with equal groups of objects to gain foundations for multiplication. CCSS.Math.Content.2.OA.C.3
Determine whether a group of objects (up to 20) has an odd or even number of members,e.g.,by pairing objects or counting them by 2s;write an equation to express an even number as a sum of two equal addends.";
CCSSMathContent["Grade 2", "OA", "C.4"]  =
"Work with equal groups of objects to gain foundations for multiplication. CCSS.Math.Content.2.OA.C.4
Use addition to find the total number of objects arranged in rectangular arrays with up to 5 rows and up to 5 columns;write an equation to express the total as a sum of equal addends.";

CCSSMathContent["Grade 3","OA","D.9"]="Solve problems involving the four operations, and identify and explain patterns in arithmetic. CCSS.Math.Content.3.OA.D.9
Identify arithmetic patterns (including patterns in the addition table or multiplication table), and explain them using properties of operations.";

CCSSMathContent["Kindergarten", "CC", "A.3"] = "Know number names and the count sequence. CCSS.Math.Content.K.CC.A.3
Write numbers from 0 to 20. Represent a number of objects with a written numeral 0-20 (with 0 representing a count of no objects).";

CCSSMathContent["Grade 3", "NF", "A.1"] = "Develop understanding of fractions as numbers.
CCSS.Math.Content.3.NF.A.1
Understand a fraction 1/b as the quantity formed by 1 part when a whole is partitioned into b equal parts; understand a fraction a/b as the quantity formed by a parts of size 1/b.";

CCSSMathContent["Grade 3", "NF", "A.2"] = "Develop understanding of fractions as numbers.
CCSS.Math.Content.3.NF.A.2
Understand a fraction as a number on the number line; represent fractions on a number line diagram.";

CCSSMathContent["Grade 4", "NF", "B.3"] = "Build fractions from unit fractions.
CCSS.Math.Content.4.NF.B.3
Understand a fraction a/b with a > 1 as a sum of fractions 1/b.";
CCSSMathContent["Grade 4", "NF", "B.3.A"] = "CCSS.Math.Content.4.NF.B.3.A
Understand addition and subtraction of fractions as joining and separating parts referring to the same whole.";
CCSSMathContent["Grade 4", "NF", "B.3.B"] = "CCSS.Math.Content.4.NF.B.3.B
Decompose a fraction into a sum of fractions with the same denominator in more than one way, recording each decomposition by an equation. Justify decompositions, e.g., by using a visual fraction model. Examples: 3/8 = 1/8 + 1/8 + 1/8 ; 3/8 = 1/8 + 2/8 ; 2 1/8 = 1 + 1 + 1/8 = 8/8 + 8/8 + 1/8.";
CCSSMathContent["Grade 4", "NF", "B.3.C"] = "CCSS.Math.Content.4.NF.B.3.c
Add and subtract mixed numbers with like denominators, e.g., by replacing each mixed number with an equivalent fraction, and/or by using properties of operations and the relationship between addition and subtraction.";

CCSSMathContent["Grade 8", "EE", "A.1"] ="Expressions and Equations Work with radicals and integer exponents.
CCSS.Math.Content.8.EE.A.1
Know and apply the properties of integer exponents to generate equivalent numerical expressions.For example, 3^2 × 3^-5 = 3^-3 = 1/3^3 = 1/27";


CCSSMathContent[]={List["Kindergarten", "NBT","A.1"],List["Grade 1", "NBT","A.1"],List["Grade 1", "NBT","B.2"],List["Grade 1", "NBT","B.2.A"],List["Grade 1", "NBT","B.2.B"],List["Grade 1", "NBT","B.2.C"],List["Grade 1", "NBT","B.3"],List["Grade 1", "NBT","C.4"],List["Grade 1", "NBT","C.5"],List["Grade 1", "NBT","C.6"],List["Grade 2", "NBT","A.1"],List["Grade 2", "NBT","A.1.A"],List["Grade 2", "NBT","A.1.B"],List["Grade 2", "NBT","A.2"],List["Grade 2", "NBT","A.3"],List["Grade 2", "NBT","A.4"],List["Grade 2", "NBT","B.5"], 
List["Grade 4","NBT","A.2"],
List["Grade 2", "OA", "A.1"],
List["Grade 2", "OA", "B.2"] ,
List["Grade 2", "OA", "C.3"] ,
List["Grade 2", "OA", "C.4"] ,
List["Grade 3","OA","D.9"],

List["Kindergarten", "CC", "A.3"] ,

List["Grade 3", "NF", "A.1"] ,
List["Grade 3", "NF", "A.2"] , 
List["Grade 4", "NF", "B.3"] ,
List["Grade 4", "NF", "B.3.A"] ,
List["Grade 4", "NF", "B.3.B"] ,
List["Grade 4", "NF", "B.3.C"] ,
List["Grade 8", "EE", "A.1"]
} // Sort;

End[];

Protect[CCSSMathContent, CCSSMathExercise];
EndPackage[];

. Introduction

.. H = -1

H = -1 is an universal constant. H represents a half turn along a circle, like i represents a quarter turn.

Kids know what it is to turn around and walk back along the same path.

Pronounce H as “ê:ta:” (ehta) or “symbolic negative one” or “symbolic negative unit”.

The choice of H as a symbol is well-considered: its shape reminds of -1 and even more (-1).

This notebook provides a package to support the use of H in Mathematica.

The literature section provides texts that discuss the use of H.

.. Key application of H

The key application of H is:

For number x there is an additive inverse H x, with the rule x + H x = 0.

For nonzero number x there is a multiplicative inverse (x^(H ))(“per x”), with the rule x (x^H) = 1.

ShowInversesH[2]

.. The curriculum

I have considered writing two separate articles, one on the additive inverse (negative numbers) and one on the multiplicative inverse (exponent H, division, quotient), but it is better to present the integral analysis. Separate are already, and their arguments support the present analysis and the reader should not overlook those arguments: (2018a) on pronunciation of integers using the full place value system, and (2018b) with the tables of addition and subtraction with better use of place value.

The US Common Core State Standards (CCSS) (2018) have the negative numbers only in Grade 6. Holland and the UK have them in Grade 7, i.e. junior highschool. Elementary school has little experience with the negative numbers and this community will have little interest in such discussion. They have a vested interest in fractions for Grade 3-5 (i.e. in best definition:  expressions with a fraction bar). Thus it is fortunate that the present discussion on the multiplicative inverse can be put into an integral analysis that highlights that the lower grades of elementary school better should not neglect the additive inverse (negative numbers). Increasing the understanding by teachers on these issues is an important step for increasing the likelihood of improvement.

Researchers, teachers and (Common Core) educators have a tradition to say that “there are no negative apples” and e.g. “there are no -3 apples”. Apparently they are not aware that eating an apple is the very cancellation represented by x + H x = 0.  The equation:

3 apples + eating 3 apples = 0 apples

indicates that eating provides the cancellation, using H = eating, so that we really have the equivalent of -3 apples. Observe that “-3” is only a way of denoting a negative integer, and that H 3 is this very same integer. The very format of numbers like -3 might have blocked understanding of what negative numbers are, since the format suggests an object and not a process. We should however not look at objects only but also at activities, like counting and addition are activities as well. It is only accounting with credit and debet. For 2 apples + eating 5 apples = eating 3 apples, or 2 + 5 H = 2 + 2 H + 3 H = 0 + 3 H = 3 H, the interpretation is that you go hungry for want of eating three apples. The term eating × eating means cancelling the cancellation, or not do the eating. Having 3 apples minus eating 2 apples means that you have 5 apples, with the rule that H H = 1, like making two half turns gives a whole turn. If properly explained like this, elementary school teachers in Grade 2 should be able to master this idiom and then explain this to their students too.

The concern for the well-being of the kids is shared by all of course. The steps forward come from questioning dogma and from growing awareness that mathematics education (ME) and its research (MER) are a big mess and not a perfect and shining peak of civilisation. Remember though that a dogma prevents creative thinking that would overcome the dogma.

.. Redesign of mathematics education

For Mathematics Education (ME) and ME research (MER) we have (and observe the use of quotation marks):

Conventional MER adopts (traditional) “mathematics” as given, and the research objective is to find better ways to teach this to students.

The re-engineering approach has the diagnosis that "problems in didactics" are caused by so-called "mathematics" itself. Mathematics should be clear and convincing by itself. When students experience problems, then it isn't their fault but the fault of so-called "mathematics".

See https://zenodo.org/communities/re-engineering-math-ed/about.

Didactics of mathematics has an overall unity of (i) words (symbols), (ii) (symbolic) expressions, (iii) graphs, (iv) tables. Teaching one aspect without mentioning the other aspects is not done.

.. Readership

We use Mathematica to mimic what kids might do with pencil and paper. We will not assume that kids would learn about Mathematica before they learn arithmetic.

Our readership are researchers, teachers and (Common Core) educators, not only w.r.t. mathematics education but also from fields in education that use mathematics.

It is important to realise that mathematics education (ME) and its research (MER) have been dominated by (i) pedagogues with little insight in mathematics and (ii) mathematicians trained on abstract thinking instead of empirics. Remember the math wars - and much hasn’t been resolved but only has gone underground. Advancement can by made by the proper combination of the clear light of day, scientific integrity, pedagogy, math, and empirics, see https://zenodo.org/communities/re-engineering-math-ed/about. An important impetus might come from educational fields that use mathematics, like physics, biology, psychology or economics, who are competent in math and who are aware of the importance of empirics, and who thus can ask critical questions and who have every reason to do so. Not only the kids but also the education in their fields suffer from the current mishap in mathematics education (ME) and its research (MER).

I also hope that the makers of Mathematica read this, and agree to include H as a universal constant indeed.

This notebook is mainly a report on content. At the same time it is a technical report on how to employ Mathematica and the new package for our topic. Some people in the readership will benefit much from the Appendices for this technical aspect.

.. Didactic core and technical report on programming

This topic of this notebook is mathematics education (ME) and its research (MER). This is often seen as “text without programming”. Our topic discusses mathematics while mathematics deals with patterns. The discussion on our topic can improve quite a lot when we use Mathematica, a system for doing mathematics by computer, see Wolfram (1991, 1998). This gives “text with programming”, both in the Main body of the text but also in the Stages that we discuss separately. This notebook also provides a report on the package, which is “text about programming”. The technical details are in the Appendices. The reader is invited to keep these three aspects on content and programming in mind, and not confuse the one with the other.

Graphics[{Circle[{0, 0}, 1], Circle[{1,  0}, 1], Circle[{1/2, -1}, 1],  Text["ME &\nMER", {-1/3, 1/4}], Text["Mma", {1.5, 1/4}], Text["About\npackage", {1/2, -1.4}], Text["Main &\nStages", {1/2, .3}], Text["Apx", {1.15, -.6}], Text["A bit", {1/2, -.4}]}]

.. Structure of the paper

The didactic core is how pupils would work, mimicked by routines here. For teachers and researchers we must look at the properties of the routines. The main body of the text cannot avoid some issues of programming. The routines can be categorised by the 7 stages in the curriculum. The 7 logical stages create some richness in routines, and therefor we also have some repetition in the discussion, as “the same issue” might need attention within a new context again.

Section 2 gives an overview of our topic. Section 3 looks at the negative numbers. Section 4 gives an overview of the 7 stages of arithmetic for our topic and what Mathematica already provides for. Section 5 gives conclusions. Our conclusions are rather meagre and pro forma. The main conclusion is provided by this notebook with its package itself: that this is a relevant topic to look into.

The main body of the text gives main points. There are two kinds of details with separate discussion.

The separate discussions on the stages have the label “Stage” and not “Appendix” . The stages are linked to the US Common Core. The classes in the Common Core differ from the stages, and all differ from the Van Hiele levels of insight.

The discussions on the routines have the label “Appendix” in their name. There is no master routine yet since we do not have a sufficient categorisation yet by stage and step within the stage.

Appendix A identifies properties of Mathematica that relate to the 7 stages (support or conflict).

Appendix B provides for routines that fit the intended use, using Appendix A.

Appendix C looks at the properties of the routines, and relates them to the stages in didactics.

Appendix D serves to highlight SimplifyH as a short but relevant routine.

Appendix E might have been part of Appendix A, but highlights the different treatment of rationals.

. Overview on the inverses with H

.. Empirical theory but without testing yet

This paper distinguishes 7 stages in mathematical development of arithmetic on our topic. The stages differ from the grades and both differ from the Van Hiele levels of insight. The stages are linked up though with the US Common Core (2018) for kindergarten and K1-6.

It are the kids themselves who tell us what works for them. The following only develops theory. It is no use to test kids when we don’t have a sound theory. Future research would involve experiments. This discussion within Mathematica has been quite helpful in identifying aspects that require attention for such experimenting.

The Dutch Ministry of Education, Culture and Science (2016) decided that highschool teachers are also qualified for kindergarten and elementary school. I have my hesitations on this, and restrict my teaching to highschool & downstream and not upstream, see also Colignatus (2015b) with my disclaimer on competence. The following only gives my thoughts on the subject matter for (my upstream) kindergarten and elementary school. For example, we distinguish between scalar multiplication (2 km) and grouping (5 baskets of 4 apples), and I really would not know whether this distinction is made in elementary school with proper accuracy.

There has been some testing on software though: employing the routines in different contexts helped me to improve their design and robustness. For example, the Table of Basic Addition now is oriented like the system of co-ordinates, and thus not upside down as in convention. Saying that 10 is higher than 1 now is also visually supported and not visually contradicted.

.. Didactics on division

Pierre van Hiele (1909-2010) already proposed to get rid of the fraction bar y / x in division, that causes needless complexity, and instead use y (x^(-1)). The exponent -1 might confuse pupils to think that they must subtract something. However, the use of an algebraic symbol H clinches the proposal. Thus we get y (x^H). The rule here is x (x^H) = 1. A direct consequence: In division of longer expressions using the fraction bar students might forget the brackets but the use of H would tend to generate more discipline, compare 1 / 2 x, 1 / 2x, 1 / (2 x) and (2 ((x))^H).

The decimal position of (2^H) on the number line can be found as:

(2^H) == (2^H)  10  (10^H) ==  (2^H)  2  5  (10^H)  == 5  (10^H)  ;

Another proposal: for "two and a half" we use 2 + (2^H), which avoids the 2(1/2) that reads as "two times a half". The latter traditional notation of the “mixed number” is an exception upon the general rule that terms alongside each other (like 2 km) represents (scalar) multiplication. It tends not to be explained that the traditional mixed number format is such exception. Problematic is also that kids first learn 2 × 3 and 2(1/2) as general rules, and only later learn that 2 a or even 2a is possible too, which means that they first learn the exception and only later the general rule (and it is not explained which is what). This practice involves a lot of unlearning, which is more time-consuming than learning (from a blank slate).

The following is an example addition of mixed numbers. Since we are not used to these formats, the steps are mentioned. For simplicity we do 3 × 5 = 15 but we might also leave this unevaluated within brackets till we have the final expression.

MixedNumberH["Example"]

({{, Using H, Fraction bar}, {1, (2+2 (3^H))+(3+4 (5^H)), (2+(2/3))+(3+(4/5))}, {2, 5+2 (3^H)+4 (5^H), 5+(2/3)+(4/5)}, {3, 5+2 5 (5^H) (3^H)+4 3 (3^H) (5^H), 5+((5 2)/(5 3))+((3 4)/(3 5))}, {4, 5+10 (15^H)+12 (15^H), 5+(10/15)+(12/15)}, {5, 5+22 (15^H), 5+(22/15)}, {6, 5+(15+7) (15^H), 5+(15/15)+(7/15)}, {7, 6+7 (15^H), 6+(7/15)}})

PM. The example uses H in italics also in StandardForm. This notebook uses H in output in TraditionalForm that generates those italics automatically. For input regular H is okay. Use input 3H because H3 would be a variable.

.. The number line

The use of the minus sign for both binary subtraction and the unitary negative numbers is a fluke of history (Vredenduin (1991)) that might actually be efficient in the sciences, but it is awkward for kids learning arithmetic. The minus sign is used from first grade as a binary operator a - b ≥ 0. The extra use of the minus sign to indicate the negative numbers may require too many explanatory steps at the same time: via 0 - 3 = -3 or the scalar multiplication (-1) × 3 = -3. Who only considers to use another sign, might still lose out on the algebra of H.

This notebook with package investigates whether symbolic H might make a difference by providing for an intermediate step, and not just a step but one with major didactic relevance.

Kids would know what it is: to walk in some direction, turn around, and walk back on the same path. The following display of the number line is more than a gimmick, though we still have to wait for experiments on what would really work. Kids would understand how the integers 1, .., 10 look when rotated a half turn or in a mirror. Similarly for a rotation or mirroring of the number line of the nonnegative integers.

TextRotate[][10]

TextReflect[10]

The next step would be to explain to pupils that instead of such rotated or mirrored numbers we write H x. There would be no mystery what these numbers would be, because they would indicate the positions with respect to zero (or steps forward or backward from a relative zero). We use H because we don’t want a conflict with their current understanding of a - b ≥ 0.

IntegerLineH[10]

Let us identify a cookie by 1, with 1 written in chocolate on it. Let us identify a hungry cookie-monster by H, wearing a T-shirt with H. Let a cookie-monster get a full stomach from eating precisely one cookie, and then change to a T-shirt that says 0. The rule of the game is x + x H = 0, with x the number of cookies and y H the number of cookie-monsters. Relevant questions are x + y H = ... ? How many cookies are left or how many cookie-monsters go hungry ?

For example: 7 + 3 H = (4 + 3) + 3 H = 4 + 3 + 3 H  = 4 + (3 + 3 H) = 4 + 0 = 4.

The latter shows the many steps for the first time. The following gives the core for a bit more experience.

HToZero[7 + 3 H]

In 7 + 3 H = 4, the 7 is an arrow of size 7 to the right on the number line and 3 H is an arrow of size 3 to the left, and jointly they land in position 4. This is vector addition along the line.

Once we have the line we can explain to kids, and they could understand, that a + H b = a - b, first with only nonnegative outcomes but later also outcomes in the negative section of the number line.

2 + 5 H = 2 + (2 + 3) H = 2 + 2 H + 3 H = 0 + 3 H = 3 H

HToZero[2 + 5 H]

When a finds an inverse or cancellation in H a, so that a + H a = 0, then an obvious question is what cancels H a itself. We get H a + H H a = 0. What do you see ?

MatrixForm[{H # + # == 0,H # + HoldForm[H H #] == 0}] & /@ {2, 5, 9}

It remains to be seen what kids might see indeed, and otherwise they might be told that H H = 1, and be shown by turning a full circle. For the game: a hungry cookie-monster bumping into a hungry cookie-monster turns all numbers into cookies. Do not forget to explain about cancelling cancellation. The basic model for reversibility is turning around in space but such games can be made reversible too.

Subtraction a - b ≥ 0 may be extended into a - b < 0 with its present didactics, with e.g. 2 - 5 = 2 - (2 + 3) = 2 - 2 - 3 = 0 - 3 = -3,  but the method with H (see above) provides an intermediate stage with familiar addition, that does not require (i) the switch at the brackets from plus to minus and (ii) the transformation of binary 0 - 3 to number -3.

When kids arrive at the issue of a - H b and find a + H H b, they already know H H = 1.

Once the concepts and the associated algebra are mastered, the notation of the Integers with the Minus Sign (IwMS) or the Negative Integers denoted by the Minus Sign (NIdMS) (3 H is a negative integer too) (I will not use these abbreviations) would be less of a problem and less urgent. Writing 3 H for -3 is perfectly correct, also in university (when you once state H = -1).

The integers with the minus sign thus would only be introduced once the concept of the negative numbers has already been mastered (via H) and once the issue is seen as merely a more convenient way of writing the same.

Range[-10, 10]

It is not clear to me whether H would be a useful intermediate step indeed. Perhaps it is possible to first say that a - b may also be written as a + (-1) × b and also as a + (-b), and only then construct the number line, directly using the minus sign. Perhaps it suffices to train kids better on the use of brackets. Empirical research however hasn’t had this focus since the negative numbers only appear so late in education.

Given all this uncertainty I do not want to take much risk and prefer the use of H at least as an analytical device to indicate the stages in education on our topic.

.. The additive inverse

We better reconsider the introduction of negative numbers. There is the expression a - (-b) that pupils (now in junior highschool) find so difficult. This becomes a + H H b. Subtraction involves an element of multiplication, and is not merely “the opposite of addition” (without dwelling on what “opposite” would mean). Section 3 will consider the issue. The following is usefully said here.

With the unitary operation we can define the binary one, and with the binary operation we can define the unitary one: H x = 0 - x. H is superfluous and only a way of writing 0 - x. At advanced understanding it would be a matter of taste what we prefer as the basic notion. One variable is simpler than two, but is it really ?

For kids it should relate to what their first intuitions are. They count up and count down. But they also turn this way and back again along the circle. They know what a mirror is. This causes a stalemate in what would be “intuitive”. Experiments should give the answer what works best, and this would depend upon time and place and culture, and such circumstantials should not interfere with the present steps in the argument.

There is an argument of simplicity, see above for a - b < 0 and a - (-b).  However, empirical testing might show that having H as an intermediate stage only delays the command of subtraction. Kids might also first work with 0 - 3 in symbolic form, gain command, and only then switch to -3 as a notation issue only.

The unitary operations generate the inverses, and this emphasizes the cancellation of terms. To me this is a strong argument, but one might hold that teachers might focus on cancellation too.

Let us look into this a bit deeper. The inverses help, via their very definitions, to focus on how to cancel values. “Simplify 2 + 5 H” invokes cancellation, helps to focus on what is the largest number that can be cancelled (in this case: which of 2 and 5 is the smallest), and gives (see above):

HToZero[2 + 5 H]

When we teach kids subtraction a - b and division a / b as operations in general then we may lock them in a way of thinking that is less effective than recognising the inverses. Subtraction is “the opposite of addition” and is indirect, and not direct, about cancellation, since e.g. also 5 - 3 = 4 - 2. The rules of subtraction include the additive inverse but do not emphasize it like H with its very definition. Just to be sure: using H helps to focus on cancellation, but we should avoid that kids think that it forces to cancellation. The teaching goal would be algebraic competence, so that kids know that 5 - 3 = 4 - 2 and 5 + 3 H = 4 + 2 H and other varieties. It depends upon circumstance and what the teacher instructs what the purpose of an exercise would be. “Simplify by means of the inverse” might differ from “Simpify by subtraction”.

The didactic problem might be a different one. Apparently subtraction is taught in elementary school as the absolute difference, which indeed forces to cancellation. Subtraction in Grades 1-5 has a - b ≥ 0 so that the pupil starts to expect that the first number will always be the highest. This approach in teaching locks into absolute difference, while subtraction is wider and allows 3 - 5 = -2. This requires later unlearning: what elementary school gladly hands over to secondary education. Thus, (i) at elementary school teaching actually is on absolute values, and it writes a - b while it should write |a - b|, then (ii) junior highschool kids must unlearn this abuse of a - b and learn the proper use of a - b, and then (iii) senior highschool must again master the concept of absolute value, with |a - b| finally in proper attire. It is quite a round-about, but one can understand the current situation at elementary school that alway writing |a - b| is superfluous when in their sums a ≥ b anyway. If this indeed is the diagnosis of the real problem, then its origin may still lie in the dual use of the minus sign for both the unitary and binary operations. In any case H might be an intermediate stepping stone to cure this teaching up the wrong tree.

Thus, teaching in elementary school already focuses on cancellation by treating subtraction as absolute difference, and the latter would be counterproductive but only for later education and not in elementary school itself (except for a bit in Grade 6).

The decisive criterion appears to be: what is best w.r.t. the whole curriculum. Minimise unlearning. The inverse element (x^(H ))with the crucial definition x (x^H) = 1, for values other than 0, indicates that the crux lies with the unitary operation. Others would feel that the binary 1 / x  would be more intuitive, and that the presence of 1 would be essential. It appears however that the fraction bar has needless complexity, while kids must learn about exponents anyway. The argument on the best theory should be clear.

Thus the approach below is to introduce the negative numbers by means of H, and then define the double use of -b and a - b in terms of H, so that a - (-b) can no longer be an issue. The same can be achieved by using -1 instead of H, but we are considering didactics now, also involving some algebra, and what would work best (i) in the minds of the kids, and (ii) in their handwriting. Only empirics allows kids to tell us what works for them.

PM. This approach might be self-defeating. We suggested that (x^H) is better than (x^(-1)) since the latter might suggest to kids that they must subtract something. By developing didactics for the negative numbers such that H plays a key role there too, we might actually cause that kids will have the same idea for (x^H). However, the idea is that H will be an essentially algebraic notion throughout the curriculum, basically in multiplicative form, so that the substitution with -1 only applies on occasion. The other idea is that kids would master -b and a - b and a - (-b), so that eventually H would remain relevant only for (x^H).

Again: Given all this uncertainty I do not want to take much risk and prefer the use of H at least as an analytical device to indicate the stages in education on our topic.

.. A child wants nice and no mean numbers (CWNN*)

This paper started with the idea to write some routines to support the didactics of (x^H). While doing so, I got amazed by the treatment of the negative numbers in general.  Then I intended to only briefly mention Colignatus (2015b), A child wants nice and no mean numbers (CWNN), since this extends again with kindergarten and Grade 1, but I now must refer to CWNN with emphasis, including the amendment in the paper (2018a). Both are joined in the label CWNN* (with the need for a new edition).

CWNN* namely develops the place value system with proper pronunciation of the integers, also clarifying the role of grouping (multiplication). When the integers are pronounced correctly, say 21 = two·ten & one, then it is also clear that 2 × 10 + 1 = 21. It helps understanding 2 × 21 = 42 too. Colignatus (2018a) provides a Mathematica notebook with package that demonstrates this with sounds, for English, German, French, Dutch and Danish.

PlaceValue[21, Speak -> False]

The US Common Core State Standards (CCSS) (2018) build up the place value system in kindergarten and Grade 1 and 2, while grouping (multiplication) is only introduced in Grade 3. This is inconsistent and didactically inverted.  CCSS neglects that the very pronunciation of numbers in the full place value manner (CWNN*) already employs grouping. It is better to build up the place value system together with the notion of grouping and the table of ten and the powers of ten, i.e. to the degree that is required for kids at that moment. For example, after 9, the digits are exhaused, you introduce the new place value ten, also explain that this is your new place value, and proceed with ten & one etcetera. Building up the place value system must be done in a measured manner of course. We cannot assume that kids at that stage understand about formal multiplication. It makes much sense to first learn to do something before the full explanation is given, because you may only understand the explanation when you grasp what it is about. See the reference in (2018a) to Mannoury and “The meaning of a word is its use”. The point is: much more can be done than CCSS allows for.

Colignatus (2018b) presents routines for the tables of addition and subtraction that make better use of the place value system, namely by using negative numbers. These tables now have gotten versions (included here) that use H.

The negative numbers are introduced in the US Common Core only in Grade 6 and in Holland and the UK in Grade 7 (junior highschool). Currently fractions (expressions with a fraction bar) are discussed before the negative numbers. It would make more sense to first discuss the integers (whole numbers) before their inverses (rationals, quotients). This present notebook with its package will be better understood when the reader first checks what CWNN* does.

Let us maintain consistency. As H represents a half turn, the half or (2^H) would be a quotient, and if a discussion of those would be delayed, kids would not know that 2 halves = 2 (2^H) = 1. My best suggestion at the moment is that elementary quotients like (2^H) and (3^H) (ancient Egypt knew only some like those) could be discussed in words (“per 2” and “per 3”), and indeed discussed as inverses, before being treated in formulas.

.. Vocabulary

... Negative numbers

Minus is for the binary operation. We have -7 = negative 7  = H 7 = ehta 7, and not minus 7, though minus sign seven is correct as a literal statement to describe what has been written. (In Dutch we can say 7 minus 10 = min 3.)

PlaceValue[-123, Speak -> False]

There is a distinction between (i) the single operation -x that means H x = (-1) × x = 0 - x and (ii) the the use of the digits and thus the notation with concatenation of the minus sign with some digits (other than merely 0s). We can write "-x (digits)" for the latter. While 7 H is literally "7 ehta" we can also say "negative 7" for its material meaning, whether "-7" has been defined or not. When we transform 123 into place value weights {1, 2, 3} then we also transform -123 into {-1, -2, -3}, see Colignatus (2018b).

Some handheld calculators distinguish between the long — minus and the short - negative, so that we have a — (-b). It doesn't survive in the handwriting of students, and those calculators are actually annoying (except perhaps for kids who need to learn about the distinction).

Thus, I will employ the same minus sign both for minus and negative, and will pronounce (write about) negative 7. The negative numbers however are both H x (x > 0) and the numbers with the minus sign. "Negative numbers with the minus sign" is a correct subcategory of the negative numbers but "numbers with the minus sign" suffices.

Mathematica has the minus sign hard-coded in the integers (taking 2 em rather than 1 em). The following tests (routines with Q) employ that property. The tests are useful for the routines but also for testing answers provided by students.

?MinusSignIntegerQ

?IntegerLineHQ

?IntegerHQ

... Rational numbers

For education expressions are key. If the answer is 5 then the teacher doesn’t want to see (Sqrt[25]) even though they are the same number. Education thus has standard forms. See Colignatus (2017a). There is a tendency amongst mathematicians (without a background in programming) to forget about expressions and to define numbers as equivalence classes, but explain to them that education has another objective.

The CCSS defines “fraction” by using variables, which they thus cannot show to kids:

The Common Core definition: “Fraction. A number expressible in the form a/b where a is a whole number and b is a positive whole number. (The word fraction in these standards always refers to a non-negative number.) See also: rational number.” http://www.corestandards.org/Math/Content/mathematics-glossary/glossary/

The Common Core: “Rational number. A number expressible in the form a/b or – a/b for some fraction a/b. The rational numbers include the integers.”

It is not clear to me why CCSS includes the potentiality of “expressible”, i.e. that a number might be expressed with a fraction bar but need not be so (yet). In a / b we might take b = 1, and thus for the Common Core every nonnegative integer is a fraction, even when there is no fraction bar. I doubt that this is so useful. It is tempting to take the CCSS at face value, that what they define as “fraction” really is a fraction to them indeed, but it is also tempting not to believe them, and to think that they actually have another definition of rational number in mind and that they regard as fraction only nonnegative expressions with a fraction bar. The choice of 1/b in 3.NF.A.1 indicates this too:

CCSSMathContent["Grade 3", "NF", "A.1"]

CCSSMathContent["Grade 3", "NF", "A.2"]

We cannot know what CCSS “really” thinks, and it does not really matter much, since CCSS only gives an outline and not the details for the devil to hide in. NB. This discussion is about the didactics of the fraction bar, not about what division entails in mathematics.

My definitions:

We distinguish expressions from their values. While 4  (2^H) = 2 and thus the values are the same, the expressions “4  (2^H)” and “2” however differ. Education is much about starting with some expression and rewriting it into a standard form.

Our present discussion is about the didactics on expressions. There are expressions with a fraction bar and expressions with an exponent H.

As a general rule: avoid the term “fraction” since it is littered with confusions. The term “fraction bar” however would be unambiguous and refer to an expression rather than a numerical value.

A quotient is an expression “n (d^H)” in which d ≠ 0. For this quotient, n is called the numerator and d the denominator. The expression with a fraction bar is “n / d”, which we can mention but will not study deeply because its further use causes more awkward terms.

Rational number: A number expressible in the form c + n (d^H) for integers or rational numbers n, d and c, where d ≠ 0. This form makes a number a rational number, but it is not yet the standard form for a rational number. For example, 2 - (2^H) would not be in standard form but we can already discern that it is a rational number. See below.

The rules for the standard form might be seen as being quite involved. A quick method is to ask Mathematica to determine the integer and fractional parts of a rational number, and then compose the whole number from adding these. Let us use a negative number. If the fractional part is nonzero then traditionally we get a fraction bar but the proposal is to use exponent H. This use of H only involves the exponent while we can keep the minus sign for subtraction and negative integers.

The quotient part and Mathematica’s FractionalPart are both unambiguous, and unambiguously the same, but I advise the term quotient to avoid contamination by confused notions about what a “fraction” would be. (E.g. Mathematic’s FractionalPart differs from the CCSS fraction since the latter only has nonnegative numbers. Perhaps FractionalPart is what some might call a pure fraction, to distinguish this from the mixed number, but the mixed number would still be a “fraction” according to CCSS.)

-80/ 9    // ToH   // Evaluate// SortH  (*standard form*)

num = -80/ 9; ip = IntegerPart[num]; fp = FractionalPart[num]; ip + fp // Inactivate  (* Inactivate does not resolve the + - *)

The standard form for the rationals using the minus sign is as follows.

If a rational number is equal to an integer, it is written as this integer, and otherwise:

The rational number is written as an integer plus or minus a quotient of natural numbers.

The integer part is not written when it is 0, unless the quotient part is 0 too (and then the whole is the integer 0).

The quotient part has a denominator that isn't 0 or 1.

The quotient part is not written when the numerator is 0 (and then the whole is an integer).

The quotient part consists of a quotient (form) with an absolute value smaller than 1.

The quotient part is simplified by elimination of common primes.

When the integer part is 0 then plus is not written and minus is transformed into the negative sign written before the quotient part.

When the integer part is nonzero then there is plus or minus for the quotient part in the same direction as the sign of the integer part (reasoning in the same direction).

?IntegerPart

?FractionalPart

?MixedNumberH

.. Support by Mathematica and the new package

... What is required

H = -1 is simple, but introducing it when it isn’t used yet comes with some complexity.

The body of the text deals with the issue and didactics on content, but there is also a technical aspect:

Routines that mimic what kids would do with pencil and paper.

Routines for teachers and research on mathematics education, both for clarification and for everything to work.

... What is provided by Mathematica

Mathematica already provides most of the didactics using H. However, some elements appear to be missing. The new routines provide much of what is lacking. Mathematica has the following built-in:

-2 // FullForm

-b// FullForm

1/b  // FullForm

We have subtraction a - b as the binary operation. This can also be seen as a + -b, so that we might argue that there is no need for that binary operation called “subtraction”.  Mathematica already provides for this approach. However, it still allows us to call it subtraction.

?Subtract

To summarise, we have these four built-in properties.

{-2,  -b,  a - b, 1/b} /. -1  -> H  (*RuleAnyToH*)

The integers with a minus sign -1, -2, -3, .... are hard-coded within Mathematica. Obviously this would remain so because of its application in the world of science. The inclusing within Mathematica of H as a universal constant alongside i, Pi and E does not require also such adaption of the integers with the minus sign. Potentially, though, for education, there might be created a setting of the Preferences, that employs H in above use of Times and Power.

Unfortunately, Mathematica uses Minus[x] for -x, while we use minus for the binary operation Subtract. Minus[2] is immediately hard-coded into -2. It would have been bettter to use Negative[x] for -x, and NegativeQ for what now is Negative.

Minus[x]

?Negative

Remarkably 1 / b is coded as (b^(-1)) but displayed with a fraction bar. Even more remarkable, this also happens for input  (b^(-1)) itself, that has the proper form in both input and FullForm but not in display.

{1/b , b^-1}

In the early years, Mathematica printed numerator and denominator on separate lines, separated by another line with dashes. There still is a remnant in ToString, with the newline character “\n”.

b^-1// ToString // FullForm

The puzzle is only complete when all pieces are at their proper places, and we must do some programming to get them there.

.. A quote by Vredenduin 1991

The use of H introduces an aspect of abstract thinking alongside mere calculation, though calculation can also be regarded as the routine application of some abstract rules. This abstraction is not necessarily at the highest Van Hiele level though. Thus, we distinguish between (i) (natural) basic abstraction and (ii) the more involved abstract modeling at the highest Van Hiele level.

Piet Vredenduin (1909-1996), a Dutch teacher of mathematics and author in mathematics education, helps us to see the distinction. In his booklet on positive and negative numbers, that also relates how confused our ancestors have been on the negative numbers, he closes with this statement (1991, p119, my translation):

“from reality, a particular structure is distilled by abstraction. This structure is investigated apart from reality by means of deduction. Because of its origin the derived properties of this structure can be applied to reality again.”

This is the obvious answer to Eugene Wigner’s suggestion of magic, in his statement on the “unreasonable effectiveness of mathematics in the natural sciences”. I actually gave this answer myself before I read Vredenduin - see also Colignatus (2015e) - but it is quite nice to quote Vredenduin precisely from this booklet on positive and negative numbers.

The quote clarifies the distinction between basic and developed abstraction. My suggestion is that abstraction forms part of the notion of thinking itself. Since pupils are human, their minds are not strangers to thought and abstraction. As teachers we can encourage students to work with abstraction in a more controlled manner. Abstraction is also a very simple notion, for it means: leaving out things. Abstraction however appears hard to do, when one depends upon context (e.g. for lack of space in working memory) and when it is obviously possible to leave out what you should actually focus on.

We can deal with expressions with H via algebra or tables of addition and subtraction. Before we look at such tables, we better first master some algebra (for the tables rely upon this too, actually).

There is the approach that kids better learn solid methods first (by drilling) before they would be capable of understanding what they are doing. I already indicated that this has a core of truth. However, my approach is that mathematics should be clear by itself. Mathematics by itself will support various teaching and  learning strategies. Tradition appears not to be clear at all. The traditional approach to negative numbers and rational numbers is cumbersome (which invites drilling) and thus is better be replaced by a clear approach, whatever the teaching and learning method. (If you must drill: do it on something that is clear.)

.. Considerations on the multiplicative inverse

The use of exponent H causes a shift of attention from the rules on the fraction bar to the rules on exponents. Kids might not be ready for exponents, but this must be established by empirical research. We should not reason from the current situation with the fraction bar for its sake only.

Kids must learn the rules for exponents at some time anyway, the sooner the better, and there is really little use of learning about "division" in two separate ways - and spending most time on the clumsy fraction bar merely because it had more momentum in history.

Many, if not most, people who learn that (x^(-1)) is the same as 1 / x, wonder why there are two notations for the same thing. Van Hiele set the step to wonder what would be didactically best. The proposal to use the exponent for didactics thus is not new. The proposal to use the universal symbol H that can be interchanged with the value -1 is not so new either: Peter Harremoës (2000) discussed a much more involved idea on the negative numbers though with different notation. My innovation is to see the relevance for didactics: to combine these notions, choose the single element -1, select H as the symbol that may remain unevaluated, and clarify the meaning for didactics in texts like this notebook.

There may be people who regard (x^(-1)) = 1 / x as a great discovery, i.e. the wonder that division is related to exponent -1. I am sorry to say that these people then lack in acumen, and this might even hold for mathematicians. The meaning of the identity sign is that 1 / x is superfluous, just like H x = 0 - x  means that one of these representations is superfluous. The meaning of our present discussion is that 1 / x is  counterproductive in didactics. See below for a comment on Group Theory.

The following gives an overview of the relevant algebraic rules for H, and they are simpler than the rules for the fraction bar. (If the idea is that the fraction bar employs more space of writing, and the exponent doesn’t, by current conventions, and if this space of writing is important, then employ more space of writing for the exponent too.)

??RuleAlgebraH

.. Two possible strategies for R&D and implementation in education

Writing this notebook and programming its package was quite a delicate issue. The next step of suggesting an application of H in mathematics education and its research is so too. We no longer have the small classroom and full freedom for the teacher, but we have systems with Common Core State Standards, universities and colleges packed with researchers and trainers of teachers, and, not to forget, textbook publishers.

My research and this paper started out with (x^H). This could be used in Grade 3-6 without telling kids that H = -1. It suffices to use algebra with rules like x (x^H) = 1 for x ≠ 0.

The next obvious idea was that H might also be used for the expression a - (-b) that kids find hard. It is no longer difficult with a + H H b.

This caused me to do a more fundamental evaluation of the curriculum on negative numbers (i.e. with its consequences for division, rationals, fractions (i.e. expressions with the fraction bar) and mixed numbers).

This discussion no longer belongs here and starts in Section 3.

The paper has become quite involved, and a solution was to put details per stage and the routines into Appendices. The reader may still recognise the structure of (i) a core argument on (x^H) (stage 7) and (ii) a supplementary - though more fundamental and apparently for school more dramatic - argument on the negative numbers.

Thus, this paper distinguishes two strategies for R&D and implementation:

Keep H unevaluated and use it only as a symbol for the multiplicative (scalar) inverse (x^H) with rules for algebraic manipulation, like the fraction bar 1 / x also has rules for manipulation. This would replace the treatment of “fractions” in Grade 3-5 by a more efficient curriculum, since kids have to learn about exponentiation anyway. This option would leave the current treatment of the negative integers unaffected.

First discuss the integers (whole numbers) before doing fractions.  In the US Common Core, negative numbers are only introduced in Grade 6. Thus, interchange the treatment of negative numbers and rationals. This helps kids to get used to the notion of an inverse as well. Start with the additive inverse and the negative integers in Grade 2 and complete them in Grade 3, so that Grade 4-6 can look at the multiplicative inverse (x^H) and benefit from better command of algebra.

. Didactics on the negative numbers

.. The importance of empirical research

It may well be that the use of H for addition and subtraction can remain restricted to being a small tool for the local illumination of a - (-b) as a + H H b with the rule that H H -> 1. This can only be shown by field experiments. It are the kids who tell us what works for them.

Alternatively, the use of H might also appear to be a useful tool to bridge gaps of understanding by introducing H x before introducing -x (digits). Yet, H might also delay such understanding. My idea is to eliminate unlearning but perhaps the introduction of H would require such unlearning when kids arrive at the stage to learn about the integers with the minus sign.

A serious question is whether negative numbers using H could be introduced in Grade 1 already: and I also pose this question to indicate my own lack of knowledge for this area. Currently I propose to start with H in Grade 2 because of my preference to assume that kids can read and write and have some command of the place value system. Colignatus (2018b) presents tables of addition and subtraction that have better use of the place value system: and those also use negative numbers (though we may tell kids that they use subtraction). It would make sense to be able to use tables with H in Grade 1 too.

Indeed, the introduction of the negative numbers is best evaluated while also other confusions in mathematics education are resolved. It is not urgent to know what component would bring the greatest improvement as long as the whole package appears to be better.

Empirical testing might generate results that are only locally relevant, in some time and place and culture. Perhaps empirical testing only generates “general results” that only confirm the internal logic. Or, perhaps this application of H only remains a theoretical exercise. For now, it helps to identify the 7 stages below, and the relevant questions for field testing.

.. Transition from counting to addition

We looked at contexts in real life but the true problem might be quite different.

The following table will be used by kindergarten teachers and not the pupils, but the pupils would see it at least in Grade 1. The table highlights the issues - I thank pedagogue and teacher drs. A.I. Roessingh for this insight. Key didactics is to properly internalise the Table of Basic Addition, since this is the transition from counting to addition. Pupils who get stuck at counting - still using their fingers - will not have properly internalised this table. (Its “version in sounds” is a key part of memorisation.) NB 1. The table is oriented like the system of co-ordinates. NB 2. Taking an element within the table also shows subtractions, e.g. 7 - 5 = 2 and 7 - 2 = 5.

TableOfBasicAddition[]

Key insight: This same requirement on internalisation likely holds w.r.t. the basic negative numbers.

Since I want to avoid the confusion between operation with minus and the operation that creates the negative numbers, I now assume that the number line has been extended for kids with H.

IntegerLineH[5]

We might use the right hand fingers for the positive numbers 1-5, the left hand fingers for the negative numbers (using coloured bands to indicate the special use, or paint finger nails), and a double fist for zero. We now have addition a + H b, which is still addition. Say “2 plus negative 2 gives 0” (and use plus). I would be in favour of short “neg” and “pos” but this is not at issue here. Kids would have to memorise such a Table Of Basic Addition to work with negative numbers, in the same way as they have to memorise the table for 0-10 in order to make the transition from counting to addition.

TableOfBasicAdditionH[-5, 5]

.. Place value system: implicit vectors and negative numbers

Kids who haven’t learned arithmetic cannot later learn algebra (well). In another perspective, arithmetic is a form of algebra. The rule x + H x -> 0 is algebraic but might also be seen as calculation when applied to numbers. In the end it might be merely an issue of perspective. The tables of addition and subtraction that use the place value system use both algebra and calculation.

The place value system has these features:

When kids can count then they also know what they are counting: fingers, cars, apples. Thus we also can discuss with them what they use as the unit of account. For the place value system, the trick is to use multiple units of account. We have blue baskets that contain only 1 apple and red baskets that contain 10 apples. When we have 10 blue baskets with 10 apples, then we replace this with one red basket of 10 apples, and count 1 of 10.

In currect education vectors do not seem to exist, but they are used. For us, there is a difference between 10 and {1, 0}, but teachers employ the number 10 in place value manner with ample space for the positions, which we can best model as {1, 0}. Thus, below we will use the notation {x, y, z} for such use, though TableForm will print without brackets and commas again. The values x, y, z are the weights of the place values, and can also be called the “count for 100, count for 10, count for 1”.

ToSingleDigits[countfor10, countfor1]  (*highest place value first*)

In terms of vectors we have {1, 1} + {0, 9} and then the rule for overflow.

{1, 1} + {0, 9} -> ToSingleDigits[1, 1] + ToSingleDigits[0, 9]

When we do not want to change a sum then we add 0, but we also can use “1 of 10 - 10 of 1 = 0” on the place values. The negative numbers have a natural use in the tables of addition and subtraction that use the place value system in a better manner. We now use a minus sign that might be explained as subtraction, but below we will use H.

{1, -10} -> ToSingleDigits[1, -10]

Level transition from 10 counts for 1 into 1 count for 10.

ToSingleDigitsTable[10]

The tables of addition and subtraction consist of two parts.

The first part (first line of + + + or - - -) is the addition or subtraction per position.

The second part (second line of + + +) calls ToSingleDigitsTable that reallocates these results according to the rules of the place value system.

This addition table first creates line 4 as output, and the second step takes line 4 as input.

AdditionTable[11, 9]

Good didactics is to start with the (2), so that the tables of addition and subtraction that start with (1) can use what has already been trained on.

?ToSingleDigits

?ToSingleDigitsTable

.. Considering Grade 2

I look at Grade 2 because I want to assume that kids have learned basic reading and writing, and have some grasp of the place value system, see Colignatus (2018ab).

... Van Hiele levels. Materials -> basic abstraction -> developed abstraction

I agree with the notion in didactics that kids would work with materials first and models later. This relates to the Van Hiele levels of insight. Taking 3 apples from a basket of 5, so that 2 remain, is a commonplace material method in Grade 1 to teach a - b ≥ 0.  The reference to the use of materials should not obscure that the kids actually perform basic abstraction, for this is what thinking entails. It are not robots who take 3 apples from the basket. Subsequently I would protest when a negative number as in 5 + (-3) = 2 might be seen as a “model” at the highest Van Hiele level. Traditional arguments would be, roughly put: “negative numbers do not exist”, and “you cannot have -3 apples”. The latter puts the negative numbers at the highest Van Hiele level of abstraction, so that they would be inaccessible to kids who are supposed to be working at lower levels. This however would be an invalid application of Van Hiele’s theory. There is also abstraction at a lower level than such involved modeling (check Vredenduin). Counting and addition are activities rather than objects, and we still teach them. Negative numbers are a modification of such activity, namely reversing and cancellation, and would be at the same level of comprehension.

There are also contexts from real life: (i) kids can walk in a direction, turn around and walk back along the earlier path, which turn is given by H = -1, (ii) there is the system of 2D co-ordinates, and kids might be able to read a small map, (iii) kids know about mirrors, (iv) see the argument on -3 apples and the hungry cookie-monster above.

Kids in Holland must understand what -1 degree Celsius is. It is not clear to me how teachers in Holland deal with this,  as the negative numbers appear only in junior highschool (Grade 7). The US Common Core is quite prim with the introduction of the negative numbers, namely after the fraction bar and only in Grade 6. The US might avoid the temperature problem by using Fahrenheit. Bellamy (2015) reports on the UK and properly warns that these temperature measures have an interval scale and that only Kelvin has a ratio scale.

Perhaps as a last resort, parents could open bank accounts for their kids’s pocket money, and allow figures in the red. Perhaps the world financial system would support the introduction of negative numbers at an early stage in education.

... Negative numbers exist in tables of addition and subtraction

We actually have this situation:

The current curriculum has few examples of the use of negative numbers, and thus it might appear that they are not required, but actually there has been deliberate effort to exclude them, glossing them over where they better be mentioned. Teachers within the system might not be aware of such deliberation as this occurred somewhere in past tradition.

The negative numbers clearly "exist", namely in addition in the place value system. Conventionally these negative numbers are not shown, but the suggestion is to show them.  See Colignatus (2018b). For example:
15 + 8 -> {1, 5} + {0, 8} = {1+0, 5+8} = {1, 13} = {1, 13} + {1, -10} = {1+1, 13-10} = {2, 3} -> 23, 
using {1, -10} -> 0.  
The RHS table gives the levels only, the LHS table gives the differences too .

BothMixedAdditionTablesH[15, 8]

In Holland, the RHS table is commonplace. This means that the calculation on 13 + (-10) is glossed over. It is only said that “the overflow is passed on to the next place”. To a large extent it is fair that kids can learn to ride a bike without fully understanding Newton’s laws, yet a good case can be made that an early introduction of the negative integers would both be understood and work wonders (such as understanding of the place value system). The LHS table uses the algebraic rule that x + x H  = 0 (so that we do not change the sum) and assumes that kids can can play the cookie & hungry cookie-monster game.

Importantly, we now have a unified method that also allows for subtraction, seen as addition with H. The following would be a table of addition using H, see Colignatus (2018b) for the form without H.

BothMixedAdditionTablesH[14 , 6H]

This example crosses the zero boundary.

BothMixedAdditionTablesH[17 , 25H]

... Types of multiplication

It all depends how difficult kids find the notation and relation H 7 = (-1) × 7 = -7, or the relation of a number to a scalar multiplication of itself. When elementary school has explained multiplication as grouping only, then students may get stuck. This doesn’t mean that the topic by itself would be complicated, only that elementary school has turned a blind eye to this distinction in types of multiplication, and to the negative numbers in general. Above notation of course assumes (-1) as a basic concept without yet an explanation of (-1) × 1 = -1.

... Not all abstraction is at the highest Van Hiele level

Thus a key point is: there is quite a difference between abstraction as in Euclidean axiomatics (earlier taught in junior highschool, which inspired Van Hiele) and the abstraction that we are discussing here.

There is also this joke: A biologist, an economist and a mathematician watch an empty house. A man and a woman go into the house, and some time later they leave the house again, taking along a third person. The biologist clarifies: “They have procreated.” The economist clarifies: “The assumption that the house was empty was false. There was at least one person already there.” The mathematician says: “Well, the assumption that the house was empty has been made, and there is no need for new assumptions on biology, for there is now -1 person in the house.”

In other words, it is a matter of abstraction indeed, but not immediately at the highest level, and the issue is whether kids can be guided from basic abstraction to a proper handling of the negative numbers, by means of proper didactics and examples from daily life and history.

.. Incoherence in Math Ed research

There appears to be a remarkable incoherence in mathematics education and its research w.r.t. the negative numbers (too), which reminds of the problems that the world itself had since the discovery of direction by Albert Girard in 1629 and the introduction of the number line by John Wallis in 1673 - see the discussion by Vredenduin (1991).

The critical reader will look at my list of references (though see also CWNN*), to check whether I have read sufficiently wide to warrant this diagnosis of "remarkable incoherence". There are no such wide references, and the reason is that I looked at some and was quite disappointed - and there is no need to list those and explain my reaction. Let me give three examples though.

Skemp (1973) is recommendable but his treatment of the negative numbers (p201) is cursory and off-topic. He gives examples of operations that cancel each other, and then states: "In the mathematical realm, adding two and subtracting two are opposite operations which cancel. So let us represent these operations by (+2) and (-2), using parentheses here to show that the + or - sign is fused with the 2 to represent a new kind of number." Skemp’s "So" is overworked. Apparently (-2) now is an operation itself, and (-2)[x] = x - 2. Admittedly it is feasible and we can enhance this by equivalent classes so that (-1-1) is equivalent to (-2), but I am afraid that we are far adrift from "number sense" now, and this doesn't help education of the negative numbers.

David Tall is famous - together with Eddie Gray - for the notion of a “procept”. The various uses of the minus sign make it a procept indeed. While Tall seems to support the deliberate use of procepts, I would rather advise to deconstruct them into components, to support the better understanding of the separate uses. David Tall (2013:101) mentions under "squaring a negative number" that some students cannot distinguish -(3^2) and (((-3))^2), but this may well be a problem on using brackets and not be a problem of understanding negative numbers by itself. Overall, Tall in this book is doesn't help on our topic- but his book has another intention. One should know though that his book misrepresents the contribution by Pierre van Hiele, see elsewhere.

Anna Bellamy (2015:4) states: "I could not find a standard textbook that would present a convincing argument to Year 7 students why it is that "two minuses give a plus"." This should be "why two negatives give a positive", but she herself makes this distinction and is only quoting the confused student here.  Her finding is: "the main challenge in introducing negative numbers lies not in broadening the number system, but in (re)defining the four basic operations: addition, subtraction, multiplication and division." (p1). Perhaps, but when most kids have a confused grasp of such operations anyway, and kids are confused because their teachers are confused, then you cannot really draw that conclusion, and then you are not merely dealing with the introduction of negative numbers but dealing with the redesign of mathematics education itself, see https://zenodo.org/communities/re-engineering-math-ed/about/.

I stopped reading these texts. My strategy now is to first write up what my diagnosis is, and proceed from there.

.. Comment on variables

Our discussion uses variables. This essentially serves teachers. Pupils will work with numbers, and our variables are their schemes (learning from examples). However, it is very likely that pupils already can work with variables. They already know that “John” is a name, that can be used to identify a particular person, but there are more people of that name. Or they know that “a number” stands for a number without specifying which. Thus x is a name that can be used to identify a particular number (and not indicated which: actually any number). The use of variables in elementary education however is another topic, and not material to this present notebook.

Identify where the situations are incomparable so that kids would be lost:

Harry is a cop running after Rick who has stolen an apple. George runs along and tries to help catch Rick. George is a world champion in running, for both short and long distances. Who runs fastest is called the winner. Who is the likely winner: George, Harry or Rick ?

There are three numbers: 4, 6 and 7, and x is the highest even number. What is x: 4, 6 or 7 ?

We might not use x but a more fancy expression, and allow kids to use their own variable names, with x as one of the options.

This would seem to fit the US Common Core for Grade 2.

CCSSMathContent["Grade 2", "OA", "A.1"]

However, looking at the CCSS “Glossary Table 1”: they use the question mark (2 + 3 = ?) instead of “x = 2 + 3, what is x ?”. I would prefer that the question mark is not abused as a variable. (CCSS is somewhat crooked: using a symbol but it cannot be a proper variable, because then some theorists of mathematics education might hold that kids cannot use variables yet.)

By another fluke of history, the multiplication sign × looks too much like x, especially when discipline to use italics for x is lacking. We better keep the international convention on the x-axis and y-axis. Later multiplication either disappears as in 2 x or is replaced by 2 * x. My suggestion is that elementary school follows the latter convention. If you really must, start with 2 × 3, but once x appears on the scene then use 2 * 3.  This is also supported in Mathematica.

?Times

.. Comment on group theory

Van Hiele continued his proposal on the inverse element (x^(-1)) by proposing group theory for school, arguing that pupils can do more in abstract thinking than often presumed. The use of H might be an amendment to group theory itself (which amendment of H is not discussed by Van Hiele). The Abelian group requires inverse elements, and is tricky about the operation that creates the elements. Mathematicians are lawyers of space and number, and they can create mental constructions that seem right but that are not necessarily the most relevant ones. For the operation of addition, the inverse element of x currently is -x but would become H x. For the operation of multiplication, the inverse element of x currently is 1 / x or (x^(-1)) but would become (x^H). Strikingly, the inverse element basically uses an operation, and engages what we currently perceive as properties of a higher level: for addition we use (scalar) multiplication in H x, and for multiplication we use exponentiation. Current group theory covers this up by looking at the elements only, and by suggesting that -x would be at the same level as addition, and that 1 / x is at the same level as multiplication. This focus on elements and not operation serves only to have the Abelian group look nice and neat, but without attention for what is really happening. Thus: (a) It would be clearer to presume the existence, not of “inverse elements”, but the existence of an “operator to generate inverse elements w.r.t. another operator”, which operator already has features of the next level of modeling. (b) An argument that current education is structured along the Abelian groups because addition and subtraction would be “at the same level”, and multiplication and division would be “at the same level”, abuses the term “same level” (defining what needs to be proven) and thus would be rather blind to what is really happening. (The Abelian group is a theory and not a discovery for ideal didactics.)

(A portal and no source: https://en.wikipedia.org/wiki/Abelian_group)

PM. For multiplication, we distinguish between scalar multiples and grouping. We do not write 2 km as 2 × km. While H is a scalar, we still tend to call H x the additive inverse, with x + H x = 0. Thus we would call (x^H) the scalar inverse instead of the grouping inverse. However, the term “scalar inverse” tends to confuse with H x. Thus I settled for “multiplicative inverse” though it is less precise.

. Stages in didactics and properties of Mathematica

.. Structure

We start with the stages in didactics on our topic. We identify properties of Mathematica that relate to those stages, in support or in conflict with the intended use (Appendix A). We develop routines that use and respect those properties (Appendix B). Subsequently, we look at the properties of the routines, and relate them to the stages in didactics (Appendix C). Finally, we discuss the stages, in the main body of the text again, using the routines and what Mathematica already has provided. We manage these different aspects by (i) discussing the stages in the main body of the text, (ii) moving the issues on programming to Appendices, and (iii) putting details on the stages in separate discussions too.

.. Stages

Working with the minus sign has four aspects: (i) multiplication with a scalar, rotation in the plane,  or mirroring along the number line, (ii) the operation on two elements (“extending” plus), (iii) the exponent, (iv) notation: concatenating the minus sign with digits (theory of expressions). Thus there is a mixture of content and notation. The use of H helps to better distinguish these aspects.

We can recognise the following 7 stages in the curriculum, if we were to introduce the negative numbers. These stages are introduced here, and details are in the separate discussions. There, we relate the Stages to the Grades relevant for the US Common Core State Standards (CCSS) (2018).

Kindergarten. Speaking and listening, using practical examples. Though there is no reading and writing, the vocabulary should be unambiguous (at university level of precision). For example, large and small concern absolute sizes, while more and less, and high and low, concern relatives and thus may imply negative numbers (currently glossed over with deliberate effort). Temperatures are “below zero” and not “smaller than zero”.

Reading and writing. Addition and subtraction with nonnegative integers and differences, i.e. with a - b ≥ 0. Perhaps we should use a + H b from the start, and only later introduce a - b, but this better be tested and it seems wiser to currently start from the usual base.

Introduction of the negative integers (i.e. H) and the number line with H by rotating or mirroring the positive numbers. Thus not the numbers with the minus sign yet. This is only a definition, and can be given in 15 minutes, but it requires attention and precision.

The current routine rotates at the center of the string on the left, for simplicity of programming, but it would only be correct to rotate at zero. The rotation routine input doesn’t use angles but turns in [0, 1].

(TextRotate[#][5]& /@ ({0, 1, 2, 3, 4} / 8 (*turns*)) ) // MatrixForm

TextReflect[5]

IntegerLineH[5]

H x is clearly both a scalar multiplication of x and a position resulting from this.

There is a clear relation between this number line and the rule x + H x -> 0.

There is no conflict with the already existing use of a - b ≥ 0.

Addition with H. This is vector addition along the number line. With 5 an arrow to the right and 3 H an arrow to the left, the result is an arrow 2 to the right, which is 5 - 3 = 2. Application to a H itself gives a H + a H H = 0 and H H = 1. Pupils already know a - b for nonnegative outcomes, and we can identify a - b = a + H b, so that addition with the new numbers means a subtraction in the familiar numbers.

Extension with a + H b = H c < 0. This arises naturally, e.g. 5 + 7 H = 5 + 5 H + 2 H = 2 H. 
Subtraction a - H x gives a + H H x. A key rule is H H = 1.

Writing -c as alternative to H c.  Once kids are familiar with working with the extended number line then it is only a question when it would be the right moment to switch to the integers with the minus sign (IwMS). This is an international standard that they must master too. Kids translate expressions with H into expressions with the minus sign. Working with the minus sign, they might want to transform back to H to make sure that they understand it properly.

IntegerLineH[5]  // FromH

This number line gives only positions and there is no clear scalar multiplication in -a. Only by deliberate discussion it is seen that (-1) × a = -a and also 0 - a. The interpretation by rotation or mirroring is not clear either (while H has been introduced as such).

There is an implied relation between this number line and the rule a + (-a) -> 0, but it can be doubted whether the line is conventionally introduced this very manner. (“Here on the left, we want a number x so that 5 + x = 0. Let us write this x as -5 so that we have 5 + -5 = 0.”)  Brackets would tend to be needed here, since a + -a might read as a +- a, but perhaps the latter is intended.

If introduced “just like that”, there is a direct conflict with the use of the binary minus. There is no time to build this up, and it requires the immediate definition a + (-a) = a - a = 0.

It is not clear to me whether H would be a useful intermediate step indeed. Perhaps it is possible to first say that a - b may also be written as a + (-1) × b and also as a + (-b), and only then construct the number line, directly using the minus sign. Perhaps it suffices to train kids better on the use of brackets. Empirical research however hasn’t had this focus since the negative numbers only appear so late in education. Given all this uncertainty I do not want to take much risk and prefer the use of H at least as an analytical device to indicate the stages in education. (Lines copied to above.)

Exponent H. Once kids have mastered subtraction, H remains useful forever for the exponent. We get: multiplicative inverse element, rational number, mixed number.

?IntegerLineH

?FromH

.. Common Core on fraction bar and negative numbers

Grade 2 has pupils working with counts of hundred, but it would be better to have -10 first, since the objective is to get to understand the place value system and the properties of addition and subtraction, with -10 appearing in the tables of addition and subtraction.

Common Core is early with the fraction bar in Grade 3, 4 and 5, and late with (some) negative numbers only in Grade 6, see http://www.corestandards.org/Math/Content/NF/. In Holland kids have to wait till Grade 7 (junior high) before they see -1.

My suggestion is to turn this around. The negative integers can be handled in Grade 2 & 3, and the numbers with exponent H (no fraction bar) can be dealt with in Grade 4, 5, and 6.

Stage 3 would apply to Grade 2.

Stage 4 would apply to Grade 2 & 3.

Stages 4, 5 and 6 would apply to Grade 3.

Stage 7 would apply to Grades 4, 5, 6.

See also the Vocabulary in the main body of this paper.

PM. The Common Core states on the current order (my emphasis):

Common Core Grade 2: “Students extend their understanding of the base-ten system. This includes ideas of counting in fives, tens, and multiples of hundreds, tens, and ones, as well as number relationships involving these units, including comparing. Students understand multi-digit numbers (up to 1000) written in base-ten notation, recognizing that the digits in each place represent amounts of thousands, hundreds, tens, or ones (e.g., 853 is 8 hundreds + 5 tens + 3 ones).”

CCSSMathContent["Grade 3", "NF", "A.1"]

CCSSMathContent["Grade 3", "NF", "A.2"]

The Common Core introduction: “In Grade 6, instructional time should focus on four critical areas: (1) connecting ratio and rate to whole number multiplication and division and using concepts of ratio and rate to solve problems; (2) completing understanding of division of fractions and extending the notion of number to the system of rational numbers, which includes negative numbers; (3) writing, interpreting, and using expressions and equations; and (4) developing understanding of statistical thinking.”

.. Routines and stages

Educational settings can contain various elements or combinations: positive numbers, zero, numbers with H, or  a mixture including also the numbers with the minus sign. To provide for the stages and this richness in educational settings, it is useful to have a supporting richness in routines.

In below table, the first three routines or rules are discriminatory on what they exclude, and the last three routines or rules are discriminatory on what they include.  While kindergarten would not read and write (at least not what we are currently discussing), kindergarten teachers and researchers however can use some routines to help design the curriculum and lesson plans.

For this table it is important to understand that -1, -2, -3, ... are hard-coded in Mathematica.

({{Adapts  , -expr, -2, -3, ..., -1, Times[-1, b], Power[b, -1], Stages}, {RuleNegativeToH, yes, yes, yes, yes, yes, 1-5}, {MinusSignToH, -, yes, yes, yes, yes, 1-5}, {RuleAnyToH, depends, -, yes, yes, yes, 6}, {TimesToH, -, -, -, yes, -, 1-6}, {ToH, -, -, -, -, yes, 7}, {BothToH, -, -, -, yes, yes, 6}})

{(-1 /. RuleNegativeToH),      MinusSignToH[-1],      (-1 /. RuleAnyToH)}

{TimesToH[-1],    ToH[-1],      BothToH[-1]}

?RuleNegativeToH

?MinusSignToH

?RuleAnyToH

?TimesToH

?ToH

?BothToH

.. Routines for education

We mimic students and do not suppose that they will use these routines. The intention of these routines is not to find a final solution, which Mathematica already provides, but to mimic the steps that students would take. This appears to require attention, as Mathematica may have the tendency to simplify 4 (2^H) into (2^(2+H)) while we have no need for that.

Most routines func[expr] have supporting rules (Rulefunc}. Functions may use (various) rules once or repeatedly depending upon the implementation. func[expr] might be thought of as a button, while the rules might be applied for separate steps. A strategy is to provide functions that show the steps, like HToZero[expr] here. However, questions can be very diverse, HToZero is a lone example of such a routine, and the present focus is on the principles of design rather than providing such routines.

The routines transforming from minus and negative to H have a HoldFirst property. Translating 1/2 + 1/ 4 into the format with H should not first simplify into 3/4. An alternative design would be to require HoldForm[1/2 + 1/4] as input, but this seems overdone for such frequent occurrence. One may always use ClearAttributes[f, HoldFirst], see the routine HoldFirstH that can do this clearing and setting for the four main routines.

Pupils will first use x + H y and exercises will be to simplify (find “the answer”). This involves use of HToZero[expr], AlgebraH[expr] and SimplifyH[expr]. When learning minus, they would use MinusSignToH[expr] for checking up. Simplification by means of AlgebraH removes the HoldForm. However, at other places Mathematica may change (4^H) into (2^(2H)), and then we require some redress.

Once the minus sign has been mastered, H is only relevant for the exponent. Pupils would learn rationals and mixed numbers by means of exponentiation. We would want them to know a bit about the fraction bar too, given its common use. They would learn that y / x = y (x^H), but they would not have to learn the more complex rules for the fraction bar, such as 1 / (y / x) = x / y. The latter rule in algebra is (((y (x^H)))^H) =  (y^H) ((((x^H)))^H) = (y^H) x. For checking up, ToH[expr] remains the relevant routine for the remainder of school. PM. Deliberately, it isn’t called PowerToH, since the latter might be confusing in Mathematica, because of the distinction witin Mathematica between Rational[n, m] and n Power[m, -1].

There might be an intermediate stage. When division and its exponential form are introduced, then this might be in combination with subtraction. Then BothToH[expr] is the relevant routine. As said, these routines test on particular patterns. When this would be too subtle, then RuleAnyToH replaces -1 by H indisciminately. If the numbers with the minus sign are to be included, e.g. -3 -> 3 H, then use RuleMinusSignToH. This however also affects the representation of the rationals.

PM. In all cases FromH[expr] substitutes H -> -1, and Mathematica will provide for an expression with a fraction bar if this happens conventionally.

.. A summary overview

We may summarise our discussion.

In elementary education, kids learn addition and subtraction first. When kids count from 6 to 7 then they also count back, and when they add 6 + 1 = 7 then they can subtract 7 - 1 = 6. For the lowest levels, with nonnegative numbers, a - b ≥ 0 would be unproblematic, except when it causes a lock-in on absolute differences, or when prevention of the lock-in comes at a loss of the awareness of cancellation.

Currently grouping (multiplication) is only discussed informally in Grade 1-2 and formally in Grade 3. The development of the place value system will benefit when pupils will have seen grouping (multiplication) with 5 of 4 = 5 × 4 = 20.

Our topic arises when the negative numbers are introduced, with the stumbling block of a - (-b). We would not have negative surfaces and volumes yet, but negative co-ordinates are quite practical.

At that didactic moment, the use of  H is a foundational step. The use of H helps kids to start thinking algebraically, a bit more abstract than working with numbers only (though the numbers are quite abstract too).

The key notion: The creation of the negative numbers better is not confused with the minus sign as the pupils have been using for a - b ≥ 0.

H creates the negative numbers by rotating or mirroring the positive numbers.

H involves multiplication, namely scalar multiples as different from grouping.

This allows vector addition along the number line. “Arrow 10 to the right plus arrow 3 H to the left results into arrow 7 to the right.”

Algebraically we have negative number b H and addition a + b H, and the rule that a + a H = 0.

Applying this rule on a H itself gives a H + a H H = 0 and thus H H = 1.

At this stage, pupils will have experience with a - b ≥ 0. They discover that this is the same as a + b H ≥ 0. They get used to the extended use of plus with a + b H = c H < 0. A simple example is: 2 + 3 H = 2 + 2 H + H = 0 + H = H.

The extended use of subtraction gives a - H b = a + H H b. The  rule is that H H = 1.

Pupils will first work with H as symbol only, but at some stage the value H = -1 can be identified.

H fully covers subtraction on content.  What remains is the notation that uses the minus sign. This is notational only.

The use of the minus sign involves: using a single sign for both a single operator for rotating or mirroring H b and an operator for more numbers a + H b. Subtraction arose in history perhaps only with a confusion of these two properties, yet eventually there was deliberate design, and we can recognise the flexibility and economy of symbols, though no respect for the problems arising in education.

Using H we can define, as another way of saying the same, and identifying H = -1 (though still using H symbolically, i.e. unevaluated and algebraically):

-b = H b.  Pupils could agree that -3 writes and reads faster than H 3. Also short for 0 - b.

a - b = a + (-b) = a + H b. Pupils could agree that a - b writes and reads faster than a + H b.

The price is: a - (-b) but we now know a  - H b = a + H H b = a + b, with the algebraic rule H H = 1.

Thus subtraction involves multiplication. When a - (-b) is presented as subtraction, and turns out to be addition then we may understand why kids find this hard, for this important aspect of multiplication is not mentioned or explained.

Alternatively, H is used only in remedial teaching. However, remedial teaching would only work if it uses better methods: and if the use of H would be considered a better method, then it should be used for all. Remedial teaching rather works by taking the same steps at a tailored pace.

Once subtraction has been mastered, H will no longer be used for subtraction, and then retains its value for division i.e. exponentiation. The development of the multiplicative inverse will benefit when kids in Grade 3 have seen squares 5 of 5 = 25. It likely is possible to introduce the expression (x^2) for surface and (x^(3 )) for volume, but given the handwriting we would use x^2 and x^3 or colours for exponents first.

It remains a point that pupils might confuse (x^H) with x H, and it might be that they need something like x^H or perhaps even a fraction bar in y / x in order to observe the correct operation. However, pupils can observe minute differences, if only alerted on them, and it likely is only a matter of finding the right stepping stone. Perhaps a different colour might be used in the first steps in exponentiation. Only empirical research can show what would work.

. Conclusions

For education:

This notebook with packages is for teachers, researchers and educators on math education. It provides a working environment for research and experiments on the use of H = -1 in education. Kids would work with pencil and paper. (Though it is another issue: kids would better also be introduced into computer algebra - a bit more refined than mere “programming”.)

Hopefully the mathematics education (ME) and its research (MER) community including the educators (e.g. at CCSS) agrees that mathematics education and its research need to return to the drawing board.

Overall, ME & MER are in a mess, and we cannot expect that this proverbial Baron of Münchhausen will be able to lift himself from the morass he is in. I am writing as an economist now, who has done some study on institutional economics. My suggestion is that each nation sets up a National Center for Mathematics Education, with a governance open to the stakeholders: parents, teachers, researchers, government, publishers and employers, based upon the principles and ethics of science in open access fashion, namely that only empirical methods allow the kids to tell us what works for them. See Colignatus (2009, 2015a), Elegance with Substance and (2015b), A child wants nice and no mean numbers.

For Mathematica:

It would be best that H is included in Mathematica’s list of mathematical constants: tutorial/MathematicalConstants. This actually also holds for Ð = 10 (deca, using capital Eth), so that (Ð^H) = “per 10” = decim. The above indicates the properties that would be useful for such an implementation as well. Obviously the functionality changes when Simplify, N, and rules for pattern recognition are adapted. Wise choices must be made here.

H is already supported to a large extent by Plus & Times[-1] and Times & Power[-1]. Thus the proposal to properly include H as a universal constant only makes the structure more coherent. The symbolic use of H in these functions only applies to a particular phase in education, but could be supported by an option in the Preferences. Tongue in cheek: If Mathematica supports the use of different natural languages, then hopefully also for the language of mathematics.

On the overlap, see Appendix G on terminology and copyrights.

. Stage 1. Kindergarten. Place value

The following only indicates my own thinking without empirical testing, see above and Colignatus (2015b) for my disclaimer on competence and empirical testing.

There are steps for the integers 0-10 (kindergarten and Grade 1), 0-20 (kindergarten and Grade 1) and 0-100 (Grade 1). There is the difference between scalar multiplication (2 km) and grouping (5 baskets of 4 apples).

The US Common Core is ambitious for kindergarten and includes 20:

“Students use numbers, including written numerals, to represent quantities and to solve quantitative problems, such as counting objects in a set; counting out a given number of objects; comparing sets or numerals; and modeling simple joining and separating situations with sets of objects, or eventually with equations such as 5 + 2 = 7 and 7 – 2 = 5. (Kindergarten students should see addition and subtraction equations, and student writing of equations in kindergarten is encouraged, but it is not required.) Students choose, combine, and apply effective strategies for answering quantitative questions, including quickly recognizing the cardinalities of small sets of objects, counting and producing sets of given sizes, counting the number of objects in combined sets, or counting the number of objects that remain in a set after some are taken away.”

CCSSMathContent["Kindergarten", "CC", "A.3"]

We better define “number” as “pronunciation, numeral and word”. Kids in kindergarten and Grade 1 live in a world of sounds. My suggestions:

There seems to be a division of labour, and division of perks of competence, in which the language department tells to mathematics education: “You can have the numerals, and we keep the words and their pronunciation.” It doesn’t work like this. Kindergarten should focus on proper definitions and vocabulary. Kids at that age still live in a world of sounds, and those sounds better be helpful rather than counterproductive. It is okay to use common English at home, regarding English as a dialect of the language of mathematics, but in school the numbers 11-20 better be pronounced ten & one, ten & two, ..., ten & nine and two·ten. This pronunciation supports the decimal place value system, and the later tables of addition and subtraction. See Colignatus (2015f, 2018c) on The need of a standard for the pronunciation of the integers, and Colignatus (2018a) on Pronunciation of the integers with full use of the place value system.

PM. The trailing center dots are deliberate, see Colignatus (2018a).

PlaceValue[#, Speak -> False]& /@ Range[11, 15]

It is also important to realise that when counting from 0-9, and when the (single) digits are exhausted, that the next ten introduces the new base in the place value system. A teacher should also say so. It is simple to explain and it might be quite confusing when it isn’t explained. Perhaps a car salesman doesn’t have to explain to who buys a car that they should also get a driver’s license but we cannot assume that kids understand the place value system without proper explanation.

Proper explanation of the current numbers would tell kids that “eleven” is “one left over” after subtracting 10, and that “twelve” is “two left over” after subtracting 10, but when teachers do not take the effort to explain this, then this only means that they have no interest in the pronunciation of the words, are blind to the importance of pronunciation, and see the words only as labels instead as functionally relevant for the place value system that they are supposed to teach.

The following table will be used by kindergarten teachers and not the pupils when they cannot read and write yet. It has already been printed above so we now use small print.

TableOfBasicAddition[]

Key didactics is to properly internalise the "Table of Basic Addition", since this is the step from counting to addition. Pupils who get stuck at counting - still using their fingers - will not have properly internalised this table. (Its "version in sounds" is part of memorisation.)

The property of TOBA[10] is that kids only know the numbers up to some level, and they can only internalise what they already know, whence we get a triangle shape. Using a square table would generate 20, though see next Section. NB. The table is oriented like the system of co-ordinates, so that “1 is lower than 10” is visually supported and not contradicted.

The Table of Basic Addition also shows both counting back and subtraction. Pick a number within the table, say 7, and see how it can be found, say 7 = 5 + 2 = 2 + 5. Thus it is also possible to say that 7 - 2 is 5. Again, it are kindergarten teachers who will use this table to have discussions with the kids. It is not clear to me whether this table could already be shown to the kids themselves.

Use standard plus and minus and no other local inventions (e.g. Dutch so-called-easy “erbij” and “eraf”). One can also say that the difference between 7 and 5 is 2, so that the difference is given by the largest minus the smallest.

. Stage 2. Grade 1 & 2. Addition and subtraction in the nonnegative realm

The key phenomenon is that we have learning to read and write now.

.. Mathematics is language too

The US Common Core for Grade 1 states, and note the word “grouping”:

“In Grade 1, instructional time should focus on four critical areas: (1) developing understanding of addition, subtraction, and strategies for addition and subtraction within 20; (2) developing understanding of whole number relationships and place value, including grouping in tens and ones; (3) developing understanding of linear measurement and measuring lengths as iterating length units; and (4) reasoning about attributes of, and composing and decomposing geometric shapes.”

See Colignatus (2018a) for the explanation that one should not use “ones”, “tens”, “hundreds”.

The term “grouping” is not explained in the CCSS Glossary. It is not clear to me whether such grouping in Grade 1 may also be seen as a de facto competence on multiplication. Apparently grouping is only introduced “informally” and not “formally” with the multiplication sign. However, this creates an awkward distinction between “words” and “mathematical symbols” while such symbols are words too. It is proper to use words precisely and thus also the symbols. Currently there are “language-people” who take some distance from mathematics and who seem to decide  what “language’ would be, but they cannot have this prerogative when they clearly show bias by excluding mathematics from language. Thus, do not fall in the trap of distinguishing “informal” and “formal” and other terms that “language-people” use to express their confusions, Thus, keep emphazising clarity. Be kind to the “language-people” though, because they are victims of the mess that mathematics education is in (but do not accept their belief that mathematics education already is perfect).

When Grade 1 is introduced to grouping then this should be supported by words (symbols), (symbolic) expressions, graphs, tables. Check CWNN*. Rather than “3 times 2” we may better speak about “3 of 2”, and also speak about “grouping 3 groups of 2”.

.. Table Of Basic Addition

CCSSMathContent["Grade 2", "OA", "A.1"]

CCSSMathContent["Grade 2", "OA", "B.2"]

Would A.1 have priority over B.2 ? Why the last part of B.2 so late ? It seems to me that CCSS is confused: The TableOfBasicAddition is basic and must be mastered in Grade 1, to make the transition from counting to addition, and thus be mastered before working till 100. If it hasn't been mastered, do remedial teaching. (A remedial teacher might allow kids to solve 5 + 95 = 100 by counting from 5 to 100, merely to show them that 95 + 5 is faster, and so on. Use nine·ten & five, instead of dialect nine-tee-five.)

Thus, kids will now read and write too, to internalise the Table of Basic Addition for 0-10, see above.

A Table Of Basic Addition is triangular, except when negative integers are included. Thus the integers to 20 (two·ten) should rather not be introduced by a square table but by the following triangle (printed small).

TableOfBasicAddition[0, 20]

It is true, though, that the (non-basic) Tables of Addition for the integers [0, 10] generate a square matrix. This is where the number 20 enters the scene. Tradition has focused on this table rather than the triangle, and perhaps it suffices indeed: with the other values recoverable by implication (1 + 19 = 1 + 9 + 10 etcetera). The table is again oriented on the system of co-ordinates (supporting the reading of maps in kindergarten and Grade 1). PM. The parallel for the TOBA[10] would be to use the square matrix for 5, with at most 5 + 5 = 10. It is better to use the TOBA[10] itself however, when kids still have to learn the basics.

SquareTableOfAddition[]

.. Abacus

For Grade 1, the abacus would be important for addition and subtraction in the realm of [0, 20]. Having no physical abacus, one might use pictures (graphs) but at a loss of physical interaction. The abacus works like vector addition and subtraction (a string of beads is like an arrow). PM. I haven’t looked for uses of the abacus for negative numbers.

.. Place value and CWNN*

Kids would use the place value system, pronounce the numbers in full place value manner, and do addition and subtraction in place value manner too. There are numerous expositions about introducing kids to the place value system. What I have seen hide the negative numbers. The following uses Colignatus (2018ab), and sets the stage for using H.

I intended to write some routines to support (x^H), got amazed by the treatment of the negative numbers, and intended to only briefly mention Colignatus (2015b), A child wants nice and no mean numbers (CWNN) (pdf online), now amended by (2018a), so together CWNN*, but I now must refer to it with emphasis. This includes kindergarten and Grade 1 into this paper. CWNN* namely develops the place value system with proper pronunciation of the numbers, also clarifying the role of grouping.  (Copied to above.) To emphasize the point, and to lower the barrier for others to check the argument, I wrote (2018a) and include its package also in this notebook.

When the integers are pronounced correctly, say 24 = two·ten & four, then it is also clear that 2 × 10 + 4 = 24, so that the pronunciation generates the answer to the sum.

CCSS is seriously confused. Multiplication is only introduced in Grade 3, while the place value system uses multiplication.

CCSSMathContent["Grade 2", "NBT", "A.1"]

Apparently, for CCSS “7 hundreds, 0 tens, and 6 ones” does not representmultiplication ? CCSS has grouping as something informal:

CCSSMathContent["Grade 2", "OA", "C.3"]

It is a rather tricky: to speak about odd and even, when even is defined as having factor 2, but you will not mention its definition because you won’t refer to grouping in proper (“formal”) manner. CCSS should be able to see that this is incoherent. See also the reference to grouping above.

Thus I would suggest that Grade 1 already has grouping, in decent mathematical manner, with unity of words, symbolic expression, graphs and table. Some people might call this “formal” but it is only the use of words (symbols) with proper precision. The following are the groupings for outcomes of maximal 10. With this table you can have a discussion about odd and even with proper definition. It may be convenient to already speak about the “table of 2, max 10” since we haven’t 20 yet.  The term “times” does not express what it does, and it is better to use terms with “group”: Grouping three groups of two = 3 × 2 gives a group of 6. For convenience I drop the zero’s.

TableOfBasicGrouping[] /. 0 -> ""

Let me also show the TOBG for [-10, 10], printed smaller for page width. It would belong to a later Stage, but it adds perspective to the current argument on the relevance of grouping from the beginning. The table helps see that two negatives generate a positive.

TableOfBasicGrouping[-10, 10] /. RuleMinusSignToH

.. Place value and the tables

We first teach ToSingleDigits and then ToSingleDigitsTable, and subsequently the tables of addition and subtraction.

... Grade 1

For Grade 1 and numbers in [0, 20], the routines ToSingleDigits (-Table) have little use. The routines basically concatenate the digits here, and the real exercise is above TableOfBasicAddition[0, 20]. However, we can these routines now to highlight a conceptual issue.

Above we already met the CCSS “0 tens” that CCSS does not explain as a multiplication but something magically different. The proper term is “0 of 10” and “0 count (weight) for 10”.

ToSingleDigits["countfor10", "countfor1"] (*highest place value first*)

Evaluate[above] // Inactivate

In the current CCSS setup for Grade 1, we cannot speak about 10 × countfor10 when we haven’t had multiplication. My inference is that the relevant parts of the table of 10 must be discussed together with the introduction of the place value system.

Conventionally it requires new words like twenty and thirty, but if kids can distinguish 2 apples and 3 apples, then please don’t treat numbers differently, and they should be able to distinguish two·ten and three·ten. A grid of marbles should clarify it.

I suppose that grouping might be restricted to the TOBG[10] and the table of ten for 0, 10, 20, and that the burden will fall on the proper pronunciation of the numbers in full place value manner. (My hope is that kids have also time to sing and dance.)

... Grade 2

For Grade 2, our routines become relevant. The reason: the TableOfBasicAddition[0, 100] is too large, and we use an algorithm now, called “place value system”.

ToSingleDigits["countfor100", "countfor10", "countfor1"]

... Example for teachers and researchers, not for kids now

NB. The following is not an addition table but its second part.

The following example is not intended to be used in class as such. It is only intended to show what the routine can do, and to highlight the didactic issues. We want kids to learn these manipulations in the place value system.  Let 10 have count 9 and 1 have count 12.

{9, 12} -> ToSingleDigits[9, 12]

We can see the steps by using ToSingleDigitsTable. For the next table, the number -10 is a negative number. Thus, negative numbers really exist in everyday life. (The meaning of a word is its use.) Who wants to avoid negative numbers might tell kids that writing -10 on line 2 below 12 is a subtraction, with the outcome 2.  Then 1 must be recorded in the following column (right to left) (so that we do not change the sum). How complex is this ? There are only 2 steps per column, and quite openly: (i) insert {1, -10} if needed, (ii) determine the column sum.

Again: we cannot speak at this level about 1 × 10 - 10 × 1 = 0 when we haven’t had multiplication.

ToSingleDigitsTable[9, 12]   (*default differences -> True*)

(PM. Row 4 reads “+“ and thus we have 12 + (-10) = 2, while 12 - 10 = 2 rather has “=”. But “+“ can be defended by reference to the middle column and correctness overall.)

... The current method hides the differences

The current convention is to hide the differences. The following hides the subtraction 12 - 10. Kids must do 3 steps at the same time per column: (i) 12 - 10 = 2, and record 2 at the bottom, (ii) move 10 to the following column and turn it into 1, (iii) 9 + 1 = 10, and record this outcome at the current line. Now do these three steps again for the 2nd column.

ToSingleDigitsTable[9, 12, Differences -> False]

... A sequence for teaching and learning

The suggestion is the following sequence for teaching and learning:

Kids better start with differences, because it has fewer steps and shows them all.

Then proceed with levels, because this involves  internalisation of the intermediate steps (and less writing). (Tell kids that the objective of the lesson is not that they understand the place value system (because the would by now), but that you want them to write less and still get the right answer.)

Eventually there will be mental automation with a higher level script: write down the units, remember the rest, add to the count of ten, write down the last digit of the outcome, etcetera.

When the only goal is to drill the latter automation, then we might forget about the first two steps. When the goal is to better grasp the place value system, then these two earlier steps are important, to also understand what the drilling is about.

.. Tables of addition and subtraction

We already discussed the table of addition (in differences and levels) for the didactics of the negative numbers. It is useful to focus now on Grade 1 and 2, and wonder whether the following tables would be useful for them. This section only lists these tables.

?AdditionTable

?SubtractionTable

?BothSubtractionTables

?MixedAdditionTable

?BothMixedAdditionTables

.. Grade 1 & 2: Tables of addition and subtraction

Grade 1 would count and Grade 2 would add, but they might use the same tables.

... Grade 1: Table of addition in differences or levels

Given the restriction to the numbers 0-20 these tables have little use, except that they show in our format that addition in the place value system works on the separate digits. Only the RHS in levels is useful now.

BothMixedAdditionTables[11,7]

... Grade 1: Table of addition with outcome 20

The outcome 20 would be the first serious type of application of the addition table method that kids would see. See the discussion above about the distinctions w.r.t. the LHS (differences) and RHS (levels). For the LHS (differences) in row 5 , there is a negative number, but we can tell the kids that we insert a subtraction in this column (10 - 10) = 0. Also, to compensate in the row, we must insert a 1 in the column of ten, thus with 1 × 10 - 10 × 1 = 0, but this invokes multiplication, and the creation of 20 actually is the first step in presenting the table of 10 (for 1 of 10 is just 10).

BothMixedAdditionTables[11, 9]

... Grade 1 & 2: Table of addition getting into 11-20

Addition in [0, 20] better uses the abacus, and certainly when crossing 10. See Colignatus (2018a) for counting from 8 to 13 in full place value manner. When we do an addition with numbers in [0, 10] so that the result is in [11, 20] then the addition routine gives a warning that it is overly complex. The outcome in the first column on the RHS is already in [11, 20] and there is no need to transfer digits merely because this is how we have structured our table. But it is interesting to observe what the computer produces by sticking to the algorithm. Perhaps, though, the minds of the kids are as logical as the computer, and they might agree that 10 is transferred from the right column to the left column. Indeed, some kids might perform this method, and then get stuck for not knowing how to proceed. My guess though is that this would be self-evident from the earlier training on the TableOfBasicAddition and the abacus, so that it would be wasted teaching time and actually counterproductive to spend attention to it. It might be something for remedial teaching for kids who get stuck on this indeed. (Perhaps this explains why kids find it hard to pass 10.)

BothMixedAdditionTables[6,7]

... Grade 1 & 2: Table of subtraction, for big minus small, without crossing 10

For subtraction and outcomes a - b ≥ 0, the routine can generate negative numbers in single digit comparisons. In Grade 1 & 2 we thus use only big - small for all digits. There is little use of the place value system, except that these tables show that we work per digit position indeed, so that kids can get used to this table format, preparing them for more complex cases.

SubtractionTable[18, 2, 5, Differences -> False]

... Grade 1 & 2: Table of subtraction from above to below 10

The situation is somewhat different when we start above 10 and subtract to below 10. In this case, the first column on the RHS must “borrow” (and never give back) from the second column.

This is done best by using an abacus (with vector addition) and rehearsing the Table of Basic Addition for [0, 20]. Obviously 18 - 9 = 9 + 9 - 9 = 9 is a strategy.

Alternatively, the method in the subtraction table is sound and will be used for higher figures, and it would represent a case to argue that negative numbers have a natural place in Grade 1. Or, simply do not do such subtractions until the negative numbers have been introduced in Grade 2.

BothSubtractionTables[18, 9]

.. Grade 2: Tables of addition and subtraction

Using numbers in [0-100] with outcomes in [0, 100] can no longer by done (quite) by internalising a table, and internalisation is actually superfluous since we have a place value system that allows an algorithm. This algorithm has been put into the tables of addition and subtraction, which explains their genesis and use. Obviously we might also use the abacus but that would change the subject. See Colignatus (2018b) for further discussion of using the tables without H.

. Stage 3. Grade 2. Introduction of the negative integers, i.e. H

The following is only a definition. This can be done in 15 minutes but requires accuracy. The introduction here concerns H, and the use of -x is only done at Stage 6.

TextRotate[][10]

TextReflect[10]

IntegerLineH[10]

The nonnegative half-line can be turned around the circle. One might ask a pupil to stand upon a line, make some steps, let another pupil instruct H and another pupil instruct the number of steps, and see where the walker lands.

This completes the introduction, since it is only a definition. We quickly proceed with the next Stage 4, namely the rule that x + H x -> 0.

?IntegerLineH

?TextRotate

?TextReflect

. Stage 4. Grade 2 & 3. Addition with H, outcomes still nonnegative

We now consider steps that would be taken in education. We mimic what kids would do with pencil and paper. Where we use a variable, kids would use various numerical examples until they get the scheme (or we should have shown them wat a variable is).

We can deal with expressions with H via algebra or tables of addition and subtraction. Before we look at such tables, we better first master some algebra (for the tables rely upon this too, actually).

.. Working with H: half turn (rather than mirroring)

... Meaning

Discuss the meaning.

a + H b

Half turns around the circle. Expression H b  already requires a notion of multiplication: rotating from the right to the left. (And H H b would rotate back to the original again, but we will see this later.)

... Relation to 0, via RuleHToZero

The definition of H gives that a + H a = 0.  Starting from 5 and seven steps to the right and seven steps back lands us in 5 again.

a + H a

above             /.   RuleHToZero

There normal numbers give cookies and numbers with H give hungry cookie-monsters. When a hungry cookie-monster eats one cookie then its stomach is full. Thus 7 + 5 H= 2 + 5 + 5 H = 2 + 0 = 2 or leaves 2 cookies. There are more ways to implement it.

... Relation to 0, via AlgebraH

Simplify.

a + H a

Collect[above, a]

above          // AlgebraH

First[RuleAlgebraH]

?AlgebraH

.. HoldForm for H H: rotate back to the original

When H is a half turn, then H H is a full turn, and discussing this immediately may contribute to clarity what a half turn is. Perhaps mention this only, because the following requires algebra: “When you encounter a term H H then this means a full turn, and you can replace it with 1.” (And 2 turns still mean 1 turn ...)

In the main body of the paper: “When a + H a = 0 or that a finds an inverse or cancellation in H a, then an obvious question is what cancels H a itself. Then we get H a + H H a = 0. What do you see ?”

PM. We can keep H H without brackets or square (H^2) by using HoldForm.

MatrixForm[{H # + # == 0,H # + HoldForm[H H #] == 0}] & /@ {2, 5, 9}

Discuss the meaning of the double H: rotate back to the original value.

a + H H b     // HoldForm

above /. RuleAlgebraH

above  //AlgebraH

AlgebraH also applies a ReleaseHold. AlgebraH actually recognised the earlier HoldForm and then called the AlgebraHHelper to deal with that special format.

.. More terms in algebra

... More terms, using RuleHToZero

Simplify.

HoldForm[2 + 3H + 5 + 2H]

above    //  SortH

above   /. RuleHToZero    (* recognises 2 + 2 H -> 0 *)

above   /. RuleHToZero   (* now uses stronger decomposition*)

above//ReleaseHold

... More terms, using HToZero

2 + 3H + 5 + 2H  // HoldForm

above// HToZero        (* collects terms, does not recognise 2 + 2 H *)

... More terms, using Inactivate

Use Inactive to show intermediate steps, but not so very enlightening.

Inactivate[2 + 3H + 5 + 2H]

above// Sort

above  == Activate[above]     (* collects terms *)

RuleHToZero cannot deal with Inactive[Plus] etc. and deals only with the RHS.

above   /. RuleHToZero

.. Place value using H

We had this table above but now use the variant with H.

Perhaps we should consider that kids in first grade already could handle x + H x = 0, so that the minus sign can be introduced later ? It is a cookie-monster eating a cookie, and would that be so hard to grasp if they already learn that 1 - 1 = 0 ?

ToSingleDigitsTableH[9, 12]     (* 2nd part of an addition table *)

When working with these differences has been internalised, then they need no longer be recorded, and kids can write the outcomes directly.

ToSingleDigitsTableH[9, 12, Differences -> False]

?ToSingleDigitsTableH

.. Tables for addition and subtraction using H

... AdditionTableH

The following merely replaces -10 by 10 H for the internal steps.

AdditionTableH[35, 18]

It is a simple alteration, but it can be quite useful. Observe that the table uses these identities:

In the (10^0) column: 13 + 10 H = 3 + 10 + 10 H = 3, using the rule that a + a H = 0.

1n row 5: 10 + 10 H  = 0.

Thus:

If kids had been introduced to AdditionTable with the non-default option Differences -> False, then they now have a stepping stone still without the minus sign, so that they can see how the place value system works. The hidden subtraction is brought out into the open as an addition with H, and there is the advantage that only 2 sequential steps per column are required (instead of 3 simultaneously).

If kids had been introduced to AdditionTable with the default option Differences -> True, but they were still troubled by the subtraction (in a table of addition), then they now have a format without the minus sign, and 13 + 10 H = 3 + 10 + 10 H = 3, using the rule that a + a H = 0.

?AdditionTableH

... MixedAdditionTableH

It may need explaining that 18 H = (10 + 8) H = 10 H + 8 H.

MixedAdditionTableH[30, 9H, 8, 18 H]

?MixedAdditionTableH

. Stage 5. Grade 3. Extension with a + H b = H c < 0

.. Algebraic, using HToZero

Simplify.

HoldForm[3 + 4 H + H + 6  +5 H]

above // HToZero

The importance here is that the outcome can also be a negative number. Kids have been using minus only for a - b ≥ 0, and H x is the only expression they have for a negative outcome.

.. Rather MixedAdditionTableH than SubtractionTableH

The SubtractionTableH has a row with the “-“ sign and thus we rather use the following.

MixedAdditionTableH[35, 18 H, 7H , 12 H]

. Stage 6. Grade 3. Writing -c as alternative to H c

.. Introducing the minus sign for a negative number, extending a - b

The principles are easy to show by means of vector addition and subtraction, but the following concerns notation.

Given: 
(1) Kids have been using minus only for a - b ≥ 0. 
(2) Negative numbers have been introduced by H x, as the mirror of the positive numbers, and x + H x = 0 (with x > 0).
(3) Kids already have seen outcomes like 5 + 7 H = 2 H.

Call into memory that 5 - 3 = 5 + 3 H = 2 and more cases, so that y - x = y + H x, but only for nonnegative outcomes.

Explain that this lesson is not about something new, but only about writing in a shorter way what they already know. Show that it is shorter indeed.

The news 1: 5 - 7 = 5 + 7 H.  Thus 5 - 7 is a shorter way of writing the same.

The news 2: Introduce -x.  The definition: -x = H x.

The news from 1 and 2: 5 - 7 = 5 + 7 H = 2 H = -2.

Range[-10, 10]

The definition: y + H x = y + (-x) = y - x.

Thus also 5 - 7 = 5 - 5 - 2 = -2  because 5 - 5 = 0.

Discussion: Discuss the meaning for the single number. Clarify that it is a shorter notation only, but that it will be used to extend a - b also for outcomes lower or less than 0. (Do not say “smaller”, for that applies to the absolute values.)

Let pupils check what the new notation means in terms what they already know.

-b                 // TimesToH

Discuss the meaning for the operation on two numbers. (Arrow 10 + Arrow 2 H.)

a - b            // TimesToH

Thus the same minus sign is used both for a single number and for the operation on two numbers.

When a pupil says that “this is not simpler at all” then explain that this is how the numbers are used by grown-ups, and that they are supposed to learn this method too.

.. New application of the subtraction table

The use of the minus sign in the row with “-“ is used in Grade 1 when outcomes are nonnegative. It can be used again now when pupils are making the transition -x = H x.

This is how it looks when negative numbers arise.

SubtractionTable[35, 18]

Kids wanting to check, could use this, but row 3 still contains “-“.

SubtractionTableH[35, 18]

Colignatus (2018b) clarifies that there can be a switch in the subtraction strategy when the outcome is negative.

SubtractionTable[18, 35]

SubtractionTable[11, 99, 78]

?SubtractionTableH

.. The tricky a - (-b)

Mathematica has a difference between number -4 and expression -b.

... Creating an expression with H H for a number

Discuss the tricky case. It is the price paid for above easier notation. (Some kids might say that it is not easier at all though.)

The problematic expression can now be tackled by kids in steps. We have to do a lot of work to first keep the expression in HoldForm and then unpack it in steps. For teachers the steps are important, for programmers the different routines.

3 - -4  // TimesToHoldFormH

above /.  RuleMinusSignToH

above // MinusSignToH    (*eliminate the brackets*)

above  //AlgebraH     (*algebraic rule H H -> 1*)

... With HoldForm on a variable

Use the following routine to avoid a square.

tricky = HoldForm[a - (-b)]

above     // TimesToHoldFormH

above          // AlgebraH  (*algebraic rule H H -> 1*)

RuleAlgebraH[[2]]

PM. This keeps a bracket for (-b).

Inactivate[a - (-b)]

above /. RuleAnyToH

... From minus to H H becoming H^2

Simple substitution causes the appearance of the square. This might be no problem and even a natural environment to discuss it.

a - (-b)       // TimesToH

above          // AlgebraH  (*algebraic rule H H -> 1*)

Without HoldForm, AlgebraH directly used the substitution rules.

RuleAlgebraH[[3]]

.. More terms of a mixed variety, using HToZero

There may be an intermediate stage (up to Grade 6) with mixed use.

Simplify.

HoldForm[3 + 4 H + H - 6  -2 H]

above // HToZero

Before, I hadn’t thought about this possibility. At first the above comes across as a curious mixture of H and minus, and thus as rather Byzantine. However, the algebraic rules for a normal variable x apply also for H. Thus much of the deduction will already be an exercise for such. Of course, H comes with additional rules.

.. Tables of addition and subtraction without H

See Colignatus, Th. (2018b), Tables for addition and subtraction with better use of the place value system.  The package there doesn’t use H. It is included in the above however too.

The discussion of addition and subtraction finds a natural end here. We would pick it up for real numbers again though.

. Stage 7. Grade 4, 5, 6. Exponent H: multiplicative inverse, rational number, mixed number

.. The US Common Core

In terms of abstraction, it seems to me (but I am not competent in this) that it might be quite feasible that kids have digested the negative numbers by Grade 3, including the basic algebra involved in H, so that Grade 4, 5 and 6 are available for the exponent H.

The Common Core for Grade 4 e.g. uses the confused notation 5(2/3). We can save a lot on this, both the crooked structure and the later required unlearning on the notation of multiplication.

CCSSMathContent["Grade 4", "NF", "B.3"]

CCSSMathContent["Grade 4", "NF", "B.3.A"]

CCSSMathContent["Grade 4", "NF", "B.3.B"]

CCSSMathContent["Grade 4", "NF", "B.3.C"]

Grade 8 has (http://www.corestandards.org/Math/Content/8/EE/):

CCSSMathContent["Grade 8", "EE", "A.1"]

In the alternative approach kids would know use (3^H). Having learned more about exponents in Grade 7 an 8, they would be able to find that 3^2 × 3^-5 = 3^-3 = 3^(3H) =  (3^3)^H = 27^H in accuracy without any need of the fraction bar.

.. The multiplicative inverse

The extension of the integers with the inverses of the integers sets us upon the path to create the rational numbers.

Every nonzero integer n has an inverse number (n^H) such that their grouping is 1.

The inverse number (n^H) can be pronounced as "per n". We better do not pronounce this as "one per n", since in (n^H) there is no mention of 1. Thus (2^H) = "per two" = half, and (4^H) = "per 4" = quarter.

Show that (H^H) = H. It is easy to show that the latter is sufficient, for multiply both sides by H. Yet, now show that it is also necessary.

We better do not use the words third, fourth, etcetera for “fractions”, because these are rank numbers.

Cake division is less relevant than the number line. Yet, a cake divided in 5 parts of equal size would cause that each part has the size (5^H) (“per 5”), with the unit of measurement given by the cake. Thus 5 of those parts give 1 cake again.

(2^H) on the number line follows from:

(2^H) == (2^H)  10  (10^H) ==  (2^H)  2  5  (10^H)  == 5  (10^H)

In general (n^H) can be found on the number line by above method or creating the decimal expansion, and always use this rule:

n n^H == 1   // HoldForm

above  // AlgebraH

RuleAlgebraH[[6]]

??RuleAlgebraH

.. The meaning of these subsections

The following subsections might seems somewhat tortuous. Obviously we have quick solutions but we are interested now in what routine could mimic which step that a student could take. The following is obvious but mimicking it is not quite simple, e.g. when Mathematica wants to simplify into powers of 2. The routine SimplifyH provides some stability.

1/2 + 1/4      // SimplifyH

.. The inverse element with ReleaseHold

At some point pupils will learn about addition of exponents.

n n^H == 1   // HoldForm

above // ReleaseHold

above  // AlgebraH

.. Prove that 2^H == 2 4^H using multiplication

Prove:

2^H == 2*4^H   // HoldForm

Proof:

Multiply both sides with 2:

2 2^H == 2 *2*4^H   // HoldForm

2 2^H == 4*4^H   // HoldForm

above  /. RuleAlgebraH

.. Rational numbers

When n is a natural number excluding zero then n^H are the basic rational numbers.  Integer multiples of basic rational numbers would be rational numbers too. The natural numbers (likely including 0, depending upon the application) thus are rational numbers too.

y x^H

Formally we distinguish these rational numbers from the quotient form with numerator and denominator. Simplification of these rational numbers would tend to involve the prime numbers. Simplification with our routines is not so easy, but there is always SimplifyH.

4 2^H     // HoldForm

PM. Using 4 = 2 2 gets interpreted as 4 = (2^2).

above // ReleaseHold

Use H + 1  = 0 but this requires algebra on the exponent.

above // SimplifyH

For addition and H we had a routine HToZero that decomposed expressions into forms a + a H = 0. Now we might create a routine HToOne that factors integers into the prime numbers, and then applies a (a^(H ))= 1, to avoid such exponents. This leads too far now.

.. Mixed numbers

The rational numbers thus are: (i) integers, (ii) the basic rational numbers 0 < x < 1, (iii) the negative basic rational numbers, and (iv) the remainder are the mixed numbers: sums of the first three.

An expression like 5/2 better is written as a mixed number with H, so that it is clearer where it is on the number line. We do not call SortH for the standard form because this would put the expression into HoldForm.

proper = 5/2       // ToH

We already discussed this with some repetition. The comment in this subsection is that further arithmetic with these terms causes higher values of the exponents. This makes sense, given above comment on simplification.

The use  of the fraction bar causes more complexities, while we better teach students how to work with exponents since they must do so anyway. It is not relevant now to develop a course in dealing with exponents in Mathematica now. But a little bit can be mentioned. Let us square and expand the above. This immediately gives higher values for the exponents. The resulting first term might better be 4^H.

above^2 // Expand // PowerExpand

We can always convert back, by SimplifyH, FromH (that generates the fraction bar) or to decimal numbers.

p2= proper^2;
{Evaluate[p2 // SimplifyH ]// SortH,
p2 // FromH, 
p2 // NH}

PM. The following uses “Inactive” and unfortunately displays with the fraction bar.

inactive = 5 / 2 // RationalInactive

Unfortunately, the latter doesn’t expand like (a + b)^2.

above^2 // Expand // PowerExpand

?RationalInactive

.. Multiplication

Multiplication consists of scalar multiples (like the mirroring above) and grouping. A case of “5 of 4” would be a grouping.

Kids would start with a + H b rather than with a - b. Thus grouping would start with H as well.

a - b // TimesToH  (*traditional teacher preparing a lesson using software*)

An example multiplication with this term:

(a + b) * above

Not having squares yet, pupils could write a a  and b b without problem. Over time the use of exponent 2 will be discovered as a neat trick.

above // Expand

Collect[above, a b]

above  // AlgebraH

RuleAlgebraH[[1]]

A geometric exposition might need some different labels.

https://en.wikipedia.org/wiki/Difference_of_two_squares

.. Simplifying expressions with unevaluated H

The following transforms in the mixed number format.

4 3^H

above // PowerHToMixedNumber

above // SortH

This would tend to work always. First remove H and then build up again. SimplifyH might be sufficient, without the need to adapt Simplify to include rules on H.

4 3^H // SimplifyH

PM. Above expression already contains H. ToH has no algorithm on simplification. It stops at a form that has introduced H. Remarkably, another round of application can also introduce a minus sign. Some routines like ToH thus give a warning when H is already present.

4 3^H

above // ToH

.. Beware of H^H

Correct is:

H^H  // AlgebraH

Correct:

(2^H)^H

above      // FromH

(2^H)^H     // AlgebraH

Correct, but perhaps confusing at first:

2^H^H

above // FromH

2^H^H   // AlgebraH

.. Prove that 2^H == 2 4^H using exponents

Prove.

2^H == 2*4^H   // HoldForm

Use that 4 = 2 * 2 and that (x y)^H  = x^H y^H.

above /. 4^H  -> HoldForm[2^H 2^H]

above  /. 2  HoldForm[2^H 2^H] :> HoldForm[2 2^H  2^H]

above  /. RuleAlgebraH

.. Multiples of a Lowest Common Denominator - Direct approach

The following is the direct approach, but doesn’t display neatly.

Simplify this.

expr = 1/2 + 1/4       // ToH     (*traditional teacher setting up a question with software*)

above  /. 2^H -> 2 4^H     (* proven above *)

Collect[above, 4^H]     (* Mathematica's hidden steps *)

above /. 2^(2 H) -> 4^H

.. Multiples of a Lowest Common Denominator - Inactive and HoldForm

The following is more involved, merely to display neatly. This shows that it would be possible to make a routine to clarify the steps.

Simplify this.

expr = 1/2 + 1/4       // ToH     (*traditional teacher setting up a question with software*)

above /. Plus -> Inactive[Plus]

The order of substitution matters.

above/. 4^H -> HoldForm[4^H]

above /.  2^H -> 2 HoldForm[4^H]    (* proven above *)

above // Activate

above // ReleaseHold

Appendix F contains some other approaches that are less attractive.

.. Prime numbers

Students may now better appreciate the relevance of prime numbers for a simplied rational number.

999 / 456 ->  {FactorInteger[999] , FactorInteger[456]}

HoldForm[ 3^3 37^1 (2^3 3^1 19^1)^H]

above // PowerExpand

above // ReleaseHold

above // FromH

.. An exponent with H  in the exponent itself

An exponent with H  in the exponent itself indicates a root. We may be happy to get rid of the root sign (it is mainly useful as the square root for the Pythagorean Theorem in geometry), but, using exponents requires a fine distinction of the vertical distances, and it could be advisable to use ^ in exponents themselves.

expr = (5/2)^(8/7)    //  ToH      (* traditional teacher creating an expr *)

We would rather see the following order within the mixed numbers, because of the number line, but this sorting has not been implemented as a general feature.

Evaluate[expr]// SortH

The standard form in Mathematica. Do not overlook the 7 in the root sign.

above // ReleaseHold //  FromH

. Appendix A. More details on using Mathematica

.. More details on using Mathematica

Mathematica already uses -1 mostly in the way that we want to. However, there are some holes w.r.t. the intended use in education.

Having these various routines may be confusing (at first), but we will employ them for the different purposes of the different stages, and then they might be understood within those contexts.

.. Universal constant

Mathematica doesn't use H yet as an unevaluated universal constant like i, π and e. Thus there is need for some additional routines.

.. HoldForm versus Inactivate

The MathEd`H` routines use HoldForm (without * and ^) rather than Inactivate (with * and ^). Rules working on the one form may not work on the other form. We are used to the shorter HoldForm and then can use the HoldFirst attribute. (Pupils will need to learn both notations though. )

At first the Inactive form seemed more relevant, since it also allows steps in Activate. Kids might be served with the * and ^ in the Inactive form. In my personal taste I found them distractive, and testing on Inactive[Plus] etcetera a bridge too far. While using HoldForm, the use of Inactive remains useful on occasion. When the makers of Mathematica consider implementing H, they best look at both HoldForm and Inactivate.

.. HoldForm on Plus

Even in HoldForm, 3 - 2 is coded as 3 + -2, and input 3 + (-2) is displayed as 3 - 2. It does read better (and the FullForm may be only a concern for programming).

3- 2  // HoldForm

above // FullForm

3 +-2  // HoldForm

above // FullForm

.. Subtraction uses Times

Mathematica deals with subtraction via Times, and correctly so. The best way to show this is by calling Inactivate, though we will tend to use HoldForm.

Inactivate[a - (-b)]

With abstract H we better see the structure of the expression.

above        /.   RuleAnyToH

The bracket for (-1 * b) is correct, to identify the operation on the single variable. Because of the flatness of the product I prefer a + (-1)*(-1)*b however.

Activation generates a square.

above         // Activate

This might not fit the level of education here, but it might also be considered that introducing squares might actually be done before the introduction of negative numbers.

The routines TimesToH and TimesToHoldFormH only look at the expression Times[-1, b]. They use HoldForm. This also allows for mixtures of different formats (numbers with the minus sign and with H).

a - (-b)                        // TimesToHoldFormH

2 - 3  + 6  - (-b) - 7  // TimesToHoldFormH

TimesToH has a ReleaseHold and thus also creates the square.

a - (-b)                   // TimesToH

There are occasions when we also want to show the fraction bar. (The latter is best postponed till when kids have good command of division by means of the expression with the exponent.)

-2 / (a - -b)      // TimesToH     (* only interested in H b, kids learning about H^2 *)

2 - 3  + 6  - (-b) - 7  // TimesToH

MinusSignToH affects all numbers with the minus sign, including power terms.

2 - 3  + 6  - (-b) - 7  // MinusSignToH

ToH only looks at the exponent (and Mathematica got rid of minus negative).

1 / (a - -b)      // ToH            (* learned how to get rid of H H *)

Remember that these routines would be for teachers and researchers to develop exercises and tests, and for pupils to check (with pencil and paper) what the expression with minus means in terms of H that they already have learned.

?above

?RuleAnyToH

?TimesToHoldFormH

?MinusSignToH

.. Expressions with a fraction bar use Power, though with exceptions

Mathematica deals with expressions with the fraction bar with Power, and rightly so.

Inactivate[a / b]

above /.  RuleAnyToH

above // Activate

However, Mathematica (i) has the exception of Rational[n, m], and (ii) neglects the mixed number. See Appendix E on this.

For mixed numbers, we would like to see this:

2 + (2^H)

Mathematica can also use the fraction bar format m / n that we want to avoid (also because it obscures the position on the number line).

above  // FromH

?FromH

Observe that RuleAnyToH replaces indiscriminately, doesn’t recognise the integers with the minus sign, and doesn’t have HoldForm.  In this case it produces the relevant form with H only for the exponent (and Mathematica took care or minus negative).

-2 /(a - (-b))  /. RuleAnyToH

TimesToHoldFormH doesn’t recognise the division and numbers with a minus sign, but has H H in HoldForm. This routine is suited for learning to work with H and subtraction, but not for division and the rational numbers.

-2 /(a - (-b))   // TimesToHoldFormH

MinusSignToH is most comprehensive in this case, and possibly insightful for kids learning the ropes, but overly zealous w.r.t. the target of using H eventually only for the exponent.

-2 /(a - (-b))   // MinusSignToH     (*all aspects involved*)

above  // AlgebraH

.. Sorting

Sorting provides another angle to consider.

The canonical order regards H as a letter in the alphabet.

For 2+(2^H) we rather see first 2 and secondly (2^H) because of the position on the number line.

Mathematica has this order, and thus SortH imposes HoldForm.

2 + (2^H)

above // SortH

Sorting also affects lists.

IntegerLineH[3, 5]

above// Sort

We like to see the order of the number line though.

above// SortH

?SortH

. Appendix B. The routines

.. Routines

... Math`Ed`

?Cool`MathEd`H`*

The descriptions of the main routines are (while the others follow along the way):

?H

?FromH

?ToH

?MixedNumberH

?NH

... Tables of addition and subtraction without H

See Colignatus (2018b) for this.

?Cool`MathEd`AdditionTable`*

... Tables of addition and subtraction with H

These are versions of Colignatus (2018b) now with the use of H = -1.

?Cool`MathEd`AdditionTableH`*

... Pronunciation using the full place value system

See Colignatus (2018a) for this.

?Cool`MathEd`PronounceInteger`*

. Appendix C. Basic properties of the routines

.. Testing for routines and answers to questions

For testing in routines, but also testing whether pupils have completed an exercise.

?IntegerLineHQ

?IntegerHQ

The following helps to identify the default numbers with the minus sign. We cannot call this routine “NegativeIntegerQ” since H x is also a negative integer for x > 0.

?MinusSignIntegerQ

?ExpressionHQ

.. To and From, focussed on exponents

5/2            // ToH

-5/2           // ToH

above       // FromH

.. Holdfirst

Routines have HoldFirst so that e.g. input of 1/2 + 1/4 does not first simplify to 3/4.

1/2 + 1/4       // ToH

above              // FromH

above           // ToH

The routines for H tend to recognise the term above and then translate func[above] into func[Evaluate[above]]. Some also recognise a HoldForm input. In other cases we would have to call Evaluate ourselves.

.. TimesToH for Times. ToH for Power and Rational. BothToH for both

TimesToH assumes a format Times[-1, b] while the numbers with the minus sign do not have that format. Thus TimesToH cannot transform those numbers. Use MinusSignToH for this. However, the latter may also transform Power[x, -1] into Power[x, H], which may not be the intention at this moment.

(a - b)   // TimesToH

1 / (a - b)   // TimesToH

1 / (a - b)      // ToH

1 / (a - b)    // BothToH

?BothToH

?TimesToH

?TimesToHoldFormH

.. Numbers with the minus sign and MinusSignToH

In the above, we looked mostly at variables but now we look at numbers specifically.

Mathematica has the numbers with the minus sign in its hard core programming.

-3 // FullForm

The MathEd`H` routines have the following assumptions:

At a first stage, pupils work only with nonnegative numbers, and thus there are no numbers with a minus sign in them. Then we have only minus in a - b. Variablles differ from numbers though. TimesToH suffices for immediate ReleaseHold, or use MinusSignToH to keep HoldForm.

a - b // TimesToH    (*variables*)

4 - 3  // TimesToH     (*numbers*)

4 - 3     // MinusSignToH   (*HoldForm, useful for more numbers*)

This is useful for the first stage.

(2 - 5 + 6 - 7)   // MinusSignToH      (*traditional teacher designing a question*)

above // ReleaseHold

This only puts the expression into HoldForm. For a first stage, this is useless. It however would be useful at the stage when both H and the numbers with the minus sign are being used.

(2 - 5 + 6 - 7)   // TimesToHoldFormH

At the first stage we would not use the following, for it doesn’t change the numbers with the minus sign and it has releasehold. The reason that it didn’t evaluate above is because of the variables a and b.

(2 - 5 + 6 - 7)   // TimesToH

This is already more interesting. Observe that the routine does not distinguish between the type of integer. The number -4 is not the same as Times[-1, 4].

(8- 1+ 3 - -4)   // TimesToHoldFormH

This recognises -4 too but evaluates, turning the negative number into a binary operation.

(8- 1+ 3 - -4)  // TimesToH

At a second stage there might be numbers with the minus sign, and attention is moving towards using H only for the exponent.  In that case TimesToH respects also numbers with the minus sign while MinusSignToH would be overkill.

. Appendix D. SimplifyH

Thes routines in Appendix A can do a little only. Our few basic algebraic rules do not include all possible variation. The following introduces a single obstructive variable. Not all our routines find a neat solution.

expr = a (2H + 3)

above    /. RuleHToZero

Evaluate[expr]      // HToZero

AlgebraH is intended to contain only the main rules. It is not intended to store a multitude of variations that will always find a solution.

Evaluate[expr]      // AlgebraH

If we would get stuck (or would not find the proper substitution routine) there is always the straightforward SimplifyH.

Evaluate[expr]     // SimplifyH

?SimplifyH

When we use variables or HoldForm then the numbers do not multiply, and we can do algebra.

(a b)^H    /. RuleAlgebraH

HoldForm[(3 4)^H]

above /. RuleAlgebraH

??RuleAlgebraH

. Appendix E. Mathematica: Rational[n, m] and n Power[m, -1]

.. How ToH deals with this

For compexer input, we meet with some particular properties.

Rational[n, m] is the form of the Rationals, but the standard form often is n Power[m, -1].

The n Power[m, -1] format seems standard, also in input, but sometimes Mathematica creates the Rational format in output. Calling FullForm for input is not enough, and we may have to use Hold.

FullForm[5/2]

FullForm[Hold[5/2]]

FullForm[2 + 1/2]

FullForm[Hold[2 + 1/2]]

This makes programming a bit awkward.

For Rational[5, 2] it is easy to transform this into 2 + 2^H, with no need of HoldForm.

For Times[5, Power[2, -1], ....] it tends to be more difficult when there are other factors.

case = 2  / (5 x)

case           //FullForm

For us this becomes (do not forget that ToH has attribute HoldFirst, so that Evaluate is needed):

case           // Evaluate// ToH

.. Subroutines

ToH calls these (sub-) routines. Deliberately called PowerHeadToH instead of PowerToH.

(case // Evaluate)  // PowerHeadToH

case // Evaluate // MixedNumberH

.. RuleAnyToH, ToH, TimesToH, BothToH

RuleAnyToH replaces -1 by H indiscriminately. We might say that it provides a literal translation.  In the following example, the 1 remains standing, and 5 (4^H) is not developed into a proper mixed number. One might say that these steps belong to the realm of “simplification”. One might also say that it forms an important element in translation to properly deal with this. The 1 prefex and the hidden whole in 5/4 are products of an inferior notation only.

HoldForm[1/ (2 + 5/4)] /. RuleAnyToH

above // AlgebraH

above // SortH

ToH is more sophisticated. Writing 5 / 4 as 1 + (4^H) also causes the addition of the wholes 2 + 1 = 3.

HoldForm[1/ (2 + 5/4)] // ToH

TimesToH has no business here, and applies ReleaseHold.

HoldForm[1/ (2 + 5/4)] // TimesToH

The following applies first ToH and then TimesToH, but in this case ToH takes the brunt.

HoldForm[1/ (2 + 5/4)]  // BothToH

.. Seemingly not 100% obeying HoldFirst

Above expression 1 / (2 + 5/4) may appear also in a larger expression.

The following uses ToH and thus transforms 2 + 5/4 into 2 + 1 + (4^H)  and this becomes 3 + (4^H).

(2 + 1/2 ) / (2 + 5/4) x^-2   // ToH

ToH has attribute HoldFirst. Not having this would cause a more drastic change.

(2 + 1/2 ) / (2 + 5/4) x^-2

above  // ToH

. Appendix F. Lowest Common Denominator

.. Comment

This concerns adding 1/2 + 1/4. This is simpler with H  than using the traditional fraction bar. The current question is how we can reproduce that simplicity within the environment of Mathematica. The best approach is in the body of the text, and the following are some alternatives.

Obviously we have a quick solution but we are interested now in what routine could mimic which step that a student could take. Mathematica complicates the steps by creating powers of 2.

1/2 + 1/4      // SimplifyH

.. Multiples of a  LCD - with a variable

The use of a variable is simplest, but variables are not (much) used in current curriculum.

Simplify this.

expr = 1/2 + 1/4       // ToH     (*traditional teacher setting up a question with software*)

subst = 4^H -> c   (*commonfactor*)

expr/. Plus -> Inactive[Plus]

above  /. subst

above /.  2^H -> 2 c

above // Activate

above /. Reverse[subst]

.. Multiples of a LCD - without HoldForm and Activate

Simplify this.

1/2 + 1/4       // ToH     (* traditional teacher setting up a question with software *)

Collect[above, 4^H]   (* remarkably does not work, but changes question *)

Collect[above, 2^H] (* remarkably does not work *)

above /. 4^H -> (2^H)^2 /. 2^H -> 2 4^H    (* NB: 2 H + 1 == H *)

Collect[above, 2^H]   (* remarkably works *)

above /. 2^(2 H) -> 4^H

.. Multiples of a LCD - with HoldForm

Simplify this.

1/2 + 1/4       // ToH     (* traditional teacher setting up a question with software *)

above /. 2^H -> HoldForm[2 4^H]

above  // ReleaseHold

Collect[above, 4^H]

above /. 2^(2 H) -> 4^H

. Appendix G. Terminology of mathematics by computer

Mathematics concerns patterns and can involve anything, so that we need flexibility in our tools when we do or use mathematics. In the dawn of mankind we used stories. When writing was invented we used pen and paper. It is a revolution for mankind, comparable to the invention of the wheel and the alphabet, that we now can do mathematics using a computer. Many people focus on the computer and would say that it is a computer revolution, but computers might also generate chaos, which shows that the true relevance comes from structured use.

I regard mathematics by computer as a two-sided coin, that involves both human thought (supported by tools) and what technically happens within a computer. The computer language (software) is the interface between the human mind and the hardware with the flow of electrons, photons or whatever (I am no physicist). We might hold that thought is more fundamental, but this is of little consequence, since we still need consistency that 1+1 = 2 in math also is 1+1 = 2 in the computer, and properly interfaced by the language that would have 1+1 = 2 too. The clearest expression of mathematics by computer is in "computer algebra" languages, that understand what this revolution for mankind is about, and which were developed for the explicit support of doing mathematics by computer.

The makers of Mathematica (WRI) might be conceptually moving to regarding computation itself as a more fundamental notion than mathematics or the recognition and handling of patterns. Perhaps in their view there would be no such two-sided coin. The brain might be just computation, the computer would obviously be computation, and the language is only a translator of such computations. The idea that we are mainly interested in the structured products of the brain could be less relevant.

Stephen Wolfram by origin is a physicist and the name "Mathematica" comes from Newton's book and not from "mathematics" itself, though Newton made that reference. Stephen Wolfram obviously has a long involvement with cellular automata, culminating in his New Kind of Science. Wolfram (2013) distinguishes Mathematica as a computer program from the language that the program uses and is partially written in. Eventually he settled for the term "Wolfram language" for the computer language that he and WRI use, like "English" is the language used by the people in England (codified by their committees on the use of the English language).

My inclination however was to regard “Mathematica” primarily as the name of the language that happened to be evaluated by the program of the same name. I compared Mathematica to Algol and Fortran. I found Wolfram’s Addison-Wesley book title in 1991 & 1998 “Mathematica. A system for doing mathematics by computers” as quite apt. Obviously the system consists of the language and the software that runs it, but the latter might be provided by other providers too, like Fortran has different compilers. Every programmer knows that the devil is in the details, and that a language documentation on paper might not give the full details of actually running the software. Thus when there are not more software providers then it is only accurate to state the the present definition of the language is given precisely by the one program that runs it. This is only practical and not fundamental. In this situation there is no conflict in thinking of “Mathematica as the language of Mathematica”. Thus in my view there is no need to find a new name for the language. I thought that I was using a language but apparently in Wolfram’s recent view the emphasis was on the computer program.  I didn't read Wolfram's blog in 2013 and otherwise might have given this feedback.

Wolfram (2017) and (2018) uses the terms "computational essay" and "computational thinking" while the latter is used such that he apparently intends this to mean something like (my interpretation): programming in the Wolfram Language, using internet resources, e.g. the cloud and not necessarily the stand-alone version of Mathematica or now also Wolfram Desktop. My impression is that Wolfram indeed emphasizes computation, and that he perhaps also wants to get rid of a popular confusion of the name "Mathematica" with mathematics only. Apparently he doesn't want to get rid of that name altogether, likely given his involvement in its history and also its fine reputation.

A related website is https://www.computerbasedmath.org (CBM) by Conrad Wolfram. Most likely Conrad adopts Stephen’s view on computation. It might also be that CBM finds the name "Mathematica" disinformative, as educators (i) may be unaware of what this language and program is, (ii) may associate mathematics with pen and paper, and (iii) would pay attention however at the word "computer". Perhaps CBM also thinks: You better adopt the language of your audience than teach them to understand your terminology on the history of Mathematica.

I am not convinced by these recent developments. I still think: (1) that this is a two-sided coin (but I am no physicist and do no know about electrons and such), (2) that it is advantageous to clarify to the world: (2a) that mathematics can be used for everything, and (2b) that doing mathematics by computer is a revolution for mankind, and (3) that one should beware of people without didactic training who want to ship computer technology into the classroom. My suggestion to Stephen Wolfram remains, as I did before in (2009, 2015a), that he turns WRI into a public utility like those that exist in Holland - while it already has many characteristics of this. It is curious to see the open source initiatives that apparently will not use the language of Mathematica, now by WRI (also) called the Wolfram Language, most likely because of copyright fears even while it is good mathematics.

Apparently there are legal concerns (but I am no lawyer) that issues like 1+1 = 2 or π are not under copyright, but that choices for software can be. For example the use of h[x] with square brackets rather than parentheses h(x), might be presented to the copyright courts as a copyright issue.  This is awkward, because it is good didactics of mathematics to use the square brackets. Not only computers but also kids may get confused by expressions a(2 + b) and f(x + h) - f(x). Let me refer to my suggestion that each nation sets up its own National Center for Mathematics Education. Presently we have a jungle that is no good for WRI, no good for the open source movement (e.g. R or https://www.python.org or http://jupyter.org), and especially no good for the students. Everyone will be served by clear distinctions between (i) what is in the common domain for mathematics and education of mathematics (the language) and (ii) what would be subject to private property laws (programs in that language, interpreters and compilers for the language) (though such could also be placed into the common domain).

. Literature

Thomas Colignatus is the scientific name of Thomas Cool, econometrician and teacher of mathematics, Scheveningen, Holland.

The author thanks Peter Harremöes (Denmark) for a discussion that helped to focus on this present proposal, and H may also be called the Harremoës operator.

Bellamy, A. (2015), A Critical Analysis of Teaching and Learning Negative Numbers, Philosophy of Mathematics Education Journal, Issue 29, http://socialsciences.exeter.ac.uk/education/research/centres/stem/publications/pmej/pome29/index.html

Colignatus, Th. (2009, 2015a), Elegance with Substance, 
(1) website: http://thomascool.eu/Papers/Math/Index.html
(2) PDF on Zenodo: https://zenodo.org/record/291974
(3) Publisher for a print: https://www.mijnbestseller.nl/shop/index.php/catalog/product/view/id/115148/s/elegance-with-substance-78023-www-mijnbestseller-nl/

Colignatus, Th. (2014a), An Archi gif, compliments to Lucas V. Barbosa, https://boycottholland.wordpress.com/2014/07/14/an-archi-gif-compliments-to-lucas-v-barbosa/

Colignatus, Th. (2014b), Confusing math in elementary school, https://boycottholland.wordpress.com/2014/08/25/confusing-math-in-elementary-school/

Colignatus, Th. (2014c), Taking a loss, https://boycottholland.wordpress.com/2014/08/30/taking-a-loss/

Colignatus, Th. (2014d), With your undivided attention, https://boycottholland.wordpress.com/2014/09/04/with-your-undivided-attention/

Colignatus, Th. (2015b), A child wants nice and no mean numbers, 
(1) website: http://thomascool.eu/Papers/NiceNumbers/Index.html
(2) PDF on Zenodo: https://zenodo.org/record/291979
(3) Publisher for a print: https://www.mijnbestseller.nl/shop/index.php/catalog/product/view/id/118082/s/a-child-wants-nice-and-no-mean-numbers-79074-www-mijnbestseller-nl/

Colignatus, Th. (2015c), Computer algebra is a revolution. But 21st century skills ?, https://boycottholland.wordpress.com/2015/12/08/computer-algebra-is-a-revolution-but-21st-century-skills-q/

Colignatus, Th. (2015d), Jan van de Craats tortures kids with fractions, https://boycottholland.wordpress.com/2015/09/19/jan-van-de-craats-tortures-kids-with-fractions/

Colignatus, Th. (2015e), Abstraction vs Eugene Wigner & Edward Frenkel, https://boycottholland.wordpress.com/2015/05/23/abstraction-vs-eugene-wigner-edward-frenkel/

Colignatus, Th. (2015f, 2018c), The need for a standard for the mathematical pronunciation of the natural numbers. Suggested principles of design. Implementation for English, German, French, Dutch and Danish, https://zenodo.org/record/774866

Colignatus, Th. (2016), Looking beyond the Common Core State Standards for Mathematics, https://boycottholland.wordpress.com/2016/03/22/looking-beyond-the-ccss-m/

Colignatus, Th. (2016b), What is the use of group theory ?, https://boycottholland.wordpress.com/2016/12/29/what-is-the-use-of-group-theory-q/

Colignatus, Th. (2017a), Education, group theory and division, https://boycottholland.wordpress.com/2017/01/03/education-group-theory-and-division/

Colignatus, Th. (2017b), Teaching Simpson’s paradox at elementary school – with H, https://boycottholland.wordpress.com/2017/03/05/teaching-simpsons-paradox-at-elementary-school-with-h/

Colignatus, Th. (2017c), Ook in België is de gemengde breuk een drama, https://boycotholland.wordpress.com/2017/06/13/ook-in-belgie-is-de-gemengde-breuk-een-drama/

Colignatus, Th. (2018a), Pronunciation of the integers with full use of the place value system, https://www.wolframcloud.com/objects/thomas-cool/MathEd/2018-05-09-Pronunciation-of-integers.nb, or http://community.wolfram.com/groups/-/m/t/1334793, or PDF at https://doi.org/10.5281/zenodo.1244063 or Mathematica notebook with package at  https://doi.org/10.5281/zenodo.1244008

Colignatus, Th. (2018b), Tables for addition and subtraction with better use of the place value system, update May 5 2018, https://www.wolframcloud.com/objects/thomas-cool/MathEd/2018-04-02-AdditionTable-and-SubtractionTable.nb or http://community.wolfram.com/groups/-/m/t/1313408 or PDF at https://zenodo.org/record/1241349 and Mathematica notebook with package at https://zenodo.org/record/1241404

Common Core State Standards (CCSS) (2018), “Mathematics Standards”, http://www.corestandards.org/Math/

Everyday Mathematics (2018), Partial quotients, http://everydaymath.uchicago.edu/teaching-topics/computation/div-part-quot/

Harremoës, P. (2000), “Talnotation”. May, MFK-bladet 22.5, http://www.harremoes.dk/Peter/, http://www.harremoes.dk/Peter/talnot.pdf

Hiele, P.M. van (1973), Begrip en Inzicht, Muusses

Hiele, P.M, van (1986), Structure and Insight: A Theory of Mathematics Education, Academic Press

Ministry of Education, Culture and Science (2016): “VO-docenten bevoegd voor basisschool: ‘goede methode voor talentvolle kinderen’”, https://www.delerarenagenda.nl/blog/weblog/weblog/2016/20160902-vo-docenten-bevoegd-voor-basisschool-%E2%80%98goede-methode-voor-talentvolle-kinderen%E2%80%99

Pillsy (2010), Contribution to: “Evaluate beyond one level within Hold in Mathematica”, https://stackoverflow.com/questions/3136604/evaluate-beyond-one-level-within-hold-in-mathematica

Skemp, R. (1975), The psychology of learning mathematics, Penguin

Tall, D.O (2013), How humans learn to think mathematically, Cambridge

Vredenduin, P.G.J. (1991), De geschiedenis van positief en negatief, edited by Peter van ‘t Riet, Wolters-Noordhoff

Wolfram Research, Inc. (2017), Mathematica, Version 11.2, http://www.wolfram.com

Wolfram, S. (1991, 1998), Mathematica. A system for doing mathematics by computer, 2nd edition, Addison-Wesley

Wolfram, S. (2013), What Should We Call the Language of Mathematica?, http://blog.stephenwolfram.com/2013/02/what-should-we-call-the-language-of-mathematica/

Wolfram, S. (2017), What Is a Computational Essay?, http://blog.stephenwolfram.com/2017/11/what-is-a-computational-essay/

Wolfram, S. (2018), Launching the Wolfram Challenges Site, http://blog.stephenwolfram.com/2017/11/what-is-a-computational-essay/