The math is in fact correct. The way it's displayed, it's confusing, but not wrong.
The Help section shows the cost with research reduction taken into account. So 6591657 wood is actually only 86% from the base cost (which is 7664717). If you then apply all the calculation (meaning 36% from 7664717) you get 2759298, basically what shows on the upgrade tab. That's why you can't calculate 50% from the help section cost.
The "logic" behind this, is that the research reduction applies to all towns, while the building reduction applies only to that specific town, so when you have no reduction building, you will pay the price displayed in the Help section
Already double-checked what you said. Correct 100%. Thanks so much.