It's only natural that people have different opinions on the viability of cavalry. It really depends on the situation. Even something as simple as 10% CCA or inf/cav ratio can sometimes be enough to tip the balance, it's just too difficult to give a definitive judgement due to the complexity of the game.
If I recall correctly, most battles in the early game are decided by morale and not casualties, meaning that it is better to have more men in general rather than more cavalry.
All battles are decided by morale. A unit never dies off before it breaks.
Discipline and combat ability only indirectly affect the outcome of morale battle via each soldier killed inflicting small amount of morale damage to the remaining troops. This effect, however, never exceeds the impact of morale modifier itself. The common myth of 'early game morale, late game discipline' is, therefore, only partially true. While it is true that morale is most impactful in the early game, it's not because the functionality of combat modifiers change, but rather because of the nature of warfare shifting as countries get bigger and field more troops. In the early game, a single stackwipe is often enough to ensure victory, whereas, in the late game, you have to fend off the enemy multiple times before you can siege down enough forts to gain meaningful amount of warscore. Therefore, stats that improve manpower trade efficiency (discipline, combat ability, etc) are likely to be more important in a late game warfare environment.
However if you had cav you could have had 12k infantry and 2k cavalry or 10k infantry and 4k cavalry attacking...
Actually, 12 infantry and 2 cavalry is the same as 10 inf and 2 cav if you're fighting a 10k army. The game doesn't deploy them properly. It places the two cavs on the nearest flanks and the remaining 2 infantries just move around doing nothing.
Also as per the analysis of OP artillery only dwarfs cav some time after tech 18 in terms of raw combat power
It really depends on which tech group you're in and what other military modifiers you have, but generally speaking cavs aren't dwarfed by cannons in tech 18. Combat-wise, artillery really starts to shine once you acquire the 20% backrow damage age ability, which is around tech 24. They get strong enough to use for combat purposes at tech 16 tho, which is why I start using artillery included calculations from then, but that's really because you can make use of more combat space with cannons. Mathematically, it's still pretty weak until tech 22.
edit:
Discipline affects both morale and kill casualties, which is why 5% is it's base unit. Morale and combat ability only affect one side, hence the 10% as their base unit. The game is balanced in a way that, given everything else is equal, morale wins battles and combat abilities inflict more losses. Discipline is in the middle.