For #5 add tools.cache_function and tools.missing_dict decorators.  Might not use missing_dict.
For #5 replace self_extending_list by cache_function.
For #5 add test issue4.py, rewrite main issue4.py so that can be imported without writing to stdout.
For #5 use cache_function to refactor CD_G and G_CD (in new file issue4tools.py).
For #5 add and use lin_alg_int_inv and fib_zeros_array.
For #5 add C_CD and D_CD.
For #5 add C_G and D_G.
For #5 remove redundant material from issue4.py.
For #5 simplify code in issue4.py.
For #5 refactor doit_C to use generic function non_zero_entries(matrix).
For #5 refactor to create and use print_entries(entries) - and discover a BLUNDER in doit_D(n).
For #5 remove now redundant doit_C(n) and doit_D(n) - and this also deletes the BLUNDER.
For #5 move print_entries and non_zero_entries to issue4.py.
For #4 add g_from_cd_rules_factory. Sorry it's such a mouthful.