1-- A zero factor kills a finite product; a zero row kills a determinant (ZF).2-- Part of Cumulus, the Grace17 mathematics library.3-- Copyright (c) 2026 Grant Passmore.4-- Released under the Apache License 2.0. See LICENSE in the repository root.5-- Authors: Grant Passmore67module Grace.Cumulus.Algebra.Ring.DeterminantZero8import Determinant9import FiniteLinearity1011section Products12variable (V A add zero neg mul one w x : Set)13notationring R := (A, add, zero, neg, mul, one)14hypothesisring : IsCommRing(R)15hypothesis finite : Finite(V)16hypothesis weights : w : V → A17hypothesis member : x ∈ V18hypothesis vanishes : w(x) = R[0]1920theorem finiteRingProduct.zero_of_factor21shows finiteRingProduct(V, A, add, zero, neg, mul, one, w) = R[0]22proof23have subset : V ∖ {x} ⊆ V bysimp [Subset, difference.membership]24have smaller := Finite.subset with finite, subset25have restricted := restrict.domain_function at w, V, A, V ∖ {x} with*26have rest := finiteRingProduct.closed at V ∖ {x}, A, add, zero, neg, mul, one, restrict(w, V ∖ {x}) with*27have equation := finiteRingProduct.remove at V, A, add, zero, neg, mul, one, w, x with*28rw [equation, vanishes]29ring3031end Products3233section Determinants34variable (A add zero neg mul one M : Set)35notationring R := (A, add, zero, neg, mul, one)36hypothesisring : IsCommRing(R)3738theorem determinant.zero_row (n : Nat) (i : Set)39requires matrix : RingMatrix(n, R, M)40requires row : i ∈ n41requires vanishes : ∀ j ∈ n, M[i, j] = R[0]42shows determinant(n, R, M) = R[0]43proof44have finite := Finite.natural with*45have permutationsFinite := permutations.finite with finite46have weights := determinantTerms.function at n, A, add, zero, neg, mul, one, M with*47have zeroTerms : ∀ p ∈ permutations(n), determinantTerms(n, A, add, zero, neg, mul, one, M)(p) = R[0]48intros p hp49have permutation := permutations.mem_iff.forward with hp50have injective := Bijective.injective with permutation51have function := Injective.function with injective52have column := FunctionBetween.apply_closed with function, row53have entry := vanishes with p(i), column54have entries := permutationEntries.function at n, A, M, p with*55have value := permutationEntries.value at n, A, M, p, i with*56have zeroEntry : permutationEntries(n, A, M, p)(i) = R[0] by rwa value57have product := finiteRingProduct.zero_of_factor at n, A, add, zero, neg, mul, one, permutationEntries(n, A, M, p), i with*58have sign := permutationSign.closed at A, add, zero, neg, mul, one, n, p with*59have term := determinantTerms.value at n, A, add, zero, neg, mul, one, M, p with*60rw [term, product]61ring62unfold determinant63exact finiteRingSum.zero withring, permutationsFinite, weights, zeroTerms6465end Determinants66