From Undecidability.DiophantineConstraints Require Import H10C.
From Undecidability.DiophantineConstraints.Util Require Import H10UPC_facts.
From Undecidability.FOL Require Import Util.Syntax Util.FullTarski Util.FullTarski_facts Util.Syntax_facts Util.sig_bin.
From Undecidability.Shared Require Import Dec.
From Undecidability.Shared.Libs.PSL Require Import Numbers.
From Coq Require Import Arith Lia List.
Require Import Undecidability.Synthetic.Definitions Undecidability.Synthetic.Undecidability.


Idea: The relation (#) has the following properties:
  • n ~ p: n is left component of p
  • p ~ n: p is right component of p
  • p ~ p: the special relation H10UPC
  • n ~ m: n = m.
Translation mapping:
CoqPaper
H10UPCUDPC
H10UCUDC
formmathbb F
Prrotated double tilde
i_Prrotated double tilde, but in a model
IBmathcal M, the standard model
emplace_existsbig exists, the iterated quantifier
translate_reccode

Set Default Proof Using "Type".
Set Default Goal Selector "!".

Some utils for iteration
Section Utils.

  Lemma it_shift (X:Type) (f:XX) v n : it f (S n) v = it f n (f v).
  Proof.
  induction n as [|n IH].
  - easy.
  - cbn. f_equal. apply IH.
  Qed.


End Utils.
The validity reduction. We assume a list h10 for which we build a formula.

Section validity.

  Context {h10 : list h10upc}.
  Existing Instance falsity_on.
  Definition Pr (t t':term) := (@atom _ sig_binary _ _ tt (Vector.cons _ t _ (Vector.cons _ t' _ (Vector.nil _)))).

$k is a number
  Definition N k := Pr $k $k.
$k is a pair
  Definition P' k := ¬ (N k).
If $k is a pair (r), where r are numbers, then t.
  Definition P k l r:= P' k N l N r Pr $l $k Pr $k $r.
The pairs $pl = ($a,$b), $pr = ($c,$d) are in relation
  Definition rel pl pr a b c d := P pl a b P pr c d Pr $pl $pr.
There exist pairs relating ($a,$b) to ($c,$d)
  Definition erel a b c d := rel 0 1 (2+a) (2+b) (2+c) (2+d).
Axiom 1 - zero is a number
  Definition F_zero := N 0.
Axiom 2 - we can build (left) successors: for each pair (a,0) we have a pair (S a, 0)
  Definition F_succ_left := N 0 ~> P 2 3 4 P 0 1 4 Pr $2 $0.
Axiom 3 - we can build right successors: (x,y)#(a,b) -> (x,S y)#(S a,S (b+y))
  Definition F_succ_right :=
                             erel 0 1 2 3 ~>
                            (erel 3 1 4 3 ~>
                            (erel 1 7 5 7 ~>
                            (erel 2 7 6 7 ~>
                            (erel 0 5 6 4)))) .
Generate n all quantifiers around i
  Definition emplace_exists (n:) (i:form) := it ( k k) n i.

Translate our formula, one relation at a time
  Definition translate_single (h:h10upc) (nv:) :=
          match h with ((a,b),(c,d))
            erel a b c d end.
Translate an entire instance of H10UPC, assuming a proper context
  Fixpoint translate_rec (t:form) (nv:) (l:list h10upc) :=
          match l with nil t
                     | l::lr translate_single l nv translate_rec t nv lr end.
Actually translate the instance of H10UPC, by creating a proper context
  Definition translate_constraints (x:list h10upc) :=
    let nv := S (highest_var_list x)
    in (emplace_exists nv (translate_rec (¬ ) (S nv) x)).

The actual reduction instance. If h10 is a yes-instance of H10UPC, this formula is valid and vice-versa The 3 variables are the zero constant and two arbitrary values which define the atomic predicate for Friedman translation.
We now define our standard model.
  Section InverseTransport.
An element of the standard model is either a number or a pair.
    Inductive dom : Type := Num : dom | Pair : dom.
