Permutation Images of Finsets #
This file provides shared definitions and lemmas for working with the image of a finset under a permutation.
Main definitions #
PermFinset.imageFinset- The image of a finset under a permutation:P.map ⟨σ, σ.injective⟩PermFinset.permsMapping- The set of permutations that map one finset to another
Main results #
PermFinset.imageFinset_card- The image has the same cardinality as the original setPermFinset.imageFinset_compl- The image of a complement equals the complement of the imagePermFinset.imageFinset_inv- If σ maps P to Q, then σ⁻¹ maps Q to PPermFinset.permsMapping_empty_of_card_ne- If |P| ≠ |Q|, no permutation maps P to Q
Implementation notes #
These definitions are used by:
CauchyBinet.lean(has local aliasesimageFinsetandpermsMapping)DesnanotJacobi.lean(usesPermFinset.imageFinsetandPermFinset.permsMappingdirectly)
New code should use this module.
The image of a finset under a permutation.
Equations
- PermFinset.imageFinset σ P = Finset.map { toFun := ⇑σ, inj' := ⋯ } P
Instances For
The image has the same cardinality as the original set.
The image of a complement equals the complement of the image.
If σ maps P to Q (i.e., σ '' P = Q), then σ⁻¹ maps Q to P.
The set of permutations that map P to Q.
Equations
- PermFinset.permsMapping P Q = {σ : Equiv.Perm (Fin n) | PermFinset.imageFinset σ P = Q}
Instances For
Submatrix Determinant API #
This section provides a unified API for submatrix determinants, bridging the
definitions in CauchyBinet.lean and DesnanotJacobi.lean.
Definitions across the codebase #
There are currently two styles of submatrix determinant definitions:
Proof-requiring version (
AlgebraicCombinatorics.CauchyBinet.submatrixDet): Requires a proofh : P.card = Q.cardas an argument.def submatrixDet A P Q (h : P.card = Q.card) := (A.submatrix (P.orderEmbOfFin rfl) (Q.orderEmbOfFin (h ▸ rfl))).detTotal version (
AlgebraicCombinatorics.Determinants.submatrixDet,AlgebraicCombinatorics.CauchyBinet.minor): Usesif h : P.card = Q.card then ... else 0to handle cardinality mismatch.def submatrixDet A P Q := if h : P.card = Q.card then ... else 0
Equivalence lemmas #
The following lemmas establish equivalence between these definitions:
PermFinset.submatrixDet_of_card_eq: When |P| = |Q|, unfolds to the determinantPermFinset.submatrixDet_eq_proof_version: Relates to the proof-requiring styleAlgebraicCombinatorics.CauchyBinet.submatrixDet_eq_permFinset: CauchyBinet version equals PermFinsetAlgebraicCombinatorics.CauchyBinet.minor_eq_permFinset_submatrixDet: CauchyBinet.minor equals PermFinsetAlgebraicCombinatorics.Determinants.submatrixDet_eq_permFinset: Determinants version equals PermFinset
Migration path #
New code should use PermFinset.submatrixDet (the total version). Existing code
can use the equivalence lemmas above to convert between styles.
The determinant of a submatrix corresponding to row set P and column set Q. Returns 0 if |P| ≠ |Q|.
This is the canonical "total" definition that handles cardinality mismatch gracefully, avoiding the need for proof terms in most applications.
This definition is equivalent to:
CauchyBinet.minor(same signature and semantics)Determinants.submatrixDetin DesnanotJacobi.lean (usesfinsetToFininstead oforderEmbOfFin, but these are equivalent)CauchyBinet.submatrixDetwhen |P| = |Q| (that version requires a proof argument)
Equations
- PermFinset.submatrixDet A P Q = if h : P.card = Q.card then (A.submatrix ⇑(P.orderEmbOfFin ⋯) ⇑(Q.orderEmbOfFin ⋯)).det else 0
Instances For
When |P| = |Q|, the submatrix determinant equals the actual determinant. This lemma bridges the "total" definition with the "proof-requiring" style.
PermFinset.submatrixDet equals the proof-requiring version when |P| = |Q|.
Use this lemma to convert between:
PermFinset.submatrixDet A P Q(total, returns 0 when |P| ≠ |Q|)(A.submatrix (P.orderEmbOfFin rfl) (Q.orderEmbOfFin _)).det(requires proof)
This establishes the equivalence with CauchyBinet.submatrixDet.