Hello there, I have a function norm_neg which transforms a boolean formula into its negation normal form(only have negations on variables) and a function valid which evaluates formulas. both functions use the inductive form which represents its formula. As a final assignment i need to prove the correctness of norm_neg which I figured I would do by proving that valid V p -> valid V norm_neg(p) or if formula p is valid it is also valid in negation normal form. I have managed to solver the first 5 cases (var,true,false,and,or) but the last ones require more effort due to the fact they have multiple cases in norm_neg. I have tried both induction and cases but still fail to see a way to prove it with the given induction hypothesis so I am wondering if there is a different way to handle this.
importtacticinductiveform:Type|Fvar:string->form|Ftrue:form|Ffalse:form|Fand:form->form->form|Ffor:form->form->form|Fimpl:form->form->form|Fneg:form->formdefvaluation:Type:=string->booldefvalid'(V:valuation):form->bool|(form.Fvarx):=Vx|form.Ftrue:=true|form.Ffalse:=false|(form.Fandf1f2):=(valid'f1)∧(valid'f2)|(form.Fforf1f2):=(valid'f1)∨(valid'f2)|(form.Fnegf1):=¬(valid'f1)|(form.Fimplf1f2):=(valid'f1)->(valid'f2)defvalid(V:valuation)(p:form):Prop:=valid'Vpdefnorm_neg:form->form|(form.Fneg(form.Fnegf1)):=norm_neg(f1)|(form.Fneg(form.Fandf1f2)):=form.Ffor(norm_neg(form.Fnegf1))(norm_neg(form.Fnegf2))|(form.Fneg(form.Fforf1f2)):=form.Fand(norm_neg(form.Fnegf1))(norm_neg(form.Fnegf2))|(form.Fneg(form.Fimplf1f2)):=form.Fand(norm_negf1)(norm_neg(form.Fnegf2))|(form.Fandf1f2):=form.Fand(norm_negf1)(norm_negf2)|(form.Fforf1f2):=form.Ffor(norm_negf1)(norm_negf2)|(form.Fimpl(form.Fnegf1)f2):=form.Ffor(norm_negf1)(norm_negf2)|(form.Fimpl(form.Fandf11f12)f2):=form.Ffor(form.Ffor(norm_neg(form.Fnegf11))(norm_neg(form.Fnegf12)))(norm_negf2)|(form.Fimpl(form.Fforf11f12)f2):=form.Ffor(form.Fand(norm_neg(form.Fnegf11))(norm_neg(form.Fnegf12)))(norm_negf2)|(form.Fimpl(form.Fimplf11f12)f2):=form.Ffor(form.Fneg(form.Ffor(norm_neg(form.Fnegf11))(norm_negf12)))(norm_negf2)|(form.Fimplf1f2):=form.Ffor(form.Fnegf1)(norm_negf2)|x:=xlemmacorrect_norm(p:form)(V:valuation):validVp->validV(norm_neg(p)):=begininductionpwithabcih1ih2aabbih_aaih_bbccddih_ccih_dd,repeat{--Var,True and Falseintrosat,simp[norm_neg],exactsat},{--Andintrosat,simp[norm_neg],simp[valid',valid],simp[valid,valid']atsat,applyand.intro,{applyih1,rwvalid,exactsat.left},{applyih2,rwvalid,exactsat.right}},{--Orintrosat,simp[norm_neg],simp[valid',valid],simp[valid,valid']atsat,casessat,{applyor.intro_left,applyih_aa,rwvalid,exactsat},{applyor.intro_right,applyih_bb,rwvalid,exactsat}},{--Impliessorry},{--Notsorry}end
and similar theorems, so that you can transform the goal state by rewriting using those theorems. Try to write your proof on paper and then translate it to Lean. That's usually the best approach.