The interpretation of our single binary relation
    Definition dom_rel (a : dom) (b:dom) : Prop := match (a,b) with
    | (Num , Num ) =
    | (Num , Pair _) =
    | (Pair _ , Num ) =
    | (Pair , Pair ) h10upc_sem_direct ((, ), (, ))
    end.

    Global Instance IB : interp (dom).
    Proof using .
      split; intros [] v.
      exact (dom_rel (Vector.hd v) (Vector.hd (Vector.tl v))).
    Defined.


    Definition rho_canon (rho : dom) := 0 = Num 0.

    Lemma IB_F_zero rho : rho_canon F_zero.
    Proof.
      intros . cbn. now rewrite !.
    Qed.


    Lemma IB_N_e rho i n : i = n N i {m: | Num m = n}.
    Proof.
    intros Hrho H. destruct n as [m|a b].
    * now exists m.
    * exfalso. cbn in H. rewrite Hrho in H. apply (@h10_rel_irref (a,b) H).
    Qed.


    Lemma IB_N_i rho i n : i = Num n () N i.
    Proof. cbn. intros . now destruct n as [|n'] eqn:Heq.
    Qed.

    Opaque N.

    Lemma IB_P'_e rho i n : i = n P' i {a: & {b: & n = Pair a b}}.
    Proof.
    intros Hrho H. destruct n as [m|a b].
    * exfalso. unfold P' in H. eapply H, IB_N_i, Hrho.
    * now exists a, b.
    Qed.


    Lemma IB_P'_i rho i a b : i = (Pair a b) P' i.
    Proof.
    unfold P'. intros Hrho H. destruct (@IB_N_e i (Pair a b)).
    1-2:easy. congruence.
    Qed.

    Opaque P'.

    Lemma IB_P_e rho p l r ip il ir :
         ip = p il = l ir = r
      P ip il ir {a: & {b: & p = Pair a b l = Num a r = Num b}}.
    Proof.
    intros Hp Hl Hr [[[[(a&b&)%(IB_P'_e Hp) (nl&)%(IB_N_e Hl)] (nr&)%(IB_N_e Hr)] ] ].
    exists a, b; repeat split.
    - cbn in . rewrite Hl,Hp in . now rewrite .
    - cbn in . rewrite Hr,Hp in . now rewrite .
    Qed.


    Lemma IB_P_i rho ip il ir l r : ip = Pair l r il = Num l ir = Num r P ip il ir.
    Proof.
    cbn. intros Hp Hl Hr. rewrite !Hp, !Hl, !Hr. repeat split.
    - eapply IB_P'_i. exact Hp.
    - eapply IB_N_i. exact Hl.
    - eapply IB_N_i. exact Hr.
    Qed.

    Opaque P.

We show our model fulfills axiom 1

    Lemma IB_F_succ_left rho : rho_canon F_succ_left.
    Proof.
      intros . unfold F_succ_left. intros n [m Hnm]%(IB_N_e (n:=n)). 2:easy.
      exists (Pair m 0), (Num (S m)), (Pair (S m) 0). cbn. split. 2:. split.
      - eapply IB_P_i; cbn; try reflexivity. 1: congruence. apply .
      - eapply IB_P_i; cbn; try reflexivity. apply .
    Qed.


We show we can extract constraints from our model

    Lemma IB_rel_e rho ipl ipr ia ib ic id : rel ipl ipr ia ib ic id
                 {a&{b&{c&{d| ipl=Pair a b
                             ipr=Pair c d
                             ia=Num a
                             ib=Num b
                             ic=Num c
                             id=Num d
                             h10upc_sem_direct ((a,b),(c,d))}}}}.
    Proof.
    intros [[ ] ]. eapply IB_P_e in , . 2-7: reflexivity.
    destruct as (a&b&Hpl&Ha&Hb), as (c&d&Hpr&Hc&Hd).
    exists a, b, c, d; repeat split; try easy.
    all: cbn in ; rewrite Hpl, Hpr in ; .
    Qed.


    Lemma IB_rel_i rho ipl ipr ia ib ic id a b c d :
                ipl=Pair a b
             ipr=Pair c d
             ia=Num a
             ib=Num b
             ic=Num c
             id=Num d
             h10upc_sem_direct ((a,b),(c,d))
             rel ipl ipr ia ib ic id.
    Proof.
    intros Hpl Hpr Ha Hb Hc Hd Habcd. split. 1:split.
    - eapply IB_P_i; eauto.
    - eapply IB_P_i; eauto.
    - cbn. rewrite Hpl, Hpr. apply Habcd.
    Qed.

    Opaque rel.

    Lemma IB_erel_e rho ia ib ic id : erel ia ib ic id
                 a b c d, ia=Num a
                                 ib=Num b
                                 ic=Num c
                                 id=Num d
                                 h10upc_sem_direct ((a,b),(c,d)).
    Proof.
    intros [pl [pr H]]. eapply IB_rel_e in H. destruct H as (a&b&c&d&Hpl&Hpr&Ha&Hb&Hc&Hd&&).
    exists a, b, c, d; now repeat split.
    Qed.


    Lemma IB_erel_i rho ia ib ic id a b c d :
                ia=Num a
             ib=Num b
             ic=Num c
             id=Num d
             h10upc_sem_direct ((a,b),(c,d))
             erel ia ib ic id.
    Proof.
    intros Ha Hb Hc Hd Habcd. exists (Pair c d), (Pair a b). eapply IB_rel_i. 1-2: reflexivity. all: easy.
    Qed.

    Opaque erel.

    Ltac set_eq a b := assert (a = b) as by congruence.

We show our model fulfills axiom 2

    Lemma IB_F_succ_right rho : rho_canon F_succ_right.
    Proof.
      intros . unfold F_succ_right. intros a' y' c b a y x .
      eapply IB_erel_e in , , , .
      cbn in ,,,.
      destruct as (&&&&&&&&).
      destruct as (&&&&&&&&).
      destruct as (&v0_1&&v0_2&&&&&).
      destruct as (&v0_3&&v0_4&&&&&).
      rewrite in ,,,.
      set_eq v0_1 0. set_eq v0_2 0. set_eq v0_3 0. set_eq v0_4 0.
      set_eq . set_eq . set_eq . set_eq . set_eq .
      eapply IB_erel_i; cbn. 1-4:eauto. .
    Qed.


We show we can encode constraints into our model
rho_descr_phi describes that rho is defined by the solution to h10
    Definition rho_descr_phi rho (φ:) n :=
          k, k < n match k with Num n n = (φ k) | _ True end.
    Lemma IB_single_constr rho φ (n:) (h:h10upc) : rho_descr_phi φ n
                                            highest_var h < n
                                            translate_single h (S n)
                                            h10upc_sem φ h.
    Proof.
      intros Hrhophi Hmaxhall.
      destruct h as [[a b][c d]]. unfold translate_single. cbn in Hmaxhall.
      intros (na&nb&nc&nd&Ha&Hb&Hc&Hd&Habcd)%IB_erel_e.
      unfold h10upc_sem.
      pose proof (Hrhophi a (ltac:())) as Hpa. rewrite Ha in Hpa.
      pose proof (Hrhophi b (ltac:())) as Hpb. rewrite Hb in Hpb.
      pose proof (Hrhophi c (ltac:())) as Hpc. rewrite Hc in Hpc.
      pose proof (Hrhophi d (ltac:())) as Hpd. rewrite Hd in Hpd.
      now rewrite Hpa, Hpb, Hpc, Hpd.
    Qed.

Helper for working with nested quantifiers

    Lemma IB_emplace_exists rho n i :
         emplace_exists n i
         ( f, ( k if k <? n then f (k) else (k-n)) i).
    Proof.
      unfold emplace_exists. intros H.
      induction n as [|n IH] in ,H|-*.
      - cbn. exists ( _ Num 0). eapply (sat_ext IB (:=) (:= k (k-0))).
        2: easy.
        intros x. now rewrite Nat.sub_0_r.
      - cbn in H. destruct H as (d&Hd).
        specialize (IH (d.:) Hd). destruct IH as [f Hf].
        exists ( kk if kk =? n then d else f kk).
        eapply (sat_ext IB (:= k if k <? n then f k else (d .: ) (k - n))).
        2: easy.
        intros x.
        destruct (Nat.eq_dec x n) as [Hxn|Hnxn].
        + destruct (Nat.ltb_ge x n) as [_ Hlt]. rewrite Hlt. 2:. clear Hlt.
          destruct (Nat.ltb_lt x (S n)) as [_ Hlt]. rewrite Hlt. 2:. clear Hlt. cbn.
          assert (x-n=0) as . 1: . cbn. destruct (Nat.eqb_eq x n) as [_ HH]. now rewrite HH.
        + destruct (x <? n) eqn:Hneq.
          * destruct (Nat.ltb_lt x n) as [Hlt _]. apply Hlt in Hneq. clear Hlt.
            destruct (Nat.ltb_lt x (S n)) as [_ Hlt]. rewrite Hlt. 2:. clear Hlt.
            cbn. destruct (Nat.eqb_neq x n) as [_ HH]. rewrite HH. 1: easy. .
          * destruct (Nat.ltb_ge x n) as [Hlt _]. apply Hlt in Hneq. clear Hlt.
            destruct (Nat.ltb_ge x (S n)) as [_ Hlt]. rewrite Hlt. 2:. clear Hlt.
            assert (x-n=S(x-S n)) as . 1:. easy.
    Qed.

    Opaque emplace_exists.

Final utility lemma: translate the entire list of constraints
    Lemma IB_translate_rec rho phi f e hv : rho_descr_phi hv
                             highest_var_list e < hv
                             translate_rec f (S hv) e
                             ( c, In c e h10upc_sem c) f.
    Proof.
    intros Hrhophi Hhv H.
    induction e as [|eh er IH] in H,Hhv|-*.
    - split. 1: intros c []. easy.
    - cbn. cbn in H, Hhv. destruct IH as [ ]. 1:. 1:apply H.
      split. 2:easy. intros c [|Her].
      + eapply (IB_single_constr Hrhophi). 1:. apply H.
      + now apply .
    Qed.

We can now extract the constraints from our translate_constraints function

    Lemma IB_aux_transport rho : 0 = Num 0
                               translate_constraints
                               H10UPC_SAT .
    Proof.
      intros .
      pose ((S (highest_var_list ))) as h10vars.
      unfold translate_constraints. fold h10vars. intros H.
      apply IB_emplace_exists in H. destruct H as [f Hf].
      pose ( n match (f n) with (Num k) k | _ 0 end) as .
      exists .
      unshelve eapply (IB_translate_rec (e:=) (hv:=h10vars) (:= ) _ _ Hf).
      - intros x HH. destruct (Nat.ltb_lt x h10vars) as [_ Hr]. rewrite Hr. 2:easy.
        unfold . now destruct (f x).
      - .
    Qed.


To conclude, we can wrap the axioms around it.
    Lemma IB_fulfills rho : F H10UPC_SAT .
    Proof.
      intros H. unfold F in H. pose (Num 0 .: ) as nrho.
      assert (rho_canon nrho) as nrho_canon.
      1: split; easy.
      apply (@IB_aux_transport nrho), H; fold sat.
      - easy.
      - now apply IB_F_zero.
      - now apply IB_F_succ_left.
      - now apply IB_F_succ_right.
    Qed.

  End InverseTransport.

If F is valid, h10 has a solution:
  Lemma inverseTransport : valid F H10UPC_SAT .
  Proof.
    intros H. apply (@IB_fulfills ( b Num 0)). apply H.
  Qed.


  Section Transport.
    Context (D:Type).
    Context (I:interp D).
    Existing Instance I.

    Definition iPr (d1 d2 : D) : Prop := (@i_atom _ sig_binary _ _ tt (Vector.cons _ _ (Vector.cons _ _ (Vector.nil _)))).
    Lemma iPr_spec rho' t t' d1 d2 : t = t' = Pr $t $t' iPr .
    Proof. cbn. intros . easy. Qed.

    Definition iN d := iPr d d.
    Lemma iN_spec rho' t d : t = d N t iN d.
    Proof. unfold N,iN. intros H. now rewrite iPr_spec. Qed.

    Definition iP' d := (iN d).
    Lemma iP'_spec rho' t d : t = d P' t iP' d.
    Proof. unfold P',iP'. intros H. cbn [sat]. unfold not. erewrite iN_spec. 1:easy. easy. Qed.

    Definition iP k l r:= (((iP' k iN l) iN r) iPr l k) iPr k r.
    Lemma iP_spec rho' k l r dk dl dr : k = dk l = dl r = dr P k l r iP dk dl dr.
    Proof. intros . unfold P,iP. erewrite !iPr_spec, !iN_spec, iP'_spec. 1:cbn;reflexivity. all:easy. Qed.

    Definition ierel a b c d := d1 d0, (iP a b iP c d) iPr .
    Lemma ierel_spec rho' a b c d da db dc dd : a = da b = db c = dc d = dd erel a b c d ierel da db dc dd.
    Proof. intros . unfold erel,rel,ierel. split.
    - intros [ [ H]]. exists ,. rewrite !iPr_spec, !iP_spec. 1:apply H. all:easy.
    - intros [ [ H]]. exists ,. rewrite !iPr_spec, !iP_spec in H. 1:apply H. all:easy.
    Qed.

    Lemma ierel_spec' rho' a b c d : erel a b c d ierel ( a) ( b) ( c) ( d).
    Proof. now apply ierel_spec. Qed.

    Section withAxioms.
      Context (rho:env D).
      Context (φ:).
      Context (Hφ : c, In c h10upc_sem φ c).
      Context (HA1 : F_zero).
      Context (HA2 : F_succ_left).
      Context (HA3 : F_succ_right).

      Record chain (n:) := {
        f :> D;
        chain_zero : f 0 = 0;
        chain_succ : m, m < n ierel (f m) (f 0) (f (S m)) (f 0)
      }.

      Lemma chain_N n (c:chain n) m : m n iN (c m).
      Proof using .
      intros Hm. destruct m.
      - rewrite (chain_zero c). apply .
      - destruct (chain_succ c Hm) as [ [ [[_ H] _]]]. unfold iP in H. apply H.
      Qed.


      Lemma chain_build n : inhabited (chain n).
      Proof using .
      induction n as [|n [c]].
      - apply inhabits. split with ( _ 0).
        + easy.
        + intros m H. exfalso; .
      - cbn -[N P Pr] in .
        destruct (@ (c n)) as [pl [d [pr [[ ] ]]]].
        1: { rewrite ! iN_spec. 2:cbn; reflexivity. apply chain_N. easy. }
        rewrite !iP_spec in ,. 1:rewrite !iPr_spec in . 2-9: cbn; easy.
        apply inhabits. pose ( m if m =? S n then d else c m) as f. split with f.
        + unfold f. destruct (Nat.eqb_neq 0 (S n)) as [_ ]. 2:. apply chain_zero.
        + unfold f. destruct (Nat.eqb_neq 0 (S n)) as [_ ]. 2:.
          intros m Hm. destruct (Nat.eqb_neq m (S n)) as [_ ]. 2:.
          destruct (S m=?S n) eqn:Heq.
          * apply beq_nat_true in Heq. assert (m=n) as by . exists pr, pl. rewrite chain_zero. split. 1:split. all:easy.
          * apply chain_succ. apply beq_nat_false in Heq. .
      Qed.


      Ltac h10ind_not_lt_0 := match goal with [H : h10upc_ind ?k 0 0 0 |- _] exfalso; now apply (@h10upc_ind_not_less_0 k H) end.

      Lemma chain_proves a b c d n (f:chain n) :
               h10upc_sem_direct ((a,b),(c,d))
             a < n b < n c < n d < n
             ierel (f a) (f b) (f c) (f d).
      Proof using .
      rewrite h10_equiv.
      intros k; remember k as Habcd eqn:Heq; clear Heq; revert k.
      induction 1 as [a|a b c d b' c' d' ]; intros Ha Hb Hc Hd.
      - apply chain_succ. easy.
      - cbn -[erel] in . specialize (@ (f c) (f b) (f d) (f d') (f c') (f b') (f a)).
        rewrite !ierel_spec' in . cbn in .
        rewrite !chain_zero in *.
        assert (0 < n) as H0n by .
        assert (b' < n) as Hbn by (inversion ; [ | h10ind_not_lt_0]).
        assert (c' < n) as Hcn by (inversion ; [ | h10ind_not_lt_0]).
        assert (d' < n) as Hdn by (rewrite h10_equiv in ; cbn in ; ).
        apply ; eauto.
      Qed.


      Definition rho_descr_chain rho phi n (c:chain n) hv :=
          k, k < hv k = c ( k).

      Lemma translate_rec_correct hv hn (cc:chain hn) (h:list h10upc) phi f rho' :
                f
             ( k, In k h h10upc_sem k)
             highest_var_list h < hv
             highest_num hv < hn
             rho_descr_chain cc hv
             translate_rec f (S hv) h.
      Proof using D I .
      intros Hf Hsat Hhv Hhn Hc. induction h as [|[[a b][c d]] hr IH] in Hhv,Hsat|-*.
      - cbn. easy.
      - cbn -[erel]. cbn in Hhv. split.
        + rewrite ierel_spec. 2-5:rewrite Hc; [easy|].
          apply chain_proves. 1: eapply (Hsat ((a,b),(c,d))); now left.
          all: match goal with |- ? ?a < ?hn enough ( a highest_num hv) by end.
          all: apply highest_num_descr. all:.
        + apply IH.
          * intros x Hx. apply Hsat. now right.
          * .
      Qed.


      Lemma emplace_exists_spec rho' n i :
        ( f, ( k if k <? n then f (k) else (k-n)) i)
         emplace_exists n i.
      Proof.
      intros [f Hf]. unfold emplace_exists.
      induction n as [|n IH] in ,f,Hf|-*.
      - cbn. eapply sat_ext. 2:exact Hf. intros x. cbn. now rewrite Nat.sub_0_r.
      - cbn. exists (f n). eapply sat_ext. 2:apply (IH (f n .: ) f).
        + intros x. easy.
        + eapply sat_ext. 2:apply Hf. intros x. cbv .
          destruct (x <? n) eqn:Heq, (x <? S n) eqn:HSeq.
          * easy.
          * exfalso. rewrite Nat.ltb_lt in Heq. rewrite Nat.ltb_ge in HSeq. .
          * rewrite Nat.ltb_ge in Heq. rewrite Nat.ltb_lt in HSeq. assert (x = n) as by . rewrite Nat.sub_diag. easy.
          * rewrite Nat.ltb_ge in Heq. rewrite Nat.ltb_ge in HSeq. assert (x-n=S(x-S n)) as by . cbn. easy.
      Qed.


      Lemma translate_constraints_correct :
             translate_constraints ().
      Proof using D Hφ I φ.
      unfold translate_constraints.
      pose (S(highest_var_list )) as hv. fold hv.
      pose (S(highest_num φ hv)) as hn.
      destruct (chain_build hn) as [c].
      apply emplace_exists_spec.
      exists (φ >> c).
      eapply (@translate_rec_correct hv hn c _ φ _ _).
      - cbn. easy.
      - exact Hφ.
      - unfold hv. .
      - unfold hn. .
      - intros m Hm. destruct (m <? hv) eqn:Heq.
        + easy.
        + apply Nat.ltb_ge in Heq. .
      Qed.

    End withAxioms.
To conclude, we can wrap the axioms around it.
    Lemma F_correct rho : H10UPC_SAT F.
    Proof.
      introsHφ] z . eapply translate_constraints_correct.
      - exact Hφ.
      - exact .
      - exact .
      - exact .
    Qed.

  End Transport.

If h10 has a solution, F is valid:
  Lemma transport : H10UPC_SAT valid F.
  Proof.
    intros H M I . now apply F_correct.
  Qed.


sat things
  Lemma sat1 : (complement satis (¬ F)) complement (complement H10UPC_SAT) .
  Proof.
    intros . apply . exists dom, IB, ( b Num 0). intros H.
    apply . eapply IB_fulfills. exact H.
  Qed.

  Lemma sat2 : complement (complement H10UPC_SAT) (complement satis (¬ F)).
  Proof.
    intros [D [I [ H]]]. apply . intros .
    apply H. fold sat. eapply F_correct. exact .
  Qed.


sat things 2
  Lemma sat3 : (complement (complement satis) (¬ F)) complement H10UPC_SAT .
  Proof.
    intros . apply .
    intros [D [I [ H]]]. apply H. fold sat.
    apply F_correct. easy.
  Qed.

  Lemma sat4 : complement H10UPC_SAT (complement (complement satis) (¬ F)).
  Proof.
    intros . apply . exists dom, IB, ( b Num 0). intros H.
    apply . eapply IB_fulfills. exact H.
  Qed.


sat things 3
  Lemma sat5 : satis (¬ F) complement H10UPC_SAT .
  Proof.
    intros [D [I [ H]]] Hc. apply H. fold sat.
    apply F_correct. easy.
  Qed.

  Lemma sat6 : complement H10UPC_SAT satis (¬ F).
  Proof.
    intros . exists dom, IB, ( b Num 0). intros H.
    apply . eapply IB_fulfills. exact H.
  Qed.


End validity.

Lemma fullFragValidReduction : H10UPC_SAT (valid (ff := falsity_on)).
Proof.
exists @F. split.
- apply transport.
- apply inverseTransport.
Qed.


Lemma fullFragSatisReduction : complement H10UPC_SAT (satis (ff := falsity_on)).
Proof.
exists ( k ¬ (@F k)). split.
- intros H. eapply sat6. easy.
- intros H. eapply sat5. easy.
Qed.