Theorem: Multiset.Nodup.pi
File: Mathlib/Data/Multiset/Pi.lean

tactic: intro a s ih hs ht
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s : Multiset α
t : (a : α) → Multiset (β a)
⊢ ∀ ⦃a : α⦄ {s : Multiset α},
    (Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)) →
      Nodup (a ::ₘ s) → (∀ (a_3 : α), a_3 ∈ a ::ₘ s → Nodup (t a_3)) → Nodup (pi (a ::ₘ s) t)

tactic: have has : a ∉ s := by simp at hs; exact hs.1
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
⊢ Nodup (pi (a ::ₘ s) t)

tactic: have hs : Nodup s := by simp at hs; exact hs.2
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
⊢ Nodup (pi (a ::ₘ s) t)

tactic: simp
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs✝ : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
hs : Nodup s
⊢ Nodup (pi (a ::ₘ s) t)

tactic: refine'
  ⟨fun b _ => ((ih hs) fun a' h' => ht a' <| mem_cons_of_mem h').map (Pi.cons_injective has),
    _⟩
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs✝ : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
hs : Nodup s
⊢ (∀ (a_1 : β a), a_1 ∈ t a → Nodup (Multiset.map (Pi.cons s a a_1) (pi s t))) ∧
    Pairwise (fun a_1 b => Disjoint (Multiset.map (Pi.cons s a a_1) (pi s t)) (Multiset.map (Pi.cons s a b) (pi s t)))
      (t a)

tactic: refine' (ht a <| mem_cons_self _ _).pairwise _
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs✝ : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
hs : Nodup s
⊢ Pairwise (fun a_1 b => Disjoint (Multiset.map (Pi.cons s a a_1) (pi s t)) (Multiset.map (Pi.cons s a b) (pi s t)))
    (t a)

tactic: exact fun b₁ _ b₂ _ neb =>
  disjoint_map_map.2 fun f _ g _ eq =>
    have : Pi.cons s a b₁ f a (mem_cons_self _ _) = Pi.cons s a b₂ g a (mem_cons_self _ _) :=
      by rw [eq]
    neb <| show b₁ = b₂ by rwa [Pi.cons_same, Pi.cons_same] at this
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs✝ : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
hs : Nodup s
⊢ ∀ (a_1 : β a),
    a_1 ∈ t a →
      ∀ (b : β a),
        b ∈ t a → a_1 ≠ b → Disjoint (Multiset.map (Pi.cons s a a_1) (pi s t)) (Multiset.map (Pi.cons s a b) (pi s t))

tactic: simp at hs
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
⊢ ¬a ∈ s

tactic: exact hs.1
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
hs : ¬a ∈ s ∧ Nodup s
⊢ ¬a ∈ s

tactic: simp at hs
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
⊢ Nodup s

tactic: exact hs.2
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
hs : ¬a ∈ s ∧ Nodup s
⊢ Nodup s

tactic: rw [eq]
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs✝ : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
hs : Nodup s
b₁ : β a
x✝³ : b₁ ∈ t a
b₂ : β a
x✝² : b₂ ∈ t a
neb : b₁ ≠ b₂
f : (a : α) → a ∈ s → β a
x✝¹ : f ∈ pi s t
g : (a : α) → a ∈ s → β a
x✝ : g ∈ pi s t
eq : Pi.cons s a b₁ f = Pi.cons s a b₂ g
⊢ Pi.cons s a b₁ f a (_ : a ∈ a ::ₘ s) = Pi.cons s a b₂ g a (_ : a ∈ a ::ₘ s)

tactic: rwa [Pi.cons_same, Pi.cons_same] at this
state_before: α : Type u_1
inst✝ : DecidableEq α
β : α → Type u
δ : α → Sort v
s✝ : Multiset α
t : (a : α) → Multiset (β a)
a : α
s : Multiset α
ih : Nodup s → (∀ (a : α), a ∈ s → Nodup (t a)) → Nodup (pi s t)
hs✝ : Nodup (a ::ₘ s)
ht : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → Nodup (t a_1)
has : ¬a ∈ s
hs : Nodup s
b₁ : β a
x✝³ : b₁ ∈ t a
b₂ : β a
x✝² : b₂ ∈ t a
neb : b₁ ≠ b₂
f : (a : α) → a ∈ s → β a
x✝¹ : f ∈ pi s t
g : (a : α) → a ∈ s → β a
x✝ : g ∈ pi s t
eq : Pi.cons s a b₁ f = Pi.cons s a b₂ g
this : Pi.cons s a b₁ f a (_ : a ∈ a ::ₘ s) = Pi.cons s a b₂ g a (_ : a ∈ a ::ₘ s)
⊢ b₁ = b₂