- assume n : ℕ.
- the thesis becomes ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v = [[ FAtom n ]]_ v).
- by decidable_eq_nat we proved (n = x ∨ n ≠ x) (H).
- by sem_bool we proved ([[ FAtom x ]]_v = 0 ∨ [[ FAtom x ]]_v = 1) (H1).
- we proceed by cases on H to prove
- ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v = [[ FAtom n ]]_ v).
- case Left. (* H2 : n = x *)
- we proceed by cases on H1 to prove
- ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v = [[ FAtom n ]]_ v).
- case Left. (* H3 : [[ FAtom x ]]_v = 0 *)
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v)
- = ([[ if eqb 0 0 then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v) by H3.
- = ([[ if true then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v).
- = ([[ (FAtom n)[ FBot/x ] ]]_v).
- = ([[ if eqb n x then FBot else (FAtom n) ]]_v).
- = ([[ if eqb n n then FBot else (FAtom n) ]]_v) by H2.
- = ([[ if true then FBot else (FAtom n) ]]_v) by eqb_n_n.
- = ([[ FBot ]]_v).
- = 0.
- = [[ FAtom x ]]_v by H3.
- = [[ FAtom n ]]_v by H2.
- done.
- case Right.
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v)
- = ([[ if eqb 1 0 then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v) by H3.
- = ([[ if false then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v).
- = ([[ (FAtom n)[ FTop/x ] ]]_v).
- = ([[ if eqb n x then FTop else (FAtom n) ]]_v).
- = ([[ if eqb n n then FTop else (FAtom n) ]]_v) by H2.
- = ([[ if true then FTop else (FAtom n) ]]_v) by eqb_n_n.
- = ([[ FTop ]]_v).
- = 1.
- = [[ FAtom x ]]_v by H3.
- = [[ FAtom n ]]_v by H2.
- done.
- case Right.
- by not_eq_to_eqb_false, H2 we proved (eqb n x = false) (H3).
- we proceed by cases on H1 to prove
- ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v = [[ FAtom n ]]_ v).
- case Left.
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v)
- = ([[ if eqb 0 O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v) by H4.
- = [[ (FAtom n)[ FBot/x ] ]]_v.
- = [[ if eqb n x then FBot else (FAtom n) ]]_v.
- = [[ if false then FBot else (FAtom n) ]]_v by H3.
- = [[ FAtom n ]]_v.
- done.
- case Right.
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v)
- = ([[ if eqb 1 O then (FAtom n)[ FBot/x ] else (FAtom n[ FTop/x ]) ]]_v) by H4.
- = [[ FAtom n[ FTop/x ] ]]_v.
- = [[ if eqb n x then FTop else (FAtom n) ]]_v.
- = [[ if false then FTop else (FAtom n) ]]_v by H3.
- = [[ FAtom n ]]_v.
- done.
-case FAnd.
-(*DOCBEGIN
-
-Il caso FAnd
-------------
-
-Una volta assunte eventuali sottoformule (che chiameremo f ed f1) e
-relative ipotesi induttive
-la tesi diventa `([[ if eqb [[ FAtom x ]]_v O then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v = [[ FAnd f f1 ]]_v)`.
-
-Utilizzando il lemma `sem_bool` si ottiene l'ipotesi aggiuntiva
-`([[ FAtom x ]]_v = 0 ∨ [[ FAtom x ]]_v = 1)`. Si procede poi per casi
-su di essa.
-
-1. caso in cui vale `[[ FAtom x ]]_v = 0`.
-
- Componendo le ipotesi induttive con `[[ FAtom x ]]_v = 0` e
- espandendo alcune definizioni si ottengono
- `([[ f[FBot/x ] ]]_v = [[ f ]]_v)` e
- `([[ f1[FBot/x ] ]]_v = [[ f1 ]]_v)`.
-
- La sotto prova termina con una catena di uguaglianze che
- lavora sul lato sinistro della tesi.
- Espandendo alcune definizioni, utilizzando
- `[[ FAtom x ]]_v = 0` e le nuove ipotesi appena ottenute
- si arriva a `(min [[ f ]]_v [[ f1 ]]_v)`.
- Tale espressione è uguale alla parte destra della conclusione.
-
-1. caso in cui vale `[[ FAtom x ]]_v = 1`.
-
- Analogo al precedente.
-
-DOCEND*)
- assume f : Formula.
- by induction hypothesis we know ([[ if eqb [[ FAtom x ]]_v O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H).
- assume f1 : Formula.
- by induction hypothesis we know ([[ if eqb [[ FAtom x ]]_v O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H1).
- the thesis becomes
- ([[ if eqb [[ FAtom x ]]_v O then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v = [[ FAnd f f1 ]]_v).
- by sem_bool we proved ([[ FAtom x ]]_v = 0 ∨ [[ FAtom x ]]_v = 1) (H2).
- we proceed by cases on H2 to prove
- ([[ if eqb [[ FAtom x ]]_v O then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v = [[ FAnd f f1 ]]_v).
- case Left.
- by H3, H we proved
- ([[ if eqb 0 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FBot/x ] ]]_v = [[ f ]]_v) (H5).
- by H3, H1 we proved
- ([[ if eqb 0 O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H6).
- by H6 we proved ([[ f1[FBot/x ] ]]_v = [[ f1 ]]_v) (H7).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v)
- = ([[ if eqb 0 O then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v) by H3.
- = ([[ if true then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v).
- = ([[ (FAnd f f1)[ FBot/x ] ]]_v).
- = ([[ FAnd (f[ FBot/x ]) (f1[ FBot/x ]) ]]_v).
- = (min [[ f[ FBot/x ] ]]_v [[ f1[ FBot/x ] ]]_v).
- = (min [[ f ]]_v [[ f1[ FBot/x ] ]]_v) by H5.
- = (min [[ f ]]_v [[ f1 ]]_v) by H6.
- = ([[ FAnd f f1 ]]_v).
- done.
- case Right.
- by H3, H we proved
- ([[ if eqb 1 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FTop/x ] ]]_v = [[ f ]]_v) (H5).
- by H3, H1 we proved
- ([[ if eqb 1 O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H6).
- by H6 we proved ([[ f1[FTop/x ] ]]_v = [[ f1 ]]_v) (H7).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v)
- = ([[ if eqb 1 O then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v) by H3.
- = ([[ if false then ((FAnd f f1)[ FBot/x ]) else ((FAnd f f1)[ FTop/x ]) ]]_v).
- = ([[ (FAnd f f1)[ FTop/x ] ]]_v).
- = ([[ FAnd (f[ FTop/x ]) (f1[ FTop/x ]) ]]_v).
- = (min [[ f[ FTop/x ] ]]_v [[ f1[ FTop/x ] ]]_v).
- = (min [[ f ]]_v [[ f1[ FTop/x ] ]]_v) by H5.
- = (min [[ f ]]_v [[ f1 ]]_v) by H6.
- = ([[ FAnd f f1 ]]_v).
- done.
-case FOr.
-(*DOCBEGIN
-
-Il caso FOr
------------
-
-Una volta assunte eventuali sottoformule e ipotesi induttive
-la tesi diventa `([[ if eqb [[ FAtom x ]]_v O then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v = [[ FOr f f1 ]]_v)`.
-
-Analogo al caso FAnd.
-
-DOCEND*)
- assume f : Formula.
- by induction hypothesis we know ([[ if eqb [[ FAtom x ]]_v O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H).
- assume f1 : Formula.
- by induction hypothesis we know ([[ if eqb [[ FAtom x ]]_v O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H1).
- the thesis becomes
- ([[ if eqb [[ FAtom x ]]_v O then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v = [[ FOr f f1 ]]_v).
- by sem_bool we proved ([[ FAtom x ]]_v = 0 ∨ [[ FAtom x ]]_v = 1) (H2).
- we proceed by cases on H2 to prove
- ([[ if eqb [[ FAtom x ]]_v O then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v = [[ FOr f f1 ]]_v).
- case Left.
- by H3, H we proved
- ([[ if eqb 0 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FBot/x ] ]]_v = [[ f ]]_v) (H5).
- by H3, H1 we proved
- ([[ if eqb 0 O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H6).
- by H6 we proved ([[ f1[FBot/x ] ]]_v = [[ f1 ]]_v) (H7).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v)
- = ([[ if eqb 0 O then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v) by H3.
- = ([[ if true then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v).
- = ([[ (FOr f f1)[ FBot/x ] ]]_v).
- = ([[ FOr (f[ FBot/x ]) (f1[ FBot/x ]) ]]_v).
- = (max [[ f[ FBot/x ] ]]_v [[ f1[ FBot/x ] ]]_v).
- = (max [[ f ]]_v [[ f1[ FBot/x ] ]]_v) by H5.
- = (max [[ f ]]_v [[ f1 ]]_v) by H6.
- = ([[ FOr f f1 ]]_v).
- done.
- case Right.
- by H3, H we proved
- ([[ if eqb 1 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FTop/x ] ]]_v = [[ f ]]_v) (H5).
- by H3, H1 we proved
- ([[ if eqb 1 O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H6).
- by H6 we proved ([[ f1[FTop/x ] ]]_v = [[ f1 ]]_v) (H7).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v)
- = ([[ if eqb 1 O then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v) by H3.
- = ([[ if false then ((FOr f f1)[ FBot/x ]) else ((FOr f f1)[ FTop/x ]) ]]_v).
- = ([[ (FOr f f1)[ FTop/x ] ]]_v).
- = ([[ FOr (f[ FTop/x ]) (f1[ FTop/x ]) ]]_v).
- = (max [[ f[ FTop/x ] ]]_v [[ f1[ FTop/x ] ]]_v).
- = (max [[ f ]]_v [[ f1[ FTop/x ] ]]_v) by H5.
- = (max [[ f ]]_v [[ f1 ]]_v) by H6.
- = ([[ FOr f f1 ]]_v).
- done.
-case FImpl.
-(*DOCBEGIN
-
-Il caso FImpl
--------------
-
-Una volta assunte eventuali sottoformule e ipotesi induttive
-la tesi diventa `([[ if eqb [[ FAtom x ]]_v O then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v = [[ FImpl f f1 ]]_v)`.
-
-Analogo al caso FAnd.
-
-DOCEND*)
- assume f : Formula.
- by induction hypothesis we know ([[ if eqb [[ FAtom x ]]_v O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H).
- assume f1 : Formula.
- by induction hypothesis we know ([[ if eqb [[ FAtom x ]]_v O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H1).
- the thesis becomes
- ([[ if eqb [[ FAtom x ]]_v O then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v = [[ FImpl f f1 ]]_v).
- by sem_bool we proved ([[ FAtom x ]]_v = 0 ∨ [[ FAtom x ]]_v = 1) (H2).
- we proceed by cases on H2 to prove
- ([[ if eqb [[ FAtom x ]]_v O then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v = [[ FImpl f f1 ]]_v).
- case Left.
- by H3, H we proved
- ([[ if eqb 0 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FBot/x ] ]]_v = [[ f ]]_v) (H5).
- by H3, H1 we proved
- ([[ if eqb 0 O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H6).
- by H6 we proved ([[ f1[FBot/x ] ]]_v = [[ f1 ]]_v) (H7).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v)
- = ([[ if eqb 0 O then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v) by H3.
- = ([[ if true then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v).
- = ([[ (FImpl f f1)[ FBot/x ] ]]_v).
- = ([[ FImpl (f[ FBot/x ]) (f1[ FBot/x ]) ]]_v).
- = (max (1 - [[ f[ FBot/x ] ]]_v) [[ f1[ FBot/x ] ]]_v).
- = (max (1 - [[ f ]]_v) [[ f1[ FBot/x ] ]]_v) by H5.
- = (max (1 - [[ f ]]_v) [[ f1 ]]_v) by H6.
- = ([[ FImpl f f1 ]]_v).
- done.
- case Right.
- by H3, H we proved
- ([[ if eqb 1 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FTop/x ] ]]_v = [[ f ]]_v) (H5).
- by H3, H1 we proved
- ([[ if eqb 1 O then f1[ FBot/x ] else (f1[ FTop/x ]) ]]_v = [[ f1 ]]_v) (H6).
- by H6 we proved ([[ f1[FTop/x ] ]]_v = [[ f1 ]]_v) (H7).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v)
- = ([[ if eqb 1 O then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v) by H3.
- = ([[ if false then ((FImpl f f1)[ FBot/x ]) else ((FImpl f f1)[ FTop/x ]) ]]_v).
- = ([[ (FImpl f f1)[ FTop/x ] ]]_v).
- = ([[ FImpl (f[ FTop/x ]) (f1[ FTop/x ]) ]]_v).
- = (max (1 - [[ f[ FTop/x ] ]]_v) [[ f1[ FTop/x ] ]]_v).
- = (max (1 - [[ f ]]_v) [[ f1[ FTop/x ] ]]_v) by H5.
- = (max (1 - [[ f ]]_v) [[ f1 ]]_v) by H6.
- = ([[ FImpl f f1 ]]_v).
- done.
-case FNot.
-(*DOCBEGIN
-
-Il caso FNot
-------------
-
-Una volta assunte eventuali sottoformule e ipotesi induttive
-la tesi diventa `([[ if eqb [[ FAtom x ]]_v O then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v = [[ FNot f ]]_v)`.
-
-Analogo al caso FAnd.
-
-DOCEND*)
- assume f : Formula.
- by induction hypothesis we know ([[ if eqb [[ FAtom x ]]_v O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H).
- the thesis becomes
- ([[ if eqb [[ FAtom x ]]_v O then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v = [[ FNot f ]]_v).
- by sem_bool we proved ([[ FAtom x ]]_v = 0 ∨ [[ FAtom x ]]_v = 1) (H2).
- we proceed by cases on H2 to prove
- ([[ if eqb [[ FAtom x ]]_v O then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v = [[ FNot f ]]_v).
- case Left.
- by H1, H we proved
- ([[ if eqb 0 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FBot/x ] ]]_v = [[ f ]]_v) (H5).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v)
- = ([[ if eqb 0 O then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v) by H1.
- = ([[ if true then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v).
- = ([[ (FNot f)[ FBot/x ] ]]_v).
- = ([[ FNot (f[ FBot/x ]) ]]_v).
- = (1 - [[ f[ FBot/x ] ]]_v).
- = (1 - [[ f ]]_v) by H5.
- = ([[ FNot f ]]_v).
- done.
- case Right.
- by H1, H we proved
- ([[ if eqb 1 O then f[ FBot/x ] else (f[ FTop/x ]) ]]_v = [[ f ]]_v) (H4).
- by H4 we proved ([[ f[FTop/x ] ]]_v = [[ f ]]_v) (H5).
- conclude
- ([[ if eqb [[ FAtom x ]]_v O then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v)
- = ([[ if eqb 1 O then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v) by H1.
- = ([[ if false then ((FNot f)[ FBot/x ]) else ((FNot f)[ FTop/x ]) ]]_v).
- = ([[ (FNot f)[ FTop/x ] ]]_v).
- = ([[ FNot (f[ FTop/x ]) ]]_v).
- = (1 - [[ f[ FTop/x ] ]]_v).
- = (1 - [[ f ]]_v) by H5.
- = ([[ FNot f ]]_v).
- done.
-qed.
-