Zulip Chat Archive

Stream: Is there code for X?

Topic: piAntidiag congruence


Ralf Stephan (Aug 24 2024 at 15:25):

Is the following true? If so, is there a congruence lemma to prove it?

import Mathlib
set_option autoImplicit false

open Nat Finset

example (n : ) (t₁ t₂ : Type) [DecidableEq t₁] [DecidableEq t₂] (S : Finset t₁) (T : Finset t₂)
    (h : S.card = T.card) : (S.piAntidiag n).card = (T.piAntidiag n).card := by
  sorry

Ralf Stephan (Aug 24 2024 at 15:33):

For example, does this hold?

((range 2).piAntidiag n).card = ({true, false}.piAntidiag n).card

Daniel Weber (Aug 24 2024 at 15:56):

I believe it should be true, yes. To prove this you can apply docs#Finset.equivOfCardEq to h and then use docs#Finset.card_bij and explicitly give a bijection, or you could prove (S.piAntidiag n).card = (S.card + n - 1).choose n

Daniel Weber (Aug 24 2024 at 15:57):

I think I already saw stars and bars in Lean somewhere, but I can't remember where

Daniel Weber (Aug 24 2024 at 16:00):

I found #11380. @Yaël Dillies , did you PR Cut.lean?

Yaël Dillies (Aug 24 2024 at 16:02):

Given that the file doesn't exist in APAP anymore, yes I must have

Yaël Dillies (Aug 24 2024 at 16:04):

Stars and bars in Mathlib is stated using docs#Sym

Ralf Stephan (Aug 24 2024 at 16:07):

Thanks!


Last updated: May 02 2025 at 03:31 UTC