Skip to content

feat(Data/Seq): modify and set operations for Seq#20160

Closed
vasnesterov wants to merge 27 commits intomasterfrom
vasnesterov/Seq_operations
Closed

feat(Data/Seq): modify and set operations for Seq#20160
vasnesterov wants to merge 27 commits intomasterfrom
vasnesterov/Seq_operations

Conversation

@vasnesterov
Copy link
Copy Markdown
Collaborator

@vasnesterov vasnesterov commented Dec 21, 2024

Introduce modify and set operations for sequences, along with a few lemmas about them.


Open in Gitpod

@vasnesterov vasnesterov added the t-data Data (lists, quotients, numbers, etc) label Dec 21, 2024
@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Dec 21, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 21, 2024

messageFile.md

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 21, 2024
@github-actions github-actions bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Jan 18, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 18, 2025

PR summary 2d46e13f91

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ modify
+ modify_cons_succ
+ modify_cons_zero
+ modify_nil
+ set
+ set_cons_succ
+ set_cons_zero
+ set_dropn_stable_of_lt
+ set_get_of_not_terminated
+ set_get_of_terminated
+ set_get_stable
+ set_nil

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 22, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label May 12, 2025
@mathlib4-dependent-issues-bot
Copy link
Copy Markdown
Collaborator

This PR/issue depends on:

@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 12, 2025
Comment on lines +724 to +725
simp [IsSeq, this]
exact @s.prop
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a non-terminal simp, can we write it using simpa instead?

def modify (s : Seq α) (n : ℕ) (f : α → α) : Seq α where
val := Function.update s.val n ((s.val n).map f)
property := by
have (i : ℕ) : (Function.update s.val n ((s.get? n).map f)) i = none ↔ s.get? i = none := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
have (i : ℕ) : (Function.update s.val n ((s.get? n).map f)) i = none ↔ s.get? i = none := by
have (i : ℕ) : Function.update s.val n ((s.get? n).map f) i = none ↔ s.get? i = none := by

I haven't tested this, but it looks like it should work

@vasnesterov
Copy link
Copy Markdown
Collaborator Author

This PR has been migrated to a fork-based workflow: #26120

@YaelDillies YaelDillies deleted the vasnesterov/Seq_operations branch August 18, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migrated-to-fork t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants