Section RepresentableExpressible.
Variable T : System.
Hypothesis closedT1: (ClosedSystem LNN T).
Fixpoint RepresentableHalf1 (n : nat) : naryFunc n -> Formula -> Prop :=
match n return (naryFunc n -> Formula -> Prop) with
| O =>
fun (f : naryFunc 0) (A : Formula) =>
SysPrf T (impH A (equal (var 0) (natToTerm f)))
| S m =>
fun (f : naryFunc (S m)) (A : Formula) =>
forall a : nat,
RepresentableHalf1 m (f a)
(substituteFormula LNN A (S m) (natToTerm a))
end.
Fixpoint RepresentableHalf2 (n : nat) : naryFunc n -> Formula -> Prop :=
match n return (naryFunc n -> Formula -> Prop) with
| O =>
fun (f : naryFunc 0) (A : Formula) =>
SysPrf T (impH (equal (var 0) (natToTerm f)) A)
| S m =>
fun (f : naryFunc (S m)) (A : Formula) =>
forall a : nat,
RepresentableHalf2 m (f a)
(substituteFormula LNN A (S m) (natToTerm a))
end.
Fixpoint RepresentableHelp (n : nat) : naryFunc n -> Formula -> Prop :=
match n return (naryFunc n -> Formula -> Prop) with
| O =>
fun (f : naryFunc 0) (A : Formula) =>
SysPrf T (iffH A (equal (var 0) (natToTerm f)))
| S m =>
fun (f : naryFunc (S m)) (A : Formula) =>
forall a : nat,
RepresentableHelp m (f a) (substituteFormula LNN A (S m) (natToTerm a))
end.
Definition Representable (n : nat) (f : naryFunc n)
(A : Formula) : Prop :=
(forall v : nat, In v (freeVarFormula LNN A) -> v <= n) /\
RepresentableHelp n f A.
Fixpoint ExpressibleHelp (n : nat) : naryRel n -> Formula -> Prop :=
match n return (naryRel n -> Formula -> Prop) with
| O =>
fun (R : naryRel 0) (A : Formula) =>
match R with
| true => SysPrf T A
| false => SysPrf T (notH A)
end
| S m =>
fun (R : naryRel (S m)) (A : Formula) =>
forall a : nat,
ExpressibleHelp m (R a) (substituteFormula LNN A (S m) (natToTerm a))
end.
Definition Expressible (n : nat) (R : naryRel n) (A : Formula) : Prop :=
(forall v : nat, In v (freeVarFormula LNN A) -> v <= n /\ v <> 0) /\
ExpressibleHelp n R A.
Hypothesis nn1:(SysPrf T (notH (equal (natToTerm 1) (natToTerm 0)))).

Lemma Representable2Expressible :
forall (n : nat) (R : naryRel n) (A : Formula),
Representable n (charFunction n R) A ->
Expressible n R (substituteFormula LNN A 0 (natToTerm 1)).