Why I publish the mistake alongside the result
This essay accompanies a study I built to answer a question I could not answer: how much Brazil spends to run the administration of its 5,571 municipalities, and how much of that could fund health and education instead. The study is published in full at mapasm.com.br — interactive map, raw data, formulas, code, and the CSVs for anyone who wants to redo the arithmetic.
What interests me here is not only the number. It is that the study — built with tools that two years ago would have required a team and a year — produced a result that was technically correct and operationally absurd, and it was the open data itself that let me find it. I corrected the rule. I corrected it, and it happened again with a second assumption I had not noticed was a choice. The number fell by nearly half. Every scenario is published, with the reason for each.
I treat that as the most important part of the experiment. Anyone can now produce a study with the appearance of rigour in very little time. What separates a result from a handsome artefact is having a way to discover that you were wrong before someone else discovers it for you.
Anyone can now produce a study with the appearance of rigour. What separates a result from a handsome artefact is having a way to find out you were wrong.
Before arguing about what to do, you need the size of the thing being argued about. This part is arithmetic over official data.
A one-line question
What does the administrative structure of Brazilian municipalities cost, and how much of it is duplicated without need?
Brazil has 5,571 municipalities. Each maintains a mayor’s office, a city council and its own central administration: payroll, procurement, accounting, human resources, legal counsel, records. That structure exists regardless of the municipality’s size, and it appears in public accounting under two specific budget functions — Legislative and Administration.
The question I built the study to answer was this: adding those two functions across every municipality, what is the total? And if a fiscally fragile municipality had its administration integrated into that of a more solid neighbour, with no service reduced, how much would be left over?
All the data is official and public. Population and territorial boundaries for 2025 from IBGE, 2025 revenue and expenditure from the National Treasury via SICONFI, Bolsa Família figures from the social development ministry, formal employment from the labour ministry. No estimate of my own where a declared figure exists, and no municipality without valid fiscal data treated as zero — a municipality with no information stays out of the count rather than entering as though it spent nothing.
Comparing municipalities takes care. A town of 4,000 spends little in absolute terms and a great deal per inhabitant; comparing the two extremes directly says nothing. So the fiscal fragility indicator compares each municipality against others of similar size, combining four measures: how much of its spending it covers with its own revenue, how much it depends on transfers, what its administration costs per inhabitant, and how heavily the machine weighs on its budget.
R$ 17.7 billion a year
The published plan integrates the administration of 1,088 municipalities into that of 592 more sustainable neighbours. No service enters the savings.
The result, under the rules I describe below: R$ 17.69 billion a year. Over five years, R$ 88 billion. Over ten, R$ 177 billion. It comes from 1,088 origin municipalities integrated into 592 receiving ones, covering 26.7 million inhabitants.
What enters that count is deliberately narrow. Only Administration and Legislative spending in the origin municipalities. Health, education, social assistance, sanitation, urban services, transport — all preserved intact in the counterfactual, and not one cent of public service appears as savings. The study also does not measure service levels: it does not claim provision would get better or worse, because it has no way to measure that.
From the gross amount eliminated I subtract what the receiver’s own machine grows by, once it serves the combined population. That is not a guess: it is the same cost function the study measures — administration grows with population raised to 0.694 — applied to each grouping. For the published network it comes to roughly a third of what was eliminated. Extraordinary transition costs — severance, systems migration, adapting buildings — sit outside the annual flow and need their own budget. Saying they exist and are not here is more honest than inventing a number for them.
Where the money would go is the part that interests me. The idea is a protected national fund, earmarked for health and education, with public targets, a technical board, continuous audit and competitive selection of operators by performance. Not a generic budget increase: an instrument obliged to show measured results.
This is where the study touches the previous essay in this series. There the argument was that abundant intelligence and labour can redesign the essential systems of life — health, education, food, housing. The obvious objection, in Brazil, is where the money to start comes from. One possible answer: it is already being spent, on administrative structures that duplicate each other.
The question is not where to find new money. It is what is already being spent on structure that repeats itself.
Where the money is not
Public debate imagines the problem sitting in the tiniest municipalities. The data says otherwise.
When municipal consolidation comes up in Brazil, the image that arrives is the town of three thousand people created for political convenience, with a nine-member council and no revenue of its own. That town exists, in large numbers: 548 of the plan’s 1,088 origins have up to 10,000 inhabitants — half the cases.
But they account for 18% of the savings. The 440 municipalities between 10,000 and 50,000 are worth 33.6%. And the 100 largest cases, 9.2% of the total, hold half of everything.
That inverts the political intuition. The case that is rhetorically easiest to defend — the tiny, unviable municipality — is the one that changes the fiscal result least. What moves the number are mid-sized municipalities with proportionally enormous administrations, in metropolitan regions where the boundary between one city and the next is already invisible on the map.
The most extreme example in the study is Maricá, in Rio de Janeiro state. It has 212,470 inhabitants and R$ 1.42 billion of administrative machine — R$ 6,693 per inhabitant. To compare in the line the study publishes municipality by municipality, the Administration function: Maricá spends R$ 6,231 per inhabitant and São Gonçalo, its neighbour and four and a half times more populous, spends R$ 242 — twenty-five times less. Maricá alone is worth 5.4% of the entire plan, more than any single grouping with one exception, São Paulo absorbing Guarulhos and Embu das Artes.
And here the study points outside itself, in two ways. First: Maricá’s problem is not scale — it has ample population to sustain an administration of its own. It is spending. Consolidating Maricá with Niterói captures the value in the ledger, but the useful question is why its administration costs twenty-five times the neighbour’s, and consolidation does not answer that.
The second is more uncomfortable, and it cuts against the index I myself used. Maricá has the highest oil-royalty revenue per inhabitant in the country, and royalties enter public accounting as a current transfer. The federative dependency indicator does not distinguish a transfer the union shares out from revenue a municipality earns by sitting on top of oil, so the richest city in the state appears among the most fragile. The label is wrong for it. I kept Maricá in the plan because removing it would be exactly the curated exception the next chapter condemns, but the reader needs to know that case number one on the list is also the case where the indicator fails.
The case that is easiest to defend politically changes the result least. Half the municipalities in the plan account for 18% of the savings.
The part I had not planned to write, and which turned out to be the reason for publishing.
The model wanted Fortaleza
The first version of the plan reached R$ 34.13 billion. Nearly half of it came from pairings that do not survive two minutes of reading.
The original rule was simple and looked sufficient: an origin municipality has to sit in the most fragile quartile; the receiver has to be a genuine neighbour, in the same state, more fiscally sustainable and outside the fragile group; and the consolidation has to produce positive net savings. A solver finds the combination that maximises total savings.
The result was R$ 34.13 billion a year, across 1,116 origin municipalities. I went to look at the list of largest groupings and found this: Fortaleza, with 2,578,483 inhabitants, being absorbed by Pacatuba, with 86,564. Manaus, with 2.3 million, by Iranduba, with 68,000. Maceió by Marechal Deodoro. João Pessoa by Cabedelo. Porto Velho by Machadinho d’Oeste.
None of that was a programming error. It was the rule working exactly as written. The fragility indicator compares each municipality against others of similar size, so a state capital can rank among the most fragile capitals and land in the origin group. And savings grow with the size of the origin municipality — the measured elasticity was 0.694 — so the solver has an enormous incentive to take the largest municipalities available. Since the rule placed no limit on the scale of the pair, any neighbour with a better indicator served as receiver.
The size of the problem: 164 of the 1,116 consolidations had the origin larger than the receiver, and they accounted for 42.9% of all the machine eliminated. Nearly half the headline resting on the indefensible cases. And the caveat had been published from the start — the limitations document said, in those words, that the plan imposed no population limit on the receiver. It was in the fine print, and the big number was in the title.
It was not a programming error. It was the rule working exactly as written.
The price of plausibility
Correcting it cost half the headline, over two rounds. It was the best trade in the study.
The correction has two parts. The receiver cannot be more than five times smaller than the origin. And above 200,000 inhabitants, an origin can only be absorbed by a receiver of equal or greater population — above that size a municipality has the structure of a mid-sized city, and being absorbed by a smaller neighbour stops making sense outside the spreadsheet.
The second part was necessary because the first, alone, did not fix it. With the five-times limit, the plan’s largest grouping was still Niterói, with 516,787 inhabitants, absorbing São Gonçalo, with 960,196. Arithmetically it passed. As a headline, it was the same disease in a smaller dose.
With both parts, the plan fell from R$ 34.13 to R$ 25.59 billion a year, and from 1,116 to 1,088 origin municipalities. Twenty-eight drop out, and they drop out because they have no neighbour large enough: none of them switched partners, which you can check by comparing the two published scenarios. The largest grouping becomes São Paulo absorbing Guarulhos and Embu das Artes; second, Niterói absorbing Maricá; third, Rio absorbing four neighbours in the Baixada.
The direction of the pairs became defensible. Their scale, not entirely — and it would be dishonest to stop here. The plan still proposes that Guarulhos, with 1.35 million inhabitants and the thirteenth-largest city in the country, cease to exist as its own entity; the same holds for Duque de Caxias, Nova Iguaçu and four more above 400,000. That is not Fortaleza inside Pacatuba, but neither is it an administrative adjustment: it is the kind of arrangement that, in Brazilian practice, gets discussed as a metropolitan region or an inter-municipal consortium, not as abolishing a municipality. The rule I wrote limits the scale of the pair in relative terms and imposes no absolute size ceiling on the origin. That is a gap, not a decision — I only saw it afterwards, when an adversarial review of the text pointed out that my own criterion condemned Fortaleza in two minutes of reading and absolved Guarulhos in one.
A note on temptation. There was an impulse to hand-adjust the Niterói and São Gonçalo case, swapping the roles to make it plausible. It does not work: São Gonçalo is itself in the most fragile quartile, and consolidating administration into the city whose fiscal management is the problem inverts the thesis. But the stronger reason not to do it is another. The moment a result is corrected by hand because it looked bad, the study stops being a published rule and becomes a rule with curated exceptions — and the first question from any auditor becomes which other cases were adjusted. A rule that costs R$ 8.5 billion is cheaper than that question.
And then it happened again, in the same week, with an assumption I had not even noticed was a choice. The script computed the absorption cost two ways: by the study’s own cost model, which it used to decide which neighbour received which municipality, and by a flat 3% reserve, which was the one it published. Two numbers for the same quantity, and the published one was the larger. In 1,088 of 1,088 cases the model said less was left over.
The gap was not a detail: R$ 7.9 billion a year. And there is an argument against the 3% that depends on no model at all — under the constitution, the number of councillors grows with population, so São Paulo’s legislature grows when it absorbs Guarulhos’s 1.35 million people. The regression embeds that. A flat rate on what was eliminated does not.
Worse: the sensitivity test I had written varied that reserve from 3% to 20% — below the third the model itself implied. It was not deliberate, but the effect is the same as a test designed to pass. A test that does not reach the assumption it is testing does not test it.
So the central estimate became the model’s, and the plan fell from R$ 25.59 to R$ 17.69 billion a year. Taking both corrections together, the number I published first lost nearly half: from R$ 34.13 to R$ 17.69 billion. The 3% stay published as a floor — what is left if the only cost is integrating systems and people, with the receiver’s own machine not growing.
One technical detail moved the result upwards, and it is worth telling because rigour does not only run one way. The cost has to be computed per grouping, not per pair: absorbing three municipalities at once costs less than absorbing one three times, because administration grows with population raised to 0.694 and that curve is concave. Pair by pair it came to R$ 17.27 billion. By grouping, R$ 17.69 billion — four hundred million a year that the wrong arithmetic threw away.
And the part that interests me most: the argument got stronger as the number got smaller. The hundred largest cases went from 50% to 56.6% of the total; municipalities above 200,000 inhabitants, from 23.8% to 29.7%. The thesis that the politically easy case is not what moves the result comes out reinforced by a correction that cuts the headline by a third. Maricá, which was 5.4% of the plan, becomes 8.0% — because what disappears with consolidation is the spending anomaly, not the scale.
The old scenario stays published alongside the new one, identified as an economic ceiling rather than a plan. The difference between the two numbers means something: it is the price of requiring every pair to be operationally plausible. Publishing both makes that price visible instead of leaving it in a caveat nobody reads.
And since the subject is not hiding the price, it is worth showing the whole curve, because the two numbers I chose — five times and 200,000 inhabitants — are my choice and come from no source. With no restriction at all: R$ 23.12 bn. With a ten-times ceiling: 19.53. Five times: 18.91. Five times plus a 300,000 threshold: 18.48. Five times plus 200,000, which is the published plan: 17.69. Five plus 100,000: 16.24. Five plus 50,000: 15.19. Receiver always equal or larger, no exception: 14.18.
The curve is smooth — there is no elbow, no point the arithmetic elects. And there is an honest argument against my choice: the Brazilian literature on mid-sized cities and the IBGE classification use 100,000 inhabitants as the floor, not 200,000, which would give R$ 16.24 billion. More than that: the principle I stated — being absorbed by a smaller neighbour stops making sense outside the spreadsheet — is universal, and the only point on the curve that honours it completely is the last, R$ 14.18 billion. I chose to apply the principle only above a certain size, and that size was calibrated by judgement, in the range where it costs least. Anyone who thinks 100,000 is the right number has the spreadsheet to redo the sum, and so does anyone who thinks the strict rule is the only coherent one.
Defending the smaller number may seem counterintuitive. But R$ 17.7 billion is a stronger claim than R$ 34.1 billion, because it survives first contact with a critic. The big number died in two minutes — the time it takes to open a CSV and search for Fortaleza — and took with it what was correct.
The moment a result is corrected by hand because it looked bad, the study stops being a published rule and becomes a rule with curated exceptions.
R$ 17.7 billion is a stronger claim than R$ 34.1 billion, because it survives first contact.
Where this points
Three things this experiment left behind, in increasing order of importance.
The first is the number, and it is the least important of the three. There is fiscal room of the order of R$ 18 billion a year in administrative structure that repeats itself, and it would be enough to fund a national health and education fund with an obligation to show measured results. Stated with the precision the data allows: between R$ 12.8 and R$ 25.6 billion depending on the assumption adopted, with R$ 17.7 billion at the published rules’s point — the twenty-nine sensitivity tests are in the robustness CSV, and the floor of that range is what remains when the hundred largest cases are discarded. This is not an executable plan: economic viability implies neither legal nor political viability, and changing municipalities in Brazil involves legislation, consultation with the populations affected, and a debate no study replaces.
The second concerns Bolsa Família, and I need to be precise here because the subject is serious. The data shows a strong association between municipal fiscal fragility and the programme’s incidence: the median goes from 5.3 families per 100 inhabitants in the most sustainable municipalities to 19.4 in those of extreme fragility, 3.7 times more. Association is not causation, and the programme does not cause fiscal fragility — poor municipalities have both. The programme is maintained, in full. What the study suggests is a long-horizon path: a more stable municipal economy, with health and above all education funded, creates conditions for families to reach sufficient income of their own. If 10% of them got there, that would be 386,000 families with income autonomy. This is not a benefit cut, it is not automatic, and any exit would depend on effective and sustainable income, with the programme’s Protection Rule respected. The metric that matters is autonomy, not avoided expenditure.
The third is the method, and it is why I published. I built this study in weeks, alone, with AI assistance under my direction: the collection, the pipeline, the cost model, the network optimisation, the site. Two years ago it would have taken a team and a year. That fall in cost is real and available to anyone — which means we are going to be flooded with studies that look rigorous, produced fast, with big numbers and plausible methodology.
The defence against that is not to distrust everyone. It is to require that a study arrive with the means to contest it: a declared source per indicator, a published formula, raw data with hashes, code that runs, and the CSVs to redo the arithmetic. That is exactly what let me find Fortaleza inside Pacatuba. It was not intuition or external review: it was opening the file I had published myself and sorting by size.
So the request I make of anyone reading is the same one the study makes: download the data and disagree with numbers. If I got something wrong somewhere else — and it is likely I did — it is all there for you to show where.
We are going to be flooded with studies that look rigorous. The defence is not to distrust them all: it is to require that they arrive with the means to be contested.
It was not intuition or external review. It was opening the file I had published myself and sorting by size.
References
- MAPA MS — Mapa da Sustentabilidade Municipal do Brasil. Full study, municipal laboratory and open data: mapasm.com.br
- Code, pipeline and calculation records: github.com/totobusnello/mapa-sustentabilidade-municipal-br
- IBGE. Estimativas da população residente nos municípios brasileiros, 1º de julho de 2025. Malha Municipal Digital 2025. Produto Interno Bruto dos Municípios 2023 (controle defasado).
- Secretaria do Tesouro Nacional. SICONFI — Declaração de Contas Anuais 2025: Anexo I-C (receitas), I-D (despesas por natureza) e I-E (despesas por função). Máquina administrativa definida como funções orçamentárias 01 (Legislativa) e 04 (Administração).
- Ministério do Desenvolvimento e Assistência Social. Bolsa Família — quantidade de famílias beneficiárias e valores repassados por município, 2025 (MI Social/SAGICAD).
- Ministério do Trabalho e Emprego. Estoque de referência de empregos formais por município, dezembro de 2025 (PDET/RAIS).
- Governo Federal. Regra de Proteção do Bolsa Família: gov.br/mds/pt-br/acoes-e-programas/bolsa-familia/regra-de-protecao
- Methodology, limitations and sources, with formula and coverage per indicator: mapasm.com.br/data/metodologia.md · /data/limitacoes.md · /data/fontes.md
- Busnello, L. A. A Infraestrutura da Abundância — IA, Robótica e os Sistemas Essenciais da Vida. labf.bio/pt/infraestrutura-da-abundancia