My questions :
How is entropy a state variable?
Why can we use a reversible process to measure an irreversible process's change in entropy if irreversible processes generate extra (unaccounted for in reversible process) thermal energy?
I try to go in detail about them below. I also have a third question, I don't think I worded it correctly but I don't have it clearly grasped. It's at the bottom
For question (1) :
In this video https://www.khanacademy.org/science/physics/thermodynamics/laws-of-thermodynamics/v/proof-s-or-entropy-is-a-valid-state-variable, Sal derived entropy for an isotherm as the integral of a $PV$ diagram from the beginning point of the isotherm to the end of the isotherm, as in an isotherm $\int Pdv = W = Q$, and after that calculation Sal divided by the temperature of whatever gave that heat. So that makes $Q/T$ = change in entropy.
However, this means that the path taken to get from point $A$ to point $B$ matters, as if the path changes, the integral value also changes, which means the heat ($Q$) in entropy changes. You can imagine a linear path from point $A$ to $B$, having an integral value of some number, but if the path from point $A$ curves up then back down to point $B$, then the integral definitely changes, and thus does entropy.
So since from this perspective change in entropy does depend on the path on the $PV$ diagram, how is entropy a state variable?
For Question (2) :
From the video right after, https://www.khanacademy.org/science/physics/thermodynamics/laws-of-thermodynamics/v/thermodynamic-entropy-definition-clarification Sal gives a clarification to the question about entropy as a state variable, that the derivation used above is only applicable for reversible processes. He shows that in an irreversible process, thermal energy would be generated.
At 13:28, he says :
So in an irreversible system, [change in entropy] wouldn't be a valid state variable.
He later says that entropy change in an irreversible process can be measured as though the path taken was a reversible process.
This seems kind of contradictory, as the thermal energy generated from an irreversible process is not accounted for in a path of reversible process. So even if entropy was a state variable, do we not care about this extra heat?
For my question I have no idea the answer but also no idea the question, I have heard you couldn't accurately tell entropy change in an irreversible process, all you could do was bound it from a reversible process. Of course, net change in entropy of system and surroundings would stay $0$ as per reversible process, but maybe for just system or just surrounding you could bound the entropy change? I really haven't researched this, if you can please just tell me right or wrong.