l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem independent_ne_bot_iff_independent :
    Independent (fun i : {i // t i ≠ ⊥} ↦ t i) ↔ Independent t := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.comp Subtype.val_injective⟩
  simp only [independent_def] at h ⊢
  intro i
  cases eq_or_ne (t i) ⊥ with
  | inl hi => simp [hi]
  | inr hi => ?_
  

Proof state:
case inr
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
h : ∀ (i : { i // t i ≠ ⊥ }), Disjoint (t ↑i) (⨆ j, ⨆ (_ : j ≠ i), t ↑j)
i : ι
hi : t i ≠ ⊥
⊢ Disjoint (t i) (⨆ j, ⨆ (_ : j ≠ i), t j)

Next tactic:
convert h ⟨i, hi⟩
@[simp]
theorem independent_ne_bot_iff_independent :
    Independent (fun i : {i // t i ≠ ⊥} ↦ t i) ↔ Independent t := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.comp Subtype.val_injective⟩
  simp only [independent_def] at h ⊢
  intro i
  cases eq_or_ne (t i) ⊥ with
  | inl hi => simp [hi]
  | inr hi => ?_
  convert h ⟨i, hi⟩
  

Proof state:
case h.e'_5
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
h : ∀ (i : { i // t i ≠ ⊥ }), Disjoint (t ↑i) (⨆ j, ⨆ (_ : j ≠ i), t ↑j)
i : ι
hi : t i ≠ ⊥
⊢ ⨆ j, ⨆ (_ : j ≠ i), t j = ⨆ j, ⨆ (_ : j ≠ { val := i, property := hi }), t ↑j

Next tactic:
have : ∀ j, ⨆ (_ : t j = ⊥), t j = ⊥ := fun j ↦ by simp only [iSup_eq_bot, imp_self]
@[simp]
theorem independent_ne_bot_iff_independent :
    Independent (fun i : {i // t i ≠ ⊥} ↦ t i) ↔ Independent t := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.comp Subtype.val_injective⟩
  simp only [independent_def] at h ⊢
  intro i
  cases eq_or_ne (t i) ⊥ with
  | inl hi => simp [hi]
  | inr hi => ?_
  convert h ⟨i, hi⟩
  have : ∀ j, ⨆ (_ : t j = ⊥), t j = ⊥ := fun j ↦ by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
h : ∀ (i : { i // t i ≠ ⊥ }), Disjoint (t ↑i) (⨆ j, ⨆ (_ : j ≠ i), t ↑j)
i : ι
hi : t i ≠ ⊥
j : ι
⊢ ⨆ (_ : t j = ⊥), t j = ⊥

Next tactic:
simp only [iSup_eq_bot, imp_self]
@[simp]
theorem independent_ne_bot_iff_independent :
    Independent (fun i : {i // t i ≠ ⊥} ↦ t i) ↔ Independent t := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.comp Subtype.val_injective⟩
  simp only [independent_def] at h ⊢
  intro i
  cases eq_or_ne (t i) ⊥ with
  | inl hi => simp [hi]
  | inr hi => ?_
  convert h ⟨i, hi⟩
  have : ∀ j, ⨆ (_ : t j = ⊥), t j = ⊥ := fun j ↦ by simp only [iSup_eq_bot, imp_self]
  

Proof state:
case h.e'_5
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
h : ∀ (i : { i // t i ≠ ⊥ }), Disjoint (t ↑i) (⨆ j, ⨆ (_ : j ≠ i), t ↑j)
i : ι
hi : t i ≠ ⊥
this : ∀ (j : ι), ⨆ (_ : t j = ⊥), t j = ⊥
⊢ ⨆ j, ⨆ (_ : j ≠ i), t j = ⨆ j, ⨆ (_ : j ≠ { val := i, property := hi }), t ↑j

Next tactic:
rw [iSup_split _ (fun j ↦ t j = ⊥), iSup_subtype]
@[simp]
theorem independent_ne_bot_iff_independent :
    Independent (fun i : {i // t i ≠ ⊥} ↦ t i) ↔ Independent t := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.comp Subtype.val_injective⟩
  simp only [independent_def] at h ⊢
  intro i
  cases eq_or_ne (t i) ⊥ with
  | inl hi => simp [hi]
  | inr hi => ?_
  convert h ⟨i, hi⟩
  have : ∀ j, ⨆ (_ : t j = ⊥), t j = ⊥ := fun j ↦ by simp only [iSup_eq_bot, imp_self]
  rw [iSup_split _ (fun j ↦ t j = ⊥), iSup_subtype]
  

Proof state:
case h.e'_5
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
h : ∀ (i : { i // t i ≠ ⊥ }), Disjoint (t ↑i) (⨆ j, ⨆ (_ : j ≠ i), t ↑j)
i : ι
hi : t i ≠ ⊥
this : ∀ (j : ι), ⨆ (_ : t j = ⊥), t j = ⊥
⊢ (⨆ i_1, ⨆ (_ : t i_1 = ⊥), ⨆ (_ : i_1 ≠ i), t i_1) ⊔ ⨆ i_1, ⨆ (_ : ¬t i_1 = ⊥), ⨆ (_ : i_1 ≠ i), t i_1 =
    ⨆ i_1,
      ⨆ (h : t i_1 ≠ ⊥),
        ⨆ (_ : { val := i_1, property := h } ≠ { val := i, property := hi }), t ↑{ val := i_1, property := h }

Next tactic:
simp only [iSup_comm (ι' := _ ≠ i), this, ne_eq, sup_of_le_right, Subtype.mk.injEq, iSup_bot,
    bot_le]
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
⊢ InjOn t {i | t i ≠ ⊥}

Next tactic:
rintro i _ j (hj : t j ≠ ⊥) h
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
⊢ i = j

Next tactic:
by_contra! contra
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  by_contra! contra
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
contra : i ≠ j
⊢ False

Next tactic:
apply hj
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  by_contra! contra
  apply hj
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
contra : i ≠ j
⊢ t j = ⊥

Next tactic:
suffices t j ≤ ⨆ (k) (_ : k ≠ i), t k by
    replace ht := (ht i).mono_right this
    rwa [h, disjoint_self] at ht
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  by_contra! contra
  apply hj
  suffices t j ≤ ⨆ (k) (_ : k ≠ i), t k by
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
contra : i ≠ j
this : t j ≤ ⨆ k, ⨆ (_ : k ≠ i), t k
⊢ t j = ⊥

Next tactic:
replace ht := (ht i).mono_right this
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  by_contra! contra
  apply hj
  suffices t j ≤ ⨆ (k) (_ : k ≠ i), t k by
    replace ht := (ht i).mono_right this
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
contra : i ≠ j
this : t j ≤ ⨆ k, ⨆ (_ : k ≠ i), t k
ht : Disjoint (t i) (t j)
⊢ t j = ⊥

Next tactic:
rwa [h, disjoint_self] at ht
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  by_contra! contra
  apply hj
  suffices t j ≤ ⨆ (k) (_ : k ≠ i), t k by
    replace ht := (ht i).mono_right this
    rwa [h, disjoint_self] at ht
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
contra : i ≠ j
⊢ t j ≤ ⨆ k, ⨆ (_ : k ≠ i), t k

Next tactic:
replace contra : j ≠ i
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  by_contra! contra
  apply hj
  suffices t j ≤ ⨆ (k) (_ : k ≠ i), t k by
    replace ht := (ht i).mono_right this
    rwa [h, disjoint_self] at ht
  replace contra : j ≠ i
  · 

Proof state:
case contra
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
contra : i ≠ j
⊢ j ≠ i

Next tactic:
exact Ne.symm contra
theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥} := by
  rintro i _ j (hj : t j ≠ ⊥) h
  by_contra! contra
  apply hj
  suffices t j ≤ ⨆ (k) (_ : k ≠ i), t k by
    replace ht := (ht i).mono_right this
    rwa [h, disjoint_self] at ht
  replace contra : j ≠ i
  · exact Ne.symm contra
  -- Porting note: needs explicit `f`
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
i : ι
a✝ : i ∈ {i | t i ≠ ⊥}
j : ι
hj : t j ≠ ⊥
h : t i = t j
contra : j ≠ i
⊢ t j ≤ ⨆ k, ⨆ (_ : k ≠ i), t k

Next tactic:
exact @le_iSup₂ _ _ _ _ (fun x _ => t x) j contra
theorem Independent.injective (ht : Independent t) (h_ne_bot : ∀ i, t i ≠ ⊥) : Injective t := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
h_ne_bot : ∀ (i : ι), t i ≠ ⊥
⊢ Injective t

Next tactic:
suffices univ = {i | t i ≠ ⊥} by rw [injective_iff_injOn_univ, this]; exact ht.injOn
theorem Independent.injective (ht : Independent t) (h_ne_bot : ∀ i, t i ≠ ⊥) : Injective t := by
  suffices univ = {i | t i ≠ ⊥} by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
h_ne_bot : ∀ (i : ι), t i ≠ ⊥
this : univ = {i | t i ≠ ⊥}
⊢ Injective t

Next tactic:
rw [injective_iff_injOn_univ, this]
theorem Independent.injective (ht : Independent t) (h_ne_bot : ∀ i, t i ≠ ⊥) : Injective t := by
  suffices univ = {i | t i ≠ ⊥} by rw [injective_iff_injOn_univ, this]; 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
h_ne_bot : ∀ (i : ι), t i ≠ ⊥
this : univ = {i | t i ≠ ⊥}
⊢ InjOn t {i | t i ≠ ⊥}

Next tactic:
exact ht.injOn
theorem Independent.injective (ht : Independent t) (h_ne_bot : ∀ i, t i ≠ ⊥) : Injective t := by
  suffices univ = {i | t i ≠ ⊥} by rw [injective_iff_injOn_univ, this]; exact ht.injOn
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht✝ ht : Independent t
h_ne_bot : ∀ (i : ι), t i ≠ ⊥
⊢ univ = {i | t i ≠ ⊥}

Next tactic:
aesop
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
i j : ι
hij : i ≠ j
huniv : ∀ (k : ι), k = i ∨ k = j
⊢ Independent t ↔ Disjoint (t i) (t j)

Next tactic:
constructor
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  constructor
  · 

Proof state:
case mp
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
i j : ι
hij : i ≠ j
huniv : ∀ (k : ι), k = i ∨ k = j
⊢ Independent t → Disjoint (t i) (t j)

Next tactic:
exact fun h => h.pairwiseDisjoint hij
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  constructor
  · exact fun h => h.pairwiseDisjoint hij
  · 

Proof state:
case mpr
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
i j : ι
hij : i ≠ j
huniv : ∀ (k : ι), k = i ∨ k = j
⊢ Disjoint (t i) (t j) → Independent t

Next tactic:
rintro h k
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  constructor
  · exact fun h => h.pairwiseDisjoint hij
  · rintro h k
    

Proof state:
case mpr
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
i j : ι
hij : i ≠ j
huniv : ∀ (k : ι), k = i ∨ k = j
h : Disjoint (t i) (t j)
k : ι
⊢ Disjoint (t k) (⨆ j, ⨆ (_ : j ≠ k), t j)

Next tactic:
obtain rfl | rfl := huniv k
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  constructor
  · exact fun h => h.pairwiseDisjoint hij
  · rintro h k
    obtain rfl | rfl := huniv k
    · 

Proof state:
case mpr.inl
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
j k : ι
hij : k ≠ j
huniv : ∀ (k_1 : ι), k_1 = k ∨ k_1 = j
h : Disjoint (t k) (t j)
⊢ Disjoint (t k) (⨆ j, ⨆ (_ : j ≠ k), t j)

Next tactic:
refine' h.mono_right (iSup_le fun i => iSup_le fun hi => Eq.le _)
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  constructor
  · exact fun h => h.pairwiseDisjoint hij
  · rintro h k
    obtain rfl | rfl := huniv k
    · refine' h.mono_right (iSup_le fun i => iSup_le fun hi => Eq.le _)
      

Proof state:
case mpr.inl
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
j k : ι
hij : k ≠ j
huniv : ∀ (k_1 : ι), k_1 = k ∨ k_1 = j
h : Disjoint (t k) (t j)
i : ι
hi : i ≠ k
⊢ t i = t j

Next tactic:
rw [(huniv i).resolve_left hi]
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  constructor
  · exact fun h => h.pairwiseDisjoint hij
  · rintro h k
    obtain rfl | rfl := huniv k
    · refine' h.mono_right (iSup_le fun i => iSup_le fun hi => Eq.le _)
      rw [(huniv i).resolve_left hi]
    · 

Proof state:
case mpr.inr
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
i k : ι
hij : i ≠ k
huniv : ∀ (k_1 : ι), k_1 = i ∨ k_1 = k
h : Disjoint (t i) (t k)
⊢ Disjoint (t k) (⨆ j, ⨆ (_ : j ≠ k), t j)

Next tactic:
refine' h.symm.mono_right (iSup_le fun j => iSup_le fun hj => Eq.le _)
theorem independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j) :
    Independent t ↔ Disjoint (t i) (t j) := by
  constructor
  · exact fun h => h.pairwiseDisjoint hij
  · rintro h k
    obtain rfl | rfl := huniv k
    · refine' h.mono_right (iSup_le fun i => iSup_le fun hi => Eq.le _)
      rw [(huniv i).resolve_left hi]
    · refine' h.symm.mono_right (iSup_le fun j => iSup_le fun hj => Eq.le _)
      

Proof state:
case mpr.inr
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Set α
hs : SetIndependent s
t : ι → α
ht : Independent t
i k : ι
hij : i ≠ k
huniv : ∀ (k_1 : ι), k_1 = i ∨ k_1 = k
h : Disjoint (t i) (t k)
j : ι
hj : j ≠ k
⊢ t j = t i

Next tactic:
rw [(huniv j).resolve_right hj]
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
⊢ Independent (f ∘ Subtype.val) ↔ Finset.SupIndep s f

Next tactic:
classical
    rw [Finset.supIndep_iff_disjoint_erase]
    refine' Subtype.forall.trans (forall₂_congr fun a b => _)
    rw [Finset.sup_eq_iSup]
    congr! 1
    refine' iSup_subtype.trans _
    congr! 1
    simp [iSup_and, @iSup_comm _ (_ ∈ s)]
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  classical
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
⊢ Independent (f ∘ Subtype.val) ↔ Finset.SupIndep s f

Next tactic:
rw [Finset.supIndep_iff_disjoint_erase]
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  classical
    rw [Finset.supIndep_iff_disjoint_erase]
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
⊢ Independent (f ∘ Subtype.val) ↔ ∀ i ∈ s, Disjoint (f i) (Finset.sup (Finset.erase s i) f)

Next tactic:
refine' Subtype.forall.trans (forall₂_congr fun a b => _)
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  classical
    rw [Finset.supIndep_iff_disjoint_erase]
    refine' Subtype.forall.trans (forall₂_congr fun a b => _)
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
a : ι
b : a ∈ s
⊢ Disjoint ((f ∘ Subtype.val) { val := a, property := b })
      (⨆ j, ⨆ (_ : j ≠ { val := a, property := b }), (f ∘ Subtype.val) j) ↔
    Disjoint (f a) (Finset.sup (Finset.erase s a) f)

Next tactic:
rw [Finset.sup_eq_iSup]
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  classical
    rw [Finset.supIndep_iff_disjoint_erase]
    refine' Subtype.forall.trans (forall₂_congr fun a b => _)
    rw [Finset.sup_eq_iSup]
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
a : ι
b : a ∈ s
⊢ Disjoint ((f ∘ Subtype.val) { val := a, property := b })
      (⨆ j, ⨆ (_ : j ≠ { val := a, property := b }), (f ∘ Subtype.val) j) ↔
    Disjoint (f a) (⨆ a_1 ∈ Finset.erase s a, f a_1)

Next tactic:
congr! 1
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  classical
    rw [Finset.supIndep_iff_disjoint_erase]
    refine' Subtype.forall.trans (forall₂_congr fun a b => _)
    rw [Finset.sup_eq_iSup]
    congr! 1
    

Proof state:
case a.h.e'_5
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
a : ι
b : a ∈ s
⊢ ⨆ j, ⨆ (_ : j ≠ { val := a, property := b }), (f ∘ Subtype.val) j = ⨆ a_1 ∈ Finset.erase s a, f a_1

Next tactic:
refine' iSup_subtype.trans _
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  classical
    rw [Finset.supIndep_iff_disjoint_erase]
    refine' Subtype.forall.trans (forall₂_congr fun a b => _)
    rw [Finset.sup_eq_iSup]
    congr! 1
    refine' iSup_subtype.trans _
    

Proof state:
case a.h.e'_5
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
a : ι
b : a ∈ s
⊢ ⨆ i,
      ⨆ (h : i ∈ s),
        ⨆ (_ : { val := i, property := h } ≠ { val := a, property := b }),
          (f ∘ Subtype.val) { val := i, property := h } =
    ⨆ a_1 ∈ Finset.erase s a, f a_1

Next tactic:
congr! 1
theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f := by
  classical
    rw [Finset.supIndep_iff_disjoint_erase]
    refine' Subtype.forall.trans (forall₂_congr fun a b => _)
    rw [Finset.sup_eq_iSup]
    congr! 1
    refine' iSup_subtype.trans _
    congr! 1
    

Proof state:
case a.h.e'_5.h.e'_4
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝ : CompleteLattice α
s : Finset ι
f : ι → α
a : ι
b : a ∈ s
⊢ (fun i =>
      ⨆ (h : i ∈ s),
        ⨆ (_ : { val := i, property := h } ≠ { val := a, property := b }),
          (f ∘ Subtype.val) { val := i, property := h }) =
    fun a_1 => ⨆ (_ : a_1 ∈ Finset.erase s a), f a_1

Next tactic:
simp [iSup_and, @iSup_comm _ (_ ∈ s)]
/-- A variant of `CompleteLattice.independent_iff_supIndep` for `Fintype`s. -/
theorem CompleteLattice.independent_iff_supIndep_univ [CompleteLattice α] [Fintype ι] {f : ι → α} :
    CompleteLattice.Independent f ↔ Finset.univ.SupIndep f := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝¹ : CompleteLattice α
inst✝ : Fintype ι
f : ι → α
⊢ Independent f ↔ Finset.SupIndep Finset.univ f

Next tactic:
classical
    simp [Finset.supIndep_iff_disjoint_erase, CompleteLattice.Independent, Finset.sup_eq_iSup]
/-- A variant of `CompleteLattice.independent_iff_supIndep` for `Fintype`s. -/
theorem CompleteLattice.independent_iff_supIndep_univ [CompleteLattice α] [Fintype ι] {f : ι → α} :
    CompleteLattice.Independent f ↔ Finset.univ.SupIndep f := by
  classical
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
ι' : Type u_4
inst✝¹ : CompleteLattice α
inst✝ : Fintype ι
f : ι → α
⊢ Independent f ↔ Finset.SupIndep Finset.univ f

Next tactic:
simp [Finset.supIndep_iff_disjoint_erase, CompleteLattice.Independent, Finset.sup_eq_iSup]
/-- The 0th differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `A → Fun(G, A)`. It sends `(a, g) ↦ ρ_A(g)(a) - a.` -/
@[simps]
def dZero : A →ₗ[k] G → A where
  toFun m g := A.ρ g m - m
  map_add' x y := funext fun g => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x y : CoeSort.coe A
g : G
⊢ (fun m g => ((Rep.ρ A) g) m - m) (x + y) g =
    ((fun m g => ((Rep.ρ A) g) m - m) x + (fun m g => ((Rep.ρ A) g) m - m) y) g

Next tactic:
simp only [map_add, add_sub_add_comm]
/-- The 0th differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `A → Fun(G, A)`. It sends `(a, g) ↦ ρ_A(g)(a) - a.` -/
@[simps]
def dZero : A →ₗ[k] G → A where
  toFun m g := A.ρ g m - m
  map_add' x y := funext fun g => by simp only [map_add, add_sub_add_comm]; 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x y : CoeSort.coe A
g : G
⊢ ((Rep.ρ A) g) x - x + (((Rep.ρ A) g) y - y) = ((fun g => ((Rep.ρ A) g) x - x) + fun g => ((Rep.ρ A) g) y - y) g

Next tactic:
rfl
/-- The 0th differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `A → Fun(G, A)`. It sends `(a, g) ↦ ρ_A(g)(a) - a.` -/
@[simps]
def dZero : A →ₗ[k] G → A where
  toFun m g := A.ρ g m - m
  map_add' x y := funext fun g => by simp only [map_add, add_sub_add_comm]; rfl
  map_smul' r x := funext fun g => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
r : k
x : CoeSort.coe A
g : G
⊢ AddHom.toFun
      { toFun := fun m g => ((Rep.ρ A) g) m - m,
        map_add' :=
          (_ :
            ∀ (x y : CoeSort.coe A),
              (fun m g => ((Rep.ρ A) g) m - m) (x + y) =
                (fun m g => ((Rep.ρ A) g) m - m) x + (fun m g => ((Rep.ρ A) g) m - m) y) }
      (r • x) g =
    ((RingHom.id k) r •
        AddHom.toFun
          { toFun := fun m g => ((Rep.ρ A) g) m - m,
            map_add' :=
              (_ :
                ∀ (x y : CoeSort.coe A),
                  (fun m g => ((Rep.ρ A) g) m - m) (x + y) =
                    (fun m g => ((Rep.ρ A) g) m - m) x + (fun m g => ((Rep.ρ A) g) m - m) y) }
          x)
      g

Next tactic:
dsimp
/-- The 0th differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `A → Fun(G, A)`. It sends `(a, g) ↦ ρ_A(g)(a) - a.` -/
@[simps]
def dZero : A →ₗ[k] G → A where
  toFun m g := A.ρ g m - m
  map_add' x y := funext fun g => by simp only [map_add, add_sub_add_comm]; rfl
  map_smul' r x := funext fun g => by dsimp; 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
r : k
x : CoeSort.coe A
g : G
⊢ ((Rep.ρ A) g) (r • x) - r • x = r • (((Rep.ρ A) g) x - x)

Next tactic:
rw [map_smul, smul_sub]
theorem dZero_ker_eq_invariants : LinearMap.ker (dZero A) = invariants A.ρ := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
⊢ LinearMap.ker (dZero A) = invariants (Rep.ρ A)

Next tactic:
ext x
theorem dZero_ker_eq_invariants : LinearMap.ker (dZero A) = invariants A.ρ := by
  ext x
  

Proof state:
case h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : CoeSort.coe A
⊢ x ∈ LinearMap.ker (dZero A) ↔ x ∈ invariants (Rep.ρ A)

Next tactic:
simp only [LinearMap.mem_ker, mem_invariants, ← @sub_eq_zero _ _ _ x, Function.funext_iff]