Theorem: Groth16TypeI.is_sound
Proof state before:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeI.Stmt
prover : Prover F Groth16TypeI
typeI_identification :
  ∀ pfs ∈ Groth16TypeI.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * Groth16TypeI.SRSElementValue_G1 SRS_elem)
          Groth16TypeI.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * Groth16TypeI.SRSElementValue_G2 SRS_elem)
          Groth16TypeI.ListSRSElements_G2).sum
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeI.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeI.SRSElementValue_G1 SRS_elem)
                          Groth16TypeI.ListSRSElements_G1).sum)
                  Groth16TypeI.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeI.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeI.SRSElementValue_G1 SRS_elem)
                  Groth16TypeI.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeI.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeI.SRSElementValue_G2 SRS_elem)
                          Groth16TypeI.ListSRSElements_G2).sum)
                  Groth16TypeI.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeI.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeI.SRSElementValue_G2 SRS_elem)
                  Groth16TypeI.ListSRSElements_G2).sum))
        (Groth16TypeI.ListPairings ())).sum =
    0
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_Idx.C (SRS_Elements_Idx.q i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) *
            ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_Idx.C (SRS_Elements_Idx.q i)) prover i) * v_wit i)
                  (List.finRange n_wit)).sum) -
          ((List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
            (List.map
                (fun i =>
                  Polynomial.C ((fun prover i => prover.1 Proof_Idx.C (SRS_Elements_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0
Tactic:
simp only [identified_proof_elems_def, Bool.not_eq_true, List.mem_cons, List.mem_singleton,
  forall_eq_or_imp, forall_eq] at typeI_identification
Proof state after:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeI.Stmt
prover : Prover F Groth16TypeI
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeI.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeI.SRSElementValue_G1 SRS_elem)
                          Groth16TypeI.ListSRSElements_G1).sum)
                  Groth16TypeI.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeI.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeI.SRSElementValue_G1 SRS_elem)
                  Groth16TypeI.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeI.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeI.SRSElementValue_G2 SRS_elem)
                          Groth16TypeI.ListSRSElements_G2).sum)
                  Groth16TypeI.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeI.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeI.SRSElementValue_G2 SRS_elem)
                  Groth16TypeI.ListSRSElements_G2).sum))
        (Groth16TypeI.ListPairings ())).sum =
    0
typeI_identification :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.A SRS_elem) * Groth16TypeI.SRSElementValue_G1 SRS_elem)
          Groth16TypeI.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 Proof_Idx.A SRS_elem) * Groth16TypeI.SRSElementValue_G2 SRS_elem)
          Groth16TypeI.ListSRSElements_G2).sum ∧
    (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * Groth16TypeI.SRSElementValue_G1 SRS_elem)
            Groth16TypeI.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * Groth16TypeI.SRSElementValue_G2 SRS_elem)
            Groth16TypeI.ListSRSElements_G2).sum ∧
      (List.map (fun SRS_elem => C (prover.1 Proof_Idx.C SRS_elem) * Groth16TypeI.SRSElementValue_G1 SRS_elem)
              Groth16TypeI.ListSRSElements_G1).sum =
          (List.map (fun SRS_elem => C (prover.2 Proof_Idx.C SRS_elem) * Groth16TypeI.SRSElementValue_G2 SRS_elem)
              Groth16TypeI.ListSRSElements_G2).sum ∧
        ∀ a ∈ [],
          (List.map (fun SRS_elem => C (prover.1 a.1 SRS_elem) * Groth16TypeI.SRSElementValue_G1 SRS_elem)
                Groth16TypeI.ListSRSElements_G1).sum =
            (List.map (fun SRS_elem => C (prover.2 a.2 SRS_elem) * Groth16TypeI.SRSElementValue_G2 SRS_elem)
                Groth16TypeI.ListSRSElements_G2).sum
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_Idx.C (SRS_Elements_Idx.q i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) *
            ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_Idx.C (SRS_Elements_Idx.q i)) prover i) * v_wit i)
                  (List.finRange n_wit)).sum) -
          ((List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
            (List.map
                (fun i =>
                  Polynomial.C ((fun prover i => prover.1 Proof_Idx.C (SRS_Elements_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0