Random food/chemistry question. How early could margarine be invented? Considering it's just plant or animal fat processed with water, it seems plausible that it could've been invented far earlier than the late 19th century. Apparently the main obstacle is that hydrogenation, necessary to produce good-quality (for a given value of "good") margarine, requires a 19th century understanding of chemistry. HOWEVER,
the Mege-Mouries process, the first margarine invented in the 1860s (at the request of Napoleon III to find a butter substitute for the French military), appears to not require anything more complex than baking soda (according to that article, the "agricultural gastric juice" was based on Mege-Mouries's misunderstanding). Producing pure baking soda (NaHCO3) seems to be impossible before the 19th century, but the precursors--natron, soda ash, etc.--are known preservatives since Antiquity and contain quantities of sodium bicarbonate and related chemicals.
Would this primitive margarine be edible and able to preserve anywhere near as well as even 19th century margarine? Obviously nobody with good access to real butter would want this, which leaves the urban poor, slaves, prisoners, and ship crews as the only real market. Assuming it's possible, would it have any appreciable effect on history, culture, or economies? Maybe it could be an export for areas reliant on fishing/whaling, given that margarine was often produced from fish oil/whale oil?