I'm working on a paper which involves the application of a particular equation to sets of experimental materials science data. I devised the idea for the equation and collected/collated the data. With my PI, I then drafted an initial form for the equation. Once I applied it to the data, though, I caught an error. My PI was really reticent to change it and I had a hard time convincing him it was necessary. Neither my PI nor any of my coworkers have a strong math background, so I turned to a personal friend who was a math major in college to help me show that a better equation exists.
My friend helped me to identify the correct functional form and, critically, drew up a mathematical proof showing that the resulting equation gives a particular value if and only if our assumptions are true. This basically shows that the equation is not just right but also meaningful for interpreting the data, and that's a huge deal for the paper.
I feel like this warrants co-authorship, but... my friend is currently unemployed and last worked as a middle school teacher. I checked their work (I was a math minor and am confident it's right) but it is their original contribution, not mine. My friend also hopes the publication of this paper could help them land a "more serious job". I just don't know how to note their affiliation for a journal and have no clue how I'm going to sell this to my PI.
How should I properly attribute authorship for an unemployed non-academic? I also welcome ideas of how to convince my PI that this authorship is necessary, but that's much more subjective and I'm not asking for an answer. I have told him that I had a "math major friend" assist in the development of the new equation. He seems ok with the new form because the proof exists, but he didn't read the proof when offered. I'm worried he'll reject the paper if he decides my friend's credentials are insufficient when we go to submit, but I'm not going to lie and say the proof was my work.